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iANCm1zZykNCnsNCiAgICBTVEFGU3Ry aW5nIHdoZXJlKG1hY2hpbmUpOw0KICAgIFNUQUZTdHJpbmcgc2VydmljZSgiVkFSIik7DQogICAg ICAgICAgICAgICAgIGNoYXIgcmVxW01BWF9QQVRIXSA9IHswfTsNCiAgICAgICAgICAgICAgICAg c3ByaW50ZihyZXEsIkdFVCBTWVNURU0gVkFSICVzIixlbnZuYW1lKTsNCiAgICAgICAgICAgICAg ICAgU1RBRlN0cmluZyByZXF1ZXN0KHJlcSk7DQoNCiAgICAgICAgICAgICAgICAgdW5zaWduZWQg aW50IHJjID0gMDsNCiAgICAgICAgICAgICAgICAgaWYoZ0hhbmRsZSA9PSAwKQ0KICAgICAgICAg ICAgICAgICB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByYyA9IFNUQUZIYW5k bGU6OmNyZWF0ZSgiV0JJbnRlZ3JhdGUiLCANCmdIYW5kbGUpOw0KDQogICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBpZiAocmMgIT0gMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBjb3V0IDw8ICJFcnJvciANCnJlZ2lzdGVyaW5nIHdpdGggU1RBRiwgUkM6ICIgPDwgcmMgPDwg ZW5kbDsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBy ZXR1cm4gcmM7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAg ICAgICAgIH0NCiANCiAgICAgICAgICAgICAgICAgU1RBRlJlc3VsdFB0ciByZXN1bHQgPSBnSGFu ZGxlLT5zdWJtaXQod2hlcmUsIHNlcnZpY2UsIA0KcmVxdWVzdCk7DQogICAgICAgICAgICAgICAg IHJjID0gcmVzdWx0LT5yYzsNCiAgICAgICAgICAgICAgICAgaWYocmMgIT0gMCkNCiAgICAgICAg ICAgICAgICAgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhciBtc2dbTUFY X1BBVEhdID0gezB9Ow0KIHByaW50ZigiRXJyb3I6JXNcbiIsKHJlc3VsdC0+cmVzdWx0KS5idWZm ZXIoKSk7DQogICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgZWxzZQ0KICAgICAg ICAgICAgICAgICB7DQogc3RyY3B5KGVudlZhbHVlLChyZXN1bHQtPnJlc3VsdCkuYnVmZmVyKCkp Ow0KICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQtPnJj Ow0KfQ0KDQppbnQgbWFpbigpDQp7DQogICAgICAgICAgICAgICAgIGNoYXIgZW52VmFsdWVbMTAy NF0gPSB7MH07DQogICAgICAgICAgICAgICAgIGNoYXIgbXNnWzEwMjRdID0gezB9Ow0KICAgICAg ICAgICAgICAgICBpbnQgcmMgPSBnZXRFbnYoIlNUQUYvRW52L3dpbmRpciIsIkxPQ0FMIixlbnZW YWx1ZSxtc2cpOw0KICAgICAgICAgICAgICAgICBwcmludGYoImVudlZhbHVlIGlzICVzXG4iLGVu dlZhbHVlKTsNCiAgICAgICAgICAgICAgICAgcHJpbnRmKG1zZyk7DQogICAgICAgICAgICAgICAg IHJldHVybiAwOw0KfQ0KDQogDQoNClJlZ2FyZHMNCg0KoaGhoaGhoaGhoaGhoaGhoXlhbmcgd2Vu aG9uZw0KoaGhoaGhoaGhoaGhoaGhoXl3aGtpbmdAdG9tLmNvbQ0KoaGhoaGhoaGhoaGhoaGhoaGh oaEyMDA2LTA1LTE0DQoNCg0K |