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yAgICAKKyAgICB3aGlsZSAoKG9wdD1nZXRvcHQoYXJnYyxhcmd2LCJlZDpmOnQ6bTpwOnI6czpsOnd4OiIpKSAhPSBFT0YpCisgICAgICAgIHN3aXRjaCAob3B0KSB7CisgICAgICAgIGNhc2UgJ2QnOgorICAgICAgICAgICAgc2Rldm5hbWUgPSBvcHRhcmc7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAnZic6CisgICAgICAgICAgICBnRnNTYXZlUGFyYW0ubG9jYWxGc1BhdGggPSBvcHRhcmc7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAndCc6CisgICAgICAgICAgICBnRnNTYXZlUGFyYW0udE1heExvZ3NpemUgPSBhdG9pKG9wdGFyZyk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAnZSc6CisgICAgICAgICAgICBpc2RhZW1vbiA9IDE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAnbSc6CisgICAgICAgICAgICBtYXhDb25uZWN0cyA9IGF0b2kob3B0YXJnKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlICdwJzoKKyAgICAgICAgICAgIHBvcnQgPSBhdG9pKG9wdGFyZyk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAncic6CisgICAgICAgICAgICBtYWNoaW5lbmFtZSA9IG9wdGFyZzsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlICdzJzoKKyAgICAgICAgICAgIHN0dHlwYXJtcyA9IG9wdGFyZzsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlICdsJzoKKyAgICAgICAgICAgIGxpbmtuYW1lID0gb3B0YXJnOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgJ3gnOgorICAgICAgICAgICAgZGVidWcgPSBhdG9pKG9wdGFyZyk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAndyc6CisgICAgICAgICA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Sk7CisgICAgfSAgICAKKyAgICAKKyAgICBkZXZmZCA9IG9wZW4oc2Rldm5hbWUsIE9fUkRXUiwgMDc1NSk7CisgICAgaWYgKGRldmZkIDwgMCkgeworICAgICAgICBwcmludGYoIk9wZW4gb2YgJXMgZmFpbGVkOiAlbVxuIiwgc2Rldm5hbWUpOworICAgICAgICBleGl0KDIpOworICAgIH0KKworICAgIGlmIChzdHR5cGFybXMpIAorICAgICAgICBzZXRfdHR5KGRldmZkLCBzdHR5cGFybXMpOworICAgIGVsc2UKKyAgICAgICAgc2V0X3R0eShkZXZmZCwgWkxPR19ERUZBVUxUX1RUWUJBVUQpOworICAgICAgICAKKyAgICAvKsjnufuxo7Tmtb2087Dlsb612M7EvP7Ptc2zKi8KKyAgICBpZihnRnNTYXZlUGFyYW0ubG9jYWxGc1BhdGgpICAgICAKKyAgICAgICAgekxvZ0FndF9TYXZlZnNfTWFpbihkZXZmZCk7CisgICAgZWxzZSAKKyAgICAgICAgekxvZ0FndF9OZXRTZXJpYWxfTWFpbihkZXZmZCk7Cit9CisK