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vZygiUkFHIO2MjOydvCgqX2NodW5rcy5qc29uKeydtCDsl4bsirXri4jri6QuIOuovOyggCBjaHVua19hbmRfc3VtbWFyeS5weeulvCDsi6TtlontlbTslbwg7ZWp64uI64ukLiIpDQogICAgICAgIHN5cy5leGl0KDEpDQoNCiAgICBmb3IgZiBpbiByYWdfZmlsZXM6DQogICAgICAgIHRyeToNCiAgICAgICAgICAgIHVuaXRzID0ganNvbi5sb2FkcyhmLnJlYWRfdGV4dChlbmNvZGluZz0idXRmLTgiLCBlcnJvcnM9Imlnbm9yZSIpKQ0KICAgICAgICBleGNlcHQgRXhjZXB0aW9uIGFzIGU6DQogICAgICAgICAgICBsb2coZiJbV0FSTl0gUkFHIO2MjOydvCDsnb3quLAg7Iuk7YyoOiB7Zi5uYW1lfSB8IHtlfSIpDQogICAgICAgICAgICBjb250aW51ZQ0KDQogICAgICAgIGZvciB1IGluIHVuaXRzOg0KICAgICAgICAgICAgc3VtbSA9ICh1LmdldCgic3VtbWFyeSIpIG9yICIiKS5zdHJpcCgpDQogICAgICAgICAgICBzb3VyY2UgPSAodS5nZXQoInNvdXJjZSIpIG9yICIiKS5zdHJpcCgpDQogICAgICAgICAgICBrZXl3b3JkcyA9ICh1LmdldCgia2V5d29yZHMiKSBvciAiIikNCiAgICAgICAgICAgIA0KICAgICAgICAgICAgaWYgc3VtbToNCiAgICAgICAgICAgICAgICAjIOy2nOyymOyZgCDtgqTsm4zrk5wg7Y+s7ZWoDQogICAgICAgICAgICAgICAgZW50cnkgPSBmIlt7c291cmNlfV0ge3N1bW19Ig0KICAgICAgICAgICAgICAgIGlmIGtleXdvcmRzOg0KICAgICAgICAgICAgICAgICAgICBlbnRyeSArPSBmIiAo7YKk7JuM65OcOiB7a2V5d29yZHN9KSINCiAgICAgICAgICAgICAgICBzdW1tYXJpZXMuYXBwZW5kKGVudHJ5KQ0KDQogICAgcmV0dXJuIHN1bW1hcmllcw0KDQoNCmRlZiBjb21wcmVzc19iYXRjaChkb21haW5fcH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