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OKWiOKWiOKWiOKWiOKWhCAgIOKWhOKWiOKWiOKWiOKWiOKWiOKWiOKWhCAgIOKWhOKWiCAgICAgICAKICDilojilojiloggICAg4paI4paI4paIICAgICDilojilojiloggICAg4paI4paI4paIIOKWiOKWiOKWiCAgICDilojilojiloggICDilojilojilogg4paE4paI4paI4paI4paAIOKWiOKWiOKWiCAg4paI4paI4paI4paA4paA4paA4paI4paI4paEICAg4paI4paI4paIICAgIOKWiOKWiOKWiCAgICAgIOKWgOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWhCDilojilojiloggICAg4paI4paI4paIIOKWiOKWiOKWiCAgICDilojilojilogg4paI4paI4paIICAgICAgIAogIOKWiOKWiOKWiCAgICDilojilojiloggICAgIOKWiOKWiOKWiCAgICDilojilojilogg4paI4paI4paIICAgIOKWiOKWgCAgICDilojilojilojilpDilojilojiloAgICDilojilojilojilowg4paI4paI4paIICAg4paI4paI4paIICAg4paI4paI4paIICAgIOKWiOKWgCAgICAgICAgICDiloDilojilojilojiloDiloDilojilogg4paI4paI4paIICAgIOKWiOKWiOKWiCDilojilojiloggICAg4paI4paI4paIIOKWiOKWiOKWiCAgICAgICAKIOKWhOKWiOKWiOKWiOKWhOKWhOKWhOKWhOKWiOKWiOKWiOKWhOKWhCAgIOKWiOKWiOKWiCAgICDilojilojilogg4paI4paI4paIICAgICAgICAg4paE4paI4paI4paI4paI4paI4paAICAgIOKWiOKWiOKWiOKWjCDilojilojiloggICDilojilojiloggIOKWhOKWiOKWiOKWiCAgICAgICAgICAgICAgICAg4paI4paI4paIICAg4paAIOKWiOKWiOKWiCAgICDilojilojilogg4paI4paI4paIICAgIOKWiOKWiOKWiCDilojilojiloggICAgICAgCuKWgOKWgOKWiOKWiOKWiOKWgOKWgOKWgOKWgOKWiOKWiOKWiOKWgCAg4paA4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paIIOKWiOKWiOKWiCAgICAgICAg4paA4paA4paI4paI4paI4paI4paI4paEICAgIOKWiOKWiOKWiOKWjCDilojilojiloggICDilojilojilogg4paA4paA4paI4paI4paIIOKWiOKWiOKWiOKWiOKWhCAgICAgICAgICAg4paI4paI4paIICAgICDilojilojiloggICAg4paI4paI4paIIOKWiOKWiOKWiCAgICDilojilojilogg4paI4paI4paIICAgICAgIAogIOKWiOKWiOKWiCAgICDilojilojiloggICAgIOKWiOKWiOKWiCAgICDilojilojilogg4paI4paI4paIICAgIOKWiOKWhCAgICDilojilojilojilpDilojilojiloQgICDilojilojiloggIOKWiOKWiOKWiCAgIOKWiOKWiOKWiCAgIOKWiOKWiOKWiCAgICDilojilojiloggICAgICAgICAg4paI4paI4paIICAgICDilojilojiloggICAg4paI4paI4paIIOKWiOKWiOKWiCAgICDilojilojilogg4paI4paI4paIICAgICAgIAogIOKWiOKWiOKWiCAgICDilojilojiloggICAgIOKWiOKWiOKWiCAgICDilojilojilogg4paI4paI4paIICAgIOKWiOKWiOKWiCAgIOKWiOKWiOKWiCDiloDilojilojilojiloQg4paI4paI4paIICDilojilojiloggICDilojilojiloggICDilojilojiloggICAg4paI4paI4paIICAgICAgICAgIOKWiOKWiOKWiCAgICAg4paI4paI4paIICAgIOKWiOKWiOKWiCDilojilojiloggICAg4paI4paI4paIIOKWiOKWiOKWiOKWjCAgICDiloQgCiAg4paI4paI4paIICAgIOKWiOKWgCAgICAgIOKWiOKWiOKWiCAgICDilojiloAgIOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWgCAgICDilojilojiloggICDiloDilojiloAg4paI4paAICAgIOKWgOKWiCAgIOKWiOKWgCAgICDilojilojilojilojilojilojilojilojiloAgICAgICAgICAg4paE4paI4paI4paI4paI4paAICAgIOKWgOKWiOKWiOKWiOKWiOKWiOKWiOKWgCAgIOKWgOKWiOKWiOKWiOKWiOKWiOKWiOKWgCAg4paI4paI4paI4paI4paI4paE4paE4paI4paIIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIOKWgCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDiloAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXDAzM1s5N21bIV0gaHR0cHM6Ly9naXRodWIuY29tL1o0bnp1L2hhY2tpbmd0b29sClwwMzNbOTdtICIiIgpkZWYgbWVudSgpOgogICAgcHJpbnQoTG9nbyArICIiIlwwMzNbMG0gCiAgICBcMDMzWzkxbVshXSBUaGlzIFRvb2wgTXVzdCBSdW4gYXMgYSBSb290Li5bIV0gXDAzM1s5N20KICAgIFswMF1Bbm9uU3VyZiAgICAgICAgICAgICAgICAgIAogICAgWzAxXUluZm9ybWF0aW9uIEdhdGhlcmluZwogICAgWzAyXVBhc3N3b3JkIEF0dGFjayAmJiBXb3JkbGlzdCBHZW5lcmF0b3IKICAgIFswM11XaXJlbGVzcyBBdHRhY2sKICAgIFswNF1TUUwgSW5qZWN0aW9uIFRvb2xzIAogICAgWzA1XVBoaXNoaW5nIEF0dGFjayAKICAgIFswNl1XZWIgQXR0YWNrIFRvb2wKICAgIFswN11Qb3N0IGV4cGxvaXRhdGlvbgogICAgWzA4XUZvcmVuc2ljIFRvb2xzCiAgICBbMDldUGF5bG9hZCBDcmVhdG9yCiAgICBbMTBdUm91dGVyIEV4cGxvaXQKICAgIFsxMV1XaWZpIEphbW1pbmcKICAgIFsxMl1Tb2NpYWxNZWRpYSBBdHRhY2sKICAgIFsxM11Tb2NpYWxNZWRpYSBGaW5kZXIgCiAgICBbMTRdQW5kcm9pZCBIYWNrCiAgICBbMTVdU3RlZ2Fub2dyYXBoeQogICAgWzE2XU1vcmUgVG9vbHMgCiAgICBbMTddVXBkYXRlIFN5c3RlbQogICAgWzk5XUV4aXQKICAgICIiIikKICAgIAogICAgY2hvaWNlID0gaW5wdXQoIlo0bnp1ICA9Pj4gIikKICAgIGlmIGNob2ljZSA9PSAiMCIgb3IgY2hvaWNlID09ICIwMCI6CiAgICAgICAgY2xlYXJTY3IoKQogICAgICAgIGFub25zdXJmKCkKICAgIGVsaWYgY2hvaWNlID09ICIxIiBvciBjaG9pY2UgPT0gIjAxIjoKICAgICAgICBjbGVhclNjcigpCiAgICAgICAgaW5mbygpCiAgICBlbGlmIGNob2ljZSA9PSAiMiIgb3IgY2hvaWNlID09ICIwMiI6CiAgICAgICAgY2xlYXJTY3IoKQogICAgICAgIHBhc3N3ZCgpCiAgICBlbGlmIGNob2ljZSA9PSAiMyIgb3IgY2hvaWNlID09ICIwMyI6CiAgICAgICAgY2xlYXJTY3IoKQogICAgICAgIHdpcmUoKQogICAgZWxpZiBjaG9pY2UgPT0gIjQiIG9yIGNob2ljZSA9PSAiMDQiOgogICAgICAgIGNsZWFyU2NyKCkKICAgICAgICBzcWx0b29sKCkgICAgCiAgICBlbGlmIGNob2ljZSA9PSAiNSIgb3IgY2hvaWNlID09ICIwNSI6CiAgICAgICAgY2xlYXJTY3IoKQogICAgICAgIHBoaXNoYXR0YWNrKCkKICAgIGVsaWYgY2hvaWNlID09ICI2IiBvciBjaG9pY2UgPT0gIjA2IjoKICAgICAgICBjbGVhclNjcigpCiAgICAgICAgd2ViQXR0YWNrKCkgICAgICAgIAogICAgZWxpZiBjaG9pY2UgPT0gIjciIG9yIGNob2ljZSA9PSAiMDciOgogICAgICAgIGNsZWFyU2NyKCkKICAgICAgICBwb3N0ZXhwKCkKICAgIGVsaWYgY2hvaWNlID09ICI4IiBvciBjaG9pY2UgPT0gIjA4IiA6CiAgICAgICAgY2xlYXJTY3IoKQogICAgICAgIGZvcmVuc2ljKCkKICAgIGVsaWYgY2hvaWNlID09ICI5IiBvciBjaG9pY2UgPT0gIjA5IiA6CiAgICAgICAgY2xlYXJTY3IoKQogICAgICAgIHBheWxvYWRzKCkgICAgICAgCiAgICBlbGlmIGNob2ljZSA9PSAiMTAiOgogICAgICAgIGNsZWFyU2NyKCkKICAgICAgICByb3V0ZXhwKCkKICAgIGVsaWYgY2hvaWNlID09ICIxMSIgOgogICAgICAgIGNsZWFyU2NyKCkKICAgICAgICB3aWZpamFtbWluZygpCiAgICBlbGlmIGNob2ljZSA9PSAiMTIiIDoKICAgICAgICBjbGVhclNjcigpCiAgICAgICAgc29jaWFsYXR0YWNrKCkgICAgICAgCiAgICBlbGlmIGNob2ljZSA9PSAiMTMiIDoKICAgICAgICBjbGVhclNjcigpCiAgICAgICAgc29jaWFsZmluZGVyKCkKICAgIGVsaWYgY2hvaWNlID09ICIxNCI6CiAgICAgICAgY2xlYXJTY3IoKQogICAgICAgIGFuZHJvaWRoYWNrKCkKICAgIGVsaWYgY2hvaWNlID09ICIxNSI6CiAgICAgICAgY2xlYXJTY3IoKQogICAgICAgIHN0ZWdhbm9ncmFwaHkoKQogICAgZWxpZiBjaG9pY2UgPT0gIjE2IjoKICAgICAgICBjbGVhclNjcigpCiAgICAgICAgcHJpbnQoTG9nbykKICAgICAgICBvdGhlcnMoKQogICAgZWxpZiBjaG9pY2UgPT0gIjE3IjoKICAgICAgICBjbGVhclNjcigpCiAgICAgICAgcHJpbnQoTG9nbykKICAgICAgICB1cGRhdGVzeXMoKQogICAgZWxpZiBjaG9pY2UgPT0gIjk5IiA6CiAgICAgICAgY2xlYXJTY3IoKSwgc3lzLmV4aXQoKQogICAgICAgIGV4aXQoKQogICAgZWxpZiBjaG9pY2UgPT0gIiI6CiAgICAgICAgbWVudSgpCiAgICBlbHNlOgogICAgICAgIHByaW50KCJXcm9uZyBJbnB1dC4uLiEhIikKICAgICAgICB0aW1lLnNsZWVwKDMpCiAgICAgICAgbWVudSgpCgpkZWYgYW5vbnN1cmYoKToKICAgIG9zLnN5c3RlbSgiZmlnbGV0IC1mIHN0YW5kYXJkIC1jIEFub25tb3VzbHkgSGlkaW5nIFRvb2wgfCBsb2xjYXQiKQogICAgcHJpbnQoIiIiCiAgICAgICAgWzFdICBBbm9ubW91c2x5IFN1cmYKICAgICAgICBbMl0gIE11bHRpdG9yCiAgICAgIC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s4XSAgSXNJdERvd24gKENoZWNrIFdlYnNpdGUgRG93bi9VcCkKICAgICAgICAgICAgWzk5XSBCYWNrIFRvIE1haW4gTWVudSAKICAgICAgICAiIiIpCiAgICBjaG9pY2UyID0gaW5wdXQoIlo0bnp1ID0+PiAiKQogICAgaWYgY2hvaWNlMiA9PSAiMSI6CiAgICAgICAgbm1hcCgpCiAgICBpZiBjaG9pY2UyID09ICIyIjoKICAgICAgICBjbGVhclNjcigpCiAgICAgICAgRHJhY25tYXAoKQogICAgaWYgY2hvaWNlMiA9PSAiMyI6CiAgICAgICAgY2xlYXJTY3IoKQogICAgICAgIHBvcnRzKCkKICAgIGlmIGNob2ljZTIgPT0gIjQiOgogICAgICAgIGNsZWFyU2NyKCkKICAgICAgICBoMmlwKCkKICAgIGlmIGNob2ljZTIgPT0gIjUiOgogICAgICAgIGNsZWFyU2NyKCkKICAgICAgICB4ZXJvc3Bsb2l0KCkKICAgIGlmIGNob2ljZTIgPT0gIjYiOgogICAgICAgIGNsZWFyU2NyKCkKICAgICAgICBYU1N0cmlrZSgpCiAgICBlbGlmIGNob2ljZTIgPT0gIjciOgogICAgICAgIGNsZWFyU2NyKCkKICAgICAgICByZWNvbnNwaWRlcigpCiAgICBlbGlmIGNob2ljZTIgPT0gIjgiOgogICAgICAgIGNsZWFyU2NyKCkKICAgICAgICBpc2l0ZG93bigpCiAgICBlbGlmIGNob2ljZTIgPT0gIjk5IjoKICAgICAgICBjbGVhclNjcigpCiAgICAgICAgbWVudSgpCiAgICBlbGlmIGNob2ljZTIgPT0gIiI6CiAgICAgICAgbWVudSgpCiAgICBlbHNlOgogICAgICAgIG1lbnUoKQoKZGVmIG5tYXAoKToKICAgIG5tYXBjaG9pY2UgPSBpbnB1dCgiWzFdSW5zdGFsbCBbOTldQkFjayA+PiAiKQogICAgaWYgbm1hcGNob2ljZSA9PSAiMSIgOgogICAgICAgIG9zLnN5c3RlbSgic3VkbyBnaXQgY2xvbmUgaHR0cHM6Ly9naXRodWIu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wIGluc3RhbGwgLXIgcmVxdWlyZW1lbnRzLnR4dCIpCiAgICAgICAgcGFzc3dkKCkKICAgIGVsaWYgdXNlcmNob2ljZSA9PSAiMiIgOgogICAgICAgIG9zLnN5c3RlbSgiY2QgQ3IzZE92M3IgJiYgc3VkbyBweXRob24zIENyM2QwdjNyLnB5IC1oIikKICAgIGVsaWYgdXNlcmNob2ljZSA9PSAiOTkiOgogICAgICAgIHBhc3N3ZCgpCiAgICBlbHNlIDoKICAgICAgICBtZW51KCkKCmRlZiB3aXJlKCk6CiAgICBjbGVhclNjcigpCiAgICBvcy5zeXN0ZW0oImZpZ2xldCAtZiBzdGFuZGFyZCAtYyBXaXJlbGVzcyBBdHRhY2sgVG9vbHMgfCBsb2xjYXQiKQogICAgcHJpbnQoIiIiICAKICAgICAgICAgICAgICAgIFsxXSBXaUZpLVB1bXBraW4KICAgICAgICAgICAgICAgIFsyXSBwaXhpZXdwcwogICAgICAgICAgICAgICAgWzNdIEJsdWV0b290aCBIb25leXBvdCBHVUkgRnJhbWV3b3JrCiAgICAgICAgICAgICAgICBbNF0gRmx1eGlvbgogICAgICAgICAgICAgICAgWzVdIFdpZmlwaGlzaGVyCiAgICAgICAgICAgICAgICBbNl0gV2lmaXRlCiAgICAgICAgICAgICAgICBbN10gRXZpbFR3aW4gCiAgICAgICAgICAgICAgICBbOTldQmFjayBUbyBUaGUgTWFpbiBNZW51ICIiIikKICAgIGNob2ljZTQgPSBpbnB1dCgiWjRuenUgPT0+PiAiKQogICAgaWYgY2hvaWNlNCA9PSAiMSI6CiAgICAgICAgY2xlYXJTY3IoKQogICAgICAgIHdpZmlwdW1raW4oKQogICAgaWYgY2hvaWNlNCA9PSAiMiI6CiAgICAgICAgY2xlYXJTY3IoKQogICAgICAgIHBpeGlld3BzKCkKICAgIGlmIGNob2ljZTQgPT0gIjMiOgogICAgICAgIGNsZWFyU2NyKCkKICAgICAgICBibHVlcG90KCkKICAgIGlmIGNob2ljZTQgPT0gIjQiOgogICAgIC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gogICAgICAgIGNsZWFyU2NyKCkKICAgICAgICBzZXRvb2xraXQoKQogICAgaWYgY2hvaWNlID09ICIyIjoKICAgICAgICBjbGVhclNjcigpCiAgICAgICAgc29jaWFsZmlzaCgpCiAgICBpZiBjaG9pY2UgPT0gIjMiOgogICAgICAgIGNsZWFyU2NyKCkKICAgICAgICBzaGVsbHBoaXNoKCkKICAgIGlmIGNob2ljZSA9PSAiNCI6CiAgICAgICAgY2xlYXJTY3IoKQogICAgICAgIGJsYWNrZXllKCkKICAgIGVsaWYgY2hvaWNlID09ICI1IjoKICAgICAgICBjbGVhclNjcigpCiAgICAgICAgaXNlZXlvdSgpCiAgICBlbGlmIGNob2ljZSA9PSAiNiI6CiAgICAgICAgY2xlYXJTY3IoKQogICAgICAgIHNheWNoZWVzZSgpCiAgICBlbGlmIGNob2ljZSA9PSAiNyI6CiAgICAgICAgY2xlYXJTY3IoKQogICAgICAgIHFyamFja2luZygpCiAgICBpZiBjaG9pY2UgPT0gIjk5IjoKICAgICAgICBjbGVhclNjcigpCiAgICAgICAgbWVudSgpCiAgICBlbGlmIGNob2ljZSA9PSAiIjoKICAgICAgICBtZW51KCkKICAgIGVsc2U6CiAgICAgICAgbWVudSgpCgpkZWYgc29jaWFsZmlzaCgpOgogICAgY2hvaWNlPWlucHV0KCJbMV1pbnN0YWxsIFsyXVJ1biBbOTldQkFjayA+PiAiKQogICAgaWYgY2hvaWNlID09ICIxIjoKICAgICAgICBvcy5zeXN0ZW0oInN1ZG8gZ2l0IGNsb25lIGh0dHBzOi8vZ2l0aHViLmNvbS9VbmRlYWRTZWMvU29jaWFsRmlzaC5naXQgJiYgc3VkbyBhcHQtZ2V0IGluc3RhbGwgcHl0aG9uMyBweXRob24zLXBpcCBweXRob24zLWRldiAteSIpCiAgICAgICAgb3Muc3lzdGVtKCJjZCBTb2NpYWxGaXNoICYmIHN1ZG8gcHl0aG9uMyAtbSBwaXAgaW5zdGFsbCAtciByZXF1aXJlbWVudHMudHh0IikKICAgIC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bM10gQXV0b1NweSAKICAgICAgICBbOTldQmFjayB0byBNZW51CiAgICAiIiIpCiAgICBjaG9pY2UgPSBpbnB1dCgiWjRuenUgPT0+PiIpCiAgICBpZiBjaG9pY2UgPT0gIjEiIDoKICAgICAgICBjbGVhclNjcigpCiAgICAgICAgYnVsa2V4dHJhY3RvcigpCiAgICBlbGlmIGNob2ljZSA9PSAiMiI6CiAgICAgICAgY2xlYXJTY3IoKQogICAgICAgIGd1eW1hZ2VyKCkKICAgIGVsaWYgY2hvaWNlID09ICIzIjoKICAgICAgICBjbGVhclNjcigpCiAgICAgICAgYXV0b3BzeSgpCiAgICBlbGlmIGNob2ljZSA9PSAiOTkiOgogICAgICAgIG1lbnUoKQogICAgZWxpZiBjaG9pY2UgPT0gIiI6CiAgICAgICAgbWVudSgpCiAgICBlbHNlIDoKICAgICAgICBtZW51KCkKCmRlZiBidWxrZXh0cmFjdG9yKCk6CiAgICBwcmludCgiIiIKICAgICAgICBbMV1HVUkgTW9kZShEb3dubG9hZCByZXF1aXJlZCkKICAgICAgICBbMl1DTEkgTW9kZQogICAgICAgIFs5OV1CQWNrCiAgICAiIiIpCiAgICBjaG9pY2UgPSBpbnB1dCgiWjRuenUgPj4gIikKICAgIGlmIGNob2ljZSA9PSAiMSI6CiAgICAgICAgb3Muc3lzdGVtKCJzdWRvIGdpdCBjbG9uZSBodHRwczovL2dpdGh1Yi5jb20vc2ltc29uZy9idWxrX2V4dHJhY3Rvci5naXQiKQogICAgICAgIG9zLnN5c3RlbSgibHMgc3JjLyAmJiBjZCAuLiAmJiBjZCBqYXZhX2d1aSAmJiAuL0JFVmlld2VyIikKICAgICAgICBwcmludCgiSWYgeW91IGdldHRpbmcgZXJyb3IgYWZ0ZXIgY2xvbmUgZ28gdG8gL2phdmFfZ3VpL3NyYy8gQW5kIENvbXBpbGUgLkphciBmaWxlICYmIHJ1biAuL0JFVmlld2VyIikKICAgICAgICBwcmludCgiUGxlYXNlIFZpc2l0IEZvciBNb3JlIERldG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GFjayBUb29scyB8IGxvbGNhdCIpCiAgICBwcmludCgiIiIKICAgICAgICBbMV1TbG93TG9yaXMKICAgICAgICBbOTldQmFjawogICAgIiIiKQogICAgY2hvaWNlID1pbnB1dCgiWjRuenUgPj4gIikKICAgIGlmIGNob2ljZSA9PSAiMSI6CiAgICAgICAgY2xlYXJTY3IoKQogICAgICAgIHNsb3dsb3JpcygpCiAgICBlbGlmIGNob2ljZSA9PSAiMiI6CiAgICAgICAgcGFzcwogICAgZWxpZiBjaG9pY2UgPT0gIjk5IjoKICAgICAgICBvdGhlcnMoKQogICAgZWxzZSA6CiAgICAgICAgcHJpbnQoIkludmFsaWQgLi4uIikKICAgICAgICBtZW51KCkKZGVmIHdlYkF0dGFjaygpOgogICAgY2xlYXJTY3IoKQogICAgb3Muc3lzdGVtKCJmaWdsZXQgJ1dlYiBBdHRhY2sgVG9vbHMnIC1mIHN0YW5kYXJkIC1jIHwgbG9sY2F0IikKICAgIHByaW50KCIiIgogICAgICAgIFsxXSBXZWIyQXR0YWNrCiAgICAgICAgWzJdIFNraXBmaXNoCiAgICAgICAgWzNdIFN1YkRvbWFpbiBGaW5kZXIKICAgICAgICBbNF0gQ2hlY2tVUkwKICAgICAgICBbNV0gQmxhenkoQWxzbyBGaW5kIENsaWNrSmFja2luZykKICAgICAgICBbOTldQmFjayBUbyBNZW51CiAgICAiIiIpCiAgICBjaG9pY2UgPSBpbnB1dCgiWjRuenUgPj4gIikKICAgIGlmIGNob2ljZSA9PSAiMSI6CiAgICAgICAgY2xlYXJTY3IoKQogICAgICAgIHdlYjJhdHRhY2soKQogICAgZWxpZiBjaG9pY2UgPT0gIjIiOgogICAgICAgIHNraXBmaXNoKCkKICAgIGVsaWYgY2hvaWNlID09ICIzIjoKICAgICAgICBzdWJkb21haW4oKQogICAgZWxpZiBjaG9pY2UgPT0gIjQiOgogICAgICAgIGNsZWFyU2NyKCkKICAgICAgICBjaGVja3VybCgpCiAgICBlbGlmIGNob2ljZSA9PSAiNSI6C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k5XUJhY2sKICAgICIiIikKICAgIGNob2ljZSA9IGlucHV0KCJaNG56dSA9Pj4gIikKICAgIGlmIGNob2ljZSA9PSAiMSI6CiAgICAgICAgY2xlYXJTY3IoKQogICAgICAgICMgYWlybW9uKCkKICAgICAgICBwYXNzCiAgICBlbGlmIGNob2ljZSA9PSAiOTkiOgogICAgICAgIG1lbnUoKQogICAgZWxzZSA6CiAgICAgICAgbWVudSgpCgpkZWYgYWlybW9uKCk6CiAgICAjIG9zLnN5c3RlbSgiZWNobyBcIiBcIiB8IGJveGVzIC1kIGJveSIpCiAgICBwcmludChMb2dvKQogICAgdXNlcmNob2ljZSA9IGlucHV0KCJbMV1JbnN0YWxsIFsyXVJ1biBbOTldQmFjayA+PiIpCiAgICBpZiB1c2VyY2hvaWNlID09ICIxIjoKICAgICAgICBwcmludCgiSW4gV29ya2luZyIpCiAgICAgICAgdGltZS5zbGVlcCg1KQogICAgICAgIG1lbnUoKQogICAgZWxpZiB1c2VyY2hvaWNlID09ICIyIjoKICAgICAgICBwcmludCgiIiIKICAgICAgICAgICAgIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICMgICAgIFshXSBGb2xsb3cgQmVsb3cgc3RlcHMgZm9yIEphbW1pbmcgWyFdICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAjICAgICBbMV1pd2NvbmZpZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgIyAgICAgWzJdYWlybW9uLW5nICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICMgICAgIFszXWFpcm1vbi1uZyBzdGFydCBJbnRlcmZhY2VOYW1lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAjICAgICBbNF1haXJvZHVtcC1uZyBJbnRlcmZhY2VOYW1lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgIyAgICAgWzVdYWlyb2R1bXAtbmcgLWMgW0NIIG5vLl0gLS1ic3NpZCBbTUFDIGFkZHJlc3NdIEludGVyZmFjZU5hbWUgICAgICAjICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICMgICAgIFs2XWFpcmVwbHktbmcgLTAgMCAtYSBbbWFjIGFkZHJlc3NdIEludGVyZmFjZU5hbWUgICAgICAgICAgICAgICAgICAgIyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAjICAgICBbK11BZnRlciBDb21wbGV0ZSBtb25pdG9yIG1vZGUgcmV0dXJuIHlvdXIgaW50ZXJmYWNlIGluIG5vcm1hbCBtb2RlICMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgIyAgICAgWzddYWlybW9uLW5nIHN0b3AgSW50ZXJmYWNlTmFtZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyAKICAgICAgICAiIiIpCiAgICAgICAgb3Muc3lzdGVtKCJzdWRvIGFpcm1vbi1uZyIpCiAgICBlbGlmIHVzZXJjaG9pY2UgPT0gIjk5IjoKICAgICAgICB3aWZpamFtbWluZygpCiAgICBlbGlmIHVzZXJjaG9pY2UgPT0gIiI6CiAgICAgICAgd2lmaWphbW1pbmcoKQogICAgZWxzZSA6CiAgICAgICAgbWVudSgpICAKICAgICMgej1yYXdfaW5wdXQoIkVudGVyIFlvdXIgd2lmaSBJbnRlcmZhY2UgTmFtZSA6LSAiKQogICAgIyBvcy5zeXN0ZW0oImFpcm1vbi1uZyAmJiBhaXJtb24tbmcgc3RhcnQgJXMiJXopCgpkZWYgc3RlZ2Fub2dyYXBoeSgpOgogICAgY2xlYXJTY3IoKQogICAgb3Muc3lzdGVtKCJmaWdsZXQgLWYgc3RhbmRhcmQgLWMgU3RlZ2Fub0dyYXBoeSB8IGxvbGNhdCIpCiAgICBwcmludCgiIiIKICAgICAgICBbM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c3RzKCIvaG9tZS97MH0vRGVza3RvcC8iLmZvcm1hdCh1c2VyKSk6CiAgICAgICAgICAgICMgICAgIG9zLmNoZGlyKCIvaG9tZS97MH0vRGVza3RvcC8iLmZvcm1hdCh1c2VyKSkKICAgICAgICAgICAgIyAgICAgaWYgb3MucGF0aC5pc2RpcignaGFja2luZ3Rvb2wnKToKICAgICAgICAgICAgIyAgICAgICAgIG9zLmNoZGlyKCIvaG9tZS97MH0vRGVza3RvcC9oYWNraW5ndG9vbC8iLmZvcm1hdCh1c2VyKSkKICAgICAgICAgICAgIyAgICAgICAgIG1lbnUoKQogICAgICAgICAgICAjICAgICBlbHNlIDoKICAgICAgICAgICAgIyAgICAgICAgIG9zLnN5c3RlbSgibWtkaXIgaGFja2luZ3Rvb2wiKQogICAgICAgICAgICAjICAgICAgICAgb3MuY2hkaXIoIi9ob21lL3swfS9EZXNrdG9wL2hhY2tpbmd0b29sLyIuZm9ybWF0KHVzZXIpKQogICAgICAgICAgICAjICAgICAgICAgbWVudSgpCiAgICAgICAgICAgIGlmIG9zLmdldGV1aWQoKSAhPSAwOgogICAgICAgICAgICAgICAgb3MuY2hkaXIoIi9ob21lL3swfS9EZXNrdG9wLyIuZm9ybWF0KG5vdHVzZXIpKQogICAgICAgICAgICAgICAgaWYgb3MucGF0aC5pc2RpcignaGFja2luZ3Rvb2wnKToKICAgICAgICAgICAgICAgICAgICBvcy5jaGRpcigiL2hvbWUvezB9L0Rlc2t0b3AvaGFja2luZ3Rvb2wvIi5mb3JtYXQobm90dXNlcikpCiAgICAgICAgICAgICAgICAgICAgbWVudSgpCiAgICAgICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgICAgICAgIG9zLnN5c3RlbSgibWtkaXIgaGFja2luZ3Rvb2wiKQogICAgICAgICAgICAgICAgICAgIG9zLmNoZGlyKCIvaG9tZS97MH0vRGVza3RvcC9oYWNraW5ndG9vbC8iLmZvcm1hdChub3R1c2VyKSkKICAgICAgICAgICAgICAgICAgICBtZW51KCkKICAgICAgICAgICAgZWxpZiBvcy5nZXRldWlkKCkgPT0gMDoKICAgICAgICAgICAgICAgIG9zLmNoZGlyKCIvaG9tZS97MH0vRGVza3RvcC8iLmZvcm1hdCh1bmFtZSkpCiAgICAgICAgICAgICAgICBpZiBvcy5wYXRoLmlzZGlyKCdoYWNraW5ndG9vbCcpOgogICAgICAgICAgICAgICAgICAgIG9zLmNoZGlyKCIvaG9tZS97MH0vRGVza3RvcC9oYWNraW5ndG9vbC8iLmZvcm1hdCh1bmFtZSkpCiAgICAgICAgICAgICAgICAgICAgbWVudSgpCiAgICAgICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgICAgICAgIG9zLnN5c3RlbSgibWtkaXIgaGFja2luZ3Rvb2wiKQogICAgICAgICAgICAgICAgICAgIG9zLmNoZGlyKCIvaG9tZS97MH0vRGVza3RvcC9oYWNraW5ndG9vbC8iLmZvcm1hdCh1bmFtZSkpCiAgICAgICAgICAgICAgICAgICAgbWVudSgpCiAgICAgICAgZWxpZiBwYXRoLmV4aXN0cygnL2RhdGEnKToKICAgICAgICAgICAgb3MuY2hkaXIoImRhdGEvZGF0YS9jb20udGVybXV4L2ZpbGVzL2hvbWUvIikKICAgICAgICAgICAgaWYgb3MucGF0aC5pc2RpcignaGFja2luZ3Rvb2wnKToKICAgICAgICAgICAgICAgIG9zLmNoZGlyKCJkYXRhL2RhdGEvY29tLnRlcm11eC9maWxlcy9ob21lL2hhY2tpbmd0b29sLyIpCiAgICAgICAgICAgICAgICBtZW51KCkKICAgICAgICAgICAgZWxzZSA6CiAgICAgICAgICAgICAgICBvcy5zeXN0ZW0oIm1rZGlyIGhhY2tpbmd0b29sc3RvcmUiKQogICAgICAgICAgICAgICAgb3MuY2hkaXIoImRhdGEvZGF0YS9jb20udGVybXV4L2ZpbGVzL2hvbWUvaGFja2luZ3Rvb2wvIikKICAgICAgICAgICAgICAgIG1lbnUoKQogICAgZXhjZXB0IEtleWJvYXJkSW50ZXJydXB0OgogICAgICAgIAogICAgICAgIHByaW50KCJcbiBTb3JyeSAuLiEhISIpCiAgICAgICAgdGltZS5zbGVlcCgzKQoK''') exec(base64.b64decode(x))