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k cmVtb3RlX2RhdGEgPSBAY3VybF9leGVjKCRjdXJsKTsKICAgICAgICAgICAgQGN1cmxfY2xvc2Uo JGN1cmwpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGlmIChmdW5jdGlvbl9leGlzdHMo J3N0cmVhbV9jb250ZXh0X2NyZWF0ZScpKSB7CiAgICAgICAgICAgICAgICAkaGVhZGVyX2FycmF5 ID0gYXJyYXkoJ2h0dHAnID0+IGFycmF5KCdtZXRob2QnID0+ICdHRVQnLCAndGltZW91dCcgPT4g MzApKTsKICAgICAgICAgICAgICAgICRodHRwX2hlYWRlciA9IEBzdHJlYW1fY29udGV4dF9jcmVh dGUoJGhlYWRlcl9hcnJheSk7CiAgICAgICAgICAgICAgICAkcmVtb3RlX2RhdGEgPSBAZmlsZV9n ZXRfY29udGVudHMoJHdlYnVybCwgZmFsc2UsICRodHRwX2hlYWRlcik7CiAgICAgICAgICAgIH0g ZWxzZSB7CiAgICAgICAgICAgICAgICAkdGVtcF91cmwgPSBleHBsb2RlKCIvIiwgJHdlYnVybCk7 CiAgICAgICAgICAgICAgICAkbmV3X3VybCA9ICR0ZW1wX3VybFsyXTsKICAgICAgICAgICAgICAg ICRodHRwX3BvcnQgPSA4MDsKICAgICAgICAgICAgICAgICRnZXRfZmlsZSA9IHN1YnN0cigkd2Vi dXJsLCBzdHJsZW4oJG5ld191cmwpICsgNyk7CiAgICAgICAgICAgICAgICBpZiAoc3Ryc3RyKCRu ZXdfdXJsLCBjaHIoNTgpKSkgewogICAgICAgICAgICAgICAgICAgICRzX3Zhcl9hcnJheVsndGQn XSA9IGV4cGxvZGUoY2hyKDU4KSwgJG5ld191cmwpOwogICAgICAgICAgICAgICAgICAgICRuZXdf dXJsID0gJHNfdmFyX2FycmF5Wyd0ZCddWzBdOwogICAgICAgICAgICAgICAgICAgICRodHRwX3Bv cnQgPSAkc192YXJfYXJyYXlbJ3RkJ11bMV07CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAg ICA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