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ZnVuY19fKTsNCisgICAgICAgIHJldHVybjsNCisgICAgfQ0KKyAgICANCisgICAgd2hpbGUoMSl7DQorICAgICAgICByZWFkX2xlbiA9IHJlYWQodm9pY2VfaXBjX2ZkLCByZWN2X3ZvaWNlX252cndfYnVmLCBWT0lDRV9IRUFEX0xFTiArIFZPSUNFX05WUldfTUFYX0xFTik7DQorICAgICAgICBpZiAoMCA+PSByZWFkX2xlbil7DQorICAgICAgICAgICAgc2xlZXAoMSk7DQorCQkJY29udGludWU7DQorCQl9DQorDQorICAgICAgICBwcmludGYoIiVzOiByZWFkX2xlbiA9ICVkLCBmdW5jX2lkID0gJWQsIHBhcmFtX2xlbiA9ICVkIVxuIiwgX19mdW5jX18sIHJlYWRfbGVuLCBcDQorICAgICAgICAqKChpbnQqKXJlY3Zfdm9pY2VfbnZyd19idWYpLCAqKChpbnQqKXJlY3Zfdm9pY2VfbnZyd19idWYgKyAxKSk7DQorICAgICAgICANCisjaWYgMA0KKyAgICAgICAgcHJpbnRmKCIlczogcGFyYW1bMF09JTAyeCxwYXJhbVsxXT0lMDJ4LHBhcmFtWzJdPSUwMngscGFyYW1bM109JTAyeCxwYXJhbVs0XT0lMDJ4LHBhcmFtWzVdPSUwMngscGFyYW1bNl09JTAyeCFcbiIsIFwNCisgICAgICAgICAgICBfX2Z1bmNfXywgcmVjdl92b2ljZV9udnJ3X2J1Zi5wYXJhbVswXSwgcmVjdl92b2ljZV9udnJ3X2J1Zi5wYXJhbVsxXSwgcmVjdl92b2ljZV9udnJ3X2J1Zi5wYXJhbVsyXSwgXA0KKyAgICAgICAgICAgIHJlY3Zfdm9pY2VfbnZyd19idWYucGFyYW1bM10sIHJlY3Zfdm9pY2VfbnZyd19idWYucGFyYW1bNF0sIHJlY3Zfdm9pY2VfbnZyd19idWYucGFyYW1bNV0sIHJlY3Zfdm9pY2VfbnZyd19idWYucGFyYW1bNl0pOw0KKyAgICAgICAgDQorICAgICAgICBpbnQgd3JpdGVzaXplID0gMDsNCisgICA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AgIA0KKyAgICAgICAgYnJlYWs7DQorICAgIH0NCisNCisgICAgaWYocmVjdl92b2ljZV9udnJ3X2J1Zil7DQorICAgICAgICBmcmVlKHJlY3Zfdm9pY2VfbnZyd19idWYpOw0KKyAgICAgICAgcmVjdl92b2ljZV9udnJ3X2J1ZiA9IE5VTEw7DQorICAgIH0NCisgICAgDQorICAgIHJldHVybjsNCit9DQorDQogaW50IG1haW4oaW50IGFyZ2MsIGNoYXIgKiphcmd2KQ0KIHsNCiAgICAgaW50IHJldCA9IDA7DQpAQCAtNzA3LDcgKzc3MSwxMSBAQAogCQlwcmludGYoInJlY3ZfY2FwX3ZvaWNlX2Fsc2EgY3JlYXRlIGVycm9yIVxuIik7DQogCX0NCiANCi0gICAgc2xlZXAoNCk7DQorICAgIHNsZWVwKDQpOyAvL7XItP1jYXCy4NL0xrW6y7zkzai1wL2owaLN6rPJDQorDQorICAgIC8vaXBjs/XKvLuvuvOjrNaxvdO78cihY2FwsuB2b2ljZSBudg0KKyAgICByZWN2X3VwZGF0ZV92b2ljZV9udnJ3X2lwYygpOw0KKyAgICANCiAgICAgVm9pY2VfQ3RybF9ScG1zZ19SZWN2KCk7DQogICAgIA0KICAgICByZXR1cm4gMDsNCg==