xiaomianao666

小程序:哔嘀影视

Aug 2nd, 2023
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@哔嘀影视@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi5ZOU5ZiA5b2x6KeGIiwiYXV0aG9yIjoiIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSMjZnlwYWdlIiwidmVyc2lvbiI6NCwiY29sX3R5cGUiOiJtb3ZpZV8zIiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJ2aWRlbyIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxudmFyIGQgPSBbXVxudmFyIHBhZ2UgPSBNWV9QQUdFXG4vL3ZhciBodG1sID0gZmV0Y2goY29uZmlnLmluZGV4ICsgYHMvYWxsLyR7cGFnZX1gKVxuXG5NWV9VUkwgPSBjb25maWcuaW5kZXggKyBgcy9hbGwvJHtwYWdlfWBcblxuLy9jbGVhclZhcihNWV9SVUxFLnRpdGxlICsgJ3VybCcpXG5cbnZhciBnZXRSYW5nZUNvbG9ycyA9IGZ1bmN0aW9uKCkge8KgwqDCoMKgwqDCoMKgXG4gICAgcmV0dXJuICcjJyArICgnMDAwMDAnICsgKE1hdGgucmFuZG9tKCkgKiAweDEwMDAwMDAgPDwgMCkudG9TdHJpbmcoMTYpKS5zdWJzdHIoLTYpO8KgwqDCoMKgwqBcbn1cblxuY29uc3Qg5YiG57G76aKc6ImyID0gZ2V0UmFuZ2VDb2xvcnMoKVxuY29uc3Qg5aSn57G75a6a5L2NID0gJ2JvZHkmJmRpdi5uYXZiYXItZXhwYW5kLW1kJiYubmF2YmFyLW5hdidcbmNvbnN0IOaLvOaOpeWIh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YiG57G76aKc6ImyICsgJ1xcXCI+JyArIHRpdGxlICsgJzwvc3Bhbj48L2I+JyA6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHBkKGl0ZW0sIOWIhuexu+mTvuaOpSkgKyAnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5ld19jYXRlID0gW11cXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wLmZvckVhY2goKGNhdGUsIGluZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jYXRlLnB1c2goaW5kZXggPT09IDAgPyBwYXJhbXMua2V5LnRvU3RyaW5nKCkgOiBcXFwiMFxcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS50aXRsZSwgSlNPTi5zdHJpbmdpZnkobmV3X2NhdGUpKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihNWV9SVUxFLnRpdGxlKyd1cmwnLCBpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiBwYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gZWxzZSBpZiAoZm9sZCA9PT0gJzEnKSB7XFxuICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHBkZmgoaXRlbSwg5YiG57G75qCH6aKYKVxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGtleS50b1N0cmluZygpID09PSBjYXRlX3RlbXBbaW5kZXhdID8gJ+KAnOKAnOKAneKAnTxiPjxzcGFuIHN0eWxlPVxcXCJjb2xvcjogJyArIOWIhuexu+minOiJsiArICdcXFwiPicgKyB0aXRsZSArICc8L3NwYW4+PC9iPicgOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChwZChpdGVtLCDliIbnsbvpk77mjqUpICsgJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXBbcGFyYW1zLmluZGV4XSA9IHBhcmFtcy5rZXkudG9TdHJpbmcoKVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihNWV9SVUxFLnRpdGxlLCBKU09OLnN0cmluZ2lmeShwYXJhbXMuY2F0ZV90ZW1wKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS50aXRsZSsndXJsJywgaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9KVxcbn1cXG5cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuaQnOe0olwiLFwicGF0aFwiOlwic2VhcmNoXCIsXCJydWxlXCI6XCJqczpcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuivpuaDhVwiLFwicGF0aFwiOlwiZGV0YWlsc1wiLFwicnVsZVwiOlwianM6XFxucmVxdWlyZShjb25maWcudWkpXFxudmFyIHJlcyA9IHt9O1xcbnZhciBkID0gW107XFxudmFyIGxpc3RzPVtdO1xcbnZhciB0YWJzcz1bXTtcXG52YXIgaHRtbCA9IGdldFJlc0NvZGUoKTtcXG52YXIgdGFicyA9IHBkZmEoaHRtbCwgJ2JvZHkmJmg0Jyk7XFxudmFyIGNvbnRzID0gcGRmYShodG1sLCAnYm9keSYmLm10LTM6aGFzKDptYXRjaGVzKOaSreaUvuWIl+ihqHzkuIvovb3lnLDlnYB856eN5a2Q5LiL6L29KSknKTtcXG5cXG4vL3NldEVycm9yKGNvbnRzLmxlbmd0aCk7XFxuXFxuZnVuY3Rpb24g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1bGUoKGRjLCBzZGMpID0+IHtcXG4gICAgICAgIHZhciBkcyA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2RzaG93JywgJ+aUtui1tycpO1xcbiAgICAgICAgdmFyIHRpdGxlID0gZmluZEl0ZW0oJ2RzaG93JykudGl0bGU7XFxuXFxuICAgICAgICBpZiAoZHMgPT0gJ+aUtui1tycpIHtcXG4gICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKCdkc2hvdycsICflsZXlvIAnKVxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ2Rjb250ZW50Jywge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogZGMsXFxuICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgdXBkYXRlSXRlbSgnZHNob3cnLCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZS5yZXBsYWNlKCfmlLbotbcnLCAn5bGV5byAJylcXG4gICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICB1cGRhdGVJdGVtXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oJ2RzaG93JywgJ+aUtui1tycpXFxuICAgICAgICAgICAgdXBkYXRlSXRlbSgnZGNvbnRlbnQnLCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBzZGMsXFxuICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgdXBkYXRlSXRlbSgnZHNob3cnLCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZS5yZXBsYWNlKCflsZXlvIAnLCAn5pS26LW3JylcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgfSwgZGVzYywgc2Rlc2MpLFxcbiAgICBleHRyYToge1xcbiAgICAgICAgaWQ6ICdkc2hvdycsXFxuICAgIH1cXG59KVxcblxcblxcbmQucHVzaCh7XFxuICAg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hZGVyczoge1xcbiAgICAgICAgICAgICdjb29raWUnOiBnZXRJdGVtKGhvbWUgKyAnQ29va2llJywgJycpLFxcbiAgICAgICAgfVxcbiAgICB9KVxcbiAgICBpZiAoaHRtbC5pbmNsdWRlcygnUGxlYXNlIGNvbXBsZXRlIHRoZSBjYXB0Y2hhJykpIHtcXG4gICAgICAgIGNsZWFyVmFyKGhvbWUgKyAnQ29va2llJyk7XFxuICAgICAgICBjbGVhckl0ZW0oaG9tZSArICdDb29raWUnKTsgICAgICAgIFxcbiAgICAgICAgcmV0dXJuICQoJ2hpa2VyOi8vZW1wdHknKS5ydWxlKChob21lLCB1cmwpID0+IHtcXG4gICAgICAgICAgICB2YXIgZCA9IFtdO1xcbiAgICAgICAgICAgIHZhciBjb29raWUgPSBnZXRWYXIoaG9tZSArICdDb29raWUnLCAnJyk7XFxuICAgICAgICAgICAgLy9sb2coY29va2llKVxcbiAgICAgICAgICAgIGlmIChjb29raWUgIT0gJycpIHtcXG4gICAgICAgICAgICAgICAgc2V0SXRlbShob21lICsgJ0Nvb2tpZScsIGNvb2tpZSk7XFxuICAgICAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcbiAgICAgICAgICAgICAgICB0b2FzdCgn6aqM6K+B5a6M5oiQJylcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFg1V2ViVmlldygnaGlrZXI6Ly9lbXB0eScpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcIng1X3dlYnZpZXdfc2luZ2xlXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJmbG9hdCYmMTAwJVxcXCIsXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChob21lLCB1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBlbGVtZW50SWQgPSBcXFwibWV0YVtwcm9wZXJ0eT0nb2c6dHlwZSddXFxcIjsgLy8g5b6F5qOA5p+l55qE5YWD57SgIElEIFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGludGVydmFsVGltZSA9IDEwMDA7IC8vIOavj+malCAxIOenkumSn+ajgOafpeS4gOasoSBcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0aW1lciA9IHNldEludGVydmFsKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZWxlbWVudCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoZWxlbWVudElkKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW1lbnQpIHsgLy8g5a2Y5Zyo6K+l5YWD57Sg77yM5Y+v5Lul5omn6KGM5p+Q5Lqb5pON5L2cIFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9mYmEubG9nKCflrZjlnKgnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLnJlZnJlc2hYNURlc2MoJ2Zsb2F0JiYwJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnN0eWxlLmNvbG9yID0gJ3JlZCc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEucHV0VmFyKGhvbWUgKyAnQ29va2llJywgZmJhLmdldENvb2tpZSh1cmwpKTsgICAgICAgICAgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmeV9icmlkZ2VfYXBwLnJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcik7IC8vIOa4hemZpOWumuaXtuWZqCBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2ZiYS5sb2coJ+S4jeWtmOWcqCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGludGVydmFsVGltZSk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBob21lLCB1cmwpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBzZXRIb21lUmVzdWx0KGQpXFxuICAgICAgICB9LCBob21lLCB1cmwpXFxuICAgIH1cXG4gICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvcGFyc2UnLCB7fSkpLnJ1bGUpO1xcblxcbiAgICByZXR1cm4gdXJsO1xcbn0pO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi6aqM6K+B56CBXCIsXCJwYXRoXCI6XCJ5em1cIixcInJ1bGVcIjpcImlmIChodG1sLmluZGV4T2YoJ+i+k+WFpemqjOivgeeggScpID4gLTEpIHtcXG5cXG4gICAgbGV0IGhlYWRlcnMgPSB7XFxuICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQSxcXG4gICAgICAgIFxcXCJSZWZlcmVyXFxcIjogTVlfVVJMXFxuICAgIH07XFxuICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2Uvanhocz9ydWxlPeaooeadv8K3UScpKS5ydWxlKTtcXG4gICAgZXZhbFByaXZhdGVKUyhzc3l6KTtcXG5cXG5cXG4gICAgdmFyIGNvZGV1cmwgPSBjb25maWcuaW5kZXggKyBwZGZoKGh0bWwsICcjdmVyaWZ5Q29kZSYmc3JjJykuc2xpY2UoMSlcXG5cXG5cXG4gICAgLy9sb2coY29kZXVybClcXG5cXG4gICAgbGV0IHZjb2RlID0gZ2V0VkNvZGUyKGNvZGV1cmwsIEpTT04uc3RyaW5naWZ5KGhlYWRlcnMpLCAnc3RyaW5nJyk7XFxuXFxuICAgIHZhciBzdHIgPSBKU09OLnBhcnNlKHZjb2RlKS50ZXh0LnJlcGxhY2UoJz0nLCAnJykucmVwbGFjZSgvKHh8w5cpLywgJyonKS5yZXBsYWNlKCfDtycsICcvJylcXG5cXG4gICAgdmFyIG51bSA9IDA7XFxuICAgIG51bSA9IGV2YWwoc3RyKVxcbiAgICBsb2cobnVtKVxcblxcbiAgICB2YXIgY3VybCA9IE1ZX1VSTCArICc/Y29kZT0nICsgbnVtO1xcblxcbiAgICAvL2xvZyhjdXJsKVxcblxcbiAgICBodG1sID0gZmV0Y2goY3VybCwge1xcbiAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgfSlcXG4gICAgaWYgKGh0bWwuaW5kZXhPZign6L6T5YWl6aqM6K+B56CBJykgPT0gLTEpIHtcXG4gICAgICAgIHZhciBjb29raWUgPSBnZXRDb29raWUoY3VybClcXG4gICAgICAgIHB1dE15VmFyKCdjb29raWUnLCBjb29raWUpXFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn6Ieq5Yqo6K+G5Yir5aSx6LSl77yM6K+35Yi35paw6YeN6K+V5oiW6ICF5omL5Yqo6aqM6K+BJ1xcbiAgICAgICAgfSlcXG4gICAgICAgIFxcbiAgICAgICAgdmFyIGRpY3QgPSB7XFxuICAgICAgICAgICAgbXl1cmw6IE1ZX1VSTCxcXG4gICAgICAgICAgICB2Y29kZTogY29kZXVybFxcbiAgICAgICAgfVxcblxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ+eCueaIkeaJi+WKqOmqjOivgScsXFxuICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5IyMnKS5ydWxlKChkaWN0KSA9PiB7XFxuICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZSgn6K+36L6T5YWl6K6h566X57uT5p6cJyk7XFxuICAgICAgICAgICAgICAgIHZhciBkID0gW107XFxuICAgICAgICAgICAgICAgIHZhciBteXVybCA9IGRpY3QubXl1cmw7XFxuICAgICAgICAgICAgICAgIHZhciBodG1sID0gZmV0Y2gobXl1cmwpO1xcbiAgICAgICAgICAgICAgICB2YXIgY29kZXVybCA9IGNvbmZpZy5pbmRleCArIHBkZmgoaHRtbCwgJyN2ZXJpZnlDb2RlJiZzcmMnKS5zbGljZSgxKTtcXG4gICAgICAgICAgICAgICAgdmFyIGI2NCA9IGNvbnZlcnRCYXNlNjRJbWFnZShjb2RldXJsKVxcblxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBiNjQsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3BpY18xX2Z1bGwnLFxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfnoa7orqQnLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQudG9TdHJpbmcoKG15dXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN1cmwgPSBteXVybCArICc/Y29kZT0nICsgaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coY3VybClcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaGVhZGVycyA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJSZWZlcmVyXFxcIjogbXl1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBodG1sID0gZmV0Y2goY3VybCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChodG1sLmluZGV4T2YoJ+i+k+WFpemqjOivgeeggScpID09IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb29raWUgPSBnZXRDb29raWUoY3VybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdjb29raWUnLCBjb29raWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KCfmiJDlip/vvIzor7fliLDmkJzntKLpobXliLfmlrAnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KCfplJnor6/or7fph43or5UnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgICAgICB9LCBteXVybCksXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdudW1iZXInXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgICAgICAgICB9LCBkaWN0KVxcbiAgICAgICAgfSlcXG4gICAgICAgIFxcbiAgICB9XFxufVxcblxcblwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwicGFrb1wiLFwicGF0aFwiOlwicGFrb1wiLFwicnVsZVwiOlwianM6XFxuISBmdW5jdGlvbih0KSB7XFxuICAgIGl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ICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHZhciBuID0gb1tlXSA9IHtcXG4gICAgICAgICAgICAgICAgICAgIGV4cG9ydHM6IHt9XFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIHNbZV1bMF0uY2FsbChuLmV4cG9ydHMsIGZ1bmN0aW9uKHQpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBoKHNbZV1bMV1bdF0gfHwgdClcXG4gICAgICAgICAgICAgICAgfSwgbiwgbi5leHBvcnRzLCByLCBzLCBvLCBsKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gb1tlXS5leHBvcnRzXFxuICAgICAgICB9XFxuICAgICAgICBmb3IgKHZhciBkID0gXFxcImZ1bmN0aW9uXFxcIiA9PSB0eXBlb2YgcmVxdWlyZSAmJiByZXF1aXJlLCB0ID0gMDsgdCA8IGwubGVuZ3RoOyB0KyspIGgobFt0XSk7XFxuICAgICAgICByZXR1cm4gaFxcbiAgICB9KHtcXG4gICAgICAgIDE6IFtmdW5jdGlvbih0LCBlLCBhKSB7XFxuICAgICAgICAgICAgXFxcInVzZSBzdHJpY3RcXFwiO1xcbiAgICAgICAgICAgIHZhciBzID0gdChcXFwiLi96bGliL2RlZmxhdGVcXFwiKSxcXG4gICAgICAgICAgICAgICAgbyA9IHQoXFxcIi4vdXRpbHMvY29tbW9uXFxcIiksXFxuICAgICAgICAgICAgICAgIGwgPSB0KFxcXCIuL3V0aWxzL3N0cmluZ3NcXFwiKSxcXG4gICAgICAgICAgICAgICAgbiA9IHQoXFxcIi4vemxpYi9tZXNzYWdlc1xcXCIpLFxcbiAgICAgICAgICAgICAgICByID0gdChcXFwiLi96bGliL3pzdHJlYW1cXFwiKSxcXG4gICAgICAgICAgICAgICAgaCA9IE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcsXFxuICAgICAgICAgICAgICAgIGQgPSAwLFxcbiAgICAgICAgICAgICAgICBmID0gLTEsXFxuICAgICAgICAgICAgICAgIF8gPSAwLFxcbiAgICAgICAgICAgICAgICB1ID0gODtcXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBjKHQpIHtcXG4gICAgICAgICAgICAgICAgaWYgKCEodGhpcyBpbnN0YW5jZW9mIGMpKSByZXR1cm4gbmV3IGModCk7XFxuICAgICAgICAgICAgICAgIHRoaXMub3B0aW9ucyA9IG8uYXNzaWduKHtcXG4gICAgICAgICAgICAgICAgICAgIGxldmVsOiBmLFxcbiAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiB1LFxcbiAgICAgICAgICAgICAgICAgICAgY2h1bmtTaXplOiAxNjM4NCxcXG4gICAgICAgICAgICAgICAgICAgIHdpbmRvd0JpdHM6IDE1LFxcbiAgICAgICAgICAgICAgICAgICAgbWVtTGV2ZWw6IDgsXFxuICAgICAgICAgICAgICAgICAgICBzdHJhdGVneTogXyxcXG4gICAgICAgICAgICAgICAgICAgIHRvOiBcXFwiXFxcIlxcbiAgICAgICAgICAgICAgICB9LCB0IHx8IHt9KTtcXG4gICAgICAgICAgICAgICAgdmFyIGUgPSB0aGlzLm9wdGlvbnM7XFxuICAgICAgICAgICAgICAgIGUucmF3ICYmIDAgPCBlLndpbmRvd0JpdHMgPyBlLndpbmRvd0JpdHMgPSAtZS53aW5kb3dCaXRzIDogZS5nemlwICYmIDAgPCBlLndpbmRvd0JpdHMgJiYgZS53aW5kb3dCaXRzIDwgMTYgJiYgKGUud2luZG93Qml0cyArPSAxNiksIHRoaXMuZXJyID0gMCwgdGhpcy5tc2cgPSBcXFwiXFxcIiwgdGhpcy5lbmRlZCA9ICExLCB0aGlzLmNodW5rcyA9IFtdLCB0aGlzLnN0cm0gPSBuZXcgciwgdGhpcy5zdHJtLmF2YWlsX291dCA9IDA7XFxuICAgICAgICAgICAgICAgIHZhciBhID0gcy5kZWZsYXRlSW5pdDIodGhpcy5zdHJtLCBlLmxldmVsLCBlLm1ldGhvZCwgZS53aW5kb3dCaXRzLCBlLm1lbUxldm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gICAgICAgICBcXFwiLi91dGlscy9zdHJpbmdzXFxcIjogNCxcXG4gICAgICAgICAgICBcXFwiLi96bGliL2RlZmxhdGVcXFwiOiA4LFxcbiAgICAgICAgICAgIFxcXCIuL3psaWIvbWVzc2FnZXNcXFwiOiAxMyxcXG4gICAgICAgICAgICBcXFwiLi96bGliL3pzdHJlYW1cXFwiOiAxNVxcbiAgICAgICAgfV0sXFxuICAgICAgICAyOiBbZnVuY3Rpb24odCwgZSwgYSkge1xcbiAgICAgICAgICAgIFxcXCJ1c2Ugc3RyaWN0XFxcIjtcXG4gICAgICAgICAgICB2YXIgZiA9IHQoXFxcIi4vemxpYi9pbmZsYXRlXFxcIiksXFxuICAgICAgICAgICAgICAgIF8gPSB0KFxcXCIuL3V0aWxzL2NvbW1vblxcXCIpLFxcbiAgICAgICAgICAgICAgICB1ID0gdChcXFwiLi91dGlscy9zdHJpbmdzXFxcIiksXFxuICAgICAgICAgICAgICAgIGMgPSB0KFxcXCIuL3psaWIvY29uc3RhbnRzXFxcIiksXFxuICAgICAgICAgICAgICAgIGkgPSB0KFxcXCIuL3psaWIvbWVzc2FnZXNcXFwiKSxcXG4gICAgICAgICAgICAgICAgbiA9IHQoXFxcIi4vemxpYi96c3RyZWFtXFxcIiksXFxuICAgICAgICAgICAgICAgIHIgPSB0KFxcXCIuL3psaWIvZ3poZWFkZXJcXFwiKSxcXG4gICAgICAgICAgICAgICAgYiA9IE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmc7XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gcyh0KSB7XFxuICAgICAgICAgICAgICAgIGlmICghKHRoaXMgaW5zdGFuY2VvZiBzKSkgcmV0dXJuIG5ldyBzKHQpO1xcbiAgICAgICAgICAgICAgICB0aGlzLm9wdGlvbnMgPSBfLmFzc2lnbih7XFxuICAgICAgICAgICAgICAgICAgICBjaHVua1NpemU6IDE2Mzg0LFxcbiAgICAgICAgICAgICAgICAgICAgd2luZG93Qml0czogMCxcXG4gIC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mluZzJidWYoZS5kaWN0aW9uYXJ5KSA6IFxcXCJbb2JqZWN0IEFycmF5QnVmZmVyXVxcXCIgPT09IGIuY2FsbChlLmRpY3Rpb25hcnkpICYmIChlLmRpY3Rpb25hcnkgPSBuZXcgVWludDhBcnJheShlLmRpY3Rpb25hcnkpKSwgZS5yYXcgJiYgKGEgPSBmLmluZmxhdGVTZXREaWN0aW9uYXJ5KHRoaXMuc3RybSwgZS5kaWN0aW9uYXJ5KSkgIT09IGMuWl9PSykpIHRocm93IG5ldyBFcnJvcihpW2FdKVxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBvKHQsIGUpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGEgPSBuZXcgcyhlKTtcXG4gICAgICAgICAgICAgICAgaWYgKGEucHVzaCh0LCAhMCksIGEuZXJyKSB0aHJvdyBhLm1zZyB8fCBpW2EuZXJyXTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGEucmVzdWx0XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHMucHJvdG90eXBlLnB1c2ggPSBmdW5jdGlvbih0LCBlKSB7XFxuICAgICAgICAgICAgICAgIHZhciBhLCBpLCBuLCByLCBzLCBvID0gdGhpcy5zdHJtLFxcbiAgICAgICAgICAgICAgICAgICAgbCA9IHRoaXMub3B0aW9ucy5jaHVua1NpemUsXFxuICAgICAgICAgICAgICAgICAgICBoID0gdGhpcy5vcHRpb25zLmRpY3Rpb25hcnksXFxuICAgICAgICAgICAgICAgICAgICBkID0gITE7XFxuICAgICAgICAgICAgICAgIGlmICh0aGlzLmVuZGVkKSByZXR1cm4gITE7XFxuICAgICAgICAgICAgICAgIGkgPSBlID09PSB+fmUgPyBlIDogITAgPT09IGUgPyBjLlpfRklOSVNIIDogYy5aX05PX0ZMVVNILCBcXFwic3RyaW5nXFxcIiA9PSB0eXBlb2YgdCA/IG8uaW5wdXQgPSB1LmJpbnN0cmluZzJidWYodCkgOiBcXFwiW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LCBhLkluZmxhdGUgPSBzLCBhLmluZmxhdGUgPSBvLCBhLmluZmxhdGVSYXcgPSBmdW5jdGlvbih0LCBlKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAoZSA9IGUgfHwge30pLnJhdyA9ICEwLCBvKHQsIGUpXFxuICAgICAgICAgICAgfSwgYS51bmd6aXAgPSBvXFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgXFxcIi4vdXRpbHMvY29tbW9uXFxcIjogMyxcXG4gICAgICAgICAgICBcXFwiLi91dGlscy9zdHJpbmdzXFxcIjogNCxcXG4gICAgICAgICAgICBcXFwiLi96bGliL2NvbnN0YW50c1xcXCI6IDYsXFxuICAgICAgICAgICAgXFxcIi4vemxpYi9nemhlYWRlclxcXCI6IDksXFxuICAgICAgICAgICAgXFxcIi4vemxpYi9pbmZsYXRlXFxcIjogMTEsXFxuICAgICAgICAgICAgXFxcIi4vemxpYi9tZXNzYWdlc1xcXCI6IDEzLFxcbiAgICAgICAgICAgIFxcXCIuL3psaWIvenN0cmVhbVxcXCI6IDE1XFxuICAgICAgICB9XSxcXG4gICAgICAgIDM6IFtmdW5jdGlvbih0LCBlLCBhKSB7XFxuICAgICAgICAgICAgXFxcInVzZSBzdHJpY3RcXFwiO1xcbiAgICAgICAgICAgIHZhciBpID0gXFxcInVuZGVmaW5lZFxcXCIgIT0gdHlwZW9mIFVpbnQ4QXJyYXkgJiYgXFxcInVuZGVmaW5lZFxcXCIgIT0gdHlwZW9mIFVpbnQxNkFycmF5ICYmIFxcXCJ1bmRlZmluZWRcXFwiICE9IHR5cGVvZiBJbnQzMkFycmF5O1xcbiAgICAgICAgICAgIGEuYXNzaWduID0gZnVuY3Rpb24odCkge1xcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBlLCBhLCBpID0gQXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoYXJndW1lbnRzLCAxKTsgaS5sZW5ndGg7KSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgbiA9IGkuc2hpZnQoKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChuKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxcXCJvYmplY3RcXFwiICE9IHR5cGVvZiBuKSB0aHJvdyBuZXcgVHlwZUVycm9yKG4gKyBcXFwibXVzdCBiZSBub24tb2JqZWN0XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgciBpbiBuKSBlID0gbiwgYSA9IHIsIE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChlLCBhKSAmJiAodFtyXSA9IG5bcl0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRcXG4gICAgICAgICAgICB9LCBhLnNocmlua0J1ZiA9IGZ1bmN0aW9uKHQsIGUpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHQubGVuZ3RoID09PSBlID8gdCA6IHQuc3ViYXJyYXkgPyB0LnN1YmFycmF5KDAsIGUpIDogKHQubGVuZ3RoID0gZSwgdClcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIHZhciBuID0ge1xcbiAgICAgICAgICAgICAgICAgICAgYXJyYXlTZXQ6IGZ1bmN0aW9uKHQsIGUsIGEsIGksIG4pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5zdWJhcnJheSAmJiB0LnN1YmFycmF5KSB0LnNldChlLnN1YmFycmF5KGEsIGEgKyBpKSwgbik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciByID0gMDsgciA8IGk7IHIrKykgdFtuICsgcl0gPSBlW2EgKyByXVxcbiAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIGZsYXR0ZW5DaHVua3M6IGZ1bmN0aW9uKHQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZSwgYSwgaSwgbiwgciwgcztcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGUgPSBpID0gMCwgYSA9IHQubGVuZ3RoOyBlIDwgYTsgZSsrKSBpICs9IHRbZV0ubGVuZ3RoO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAocyA9IG5ldyBVaW50OEFycmF5KGkpLCBlID0gbiA9IDAsIGEgPSB0Lmxlbmd0aDsgZSA8IGE7IGUrKykgciA9IHRbZV0sIHMuc2V0KHIsIG4pLCBuICs9IHIubGVuZ3RoO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIHIgPSB7XFxuICAgICAgICAgICAgICAgICAgICBhcnJheVNldDogZnVuY3Rpb24odCwgZSwgYSwgaSwgbikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHIgPSAwOyByIDwgaTsgcisrKSB0W24gKyByXSA9IGVbYSArIHJdXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgZmxhdHRlbkNodW5rczogZnVuY3Rpb24odCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbXS5jb25jYXQuYXBwbHkoW10sIHQpXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgYS5zZXRUeXBlZCA9IGZ1bmN0aW9uKHQpIHtcXG4gICAgICAgICAgICAgICAgdCA/IChhLkJ1ZjggPSBVaW50OEFycmF5LCBhLkJ1ZjE2ID0gVWludDE2QXJyYXksIGEuQnVmMzIgPSBJbnQzMkFycmF5LCBhLmFzc2lnbihhLCBuKSkgOiAoYS5CdWY4ID0gQXJyYXksIGEuQnVmMTYgPSBBcnJheSwgYS5CdWYzMiA9IEFycmF5LCBhLmFzc2lnbihhLCByKSlcXG4gICAgICAgICAgICB9LCBhLnNldFR5cGVkKGkpXFxuICAgICAgICB9LCB7fV0sXFxuICAgICAgICA0OiBbZnVuY3Rpb24odCwgZSwgYSkge1xcbiAgICAgICAgICAgIFxcXCJ1c2Ugc3RyaWN0XFxcIjtcXG4gICAgICAgICAgICB2YXIgbCA9IHQoXFxcIi4vY29tbW9uXFxcIiksXFxuICAgICAgICAgICAgICAgIG4gPSAhMCxcXG4gICAgICAgICAgICAgICAgciA9ICEwO1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIFN0cmluZy5mcm9tQ2hhckNvZGUuYXBwbHkobnVsbCwgWzBdKVxcbiAgICAgICAgICAgIH0gY2F0Y2ggKHQpIHtcXG4gICAgICAgICAgICAgICAgbiA9ICExXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIFN0cmluZy5mcm9tQ2hhckNvZGUuYXBwbHkobnVsbCwgbmV3IFVpbnQ4QXJyYXkoMSkpXFxuICAgICAgICAgICAgfSBjYXRjaCAodCkge1xcbiAgICAgICAgICAgICAgICByID0gITFcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgZm9yICh2YXIgaCA9IG5ldyBsLkJ1ZjgoMjU2KSwgaSA9IDA7IGkgPCAyNTY7IGkrKykgaFtpXSA9IDI1MiA8PSBpID8gNiA6IDI0OCA8PSBpID8gNSA6IDI0MCA8PSBpID8gNCA6IDIyNCA8PSBpID8gMyA6IDE5MiA8PSBpID8gMiA6IDE7XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gZCh0LCBlKSB7XFxuICAgICAgICAgICAgICAgIGlmIChlIDwgNjU1MzQgJiYgKHQuc3ViYXJyYXkgJiYgciB8fCAhdC5zdWJhcnJheSAmJiBuKSkgcmV0dXJuIFN0cmluZy5mcm9tQ2hhckNvZGUuYXBwbHkobnVsbCwgbC5zaHJpbmtCdWYodCwgZSkpO1xcbiAgICAgICAgICAgIC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0gMjI0IHwgYSA+Pj4gMTIgOiAoZVtyKytdID0gMjQwIHwgYSA+Pj4gMTgsIGVbcisrXSA9IDEyOCB8IGEgPj4+IDEyICYgNjMpLCBlW3IrK10gPSAxMjggfCBhID4+PiA2ICYgNjMpLCBlW3IrK10gPSAxMjggfCA2MyAmIGEpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gZVxcbiAgICAgICAgICAgIH0sIGEuYnVmMmJpbnN0cmluZyA9IGZ1bmN0aW9uKHQpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGQodCwgdC5sZW5ndGgpXFxuICAgICAgICAgICAgfSwgYS5iaW5zdHJpbmcyYnVmID0gZnVuY3Rpb24odCkge1xcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBlID0gbmV3IGwuQnVmOCh0Lmxlbmd0aCksIGEgPSAwLCBpID0gZS5sZW5ndGg7IGEgPCBpOyBhKyspIGVbYV0gPSB0LmNoYXJDb2RlQXQoYSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBlXFxuICAgICAgICAgICAgfSwgYS5idWYyc3RyaW5nID0gZnVuY3Rpb24odCwgZSkge1xcbiAgICAgICAgICAgICAgICB2YXIgYSwgaSwgbiwgciwgcyA9IGUgfHwgdC5sZW5ndGgsXFxuICAgICAgICAgICAgICAgICAgICBvID0gbmV3IEFycmF5KDIgKiBzKTtcXG4gICAgICAgICAgICAgICAgZm9yIChhID0gaSA9IDA7IGEgPCBzOylcXG4gICAgICAgICAgICAgICAgICAgIGlmICgobiA9IHRbYSsrXSkgPCAxMjgpIG9baSsrXSA9IG47XFxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICg0IDwgKHIgPSBoW25dKSkgb1tpKytdID0gNjU1MzMsIGEgKz0gciAtIDE7XFxuICAgICAgICAgICAgICAgIGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChuICY9IDIgPT09IHIgPyAzMSA6IDMgPT09IHIgPyAxNSA6IDc7IDEgPCByICYmIGEgPCBzOykgbiA9IG4gPDwgNiB8IDYzICYgdFthKytdLCByLS07XFxuICAgICAgICAgICAgICAgICAgICAxIDwgciA/IG9baSsrXSA9IDY1NTMzIDogbiA8IDY1NTM2ID8gb1tpKytdID0gbiA6IChuIC09IDY1NTM2LCBvW2krK10gPSA1NTI5NiB8IG4gPj4gMTAgJiAxMDIzLCBvW2krK10gPSA1NjMyMCB8IDEwMjMgJiBuKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBkKG8sIGkpXFxuICAgICAgICAgICAgfSwgYS51dGY4Ym9yZGVyID0gZnVuY3Rpb24odCwgZSkge1xcbiAgICAgICAgICAgICAgICB2YXIgYTtcXG4gICAgICAgICAgICAgICAgZm9yICgoZSA9IGUgfHwgdC5sZW5ndGgpID4gdC5sZW5ndGggJiYgKGUgPSB0Lmxlbmd0aCksIGEgPSBlIC0gMTsgMCA8PSBhICYmIDEyOCA9PSAoMTkyICYgdFthXSk7KSBhLS07XFxuICAgICAgICAgICAgICAgIHJldHVybiBhIDwgMCA/IGUgOiAwID09PSBhID8gZSA6IGEgKyBoW3RbYV1dID4gZSA/IGEgOiBlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIFxcXCIuL2NvbW1vblxcXCI6IDNcXG4gICAgICAgIH1dLFxcbiAgICAgICAgNTogW2Z1bmN0aW9uKHQsIGUsIGEpIHtcXG4gICAgICAgICAgICBcXFwidXNlIHN0cmljdFxcXCI7XFxuICAgICAgICAgICAgZS5leHBvcnRzID0gZnVuY3Rpb24odCwgZSwgYSwgaSkge1xcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBuID0gNjU1MzUgJiB0IHwgMCwgciA9IHQgPj4+IDE2ICYgNjU1MzUgfCAwLCBzID0gMDsgMCAhPT0gYTspIHtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoYSAtPSBzID0gMmUzIDwgYSA/IDJlMyA6IGE7IHIgPSByICsgKG4gPSBuICsgZVtpKytdIHwgMCkgfCAwLCAtLXM7KTtcXG4gICAgICAgICAgICAgICAgICAgIG4gJT0gNjU1MjEsIHIgJT0gNjU1MjFcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gbiB8IHIgPDwgMTYgfCAwXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwge31dLFxcbiAgICAgICAgNjogW2Z1bmN0aW9uKHQsIGUsIGEpIHtcXG4gICAgICAgICAgICBcXFwidXNlIHN0cmljdFxcXCI7XFxuICAgICAgICAgICAgZS5leHBvcnRzID0ge1xcbiAgICAgICAgICAgICAgICBaX05PX0ZMVVNIOiAwLFxcbiAgICAgICAgICAgICAgICBaX1BBUlRJQUxfRkxVU0g6IDEsXFxuICAgICAgICAgICAgICAgIFpfU1lOQ19GTFVTSDogMixcXG4gICAgICAgICAgICAgICAgWl9GVUxMX0ZMVVNIOiAzLFxcbiAgICAgICAgICAgICAgICBaX0ZJTklTSDogNCxcXG4gICAgICAgICAgICAgICAgWl9CTE9DSzogNSxcXG4gICAgICAgICAgICAgICAgWl9UUkVFUzogNixcXG4gICAgICAgICAgICAgICAgWl9PSzogMCxcXG4gICAgICAgICAgICAgICAgWl9TVFJFQU1fRU5EOiAxLFxcbiAgICAgICAgICAgICAgICBaX05FRURfRElDVDogMixcXG4gICAgICAgICAgICAgICAgWl9FUlJOTzogLTEsXFxuICAgICAgICAgICAgICAgIFpfU1RSRUFNX0VSUk9SOiAtMixcXG4gICAgICAgICAgICAgICAgWl9EQVRBX0VSUk9SOiAtMyxcXG4gICAgICAgICAgICAgICAgWl9CVUZfRVJST1I6IC01LFxcbiAgICAgICAgICAgICAgICBaX05PX0NPTVBSRVNTSU9OOiAwLFxcbiAgICAgICAgICAgICAgICBaX0JFU1RfU1BFRUQ6IDEsXFxuICAgICAgICAgICAgICAgIFpfQkVTVF9DT01QUkVTU0lPTjogOSxcXG4gICAgICAgICAgICAgICAgWl9ERUZBVUxUX0NPTVBSRVNTSU9OOiAtMSxcXG4gICAgICAgICAgICAgICAgWl9GSUxURVJFRDogMSxcXG4gICAgICAgICAgICAgICAgWl9IVUZGTUFOX09OTFk6IDIsXFxuICAgICAgICAgICAgICAgIFpfUkxFOiAzLFxcbiAgICAgICAgICAgICAgICBaX0ZJWEVEOiA0LFxcbiAgICAgICAgICAgICAgICBaX0RFRkFVTFRfU1RSQVRFR1k6IDAsXFxuICAgICAgICAgICAgICAgIFpfQklOQVJZOiAwLFxcbiAgICAgICAgICAgICAgICBaX1RFWFQ6IDEsXFxuICAgICAgICAgICAgICAgIFpfVU5LTk9XTjogMixcXG4gICAgICAgICAgICAgICAgWl9ERUZMQVRFRDogOFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIHt9XSxcXG4gICAgICAgIDc6IFtmdW5jdGlvbih0LCBlLCBhKSB7XFxuICAgICAgICAgICAgXFxcInVzZSBzdHJpY3RcXFwiO1xcbiAgICAgICAgICAgIHZhciBvID0gZnVuY3Rpb24oKSB7XFxuICAgICAgICAgICAgICAgIGZvciAodmFyIHQsIGUgPSBbXSwgYSA9IDA7IGEgPCAyNTY7IGErKykge1xcbiAgICAgICAgICAgICAgICAgICAgdCA9IGE7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDg7IGkrKykgdCA9IDEgJiB0ID8gMzk4ODI5MjM4NCBeIHQgPj4+IDEgOiB0ID4+PiAxO1xcbiAgICAgICAgICAgICAgICAgICAgZVthXSA9IHRcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gZVxcbiAgICAgICAgICAgIH0oKTtcXG4gICAgICAgICAgICBlLmV4cG9ydHMgPSBmdW5jdGlvbih0LCBlLCBhLCBpKSB7XFxuICAgICAgICAgICAgICAgIHZhciBuID0gbyxcXG4gICAgICAgICAgICAgICAgICAgIHIgPSBpICsgYTtcXG4gICAgICAgICAgICAgICAgdCBePSAtMTtcXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgcyA9IGk7IHMgPCByOyBzKyspIHQgPSB0ID4+PiA4IF4gblsyNTUgJiAodCBeIGVbc10pXTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIC0xIF4gdFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIHt9XSxcXG4gICAgICAgIDg6IFtmdW5jdGlvbih0LCBlLCBhKSB7XFxuICAgICAgICAgICAgXFxcInVzZSBzdHJpY3RcXFwiO1xcbiAgICAgICAgICAgIHZhciBsLCBfID0gdChcXFwiLi4vdXRpbHMvY29tbW9uXFxcIiksXFxuICAgICAgICAgICAgICAgIGggPSB0KFxcXCIuL3RyZWVzXFxcIiksXFxuICAgICAgICAgICAgICAgIHUgPSB0KFxcXCIuL2FkbGVyMzJcXFwiKSxcXG4gICAgICAgICAgICAgICAgYyA9IHQoXFxcIi4vY3JjMzJcXFwiKSxcXG4gICAgICAgICAgICAgICAgaSA9IHQoXFxcIi4vbWVzc2FnZXNcXFwiKSxcXG4gICAgICAgICAgICAgICAgZCA9IDAsXFxuICAgICAgICAgICAgICAgIGYgPSA0LFxcbiAgICAgICAgICAgICAgICBiID0gMCxcXG4gICAgICAgICAgICAgICAgZyA9IC0yLFxcbiAgICAgICAgICAgICAgICBtID0gLTEsXFxuICAgICAgICAgICAgICAgIHcgPSA0LFxcbiAgICAgICAgICAgICAgICBuID0gMixcXG4gICAgICAgICAgICAgICAgcCA9IDgsXFxuICAgICAgICAgICAgICAgIHYgPSA5LFxcbiAgICAgICAgICAgICAgICByID0gMjg2LFxcbiAgICAgICAgICAgICAgICBzID0gMzAsXFxuICAgICAgICAgICAgICAgIG8gPSAxOSxcXG4gICAgICAgICAgICAgICAgayA9IDIgKiByICsgMSxcXG4gICAgICAgICAgICAgICAgeSA9IDE1LFxcbiAgICAgICAgICAgICAgICB4ID0gMyxcXG4gICAgICAgICAgICAgICAgeiA9IDI1OCxcXG4gICAgICAgICAgICAgICAgQiA9IHogKyB4ICsgMSxcXG4gICAgICAgICAgICAgICAgUyA9IDQyLFxcbiAgICAgICAgICAgICAgICBFID0gMTEzLFxcbiAgICAgICAgICAgICAgICBBID0gMSxcXG4gICAgICAgICAgICAgICAgWiA9IDIsXFxuICAgICAgICAgICAgICAgIFIgPSAzLFxcbiAgICAgICAgICAgICAgICBDID0gNDtcXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBOKHQsIGUpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHQubXNnID0gaVtlXSwgZVxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBPKHQpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICh0IDw8IDEpIC0gKDQgPCB0ID8gOSA6IDApXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIEQodCkge1xcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBlID0gdC5sZW5ndGg7IDAgPD0gLS1lOykgdFtlXSA9IDBcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gSSh0KSB7XFxuICAgICAgICAgICAgICAgIHZhciBlID0gdC5zdGF0ZSxcXG4gICAgICAgICAgICAgICAgICAgIGEgPSBlLnBlbmRpbmc7XFxuICAgICAgICAgICAgICAgIGEgPiB0LmF2YWlsX291dCAmJiAoYSA9IHQuYXZhaWxfb3V0KSwgMCAhPT0gYSAmJiAoXy5hcnJheVNldCh0Lm91dHB1dCwgZS5wZW5kaW5nX2J1ZiwgZS5wZW5kaW5nX291dCwgYSwgdC5uZXh0X291dCksIHQubmV4dF9vdXQgKz0gYSwgZS5wZW5kaW5nX291dCArPSBhLCB0LnRvdGFsX291dCArPSBhLCB0LmF2YWlsX291dCAtPSBhLCBlLnBlbmRpbmcgLT0gYSwgMCA9PT0gZS5wZW5kaW5nICYmIChlLnBlbmRpbmdfb3V0ID0gMCkpXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIFUodCwgZSkge1xcbiAgICAgICAgICAgICAgICBoLl90cl9mbHVzaF9ibG9jayh0LCAwIDw9IHQuYmxvY2tfc3RhcnQgPyB0LmJsb2NrX3N0YXJ0IDogLTEsIHQuc3Ryc3RhcnQgLSB0LmJsb2NrX3N0YXJ0LCBlKSwgdC5ibG9ja19zdGFydCA9IHQuc3Ryc3RhcnQsIEkodC5zdHJtKVxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBUKHQsIGUpIHtcXG4gICAgICAgICAgICAgICAgdC5wZW5kaW5nX2J1Zlt0LnBlbmRpbmcrK10gPSBlXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIEYodCwgZSkge1xcbiAgICAgICAgICAgICAgICB0LnBlbmRpbmdfYnVmW3QucGVuZGluZysrXSA9IGUgPj4+IDggJiAyNTUsIHQucGVuZGluZ19idWZbdC5wZW5kaW5nKytdID0gMjU1ICYgZVxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBMKHQsIGUpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGEsIGksIG4gPSB0Lm1heF9jaGFpbl9sZW5ndGgsXFxuICAgICAgICAgICAgICAgICAgICByID0gdC5zdHJzdGFydCxcXG4gICAgICAgICAgICAgICAgICAgIHMgPSB0LnByZXZfbGVuZ3RoLFxcbiAgICAgICAgICAgICAgICAgICAgbyA9IHQubmljZV9tYXRjaCxcXG4gICAgICAgICAgICAgICAgICAgIGwgPSB0LnN0cnN0YXJ0ID4gdC53X3NpemUgLSBCID8gdC5zdHJzdGFydCAtICh0Lndfc2l6ZSAtIEIpIDogMCxcXG4gICAgICAgICAgICAgICAgICAgIGggPSB0LndpbmRvdyxcXG4gICAgICAgICAgICAgICAgICAgIGQgPSB0LndfbWFzayxcXG4gICAgICAgICAgICAgICAgICAgIGYgPSB0LnByZXYsXFxuICAgICAgICAgICAgICAgICAgICBfID0gdC5zdHJzdGFydCArIHosXFxuICAgICAgICAgICAgICAgICAgICB1ID0gaFtyICsgcyAtIDFdLFxcbiAgICAgICAgICAgICAgICAgICAgYyA9IGhbciArIHNdO1xcbiAgICAgICAgICAgICAgICB0LnByZXZfbGVuZ3RoID49IHQuZ29vZF9tYXRjaCAmJiAobiA+Pj0gMiksIG8gPiB0Lmxvb2thaGVhZCAmJiAobyA9IHQubG9va2FoZWFkKTtcXG4gICAgICAgICAgICAgICAgZG8ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGhbKGEgPSBlKSArIHNdID09PSBjICYmIGhbYSArIHMgLSAxXSA9PT0gdSAmJiBoW2FdID09PSBoW3JdICYmIGhbKythXSA9PT0gaFtyICsgMV0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByICs9IDIsIGErKztcXG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7fSB3aGlsZSAoaFsrK3JdID09PSBoWysrYV0gJiYgaFsrK3JdID09PSBoWysrYV0gJiYgaFsrK3JdID09PSBoWysrYV0gJiYgaFsrK3JdID09PSBoWysrYV0gJiYgaFsrK3JdID09PSBoWysrYV0gJiYgaFsrK3JdID09PSBoWysrYV0gJiYgaFsrK3JdID09PSBoWysrYV0gJiYgaFsrK3JdID09PSBoWysrYV0gJiYgciA8IF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID0geiAtIChfIC0gciksIHIgPSBfIC0geiwgcyA8IGkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHQubWF0Y2hfc3RhcnQgPSBlLCBvIDw9IChzID0gaSkpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gaFtyICsgcyAtIDFdLCBjID0gaFtyICsgc11cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKChlID0gZltlICYgZF0pID4gbCAmJiAwICE9IC0tbik7XFxuICAgICAgICAgICAgICAgIHJldHVybiBzIDw9IHQubG9va2FoZWFkID8gcyA6IHQubG9va2FoZWFkXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIEgodCkge1xcbiAgICAgICAgICAgICAgICB2YXIgZSwgYSwgaSwgbiwgciwgcywgbywgbCwgaCwgZCwgZiA9IHQud19zaXplO1xcbiAgICAgICAgICAgICAgICBkbyB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAobiA9IHQud2luZG93X3NpemUgLSB0Lmxvb2thaGVhZCAtIHQuc3Ryc3RhcnQsIHQuc3Ryc3RhcnQgPj0gZiArIChmIC0gQikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKF8uYXJyYXlTZXQodC53aW5kb3csIHQud2luZG93LCBmLCBmLCAwKSwgdC5tYXRjaF9zdGFydCAtPSBmLCB0LnN0cnN0YXJ0IC09IGYsIHQuYmxvY2tfc3RhcnQgLT0gZiwgZSA9IGEgPSB0Lmhhc2hfc2l6ZTsgaSA9IHQuaGVhZFstLWVdLCB0LmhlYWRbZV0gPSBmIDw9IGkgPyBpIC0gZiA6IDAsIC0tYTspO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoZSA9IGEgPSBmOyBpID0gdC5wcmV2Wy0tZV0sIHQucHJldltlXSA9IGYgPD0gaSA/IGkgLSBmIDogMCwgLS1hOyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbiArPSBmXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gdC5zdHJtLmF2YWlsX2luKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGlmIChzID0gdC5zdHJtLCBvID0gdC53aW5kb3csIGwgPSB0LnN0cnN0YXJ0ICsgdC5sb29rYWhlYWQsIGggPSBuLCBkID0gdm9pZCAwLCBkID0gcy5hdmFpbF9pbiwgaCA8IGQgJiYgKGQgPSBoKSwgYSA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hfc2hpZnQgPSB+figoby5oYXNoX2JpdHMgKyB4IC0gMSkgLyB4KSwgby53aW5kb3cgPSBuZXcgXy5CdWY4KDIgKiBvLndfc2l6ZSksIG8uaGVhZCA9IG5ldyBfLkJ1ZjE2KG8uaGFzaF9zaXplKSwgby5wcmV2ID0gbmV3IF8uQnVmMTYoby53X3NpemUpLCBvLmxpdF9idWZzaXplID0gMSA8PCBuICsgNiwgby5wZW5kaW5nX2J1Zl9zaXplID0gNCAqIG8ubGl0X2J1ZnNpemUsIG8ucGVuZGluZ19idWYgPSBuZXcgXy5CdWY4KG8ucGVuZGluZ19idWZfc2l6ZSksIG8uZF9idWYgPSAxICogby5saXRfYnVmc2l6ZSwgby5sX2J1ZiA9IDMgKiBvLmxpdF9idWZzaXplLCBvLmxldmVsID0gZSwgby5zdHJhdGVneSA9IHIsIG8ubWV0aG9kID0gYSwgcSh0KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsID0gW25ldyBNKDAsIDAsIDAsIDAsIGZ1bmN0aW9uKHQsIGUpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGEgPSA2NTUzNTtcXG4gICAgICAgICAgICAgICAgZm9yIChhID4gdC5wZW5kaW5nX2J1Zl9zaXplIC0gNSAmJiAoYSA9IHQucGVuZGluZ19idWZfc2l6ZSAtIDUpOzspIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh0Lmxvb2thaGVhZCA8PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEgodCksIDAgPT09IHQubG9va2FoZWFkICYmIGUgPT09IGQpIHJldHVybiBBO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSB0Lmxvb2thaGVhZCkgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHQuc3Ryc3RhcnQgKz0gdC5sb29rYWhlYWQsIHQubG9va2FoZWFkID0gMDtcXG4gICAgICAgICAgICAgICAgICAgIHZhciB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gICBpZiAoaS5nemhlYWQubmFtZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSBpLnBlbmRpbmc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaS5wZW5kaW5nID09PSBpLnBlbmRpbmdfYnVmX3NpemUgJiYgKGkuZ3poZWFkLmhjcmMgJiYgaS5wZW5kaW5nID4gbiAmJiAodC5hZGxlciA9IGModC5hZGxlciwgaS5wZW5kaW5nX2J1ZiwgaS5wZW5kaW5nIC0gbiwgbikpLCBJKHQpLCBuID0gaS5wZW5kaW5nLCBpLnBlbmRpbmcgPT09IGkucGVuZGluZ19idWZfc2l6ZSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBUKGksIHIgPSBpLmd6aW5kZXggPCBpLmd6aGVhZC5uYW1lLmxlbmd0aCA/IDI1NSAmIGkuZ3poZWFkLm5hbWUuY2hhckNvZGVBdChpLmd6aW5kZXgrKykgOiAwKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDAgIT09IHIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGkuZ3poZWFkLmhjcmMgJiYgaS5wZW5kaW5nID4gbiAmJiAodC5hZGxlciA9IGModC5hZGxlciwgaS5wZW5kaW5nX2J1ZiwgaS5wZW5kaW5nIC0gbiwgbikpLCAwID09PSByICYmIChpLmd6aW5kZXggPSAwLCBpLnN0YXR1cyA9IDkxKVxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGkuc3RhdHVzID0gOTE7XFxuICAgICAgICAgICAgICAgIGlmICg5MSA9PT0gaS5zdGF0dXMpXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaS5nemhlYWQuY29tbWVudCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSBpLnBlbmRpbmc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaS5wZW5kaW5nID09PSBpLnBlbmRpbmdfYnVmX3NpemUgJiYgKGkuZ3poZWFkLmhjcmMgJiYgaS5wZW5kaW5nID4gbiAmJiAodC5hZGxlciA9IGModC5hZGxlciwgaS5wZW5kaW5nX2J1ZiwgaS5wZW5kaW5nIC0gbiwgbikpLCBJKHQpLCBuID0gaS5wZW5kaW5nLCBpLnBlbmRpbmcgPT09IGkucGVuZGluZ19idWZfc2l6ZSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBUKGksIHIgPSBpLmd6aW5kZXggPCBpLmd6aGVhZC5jb21tZW50Lmxlbmd0aCA/IDI1NSAmIGkuZ3poZWFkLmNvbW1lbnQuY2hhckNvZGVBdChpLmd6aW5kZXgrKykgOiAwKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDAgIT09IHIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGkuZ3poZWFkLmhjcmMgJiYgaS5wZW5kaW5nID4gbiAmJiAodC5hZGxlciA9IGModC5hZGxlciwgaS5wZW5kaW5nX2J1ZiwgaS5wZW5kaW5nIC0gbiwgbikpLCAwID09PSByICYmIChpLnN0YXR1cyA9IDEwMylcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpLnN0YXR1cyA9IDEwMztcXG4gICAgICAgICAgICAgICAgaWYgKDEwMyA9PT0gaS5zdGF0dXMgJiYgKGkuZ3poZWFkLmhjcmMgPyAoaS5wZW5kaW5nICsgMiA+IGkucGVuZGluZ19idWZfc2l6ZSAmJiBJKHQpLCBpLnBlbmRpbmcgKyAyIDw9IGkucGVuZGluZ19idWZfc2l6ZSAmJiAoVChpLCAyNTUgJiB0LmFkbGVyKSwgVChpLCB0LmFkbGVyID4+IDggJiAyNTUpLCB0LmFkbGVyID0gMCwgaS5zdGF0dXMgPSBFKSkgOiBpLnN0YXR1cyA9IEUpLCAwICE9PSBpLnBlbmRpbmcpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChJKHQpLCAwID09PSB0LmF2YWlsX291dCkgcmV0dXJuIGkubGFzdF9mbHVzaCA9IC0xLCBiXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoMCA9PT0gdC5hdmFpbF9pbiAmJiBPKGUpIDw9IE8oYSkgJiYgZSAhPT0gZikgcmV0dXJuIE4odCwgLTUpO1xcbiAgICAgICAgICAgICAgICBpZiAoNjY2ID09PSBpLnN0YXR1cyAmJiAwICE9PSB0LmF2YWlsX2luKSByZXR1cm4gTih0LCAtNSk7XFxuICAgICAgICAgICAgICAgIGlmICgwICE9PSB0LmF2YWlsX2luIHx8IDAgIT09IGkubG9va2FoZWFkIHx8IGUgIT09IGQgJiYgNjY2ICE9PSBpLnN0YXR1cykge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIG8gPSAyID09PSBpLnN0cmF0ZWd5ID8gZnVuY3Rpb24odCwgZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGE7Oykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gdC5sb29rYWhlYWQgJiYgKEgodCksIDAgPT09IHQubG9va2FoZWFkKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUgPT09IGQpIHJldHVybiBBO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodC5tYXRjaF9sZW5ndGggPSAwLCBhID0gaC5fdHJfdGFsbHkodCwgMCwgdC53aW5kb3dbdC5zdHJzdGFydF0pLCB0Lmxvb2thaGVhZC0tLCB0LnN0cnN0YXJ0KyssIGEgJiYgKFUodCwgITEpLCAwID09PSB0LnN0cm0uYXZhaWxfb3V0KSkgcmV0dXJuIEFcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHQuaW5zZXJ0ID0gMCwgZSA9PT0gZiA/IChVKHQsICEwKSwgMCA9PT0gdC5zdHJtLmF2YWlsX291dCA/IFIgOiBDKSA6IHQubGFzdF9saXQgJiYgKFUodCwgITEpLCAwID09PSB0LnN0cm0uYXZhaWxfb3V0KSA/IEEgOiBaXFxuICAgICAgICAgICAgICAgICAgICB9KGksIGUpIDogMyA9PT0gaS5zdHJhdGVneSA/IGZ1bmN0aW9uKHQsIGUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBhLCBpLCBuLCByLCBzID0gdC53aW5kb3c7Oykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodC5sb29rYWhlYWQgPD0geikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEgodCksIHQubG9va2FoZWFkIDw9IHogJiYgZSA9PT0gZCkgcmV0dXJuIEE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gdC5sb29rYWhlYWQpIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHQubWF0Y2hfbGVuZ3RoID0gMCwgdC5sb29rYWhlYWQgPj0geCAmJiAwIDwgdC5zdHJzdGFydCAmJiAoaSA9IHNbbiA9IHQuc3Ryc3RhcnQgLSAxXSkgPT09IHNbKytuXSAmJiBpID09PSBzWysrbl0gJiYgaSA9PT0gc1srK25dKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gdC5zdHJzdGFydCArIHo7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7fSB3aGlsZSAoaSA9PT0gc1srK25dICYmIGkgPT09IHNbKytuXSAmJiBpID09PSBzWysrbl0gJiYgaSA9PT0gc1srK25dICYmIGkgPT09IHNbKytuXSAmJiBpID09PSBzWysrbl0gJiYgaSA9PT0gc1srK25dICYmIGkgPT09IHNbKytuXSAmJiBuIDwgcik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1hdGNoX2xlbmd0aCA9IHogLSAociAtIG4pLCB0Lm1hdGNoX2xlbmd0aCA+IHQubG9va2FoZWFkICYmICh0Lm1hdGNoX2xlbmd0aCA9IHQubG9va2FoZWFkKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0Lm1hdGNoX2xlbmd0aCA+PSB4ID8gKGEgPSBoLl90cl90YWxseSh0LCAxLCB0Lm1hdGNoX2xlbmd0aCAtIHgpLCB0Lmxvb2thaGVhZCAtPSB0Lm1hdGNoX2xlbmd0aCwgdC5zdHJzdGFydCArPSB0Lm1hdGNoX2xlbmd0aCwgdC5tYXRjaF9sZW5ndGggPSAwKSA6IChhID0gaC5fdHJfdGFsbHkodCwgMCwgdC53aW5kb3dbdC5zdHJzdGFydF0pLCB0Lmxvb2thaGVhZC0tLCB0LnN0cnN0YXJ0KyspLCBhICYmIChVKHQsICExKSwgMCA9PT0gdC5zdHJtLmF2YWlsX291dCkpIHJldHVybiBBXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0Lmluc2VydCA9IDAsIGUgPT09IGYgPyAoVSh0LCAhMCksIDAgPT09IHQuc3RybS5hdmFpbF9vdXQgPyBSIDogQykgOiB0Lmxhc3RfbGl0ICY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sX291dCksIG8gPSByICsgKHQuYXZhaWxfb3V0IC0gMjU3KSwgbCA9IGEuZG1heCwgaCA9IGEud3NpemUsIGQgPSBhLndoYXZlLCBmID0gYS53bmV4dCwgXyA9IGEud2luZG93LCB1ID0gYS5ob2xkLCBjID0gYS5iaXRzLCBiID0gYS5sZW5jb2RlLCBnID0gYS5kaXN0Y29kZSwgbSA9ICgxIDw8IGEubGVuYml0cykgLSAxLCB3ID0gKDEgPDwgYS5kaXN0Yml0cykgLSAxO1xcbiAgICAgICAgICAgICAgICB0OiBkbyB7XFxuICAgICAgICAgICAgICAgICAgICBjIDwgMTUgJiYgKHUgKz0gQltpKytdIDw8IGMsIGMgKz0gOCwgdSArPSBCW2krK10gPDwgYywgYyArPSA4KSwgcCA9IGJbdSAmIG1dO1xcbiAgICAgICAgICAgICAgICAgICAgZTogZm9yICg7Oykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1ID4+Pj0gdiA9IHAgPj4+IDI0LCBjIC09IHYsIDAgPT09ICh2ID0gcCA+Pj4gMTYgJiAyNTUpKSBTW3IrK10gPSA2NTUzNSAmIHA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKDE2ICYgdikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09ICg2NCAmIHYpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IGJbKDY1NTM1ICYgcCkgKyAodSAmICgxIDw8IHYpIC0gMSldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIGVcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgzMiAmIHYpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhLm1vZGUgPSAxMjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayB0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXCJpbnZhbGlkIGxpdGVyYWwvbGVuZ3RoIGNvZGVcXFwiLCBhLm1vZGUgPSAzMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIHRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gNjU1MzUgJiBwLCAodiAmPSAxNSkgJiYgKGMgPCB2ICYmICh1ICs9IEJbaSsrXSA8PCBjLCBjICs9IDgpLCBrICs9IHUgJiAoMSA8PCB2KSAtIDEsIHUgPj4+PSB2LCBjIC09IHYpLCBjIDwgMTUgJiYgKHUgKz0gQltpKytdIDw8IGMsIGMgKz0gOCwgdSArPSBCW2krK10gPDwgYywgYyArPSA4KSwgcCA9IGdbdSAmIHddO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhOiBmb3IgKDs7KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodSA+Pj49IHYgPSBwID4+PiAyNCwgYyAtPSB2LCAhKDE2ICYgKHYgPSBwID4+PiAxNiAmIDI1NSkpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT0gKDY0ICYgdikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IGdbKDY1NTM1ICYgcCkgKyAodSAmICgxIDw8IHYpIC0gMSldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZSBhXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcImludmFsaWQgZGlzdGFuY2UgY29kZVxcXCIsIGEubW9kZSA9IDMwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIHRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh5ID0gNjU1MzUgJiBwLCBjIDwgKHYgJj0gMTUpICYmICh1ICs9IEJbaSsrXSA8PCBjLCAoYyArPSA4KSA8IHYgJiYgKHUgKz0gQltpKytdIDw8IGMsIGMgKz0gOCkpLCBsIDwgKHkgKz0gdSAmICgxIDw8IHYpIC0gMSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXCJpbnZhbGlkIGRpc3RhbmNlIHRvbyBmYXIgYmFja1xcXCIsIGEubW9kZSA9IDMwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIHRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1ID4+Pj0gdiwgYyAtPSB2LCAodiA9IHIgLSBzKSA8IHkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZCA8ICh2ID0geSAtIHYpICYmIGEuc2FuZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXCJpbnZhbGlkIGRpc3RhbmNlIHRvbyBmYXIgYmFja1xcXCIsIGEubW9kZSA9IDMwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayB0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh6ID0gXywgKHggPSAwKSA9PT0gZikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoeCArPSBoIC0gdiwgdiA8IGspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoayAtPSB2OyBTW3IrK10gPSBfW3grK10sIC0tdjspO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCA9IHIgLSB5LCB6ID0gU1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChmIDwgdikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoeCArPSBoICsgZiAtIHYsICh2IC09IGYpIDwgaykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChrIC09IHY7IFNbcisrXSA9IF9beCsrXSwgLS12Oyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoeCA9IDAsIGYgPCBrKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChrIC09IHYgPSBmOyBTW3IrK10gPSBfW3grK10sIC0tdjspO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggPSByIC0geSwgeiA9IFNcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoeCArPSBmIC0gdiwgdiA8IGspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChrIC09IHY7IFNbcisrXSA9IF9beCsrXSwgLS12Oyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggPSByIC0geSwgeiA9IFNcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICg7IDIgPCBrOykgU1tyKytdID0gelt4KytdLCBTW3IrK10gPSB6W3grK10sIFNbcisrXSA9IHpbeCsrXSwgayAtPSAzO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgJiYgKFNbcisrXSA9IHpbeCsrXSwgMSA8IGsgJiYgKFNbcisrXSA9IHpbeCsrXSkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoeCA9IHIgLSB5OyBTW3IrK10gPSBTW3grK10sIFNbcisrXSA9IFNbeCsrXSwgU1tyKytdID0gU1t4KytdLCAyIDwgKGsgLT0gMyk7KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrICYmIChTW3IrK10gPSBTW3grK10sIDEgPCBrICYmIChTW3IrK10gPSBTW3grK10pKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IHdoaWxlIChpIDwgbiAmJiByIDwgbyk7XFxuICAgICAgICAgICAgICAgIGkgLT0gayA9IGMgPj4gMywgdSAmPSAoMSA8PCAoYyAtPSBrIDw8IDMpKSAtIDEsIHQubmV4dF9pbiA9IGksIHQubmV4dF9vdXQgPSByLCB0LmF2YWlsX2luID0gaSA8IG4gPyBuIC0gaSArIDUgOiA1IC0gKGkgLSBuKSwgdC5hdmFpbF9vdXQgPSByIDwgbyA/IG8gLSByICsgMjU3IDogMjU3IC0gKHIgLSBvKSwgYS5ob2xkID0gdSwgYS5iaXRzID0gY1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIHt9XSxcXG4gICAgICAgIDExOiBbZnVuY3Rpb24odCwgZSwgYSkge1xcbiAgICAgICAgICAgIFxcXCJ1c2Ugc3RyaWN0XFxcIjtcXG4gICAgICAgICAgICB2YXIgWiA9IHQoXFxcIi4uL3V0aWxzL2NvbW1vblxcXCIpLFxcbiAgICAgICAgICAgICAgICBSID0gdChcXFwiLi9hZGxlcjMyXFxcIiksXFxuICAgICAgICAgICAgICAgIEMgPSB0KFxcXCIuL2NyYzMyXFxcIiksXFxuICAgICAgICAgICAgICAgIE4gPSB0KFxcXCIuL2luZmZhc3RcXFwiKSxcXG4gICAgICAgICAgICAgICAgTyA9IHQoXFxcIi4vaW5mdHJlZXNcXFwiKSxcXG4gICAgICAgICAgICAgICAgRCA9IDEsXFxuICAgICAgICAgICAgICAgIEkgPSAyLFxcbiAgICAgICAgICAgICAgICBVID0gMCxcXG4gICAgICAgICAgICAgICAgVCA9IC0yLFxcbiAgICAgICAgICAgICAgICBGID0gMSxcXG4gICAgICAgICAgICAgICAgaSA9IDg1MixcXG4gICAgICAgICAgICAgICAgbiA9IDU5MjtcXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBMKHQpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICh0ID4+PiAyNCAmIDI1NSkgKyAodCA+Pj4gOCAmIDY1MjgwKSArICgoNjUyODAgJiB0KSA8PCA4KSArICgoMjU1ICYgdCkgPDwgMjQpXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIHIoKSB7XFxuICAgICAgICAgICAgICAgIHRoaXMubW9kZSA9IDAsIHRoaXMubGFzdCA9ICExLCB0aGlzLndyYXAgPSAwLCB0aGlzLmhhdmVkaWN0ID0gITEsIHRoa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UgPSBudWxsKSwgYSkgOiBUXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHZhciBkLCBmLCBfID0gITA7XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gSCh0KSB7XFxuICAgICAgICAgICAgICAgIGlmIChfKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgZTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoZCA9IG5ldyBaLkJ1ZjMyKDUxMiksIGYgPSBuZXcgWi5CdWYzMigzMiksIGUgPSAwOyBlIDwgMTQ0OykgdC5sZW5zW2UrK10gPSA4O1xcbiAgICAgICAgICAgICAgICAgICAgZm9yICg7IGUgPCAyNTY7KSB0LmxlbnNbZSsrXSA9IDk7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKDsgZSA8IDI4MDspIHQubGVuc1tlKytdID0gNztcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoOyBlIDwgMjg4OykgdC5sZW5zW2UrK10gPSA4O1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChPKEQsIHQubGVucywgMCwgMjg4LCBkLCAwLCB0LndvcmssIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYml0czogOVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLCBlID0gMDsgZSA8IDMyOykgdC5sZW5zW2UrK10gPSA1O1xcbiAgICAgICAgICAgICAgICAgICAgTyhJLCB0LmxlbnMsIDAsIDMyLCBmLCAwLCB0LndvcmssIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBiaXRzOiA1XFxuICAgICAgICAgICAgICAgICAgICB9KSwgXyA9ICExXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdC5sZW5jb2RlID0gZCwgdC5sZW5iaXRzID0gOSwgdC5kaXN0Y29kZSA9IGYsIHQuZGlzdGJpdHMgPSA1XFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIGoodCwgZSwgYSwgaSkge1xcbiAgICAgICAgICAgICAgICB2YXIgbiwgciA9IHQuc3RhdGU7XFxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsID09PSByLndpbmRvdyAmJiAoci53c2l6ZSA9IDEgPDwgci53Yml0cywgci53bmV4dCA9IDAsIHIud2hhdmUgPSAwLCByLndpbmRvdyA9IG5ldyBaLkJ1Zjgoci53c2l6ZSkpLCBpID49IHIud3NpemUgPyAoWi5hcnJheVNldChyLndpbmRvdywgZSwgYSAtIHIud3NpemUsIHIud3NpemUsIDApLCByLnduZXh0ID0gMCwgci53aGF2ZSA9IHIud3NpemUpIDogKGkgPCAobiA9IHIud3NpemUgLSByLnduZXh0KSAmJiAobiA9IGkpLCBaLmFycmF5U2V0KHIud2luZG93LCBlLCBhIC0gaSwgbiwgci53bmV4dCksIChpIC09IG4pID8gKFouYXJyYXlTZXQoci53aW5kb3csIGUsIGEgLSBpLCBpLCAwKSwgci53bmV4dCA9IGksIHIud2hhdmUgPSByLndzaXplKSA6IChyLnduZXh0ICs9IG4sIHIud25leHQgPT09IHIud3NpemUgJiYgKHIud25leHQgPSAwKSwgci53aGF2ZSA8IHIud3NpemUgJiYgKHIud2hhdmUgKz0gbikpKSwgMFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBhLmluZmxhdGVSZXNldCA9IG8sIGEuaW5mbGF0ZVJlc2V0MiA9IGwsIGEuaW5mbGF0ZVJlc2V0S2VlcCA9IHMsIGEuaW5mbGF0ZUluaXQgPSBmdW5jdGlvbih0KSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBoKHQsIDE1KVxcbiAgICAgICAgICAgIH0sIGEuaW5mbGF0ZUluaXQyID0gaCwgYS5pbmZsYXRlID0gZnVuY3Rpb24odCwgZSkge1xcbiAgICAgICAgICAgICAgICB2YXIgYSwgaSwgbiwgciwgcywgbywgbCwgaCwgZCwgZiwgXywgdSwgYywgYiwgZywgbSwgdywgcCwgdiwgaywgeSwgeCwgeiwgQiwgUyA9IDAsXFxuICAgICAgICAgICAgICAgICAgICBFID0gbmV3IFouQnVmOCg0KSxcXG4gICAgICAgICAgICAgICAgICAgIEEgPSBbMTYsIDE3LCAxOCwgMCwgOCwgNywgOSwgNiwgMTAsIDUsIDExLCA0LCAxMiwgMywgMTMsIDIsIDE0LCAxLCAxNV07XFxuICAgICAgICAgICAgICAgIGlmICghdCB8fCAhdC5zdGF0ZSB8fCAhdC5vdXRwdXQgfHwgIXQuaW5wdXQgJiYgMCAhPT0gdC5hdmFpbF9pbikgcmV0dXJuIFQ7XFxuICAgICAgICAgICAgICAgIDEyID09PSAoYSA9IHQuc3RhdGUpLm1vZGUgJiYgKGEubW9kZSA9IDEzKSwgcyA9IHQubmV4dF9vdXQsIG4gPSB0Lm91dHB1dCwgbCA9IHQuYXZhaWxfb3V0LCByID0gdC5uZXh0X2luLCBpID0gdC5pbnB1dCwgbyA9IHQuYXZhaWxfaW4sIGggPSBhLmhvbGQsIGQgPSBhLmJpdHMsIGYgPSBvLCBfID0gbCwgeCA9IFU7XFxuICAgICAgICAgICAgICAgIHQ6IGZvciAoOzspIHN3aXRjaCAoYS5tb2RlKSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIEY6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IGEud3JhcCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhLm1vZGUgPSAxMztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICg7IGQgPCAxNjspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgyICYgYS53cmFwICYmIDM1NjE1ID09PSBoKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVbYS5jaGVjayA9IDBdID0gMjU1ICYgaCwgRVsxXSA9IGggPj4+IDggJiAyNTUsIGEuY2hlY2sgPSBDKGEuY2hlY2ssIEUsIDIsIDApLCBkID0gaCA9IDAsIGEubW9kZSA9IDI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhLmZsYWdzID0gMCwgYS5oZWFkICYmIChhLmhlYWQuZG9uZSA9ICExKSwgISgxICYgYS53cmFwKSB8fCAoKCgyNTUgJiBoKSA8PCA4KSArIChoID4+IDgpKSAlIDMxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcImluY29ycmVjdCBoZWFkZXIgY2hlY2tcXFwiLCBhLm1vZGUgPSAzMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDggIT0gKDE1ICYgaCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFwidW5rbm93biBjb21wcmVzc2lvbiBtZXRob2RcXFwiLCBhLm1vZGUgPSAzMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGQgLT0gNCwgeSA9IDggKyAoMTUgJiAoaCA+Pj49IDQpKSwgMCA9PT0gYS53Yml0cykgYS53Yml0cyA9IHk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoeSA+IGEud2JpdHMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFwiaW52YWxpZCB3aW5kb3cgc2l6ZVxcXCIsIGEubW9kZSA9IDMwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBhLmRtYXggPSAxIDw8IHksIHQuYWRsZXIgPSBhLmNoZWNrID0gMSwgYS5tb2RlID0gNTEyICYgaCA/IDEwIDogMTIsIGQgPSBoID0gMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgZCA8IDE2Oykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgby0tLCBoICs9IGlbcisrXSA8PCBkLCBkICs9IDhcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGEuZmxhZ3MgPSBoLCA4ICE9ICgyNTUgJiBhLmZsYWdzKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXCJ1bmtub3duIGNvbXByZXNzaW9uIG1ldGhvZFxcXCIsIGEubW9kZSA9IDMwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoNTczNDQgJiBhLmZsYWdzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcInVua25vd24gaGVhZGVyIGZsYWdzIHNldFxcXCIsIGEubW9kZSA9IDMwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBhLmhlYWQgJiYgKGEuaGVhZC50ZXh0ID0gaCA+PiA4ICYgMSksIDUxMiAmIGEuZmxhZ3MgJiYgKEVbMF0gPSAyNTUgJiBoLCBFWzFdID0gaCA+Pj4gOCAmIDI1NSwgYS5jaGVjayA9IEMoYS5jaGVjaywgRSwgMiwgMCkpLCBkID0gaCA9IDAsIGEubW9kZSA9IDM7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDM6XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICg7IGQgPCAzMjspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGEuaGVhZCAmJiAoYS5oZWFkLnRpbWUgPSBoKSwgNTEyICYgYS5mbGFncyAmJiAoRVswXSA9IDI1NSAmIGgsIEVbMV0gPSBoID4+PiA4ICYgMjU1LCBFWzJdID0gaCA+Pj4gMTYgJiAyNTUsIEVbM10gPSBoID4+PiAyNCAmIDI1NSwgYS5jaGVjayA9IEMoYS5jaGVjaywgRSwgNCwgMCkpLCBkID0gaCA9IDAsIGEubW9kZSA9IDQ7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICg7IGQgPCAxNjspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGEuaGVhZCAmJiAoYS5oZWFkLnhmbGFncyA9IDI1NSAmIGgsIGEuaGVhZC5vcyA9IGggPj4gOCksIDUxMiAmIGEuZmxhZ3MgJiYgKEVbMF0gPSAyNTUgJiBoLCBFWzFdID0gaCA+Pj4gOCAmIDI1NSwgYS5jaGVjayA9IEMoYS5jaGVjaywgRSwgMiwgMCkpLCBkID0gaCA9IDAsIGEubW9kZSA9IDU7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDU6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDEwMjQgJiBhLmZsYWdzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBkIDwgMTY7KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYS5sZW5ndGggPSBoLCBhLmhlYWQgJiYgKGEuaGVhZC5leHRyYV9sZW4gPSBoKSwgNTEyICYgYS5mbGFncyAmJiAoRVswXSA9IDI1NSAmIGgsIEVbMV0gPSBoID4+PiA4ICYgMjU1LCBhLmNoZWNrID0gQyhhLmNoZWNrLCBFLCAyLCAwKSksIGQgPSBoID0gMFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBhLmhlYWQgJiYgKGEuaGVhZC5leHRyYSA9IG51bGwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGEubW9kZSA9IDY7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDY6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDEwMjQgJiBhLmZsYWdzICYmIChvIDwgKHUgPSBhLmxlbmd0aCkgJiYgKHUgPSBvKSwgdSAmJiAoYS5oZWFkICYmICh5ID0gYS5oZWFkLmV4dHJhX2xlbiAtIGEubGVuZ3RoLCBhLmhlYWQuZXh0cmEgfHwgKGEuaGVhZC5leHRyYSA9IG5ldyBBcnJheShhLmhlYWQuZXh0cmFfbGVuKSksIFouYXJyYXlTZXQoYS5oZWFkLmV4dHJhLCBpLCByLCB1LCB5KSksIDUxMiAmIGEuZmxhZ3MgJiYgKGEuY2hlY2sgPSBDKGEuY2hlY2ssIGksIHUsIHIpKSwgbyAtPSB1LCByICs9IHUsIGEubGVuZ3RoIC09IHUpLCBhLmxlbmd0aCkpIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYS5sZW5ndGggPSAwLCBhLm1vZGUgPSA3O1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA3OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgyMDQ4ICYgYS5mbGFncykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh1ID0gMDsgeSA9IGlbciArIHUrK10sIGEuaGVhZCAmJiB5ICYmIGEubGVuZ3RoIDwgNjU1MzYgJiYgKGEuaGVhZC5uYW1lICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoeSkpLCB5ICYmIHUgPCBvOyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICg1MTIgJiBhLmZsYWdzICYmIChhLmNoZWNrID0gQyhhLmNoZWNrLCBpLCB1LCByKSksIG8gLT0gdSwgciArPSB1LCB5KSBicmVhayB0XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGEuaGVhZCAmJiAoYS5oZWFkLm5hbWUgPSBudWxsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBhLmxlbmd0aCA9IDAsIGEubW9kZSA9IDg7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDg6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDQwOTYgJiBhLmZsYWdzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHUgPSAwOyB5ID0gaVtyICsgdSsrXSwgYS5oZWFkICYmIHkgJiYgYS5sZW5ndGggPCA2NTUzNiAmJiAoYS5oZWFkLmNvbW1lbnQgKz0gU3RyaW5nLmZyb21DaGFyQ29kZSh5KSksIHkgJiYgdSA8IG87KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDUxMiAmIGEuZmxhZ3MgJiYgKGEuY2hlY2sgPSBDKGEuY2hlY2ssIGksIHUsIHIpKSwgbyAtPSB1LCByICs9IHUsIHkpIGJyZWFrIHRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgYS5oZWFkICYmIChhLmhlYWQuY29tbWVudCA9IG51bGwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGEubW9kZSA9IDk7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDk6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDUxMiAmIGEuZmxhZ3MpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICg7IGQgPCAxNjspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgby0tLCBoICs9IGlbcisrXSA8PCBkLCBkICs9IDhcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaCAhPT0gKDY1NTM1ICYgYS5jaGVjaykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcImhlYWRlciBjcmMgbWlzbWF0Y2hcXFwiLCBhLm1vZGUgPSAzMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IGggPSAwXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGEuaGVhZCAmJiAoYS5oZWFkLmhjcmMgPSBhLmZsYWdzID4+IDkgJiAxLCBhLmhlYWQuZG9uZSA9ICEwKSwgdC5hZGxlciA9IGEuY2hlY2sgPSAwLCBhLm1vZGUgPSAxMjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTA6XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICg7IGQgPCAzMjspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHQuYWRsZXIgPSBhLmNoZWNrID0gTChoKSwgZCA9IGggPSAwLCBhLm1vZGUgPSAxMTtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTE6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IGEuaGF2ZWRpY3QpIHJldHVybiB0Lm5leHRfb3V0ID0gcywgdC5hdmFpbF9vdXQgPSBsLCB0Lm5leHRfaW4gPSByLCB0LmF2YWlsX2luID0gbywgYS5ob2xkID0gaCwgYS5iaXRzID0gZCwgMjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0LmFkbGVyID0gYS5jaGVjayA9IDEsIGEubW9kZSA9IDEyO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxMjpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoNSA9PT0gZSB8fCA2ID09PSBlKSBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxMzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5sYXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggPj4+PSA3ICYgZCwgZCAtPSA3ICYgZCwgYS5tb2RlID0gMjc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBkIDwgMzspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoYS5sYXN0ID0gMSAmIGgsIGQgLT0gMSwgMyAmIChoID4+Pj0gMSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYS5tb2RlID0gMTQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEgoYSksIGEubW9kZSA9IDIwLCA2ICE9PSBlKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggPj4+PSAyLCBkIC09IDI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhLm1vZGUgPSAxNztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDM6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXCJpbnZhbGlkIGJsb2NrIHR5cGVcXFwiLCBhLm1vZGUgPSAzMFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBoID4+Pj0gMiwgZCAtPSAyO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxNDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGggPj4+PSA3ICYgZCwgZCAtPSA3ICYgZDsgZCA8IDMyOykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgby0tLCBoICs9IGlbcisrXSA8PCBkLCBkICs9IDhcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCg2NTUzNSAmIGgpICE9IChoID4+PiAxNiBeIDY1NTM1KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXCJpbnZhbGlkIHN0b3JlZCBibG9jayBsZW5ndGhzXFxcIiwgYS5tb2RlID0gMzA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhLmxlbmd0aCA9IDY1NTM1ICYgaCwgZCA9IGggPSAwLCBhLm1vZGUgPSAxNSwgNiA9PT0gZSkgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTU6XFxuICAgICAgICAgICAgICAgICAgICAgICAgYS5tb2RlID0gMTY7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDE2OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1ID0gYS5sZW5ndGgpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG8gPCB1ICYmICh1ID0gbyksIGwgPCB1ICYmICh1ID0gbCksIDAgPT09IHUpIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFouYXJyYXlTZXQobiwgaSwgciwgdSwgcyksIG8gLT0gdSwgciArPSB1LCBsIC09IHUsIHMgKz0gdSwgYS5sZW5ndGggLT0gdTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYS5tb2RlID0gMTI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDE3OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBkIDwgMTQ7KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5ubGVuID0gMjU3ICsgKDMxICYgaCksIGggPj4+PSA1LCBkIC09IDUsIGEubmRpc3QgPSAxICsgKDMxICYgaCksIGggPj4+PSA1LCBkIC09IDUsIGEubmNvZGUgPSA0ICsgKDE1ICYgaCksIGggPj4+PSA0LCBkIC09IDQsIDI4NiA8IGEubmxlbiB8fCAzMCA8IGEubmRpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFwidG9vIG1hbnkgbGVuZ3RoIG9yIGRpc3RhbmNlIHN5bWJvbHNcXFwiLCBhLm1vZGUgPSAzMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYS5oYXZlID0gMCwgYS5tb2RlID0gMTg7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDE4OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBhLmhhdmUgPCBhLm5jb2RlOykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgZCA8IDM7KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYS5sZW5zW0FbYS5oYXZlKytdXSA9IDcgJiBoLCBoID4+Pj0gMywgZCAtPSAzXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBhLmhhdmUgPCAxOTspIGEubGVuc1tBW2EuaGF2ZSsrXV0gPSAwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhLmxlbmNvZGUgPSBhLmxlbmR5biwgYS5sZW5iaXRzID0gNywgeiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJpdHM6IGEubGVuYml0c1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB4ID0gTygwLCBhLmxlbnMsIDAsIDE5LCBhLmxlbmNvZGUsIDAsIGEud29yaywgeiksIGEubGVuYml0cyA9IHouYml0cywgeCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXCJpbnZhbGlkIGNvZGUgbGVuZ3RocyBzZXRcXFwiLCBhLm1vZGUgPSAzMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYS5oYXZlID0gMCwgYS5tb2RlID0gMTk7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDE5OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBhLmhhdmUgPCBhLm5sZW4gKyBhLm5kaXN0Oykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgbSA9IChTID0gYS5sZW5jb2RlW2ggJiAoMSA8PCBhLmxlbmJpdHMpIC0gMV0pID4+PiAxNiAmIDI1NSwgdyA9IDY1NTM1ICYgUywgISgoZyA9IFMgPj4+IDI0KSA8PSBkKTspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgby0tLCBoICs9IGlbcisrXSA8PCBkLCBkICs9IDhcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodyA8IDE2KSBoID4+Pj0gZywgZCAtPSBnLCBhLmxlbnNbYS5oYXZlKytdID0gdztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMTYgPT09IHcpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKEIgPSBnICsgMjsgZCA8IEI7KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaCA+Pj49IGcsIGQgLT0gZywgMCA9PT0gYS5oYXZlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcImludmFsaWQgYml0IGxlbmd0aCByZXBlYXRcXFwiLCBhLm1vZGUgPSAzMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeSA9IGEubGVuc1thLmhhdmUgLSAxXSwgdSA9IDMgKyAoMyAmIGgpLCBoID4+Pj0gMiwgZCAtPSAyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKDE3ID09PSB3KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChCID0gZyArIDM7IGQgPCBCOykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgby0tLCBoICs9IGlbcisrXSA8PCBkLCBkICs9IDhcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCAtPSBnLCB5ID0gMCwgdSA9IDMgKyAoNyAmIChoID4+Pj0gZykpLCBoID4+Pj0gMywgZCAtPSAzXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoQiA9IGcgKyA3OyBkIDwgQjspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgLT0gZywgeSA9IDAsIHUgPSAxMSArICgxMjcgJiAoaCA+Pj49IGcpKSwgaCA+Pj49IDcsIGQgLT0gN1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGEuaGF2ZSArIHUgPiBhLm5sZW4gKyBhLm5kaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFwiaW52YWxpZCBiaXQgbGVuZ3RoIHJlcGVhdFxcXCIsIGEubW9kZSA9IDMwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgdS0tOykgYS5sZW5zW2EuaGF2ZSsrXSA9IHlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoMzAgPT09IGEubW9kZSkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IGEubGVuc1syNTZdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcImludmFsaWQgY29kZSAtLSBtaXNzaW5nIGVuZC1vZi1ibG9ja1xcXCIsIGEubW9kZSA9IDMwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5sZW5iaXRzID0gOSwgeiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJpdHM6IGEubGVuYml0c1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB4ID0gTyhELCBhLmxlbnMsIDAsIGEubmxlbiwgYS5sZW5jb2RlLCAwLCBhLndvcmssIHopLCBhLmxlbmJpdHMgPSB6LmJpdHMsIHgpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFwiaW52YWxpZCBsaXRlcmFsL2xlbmd0aHMgc2V0XFxcIiwgYS5tb2RlID0gMzA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhLmRpc3RiaXRzID0gNiwgYS5kaXN0Y29kZSA9IGEuZGlzdGR5biwgeiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJpdHM6IGEuZGlzdGJpdHNcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgeCA9IE8oSSwgYS5sZW5zLCBhLm5sZW4sIGEubmRpc3QsIGEuZGlzdGNvZGUsIDAsIGEud29yaywgeiksIGEuZGlzdGJpdHMgPSB6LmJpdHMsIHgpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFwiaW52YWxpZCBkaXN0YW5jZXMgc2V0XFxcIiwgYS5tb2RlID0gMzA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhLm1vZGUgPSAyMCwgNiA9PT0gZSkgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjA6XFxuICAgICAgICAgICAgICAgICAgICAgICAgYS5tb2RlID0gMjE7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDIxOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICg2IDw9IG8gJiYgMjU4IDw9IGwpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5uZXh0X291dCA9IHMsIHQuYXZhaWxfb3V0ID0gbCwgdC5uZXh0X2luID0gciwgdC5hdmFpbF9pbiA9IG8sIGEuaG9sZCA9IGgsIGEuYml0cyA9IGQsIE4odCwgXyksIHMgPSB0Lm5leHRfb3V0LCBuID0gdC5vdXRwdXQsIGwgPSB0LmF2YWlsX291dCwgciA9IHQubmV4dF9pbiwgaSA9IHQuaW5wdXQsIG8gPSB0LmF2YWlsX2luLCBoID0gYS5ob2xkLCBkID0gYS5iaXRzLCAxMiA9PT0gYS5tb2RlICYmIChhLmJhY2sgPSAtMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoYS5iYWNrID0gMDsgbSA9IChTID0gYS5sZW5jb2RlW2ggJiAoMSA8PCBhLmxlbmJpdHMpIC0gMV0pID4+PiAxNiAmIDI1NSwgdyA9IDY1NTM1ICYgUywgISgoZyA9IFMgPj4+IDI0KSA8PSBkKTspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtICYmIDAgPT0gKDI0MCAmIG0pKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAocCA9IGcsIHYgPSBtLCBrID0gdzsgbSA9IChTID0gYS5sZW5jb2RlW2sgKyAoKGggJiAoMSA8PCBwICsgdikgLSAxKSA+PiBwKV0pID4+PiAxNiAmIDI1NSwgdyA9IDY1NTM1ICYgUywgIShwICsgKGcgPSBTID4+PiAyNCkgPD0gZCk7KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA+Pj49IHAsIGQgLT0gcCwgYS5iYWNrICs9IHBcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGggPj4+PSBnLCBkIC09IGcsIGEuYmFjayArPSBnLCBhLmxlbmd0aCA9IHcsIDAgPT09IG0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYS5tb2RlID0gMjY7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgzMiAmIG0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYS5iYWNrID0gLTEsIGEubW9kZSA9IDEyO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoNjQgJiBtKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcImludmFsaWQgbGl0ZXJhbC9sZW5ndGggY29kZVxcXCIsIGEubW9kZSA9IDMwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBhLmV4dHJhID0gMTUgJiBtLCBhLm1vZGUgPSAyMjtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGEuZXh0cmEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChCID0gYS5leHRyYTsgZCA8IEI7KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYS5sZW5ndGggKz0gaCAmICgxIDw8IGEuZXh0cmEpIC0gMSwgaCA+Pj49IGEuZXh0cmEsIGQgLT0gYS5leHRyYSwgYS5iYWNrICs9IGEuZXh0cmFcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYS53YXMgPSBhLmxlbmd0aCwgYS5tb2RlID0gMjM7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDIzOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBtID0gKFMgPSBhLmRpc3Rjb2RlW2ggJiAoMSA8PCBhLmRpc3RiaXRzKSAtIDFdKSA+Pj4gMTYgJiAyNTUsIHcgPSA2NTUzNSAmIFMsICEoKGcgPSBTID4+PiAyNCkgPD0gZCk7KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PSAoMjQwICYgbSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChwID0gZywgdiA9IG0sIGsgPSB3OyBtID0gKFMgPSBhLmRpc3Rjb2RlW2sgKyAoKGggJiAoMSA8PCBwICsgdikgLSAxKSA+PiBwKV0pID4+PiAxNiAmIDI1NSwgdyA9IDY1NTM1ICYgUywgIShwICsgKGcgPSBTID4+PiAyNCkgPD0gZCk7KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA+Pj49IHAsIGQgLT0gcCwgYS5iYWNrICs9IHBcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGggPj4+PSBnLCBkIC09IGcsIGEuYmFjayArPSBnLCA2NCAmIG0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFwiaW52YWxpZCBkaXN0YW5jZSBjb2RlXFxcIiwgYS5tb2RlID0gMzA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGEub2Zmc2V0ID0gdywgYS5leHRyYSA9IDE1ICYgbSwgYS5tb2RlID0gMjQ7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDI0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhLmV4dHJhKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoQiA9IGEuZXh0cmE7IGQgPCBCOykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEub2Zmc2V0ICs9IGggJiAoMSA8PCBhLmV4dHJhKSAtIDEsIGggPj4+PSBhLmV4dHJhLCBkIC09IGEuZXh0cmEsIGEuYmFjayArPSBhLmV4dHJhXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhLm9mZnNldCA+IGEuZG1heCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXCJpbnZhbGlkIGRpc3RhbmNlIHRvbyBmYXIgYmFja1xcXCIsIGEubW9kZSA9IDMwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBhLm1vZGUgPSAyNTtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjU6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IGwpIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHUgPSBfIC0gbCwgYS5vZmZzZXQgPiB1KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodSA9IGEub2Zmc2V0IC0gdSkgPiBhLndoYXZlICYmIGEuc2FuZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFwiaW52YWxpZCBkaXN0YW5jZSB0b28gZmFyIGJhY2tcXFwiLCBhLm1vZGUgPSAzMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA+IGEud25leHQgPyAodSAtPSBhLnduZXh0LCBjID0gYS53c2l6ZSAtIHUpIDogYyA9IGEud25leHQgLSB1LCB1ID4gYS5sZW5ndGggJiYgKHUgPSBhLmxlbmd0aCksIGIgPSBhLndpbmRvd1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBiID0gbiwgYyA9IHMgLSBhLm9mZnNldCwgdSA9IGEubGVuZ3RoO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobCA8IHUgJiYgKHUgPSBsKSwgbCAtPSB1LCBhLmxlbmd0aCAtPSB1OyBuW3MrK10gPSBiW2MrK10sIC0tdTspO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIDAgPT09IGEubGVuZ3RoICYmIChhLm1vZGUgPSAyMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDI2OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBsKSBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG5bcysrXSA9IGEubGVuZ3RoLCBsLS0sIGEubW9kZSA9IDIxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyNzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS53cmFwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBkIDwgMzI7KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCB8PSBpW3IrK10gPDwgZCwgZCArPSA4XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8gLT0gbCwgdC50b3RhbF9vdXQgKz0gXywgYS50b3RhbCArPSBfLCBfICYmICh0LmFkbGVyID0gYS5jaGVjayA9IGEuZmxhZ3MgPyBDKGEuY2hlY2ssIG4sIF8sIHMgLSBfKSA6IFIoYS5jaGVjaywgbiwgXywgcyAtIF8pKSwgXyA9IGwsIChhLmZsYWdzID8gaCA6IEwoaCkpICE9PSBhLmNoZWNrKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXCJpbmNvcnJlY3QgZGF0YSBjaGVja1xcXCIsIGEubW9kZSA9IDMwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gaCA9IDBcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYS5tb2RlID0gMjg7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDI4OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhLndyYXAgJiYgYS5mbGFncykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgZCA8IDMyOykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoICE9PSAoNDI5NDk2NzI5NSAmIGEudG90YWwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXCJpbmNvcnJlY3QgbGVuZ3RoIGNoZWNrXFxcIiwgYS5tb2RlID0gMzA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSBoID0gMFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBhLm1vZGUgPSAyOTtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjk6XFxuICAgICAgICAgICAgICAgICAgICAgICAgeCA9IDE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzA6XFxuICAgICAgICAgICAgICAgICAgICAgICAgeCA9IC0zO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDMxOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtNDtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzI6XFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBUXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIHQubmV4dF9vdXQgPSBzLCB0LmF2YWlsX291dCA9IGwsIHQubmV4dF9pbiA9IHIsIHQuYXZhaWxfaW4gPSBvLCBhLmhvbGQgPSBoLCBhLmJpdHMgPSBkLCAoYS53c2l6ZSB8fCBfICE9PSB0LmF2YWlsX291dCAmJiBhLm1vZGUgPCAzMCAmJiAoYS5tb2RlIDwgMjcgfHwgNCAhPT0gZSkpICYmIGoodCwgdC5vdXRwdXQsIHQubmV4dF9vdXQsIF8gLSB0LmF2YWlsX291dCkgPyAoYS5tb2RlID0gMzEsIC00KSA6IChmIC09IHQuYXZhaWxfaW4sIF8gLT0gdC5hdmFpbF9vdXQsIHQudG90YWxfaW4gKz0gZiwgdC50b3RhbF9vdXQgKz0gXywgYS50b3RhbCArPSBfLCBhLndyYXAgJiYgXyAmJiAodC5hZGxlciA9IGEuY2hlY2sgPSBhLmZsYWdzID8gQyhhLmNoZWNrLCBuLCBfLCB0Lm5leHRfb3V0IC0gXykgOiBSKGEuY2hlY2ssIG4sIF8sIHQubmV4dF9vdXQgLSBfKSksIHQuZGF0YV90eXBlID0gYS5iaXRzICsgKGEubGFzdCA/IDY0IDogMCkgKyAoMTIgPT09IGEubW9kZSA/IDEyOCA6IDApICsgKDIwID09PSBhLm1vZGUgfHwgMTUgPT09IGEubW9kZSA/IDI1NiA6IDApLCAoMCA9PT0gZiAmJiAwID09PSBfIHx8IDQgPT09IGUpICYmIHggPT09IFUgJiYgKHggPSAtNSksIHgpXFxuICAgICAgICAgICAgfSwgYS5pbmZsYXRlRW5kID0gZnVuY3Rpb24odCkge1xcbiAgICAgICAgICAgICAgICBpZiAoIXQgfHwgIXQuc3RhdGUpIHJldHVybiBUO1xcbiAgICAgICAgICAgICAgICB2YXIgZSA9IHQuc3RhdGU7XFxuICAgICAgICAgICAgICAgIHJldHVybiBlLndpbmRvdyAmJiAoZS53aW5kb3cgPSBudWxsKSwgdC5zdGF0ZSA9IG51bGwsIFVcXG4gICAgICAgICAgICB9LCBhLmluZmxhdGVHZXRIZWFkZXIgPSBmdW5jdGlvbih0LCBlKSB7XFxuICAgICAgICAgICAgICAgIHZhciBhO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdCAmJiB0LnN0YXRlID8gMCA9PSAoMiAmIChhID0gdC5zdGF0ZSkud3JhcCkgPyBUIDogKChhLmhlYWQgPSBlKS5kb25lID0gITEsIFUpIDogVFxcbiAgICAgICAgICAgIH0sIGEuaW5mbGF0ZVNldERpY3Rpb25hcnkgPSBmdW5jdGlvbih0LCBlKSB7XFxuICAgICAgICAgICAgICAgIHZhciBhLCBpID0gZS5sZW5ndGg7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0ICYmIHQuc3RhdGUgPyAwICE9PSAoYSA9IHQuc3RhdGUpLndyYXAgJiYgMTEgIT09IGEubW9kZSA/IFQgOiAxMSA9PT0gYS5tb2RlICYmIFIoMSwgZSwgaSwgMCkgIT09IGEuY2hlY2sgPyAtMyA6IGoodCwgZSwgaSwgaSkgPyAoYS5tb2RlID0gMzEsIC00KSA6IChhLmhhdmVkaWN0ID0gMSwgVSkgOiBUXFxuICAgICAgICAgICAgfSwgYS5pb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CAxMjI4OSwgMTYzODUsIDI0NTc3LCAwLCAwXSxcXG4gICAgICAgICAgICAgICAgRiA9IFsxNiwgMTYsIDE2LCAxNiwgMTcsIDE3LCAxOCwgMTgsIDE5LCAxOSwgMjAsIDIwLCAyMSwgMjEsIDIyLCAyMiwgMjMsIDIzLCAyNCwgMjQsIDI1LCAyNSwgMjYsIDI2LCAyNywgMjcsIDI4LCAyOCwgMjksIDI5LCA2NCwgNjRdO1xcbiAgICAgICAgICAgIGUuZXhwb3J0cyA9IGZ1bmN0aW9uKHQsIGUsIGEsIGksIG4sIHIsIHMsIG8pIHtcXG4gICAgICAgICAgICAgICAgdmFyIGwsIGgsIGQsIGYsIF8sIHUsIGMsIGIsIGcsIG0gPSBvLmJpdHMsXFxuICAgICAgICAgICAgICAgICAgICB3ID0gMCxcXG4gICAgICAgICAgICAgICAgICAgIHAgPSAwLFxcbiAgICAgICAgICAgICAgICAgICAgdiA9IDAsXFxuICAgICAgICAgICAgICAgICAgICBrID0gMCxcXG4gICAgICAgICAgICAgICAgICAgIHkgPSAwLFxcbiAgICAgICAgICAgICAgICAgICAgeCA9IDAsXFxuICAgICAgICAgICAgICAgICAgICB6ID0gMCxcXG4gICAgICAgICAgICAgICAgICAgIEIgPSAwLFxcbiAgICAgICAgICAgICAgICAgICAgUyA9IDAsXFxuICAgICAgICAgICAgICAgICAgICBFID0gMCxcXG4gICAgICAgICAgICAgICAgICAgIEEgPSBudWxsLFxcbiAgICAgICAgICAgICAgICAgICAgWiA9IDAsXFxuICAgICAgICAgICAgICAgICAgICBSID0gbmV3IEQuQnVmMTYoMTYpLFxcbiAgICAgICAgICAgICAgICAgICAgQyA9IG5ldyBELkJ1ZjE2KDE2KSxcXG4gICAgICAgICAgICAgICAgICAgIE4gPSBudWxsLFxcbiAgICAgICAgICAgICAgICAgICAgTyA9IDA7XFxuICAgICAgICAgICAgICAgIGZvciAodyA9IDA7IHcgPD0gMTU7IHcrKykgUlt3XSA9IDA7XFxuICAgICAgICAgICAgICAgIGZvciAocCA9IDA7IHAgPCBpOyBwKyspIFJbZVthICsgcF1dKys7XFxuICAgICAgICAgICAgICAgIGZvciAoeSA9IG0sIGsgPSAxNTsgMSA8PSBrICYmIDAgPT09IFJba107IGstLSk7XFxuICAgICAgICAgICAgICAgIGlmIChrIDwgeSAmJiAoeSA9IGspLCAwID09PSBrKSByZXR1cm4gbltyKytdID0gMjA5NzE1MjAsIG5bcisrXSA9IDIwOTcxNTIwLCBvLmJpdHMgPSAxLCAwO1xcbiAgICAgICAgICAgICAgICBmb3IgKHYgPSAxOyB2IDwgayAmJiAwID09PSBSW3ZdOyB2KyspO1xcbiAgICAgICAgICAgICAgICBmb3IgKHkgPCB2ICYmICh5ID0gdiksIHcgPSBCID0gMTsgdyA8PSAxNTsgdysrKVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKEIgPDw9IDEsIChCIC09IFJbd10pIDwgMCkgcmV0dXJuIC0xO1xcbiAgICAgICAgICAgICAgICBpZiAoMCA8IEIgJiYgKDAgPT09IHQgfHwgMSAhPT0gaykpIHJldHVybiAtMTtcXG4gICAgICAgICAgICAgICAgZm9yIChDWzFdID0gMCwgdyA9IDE7IHcgPCAxNTsgdysrKSBDW3cgKyAxXSA9IENbd10gKyBSW3ddO1xcbiAgICAgICAgICAgICAgICBmb3IgKHAgPSAwOyBwIDwgaTsgcCsrKSAwICE9PSBlW2EgKyBwXSAmJiAoc1tDW2VbYSArIHBdXSsrXSA9IHApO1xcbiAgICAgICAgICAgICAgICBpZiAoMCA9PT0gdCA/IChBID0gTiA9IHMsIHUgPSAxOSkgOiAxID09PSB0ID8gKEEgPSBJLCBaIC09IDI1NywgTiA9IFUsIE8gLT0gMjU3LCB1ID0gMjU2KSA6IChBID0gVCwgTiA9IEYsIHUgPSAtMSksIHcgPSB2LCBfID0gciwgeiA9IHAgPSBFID0gMCwgZCA9IC0xLCBmID0gKFMgPSAxIDw8ICh4ID0geSkpIC0gMSwgMSA9PT0gdCAmJiA4NTIgPCBTIHx8IDIgPT09IHQgJiYgNTkyIDwgUykgcmV0dXJuIDE7XFxuICAgICAgICAgICAgICAgIGZvciAoOzspIHtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoYyA9IHcgLSB6LCBzW3BdIDwgdSA/IChiID0gMCwgZyA9IHNbcF0pIDogc1twXSA+IHUgPyAoYiA9IE5bTyArIHNbcF1dLCBnID0gQVtaICsgc1twXV0pIDogKGIgPSA5NiwgZyA9IDApLCBsID0gMSA8PCB3IC0geiwgdiA9IGggPSAxIDw8IHg7IG5bXyArIChFID4+IHopICsgKGggLT0gbCldID0gYyA8PCAyNCB8IGIgPDwgMTYgfCBnIHwgMCwgMCAhPT0gaDspO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsID0gMSA8PCB3IC0gMTsgRSAmIGw7KSBsID4+PSAxO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKDAgIT09IGwgPyAoRSAmPSBsIC0gMSwgRSArPSBsKSA6IEUgPSAwLCBwKyssIDAgPT0gLS1SW3ddKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHcgPT09IGspIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHcgPSBlW2EgKyBzW3BdXVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHkgPCB3ICYmIChFICYgZikgIT09IGQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDAgPT09IHogJiYgKHogPSB5KSwgXyArPSB2LCBCID0gMSA8PCAoeCA9IHcgLSB6KTsgeCArIHogPCBrICYmICEoKEIgLT0gUlt4ICsgel0pIDw9IDApOykgeCsrLCBCIDw8PSAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChTICs9IDEgPDwgeCwgMSA9PT0gdCAmJiA4NTIgPCBTIHx8IDIgPT09IHQgJiYgNTkyIDwgUykgcmV0dXJuIDE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbltkID0gRSAmIGZdID0geSA8PCAyNCB8IHggPDwgMTYgfCBfIC0gciB8IDBcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gMCAhPT0gRSAmJiAobltfICsgRV0gPSB3IC0geiA8PCAyNCB8IDY0IDw8IDE2IHwgMCksIG8uYml0cyA9IHksIDBcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgXFxcIi4uL3V0aWxzL2NvbW1vblxcXCI6IDNcXG4gICAgICAgIH1dLFxcbiAgICAgICAgMTM6IFtmdW5jdGlvbih0LCBlLCBhKSB7XFxuICAgICAgICAgICAgXFxcInVzZSBzdHJpY3RcXFwiO1xcbiAgICAgICAgICAgIGUuZXhwb3J0cyA9IHtcXG4gICAgICAgICAgICAgICAgMjogXFxcIm5lZWQgZGljdGlvbmFyeVxcXCIsXFxuICAgICAgICAgICAgICAgIDE6IFxcXCJzdHJlYW0gZW5kXFxcIixcXG4gICAgICAgICAgICAgICAgMDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCItMVxcXCI6IFxcXCJmaWxlIGVycm9yXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIi0yXFxcIjogXFxcInN0cmVhbSBlcnJvclxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCItM1xcXCI6IFxcXCJkYXRhIGVycm9yXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIi00XFxcIjogXFxcImluc3VmZmljaWVudCBtZW1vcnlcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiLTVcXFwiOiBcXFwiYnVmZmVyIGVycm9yXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIi02XFxcIjogXFxcImluY29tcGF0aWJsZSB2ZXJzaW9uXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIHt9XSxcXG4gICAgICAgIDE0OiBbZnVuY3Rpb24odCwgZSwgYSkge1xcbiAgICAgICAgICAgIFxcXCJ1c2Ugc3RyaWN0XFxcIjtcXG4gICAgICAgICAgICB2YXIgbCA9IHQoXFxcIi4uL3V0aWxzL2NvbW1vblxcXCIpLFxcbiAgICAgICAgICAgICAgICBvID0gMCxcXG4gICAgICAgICAgICAgICAgaCA9IDE7XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gaSh0KSB7XFxuICAgICAgICAgICAgICAgIGZvciAodmFyIGUgPSB0Lmxlbmd0aDsgMCA8PSAtLWU7KSB0W2VdID0gMFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB2YXIgZCA9IDAsXFxuICAgICAgICAgICAgICAgIHMgPSAyOSxcXG4gICAgICAgICAgICAgICAgZiA9IDI1NixcXG4gICAgICAgICAgICAgICAgXyA9IGYgKyAxICsgcyxcXG4gICAgICAgICAgICAgICAgdSA9IDMwLFxcbiAgICAgICAgICAgICAgICBjID0gMTksXFxuICAgICAgICAgICAgICAgIGcgPSAyICogXyArIDEsXFxuICAgICAgICAgICAgICAgIG0gPSAxNSxcXG4gICAgICAgICAgICAgICAgbiA9IDE2LFxcbiAgICAgICAgICAgICAgICBiID0gNyxcXG4gICAgICAgICAgICAgICAgdyA9IDI1NixcXG4gICAgICAgICAgICAgICAgcCA9IDE2LFxcbiAgICAgICAgICAgICAgICB2ID0gMTcsXFxuICAgICAgICAgICAgICAgIGsgPSAxOCxcXG4gICAgICAgICAgICAgICAgeSA9IFswLCAwLCAwLCAwLCAwLCAwLCAwLCAwLCAxLCAxLCAxLCAxLCAyLCAyLCAyLCAyLCAzLCAzLCAzLCAzLCA0LCA0LCA0LCA0LCA1LCA1LCA1LCA1LCAwXSxcXG4gICAgICAgICAgICAgICAgeCA9IFswLCAwLCAwLCAwLCAxLCAxLCAyLCAyLCAzLCAzLCA0LCA0LCA1LCA1LCA2LCA2LCA3LCA3LCA4LCA4LCA5LCA5LCAxMCwgMTAsIDExLCAxMSwgMTIsIDEyLCAxMywgMTNdLFxcbiAgICAgICAgICAgICAgICB6ID0gWzAsIDAsIDAsIDAsIDAsIDAsIDAsIDAsIDAsIDAsIDAsIDAsIDAsIDAsIDAsIDAsIDIsIDMsIDddLFxcbiAgICAgICAgICAgICAgICBCID0gWzE2LCAxNywgMTgsIDAsIDgsIDcsIDksIDYsIDEwLCA1LCAxMSwgNCwgMTIsIDMsIDEzLCAyLCAxNCwgMSwgMTVdLFxcbiAgICAgICAgICAgICAgICBTID0gbmV3IEFycmF5KDIgKiAoXyArIDIpKTtcXG4gICAgICAgICAgICBpKFMpO1xcbiAgICAgICAgICAgIHZhciBFID0gbmV3IEFycmF5KDIgKiB1KTtcXG4gICAgICAgICAgICBpKEUpO1xcbiAgICAgICAgICAgIHZhciBBID0gbmV3IEFycmF5KDUxMik7XFxuICAgICAgICAgICAgaShBKTtcXG4gICAgICAgICAgICB2YXIgWiA9IG5ldyBBcnJheSgyNTYpO1xcbiAgICAgICAgICAgIGkoWik7XFxuICAgICAgICAgICAgdmFyIFIgPSBuZXcgQXJyYXkocyk7XFxuICAgICAgICAgICAgaShSKTtcXG4gICAgICAgICAgICB2YXIgQywgTiwgTywgRCA9IG5ldyBBcnJheSh1KTtcXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBJKHQsIGUsIGEsIGksIG4pIHtcXG4gICAgICAgICAgICAgICAgdGhpcy5zdGF0aWNfdHJlZSA9IHQsIHRoaXMuZXh0cmFfYml0cyA9IGUsIHRoaXMuZXh0cmFfYmFzZSA9IGEsIHRoaXMuZWxlbXMgPSBpLCB0aGlzLm1heF9sZW5ndGggPSBuLCB0aGlzLmhhc19zdHJlZSA9IHQgJiYgdC5sZW5ndGhcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gcih0LCBlKSB7XFxuICAgICAgICAgICAgICAgIHRoaXMuZHluX3RyZWUgPSB0LCB0aGlzLm1heF9jb2RlID0gMCwgdGhpcy5zdGF0X2Rlc2MgPSBlXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIFUodCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdCA8IDI1NiA/IEFbdF0gOiBBWzI1NiArICh0ID4+PiA3KV1cXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gVCh0LCBlKSB7XFxuICAgICAgICAgICAgICAgIHQucGVuZGluZ19idWZbdC5wZW5kaW5nKytdID0gMjU1ICYgZSwgdC5wZW5kaW5nX2J1Zlt0LnBlbmRpbmcrK10gPSBlID4+PiA4ICYgMjU1XFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIEYodCwgZSwgYSkge1xcbiAgICAgICAgICAgICAgICB0LmJpX3ZhbGlkID4gbiAtIGEgPyAodC5iaV9idWYgfD0gZSA8PCB0LmJpX3ZhbGlkICYgNjU1MzUsIFQodCwgdC5iaV9idWYpLCB0LmJpX2J1ZiA9IGUgPj4gbiAtIHQuYmlfdmFsaWQsIHQuYmlfdmFsaWQgKz0gYSAtIG4pIDogKHQuYmlfYnVmIHw9IGUgPDwgdC5iaV92YWxpZCAmIDY1NTM1LCB0LmJpX3ZhbGlkICs9IGEpXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIEwodCwgZSwgYSkge1xcbiAgICAgICAgICAgICAgICBGKHQsIGFbMiAqIGVdLCBhWzIgKiBlICsgMV0pXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIEgodCwgZSkge1xcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBhID0gMDsgYSB8PSAxICYgdCwgdCA+Pj49IDEsIGEgPDw9IDEsIDAgPCAtLWU7KTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGEgPj4+IDFcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gaih0LCBlLCBhKSB7XFxuICAgICAgICAgICAgICAgIHZhciBpLCBuLCByID0gbmV3IEFycmF5KG0gKyAxKSxcXG4gICAgICAgICAgICAgICAgICAgIHMgPSAwO1xcbiAgICAgICAgICAgICAgICBmb3IgKGkgPSAxOyBpIDw9IG07IGkrKykgcltpXSA9IHMgPSBzICsgYVtpIC0gMV0gPDwgMTtcXG4gICAgICAgICAgICAgICAgZm9yIChuID0gMDsgbiA8PSBlOyBuKyspIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBvID0gdFsyICogbiArIDFdO1xcbiAgICAgICAgICAgICAgICAgICAgMCAhPT0gbyAmJiAodFsyICogbl0gPSBIKHJbb10rKywgbykpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gSyh0KSB7XFxuICAgICAgICAgICAgICAgIHZhciBlO1xcbiAgICAgICAgICAgICAgICBmb3IgKGUgPSAwOyBlIDwgXzsgZSsrKSB0LmR5bl9sdHJlZVsyICogZV0gPSAwO1xcbiAgICAgICAgICAgICAgICBmb3IgKGUgPSAwOyBlIDwgdTsgZSsrKSB0LmR5bl9kdHJlZVsyICogZV0gPSAwO1xcbiAgICAgICAgICAgICAgICBmb3IgKGUgPSAwOyBlIDwgYzsgZSsrKSB0LmJsX3RyZWVbMiAqIGVdID0gMDtcXG4gICAgICAgICAgICAgICAgdC5keW5fbHRyZWVbMiAqIHddID0gMSwgdC5vcHRfbGVuID0gdC5zdGF0aWNfbGVuID0gMCwgdC5sYXN0X2xpdCA9IHQubWF0Y2hlcyA9IDBcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gTSh0KSB7XFxuICAgICAgICAgICAgICAgIDggPCB0LmJpX3ZhbGlkID8gVCh0LCB0LmJpX2J1ZikgOiAwIDwgdC5iaV92YWxpZCAmJiAodC5wZW5kaW5nX2J1Zlt0LnBlbmRpbmcrK10gPSB0LmJpX2J1ZiksIHQuYmlfYnVmID0gMCwgdC5iaV92YWxpZCA9IDBcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gUCh0LCBlLCBhLCBpKSB7XFxuICAgICAgICAgICAgICAgIHZhciBuID0gMiAqIGUsXFxuICAgICAgICAgICAgICAgICAgICByID0gMiAqIGE7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0W25dIDwgdFtyXSB8fCB0W25dID09PSB0W3JdICYmIGlbZV0gPD0gaVthXVxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBZKHQsIGUsIGEpIHtcXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IHQuaGVhcFthXSwgbiA9IGEgPDwgMTsgbiA8PSB0LmhlYXBfbGVuICYmIChuIDwgdC5oZWFwX2xlbiAmJiBQKGUsIHQuaGVhcFtuICsgMV0sIHQuaGVhcFtuXSwgdC5kZXB0aCkgJiYgbisrLCAhUChlLCBpLCB0LmhlYXBbbl0sIHQuZGVwdGgpKTspIHQuaGVhcFthXSA9IHQuaGVhcFtuXSwgYSA9IG4sIG4gPDw9IDE7XFxuICAgICAgICAgICAgICAgIHQuaGVhcFthXSA9IGlcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gcSh0LCBlLCBhKSB7XFxuICAgICAgICAgICAgICAgIHZhciBpLCBuLCByLCBzLCBvID0gMDtcXG4gICAgICAgICAgICAgICAgaWYgKDAgIT09IHQubGFzdF9saXQpXFxuICAgICAgICAgICAgICAgICAgICBmb3IgKDsgaSA9IHQucGVuZGluZ19idWZbdC5kX2J1ZiArIDIgKiBvXSA8PCA4IHwgdC5wZW5kaW5nX2J1Zlt0LmRfYnVmICsgMiAqIG8gKyAxXSwgbiA9IHQucGVuZGluZ19idWZbdC5sX2J1ZiArIG9dLCBvKyssIDAgPT09IGkgPyBMKHQsIG4sIGUpIDogKEwodCwgKHIgPSBaW25dKSArIGYgKyAxLCBlKSwgMCAhPT0gKHMgPSB5W3JdKSAmJiBGKHQsIG4gLT0gUltyXSwgcyksIEwodCwgciA9IFUoLS1pKSwgYSksIDAgIT09IChzID0geFtyXSkgJiYgRih0LCBpIC09IERbcl0sIHMpKSwgbyA8IHQubGFzdF9saXQ7KTtcXG4gICAgICAgICAgICAgICAgTCh0LCB3LCBlKVxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBHKHQsIGUpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGEsIGksIG4sIHIgPSBlLmR5bl90cmVlLFxcbiAgICAgICAgICAgICAgICAgICAgcyA9IGUuc3RhdF9kZXNjLnN0YXRpY190cmVlLFxcbiAgICAgICAgICAgICAgICAgICAgbyA9IGUuc3RhdF9kZXNjLmhhc19zdHJlZSxcXG4gICAgICAgICAgICAgICAgICAgIGwgPSBlLnN0YXRfZGVzYy5lbGVtcyxcXG4gICAgICAgICAgICAgICAgICAgIGggPSAtMTtcXG4gICAgICAgICAgICAgICAgZm9yICh0LmhlYXBfbGVuID0gMCwgdC5oZWFwX21heCA9IGcsIGEgPSAwOyBhIDwgbDsgYSsrKSAwICE9PSByWzIgKiBhXSA/ICh0LmhlYXBbKyt0LmhlYXBfbGVuXSA9IGggPSBhLCB0LmRlcHRoW2FdID0gMCkgOiByWzIgKiBhICsgMV0gPSAwO1xcbiAgICAgICAgICAgICAgICBmb3IgKDsgdC5oZWFwX2xlbiA8IDI7KSByWzIgKiAobiA9IHQuaGVhcFsrK3QuaGVhcF9sZW5dID0gaCA8IDIgPyArK2ggOiAwKV0gPSAxLCB0LmRlcHRoW25dID0gMCwgdC5vcHRfbGVuLS0sIG8gJiYgKHQuc3RhdGljX2xlbiAtPSBzWzIgKiBuICsgMV0pO1xcbiAgICAgICAgICAgICAgICBmb3IgKGUubWF4X2NvZGUgPSBoLCBhID0gdC5oZWFwX2xlbiA+PiAxOyAxIDw9IGE7IGEtLSkgWSh0LCByLCBhKTtcXG4gICAgICAgICAgICAgICAgZm9yIChuID0gbDsgYSA9IHQuaGVhcFsxXSwgdC5oZWFwWzFdID0gdC5oZWFwW3QuaGVhcF9sZW4tLV0sIFkodCwgciwgMSksIGkgPSB0LmhlYXBbMV0sIHQuaGVhcFstLXQuaGVhcF9tYXhdID0gYSwgdC5oZWFwWy0tdC5oZWFwX21heF0gPSBpLCByWzIgKiBuXSA9IHJbMiAqIGFdICsgclsyICogaV0sIHQuZGVwdGhbbl0gPSAodC5kZXB0aFthXSA+PSB0LmRlcHRoW2ldID8gdC5kZXB0aFthXSA6IHQuZGVwdGhbaV0pICsgMSwgclsyICogYSArIDFdID0gclsyICogaSArIDFdID0gbiwgdC5oZWFwWzFdID0gbisrLCBZKHQsIHIsIDEpLCAyIDw9IHQuaGVhcF9sZW47KTtcXG4gICAgICAgICAgICAgICAgdC5oZWFwWy0tdC5oZWFwX21heF0gPSB0LmhlYXBbMV0sXFxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbih0LCBlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGEsIGksIG4sIHIsIHMsIG8sIGwgPSBlLmR5bl90cmVlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoID0gZS5tYXhfY29kZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IGUuc3RhdF9kZXNjLnN0YXRpY190cmVlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmID0gZS5zdGF0X2Rlc2MuaGFzX3N0cmVlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfID0gZS5zdGF0X2Rlc2MuZXh0cmFfYml0cyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGUuc3RhdF9kZXNjLmV4dHJhX2Jhc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMgPSBlLnN0YXRfZGVzYy5tYXhfbGVuZ3RoLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID0gMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHIgPSAwOyByIDw9IG07IHIrKykgdC5ibF9jb3VudFtyXSA9IDA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsWzIgKiB0LmhlYXBbdC5oZWFwX21heF0gKyAxXSA9IDAsIGEgPSB0LmhlYXBfbWF4ICsgMTsgYSA8IGc7IGErKykgYyA8IChyID0gbFsyICogbFsyICogKGkgPSB0LmhlYXBbYV0pICsgMV0gKyAxXSArIDEpICYmIChyID0gYywgYisrKSwgbFsyICogaSArIDFdID0gciwgaCA8IGkgfHwgKHQuYmxfY291bnRbcl0rKywgcyA9IDAsIHUgPD0gaSAmJiAocyA9IF9baSAtIHVdKSwgbyA9IGxbMiAqIGldLCB0Lm9wdF9sZW4gKz0gbyAqIChyICsgcyksIGYgJiYgKHQuc3RhdGljX2xlbiArPSBvICogKGRbMiAqIGkgKyAxXSArIHMpKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgIT09IGIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChyID0gYyAtIDE7IDAgPT09IHQuYmxfY291bnRbcl07KSByLS07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0LmJsX2NvdW50W3JdLS0sIHQuYmxfY291bnRbciArIDFdICs9IDIsIHQuYmxfY291bnRbY10tLSwgYiAtPSAyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDAgPCBiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChyID0gYzsgMCAhPT0gcjsgci0tKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gdC5ibF9jb3VudFtyXTsgMCAhPT0gaTspIGggPCAobiA9IHQuaGVhcFstLWFdKSB8fCAobFsyICogbiArIDFdICE9PSByICYmICh0Lm9wdF9sZW4gKz0gKHIgLSBsWzIgKiBuICsgMV0pICogbFsyICogbl0sIGxbMiAqIG4gKyAxXSA9IHIpLCBpLS0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSh0LCBlKSwgaihyLCBoLCB0LmJsX2NvdW50KVxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBYKHQsIGUsIGEpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGksIG4sIHIgPSAtMSxcXG4gICAgICAgICAgICAgICAgICAgIHMgPSBlWzFdLFxcbiAgICAgICAgICAgICAgICAgICAgbyA9IDAsXFxuICAgICAgICAgICAgICAgICAgICBsID0gNyxcXG4gICAgICAgICAgICAgICAgICAgIGggPSA0O1xcbiAgICAgICAgICAgICAgICBmb3IgKDAgPT09IHMgJiYgKGwgPSAxMzgsIGggPSAzKSwgZVsyICogKGEgKyAxKSArIDFdID0gNjU1MzUsIGkgPSAwOyBpIDw9IGE7IGkrKykgbiA9IHMsIHMgPSBlWzIgKiAoaSArIDEpICsgMV0sICsrbyA8IGwgJiYgbiA9PT0gcyB8fCAobyA8IGggPyB0LmJsX3RyZWVbMiAqIG5dICs9IG8gOiAwICE9PSBuID8gKG4gIT09IHIgJiYgdC5ibF90cmVlWzIgKiBuXSsrLCB0LmJsX3RyZWVbMiAqIHBdKyspIDogbyA8PSAxMCA/IHQuYmxfdHJlZVsyICogdl0rKyA6IHQuYmxfdHJlZVsyICoga10rKywgciA9IG4sIChvID0gMCkgPT09IHMgPyAobCA9IDEzOCwgaCA9IDMpIDogbiA9PT0gcyA/IChsID0gNiwgaCA9IDMpIDogKGwgPSA3LCBoID0gNCkpXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIFcodCwgZSwgYSkge1xcbiAgICAgICAgICAgICAgICB2YXIgaSwgbiwgciA9IC0xLFxcbiAgICAgICAgICAgICAgICAgICAgcyA9IGVbMV0sXFxuICAgICAgICAgICAgICAgICAgICBvID0gMCxcXG4gICAgICAgICAgICAgICAgICAgIGwgPSA3LFxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDQ7XFxuICAgICAgICAgICAgICAgIGZvciAoMCA9PT0gcyAmJiAobCA9IDEzOCwgaCA9IDMpLCBpID0gMDsgaSA8PSBhOyBpKyspXFxuICAgICAgICAgICAgICAgICAgICBpZiAobiA9IHMsIHMgPSBlWzIgKiAoaSArIDEpICsgMV0sICEoKytvIDwgbCAmJiBuID09PSBzKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvIDwgaClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICg7IEwodCwgbiwgdC5ibF90cmVlKSwgMCAhPSAtLW87KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIDAgIT09IG4gPyAobiAhPT0gciAmJiAoTCh0LCBuLCB0LmJsX3RyZWUpLCBvLS0pLCBMKHQsIHAsIHQuYmxfdHJlZSksIEYodCwgbyAtIDMsIDIpKSA6IG8gPD0gMTAgPyAoTCh0LCB2LCB0LmJsX3RyZWUpLCBGKHQsIG8gLSAzLCAzKSkgOiAoTCh0LCBrLCB0LmJsX3RyZWUpLCBGKHQsIG8gLSAxMSwgNykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBuLCAobyA9IDApID09PSBzID8gKGwgPSAxMzgsIGggPSAzKSA6IG4gPT09IHMgPyAobCA9IDYsIGggPSAzKSA6IChsID0gNywgaCA9IDQpXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGkoRCk7XFxuICAgICAgICAgICAgdmFyIEogPSAhMTtcXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBRKHQsIGUsIGEsIGkpIHtcXG4gICAgICAgICAgICAgICAgdmFyIG4sIHIsIHMsIG87XFxuICAgICAgICAgICAgICAgIEYodCwgKGQgPDwgMSkgKyAoaSA/IDEgOiAwKSwgMyksIHIgPSBlLCBzID0gYSwgbyA9ICEwLCBNKG4gPSB0KSwgbyAmJiAoVChuLCBzKSwgVChuLCB+cykpLCBsLmFycmF5U2V0KG4ucGVuZGluZ19idWYsIG4ud2luZG93LCByLCBzLCBuLnBlbmRpbmcpLCBuLnBlbmRpbmcgKz0gc1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBhLl90cl9pbml0ID0gZnVuY3Rpb24odCkge1xcbiAgICAgICAgICAgICAgICBKIHx8IChmdW5jdGlvbigpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0LCBlLCBhLCBpLCBuLCByID0gbmV3IEFycmF5KG0gKyAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IGEgPSAwOyBpIDwgcyAtIDE7IGkrKylcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKFJbaV0gPSBhLCB0ID0gMDsgdCA8IDEgPDwgeVtpXTsgdCsrKSBaW2ErK10gPSBpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChaW2EgLSAxXSA9IGksIGkgPSBuID0gMDsgaSA8IDE2OyBpKyspXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChEW2ldID0gbiwgdCA9IDA7IHQgPCAxIDw8IHhbaV07IHQrKykgQVtuKytdID0gaTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobiA+Pj0gNzsgaSA8IHU7IGkrKylcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKERbaV0gPSBuIDw8IDcsIHQgPSAwOyB0IDwgMSA8PCB4W2ldIC0gNzsgdCsrKSBBWzI1NiArIG4rK10gPSBpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChlID0gMDsgZSA8PSBtOyBlKyspIHJbZV0gPSAwO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yICh0ID0gMDsgdCA8PSAxNDM7KSBTWzIgKiB0ICsgMV0gPSA4LCB0KyssIHJbOF0rKztcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoOyB0IDw9IDI1NTspIFNbMiAqIHQgK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gMzE7IGUrKywgYSA+Pj49IDEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDEgJiBhICYmIDAgIT09IHQuZHluX2x0cmVlWzIgKiBlXSkgcmV0dXJuIG87XFxuICAgICAgICAgICAgICAgICAgICBpZiAoMCAhPT0gdC5keW5fbHRyZWVbMThdIHx8IDAgIT09IHQuZHluX2x0cmVlWzIwXSB8fCAwICE9PSB0LmR5bl9sdHJlZVsyNl0pIHJldHVybiBoO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChlID0gMzI7IGUgPCBmOyBlKyspXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgIT09IHQuZHluX2x0cmVlWzIgKiBlXSkgcmV0dXJuIGg7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb1xcbiAgICAgICAgICAgICAgICB9KHQpKSwgRyh0LCB0LmxfZGVzYyksIEcodCwgdC5kX2Rlc2MpLCBzID0gZnVuY3Rpb24odCkge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGU7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKFgodCwgdC5keW5fbHRyZWUsIHQubF9kZXNjLm1heF9jb2RlKSwgWCh0LCB0LmR5bl9kdHJlZSwgdC5kX2Rlc2MubWF4X2NvZGUpLCBHKHQsIHQuYmxfZGVzYyksIGUgPSBjIC0gMTsgMyA8PSBlICYmIDAgPT09IHQuYmxfdHJlZVsyICogQltlXSArIDFdOyBlLS0pO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHQub3B0X2xlbiArPSAzICogKGUgKyAxKSArIDUgKyA1ICsgNCwgZVxcbiAgICAgICAgICAgICAgICB9KHQpLCBuID0gdC5vcHRfbGVuICsgMyArIDcgPj4+IDMsIChyID0gdC5zdGF0aWNfbGVuICsgMyArIDcgPj4+IDMpIDw9IG4gJiYgKG4gPSByKSkgOiBuID0gciA9IGEgKyA1LCBhICsgNCA8PSBuICYmIC0xICE9PSBlID8gUSh0LCBlLCBhLCBp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YXN0KFxcXCLor7fphY3nva7lv6vpgJ/mkJzntKJcXFwiKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vc2VhcmNoP3M9JyArIHRpdGxlICsgJyZydWxlPScgKyBvYmoubmFtZTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcblxcbiAgICAgICAgICAgICAgICBpZiAob2JqLmhhc093blByb3BlcnR5KFxcXCJydWxlXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChvYmoucnVsZS5pbmRleE9mKCdjb3B5JykhPS0xKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIuW3sue7j+WkjeWItuivt+WvvOWFpeinhOWImVxcXCIpXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb2JqLnJ1bGVcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/or7flronoo4VcXFwiICsgb2JqLm5hbWUgKyBcXFwi5bCP56iL5bqPXFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIG9iaiwgXFxcImhpa2VyOi8vaG9tZVxcXCIsIHRpdGxlKSxcXG4gICAgICAgIHBpY191cmw6IG9iai5waWMsXFxuICAgICAgICBjb2xfdHlwZToganNvbi5xdWlja1NlYXJjaENvbmZpZ3MubW9kZSxcXG4gICAgICAgIGV4dHJhOntpZDoncXNlYXJjaCd9XFxuICAgIH0pXFxufVxcblxcblxcbi8qICAgICQoKS5sYXp5UnVsZSgob2JqLCBob21lLCB0aXRsZSkgPT4ge1xcbiAgICAgICAgbGV0IHJ1bGVMaXN0ID0gSlNPTi5wYXJzZShyZXF1ZXN0KGhvbWUpKTtcXG4gICAgICAgIGxldCBoYXNSdWxlID0gcnVsZUxpc3Quc29tZShpdGVtID0+IGl0ZW0udGl0bGUgPT09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OiIifQ==
Add Comment
Please, Sign In to add comment