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A7IGkgPCBuQXJnczsgaSsrICkKICAgIHsKICAgICAgVEVYVENIQVIgYXJnW0NNRExfTUFYX1NUUkxFTl0gPSB7TCdcMCd9OwogICAgICBURVhUQ0hBUiogcF9hcmcgPSBhcmc7CiAgICAgIFRFWFRDSEFSKiBjdXJyZW50X3N0ciA9ICYoc19zdHJbaSpDTURMX01BWF9BUkdDXSk7CgogICAgICBpZiAoR2V0QXJnRnJvbVN0cmluZyhhcmdjLCBhcmd2LCBjdXJyZW50X3N0ciwgY19zdHJfdHlwZVtpXSwgYXJnLCBzd2l0Y2hlc191c2VkICkKICAgICAgICAgICYmICFiX3N0cl9vcHRbaV0gKQogICAgICAgIHsKI2lmZGVmIF9VTklDT0RFCiAgICAgICAgICBfZnRwcmludGYoc3RkZXJyLCBfVEVYVCgiXG5cbkVycm9yOiBQYXJzaW5nIGFyZ3VtZW50IGZvciByZXF1aXJlZCBzd2l0Y2ggJyVscycuXG4iICksIGN1cnJlbnRfc3RyKTsKI2Vsc2UKICAgICAgICAgIF9mdHByaW50ZihzdGRlcnIsIF9URVhUKCJcblxuRXJyb3I6IFBhcnNpbmcgYXJndW1lbnQgZm9yIHJlcXVpcmVkIHN3aXRjaCAnJXMnLlxuIiApLCBjdXJyZW50X3N0cik7CiNlbmRpZgogICAgICAgICAgZm91bmRfYW5kX3NldCA9IDA7CiAgICAgICAgICBnb3RvIGJhaWw7CiAgICAgICAgfQogICAgICBpZiAoQ2hlY2tBcmcocF9hcmcsIHNfc3RyLCBuQXJncywgY19zdHJfdHlwZVtpXSwgY3VycmVudF9zdHIpKQogICAgICAgIHsKICAgICAgICAgIGdvdG8gYmFpbDsKICAgICAgICB9CgogICAgICBzd2l0Y2ggKGNfc3RyX3R5cGVbaV0gKQogICAgICAgIHsKICAgICAgICBjYXNlICdzJzoKICAgICAgICAgIHsKICAgICAgICAgICAgVEVYVENIQVIqIHRtcDsKICAgICAgICAgICAgdG1wID0gdmFfYXJnKGFwLCBURVhUQ0hBUiopOwoKICAgICAgICAgICAgaWYgKCBhcmdbMF0gPT0gJ1wwJyApCiAgICAgICAgICAgICAgYnJlYWs7CgogICAgICAgICAgICBfdGNzbmNweSggdG1wLCBhcmcsIENNRExfTUFYX1NUUkxFTiApOwogICAgICAgICAgICAvKiBSZW1vdmUgcXVvdGVzLiBXaW5kb3dzIE1vYmlsZSBXb3JrYXJvdW5kLiAqLwogICAgICAgICAgICByZW1vdmVRdW90ZXModG1wKTsKICAgICAgICAgICAgZm91bmRfYW5kX3NldCsrOwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIH0KICAgICAgICBjYXNlICdkJzoKICAgICAgICAgIHsKICAgICAgICAgICAgSU5UKiB0bXAgPSB2YV9hcmcoYXAsIElOVCopOwoKICAgICAgICAgICAgaWYgKCBhcmdbMF0gPT0gJ1wwJyApCiAgICAgICAgICAgICAgYnJlYWs7CgogICAgICAgICAgICAqdG1wID0gX3Rjc3RvbChhcmcsIE5VTEwsIDApOwogICAgICAgICAgICBmb3VuZF9hbmRfc2V0Kys7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgfQogICAgICAgIGNhc2UgJ2MnOgogICAgICAgICAgewogICAgICAgICAgICBjaGFyKiB0bXAgPSB2YV9hcmcoYXAsIGNoYXIqKTsKCiAgICAgICAgICAgIGlmICggYXJnWzBdID09ICdcMCcgKQogICAgICAgICAgICAgIGJyZWFrOwoKICAgICAgICAgICAgKnRtcCA9ICphcmc7CiAgICAgICAgICAgIGZvdW5kX2FuZF9zZXQrKzsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICB9CiAgICAgICAgY2FzZSAndSc6CiAgICAgICAgICB7CiAgICAgICAgICAgIFVDSEFSKiB0bXAgPSB2YV9hcmcoYXAsIFVDSEFSKik7CgogICAgICAgICAgICBpZiAoIGFyZ1swXSA9PSAnXDAnICkKICAgICAgICAgICAgICBicmVhazsKCiAgICAgICAgICAgICp0bXAgPSBfdHN0b2koYXJnKTsKICAgICAgICAgICAgZm91bmRfYW5kX3NldCsrOwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIH0KICAgICAgICBjYXNlICdmJzoKICAgICAgICAgIHsKICAgICAgICAgICAgZmxvYXQqIHRtcCA9IChmbG9hdCopIHZhX2FyZyggYXAsZG91YmxlKik7CgogICAgICAgICAgICBpZiAoIGFyZ1swXSA9PSAnXDAnICkKICAgICAgICAgICAgICBicmVhazsKCiAgICAgICAgICAgICp0bXAgPSAoZmxvYXQpIF90c3RvZihhcmcpOwogICAgICAgICAgICBmb3VuZF9hbmRfc2V0Kys7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgfQogICAgICAgIGNhc2UgJ3knOiAvLyBzdXBwb3J0ICdkYXRhIHR5cGUgZG91YmxlJwogICAgICAgICAgewogICAgICAgICAgICBkb3VibGUqIHRtcCA9IChkb3VibGUqKSB2YV9hcmcoIGFwLGRvdWJsZSopOwogICAgICAgICAgICAvLyB1c2Ugc3NjYW5mIGluc3RlYWQgX3RzdG9mIGJlY2F1c2Ugb2YgZ2NjCiAgICAgICAgICAgIC8vX3RzdG9mKGFyZywiJWxmIix0bXApOyAvLyAnJWxmJyByZWFkcyBhcyBkb3VibGUKICAgICAgICAgICAgKnRtcCA9IF90c3RvZihhcmcpOyAvLyAnJWxmJyByZWFkcyBhcyBkb3VibGUKICAgICAgICAgICAgZm91bmRfYW5kX3NldCsrOwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIH0KICAgICAgICBjYXNlICcxJzoKICAgICAgICAgIHsKCiAgICAgICAgICAgIElOVCogdG1wID0gdmFfYXJnKCBhcCwgSU5UKik7CgogICAgICAgICAgICBpZiAoIGFyZ1swXSA9PSAnXDAnICkKICAgICAgICAgICAgICBicmVhazsKCiAgICAgICAgICAgICp0bXAgPSAxOwogICAgICAgICAgICBmb3VuZF9hbmRfc2V0Kys7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgfQoKICAgICAgICBkZWZhdWx0OgogICAgICAgICAgRkRLcHJpbnRmRXJyKCJCdWc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F90Y3NsZW4oc3RyKSAtIDE7ICsraSApCiAgICAgIHsKICAgICAgICBpZiAoIHN0cltpXSA9PSAnJScgKSAgLyogV2UgaGF2ZSBhbiBBcmd1bWVudCAqLwogICAgICAgICAgewogICAgICAgICAgICBpZiAoIGFyZ0NvdW50ZXIgKQogICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGlmICggYl9zdHJfb3B0W2FyZ0NvdW50ZXItMV0gKQogICAgICAgICAgICAgICAgICBzdHJfc3RhcnQgPSBzdHJfc3RvcCArIDM7CgogICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgICBzdHJfc3RhcnQgPSBzdHJfc3RvcCArIDI7CiAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgLyogU2F2ZSBBcmd1bWVudCB0eXBlICovCiAgICAgICAgICAgIGNfc3RyX3R5cGVbYXJnQ291bnRlcl0gPSBzdHJbaSsxXTsKCiAgICAgICAgICAgIGlmICggKnN0cl9zdGFydCA9PSAnKCcgKSAvKiBPcHRpb25hbCBBcmd1bWVudCAqLwogICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGJfc3RyX29wdFthcmdDb3VudGVyXSA9IDE7CiAgICAgICAgICAgICAgICBzdHJfc3RhcnQrKzsKICAgICAgICAgICAgICB9CgogICAgICAgICAgICAvKiBTYXZlIEFyZ3VtZW50ICovCiAgICAgICAgICAgIHN0cltpXSA9ICdcMCc7CgogICAgICAgICAgICBfdGNzbmNweSgmKHNfc3RyW2FyZ0NvdW50ZXIqQ01ETF9NQVhfQVJHQ10pLCBzdHJfc3RhcnQsIENNRExfTUFYX0FSR0MgKTsKCiAgICAgICAgICAgIHN0cltpXSA9ICclJzsKCiAgICAgICAgICAgIHN0cl9zdG9wID0gJihzdHJbaV0pOwoKICAgICAgICAgICAgaWYgKCBiX3N0cl9vcHRbYXJnQ291bnRlcl0gKQogICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGlmICggaSsyID4gKCBfdGNzbGVuKHN0cikgLTEgKSkKICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgIF9mdHByaW50ZihzdGRlcnIsX1RFWFQoIlxuXG5JbnRlcm5hbCBQYXJzZXIgRXJyb3I6IFN0cmxlbiBQcm9ibGVtXG4iKSApOwogICAgICAgICAgICAgICAgICAgIHJldHVybiAxOwogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZiAoIHN0cltpKzJdICE9ICcpJyApCiAgICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICBfZnRwcmludGYoc3RkZXJyLF9URVhUKCJcblxuSW50ZXJuYWwgUGFyc2VyIEVycm9yOiBNaXNzaW5nIGJyYWNrZXQgJyknXG4iKSApOwogICAgICAgICAgICAgICAgICAgIHJldHVybiAxOwogICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgIH0KCgogICAgICAgICAgICBhcmdDb3VudGVyKys7CiAgICAgICAgICB9CgoKICAgICAgfQoKICAgIHJldHVybiAwOwogIH0KCgoKCnZvaWQgUmVtb3ZlV2hpdGVTcGFjZShjb25zdCBURVhUQ0hBUiogcFJlcUFyZ3MsIFRFWFRDSEFSKiBwUmVtb3ZlZCkKewogIFVJTlQgaSA9IDA7CiAgSU5UIGsgPSAwOwogIFVJTlQgbGVuID0gKFVJTlQpX3Rjc2xlbihwUmVxQXJncyk7CgoKICBmb3IgKCBpID0gMDsgaSA8IGxlbjsgKytpICkKICAgIHsKCiAgICAgIGlmICggcFJlcUFyZ3NbaV0gIT0gJyAnICkKICAgICAgICB7CiAgICAgICAgICBwUmVtb3ZlZFtrXSA9IHBSZXFBcmdzW2ldOwogICAgICAgICAgaysrOwogICAgICAgIH0KICAgIH0KfQoKCklOVCBHZXRBcmdGcm9tU3RyaW5nKElOVCBhcmdjLCBURVhUQ0hBUiogYXJndltdLCBURVhUQ0hBUiogc2VhcmNoX3N0cmluZywgVEVYVENIQVIgdHlwZSwgVEVYVENIQVIqIGZvdW5kX3N0cmluZywgSU5UKiBzd191c2VkICkKewogIElOVCBpID0gMDsKCiAgZm9yIChpID0gMTsgaSA8IGFyZ2M7ICsraSApIHsKICAgIGlmICggIV90Y3NjbXAoc2VhcmNoX3N0cmluZywgYXJndltpXSkgKSAvKiBTdHJpbmdzIGFyZSBlcXVhbCAqLwogICAgICB7CiAgICAgICAgaWYgKCB0eXBlID09ICcxJyApIC8qIFN3aXRjaCB3aXRob3V0IGFyZ3VtZW50ICovCiAgICAgICAgewogICAgICAgICAgX3Rjc25jcHkoIGZvdW5kX3N0cmluZywgX1RFWFQoIjEiKSwgMSk7CiAgICAgICAgICBzd191c2VkW2ldID0gMTsKICAgICAgICAgIHJldHVybiAwOwoKICAgICAgICB9CgogICAgICAgIGlmICggaSA9PSAoYXJnYyAtIDEpKSAgLyogV2UgaGF2ZSAlcyBvciAlZCBidXQgYXJlIGZpbmlzaGVkKi8KICAgICAgICAgIHJldHVybiAxOwoKICAgICAgICBpZiAoIF90Y3NsZW4oYXJndltpKzFdKSA+IENNRExfTUFYX1NUUkxFTiApCiAgICAgICAgICB7CiNpZmRlZiBfVU5JQ09ERQogICAgICAgICAgICBfZnRwcmludGYgKHN0ZGVycixfVEVYVCgiV2FybmluZzogSWdub3JpbmcgYXJndW1lbnQgZm9yIHN3aXRjaCAnJWxzJy4gIiksIHNlYXJjaF9zdHJpbmcgKTsKI2Vsc2UKICAgICAgICAgICAgX2Z0cHJpbnRmIChzdGRlcnIsX1RFWFQoIldhcm5pbmc6IElnbm9yaW5nIGFyZ3VtZW50IGZvciBzd2l0Y2ggJyVzJy4gIiksIHNlYXJjaF9zdHJpbmcgKTsKI2VuZGlmCiAgICAgICAgICAgIF9mdHByaW50ZiAoc3RkZXJyLF9URVhUKCJBcmd1bWVudCBpcyB0b28gTE9ORy5cbiIpICk7CiAgICAgICAgICAgIHJldHVybiAxOwogICAgICAgICAgfQogICAgICAgIGVsc2UKICAgICAgICB7CiAgICAgICAgICBfdGNzbmNweSggZm91bmRfc3RyaW5nLCB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