Advertisement
xiaomianao666

邀您一起看:欢乐英雄

Mar 8th, 2024
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥欢乐英雄@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuWKqOaAgeWIhuexu1wiLFwicGF0aFwiOlwiZHRmbFwiLFwicnVsZVwiOlwianM6XFxuXFxuY29uc3QgZW1wdHkgPSBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG5cXG50cnkge1xcbiAgICBcXG4gICAgdmFyIGNhdGVnb3JpZXMgPSBwZGZhKGh0bWwsIOWkp+exu+WumuS9jSkuY29uY2F0KHBkZmEoaHRtbCwg5ou85o6l5YiG57G7KSlcXG59IGNhdGNoIChlKSB7XFxuICAgIHZhciBjYXRlZ29yaWVzID0gcGRmYShodG1sLCDlpKfnsbvlrprkvY0pXFxuICAgIFxcbn1cXG5sZXQgaW5pdF9jYXRlID0gW11cXG5cXG5mb3IgKGxldCBpID0gMDsgaSA8IDIwOyBpKyspIHtcXG4gICAgaW5pdF9jYXRlLnB1c2goXFxcIjBcXFwiKVxcbn1cXG5cXG5jb25zdCBmb2xkID0gZ2V0VmFyKE1ZX1JVTEUuZ3JvdXAsIFxcXCIwXFxcIil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CH6aKYKVxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGtleS50b1N0cmluZygpID09PSBjYXRlX3RlbXBbaW5kZXhdID8gJ+KAnOKAnOKAneKAnTxiPjxzcGFuIHN0eWxlPVxcXCJjb2xvcjogJyArIOWIhuexu+minOiJsiArICdcXFwiPicgKyB0aXRsZSArICc8L3NwYW4+PC9iPicgOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChwZChpdGVtLCDliIbnsbvpk77mjqUpICsgJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdfY2F0ZSA9IFtdXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcC5mb3JFYWNoKChjYXRlLCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY2F0ZS5wdXNoKGluZGV4ID09PSAwID8gcGFyYW1zLmtleS50b1N0cmluZygpIDogXFxcIjBcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudGl0bGUsIEpTT04uc3RyaW5naWZ5KG5ld19jYXRlKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS50aXRsZSsndXJsJywgaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2UgaWYgKGZvbGQgPT09ICcxJykge1xcbiAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBwZGZoKGl0ZW0sIOWIhuexu+agh+mimClcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBrZXkudG9TdHJpbmcoKSA9PT0gY2F0ZV90ZW1wW2luZGV4XSA/ICfigJzigJzigJ3igJ08Yj48c3BhbiBzdHlsZT1cXFwiY29sb3I6ICcgKyDliIbnsbvpopzoibIgKyAnXFxcIj4nICsgdGl0bGUgKyAnPC9zcGFuPjwvYj4nIDogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQocGQoaXRlbSwg5YiG57G76ZO+5o6lKSArICcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wW3BhcmFtcy5pbmRleF0gPSBwYXJhbXMua2V5LnRvU3RyaW5nKClcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS50aXRsZSwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmNhdGVfdGVtcCkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudGl0bGUrJ3VybCcsIGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiBwYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgfSlcXG59XFxuXCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLor6bmg4VcIixcInBhdGhcIjpcImRldGFpbHNcIixcInJ1bGVcIjpcImpzOlxcbnJlcXVpcmUoY29uZmlnLnVpKVxcbnZhciByZXMgPSB7fTtcXG52YXIgZCA9IFtdO1xcbnZhciBsaXN0cz1bXTtcXG52YXIgdGFic3M9W107XFxudmFyIGh0bWwgPSBnZXRSZXNDb2RlKCk7XFxudmFyIHRhYnMgPSBwZGZhKGh0bWwsICdib2R5JiZoNCcpO1xcbnZhciBjb250cyA9IHBkZmEoaHRtbCwgJ2JvZHkmJi5tdC0zOmhhcyg6bWF0Y2hlcyjmkq3mlL7liJfooah85LiL6L295Zyw5Z2AfOenjeWtkOS4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ZycsXFxuICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZGMsIHNkYykgPT4ge1xcbiAgICAgICAgdmFyIGRzID0gc3RvcmFnZTAuZ2V0SXRlbSgnZHNob3cnLCAn5pS26LW3Jyk7XFxuICAgICAgICB2YXIgdGl0bGUgPSBmaW5kSXRlbSgnZHNob3cnKS50aXRsZTtcXG5cXG4gICAgICAgIGlmIChkcyA9PSAn5pS26LW3Jykge1xcbiAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oJ2RzaG93JywgJ+WxleW8gCcpXFxuICAgICAgICAgICAgdXBkYXRlSXRlbSgnZGNvbnRlbnQnLCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBkYyxcXG4gICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICB1cGRhdGVJdGVtKCdkc2hvdycsIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLnJlcGxhY2UoJ+aUtui1tycsICflsZXlvIAnKVxcbiAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW1cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnZHNob3cnLCAn5pS26LW3JylcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKCdkY29udGVudCcsIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHNkYyxcXG4gICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICB1cGRhdGVJdGVtKCdkc2hvdycsIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLnJlcGxhY2UoJ+WxleW8gCcsICfmlLbotbcnKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICB9LCBkZXNjLCBzZGVzYyksXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICBpZDogJ2RzaG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GlrZXI6Ly9lbXB0eSdcXG4gICAgICAgIH0pOyovXFxuICAgIH1cXG5cXG4gICAgdmFyIHBsYXlzID0gW107XFxuICAgIHN3aXRjaCAodHlwZSkge1xcbiAgICAgICAgY2FzZSAn5pKt5pS+5YiX6KGoJzpcXG4gICAgICAgICAgICBwbGF5cyA9IHBkZmEoY29udHNbaV0sICdib2R5JiZhJyk7XFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICBjYXNlICfkuIvovb3lnLDlnYAnOlxcbiAgICAgICAgICAgIHZhciB0ZW1wID0gcmVUYWcoY29udHNbaV0sIFsndGJvZHknLCAndHInLCAndGQnXSwgWydkaXYnLCAndWwnLCAnbGknXSlcXG4gICAgICAgICAgICBwbGF5cyA9IHBkZmEodGVtcCwgJ2JvZHkmJiNkb3dubG9hZC1saXN0JiZ1bCcpO1xcbiAgICAgICAgICAgIHBsYXlzLnJldmVyc2UoKTtcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGNhc2UgJ+enjeWtkOS4i+i9vSc6XFxuICAgICAgICAgICAgcGxheXMgPSBwZGZhKGNvbnRzW2ldLCAnYm9keSYmYScpO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICB9XFxuXFxuICAgIHZhciBjb2wgPSAndGV4dF80JztcXG4gICAgdmFyIHRlbXA9W107XFxuICAgIHBsYXlzLmZvckVhY2goeCA9PiB7XFxuICAgICAgICBcXG4gICAgICAgIHZhciB0ZXh0ID0gcGRmaCh4LCAnYSYmVGV4dCcpO1xcbiAgICAgICAgdmFyIHVybCA9IHBkKHgsICdhJiZocmVmJykgKyBsYXp5O1xcbiAgICAgICAgaWYgKC8obWFnbmV0fHRvcnJlbnR8ZWQyaykvLnRlc3QodXJsKSkge1xcbiAgICAgICAgICAgIHRleHQgPSBwZGZoKHgsICcudGV4dC1tdXRlZCYmVGV4dCcpO1xcbiAgICAgICAgICAgIHVybCA9IHBkKHgsICdhJiZocmVmJyk7XFxuICAgICAgICAgICAgY29s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cIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuino+aekFwiLFwicGF0aFwiOlwibGF6eVwiLFwicnVsZVwiOlwianM6XFxudmFyIGxhenkgPSAkKCcnKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgIHZhciB1cmw9aW5wdXQ7XFxuICAgIHZhciBob21lID0gJ2JkeXMnO1xcbiAgICB2YXIgaHRtbCA9IGZldGNoKHVybCwge1xcbiAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICdjb29raWUnOiBnZXRJdGVtKGhvbWUgKyAnQ29va2llJywgJycpLFxcbiAgICAgICAgfVxcbiAgICB9KVxcbiAgICBpZiAoaHRtbC5pbmNsdWRlcygnUGxlYXNlIGNvbXBsZXRlIHRoZSBjYXB0Y2hhJykpIHtcXG4gICAgICAgIGNsZWFyVmFyKGhvbWUgKyAnQ29va2llJyk7XFxuICAgICAgICBjbGVhckl0ZW0oaG9tZSArICdDb29raWUnKTsgICAgICAgIFxcbiAgICAgICAgcmV0dXJuICQoJ2hpa2VyOi8vZW1wdHknKS5ydWxlKChob21lLCB1cmwpID0+IHtcXG4gICAgICAgICAgICB2YXIgZCA9IFtdO1xcbiAgICAgICAgICAgIHZhciBjb29raWUgPSBnZXRWYXIoaG9tZSArICdDb29raWUnLCAnJyk7XFxuICAgICAgICAgICAgLy9sb2coY29va2llKVxcbiAgICAgICAgICAgIGlmIChjb29raWUgIT0gJycpIHtcXG4gICAgICAgICAgICAgICAgc2V0SXRlbShob21lICsgJ0Nvb2tpZScsIGNvb2tpZSk7XFxuICAgICAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcbiAgICAgICAgICAgICAgICB0b2FzdCgn6aqM6K+B5a6M5oiQJylcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFg1V2ViVmlldygnaGlrZXI6Ly9lbXB0eScpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcIng1X3dlYnZpZXdfc2luZ2xlXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJmbG9hdCYmMTAwJVxcXCIsXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChob21lLCB1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBlbGVtZW50SWQgPSBcXFwibWV0YVtwcm9wZXJ0eT0nb2c6dHlwZSddXFxcIjsgLy8g5b6F5qOA5p+l55qE5YWD57SgIElEIFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGludGVydmFsVGltZSA9IDEwMDA7IC8vIOavj+malCAxIOenkumSn+ajgOafpeS4gOasoSBcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0aW1lciA9IHNldEludGVydmFsKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZWxlbWVudCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoZWxlbWVudElkKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW1lbnQpIHsgLy8g5a2Y5Zyo6K+l5YWD57Sg77yM5Y+v5Lul5omn6KGM5p+Q5Lqb5pON5L2cIFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9mYmEubG9nKCflrZjlnKgnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLnJlZnJlc2hYNURlc2MoJ2Zsb2F0JiYwJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnN0eWxlLmNvbG9yID0gJ3JlZCc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEucHV0VmFyKGhvbWUgKyAnQ29va2llJywgZmJhLmdldENvb2tpZSh1cmwpKTsgICAgICAgICAgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmeV9icmlkZ2VfYXBwLnJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcik7IC8vIOa4hemZpOWumuaXtuWZqCBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2ZiYS5sb2coJ+S4jeWtmOWcqCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGludGVydmFsVGltZSk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBob21lLCB1cmwpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBzZXRIb21lUmVzdWx0KGQpXFxuICAgICAgICB9LCBob21lLCB1cmwpXFxuICAgIH1cXG4gICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvcGFyc2UnLCB7fSkpLnJ1bGUpO1xcbiAgICByZXR1cm4gdXJsO1xcbn0pO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi6aqM6K+B56CBXCIsXCJwYXRoXCI6XCJ5em1cIixcInJ1bGVcIjpcImlmIChodG1sLmluZGV4T2YoJ+i+k+WFpemqjOivgeeggScpID4gLTEpIHtcXG5cXG4gICAgbGV0IGhlYWRlcnMgPSB7XFxuICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQSxcXG4gICAgICAgIFxcXCJSZWZlcmVyXFxcIjogTVlfVVJMXFxuICAgIH07XFxuICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2Uvanhocz9ydWxlPeaooeadv8K3UScpKS5ydWxlKTtcXG4gICAgZXZhbFByaXZhd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J+eCueaIkeaJi+WKqOmqjOivgScsXFxuICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5IyMnKS5ydWxlKChkaWN0KSA9PiB7XFxuICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZSgn6K+36L6T5YWl6K6h566X57uT5p6cJyk7XFxuICAgICAgICAgICAgICAgIHZhciBkID0gW107XFxuICAgICAgICAgICAgICAgIHZhciBteXVybCA9IGRpY3QubXl1cmw7XFxuICAgICAgICAgICAgICAgIHZhciBodG1sID0gZmV0Y2gobXl1cmwpO1xcbiAgICAgICAgICAgICAgICB2YXIgY29kZXVybCA9IGNvbmZpZy5pbmRleCArIHBkZmgoaHRtbCwgJyN2ZXJpZnlDb2RlJiZzcmMnKS5zbGljZSgxKTtcXG4gICAgICAgICAgICAgICAgdmFyIGI2NCA9IGNvbnZlcnRCYXNlNjRJbWFnZShjb2RldXJsKVxcblxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBiNjQsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3BpY18xX2Z1bGwnLFxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfnoa7orqQnLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQudG9TdHJpbmcoKG15dXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN1cmwgPSBteXVybCArICc/Y29kZT0nICsgaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhlYWRlcnMgPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IG15dXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgaHRtbCA9IGZldGNoKGN1cmwsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaHRtbC5pbmRleE9mKCfovpPlhaXpqozor4HnoIEnKSA9PSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29va2llID0gZ2V0Q29va2llKGN1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignY29va2llJywgY29va2llKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdCgn5oiQ5Yqf77yM6K+35Yiw5pCc57Si6aG15Yi35pawJylcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdCgn6ZSZ6K+v6K+36YeN6K+VJylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICAgICAgfSwgbXl1cmwpLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAnbnVtYmVyJ1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgICAgICAgICAgfSwgZGljdCl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gaSA9IG5ldyBFcnJvcihcXFwiQ2Fubm90IGZpbmQgbW9kdWxlICdcXFwiICsgZSArIFxcXCInXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBpLmNvZGUgPSBcXFwiTU9EVUxFX05PVF9GT1VORFxcXCIsIGlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB2YXIgbiA9IG9bZV0gPSB7XFxuICAgICAgICAgICAgICAgICAgICBleHBvcnRzOiB7fVxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICBzW2VdWzBdLmNhbGwobi5leHBvcnRzLCBmdW5jdGlvbih0KSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaChzW2VdWzFdW3RdIHx8IHQpXFxuICAgICAgICAgICAgICAgIH0sIG4sIG4uZXhwb3J0cywgciwgcywgbywgbClcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIG9bZV0uZXhwb3J0c1xcbiAgICAgICAgfVxcbiAgICAgICAgZm9yICh2YXIgZCA9IFxcXCJmdW5jdGlvblxcXCIgPT0gdHlwZW9mIHJlcXVpcmUgJiYgcmVxdWlyZSwgdCA9IDA7IHQgPCBsLmxlbmd0aDsgdCsrKSBoKGxbdF0pO1xcbiAgICAgICAgcmV0dXJuIGhcXG4gICAgfSh7XFxuICAgICAgICAxOiBbZnVuY3Rpb24odCwgZSwgYSkge1xcbiAgICAgICAgICAgIFxcXCJ1c2Ugc3RyaWN0XFxcIjtcXG4gICAgICAgICAgICB2YXIgcyA9IHQoXFxcIi4vemxpYi9kZWZsYXRlXFxcIiksXFxuICAgICAgICAgICAgICAgIG8gPSB0KFxcXCIuL3V0aWxzL2NvbW1vblxcXCIpLFxcbiAgICAgICAgICAgICAgICBsID0gdChcXFwiLi91dGlscy9zdHJpbmdzXFxcIiksXFxuICAgICAgICAgICAgICAgIG4gPSB0KFxcXCIuL3psaWIvbWVzc2FnZXNcXFwiKSxcXG4gICAgICAgICAgICAgICAgciA9IHQoXFxcIi4vemxpYi96c3RyZWFtXFxcIiksXFxuICAgICAgICAgICAgICAgIGggPSBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLFxcbiAgICAgICAgICAgICAgICBkID0gMCxcXG4gICAgICAgICAgICAgICAgZiA9IC0xLFxcbiAgICAgICAgICAgICAgICBfID0gMCxcXG4gICAgICAgICAgICAgICAgdSA9IDg7XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gYyh0KSB7XFxuICAgICAgICAgICAgICAgIGlmICghKHRoaXMgaW5zdGFuY2VvZiBjKSkgcmV0dXJuIG5ldyBjKHQpO1xcbiAgICAgICAgICAgICAgICB0aGlzLm9wdGlvbnMgPSBvLmFzc2lnbih7XFxuICAgICAgICAgICAgICAgICAgICBsZXZlbDogZixcXG4gICAgICAgICAgICAgICAgICAgIG1ldGhvZDogdSxcXG4gICAgICAgICAgICAgICAgICAgIGNodW5rU2l6ZTogMTYzODQsXFxuICAgICAgICAgICAgICAgICAgICB3aW5kb3dCaXRzOiAxNSxcXG4gICAgICAgICAgICAgICAgICAgIG1lbUxldmVsOiA4LFxcbiAgICAgICAgICAgICAgICAgICAgc3RyYXRlZ3k6IF8sXFxuICAgICAgICAgICAgICAgICAgICB0bzogXFxcIlxcXCJcXG4gICAgICAgICAgICAgICAgfSwgdCB8fCB7fSk7XFxuICAgICAgICAgICAgICAgIHZhciBlID0gdGhpcy5vcHRpb25zO1xcbiAgICAgICAgICAgICAgICBlLnJhdyAmJiAwIDwgZS53aW5kb3dCaXRzID8gZS53aW5kb3dCaXRzID0gLWUud2luZG93Qml0cyA6IGUuZ3ppcCAmJiAwIDwgZS53aW5kb3dCaXRzICYmIGUud2luZG93Qml0cyA8IDE2ICYmIChlLndpbmRvd0JpdHMgKz0gMTYpLCB0aGlzLmVyciA9IDAsIHRoaXMubXNnID0gXFxcIlxcXCIsIHRoaXMuZW5kZWQgPSAhMSwgdGhpcy5jaHVua3MgPSBbXSwgdGhpcy5zdHJtID0gbmV3IHIsIHRoaXMuc3RybS5hdmFpbF9vdXQgPSAwO1xcbiAgICAgICAgICAgICAgICB2YXIgYSA9IHMuZGVmbGF0ZUluaXQyKHRoaXMuc3RybSwgZS5sZXZlbCwgZS5tZXRob2QsIGUud2luZG93Qml0cywgZS5tZW1MZXZlbCwgZS5zdHJhdGVneSk7XFxuICAgICAgICAgICAgICAgIGlmIChhICE9PSBkKSB0aHJvdyBuZXcgRXJyb3IoblthXSk7XFxuICAgICAgICAgICAgICAgIGlmIChlLmhlYWRlciAmJiBzLmRlZmxhdGVTZXRIZWFkZXIodGhpcy5zdHJtLCBlLmhlYWRlciksIGUuZGljdGlvbmFyeSkge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaSA9IFxcXCJzdHJpbmdcXFwiID09IHR5cGVvZiBlLmRpY3Rpb25hcnkgPyBsLnN0cmluZzJidWYoZS5kaWN0aW9uYXJ5KSA6IFxcXCJbb2JqZWN0IEFycmF5QnVmZmVyXVxcXCIgPT09IGguY2FsbChlLmRpY3Rpb25hcnkpID8gbmV3IFVpbnQ4QXJyYXkoZS5kaWN0aW9uYXJ5KSA6IGUuZGljdGlvbmFyeSwgKGEgPSBzLmRlZmxhdGVTZXREaWN0aW9uYXJ5KHRoaXMuc3RybSwgaSkpICE9PSBkKSB0aHJvdyBuZXcgRXJyb3IoblthXSk7XFxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9kaWN0X3NldCA9ICEwXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gaSh0LCBlKSB7XFxuICAgICAgICAgICAgICAgIHZhciBhID0gbmV3IGMoZSk7XFxuICAgICAgICAgICAgICAgIGlmIChhLnB1c2godCwgITApLCBhLmVycikgdGhyb3cgYS5tc2cgfHwgblthLmVycl07XFxuICAgICAgICAgICAgICAgIHJldHVybiBhLnJlc3VsdFxc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ICAgICAgICAgICAgICAgcmV0dXJuIChlID0gZSB8fCB7fSkuZ3ppcCA9ICEwLCBpKHQsIGUpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIFxcXCIuL3V0aWxzL2NvbW1vblxcXCI6IDMsXFxuICAgICAgICAgICAgXFxcIi4vdXRpbHMvc3RyaW5nc1xcXCI6IDQsXFxuICAgICAgICAgICAgXFxcIi4vemxpYi9kZWZsYXRlXFxcIjogOCxcXG4gICAgICAgICAgICBcXFwiLi96bGliL21lc3NhZ2VzXFxcIjogMTMsXFxuICAgICAgICAgICAgXFxcIi4vemxpYi96c3RyZWFtXFxcIjogMTVcXG4gICAgICAgIH1dLFxcbiAgICAgICAgMjogW2Z1bmN0aW9uKHQsIGUsIGEpIHtcXG4gICAgICAgICAgICBcXFwidXNlIHN0cmljdFxcXCI7XFxuICAgICAgICAgICAgdmFyIGYgPSB0KFxcXCIuL3psaWIvaW5mbGF0ZVxcXCIpLFxcbiAgICAgICAgICAgICAgICBfID0gdChcXFwiLi91dGlscy9jb21tb25cXFwiKSxcXG4gICAgICAgICAgICAgICAgdSA9IHQoXFxcIi4vdXRpbHMvc3RyaW5nc1xcXCIpLFxcbiAgICAgICAgICAgICAgICBjID0gdChcXFwiLi96bGliL2NvbnN0YW50c1xcXCIpLFxcbiAgICAgICAgICAgICAgICBpID0gdChcXFwiLi96bGliL21lc3NhZ2VzXFxcIiksXFxuICAgICAgICAgICAgICAgIG4gPSB0KFxcXCIuL3psaWIvenN0cmVhbVxcXCIpLFxcbiAgICAgICAgICAgICAgICByID0gdChcXFwiLi96bGliL2d6aGVhZGVyXFxcIiksXFxuICAgICAgICAgICAgICAgIGIgPSBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nO1xcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIHModCkge1xcbiAgICAgICAgICAgICAgICBpZiAoISh0aGlzIGluc3RhbmNlb2YgcykpIHJldHVybiBuZXcgcyh0KTtcXG4gICAgICAgICAgICAgICAgdGhpcy5vcHRpb25zID0gXy5hc3NpZ24oe1xcbiAgICAgICAgICAgICAgICAgICAgY2h1bmtTaXplOiAxNjM4NCxcXG4gICAgICAgICAgICAgICAgICAgIHdpbmRvd0JpdHM6IDAsXFxuICAgICAgICAgICAgICAgICAgICB0bzogXFxcIlxcXCJcXG4gICAgICAgICAgICAgICAgfSwgdCB8fCB7fSk7XFxuICAgICAgICAgICAgICAgIHZhciBlID0gdGhpcy5vcHRpb25zO1xcbiAgICAgICAgICAgICAgICBlLnJhdyAmJiAwIDw9IGUud2luZG93Qml0cyAmJiBlLndpbmRvd0JpdHMgPCAxNiAmJiAoZS53aW5kb3dCaXRzID0gLWUud2luZG93Qml0cywgMCA9PT0gZS53aW5kb3dCaXRzICYmIChlLndpbmRvd0JpdHMgPSAtMTUpKSwgISgwIDw9IGUud2luZG93Qml0cyAmJiBlLndpbmRvd0JpdHMgPCAxNikgfHwgdCAmJiB0LndpbmRvd0JpdHMgfHwgKGUud2luZG93Qml0cyArPSAzMiksIDE1IDwgZS53aW5kb3dCaXRzICYmIGUud2luZG93Qml0cyA8IDQ4ICYmIDAgPT0gKDE1ICYgZS53aW5kb3dCaXRzKSAmJiAoZS53aW5kb3dCaXRzIHw9IDE1KSwgdGhpcy5lcnIgPSAwLCB0aGlzLm1zZyA9IFxcXCJcXFwiLCB0aGlzLmVuZGVkID0gITEsIHRoaXMuY2h1bmtzID0gW10sIHRoaXMuc3RybSA9IG5ldyBuLCB0aGlzLnN0cm0uYXZhaWxfb3V0ID0gMDtcXG4gICAgICAgICAgICAgICAgdmFyIGEgPSBmLmluZmxhdGVJbml0Mih0aGlzLnN0cm0sIGUud2luZG93Qml0cyk7XFxuICAgICAgICAgICAgICAgIGlmIChhICE9PSBjLlpfT0spIHRocm93IG5ldyBFcnJvcihpW2FdKTtcXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuaGVhZGVyID0gbmV3IHIsIGYuaW5mbGF0ZUdldEhlYWR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gICBhLmFzc2lnbiA9IGZ1bmN0aW9uKHQpIHtcXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgZSwgYSwgaSA9IEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKGFyZ3VtZW50cywgMSk7IGkubGVuZ3RoOykge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIG4gPSBpLnNoaWZ0KCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAobikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcXFwib2JqZWN0XFxcIiAhPSB0eXBlb2YgbikgdGhyb3cgbmV3IFR5cGVFcnJvcihuICsgXFxcIm11c3QgYmUgbm9uLW9iamVjdFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHIgaW4gbikgZSA9IG4sIGEgPSByLCBPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSwgYSkgJiYgKHRbcl0gPSBuW3JdKVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiB0XFxuICAgICAgICAgICAgfSwgYS5zaHJpbmtCdWYgPSBmdW5jdGlvbih0LCBlKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0Lmxlbmd0aCA9PT0gZSA/IHQgOiB0LnN1YmFycmF5ID8gdC5zdWJhcnJheSgwLCBlKSA6ICh0Lmxlbmd0aCA9IGUsIHQpXFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICB2YXIgbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgIGFycmF5U2V0OiBmdW5jdGlvbih0LCBlLCBhLCBpLCBuKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUuc3ViYXJyYXkgJiYgdC5zdWJhcnJheSkgdC5zZXQoZS5zdWJhcnJheShhLCBhICsgaSksIG4pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgciA9IDA7IHIgPCBpOyByKyspIHRbbiArIHJdID0gZVthICsgcl1cXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICBmbGF0dGVuQ2h1bmtzOiBmdW5jdGlvbih0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGUsIGEsIGksIG4sIHIsIHM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChlID0gaSA9IDAsIGEgPSB0Lmxlbmd0aDsgZSA8IGE7IGUrKykgaSArPSB0W2VdLmxlbmd0aDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHMgPSBuZXcgVWludDhBcnJheShpKSwgZSA9IG4gPSAwLCBhID0gdC5sZW5ndGg7IGUgPCBhOyBlKyspIHIgPSB0W2VdLCBzLnNldChyLCBuKSwgbiArPSByLmxlbmd0aDtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICByID0ge1xcbiAgICAgICAgICAgICAgICAgICAgYXJyYXlTZXQ6IGZ1bmN0aW9uKHQsIGUsIGEsIGksIG4pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciByID0gMDsgciA8IGk7IHIrKykgdFtuICsgcl0gPSBlW2EgKyByXVxcbiAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIGZsYXR0ZW5DaHVua3M6IGZ1bmN0aW9uKHQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gW10uY29uY2F0LmFwcGx5KFtdLCB0KVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIGEuc2V0VHlwZWQgPSBmdW5jdGlvbih0KSB7XFxuICAgICAgICAgICAgICAgIHQgPyAoYS5CdWY4ID0gVWludDhBcnJheSwgYS5CdWYxNiA9IFVpbnQxNkFycmF5LCBhLkJ1ZjMyID0gSW50MzJBcnJheSwgYS5hc3NpZ24oYSwgbikpIDogKGEuQnVmOCA9IEFycmF5LCBhLkJ1ZjE2ID0gQXJyYXksIGEuQnVmMzIgPSBBcnJheSwgYS5hc3NpZ24oYSwgcikpXFxuICAgICAgICAgICAgfSwgYS5zZXRUeXBlZChpKVxcbiAgICAgICAgfSwge31dLFxcbiAgICAgICAgNDogW2Z1bmN0aW9uKHQsIGUsIGEpIHtcXG4gICAgICAgICAgICBcXFwidXNlIHN0cmljdFxcXCI7XFxuICAgICAgICAgICAgdmFyIGwgPSB0KFxcXCIuL2NvbW1vblxcXCIpLFxcbiAgICAgICAgICAgICAgICBuID0gITAsXFxuICAgICAgICAgICAgICAgIHIgPSAhMDtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBTdHJpbmcuZnJvbUNoYXJDb2RlLmFwcGx5KG51bGwsIFswXSlcXG4gICAgICAgICAgICB9IGNhdGNoICh0KSB7XFxuICAgICAgICAgICAgICAgIG4gPSAhMVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBTdHJpbmcuZnJvbUNoYXJDb2RlLmFwcGx5KG51bGwsIG5ldyBVaW50OEFycmF5KDEpKVxcbiAgICAgICAgICAgIH0gY2F0Y2ggKHQpIHtcXG4gICAgICAgICAgICAgICAgciA9ICExXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGZvciAodmFyIGggPSBuZXcgbC5CdWY4KDI1NiksIGkgPSAwOyBpIDwgMjU2OyBpKyspIGhbaV0gPSAyNTIgPD0gaSA/IDYgOiAyNDggPD0gaSA/IDUgOiAyNDAgPD0gaSA/IDQgOiAyMjQgPD0gaSA/IDMgOiAxOTIgPD0gaSA/IDIgOiAxO1xcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIGQodCwgZSkge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gZWxzZSBpZiAoNCA8IChyID0gaFtuXSkpIG9baSsrXSA9IDY1NTMzLCBhICs9IHIgLSAxO1xcbiAgICAgICAgICAgICAgICBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobiAmPSAyID09PSByID8gMzEgOiAzID09PSByID8gMTUgOiA3OyAxIDwgciAmJiBhIDwgczspIG4gPSBuIDw8IDYgfCA2MyAmIHRbYSsrXSwgci0tO1xcbiAgICAgICAgICAgICAgICAgICAgMSA8IHIgPyBvW2krK10gPSA2NTUzMyA6IG4gPCA2NTUzNiA/IG9baSsrXSA9IG4gOiAobiAtPSA2NTUzNiwgb1tpKytdID0gNTUyOTYgfCBuID4+IDEwICYgMTAyMywgb1tpKytdID0gNTYzMjAgfCAxMDIzICYgbilcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gZChvLCBpKVxcbiAgICAgICAgICAgIH0sIGEudXRmOGJvcmRlciA9IGZ1bmN0aW9uKHQsIGUpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGE7XFxuICAgICAgICAgICAgICAgIGZvciAoKGUgPSBlIHx8IHQubGVuZ3RoKSA+IHQubGVuZ3RoICYmIChlID0gdC5sZW5ndGgpLCBhID0gZSAtIDE7IDAgPD0gYSAmJiAxMjggPT0gKDE5MiAmIHRbYV0pOykgYS0tO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gYSA8IDAgPyBlIDogMCA9PT0gYSA/IGUgOiBhICsgaFt0W2FdXSA+IGUgPyBhIDogZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIHtcXG4gICAgICAgICAgICBcXFwiLi9jb21tb25cXFwiOiAzXFxuICAgICAgICB9XSxcXG4gICAgICAgIDU6IFtmdW5jdGlvbih0LCBlLCBhKSB7XFxuICAgICAgICAgICAgXFxcInVzZSBzdHJpY3RcXFwiO1xcbiAgICAgICAgICAgIGUuZXhwb3J0cyA9IGZ1bmN0aW9uKHQsIGUsIGEsIGkpIHtcXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgbiA9IDY1NTM1ICYgdCB8IDAsIHIgPSB0ID4+PiAxNiAmIDY1NTM1IHwgMCwgcyA9IDA7IDAgIT09IGE7KSB7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGEgLT0gcyA9IDJlMyA8IGEgPyAyZTMgOiBhOyByID0gciArIChuID0gbiArIGVbaSsrXSB8IDApIHwgMCwgLS1zOyk7XFxuICAgICAgICAgICAgICAgICAgICBuICU9IDY1NTIxLCByICU9IDY1NTIxXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIG4gfCByIDw8IDE2IHwgMFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIHt9XSxcXG4gICAgICAgIDY6IFtmdW5jdGlvbih0LCBlLCBhKSB7XFxuICAgICAgICAgICAgXFxcInVzZSBzdHJpY3RcXFwiO1xcbiAgICAgICAgICAgIGUuZXhwb3J0cyA9IHtcXG4gICAgICAgICAgICAgICAgWl9OT19GTFVTSDogMCxcXG4gICAgICAgICAgICAgICAgWl9QQVJUSUFMX0ZMVVNIOiAxLFxcbiAgICAgICAgICAgICAgICBaX1NZTkNfRkxVU0g6IDIsXFxuICAgICAgICAgICAgICAgIFpfRlVMTF9GTFVTSDogMyxcXG4gICAgICAgICAgICAgICAgWl9GSU5JU0g6IDQsXFxuICAgICAgICAgICAgICAgIFpfQkxPQ0s6IDUsXFxuICAgICAgICAgICAgICAgIFpfVFJFRVM6IDYsXFxuICAgICAgICAgICAgICAgIFpfT0s6IDAsXFxuICAgICAgICAgICAgICAgIFpfU1RSRUFNX0VORDogMSxcXG4gICAgICAgICAgICAgICAgWl9ORUVEX0RJQ1Q6IDIsXFxuICAgICAgICAgICAgICAgIFpfRVJSTk86IC0xLFxcbiAgICAgICAgICAgICAgICBaX1NUUkVBTV9FUlJPUjogLTIsXFxuICAgICAgICAgICAgICAgIFpfREFUQV9FUlJPUjogLTMsXFxuICAgICAgICAgICAgICAgIFpfQlVGX0VSUk9SOiAtNSxcXG4gICAgICAgICAgICAgICAgWl9OT19DT01QUkVTU0lPTjogMCxcXG4gICAgICAgICAgICAgICAgWl9CRVNUX1NQRUVEOiAxLFxcbiAgICAgICAgICAgICAgICBaX0JFU1RfQ09NUFJFU1NJT046IDksXFxuICAgICAgICAgICAgICAgIFpfREVGQVVMVF9DT01QUkVTU0lPTjogLTEsXFxuICAgICAgICAgICAgICAgIFpfRklMVEVSRUQ6IDEsXFxuICAgICAgICAgICAgICAgIFpfSFVGRk1BTl9PTkxZOiAyLFxcbiAgICAgICAgICAgICAgICBaX1JMRTogMyxcXG4gICAgICAgICAgICAgICAgWl9GSVhFRDogNCxcXG4gICAgICAgICAgICAgICAgWl9ERUZBVUxUX1NUUkFURUdZOiAwLFxcbiAgICAgICAgICAgICAgICBaX0JJTkFSWTogMCxcXG4gICAgICAgICAgICAgICAgWl9URVhUOiAxLFxcbiAgICAgICAgICAgICAgICBaX1VOS05PV046IDIsXFxuICAgICAgICAgICAgICAgIFpfREVGTEFURUQ6IDhcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCB7fV0sXFxuICAgICAgICA3OiBbZnVuY3Rpb24odCwgZSwgYSkge1xcbiAgICAgICAgICAgIFxcXCJ1c2Ugc3RyaWN0XFxcIjtcXG4gICAgICAgICAgICB2YXIgbyA9IGZ1bmN0aW9uKCkge1xcbiAgICAgICAgICAgICAgICBmb3IgKHZhciB0LCBlID0gW10sIGEgPSAwOyBhIDwgMjU2OyBhKyspIHtcXG4gICAgICAgICAgICAgICAgICAgIHQgPSBhO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA4OyBpKyspIHQgPSAxICYgdCA/IDM5ODgyOTIzODQgXiB0ID4+PiAxIDogdCA+Pj4gMTtcXG4gICAgICAgICAgICAgICAgICAgIGVbYV0gPSB0XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIGVcXG4gICAgICAgICAgICB9KCk7XFxuICAgICAgICAgICAgZS5leHBvcnRzID0gZnVuY3Rpb24odCwgZSwgYSwgaSkge1xcbiAgICAgICAgICAgICAgICB2YXIgbiA9IG8sXFxuICAgICAgICAgICAgICAgICAgICByID0gaSArIGE7XFxuICAgICAgICAgICAgICAgIHQgXj0gLTE7XFxuICAgICAgICAgICAgICAgIGZvciAodmFyIHMgPSBpOyBzIDwgcjsgcysrKSB0ID0gdCA+Pj4gOCBeIG5bMjU1ICYgKHQgXiBlW3NdKV07XFxuICAgICAgICAgICAgICAgIHJldHVybiAtMSBeIHRcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCB7fV0sXFxuICAgICAgICA4OiBbZnVuY3Rpb24odCwgZSwgYSkge1xcbiAgICAgICAgICAgIFxcXCJ1c2Ugc3RyaWN0XFxcIjtcXG4gICAgICAgICAgICB2YXIgbCwgXyA9IHQoXFxcIi4uL3V0aWxzL2NvbW1vblxcXCIpLFxcbiAgICAgICAgICAgICAgICBoID0gdChcXFwiLi90cmVlc1xcXCIpLFxcbiAgICAgICAgICAgICAgICB1ID0gdChcXFwiLi9hZGxlcjMyXFxcIiksXFxuICAgICAgICAgICAgICAgIGMgPSB0KFxcXCIuL2NyYzMyXFxcIiksXFxuICAgICAgICAgICAgICAgIGkgPSB0KFxcXCIuL21lc3NhZ2VzXFxcIiksXFxuICAgICAgICAgICAgICAgIGQgPSAwLFxcbiAgICAgICAgICAgICAgICBmID0gNCxcXG4gICAgICAgICAgICAgICAgYiA9IDAsXFxuICAgICAgICAgICAgICAgIGcgPSAtMixcXG4gICAgICAgICAgICAgICAgbSA9IC0xLFxcbiAgICAgICAgICAgICAgICB3ID0gNCxcXG4gICAgICAgICAgICAgICAgbiA9IDIsXFxuICAgICAgICAgICAgICAgIHAgPSA4LFxcbiAgICAgICAgICAgICAgICB2ID0gOSxcXG4gICAgICAgICAgICAgICAgciA9IDI4NixcXG4gICAgICAgICAgICAgICAgcyA9IDMwLFxcbiAgICAgICAgICAgICAgICBvID0gMTksXFxuICAgICAgICAgICAgICAgIGsgPSAyICogciArIDEsXFxuICAgICAgICAgICAgICAgIHkgPSAxNSxcXG4gICAgICAgICAgICAgICAgeCA9IDMsXFxuICAgICAgICAgICAgICAgIHogPSAyNTgsXFxuICAgICAgICAgICAgICAgIEIgPSB6ICsgeCArIDEsXFxuICAgICAgICAgICAgICAgIFMgPSA0MixcXG4gICAgICAgICAgICAgICAgRSA9IDExMyxcXG4gICAgICAgICAgICAgICAgQSA9IDEsXFxuICAgICAgICAgICAgICAgIFogPSAyLFxcbiAgICAgICAgICAgICAgICBSID0gMyxcXG4gICAgICAgICAgICAgICAgQyA9IDQ7XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gTih0LCBlKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0Lm1zZyA9IGlbZV0sIGVcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gTyh0KSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAodCA8PCAxKSAtICg0IDwgdCA/IDkgOiAwKVxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBEKHQpIHtcXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgZSA9IHQubGVuZ3RoOyAwIDw9IC0tZTspIHRbZV0gPSAwXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIEkodCkge1xcbiAgICAgICAgICAgICAgICB2YXIgZSA9IHQuc3RhdGUsXFxuICAgICAgICAgICAgICAgICAgICBhID0gZS5wZW5kaW5nO1xcbiAgICAgICAgICAgICAgICBhID4gdC5hdmFpbF9vdXQgJiYgKGEgPSB0LmF2YWlsX291dCksIDAgIT09IGEgJiYgKF8uYXJyYXlTZXQodC5vdXRwdXQsIGUucGVuZGluZ19idWYsIGUucGVuZGluZ19vdXQsIGEsIHQubmV4dF9vdXQpLCB0Lm5leHRfb3V0ICs9IGEsIGUucGVuZGluZ19vdXQgKz0gYSwgdC50b3RhbF9vdXQgKz0gYSwgdC5hdmFpbF9vdXQgLT0gYSwgZS5wZW5kaW5nIC09IGEsIDAgPT09IGUucGVuZGluZyAmJiAoZS5wZW5kaW5nX291dCA9IDApKVxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBVKHQsIGUpIHtcXG4gICAgICAgICAgICAgICAgaC5fdHJfZmx1c2hfYmxvY2sodCwgMCA8PSB0LmJsb2NrX3N0YXJ0ID8gdC5ibG9ja19zdGFydCA6IC0xLCB0LnN0cnN0YXJ0IC0gdC5ibG9ja19zdGFydCwgZSksIHQuYmxvY2tfc3RhcnQgPSB0LnN0cnN0YXJ0LCBJKHQuc3RybSlcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gVCh0LCBlKSB7XFxuICAgICAgICAgICAgICAgIHQucGVuZGluZ19idWZbdC5wZW5kaW5nKytdID0gZVxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBGKHQsIGUpIHtcXG4gICAgICAgICAgICAgICAgdC5wZW5kaW5nX2J1Zlt0LnBlbmRpbmcrK10gPSBlID4+PiA4ICYgMjU1LCB0LnBlbmRpbmdfYnVmW3QucGVuZGluZysrXSA9IDI1NSAmIGVcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gTCh0LCBlKSB7XFxuICAgICAgICAgICAgICAgIHZhciBhLCBpLCBuID0gdC5tYXhfY2hhaW5fbGVuZ3RoLFxcbiAgICAgICAgICAgICAgICAgICAgciA9IHQuc3Ryc3RhcnQsXFxuICAgICAgICAgICAgICAgICAgICBzID0gdC5wcmV2X2xlbmd0aCxcXG4gICAgICAgICAgICAgICAgICAgIG8gPSB0Lm5pY2VfbWF0Y2gsXFxuICAgICAgICAgICAgICAgICAgICBsID0gdC5zdHJzdGFydCA+IHQud19zaXplIC0gQiA/IHQuc3Ryc3RhcnQgLSAodC53X3NpemUgLSBCKSA6IDAsXFxuICAgICAgICAgICAgICAgICAgICBoID0gdC53aW5kb3csXFxuICAgICAgICAgICAgICAgICAgICBkID0gdC53X21hc2ssXFxuICAgICAgICAgICAgICAgICAgICBmID0gdC5wcmV2LFxcbiAgICAgICAgICAgICAgICAgICAgXyA9IHQuc3Ryc3RhcnQgKyB6LFxcbiAgICAgICAgICAgICAgICAgICAgdSA9IGhbciArIHMgLSAxXSxcXG4gICAgICAgICAgICAgICAgICAgIGMgPSBoW3IgKyBzXTtcXG4gICAgICAgICAgICAgICAgdC5wcmV2X2xlbmd0aCA+PSB0Lmdvb2RfbWF0Y2ggJiYgKG4gPj49IDIpLCBvID4gdC5sb29rYWhlYWQgJiYgKG8gPSB0Lmxvb2thaGVhZCk7XFxuICAgICAgICAgICAgICAgIGRvIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChoWyhhID0gZSkgKyBzXSA9PT0gYyAmJiBoW2EgKyBzIC0gMV0gPT09IHUgJiYgaFthXSA9PT0gaFtyXSAmJiBoWysrYV0gPT09IGhbciArIDFdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgciArPSAyLCBhKys7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZG8ge30gd2hpbGUgKGhbKytyXSA9PT0gaFsrK2FdICYmIGhbKytyXSA9PT0gaFsrK2FdICYmIGhbKytyXSA9PT0gaFsrK2FdICYmIGhbKytyXSA9PT0gaFsrK2FdICYmIGhbKytyXSA9PT0gaFsrK2FdICYmIGhbKytyXSA9PT0gaFsrK2FdICYmIGhbKytyXSA9PT0gaFsrK2FdICYmIGhbKytyXSA9PT0gaFsrK2FdICYmIHIgPCBfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9IHogLSAoXyAtIHIpLCByID0gXyAtIHosIHMgPCBpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0Lm1hdGNoX3N0YXJ0ID0gZSwgbyA8PSAocyA9IGkpKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGhbciArIHMgLSAxXSwgYyA9IGhbciArIHNdXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IHdoaWxlICgoZSA9IGZbZSAmIGRdKSA+IGwgJiYgMCAhPSAtLW4pO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gcyA8PSB0Lmxvb2thaGVhZCA/IHMgOiB0Lmxvb2thaGVhZFxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBIKHQpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGUsIGEsIGksIG4sIHIsIHMsIG8sIGwsIGgsIGQsIGYgPSB0Lndfc2l6ZTtcXG4gICAgICAgICAgICAgICAgZG8ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKG4gPSB0LndpbmRvd19zaXplIC0gdC5sb29rYWhlYWQgLSB0LnN0cnN0YXJ0LCB0LnN0cnN0YXJ0ID49IGYgKyAoZiAtIEIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChfLmFycmF5U2V0KHQud2luZG93LCB0LndpbmRvdywgZiwgZiwgMCksIHQubWF0Y2hfc3RhcnQgLT0gZiwgdC5zdHJzdGFydCAtPSBmLCB0LmJsb2NrX3N0YXJ0IC09IGYsIGUgPSBhID0gdC5oYXNoX3NpemU7IGkgPSB0LmhlYWRbLS1lXSwgdC5oZWFkW2VdID0gZiA8PSBpID8gaSAtIGYgOiAwLCAtLWE7KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGUgPSBhID0gZjsgaSA9IHQucHJldlstLWVdLCB0LnByZXZbZV0gPSBmIDw9IGkgPyBpIC0gZiA6IDAsIC0tYTspO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gKz0gZlxcbiAgICAgICAgICAgICAgICAgICAgfVxcb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ZW5kaW5nIC0gbiwgbikpLCBpLmd6aW5kZXggPT09IGkuZ3poZWFkLmV4dHJhLmxlbmd0aCAmJiAoaS5nemluZGV4ID0gMCwgaS5zdGF0dXMgPSA3MylcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpLnN0YXR1cyA9IDczO1xcbiAgICAgICAgICAgICAgICBpZiAoNzMgPT09IGkuc3RhdHVzKVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkuZ3poZWFkLm5hbWUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBuID0gaS5wZW5kaW5nO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkucGVuZGluZyA9PT0gaS5wZW5kaW5nX2J1Zl9zaXplICYmIChpLmd6aGVhZC5oY3JjICYmIGkucGVuZGluZyA+IG4gJiYgKHQuYWRsZXIgPSBjKHQuYWRsZXIsIGkucGVuZGluZ19idWYsIGkucGVuZGluZyAtIG4sIG4pKSwgSSh0KSwgbiA9IGkucGVuZGluZywgaS5wZW5kaW5nID09PSBpLnBlbmRpbmdfYnVmX3NpemUpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgVChpLCByID0gaS5nemluZGV4IDwgaS5nemhlYWQubmFtZS5sZW5ndGggPyAyNTUgJiBpLmd6aGVhZC5uYW1lLmNoYXJDb2RlQXQoaS5nemluZGV4KyspIDogMClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwICE9PSByKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpLmd6aGVhZC5oY3JjICYmIGkucGVuZGluZyA+IG4gJiYgKHQuYWRsZXIgPSBjKHQuYWRsZXIsIGkucGVuZGluZ19idWYsIGkucGVuZGluZyAtIG4sIG4pKSwgMCA9PT0gciAmJiAoaS5nemluZGV4ID0gMCwgaS5zdGF0dXMgPSA5MSlcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpLnN0YXR1cyA9IDkxO1xcbiAgICAgICAgICAgICAgICBpZiAoOTEgPT09IGkuc3RhdHVzKVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkuZ3poZWFkLmNvbW1lbnQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBuID0gaS5wZW5kaW5nO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkucGVuZGluZyA9PT0gaS5wZW5kaW5nX2J1Zl9zaXplICYmIChpLmd6aGVhZC5oY3JjICYmIGkucGVuZGluZyA+IG4gJiYgKHQuYWRsZXIgPSBjKHQuYWRsZXIsIGkucGVuZGluZ19idWYsIGkucGVuZGluZyAtIG4sIG4pKSwgSSh0KSwgbiA9IGkucGVuZGluZywgaS5wZW5kaW5nID09PSBpLnBlbmRpbmdfYnVmX3NpemUpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgVChpLCByID0gaS5nemluZGV4IDwgaS5nemhlYWQuY29tbWVudC5sZW5ndGggPyAyNTUgJiBpLmd6aGVhZC5jb21tZW50LmNoYXJDb2RlQXQoaS5nemluZGV4KyspIDogMClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwICE9PSByKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpLmd6aGVhZC5oY3JjICYmIGkucGVuZGluZyA+IG4gJiYgKHQuYWRsZXIgPSBjKHQuYWRsZXIsIGkucGVuZGluZ19idWYsIGkucGVuZGluZ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YmIChIKHQpLCAwID09PSB0Lmxvb2thaGVhZCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlID09PSBkKSByZXR1cm4gQTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHQubWF0Y2hfbGVuZ3RoID0gMCwgYSA9IGguX3RyX3RhbGx5KHQsIDAsIHQud2luZG93W3Quc3Ryc3RhcnRdKSwgdC5sb29rYWhlYWQtLSwgdC5zdHJzdGFydCsrLCBhICYmIChVKHQsICExKSwgMCA9PT0gdC5zdHJtLmF2YWlsX291dCkpIHJldHVybiBBXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0Lmluc2VydCA9IDAsIGUgPT09IGYgPyAoVSh0LCAhMCksIDAgPT09IHQuc3RybS5hdmFpbF9vdXQgPyBSIDogQykgOiB0Lmxhc3RfbGl0ICYmIChVKHQsICExKSwgMCA9PT0gdC5zdHJtLmF2YWlsX291dCkgPyBBIDogWlxcbiAgICAgICAgICAgICAgICAgICAgfShpLCBlKSA6IDMgPT09IGkuc3RyYXRlZ3kgPyBmdW5jdGlvbih0LCBlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgYSwgaSwgbiwgciwgcyA9IHQud2luZG93OzspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHQubG9va2FoZWFkIDw9IHopIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChIKHQpLCB0Lmxvb2thaGVhZCA8PSB6ICYmIGUgPT09IGQpIHJldHVybiBBO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IHQubG9va2FoZWFkKSBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0Lm1hdGNoX2xlbmd0aCA9IDAsIHQubG9va2FoZWFkID49IHggJiYgMCA8IHQuc3Ryc3RhcnQgJiYgKGkgPSBzW24gPSB0LnN0cnN0YXJ0IC0gMV0pID09PSBzWysrbl0gJiYgaSA9PT0gc1srK25dICYmIGkgPT09IHNbKytuXSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IHQuc3Ryc3RhcnQgKyB6O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge30gd2hpbGUgKGkgPT09IHNbKytuXSAmJiBpID09PSBzWysrbl0gJiYgaSA9PT0gc1srK25dICYmIGkgPT09IHNbKytuXSAmJiBpID09PSBzWysrbl0gJiYgaSA9PT0gc1srK25dICYmIGkgPT09IHNbKytuXSAmJiBpID09PSBzWysrbl0gJiYgbiA8IHIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tYXRjaF9sZW5ndGggPSB6IC0gKHIgLSBuKSwgdC5tYXRjaF9sZW5ndGggPiB0Lmxvb2thaGVhZCAmJiAodC5tYXRjaF9sZW5ndGggPSB0Lmxvb2thaGVhZClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodC5tYXRjaF9sZW5ndGggPj0geCA/IChhID0gaC5fdHJfdGFsbHkodCwgMSwgdC5tYXRjaF9sZW5ndGggLSB4KSwgdC5sb29rYWhlYWQgLT0gdC5tYXRjaF9sZW5ndGgsIHQuc3Ryc3RhcnQgKz0gdC5tYXRjaF9sZW5ndGgsIHQubWF0Y2hfbGVuZ3RoID0gMCkgOiAoYSA9IGguX3RyX3RhbGx5KHQsIDAsIHQud2luZG93W3Quc3Ryc3RhcnRdKSwgdC5sb29rYWhlYWQtLSwgdC5zdHJzdGFydCsrKSwgYSAmJiAoVSh0LCAhMSksIDAgPT09IHQuc3Ryb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HUsIGMsIGIsIGcsIG0sIHcsIHAsIHYsIGssIHksIHgsIHosIEIsIFM7XFxuICAgICAgICAgICAgICAgIGEgPSB0LnN0YXRlLCBpID0gdC5uZXh0X2luLCBCID0gdC5pbnB1dCwgbiA9IGkgKyAodC5hdmFpbF9pbiAtIDUpLCByID0gdC5uZXh0X291dCwgUyA9IHQub3V0cHV0LCBzID0gciAtIChlIC0gdC5hdmFpbF9vdXQpLCBvID0gciArICh0LmF2YWlsX291dCAtIDI1NyksIGwgPSBhLmRtYXgsIGggPSBhLndzaXplLCBkID0gYS53aGF2ZSwgZiA9IGEud25leHQsIF8gPSBhLndpbmRvdywgdSA9IGEuaG9sZCwgYyA9IGEuYml0cywgYiA9IGEubGVuY29kZSwgZyA9IGEuZGlzdGNvZGUsIG0gPSAoMSA8PCBhLmxlbmJpdHMpIC0gMSwgdyA9ICgxIDw8IGEuZGlzdGJpdHMpIC0gMTtcXG4gICAgICAgICAgICAgICAgdDogZG8ge1xcbiAgICAgICAgICAgICAgICAgICAgYyA8IDE1ICYmICh1ICs9IEJbaSsrXSA8PCBjLCBjICs9IDgsIHUgKz0gQltpKytdIDw8IGMsIGMgKz0gOCksIHAgPSBiW3UgJiBtXTtcXG4gICAgICAgICAgICAgICAgICAgIGU6IGZvciAoOzspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodSA+Pj49IHYgPSBwID4+PiAyNCwgYyAtPSB2LCAwID09PSAodiA9IHAgPj4+IDE2ICYgMjU1KSkgU1tyKytdID0gNjU1MzUgJiBwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISgxNiAmIHYpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PSAoNjQgJiB2KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBiWyg2NTUzNSAmIHApICsgKHUgJiAoMSA8PCB2KSAtIDEpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZSBlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMzIgJiB2KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYS5tb2RlID0gMTI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgdFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFwiaW52YWxpZCBsaXRlcmFsL2xlbmd0aCBjb2RlXFxcIiwgYS5tb2RlID0gMzA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayB0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgayA9IDY1NTM1ICYgcCwgKHYgJj0gMTUpICYmIChjIDwgdiAmJiAodSArPSBCW2krK10gPDwgYywgYyArPSA4KSwgayArPSB1ICYgKDEgPDwgdikgLSAxLCB1ID4+Pj0gdiwgYyAtPSB2KSwgYyA8IDE1ICYmICh1ICs9IEJbaSsrXSA8PCBjLCBjICs9IDgsIHUgKz0gQltpKytdIDw8IGMsIGMgKz0gOCksIHAgPSBnW3UgJiB3XTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYTogZm9yICg7Oykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHUgPj4+PSB2ID0gcCA+Pj4gMjQsIGMgLT0gdiwgISgxNiAmICh2ID0gcCA+Pj4gMTYgJiAyNTUpKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09ICg2NCAmIHYpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBnWyg2NTUzNSAmIHApICsgKHUgJiAoMSA8PCB2KSAtIDEpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWUgYVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXCJpbnZhbGlkIGRpc3RhbmNlIGNvZGVcXFwiLCBhLm1vZGUgPSAzMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayB0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoeSA9IDY1NTM1ICYgcCwgYyA8ICh2ICY9IDE1KSAmJiAodSArPSBCW2krK10gPDwgYywgKGMgKz0gOCkgPCB2ICYmICh1ICs9IEJbaSsrXSA8PCBjLCBjICs9IDgpKSwgbCA8ICh5ICs9IHUgJiAoMSA8PCB2KSAtIDEpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFwiaW52YWxpZCBkaXN0YW5jZSB0b28gZmFyIGJhY2tcXFwiLCBhLm1vZGUgPSAzMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayB0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodSA+Pj49IHYsIGMgLT0gdiwgKHYgPSByIC0gcykgPCB5KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGQgPCAodiA9IHkgLSB2KSAmJiBhLnNhbmUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFwiaW52YWxpZCBkaXN0YW5jZSB0b28gZmFyIGJhY2tcXFwiLCBhLm1vZGUgPSAzMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgdFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoeiA9IF8sICh4ID0gMCkgPT09IGYpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHggKz0gaCAtIHYsIHYgPCBrKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGsgLT0gdjsgU1tyKytdID0gX1t4KytdLCAtLXY7KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggPSByIC0geSwgeiA9IFNcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZiA8IHYpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHggKz0gaCArIGYgLSB2LCAodiAtPSBmKSA8IGspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoayAtPSB2OyBTW3IrK10gPSBfW3grK10sIC0tdjspO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHggPSAwLCBmIDwgaykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoayAtPSB2ID0gZjsgU1tyKytdID0gX1t4KytdLCAtLXY7KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gciAtIHksIHogPSBTXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHggKz0gZiAtIHYsIHYgPCBrKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoayAtPSB2OyBTW3IrK10gPSBfW3grK10sIC0tdjspO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gciAtIHksIHogPSBTXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyAyIDwgazspIFNbcisrXSA9IHpbeCsrXSwgU1tyKytdID0gelt4KytdLCBTW3IrK10gPSB6W3grK10sIGsgLT0gMztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrICYmIChTW3IrK10gPSB6W3grK10sIDEgPCBrICYmIChTW3IrK10gPSB6W3grK10pKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHggPSByIC0geTsgU1tyKytdID0gU1t4KytdLCBTW3IrK10gPSBTW3grK10sIFNbcisrXSA9IFNbeCsrXSwgMiA8IChrIC09IDMpOyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgayAmJiAoU1tyKytdID0gU1t4KytdLCAxIDwgayAmJiAoU1tyKytdID0gU1t4KytdKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoaSA8IG4gJiYgciA8IG8pO1xcbiAgICAgICAgICAgICAgICBpIC09IGsgPSBjID4+IDMsIHUgJj0gKDEgPDwgKGMgLT0gayA8PCAzKSkgLSAxLCB0Lm5leHRfaW4gPSBpLCB0Lm5leHRfb3V0ID0gciwgdC5hdmFpbF9pbiA9IGkgPCBuID8gbiAtIGkgKyA1IDogNSAtIChpIC0gbiksIHQuYXZhaWxfb3V0ID0gciA8IG8gPyBvIC0gciArIDI1NyA6IDI1NyAtIChyIC0gbyksIGEuaG9sZCA9IHUsIGEuYml0cyA9IGNcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCB7fV0sXFxuICAgICAgICAxMTogW2Z1bmN0aW9uKHQsIGUsIGEpIHtcXG4gICAgICAgICAgICBcXFwidXNlIHN0cmljdFxcXCI7XFxuICAgICAgICAgICAgdmFyIFogPSB0KFxcXCIuLi91dGlscy9jb21tb25cXFwiKSxcXG4gICAgICAgICAgICAgICAgUiA9IHQoXFxcIi4vYWRsZXIzMlxcXCIpLFxcbiAgICAgICAgICAgICAgICBDID0gdChcXFwiLi9jcmMzMlxcXCIpLFxcbiAgICAgICAgICAgICAgICBOID0gdChcXFwiLi9pbmZmYXN0XFxcIiksXFxuICAgICAgICAgICAgICAgIE8gPSB0KFxcXCIuL2luZnRyZWVzXFxcIiksXFxuICAgICAgICAgICAgICAgIEQgPSAxLFxcbiAgICAgICAgICAgICAgICBJID0gMixcXG4gICAgICAgICAgICAgICAgVSA9IDAsXFxuICAgICAgICAgICAgICAgIFQgPSAtMixcXG4gICAgICAgICAgICAgICAgRiA9IDEsXFxuICAgICAgICAgICAgICAgIGkgPSA4NTIsXFxuICAgICAgICAgICAgICAgIG4gPSA1OTI7XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gTCh0KSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAodCA+Pj4gMjQgJiAyNTUpICsgKHQgPj4+IDggJiA2NTI4MCkgKyAoKDY1MjgwICYgdCkgPDwgOCk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gICBmdW5jdGlvbiBoKHQsIGUpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGEsIGk7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0ID8gKGkgPSBuZXcgciwgKHQuc3RhdGUgPSBpKS53aW5kb3cgPSBudWxsLCAoYSA9IGwodCwgZSkpICE9PSBVICYmICh0LnN0YXRlID0gbnVsbCksIGEpIDogVFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB2YXIgZCwgZiwgXyA9ICEwO1xcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIEgodCkge1xcbiAgICAgICAgICAgICAgICBpZiAoXykge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGU7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGQgPSBuZXcgWi5CdWYzMig1MTIpLCBmID0gbmV3IFouQnVmMzIoMzIpLCBlID0gMDsgZSA8IDE0NDspIHQubGVuc1tlKytdID0gODtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoOyBlIDwgMjU2OykgdC5sZW5zW2UrK10gPSA5O1xcbiAgICAgICAgICAgICAgICAgICAgZm9yICg7IGUgPCAyODA7KSB0LmxlbnNbZSsrXSA9IDc7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKDsgZSA8IDI4ODspIHQubGVuc1tlKytdID0gODtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoTyhELCB0LmxlbnMsIDAsIDI4OCwgZCwgMCwgdC53b3JrLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJpdHM6IDlcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSwgZSA9IDA7IGUgPCAzMjspIHQubGVuc1tlKytdID0gNTtcXG4gICAgICAgICAgICAgICAgICAgIE8oSSwgdC5sZW5zLCAwLCAzMiwgZiwgMCwgdC53b3JrLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYml0czogNVxcbiAgICAgICAgICAgICAgICAgICAgfSksIF8gPSAhMVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHQubGVuY29kZSA9IGQsIHQubGVuYml0cyA9IDksIHQuZGlzdGNvZGUgPSBmLCB0LmRpc3RiaXRzID0gNVxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBqKHQsIGUsIGEsIGkpIHtcXG4gICAgICAgICAgICAgICAgdmFyIG4sIHIgPSB0LnN0YXRlO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVsbCA9PT0gci53aW5kb3cgJiYgKHIud3NpemUgPSAxIDw8IHIud2JpdHMsIHIud25leHQgPSAwLCByLndoYXZlID0gMCwgci53aW5kb3cgPSBuZXcgWi5CdWY4KHIud3NpemUpKSwgaSA+PSByLndzaXplID8gKFouYXJyYXlTZXQoci53aW5kb3csIGUsIGEgLSByLndzaXplLCByLndzaXplLCAwKSwgci53bmV4dCA9IDAsIHIud2hhdmUgPSByLndzaXplKSA6IChpIDwgKG4gPSByLndzaXplIC0gci53bmV4dCkgJiYgKG4gPSBpKSwgWi5hcnJheVNldChyLndpbmRvdywgZSwgYSAtIGksIG4sIHIud25leHQpLCAoaSAtPSBuKSA/IChaLmFycmF5U2V0KHIud2luZG93LCBlLCBhIC0gaSwgaSwgMCksIHIud25leHQgPSBpLCByLndoYXZlID0gci53c2l6ZSkgOiAoci53bmV4dCArPSBuLCByLnduZXh0ID09PSByLndzaXplICYmIChyLnduZXh0ID0gMCksIHIud2hhdmUgPCByLndzaXplICYmIChyLndoYXZlICs9IG4pKSksIDBcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgYS5pbmZsYXRlUmVzZXQgPSBvLCBhLmluZmxhdGVSZXNldDIgPSBsLCBhLmluZmxhdGVSZXNldEtlZXAgPSBzLCBhLmluZmxhdGVJbml0ID0gZnVuY3Rpb24odCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gaCh0LCAxNSlcXG4gICAgICAgICAgICB9LCBhLmluZmxhdGVJbml0MiA9IGgsIGEuaW5mbGF0ZSA9IGZ1bmN0aW9uKHQsIGUpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGEsIGksIG4sIHIsIHMsIG8sIGwsIGgsIGQsIGYsIF8sIHUsIGMsIGIsIGcsIG0sIHcsIHAsIHYsIGssIHksIHgsIHosIEIsIFMgPSAwLFxcbiAgICAgICAgICAgICAgICAgICAgRSA9IG5ldyBaLkJ1ZjgoNCksXFxuICAgICAgICAgICAgICAgICAgICBBID0gWzE2LCAxNywgMTgsIDAsIDgsIDcsIDksIDYsIDEwLCA1LCAxMSwgNCwgMTIsIDMsIDEzLCAyLCAxNCwgMSwgMTVdO1xcbiAgICAgICAgICAgICAgICBpZiAoIXQgfHwgIXQuc3RhdGUgfHwgIXQub3V0cHV0IHx8ICF0LmlucHV0ICYmIDAgIT09IHQuYXZhaWxfaW4pIHJldHVybiBUO1xcbiAgICAgICAgICAgICAgICAxMiA9PT0gKGEgPSB0LnN0YXRlKS5tb2RlICYmIChhLm1vZGUgPSAxMyksIHMgPSB0Lm5leHRfb3V0LCBuID0gdC5vdXRwdXQsIGwgPSB0LmF2YWlsX291dCwgciA9IHQubmV4dF9pbiwgaSA9IHQuaW5wdXQsIG8gPSB0LmF2YWlsX2luLCBoID0gYS5ob2xkLCBkID0gYS5iaXRzLCBmID0gbywgXyA9IGwsIHggPSBVO1xcbiAgICAgICAgICAgICAgICB0OiBmb3IgKDs7KSBzd2l0Y2ggKGEubW9kZSkge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSBGOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBhLndyYXApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYS5tb2RlID0gMTM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBkIDwgMTY7KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoMiAmIGEud3JhcCAmJiAzNTYxNSA9PT0gaCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFW2EuY2hlY2sgPSAwXSA9IDI1NSAmIGgsIEVbMV0gPSBoID4+PiA4ICYgMjU1LCBhLmNoZWNrID0gQyhhLmNoZWNrLCBFLCAyLCAwKSwgZCA9IGggPSAwLCBhLm1vZGUgPSAyO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5mbGFncyA9IDAsIGEuaGVhZCAmJiAoYS5oZWFkLmRvbmUgPSAhMSksICEoMSAmIGEud3JhcCkgfHwgKCgoMjU1ICYgaCkgPDwgOCkgKyAoaCA+PiA4KSkgJSAzMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXCJpbmNvcnJlY3QgaGVhZGVyIGNoZWNrXFxcIiwgYS5tb2RlID0gMzA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICg4ICE9ICgxNSAmIGgpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcInVua25vd24gY29tcHJlc3Npb24gbWV0aG9kXFxcIiwgYS5tb2RlID0gMzA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkIC09IDQsIHkgPSA4ICsgKDE1ICYgKGggPj4+PSA0KSksIDAgPT09IGEud2JpdHMpIGEud2JpdHMgPSB5O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHkgPiBhLndiaXRzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcImludmFsaWQgd2luZG93IHNpemVcXFwiLCBhLm1vZGUgPSAzMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYS5kbWF4ID0gMSA8PCB5LCB0LmFkbGVyID0gYS5jaGVjayA9IDEsIGEubW9kZSA9IDUxMiAmIGggPyAxMCA6IDEyLCBkID0gaCA9IDA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICg7IGQgPCAxNjspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhLmZsYWdzID0gaCwgOCAhPSAoMjU1ICYgYS5mbGFncykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFwidW5rbm93biBjb21wcmVzc2lvbiBtZXRob2RcXFwiLCBhLm1vZGUgPSAzMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDU3MzQ0ICYgYS5mbGFncykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXCJ1bmtub3duIGhlYWRlciBmbGFncyBzZXRcXFwiLCBhLm1vZGUgPSAzMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYS5oZWFkICYmIChhLmhlYWQudGV4dCA9IGggPj4gOCAmIDEpLCA1MTIgJiBhLmZsYWdzICYmIChFWzBdID0gMjU1ICYgaCwgRVsxXSA9IGggPj4+IDggJiAyNTUsIGEuY2hlY2sgPSBDKGEuY2hlY2ssIEUsIDIsIDApKSwgZCA9IGggPSAwLCBhLm1vZGUgPSAzO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAzOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBkIDwgMzI7KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBhLmhlYWQgJiYgKGEuaGVhZC50aW1lID0gaCksIDUxMiAmIGEuZmxhZ3MgJiYgKEVbMF0gPSAyNTUgJiBoLCBFWzFdID0gaCA+Pj4gOCAmIDI1NSwgRVsyXSA9IGggPj4+IDE2ICYgMjU1LCBFWzNdID0gaCA+Pj4gMjQgJiAyNTUsIGEuY2hlY2sgPSBDKGEuY2hlY2ssIEUsIDQsIDApKSwgZCA9IGggPSAwLCBhLm1vZGUgPSA0O1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBkIDwgMTY7KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBhLmhlYWQgJiYgKGEuaGVhZC54ZmxhZ3MgPSAyNTUgJiBoLCBhLmhlYWQub3MgPSBoID4+IDgpLCA1MTIgJiBhLmZsYWdzICYmIChFWzBdID0gMjU1ICYgaCwgRVsxXSA9IGggPj4+IDggJiAyNTUsIGEuY2hlY2sgPSBDKGEuY2hlY2ssIEUsIDIsIDApKSwgZCA9IGggPSAwLCBhLm1vZGUgPSA1O1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA1OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgxMDI0ICYgYS5mbGFncykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgZCA8IDE2Oykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEubGVuZ3RoID0gaCwgYS5oZWFkICYmIChhLmhlYWQuZXh0cmFfbGVuID0gaCksIDUxMiAmIGEuZmxhZ3MgJiYgKEVbMF0gPSAyNTUgJiBoLCBFWzFdID0gaCA+Pj4gOCAmIDI1NSwgYS5jaGVjayA9IEMoYS5jaGVjaywgRSwgMiwgMCkpLCBkID0gaCA9IDBcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgYS5oZWFkICYmIChhLmhlYWQuZXh0cmEgPSBudWxsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBhLm1vZGUgPSA2O1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA2OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgxM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SAwLCBhLm1vZGUgPSA4O1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA4OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICg0MDk2ICYgYS5mbGFncykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh1ID0gMDsgeSA9IGlbciArIHUrK10sIGEuaGVhZCAmJiB5ICYmIGEubGVuZ3RoIDwgNjU1MzYgJiYgKGEuaGVhZC5jb21tZW50ICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoeSkpLCB5ICYmIHUgPCBvOyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICg1MTIgJiBhLmZsYWdzICYmIChhLmNoZWNrID0gQyhhLmNoZWNrLCBpLCB1LCByKSksIG8gLT0gdSwgciArPSB1LCB5KSBicmVhayB0XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGEuaGVhZCAmJiAoYS5oZWFkLmNvbW1lbnQgPSBudWxsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBhLm1vZGUgPSA5O1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA5OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICg1MTIgJiBhLmZsYWdzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBkIDwgMTY7KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGggIT09ICg2NTUzNSAmIGEuY2hlY2spKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXCJoZWFkZXIgY3JjIG1pc21hdGNoXFxcIiwgYS5tb2RlID0gMzA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSBoID0gMFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBhLmhlYWQgJiYgKGEuaGVhZC5oY3JjID0gYS5mbGFncyA+PiA5ICYgMSwgYS5oZWFkLmRvbmUgPSAhMCksIHQuYWRsZXIgPSBhLmNoZWNrID0gMCwgYS5tb2RlID0gMTI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDEwOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBkIDwgMzI7KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB0LmFkbGVyID0gYS5jaGVjayA9IEwoaCksIGQgPSBoID0gMCwgYS5tb2RlID0gMTE7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDExOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBhLmhhdmVkaWN0KSByZXR1cm4gdC5uZXh0X291dCA9IHMsIHQuYXZhaWxfb3V0ID0gbCwgdC5uZXh0X2luID0gciwgdC5hdmFpbF9pbiA9IG8sIGEuaG9sZCA9IGgsIGEuYml0cyA9IGQsIDI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdC5hZGxlciA9IGEuY2hlY2sgPSAxLCBhLm1vZGUgPSAxMjtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDUgPT09IGUgfHwgNiA9PT0gZSkgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTM6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGEubGFzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoID4+Pj0gNyAmIGQsIGQgLT0gNyAmIGQsIGEubW9kZSA9IDI3O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgZCA8IDM7KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGEubGFzdCA9IDEgJiBoLCBkIC09IDEsIDMgJiAoaCA+Pj49IDEpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEubW9kZSA9IDE0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChIKGEpLCBhLm1vZGUgPSAyMCwgNiAhPT0gZSkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoID4+Pj0gMiwgZCAtPSAyO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAyOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYS5tb2RlID0gMTc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAzOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFwiaW52YWxpZCBibG9jayB0eXBlXFxcIiwgYS5tb2RlID0gMzBcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaCA+Pj49IDIsIGQgLT0gMjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChoID4+Pj0gNyAmIGQsIGQgLT0gNyAmIGQ7IGQgPCAzMjspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoNjU1MzUgJiBoKSAhPSAoaCA+Pj4gMTYgXiA2NTUzNSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFwiaW52YWxpZCBzdG9yZWQgYmxvY2sgbGVuZ3Roc1xcXCIsIGEubW9kZSA9IDMwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5sZW5ndGggPSA2NTUzNSAmIGgsIGQgPSBoID0gMCwgYS5tb2RlID0gMTUsIDYgPT09IGUpIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDE1OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGEubW9kZSA9IDE2O1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxNjpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodSA9IGEubGVuZ3RoKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvIDwgdSAmJiAodSA9IG8pLCBsIDwgdSAmJiAodSA9IGwpLCAwID09PSB1KSBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBaLmFycmF5U2V0KG4sIGksIHIsIHUsIHMpLCBvIC09IHUsIHIgKz0gdSwgbCAtPSB1LCBzICs9IHUsIGEubGVuZ3RoIC09IHU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGEubW9kZSA9IDEyO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxNzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgZCA8IDE0Oykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgby0tLCBoICs9IGlbcisrXSA8PCBkLCBkICs9IDhcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGEubmxlbiA9IDI1NyArICgzMSAmIGgpLCBoID4+Pj0gNSwgZCAtPSA1LCBhLm5kaXN0ID0gMSArICgzMSAmIGgpLCBoID4+Pj0gNSwgZCAtPSA1LCBhLm5jb2RlID0gNCArICgxNSAmIGgpLCBoID4+Pj0gNCwgZCAtPSA0LCAyODYgPCBhLm5sZW4gfHwgMzAgPCBhLm5kaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcInRvbyBtYW55IGxlbmd0aCBvciBkaXN0YW5jZSBzeW1ib2xzXFxcIiwgYS5tb2RlID0gMzA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGEuaGF2ZSA9IDAsIGEubW9kZSA9IDE4O1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxODpcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgYS5oYXZlIDwgYS5uY29kZTspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICg7IGQgPCAzOykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEubGVuc1tBW2EuaGF2ZSsrXV0gPSA3ICYgaCwgaCA+Pj49IDMsIGQgLT0gM1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgYS5oYXZlIDwgMTk7KSBhLmxlbnNbQVthLmhhdmUrK11dID0gMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5sZW5jb2RlID0gYS5sZW5keW4sIGEubGVuYml0cyA9IDcsIHogPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaXRzOiBhLmxlbmJpdHNcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgeCA9IE8oMCwgYS5sZW5zLCAwLCAxOSwgYS5sZW5jb2RlLCAwLCBhLndvcmssIHopLCBhLmxlbmJpdHMgPSB6LmJpdHMsIHgpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFwiaW52YWxpZCBjb2RlIGxlbmd0aHMgc2V0XFxcIiwgYS5tb2RlID0gMzA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGEuaGF2ZSA9IDAsIGEubW9kZSA9IDE5O1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxOTpcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgYS5oYXZlIDwgYS5ubGVuICsgYS5uZGlzdDspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICg7IG0gPSAoUyA9IGEubGVuY29kZVtoICYgKDEgPDwgYS5sZW5iaXRzKSAtIDFdKSA+Pj4gMTYgJiAyNTUsIHcgPSA2NTUzNSAmIFMsICEoKGcgPSBTID4+PiAyNCkgPD0gZCk7KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHcgPCAxNikgaCA+Pj49IGcsIGQgLT0gZywgYS5sZW5zW2EuaGF2ZSsrXSA9IHc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDE2ID09PSB3KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChCID0gZyArIDI7IGQgPCBCOykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgby0tLCBoICs9IGlbcisrXSA8PCBkLCBkICs9IDhcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGggPj4+PSBnLCBkIC09IGcsIDAgPT09IGEuaGF2ZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXCJpbnZhbGlkIGJpdCBsZW5ndGggcmVwZWF0XFxcIiwgYS5tb2RlID0gMzA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHkgPSBhLmxlbnNbYS5oYXZlIC0gMV0sIHUgPSAzICsgKDMgJiBoKSwgaCA+Pj49IDIsIGQgLT0gMlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgxNyA9PT0gdykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoQiA9IGcgKyAzOyBkIDwgQjspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgLT0gZywgeSA9IDAsIHUgPSAzICsgKDcgJiAoaCA+Pj49IGcpKSwgaCA+Pj49IDMsIGQgLT0gM1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKEIgPSBnICsgNzsgZCA8IEI7KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkIC09IGcsIHkgPSAwLCB1ID0gMTEgKyAoMTI3ICYgKGggPj4+PSBnKSksIGggPj4+PSA3LCBkIC09IDdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhLmhhdmUgKyB1ID4gYS5ubGVuICsgYS5uZGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcImludmFsaWQgYml0IGxlbmd0aCByZXBlYXRcXFwiLCBhLm1vZGUgPSAzMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICg7IHUtLTspIGEubGVuc1thLmhhdmUrK10gPSB5XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDMwID09PSBhLm1vZGUpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBhLmxlbnNbMjU2XSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXCJpbnZhbGlkIGNvZGUgLS0gbWlzc2luZyBlbmQtb2YtYmxvY2tcXFwiLCBhLm1vZGUgPSAzMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGEubGVuYml0cyA9IDksIHogPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaXRzOiBhLmxlbmJpdHNcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgeCA9IE8oRCwgYS5sZW5zLCAwLCBhLm5sZW4sIGEubGVuY29kZSwgMCwgYS53b3JrLCB6KSwgYS5sZW5iaXRzID0gei5iaXRzLCB4KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcImludmFsaWQgbGl0ZXJhbC9sZW5ndGhzIHNldFxcXCIsIGEubW9kZSA9IDMwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5kaXN0Yml0cyA9IDYsIGEuZGlzdGNvZGUgPSBhLmRpc3RkeW4sIHogPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaXRzOiBhLmRpc3RiaXRzXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHggPSBPKEksIGEubGVucywgYS5ubGVuLCBhLm5kaXN0LCBhLmRpc3Rjb2RlLCAwLCBhLndvcmssIHopLCBhLmRpc3RiaXRzID0gei5iaXRzLCB4KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcImludmFsaWQgZGlzdGFuY2VzIHNldFxcXCIsIGEubW9kZSA9IDMwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5tb2RlID0gMjAsIDYgPT09IGUpIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDIwOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGEubW9kZSA9IDIxO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyMTpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoNiA8PSBvICYmIDI1OCA8PSBsKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubmV4dF9vdXQgPSBzLCB0LmF2YWlsX291dCA9IGwsIHQubmV4dF9pbiA9IHIsIHQuYXZhaWxfaW4gPSBvLCBhLmhvbGQgPSBoLCBhLmJpdHMgPSBkLCBOKHQsIF8pLCBzID0gdC5uZXh0X291dCwgbiA9IHQub3V0cHV0LCBsID0gdC5hdmFpbF9vdXQsIHIgPSB0Lm5leHRfaW4sIGkgPSB0LmlucHV0LCBvID0gdC5hdmFpbF9pbiwgaCA9IGEuaG9sZCwgZCA9IGEuYml0cywgMTIgPT09IGEubW9kZSAmJiAoYS5iYWNrID0gLTEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGEuYmFjayA9IDA7IG0gPSAoUyA9IGEubGVuY29kZVtoICYgKDEgPDwgYS5sZW5iaXRzKSAtIDFdKSA+Pj4gMTYgJiAyNTUsIHcgPSA2NTUzNSAmIFMsICEoKGcgPSBTID4+PiAyNCkgPD0gZCk7KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobSAmJiAwID09ICgyNDAgJiBtKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHAgPSBnLCB2ID0gbSwgayA9IHc7IG0gPSAoUyA9IGEubGVuY29kZVtrICsgKChoICYgKDEgPDwgcCArIHYpIC0gMSkgPj4gcCldKSA+Pj4gMTYgJiAyNTUsIHcgPSA2NTUzNSAmIFMsICEocCArIChnID0gUyA+Pj4gMjQpIDw9IGQpOykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggPj4+PSBwLCBkIC09IHAsIGEuYmFjayArPSBwXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoID4+Pj0gZywgZCAtPSBnLCBhLmJhY2sgKz0gZywgYS5sZW5ndGggPSB3LCAwID09PSBtKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEubW9kZSA9IDI2O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoMzIgJiBtKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEuYmFjayA9IC0xLCBhLm1vZGUgPSAxMjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDY0ICYgbSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXCJpbnZhbGlkIGxpdGVyYWwvbGVuZ3RoIGNvZGVcXFwiLCBhLm1vZGUgPSAzMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYS5leHRyYSA9IDE1ICYgbSwgYS5tb2RlID0gMjI7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDIyOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhLmV4dHJhKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoQiA9IGEuZXh0cmE7IGQgPCBCOykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEubGVuZ3RoICs9IGggJiAoMSA8PCBhLmV4dHJhKSAtIDEsIGggPj4+PSBhLmV4dHJhLCBkIC09IGEuZXh0cmEsIGEuYmFjayArPSBhLmV4dHJhXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGEud2FzID0gYS5sZW5ndGgsIGEubW9kZSA9IDIzO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyMzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgbSA9IChTID0gYS5kaXN0Y29kZVtoICYgKDEgPDwgYS5kaXN0Yml0cykgLSAxXSkgPj4+IDE2ICYgMjU1LCB3ID0gNjU1MzUgJiBTLCAhKChnID0gUyA+Pj4gMjQpIDw9IGQpOykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgby0tLCBoICs9IGlbcisrXSA8PCBkLCBkICs9IDhcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT0gKDI0MCAmIG0pKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAocCA9IGcsIHYgPSBtLCBrID0gdzsgbSA9IChTID0gYS5kaXN0Y29kZVtrICsgKChoICYgKDEgPDwgcCArIHYpIC0gMSkgPj4gcCldKSA+Pj4gMTYgJiAyNTUsIHcgPSA2NTUzNSAmIFMsICEocCArIChnID0gUyA+Pj4gMjQpIDw9IGQpOykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggPj4+PSBwLCBkIC09IHAsIGEuYmFjayArPSBwXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoID4+Pj0gZywgZCAtPSBnLCBhLmJhY2sgKz0gZywgNjQgJiBtKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcImludmFsaWQgZGlzdGFuY2UgY29kZVxcXCIsIGEubW9kZSA9IDMwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBhLm9mZnNldCA9IHcsIGEuZXh0cmEgPSAxNSAmIG0sIGEubW9kZSA9IDI0O1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyNDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5leHRyYSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKEIgPSBhLmV4dHJhOyBkIDwgQjspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgby0tLCBoICs9IGlbcisrXSA8PCBkLCBkICs9IDhcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhLm9mZnNldCArPSBoICYgKDEgPDwgYS5leHRyYSkgLSAxLCBoID4+Pj0gYS5leHRyYSwgZCAtPSBhLmV4dHJhLCBhLmJhY2sgKz0gYS5leHRyYVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5vZmZzZXQgPiBhLmRtYXgpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFwiaW52YWxpZCBkaXN0YW5jZSB0b28gZmFyIGJhY2tcXFwiLCBhLm1vZGUgPSAzMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYS5tb2RlID0gMjU7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDI1OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBsKSBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1ID0gXyAtIGwsIGEub2Zmc2V0ID4gdSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHUgPSBhLm9mZnNldCAtIHUpID4gYS53aGF2ZSAmJiBhLnNhbmUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcImludmFsaWQgZGlzdGFuY2UgdG9vIGZhciBiYWNrXFxcIiwgYS5tb2RlID0gMzA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPiBhLnduZXh0ID8gKHUgLT0gYS53bmV4dCwgYyA9IGEud3NpemUgLSB1KSA6IGMgPSBhLnduZXh0IC0gdSwgdSA+IGEubGVuZ3RoICYmICh1ID0gYS5sZW5ndGgpLCBiID0gYS53aW5kb3dcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgYiA9IG4sIGMgPSBzIC0gYS5vZmZzZXQsIHUgPSBhLmxlbmd0aDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGwgPCB1ICYmICh1ID0gbCksIGwgLT0gdSwgYS5sZW5ndGggLT0gdTsgbltzKytdID0gYltjKytdLCAtLXU7KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAwID09PSBhLmxlbmd0aCAmJiAoYS5tb2RlID0gMjEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyNjpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbCkgYnJlYWsgdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBuW3MrK10gPSBhLmxlbmd0aCwgbC0tLCBhLm1vZGUgPSAyMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGEud3JhcCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgZCA8IDMyOykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggfD0gaVtyKytdIDw8IGQsIGQgKz0gOFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfIC09IGwsIHQudG90YWxfb3V0ICs9IF8sIGEudG90YWwgKz0gXywgXyAmJiAodC5hZGxlciA9IGEuY2hlY2sgPSBhLmZsYWdzID8gQyhhLmNoZWNrLCBuLCBfLCBzIC0gXykgOiBSKGEuY2hlY2ssIG4sIF8sIHMgLSBfKSksIF8gPSBsLCAoYS5mbGFncyA/IGggOiBMKGgpKSAhPT0gYS5jaGVjaykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFwiaW5jb3JyZWN0IGRhdGEgY2hlY2tcXFwiLCBhLm1vZGUgPSAzMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IGggPSAwXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGEubW9kZSA9IDI4O1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyODpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS53cmFwICYmIGEuZmxhZ3MpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICg7IGQgPCAzMjspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgby0tLCBoICs9IGlbcisrXSA8PCBkLCBkICs9IDhcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaCAhPT0gKDQyOTQ5NjcyOTUgJiBhLnRvdGFsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFwiaW5jb3JyZWN0IGxlbmd0aCBjaGVja1xcXCIsIGEubW9kZSA9IDMwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gaCA9IDBcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYS5tb2RlID0gMjk7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDI5OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHggPSAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIHQ7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDMwOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHggPSAtMztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhayB0O1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAzMTpcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTQ7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDMyOlxcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gVFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiB0Lm5leHRfb3V0ID0gcywgdC5hdmFpbF9vdXQgPSBsLCB0Lm5leHRfaW4gPSByLCB0LmF2YWlsX2luID0gbywgYS5ob2xkID0gaCwgYS5iaXRzID0gZCwgKGEud3NpemUgfHwgXyAhPT0gdC5hdmFpbF9vdXQgJiYgYS5tb2RlIDwgMzAgJiYgKGEubW9kZSA8IDI3IHx8IDQgIT09IGUpKSAmJiBqKHQsIHQub3V0cHV0LCB0Lm5leHRfb3V0LCBfIC0gdC5hdmFpbF9vdXQpID8gKGEubW9kZSA9IDMxLCAtNCkgOiAoZiAtPSB0LmF2YWlsX2luLCBfIC09IHQuYXZhaWxfb3V0LCB0LnRvdGFsX2luICs9IGYsIHQudG90YWxfb3V0ICs9IF8sIGEudG90YWwgKz0gXywgYS53cmFwICYmIF8gJiYgKHQuYWRsZXIgPSBhLmNoZWNrID0gYS5mbGF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A0LCA1LCA3LCA5LCAxMywgMTcsIDI1LCAzMywgNDksIDY1LCA5NywgMTI5LCAxOTMsIDI1NywgMzg1LCA1MTMsIDc2OSwgMTAyNSwgMTUzNywgMjA0OSwgMzA3MywgNDA5NywgNjE0NSwgODE5MywgMTIyODksIDE2Mzg1LCAyNDU3NywgMCwgMF0sXFxuICAgICAgICAgICAgICAgIEYgPSBbMTYsIDE2LCAxNiwgMTYsIDE3LCAxNywgMTgsIDE4LCAxOSwgMTksIDIwLCAyMCwgMjEsIDIxLCAyMiwgMjIsIDIzLCAyMywgMjQsIDI0LCAyNSwgMjUsIDI2LCAyNiwgMjcsIDI3LCAyOCwgMjgsIDI5LCAyOSwgNjQsIDY0XTtcXG4gICAgICAgICAgICBlLmV4cG9ydHMgPSBmdW5jdGlvbih0LCBlLCBhLCBpLCBuLCByLCBzLCBvKSB7XFxuICAgICAgICAgICAgICAgIHZhciBsLCBoLCBkLCBmLCBfLCB1LCBjLCBiLCBnLCBtID0gby5iaXRzLFxcbiAgICAgICAgICAgICAgICAgICAgdyA9IDAsXFxuICAgICAgICAgICAgICAgICAgICBwID0gMCxcXG4gICAgICAgICAgICAgICAgICAgIHYgPSAwLFxcbiAgICAgICAgICAgICAgICAgICAgayA9IDAsXFxuICAgICAgICAgICAgICAgICAgICB5ID0gMCxcXG4gICAgICAgICAgICAgICAgICAgIHggPSAwLFxcbiAgICAgICAgICAgICAgICAgICAgeiA9IDAsXFxuICAgICAgICAgICAgICAgICAgICBCID0gMCxcXG4gICAgICAgICAgICAgICAgICAgIFMgPSAwLFxcbiAgICAgICAgICAgICAgICAgICAgRSA9IDAsXFxuICAgICAgICAgICAgICAgICAgICBBID0gbnVsbCxcXG4gICAgICAgICAgICAgICAgICAgIFogPSAwLFxcbiAgICAgICAgICAgICAgICAgICAgUiA9IG5ldyBELkJ1ZjE2KDE2KSxcXG4gICAgICAgICAgICAgICAgICAgIEMgPSBuZXcgRC5CdWYxNigxNiksXFxuICAgICAgICAgICAgICAgICAgICBOID0gbnVsbCxcXG4gICAgICAgICAgICAgICAgICAgIE8gPSAwO1xcbiAgICAgICAgICAgICAgICBmb3IgKHcgPSAwOyB3IDw9IDE1OyB3KyspIFJbd10gPSAwO1xcbiAgICAgICAgICAgICAgICBmb3IgKHAgPSAwOyBwIDwgaTsgcCsrKSBSW2VbYSArIHBdXSsrO1xcbiAgICAgICAgICAgICAgICBmb3IgKHkgPSBtLCBrID0gMTU7IDEgPD0gayAmJiAwID09PSBSW2tdOyBrLS0pO1xcbiAgICAgICAgICAgICAgICBpZiAoayA8IHkgJiYgKHkgPSBrKSwgMCA9PT0gaykgcmV0dXJuIG5bcisrXSA9IDIwOTcxNTIwLCBuW3IrK10gPSAyMDk3MTUyMCwgby5iaXRzID0gMSwgMDtcXG4gICAgICAgICAgICAgICAgZm9yICh2ID0gMTsgdiA8IGsgJiYgMCA9PT0gUlt2XTsgdisrKTtcXG4gICAgICAgICAgICAgICAgZm9yICh5IDwgdiAmJiAoeSA9IHYpLCB3ID0gQiA9IDE7IHcgPD0gMTU7IHcrKylcXG4gICAgICAgICAgICAgICAgICAgIGlmIChCIDw8PSAxLCAoQiAtPSBSW3ddKSA8IDApIHJldHVybiAtMTtcXG4gICAgICAgICAgICAgICAgaWYgKDAgPCBCICYmICgwID09PSB0IHx8IDEgIT09IGspKSByZXR1cm4gLTE7XFxuICAgICAgICAgICAgICAgIGZvciAoQ1sxXSA9IDAsIHcgPSAxOyB3IDwgMTU7IHcrKykgQ1t3ICsgMV0gPSBDW3ddICsgUlt3XTtcXG4gICAgICAgICAgICAgICAgZm9yIChwID0gMDsgcCA8IGk7IHArKykgMCAhPT0gZVthICsgcF0gJiYgKHNbQ1tlW2EgKyBwXV0rK10gPSBwKTtcXG4gICAgICAgICAgICAgICAgaWYgKDAgPT09IHQgPyAoQSA9IE4gPSBzLCB1ID0gMTkpIDogMSA9PT0gdCA/IChBID0gSSwgWiAtPSAyNTcsIE4gPSBVLCBPIC09IDI1NywgdSA9IDI1NikgOiAoQSA9IFQsIE4gPSBGLCB1ID0gLTEpLCB3ID0gdiwgXyA9IHIsIHogPSBwID0gRSA9IDAsIGQgPSAtMSwgZiA9IChTID0gMSA8PCAoeCA9IHkpKSAtIDEsIDEgPT09IHQgJiYgODUyIDwgUyB8fCAyID09PSB0ICYmIDU5MiA8IFMpIHJldHVybiAxO1xcbiAgICAgICAgICAgICAgICBmb3IgKDs7KSB7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGMgPSB3IC0geiwgc1twXSA8IHUgPyAoYiA9IDAsIGcgPSBzW3BdKSA6IHNbcF0gPiB1ID8gKGIgPSBOW08gKyBzW3BdXSwgZyA9IEFbWiArIHNbcF1dKSA6IChiID0gOTYsIGcgPSAwKSwgbCA9IDEgPDwgdyAtIHosIHYgPSBoID0gMSA8PCB4OyBuW18gKyAoRSA+PiB6KSArIChoIC09IGwpXSA9IGMgPDwgMjQgfCBiIDw8IDE2IHwgZyB8IDAsIDAgIT09IGg7KTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobCA9IDEgPDwgdyAtIDE7IEUgJiBsOykgbCA+Pj0gMTtcXG4gICAgICAgICAgICAgICAgICAgIGlmICgwICE9PSBsID8gKEUgJj0gbCAtIDEsIEUgKz0gbCkgOiBFID0gMCwgcCsrLCAwID09IC0tUlt3XSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh3ID09PSBrKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICB3ID0gZVthICsgc1twXV1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGlmICh5IDwgdyAmJiAoRSAmIGYpICE9PSBkKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICgwID09PSB6ICYmICh6ID0geSksIF8gKz0gdiwgQiA9IDEgPDwgKHggPSB3IC0geik7IHggKyB6IDwgayAmJiAhKChCIC09IFJbeCArIHpdKSA8PSAwKTspIHgrKywgQiA8PD0gMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoUyArPSAxIDw8IHgsIDEgPT09IHQgJiYgODUyIDwgUyB8fCAyID09PSB0ICYmIDU5MiA8IFMpIHJldHVybiAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG5bZCA9IEUgJiBmXSA9IHkgPDwgMjQgfCB4IDw8IDE2IHwgXyAtIHIgfCAwXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIDAgIT09IEUgJiYgKG5bXyArIEVdID0gdyAtIHogPDwgMjQgfCA2NCA8PCAxNiB8IDApLCBvLmJpdHMgPSB5LCAwXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIFxcXCIuLi91dGlscy9jb21tb25cXFwiOiAzXFxuICAgICAgICB9XSxcXG4gICAgICAgIDEzOiBbZnVuY3Rpb24odCwgZSwgYSkge1xcbiAgICAgICAgICAgIFxcXCJ1c2Ugc3RyaWN0XFxcIjtcXG4gICAgICAgICAgICBlLmV4cG9ydHMgPSB7XFxuICAgICAgICAgICAgICAgIDI6IFxcXCJuZWVkIGRpY3Rpb25hcnlcXFwiLFxcbiAgICAgICAgICAgICAgICAxOiBcXFwic3RyZWFtIGVuZFxcXCIsXFxuICAgICAgICAgICAgICAgIDA6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiLTFcXFwiOiBcXFwiZmlsZSBlcnJvclxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCItMlxcXCI6IFxcXCJzdHJlYW0gZXJyb3JcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiLTNcXFwiOiBcXFwiZGF0YSBlcnJvclxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCItNFxcXCI6IFxcXCJpbnN1ZmZpY2llbnQgbWVtb3J5XFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIi01XFxcIjogXFxcImJ1ZmZlciBlcnJvclxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCItNlxcXCI6IFxcXCJpbmNvbXBhdGlibGUgdmVyc2lvblxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCB7fV0sXFxuICAgICAgICAxNDogW2Z1bmN0aW9uKHQsIGUsIGEpIHtcXG4gICAgICAgICAgICBcXFwidXNlIHN0cmljdFxcXCI7XFxuICAgICAgICAgICAgdmFyIGwgPSB0KFxcXCIuLi91dGlscy9jb21tb25cXFwiKSxcXG4gICAgICAgICAgICAgICAgbyA9IDAsXFxuICAgICAgICAgICAgICAgIGggPSAxO1xcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIGkodCkge1xcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBlID0gdC5sZW5ndGg7IDAgPD0gLS1lOykgdFtlXSA9IDBcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdmFyIGQgPSAwLFxcbiAgICAgICAgICAgICAgICBzID0gMjksXFxuICAgICAgICAgICAgICAgIGYgPSAyNTYsXFxuICAgICAgICAgICAgICAgIF8gPSBmICsgMSArIHMsXFxuICAgICAgICAgICAgICAgIHUgPSAzMCxcXG4gICAgICAgICAgICAgICAgYyA9IDE5LFxcbiAgICAgICAgICAgICAgICBnID0gMiAqIF8gKyAxLFxcbiAgICAgICAgICAgICAgICBtID0gMTUsXFxuICAgICAgICAgICAgICAgIG4gPSAxNixcXG4gICAgICAgICAgICAgICAgYiA9IDcsXFxuICAgICAgICAgICAgICAgIHcgPSAyNTYsXFxuICAgICAgICAgICAgICAgIHAgPSAxNixcXG4gICAgICAgICAgICAgICAgdiA9IDE3LFxcbiAgICAgICAgICAgICAgICBrID0gMTgsXFxuICAgICAgICAgICAgICAgIHkgPSBbMCwgMCwgMCwgMCwgMCwgMCwgMCwgMCwgMSwgMSwgMSwgMSwgMiwgMiwgMiwgMiwgMywgMywgMywgMywgNCwgNCwgNCwgNCwgNSwgNSwgNSwgNSwgMF0sXFxuICAgICAgICAgICAgICAgIH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AxLCAwIDwgLS1lOyk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBhID4+PiAxXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIGoodCwgZSwgYSkge1xcbiAgICAgICAgICAgICAgICB2YXIgaSwgbiwgciA9IG5ldyBBcnJheShtICsgMSksXFxuICAgICAgICAgICAgICAgICAgICBzID0gMDtcXG4gICAgICAgICAgICAgICAgZm9yIChpID0gMTsgaSA8PSBtOyBpKyspIHJbaV0gPSBzID0gcyArIGFbaSAtIDFdIDw8IDE7XFxuICAgICAgICAgICAgICAgIGZvciAobiA9IDA7IG4gPD0gZTsgbisrKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgbyA9IHRbMiAqIG4gKyAxXTtcXG4gICAgICAgICAgICAgICAgICAgIDAgIT09IG8gJiYgKHRbMiAqIG5dID0gSChyW29dKyssIG8pKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIEsodCkge1xcbiAgICAgICAgICAgICAgICB2YXIgZTtcXG4gICAgICAgICAgICAgICAgZm9yIChlID0gMDsgZSA8IF87IGUrKykgdC5keW5fbHRyZWVbMiAqIGVdID0gMDtcXG4gICAgICAgICAgICAgICAgZm9yIChlID0gMDsgZSA8IHU7IGUrKykgdC5keW5fZHRyZWVbMiAqIGVdID0gMDtcXG4gICAgICAgICAgICAgICAgZm9yIChlID0gMDsgZSA8IGM7IGUrKykgdC5ibF90cmVlWzIgKiBlXSA9IDA7XFxuICAgICAgICAgICAgICAgIHQuZHluX2x0cmVlWzIgKiB3XSA9IDEsIHQub3B0X2xlbiA9IHQuc3RhdGljX2xlbiA9IDAsIHQubGFzdF9saXQgPSB0Lm1hdGNoZXMgPSAwXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIE0odCkge1xcbiAgICAgICAgICAgICAgICA4IDwgdC5iaV92YWxpZCA/IF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PSB0LnBlbmRpbmdfYnVmW3QubF9idWYgKyBvXSwgbysrLCAwID09PSBpID8gTCh0LCBuLCBlKSA6IChMKHQsIChyID0gWltuXSkgKyBmICsgMSwgZSksIDAgIT09IChzID0geVtyXSkgJiYgRih0LCBuIC09IFJbcl0sIHMpLCBMKHQsIHIgPSBVKC0taSksIGEpLCAwICE9PSAocyA9IHhbcl0pICYmIEYodCwgaSAtPSBEW3JdLCBzKSksIG8gPCB0Lmxhc3RfbGl0Oyk7XFxuICAgICAgICAgICAgICAgIEwodCwgdywgZSlcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gRyh0LCBlKSB7XFxuICAgICAgICAgICAgICAgIHZhciBhLCBpLCBuLCByID0gZS5keW5fdHJlZSxcXG4gICAgICAgICAgICAgICAgICAgIHMgPSBlLnN0YXRfZGVzYy5zdGF0aWNfdHJlZSxcXG4gICAgICAgICAgICAgICAgICAgIG8gPSBlLnN0YXRfZGVzYy5oYXNfc3RyZWUsXFxuICAgICAgICAgICAgICAgICAgICBsID0gZS5zdGF0X2Rlc2MuZWxlbXMsXFxuICAgICAgICAgICAgICAgICAgICBoID0gLTE7XFxuICAgICAgICAgICAgICAgIGZvciAodC5oZWFwX2xlbiA9IDAsIHQuaGVhcF9tYXggPSBnLCBhID0gMDsgYSA8IGw7IGErKykgMCAhPT0gclsyICogYV0gPyAodC5oZWFwWysrdC5oZWFwX2xlbl0gPSBoID0gYSwgdC5kZXB0aFthXSA9IDApIDogclsyICogYSArIDFdID0gMDtcXG4gICAgICAgICAgICAgICAgZm9yICg7IHQuaGVhcF9sZW4gPCAyOykgclsyICogKG4gPSB0LmhlYXBbKyt0LmhlYXBfbGVuXSA9IGggPCAyID8gKytoIDogMCldID0gMSwgdC5kZXB0aFtuXSA9IDAsIHQub3B0X2xlbi0tLCBvICYmICh0LnN0YXRpY19sZW4gLT0gc1syICogbiArIDFdKTtcXG4gICAgICAgICAgICAgICAgZm9yIChlLm1heF9jb2RlID0gaCwgYSA9IHQuaGVhcF9sZW4gPj4gMTsgMSA8PSBhOyBhLS0pIFkodCwgciwgYSk7XFxuICAgICAgICAgICAgICAgIGZvciAobiA9IGw7IGEgPSB0LmhlYXBbMV0sIHQuaGVhcFsxXSA9IHQuaGVhcFt0LmhlYXBfbGVuLS1dLCBZKHQsIHIsIDEpLCBpID0gdC5oZWFwWzFdLCB0LmhlYXBbLS10LmhlYXBfbWF4XSA9IGEsIHQuaGVhcFstLXQuaGVhcF9tYXhdID0gaSwgclsyICogbl0gPSByWzIgKiBhXSArIHJbMiAqIGldLCB0LmRlcHRoW25dID0gKHQuZGVwdGhbYV0gPj0gdC5kZXB0aFtpXSA/IHQuZGVwdGhbYV0gOiB0LmRlcHRoW2ldKSArIDEsIHJbMiAqIGEgKyAxXSA9IHJbMiAqIGkgKyAxXSA9IG4sIHQuaGVhcFsxXSA9IG4rKywgWSh0LCByLCAxKSwgMiA8PSB0LmhlYXBfbGVuOyk7XFxuICAgICAgICAgICAgICAgIHQuaGVhcFstLXQuaGVhcF9tYXhdID0gdC5oZWFwWzFdLFxcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24odCwgZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhLCBpLCBuLCByLCBzLCBvLCBsID0gZS5keW5fdHJlZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA9IGUubWF4X2NvZGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSBlLnN0YXRfZGVzYy5zdGF0aWNfdHJlZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZiA9IGUuc3RhdF9kZXNjLmhhc19zdHJlZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXyA9IGUuc3RhdF9kZXNjLmV4dHJhX2JpdHMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBlLnN0YXRfZGVzYy5leHRyYV9iYXNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjID0gZS5zdGF0X2Rlc2MubWF4X2xlbmd0aCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9IDA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChyID0gMDsgciA8PSBtOyByKyspIHQuYmxfY291bnRbcl0gPSAwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobFsyICogdC5oZWFwW3QuaGVhcF9tYXhdICsgMV0gPSAwLCBhID0gdC5oZWFwX21heCArIDE7IGEgPCBnOyBhKyspIGMgPCAociA9IGxbMiAqIGxbMiAqIChpID0gdC5oZWFwW2FdKSArIDFdICsgMV0gKyAxKSAmJiAociA9IGMsIGIrKyksIGxbMiAqIGkgKyAxXSA9IHIsIGggPCBpIHx8ICh0LmJsX2NvdW50W3JdKyssIHMgPSAwLCB1IDw9IGkgJiYgKHMgPSBfW2kgLSB1XSksIG8gPSBsWzIgKiBpXSwgdC5vcHRfbGVuICs9IG8gKiAociArIHMpLCBmICYmICh0LnN0YXRpY19sZW4gKz0gbyAqIChkWzIgKiBpICsgMV0gKyBzKSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwICE9PSBiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAociA9IGMgLSAxOyAwID09PSB0LmJsX2NvdW50W3JdOykgci0tO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5ibF9jb3VudFtyXS0tLCB0LmJsX2NvdW50W3IgKyAxXSArPSAyLCB0LmJsX2NvdW50W2NdLS0sIGIgLT0gMlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwIDwgYik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAociA9IGM7IDAgIT09IHI7IHItLSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IHQuYmxfY291bnRbcl07IDAgIT09IGk7KSBoIDwgKG4gPSB0LmhlYXBbLS1hXSkgfHwgKGxbMiAqIG4gKyAxXSAhPT0gciAmJiAodC5vcHRfbGVuICs9IChyIC0gbFsyICogbiArIDFdKSAqIGxbMiAqIG5dLCBsWzIgKiBuICsgMV0gPSByKSwgaS0tKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0odCwgZSksIGoociwgaCwgdC5ibF9jb3VudClcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gWCh0LCBlLCBhKSB7XFxuICAgICAgICAgICAgICAgIHZhciBpLCBuLCByID0gLTEsXFxuICAgICAgICAgICAgICAgICAgICBzID0gZVsxXSxcXG4gICAgICAgICAgICAgICAgICAgIG8gPSAwLFxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDcsXFxuICAgICAgICAgICAgICAgICAgICBoID0gNDtcXG4gICAgICAgICAgICAgICAgZm9yICgwID09PSBzICYmIChsID0gMTM4LCBoID0gMyksIGVbMiAqIChhICsgMSkgKyAxXSA9IDY1NTM1LCBpID0gMDsgaSA8PSBhOyBpKyspIG4gPSBzLCBzID0gZVsyICogKGkgKyAxKSArIDFdLCArK28gPCBsICYmIG4gPT09IHMgfHwgKG8gPCBoID8gdC5ibF90cmVlWzIgKiBuXSArPSBvIDogMCAhPT0gbiA/IChuICE9PSByICYmIHQuYmxfdHJlZVsyICogbl0rKywgdC5ibF90cmVlWzIgKiBwXSsrKSA6IG8gPD0gMTAgPyB0LmJsX3RyZWVbMiAqIHZdKysgOiB0LmJsX3RyZWVbMiAqIGtdKyssIHIgPSBuLCAobyA9IDApID09PSBzID8gKGwgPSAxMzgsIGggPSAzKSA6IG4gPT09IHMgPyAobCA9IDYsIGggPSAzKSA6IChsID0gNywgaCA9IDQpKVxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBXKHQsIGUsIGEpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGksIG4sIHIgPSAtMSxcXG4gICAgICAgICAgICAgICAgICAgIHMgPSBlWzFdLFxcbiAgICAgICAgICAgICAgICAgICAgbyA9IDAsXFxuICAgICAgICAgICAgICAgICAgICBsID0gNyxcXG4gICAgICAgICAgICAgICAgICAgIGggPSA0O1xcbiAgICAgICAgICAgICAgICBmb3IgKDAgPT09IHMgJiYgKGwgPSAxMzgsIGggPSAzKSwgaSA9IDA7IGkgPD0gYTsgaSsrKVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKG4gPSBzLCBzID0gZVsyICogKGkgKyAxKSArIDFdLCAhKCsrbyA8IGwgJiYgbiA9PT0gcykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobyA8IGgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBMKHQsIG4sIHQuYmxfdHJlZSksIDAgIT0gLS1vOyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSAwICE9PSBuID8gKG4gIT09IHIgJiYgKEwodCwgbiwgdC5ibF90cmVlKSwgby0tKSwgTCh0LCBwLCB0LmJsX3RyZWUpLCBGKHQsIG8gLSAzLCAyKSkgOiBvIDw9IDEwID8gKEwodCwgdiwgdC5ibF90cmVlKSwgRih0LCBvIC0gMywgMykpIDogKEwodCwgaywgdC5ibF90cmVlKSwgRih0LCBvIC0gMTEsIDcpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByID0gbiwgKG8gPSAwKSA9PT0gcyA/IChsID0gMTM4LCBoID0gMykgOiBuID09PSBzID8gKGwgPSA2LCBoID0gMykgOiAobCA9IDcsIGggPSA0KVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpKEQpO1xcbiAgICAgICAgICAgIHZhciBKID0gITE7XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gUSh0LCBlLCBhLCBpKSB7XFxuICAgICAgICAgICAgICAgIHZhciBuLCByLCBzLCBvO1xcbiAgICAgICAgICAgICAgICBGKHQsIChkIDw8IDEpICsgKGkgPyAxIDogMCksIDMpLCByID0gZSwgcyA9IGEsIG8gPSAhMCwgTShuID0gdCksIG8gJiYgKFQobiwgcyksIFQobiwgfnMpKSwgbC5hcnJheVNldChuLnBlbmRpbmdfYnVmLCBuLndpbmRvdywgciwgcywgbi5wZW5kaW5nKSwgbi5wZW5kaW5nICs9IHNcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgYS5fdHJfaW5pdCA9IGZ1bmN0aW9uKHQpIHtcXG4gICAgICAgICAgICAgICAgSiB8fCAoZnVuY3Rpb24oKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdCwgZSwgYSwgaSwgbiwgciA9IG5ldyBBcnJheShtICsgMSk7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSBhID0gMDsgaSA8IHMgLSAxOyBpKyspXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChSW2ldID0gYSwgdCA9IDA7IHQgPCAxIDw8IHlbaV07IHQrKykgWlthKytdID0gaTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoWlthIC0gMV0gPSBpLCBpID0gbiA9IDA7IGkgPCAxNjsgaSsrKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoRFtpXSA9IG4sIHQgPSAwOyB0IDwgMSA8PCB4W2ldOyB0KyspIEFbbisrXSA9IGk7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKG4gPj49IDc7IGkgPCB1OyBpKyspXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChEW2ldID0gbiA8PCA3LCB0ID0gMDsgdCA8IDEgPDwgeFtpXSAtIDc7IHQrKykgQVsyNTYgKyBuKytdID0gaTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoZSA9IDA7IGUgPD0gbTsgZSsrKSByW2VdID0gMDtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAodCA9IDA7IHQgPD0gMTQzOykgU1syICogdCArIDFdID0gOCwgdCsrLCByWzhdKys7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKDsgdCA8PSAyNTU7KSBTWzIgKiB0ICsgMV0gPSA5LCB0KyssIHJbOV0rKztcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoOyB0IDw9IDI3OTspIFNbMiAqIHQgKyAxXSA9IDcsIHQrKywgcls3XSsrO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yICg7IHQgPD0gMjg3OykgU1syICogdCArIDFdID0gOCwgdCsrLCByWzhdKys7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGooUywgXyArIDEsIHIpLCB0ID0gMDsgdCA8IHU7IHQrKykgRVsyICogdCArIDFdID0gNSwgRVsyICogdF0gPSBIKHQsIDUpO1xcbiAgICAgICAgICAgICAgICAgICAgQyA9IG5ldyBJKFMsIHksIGYgKyAxLCBfLCBtKSwgTiA9IG5ldyBJKEUsIHgsIDAsIHUsIG0pLCBPID0gbmV3IEkobmV3IEFycmF5KDApLCB6LCAwLCBjLCBiKVxcbiAgICAgICAgICAgICAgICB9KCksIEogPSAhMCksIHQubF9kZXNjID0gbmV3IHIodC5keW5fbHRyZWUsIEMpLCB0LmRfZGVzYyA9IG5ldyByKHQuZHluX2R0cmVlLCBOKSwgdC5ibF9kZXNjID0gbmV3IHIodC5ibF90cmVlLCBPKSwgdC5iaV9idWYgPSAwLCB0LmJpX3ZhbGlkID0gMCwgSyh0KVxcbiAgICAgICAgICAgIH0sIGEuX3RyX3N0b3JlZF9ibG9jayA9IFEsIGEuX3RyX2ZsdXNoX2Jsb2NrID0gZnVuY3Rpb24odCwgZSwgYSwgaSkge1xcbiAgICAgICAgICAgICAgICB2YXIgbiwgciwgcyA9IDA7XFxuICAgICAgICAgICAgICAgIDAgPCB0LmxldmVsID8gKDIgPT09IHQuc3RybS5kYXRhX3R5cGUgJiYgKHQuc3RybS5kYXRhX3R5cGUgPSBmdW5jdGlvbih0KSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgZSwgYSA9IDQwOTM2MjQ0NDc7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGUgPSAwOyBlIDw9IDMxOyBlKyssIGEgPj4+PSAxKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgxICYgYSAmJiAwICE9PSB0LmR5bl9sdHJlZVsyICogZV0pIHJldHVybiBvO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKDAgIT09IHQuZHluX2x0cmVlWzE4XSB8fCAwICE9PSB0LmR5bl9sdHJlZVsyMF0gfHwgMCAhPT0gdC5keW5fbHRyZWVbMjZdKSByZXR1cm4gaDtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoZSA9IDMyOyBlIDwgZjsgZSsrKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwICE9PSB0LmR5bl9sdHJlZVsyICogZV0pIHJldHVybiBoO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9cXG4gICAgICAgICAgICAgICAgfSh0KSksIEcodCwgdC5sX2Rlc2MpLCBHKHQsIHQuZF9kZXNjKSwgcyA9IGZ1bmN0aW9uKHQpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBlO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChYKHQsIHQuZHluX2x0cmVlLCB0LmxfZGVzYy5tYXhfY29kZSksIFgodCwgdC5keW5fZHRyZWUsIHQuZF9kZXNjLm1heF9jb2RlKSwgRyh0LCB0LmJsX2Rlc2MpLCBlID0gYyAtIDE7IDMgPD0gZSAmJiAwID09PSB0LmJsX3RyZWVbMiAqIEJbZV0gKyAxXTsgZS0tKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0Lm9wdF9sZW4gKz0gMyAqIChlICsgMSkgKyA1ICsgNSArIDQsIGVcXG4gICAgICAgICAgICAgICAgfSh0KSwgbiA9IHQub3B0X2xlbiArIDMgKyA3ID4+PiAzLCAociA9IHQuc3RhdGljX2xlbiArIDMgKy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7XFxuICAgICAgICAgICAgaWYgKGhhc1J1bGUgfHwgb2JqLm5hbWUgPT0gJycpIHtcXG4gICAgICAgICAgICAgICAgLy90b2FzdChcXFwi6K+36YWN572u5b+r6YCf5pCc57SiXFxcIilcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3NlYXJjaD9zPScgKyB0aXRsZSArICcmcnVsZT0nICsgb2JqLm5hbWU7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG5cXG4gICAgICAgICAgICAgICAgaWYgKG9iai5oYXNPd25Qcm9wZXJ0eShcXFwicnVsZVxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAob2JqLnJ1bGUuaW5kZXhPZignY29weScpIT0tMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLlt7Lnu4/lpI3liLbor7flr7zlhaXop4TliJlcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9iai5ydWxlXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6K+35a6J6KOFXFxcIiArIG9iai5uYW1lICsgXFxcIuWwj+eoi+W6j1xcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCBvYmosIFxcXCJoaWtlcjovL2hvbWVcXFwiLCB0aXRsZSksXFxuICAgICAgICBwaWNfdXJsOiBvYmoucGljLFxcbiAgICAgICAgY29sX3R5cGU6IGpzb24ucXVpY2tTZWFyY2hDb25maWdzLm1vZGUsXFxuICAgICAgICBleHRyYTp7aWQ6J3FzZWFyY2gnfVxcbiAgICB9KVxcbn1cXG5cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuino+WvhlwiLFwicGF0aFwiOlwicGFyc2VcIixcInJ1bGVcIjpcImpzOlxcbmV2YWxQ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gICBwYXJhbXMuY2F0ZV90ZW1wLmZvckVhY2goKGNhdGUsIGluZGV4KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2NhdGUucHVzaChpbmRleCA9PT0gMCA/IHBhcmFtcy5rZXkudG9TdHJpbmcoKSA6IFxcXFxcXFwiMFxcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihNWV9SVUxFLnRpdGxlLCBKU09OLnN0cmluZ2lmeShuZXdfY2F0ZSkpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS50aXRsZSsndXJsJywgaW5wdXQpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiBwYWdlLFxcXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiYmxhbmtfYmxvY2tcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0gZWxzZSBpZiAoZm9sZCA9PT0gJzEnKSB7XFxcXG4gICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBwZGZoKGl0ZW0sIOWIhuexu+agh+mimClcXFxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZToga2V5LnRvU3RyaW5nKCkgPT09IGNhdGVfdGVtcFtpbmRleF0gPyAn4oCc4oCc4oCd4oCdPGI+PHNwYW4gc3R5bGU9XFxcXFxcXCJjb2xvcjogJyArIOWIhuexu+minOiJsiArICdcXFxcXFxcIj4nICsgdGl0bGUgKyAnPC9zcGFuPjwvYj4nIDogdGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChwZChpdGVtLCDliIbnsbvpk77mjqUpICsgJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpXFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihNWV9SVUxFLnRpdGxlLCBKU09OLnN0cmluZ2lmeShwYXJhbXMuY2F0ZV90ZW1wKSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihNWV9SVUxFLnRpdGxlKyd1cmwnLCBpbnB1dClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogaW5kZXgsXF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XFxcXG4gICAgICAgICAgICBicmVhaztcXFxcbiAgICB9XFxcXG5cXFxcbiAgICB2YXIgY29sID0gJ3RleHRfNCc7XFxcXG4gICAgdmFyIHRlbXA9W107XFxcXG4gICAgcGxheXMuZm9yRWFjaCh4ID0+IHtcXFxcbiAgICAgICAgXFxcXG4gICAgICAgIHZhciB0ZXh0ID0gcGRmaCh4LCAnYSYmVGV4dCcpO1xcXFxuICAgICAgICB2YXIgdXJsID0gcGQoeCwgJ2EmJmhyZWYnKSArIGxhenk7XFxcXG4gICAgICAgIGlmICgvKG1hZ25ldHx0b3JyZW50fGVkMmspLy50ZXN0KHVybCkpIHtcXFxcbiAgICAgICAgICAgIHRleHQgPSBwZGZoKHgsICcudGV4dC1tdXRlZCYmVGV4dCcpO1xcXFxuICAgICAgICAgICAgdXJsID0gcGQoeCwgJ2EmJmhyZWYnKTtcXFxcbiAgICAgICAgICAgIGNvbCA9ICd0ZXh0XzInXFxcXG4gICAgICAgIH1cXFxcblxcXFxuICAgICAgICAvKmQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogYOKAnOKAnOKAneKAnTxzbWFsbD5gICsgdGV4dCArIGA8L3NtYWxsPmAsXFxcXG4gICAgICAgICAgICB1cmw6IHVybCxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBjb2wsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGlkOiB1cmwucmVwbGFjZShsYXp5LCAnJylcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSk7Ki9cXFxcbiAgICAgICAgXFxcXG4gICAgICAgIHRlbXAucHVzaCh7dGl0bGU6dGV4dCx1cmw6dXJsfSlcXFxcbiAgICB9KVxcXFxuICAgIGxpc3RzLnB1c2godGVtcClcXFxcbiAgICBcXFxcbn1cXFxcblxcXFxuXFxcXG5sZXQgcHVzaHggPSBnZXRNeVZhcigncHVzaHgnLCAnJylcXFxcbmlmIChwdXNoeCAhPSAnJykge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uICAgICAgICB9XFxcXG4gICAgfSlcXFxcbiAgICBpZiAoaHRtbC5pbmNsdWRlcygnUGxlYXNlIGNvbXBsZXRlIHRoZSBjYXB0Y2hhJykpIHtcXFxcbiAgICAgICAgY2xlYXJWYXIoaG9tZSArICdDb29raWUnKTtcXFxcbiAgICAgICAgY2xlYXJJdGVtKGhvbWUgKyAnQ29va2llJyk7ICAgICAgICBcXFxcbiAgICAgICAgcmV0dXJuICQoJ2hpa2VyOi8vZW1wdHknKS5ydWxlKChob21lLCB1cmwpID0+IHtcXFxcbiAgICAgICAgICAgIHZhciBkID0gW107XFxcXG4gICAgICAgICAgICB2YXIgY29va2llID0gZ2V0VmFyKGhvbWUgKyAnQ29va2llJywgJycpO1xcXFxuICAgICAgICAgICAgLy9sb2coY29va2llKVxcXFxuICAgICAgICAgICAgaWYgKGNvb2tpZSAhPSAnJykge1xcXFxuICAgICAgICAgICAgICAgIHNldEl0ZW0oaG9tZSArICdDb29raWUnLCBjb29raWUpO1xcXFxuICAgICAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcXFxuICAgICAgICAgICAgICAgIHRvYXN0KCfpqozor4HlrozmiJAnKVxcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hYNVdlYlZpZXcoJ2hpa2VyOi8vZW1wdHknKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwieDVfd2Vidmlld19zaW5nbGVcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXFxcbiAgICAgICAgICAgICAgICBkZXNjOiBcXFxcXFxcImZsb2F0JiYxMDAlXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGhvbWUsIHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZWxlbWVudElkID0gXFxcXFxcXCJtZXRhW3Byb3BlcnR5PSdvZzp0eXBlJ11cXFxcXFxcIjsgLy8g5b6F5qOA5p+l55qE5YWD57SgIElEIFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgaW50ZXJ2YWxUaW1lID0gMTAwMDsgLy8g5q+P6ZqUIDEg56eS6ZKf5qOA5p+l5LiA5qyhIFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdGltZXIgPSBzZXRJbnRlcnZhbCgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZWxlbWVudCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoZWxlbWVudElkKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWxlbWVudCkgeyAvLyDlrZjlnKjor6XlhYPntKDvvIzlj6/ku6XmiafooYzmn5Dkupvmk43kvZwgXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZmJhLmxvZygn5a2Y5ZyoJylcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLnJlZnJlc2hYNURlc2MoJ2Zsb2F0JiYwJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuc3R5bGUuY29sb3IgPSAncmVkJztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLnB1dFZhcihob21lICsgJ0Nvb2tpZScsIGZiYS5nZXRDb29raWUodXJsKSk7ICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmeV9icmlkZ2VfYXBwLnJlZnJlc2hQYWdlKHRydWUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsK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Y29uZmlnLmluZGV4ICsgcGRmaChodG1sLCAnI3ZlcmlmeUNvZGUmJnNyYycpLnNsaWNlKDEpXFxcXG5cXFxcbiAgICBsZXQgdmNvZGUgPSBnZXRWQ29kZTIoY29kZXVybCwgSlNPTi5zdHJpbmdpZnkoaGVhZGVycyksICdzdHJpbmcnKTtcXFxcblxcXFxuICAgIHZhciBzdHIgPSBKU09OLnBhcnNlKHZjb2RlKS50ZXh0LnJlcGxhY2UoJz0nLCAnJykucmVwbGFjZSgvKHh8w5cpLywgJyonKS5yZXBsYWNlKCfDtycsICcvJylcXFxcblxcXFxuICAgIHZhciBudW0gPSAwO1xcXFxuICAgIG51bSA9IGV2YWwoc3RyKVxcXFxuICAgIGxvZyhudW0pXFxcXG5cXFxcbiAgICB2YXIgY3VybCA9IE1ZX1VSTCArICc/Y29kZT0nICsgbnVtO1xcXFxuXFxcXG4gICAgaHRtbCA9IGZldGNoKGN1cmwsIHtcXFxcbiAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXFxcbiAgICB9KVxcXFxuICAgIGlmIChodG1sLmluZGV4T2YoJ+i+k+WFpemqjOivgeeggScpID09IC0xKSB7XFxcXG4gICAgICAgIHZhciBjb29raWUgPSBnZXRDb29raWUoY3VybClcXFxcbiAgICAgICAgcHV0TXlWYXIoJ2Nvb2tpZScsIGNvb2tpZSlcXFxcbiAgICB9IGVsc2Uge1xcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6ICfoh6rliqjor4bliKvlpLHotKXvvIzor7fliLfmlrDph43or5XmiJbogIXmiYvliqjpqozor4EnXFxcXG4gICAgICAgIH0pXFxcXG4gICAgICAgIFxcXFxuICAgICAgICB2YXIgZGljdCA9IHtcXFxcbiAgICAgICAgICAgIG15dXJsOiBNWV9VUkwsXFxcXG4gICAgICAgICAgICB2Y29kZTogY29kZXVybFxcXFxuICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiAn54K55oiR5omL5Yqo6aqM6K+BJyxcXFxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSMjJykucnVsZSgoZGljdCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZSgn6K+36L6T5YWl6K6h566X57uT5p6cJyk7XFxcXG4gICAgICAgICAgICAgICAgdmFyIGQgPSBbXTtcXFxcbiAgICAgICAgICAgICAgICB2YXIgbXl1cmwgPSBkaWN0Lm15dXJsO1xcXFxuICAgICAgICAgICAgICAgIHZhciBodG1sID0gZmV0Y2gobXl1cmwpO1xcXFxuICAgICAgICAgICAgICAgIHZhciBjb2RldXJsID0gY29uZmlnLmluZGV4ICsgcGRmaChodG1sLCAnI3ZlcmlmeUNvZGUmJnNyYycpLnNsaWNlKDEpO1xcXFxuICAgICAgICAgICAgICAgIHZhciBiNjQgPSBjb252ZXJ0QmFzZTY0SW1hZ2UoY29kZXVybClcXFxcblxcXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogYjY0LFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3BpY18xX2Z1bGwnLFxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfnoa7orqQnLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkLnRvU3RyaW5nKChteXVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN1cmwgPSBteXVybCArICc/Y29kZT0nICsgaW5wdXQ7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBoZWFkZXJzID0ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiVXNlci1BZ2VudFxcXFxcXFwiOiBNT0JJTEVfVUEsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJSZWZlcmVyXFxcXFxcXCI6IG15dXJsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBmZXRjaChjdXJsLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGh0bWwuaW5kZXhPZign6L6T5YWl6aqM6K+B56CBJykgPT0gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29va2llID0gZ2V0Q29va2llKGN1cmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdjb29raWUnLCBjb29raWUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdCgn5oiQ5Yqf77yM6K+35Yiw5pCc57Si6aG15Yi35pawJylcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoJ+mUmeivr+ivt+mHjeivlScpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgbXl1cmwpLFxcXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgIC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FxcbiAgICAgICAgICAgIGlmICghb1tlXSkge1xcXFxuICAgICAgICAgICAgICAgIGlmICghc1tlXSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgYSA9IFxcXFxcXFwiZnVuY3Rpb25cXFxcXFxcIiA9PSB0eXBlb2YgcmVxdWlyZSAmJiByZXF1aXJlO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoIXQgJiYgYSkgcmV0dXJuIGEoZSwgITApO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoZCkgcmV0dXJuIGQoZSwgITApO1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgaSA9IG5ldyBFcnJvcihcXFxcXFxcIkNhbm5vdCBmaW5kIG1vZHVsZSAnXFxcXFxcXCIgKyBlICsgXFxcXFxcXCInXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBpLmNvZGUgPSBcXFxcXFxcIk1PRFVMRV9OT1RfRk9VTkRcXFxcXFxcIiwgaVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB2YXIgbiA9IG9bZV0gPSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGV4cG9ydHM6IHt9XFxcXG4gICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgICAgICBzW2VdWzBdLmNhbGwobi5leHBvcnRzLCBmdW5jdGlvbih0KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBoKHNbZV1bMV1bdF0gfHwgdClcXFxcbiAgICAgICAgICAgICAgICB9LCBuLCBuLmV4cG9ydHMsIHIsIHMsIG8sIGwpXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICByZXR1cm4gb1tlXS5leHBvcnRzXFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgZm9yICh2YXIgZCA9IFxcXFxcXFwiZnVuY3Rpb25cXFxcXFxcIiA9PSB0eXBlb2YgcmVxdWlyZSAmJiByZXF1aXJlLCB0ID0gMDsgdCA8IGwubGVuZ3RoOyB0KyspIGgobFt0XSk7XFxcXG4gICAgICAgIHJldHVybiBoXFxcXG4gICAgfSh7XFxcXG4gICAgICAgIDE6IFtmdW5jdGlvbih0LCBlLCBhKSB7XFxcXG4gICAgICAgICAgICBcXFxcXFxcInVzZSBzdHJpY3RcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgIHZhciBzID0gdChcXFxcXFxcIi4vemxpYi9kZWZsYXRlXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgIG8gPSB0KFxcXFxcXFwiLi91dGlscy9jb21tb25cXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgbCA9IHQoXFxcXFxcXCIuL3V0aWxzL3N0cmluZ3NcXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgbiA9IHQoXFxcXFxcXCIuL3psaWIvbWVzc2FnZXNcXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgciA9IHQoXFxcXFxcXCIuL3psaWIvenN0cmVhbVxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICBoID0gT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZyxcXFxcbiAgICAgICAgICAgICAgICBkID0gMCxcXFxcbiAgICAgICAgICAgICAgICBmID0gLTEsXFxcXG4gICAgICAgICAgICAgICAgXyA9IDAsXFxcXG4gICAgICAgICAgICAgICAgdSA9IDg7XFxcXG5cXFxcbiAgICAgICAgICAgIGZ1bmN0aW9uIGModCkge1xcXFxuICAgICAgICAgICAgICAgIGlmICghKHRoaXMgaW5zdGFuY2VvZiBjKSkgcmV0dXJuIG5ldyBjKHQpO1xcXFxuICAgICAgICAgICAgICAgIHRoaXMub3B0aW9ucyA9IG8uYXNzaWduKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV2ZWw6IGYsXFxcXG4gICAgICAgICAgICAgICAgICAgIG1ldGhvZDogdSxcXFxcbiAgICAgICAgICAgICAgICAgICAgY2h1bmtTaXplOiAxNjM4NCxcXFxcbiAgICAgICAgICAgICAgICAgICAgd2luZG93Qml0czogMTUsXFxcXG4gICAgICAgICAgICAgICAgICAgIG1lbUxldmVsOiA4LFxcXFxuICAgICAgICAgICAgICAgICAgICBzdHJhdGVneTogXyxcXFxcbiAgICAgICAgICAgICAgICAgICAgdG86IFxcXFxcXFwiXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICB9LCB0IHx8IHt9KTtcXFxcbiAgICAgICAgICAgICAgICB2YXIgZSA9IHRoaXMub3B0aW9ucztcXFxcbiAgICAgICAgICAgICAgICBlLnJhdyAmJiAwIDwgZS53aW5kb3dCaXRzID8gZS53aW5kb3dCaXRzID0gLWUud2luZG93Qml0cyA6IGUuZ3ppcCAmJiAwIDwgZS53aW5kb3dCaXRzICYmIGUud2luZG93Qml0cyA8IDE2ICYmIChlLndpbmRvd0JpdHMgKz0gMTYpLCB0aGlzLmVyciA9IDAsIHRoaXMubXNnID0gXFxcXFxcXCJcXFxcXFxcIiwgdGhpcy5lbmRlZCA9ICExLCB0aGlzLmNodW5rcyA9IFtdLCB0aGlzLnN0cm0gPSBuZXcgciwgdGhpcy5zdHJtLmF2YWlsX291dCA9IDA7XFxcXG4gICAgICAgICAgICAgICAgdmFyIGEgPSBzLmRlZmxhdGVJbml0Mih0aGlzLnN0cm0sIGUubGV2ZWwsIGUubWV0aG9kLCBlLndpbmRvd0JpdHMsIGUubWVtTGV2ZWwsIGUuc3RyYXRlZ3kpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChhICE9PSBkKSB0aHJvdyBuZXcgRXJyb3IoblthXSk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGUuaGVhZGVyICYmIHMuZGVmbGF0ZVNldEhlYWRlcih0aGlzLnN0cm0sIGUuaGVhZGVyKSwgZS5kaWN0aW9uYXJ5KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBpO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaSA9IFxcXFxcXFwic3RyaW5nXFxcXFxcXCIgPT0gdHlwZW9mIGUuZGljdGlvbmFyeSA/IGwuc3RyaW5nMmJ1ZihlLmRpY3Rpb25hcnkpIDogXFxcXFxcXCJbb2JqZWN0IEFycmF5QnVmZmVyXVxcXFxcXFwiID09PSBoLmNhbGwoZS5kaWN0aW9uYXJ5KSA/IG5ldyBVaW50OEFycmF5KGUuZGljdGlvbmFyeSkgOiBlLmRpY3Rpb25hcnksIChhID0gcy5kZWZsYXRlU2V0RGljdGlvbmFyeSh0aGlzLnN0cm0sIGkpKSAhPT0gZCkgdGhyb3cgbmV3IEVycm9yKG5bYV0pO1xcXFxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9kaWN0X3NldCA9ICEwXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgICAgICBmdW5jdGlvbiBpKHQsIGUpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgYSA9IG5ldyBjKGUpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChhLnB1c2godCwgITApLCBhLmVycikgdGhyb3cgYS5tc2cgfHwgblthLmVycl07XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGEucmVzdWx0XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBjLnByb3RvdHlwZS5wdXNoID0gZnVuY3Rpb24odCwgZSkge1xcXFxuICAgICAgICAgICAgICAgIHZhciBhLCBpLCBuID0gdGhpcy5zdHJtLFxcXFxuICAgICAgICAgICAgICAgICAgICByID0gdGhpcy5vcHRpb25zLmNodW5rU2l6ZTtcXFxcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5lbmRlZCkgcmV0dXJuICExO1xcXFxuICAgICAgICAgICAgICAgIGkgPSBlID09PSB+fmUgPyBlIDogITAgPT09IGUgPyA0IDogMCwgXFxcXFxcXCJzdHJpbmdcXFxcXFxcIiA9PSB0eXBlb2YgdCA/IG4uaW5wdXQgPSBsLnN0cmluZzJidWYodCkgOiBcX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cXFwiLi96bGliL21lc3NhZ2VzXFxcXFxcXCI6IDEzLFxcXFxuICAgICAgICAgICAgXFxcXFxcXCIuL3psaWIvenN0cmVhbVxcXFxcXFwiOiAxNVxcXFxuICAgICAgICB9XSxcXFxcbiAgICAgICAgMjogW2Z1bmN0aW9uKHQsIGUsIGEpIHtcXFxcbiAgICAgICAgICAgIFxcXFxcXFwidXNlIHN0cmljdFxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgdmFyIGYgPSB0KFxcXFxcXFwiLi96bGliL2luZmxhdGVcXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgXyA9IHQoXFxcXFxcXCIuL3V0aWxzL2NvbW1vblxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICB1ID0gdChcXFxcXFxcIi4vdXRpbHMvc3RyaW5nc1xcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICBjID0gdChcXFxcXFxcIi4vemxpYi9jb25zdGFudHNcXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgaSA9IHQoXFxcXFxcXCIuL3psaWIvbWVzc2FnZXNcXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgbiA9IHQoXFxcXFxcXCIuL3psaWIvenN0cmVhbVxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICByID0gdChcXFxcXFxcIi4vemxpYi9nemhlYWRlclxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICBiID0gT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZztcXFxcblxcXFxuICAgICAgICAgICAgZnVuY3Rpb24gcyh0KSB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKCEodGhpcyBpbnN0YW5jZW9mIHMpKSByZXR1cm4gbmV3IHModCk7XFxcXG4gICAgICAgICAgICAgICAgdGhpcy5vcHRpb25zID0gXy5hc3NpZ24oe1xcXFxuICAgICAgICAgICAgICAgICAgICBjaHVua1NpemU6IDE2Mzg0LFxcXFxuICAgICAgICAgICAgICAgIC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FxcIiA9PSB0eXBlb2YgZS5kaWN0aW9uYXJ5ID8gZS5kaWN0aW9uYXJ5ID0gdS5zdHJpbmcyYnVmKGUuZGljdGlvbmFyeSkgOiBcXFxcXFxcIltvYmplY3QgQXJyYXlCdWZmZXJdXFxcXFxcXCIgPT09IGIuY2FsbChlLmRpY3Rpb25hcnkpICYmIChlLmRpY3Rpb25hcnkgPSBuZXcgVWludDhBcnJheShlLmRpY3Rpb25hcnkpKSwgZS5yYXcgJiYgKGEgPSBmLmluZmxhdGVTZXREaWN0aW9uYXJ5KHRoaXMuc3RybSwgZS5kaWN0aW9uYXJ5KSkgIT09IGMuWl9PSykpIHRocm93IG5ldyBFcnJvcihpW2FdKVxcXFxuICAgICAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgICAgICBmdW5jdGlvbiBvKHQsIGUpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgYSA9IG5ldyBzKGUpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChhLnB1c2godCwgITApLCBhLmVycikgdGhyb3cgYS5tc2cgfHwgaVthLmVycl07XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGEucmVzdWx0XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBzLnByb3RvdHlwZS5wdXNoID0gZnVuY3Rpb24odCwgZSkge1xcXFxuICAgICAgICAgICAgICAgIHZhciBhLCBpLCBuLCByLCBzLCBvID0gdGhpcy5zdHJtLFxcXFxuICAgICAgICAgICAgICAgICAgICBsID0gdGhpcy5vcHRpb25zLmNodW5rU2l6ZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgaCA9IHRoaXMub3B0aW9ucy5kaWN0aW9uYXJ5LFxcXFxuICAgICAgICAgICAgICAgICAgICBkID0gITE7XFxcXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuZW5kZWQpIHJldHVybiAhMTtcXFxcbiAgICAgICAgICAgICAgICBpID0gZSA9PT0gfn5lID8gZSA6ICEwID09PSBlID8gYy5aX0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IiAhPSB0eXBlb2YgVWludDhBcnJheSAmJiBcXFxcXFxcInVuZGVmaW5lZFxcXFxcXFwiICE9IHR5cGVvZiBVaW50MTZBcnJheSAmJiBcXFxcXFxcInVuZGVmaW5lZFxcXFxcXFwiICE9IHR5cGVvZiBJbnQzMkFycmF5O1xcXFxuICAgICAgICAgICAgYS5hc3NpZ24gPSBmdW5jdGlvbih0KSB7XFxcXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgZSwgYSwgaSA9IEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKGFyZ3VtZW50cywgMSk7IGkubGVuZ3RoOykge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgbiA9IGkuc2hpZnQoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKG4pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcXFxcXFxcIm9iamVjdFxcXFxcXFwiICE9IHR5cGVvZiBuKSB0aHJvdyBuZXcgVHlwZUVycm9yKG4gKyBcXFxcXFxcIm11c3QgYmUgbm9uLW9iamVjdFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHIgaW4gbikgZSA9IG4sIGEgPSByLCBPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSwgYSkgJiYgKHRbcl0gPSBuW3JdKVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiB0XFxcXG4gICAgICAgICAgICB9LCBhLnNocmlua0J1ZiA9IGZ1bmN0aW9uKHQsIGUpIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gdC5sZW5ndGggPT09IGUgPyB0IDogdC5zdWJhcnJheSA/IHQuc3ViYXJyYXkoMCwgZSkgOiAodC5sZW5ndGggPSBlLCB0KVxcXFxuICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgIHZhciBuID0ge1xcXFxuICAgICAgICAgICAgICAgICAgICBhcnJheVNldDogZnVuY3Rpb24odCwgZSwgYSwgaSwgbikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUuc3ViYXJyYXkgJiYgdC5zdWJhcnJheSkgdC5zZXQoZS5zdWJhcnJheShhLCBhICsgaSksIG4pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHIgPSAwOyByIDwgaTsgcisrKSB0W24gKyByXSA9IGVbYSArIHJdXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgIGZsYXR0ZW5DaHVua3M6IGZ1bmN0aW9uKHQpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlLCBhLCBpLCBuLCByLCBzO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChlID0gaSA9IDAsIGEgPSB0Lmxlbmd0aDsgZSA8IGE7IGUrKykgaSArPSB0W2VdLmxlbmd0aDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAocyA9IG5ldyBVaW50OEFycmF5KGkpLCBlID0gbiA9IDAsIGEgPSB0Lmxlbmd0aDsgZSA8IGE7IGUrKykgciA9IHRbZV0sIHMuc2V0KHIsIG4pLCBuICs9IHIubGVuZ3RoO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgciA9IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgYXJyYXlTZXQ6IGZ1bmN0aW9uKHQsIGUsIGEsIGksIG4pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHIgPSAwOyByIDwgaTsgcisrKSB0W24gKyByXSA9IGVbYSArIHJdXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgIGZsYXR0ZW5DaHVua3M6IGZ1bmN0aW9uKHQpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbXS5jb25jYXQuYXBwbHkoW10sIHQpXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgYS5zZXRUeXBlZCA9IGZ1bmN0aW9uKHQpIHtcXFxcbiAgICAgICAgICAgICAgICB0ID8gKGEuQnVmOCA9IFVpbnQ4QXJyYXksIGEuQnVmMTYgPSBVaW50MTZBcnJheSwgYS5CdWYzMiA9IEludDMyQXJyYXksIGEuYXNzaWduKGEsIG4pKSA6IChhLkJ1ZjggPSBBcnJheSwgYS5CdWYxNiA9IEFycmF5LCBhLkJ1ZjMyID0gQXJyYXksIGEuYXNzaWduKGEsIHIpKVxcXFxuICAgICAgICAgICAgfSwgYS5zZXRUeXBlZChpKVxcXFxuICAgICAgICB9LCB7fV0sXFxcXG4gICAgICAgIDQ6IFtmdW5jdGlvbih0LCBlLCBhKSB7XFxcXG4gICAgICAgICAgICBcXFxcXFxcInVzZSBzdHJpY3RcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgIHZhciBsID0gdChcXFxcXFxcIi4vY29tbW9uXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgIG4gPSAhMCxcXFxcbiAgICAgICAgICAgICAgICByID0gITA7XFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIFN0cmluZy5mcm9tQ2hhckNvZGUuYXBwbHkobnVsbCwgWzBdKVxcXFxuICAgICAgICAgICAgfSBjYXRjaCAodCkge1xcXFxuICAgICAgICAgICAgICAgIG4gPSAhMVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICBTdHJpbmcuZnJvbUNoYXJDb2RlLmFwcGx5KG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yBhIDwgaTsgYSsrKSBlW2FdID0gdC5jaGFyQ29kZUF0KGEpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBlXFxcXG4gICAgICAgICAgICB9LCBhLmJ1ZjJzdHJpbmcgPSBmdW5jdGlvbih0LCBlKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIGEsIGksIG4sIHIsIHMgPSBlIHx8IHQubGVuZ3RoLFxcXFxuICAgICAgICAgICAgICAgICAgICBvID0gbmV3IEFycmF5KDIgKiBzKTtcXFxcbiAgICAgICAgICAgICAgICBmb3IgKGEgPSBpID0gMDsgYSA8IHM7KVxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoKG4gPSB0W2ErK10pIDwgMTI4KSBvW2krK10gPSBuO1xcXFxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICg0IDwgKHIgPSBoW25dKSkgb1tpKytdID0gNjU1MzMsIGEgKz0gciAtIDE7XFxcXG4gICAgICAgICAgICAgICAgZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobiAmPSAyID09PSByID8gMzEgOiAzID09PSByID8gMTUgOiA3OyAxIDwgciAmJiBhIDwgczspIG4gPSBuIDw8IDYgfCA2MyAmIHRbYSsrXSwgci0tO1xcXFxuICAgICAgICAgICAgICAgICAgICAxIDwgciA/IG9baSsrXSA9IDY1NTMzIDogbiA8IDY1NTM2ID8gb1tpKytdID0gbiA6IChuIC09IDY1NTM2LCBvW2krK10gPSA1NTI5NiB8IG4gPj4gMTAgJiAxMDIzLCBvW2krK10gPSA1NjMyMCB8IDEwMjMgJiBuKVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gZChvLCBpKVxcXFxuICAgICAgICAgICAgfSwgYS51dGY4Ym9yZGVyID0gZnVuY3Rpb24odCwgZSkge1xcXFxuICAgICAgICAgICAgICAgIHZhciBhO1xcXFxuICAgICAgICAgICAgICAgIGZvciAoKGUgPSBlIHx8IHQubGVuZ3RoKSA+IHQubGVuZ3RoICYmIChlID0gdC5sZW5ndGgpLCBhID0gZSAtIDE7IDAgPD0gYSAmJiAxMjggPT0gKDE5MiAmIHRbYV0pOykgYS0tO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBhIDwgMCA/IGUgOiAwID09PSBhID8gZSA6IGEgKyBoW3RbYV1dID4gZSA/IGEgOiBlXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgIFxcXFxcXFwiLi9jb21tb25cXFxcXFxcIjogM1xcXFxuICAgICAgICB9XSxcXFxcbiAgICAgICAgNTogW2Z1bmN0aW9uKHQsIGUsIGEpIHtcXFxcbiAgICAgICAgICAgIFxcXFxcXFwidXNlIHN0cmljdFxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgZS5leHBvcnRzID0gZnVuY3Rpb24odCwgZSwgYSwgaSkge1xcXFxuICAgICAgICAgICAgICAgIGZvciAodmFyIG4gPSA2NTUzNSAmIHQgfCAwLCByID0gdCA+Pj4gMTYgJiA2NTUzNSB8IDAsIHMgPSAwOyAwICE9PSBhOykge1xcXFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGEgLT0gcyA9IDJlMyA8IGEgPyAyZTMgOiBhOyByID0gciArIChuID0gbiArIGVbaSsrXSB8IDApIHwgMCwgLS1zOyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIG4gJT0gNjU1MjEsIHIgJT0gNjU1MjFcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIG4gfCByIDw8IDE2IHwgMFxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9LCB7fV0sXFxcXG4gICAgICAgIDY6IFtmdW5jdGlvbih0LCBlLCBhKSB7XFxcXG4gICAgICAgICAgICBcXFxcXFxcInVzZSBzdHJpY3RcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgIGUuZXhwb3J0cyA9IHtcXFxcbiAgICAgICAgICAgICAgICBaX05PX0ZMVVNIOiAwLFxcXFxuICAgICAgICAgICAgICAgIFpfUEFSVElBTF9GTFVTSDogMSxcXFxcbiAgICAgICAgICAgICAgICBaX1NZTkNfRkxVU0g6IDIsXFxcXG4gICAgICAgICAgICAgICAgWl9GVUxMX0ZMVVNIOiAzLFxcXFxuICAgICAgICAgICAgICAgIFpfRklOSVNIOiA0LFxcXFxuICAgICAgICAgICAgICAgIFpfQkxPQ0s6IDUsXFxcXG4gICAgICAgICAgICAgICAgWl9UUkVFUzogNixcXFxcbiAgICAgICAgICAgICAgICBaX09LOiAwLFxcXFxuICAgICAgICAgICAgICAgIFpfU1RSRUFNX0VORDogMSxcXFxcbiAgICAgICAgICAgICAgICBaX05FRURfRElDVDogMixcXFxcbiAgICAgICAgICAgICAgICBaX0VSUk5POiAtMSxcXFxcbiAgICAgICAgICAgICAgICBaX1NUUkVBTV9FUlJPUjogLTIsXFxcXG4gICAgICAgICAgICAgICAgWl9EQVRBX0VSUk9SOiAtMyxcXFxcbiAgICAgICAgICAgICAgICBaX0JVRl9FUlJPUjogLTUsXFxcXG4gICAgICAgICAgICAgICAgWl9OT19DT01QUkVTU0lPTjogMCxcXFxcbiAgICAgICAgICAgICAgICBaX0JFU1RfU1BFRUQ6IDEsXFxcXG4gICAgICAgICAgICAgICAgWl9CRVNUX0NPTVBSRVNTSU9OOiA5LFxcXFxuICAgICAgICAgICAgICAgIFpfREVGQVVMVF9DT01QUkVTU0lPTjogLTEsXFxcXG4gICAgICAgICAgICAgICAgWl9GSUxURVJFRDogMSxcXFxcbiAgICAgICAgICAgICAgICBaX0hVRkZNQU5fT05MWTogMixcXFxcbiAgICAgICAgICAgICAgICBaX1JMRTogMyxcXFxcbiAgICAgICAgICAgICAgICBaX0ZJWEVEOiA0LFxcXFxuICAgICAgICAgICAgICAgIFpfREVGQVVMVF9TVFJBVEVHWTogMCxcXFxcbiAgICAgICAgICAgICAgICBaX0JJTkFSWTogMCxcXFxcbiAgICAgICAgICAgICAgICBaX1RFWFQ6IDEsXFxcXG4gICAgICAgICAgICAgICAgWl9VTktOT1dOOiAyLFxcXFxuICAgICAgICAgICAgICAgIFpfREVGTEFURUQ6IDhcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSwge31dLFxcXFxuICAgICAgICA3OiBbZnVuY3Rpb24odCwgZSwgYSkge1xcXFxuICAgICAgICAgICAgXFxcXFxcXCJ1c2Ugc3RyaWN0XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICB2YXIgbyA9IGZ1bmN0aW9uKCkge1xcXFxuICAgICAgICAgICAgICAgIGZvciAodmFyIHQsIGUgPSBbXSwgYSA9IDA7IGEgPCAyNTY7IGErKykge1xcXFxuICAgICAgICAgICAgICAgICAgICB0ID0gYTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA4OyBpKyspIHQgPSAxICYgdCA/IDM5ODgyOTIzODQgXiB0ID4+PiAxIDogdCA+Pj4gMTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZVthXSA9IHRcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGVcXFxcbiAgICAgICAgICAgIH0oKTtcXFxcbiAgICAgICAgICAgIGUuZXhwb3J0cyA9IGZ1bmN0aW9uKHQsIGUsIGEsIGkpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgbiA9IG8sXFxcXG4gICAgICAgICAgICAgICAgICAgIHIgPSBpICsgYTtcXFxcbiAgICAgICAgICAgICAgICB0IF49IC0xO1xcXFxuICAgICAgICAgICAgICAgIGZvciAodmFyIHMgPSBpOyBzIDwgcjsgcysrKSB0ID0gdCA+Pj4gOCBeIG5bMjU1ICYgKHQgXiBlW3NdKV07XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIC0xIF4gdFxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9LCB7fV0sXFxcXG4gICAgICAgIDg6IFtmdW5jdGlvbih0LCBlLCBhKSB7XFxcXG4gICAgICAgICAgICBcXFxcXFxcInVzZSBzdHJpY3RcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgIHZhciBsLCBfID0gdChcXFxcXFxcIi4uL3V0aWxzL2NvbW1vblxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICBoID0gdChcXFxcXFxcIi4vdHJlZXNcXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgdSA9IHQoXFxcXFxcXCIuL2FkbGVyMzJcXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgYyA9IHQoXFxcXFxcXCIuL2NyYzMyXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgIGkgPSB0KFxcXFxcXFwiLi9tZXNzYWdlc1xcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICBkID0gMCxcXFxcbiAgICAgICAgICAgICAgICBmID0gNCxcXFxcbiAgICAgICAgICAgICAgICBiID0gMCxcXFxcbiAgICAgICAgICAgICAgICBnID0gLTIsXFxcXG4gICAgICAgICAgICAgICAgbSA9IC0xLFxcXFxuICAgICAgICAgICAgICAgIHcgPSA0LFxcXFxuICAgICAgICAgICAgICAgIG4gPSAyLFxcXFxuICAgICAgICAgICAgICAgIHAgPSA4LFxcXFxuICAgICAgICAgICAgICAgIHYgPSA5LFxcXFxuICAgICAgICAgICAgICAgIHIgPSAyODYsXFxcXG4gICAgICAgICAgICAgICAgcyA9IDMwLFxcXFxuICAgICAgICAgICAgICAgIG8gPSAxOSxcXFxcbiAgICAgICAgICAgICAgICBrID0gMiAqIHIgKyAxLFxcXFxuICAgICAgICAgICAgICAgIHkgPSAxNSxcXFxcbiAgICAgICAgICAgICAgICB4ID0gMyxcXFxcbiAgICAgICAgICAgICAgICB6ID0gMjU4LFxcXFxuICAgICAgICAgICAgICAgIEIgPSB6ICsgeCArIDEsXFxcXG4gICAgICAgICAgICAgICAgUyA9IDQyLFxcXFxuICAgICAgICAgICAgICAgIEUgPSAxMTMsXFxcXG4gICAgICAgICAgICAgICAgQSA9IDEsXFxcXG4gICAgICAgICAgICAgICAgWiA9IDIsXFxcXG4gICAgICAgICAgICAgICAgUiA9IDMsXFxcXG4gICAgICAgICAgICAgICAgQyA9IDQ7XFxcXG5cXFxcbiAgICAgICAgICAgIGZ1bmN0aW9uIE4odCwgZSkge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiB0Lm1zZyA9IGlbZV0sIGVcXFxcbiAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgZnVuY3Rpb24gTyh0KSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICh0IDw8IDEpIC0gKDQgPCB0ID8gOSA6IDApXFxcXG4gICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgIGZ1bmN0aW9uIEQodCkge1xcXFxuICAgICAgICAgICAgICAgIGZvciAodmFyIGUgPSB0Lmxlbmd0aDsgMCA8PSAtLWU7KSB0W2VdID0gMFxcXFxuICAgICAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgICAgICBmdW5jdGlvbiBJKHQpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgZSA9IHQuc3RhdGUsXFxcXG4gICAgICAgICAgICAgICAgICAgIGEgPSBlLnBlbmRpbmc7XFxcXG4gICAgICAgICAgICAgICAgYSA+IHQuYXZhaWxfb3V0ICYmIChhID0gdC5hdmFpbF9vdXQpLCAwICE9PSBhICYmIChfLmFycmF5U2V0KHQub3V0cHV0LCBlLnBlbmRpbmdfYnVmLCBlLnBlbmRpbmdfb3V0LCBhLCB0Lm5leHRfb3V0KSwgdC5uZXh0X291dCArPSBhLCBlLnBlbmRpbmdfb3V0ICs9IGEsIHQudG90YWxfb3V0ICs9IGEsIHQuYXZhaWxfb3V0IC09IGEsIGUucGVuZGluZyAtPSBhLCAwID09PSBlLnBlbmRpbmcgJiYgKGUucGVuZGluZ19vdXQgPSAwKSlcXFxcbiAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgZnVuY3Rpb24gVSh0LCBlKSB7XFxcXG4gICAgICAgICAgICAgICAgaC5fdHJfZmx1c2hfYmxvY2sodCwgMCA8PSB0LmJsb2NrX3N0YXJ0ID8gdC5ibG9ja19zdGFydCA6IC0xLCB0LnN0cnN0YXJ0IC0gdC5ibG9ja19zdGFydCwgZSksIHQuYmxvY2tfc3RhcnQgPSB0LnN0cnN0YXJ0LCBJKHQuc3RybSlcXFxcbiAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgZnVuY3Rpb24gVCh0LCBlKSB7XFxcXG4gICAgICAgICAgICAgICAgdC5wZW5kaW5nX2J1Zlt0LnBlbmRpbmcrK10gPSBlXFxcXG4gICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgIGZ1bmN0aW9uIEYodCwgZSkge1xcXFxuICAgICAgICAgICAgICAgIHQucGVuZGluZ19idWZbdC5wZW5kaW5nKytdID0gZSA+Pj4gOCAmIDI1NSwgdC5wZW5kaW5nX2J1Zlt0LnBlbmRpbmcrK10gPSAyNTUgJiBlXFxcXG4gICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgIGZ1bmN0aW9uIEwodCwgZSkge1xcXFxuICAgICAgICAgICAgICAgIHZhciBhLCBpLCBuID0gdC5tYXhfY2hhaW5fbGVuZ3RoLFxcXFxuICAgICAgICAgICAgICAgICAgICByID0gdC5zdHJzdGFydCxcXFxcbiAgICAgICAgICAgICAgICAgICAgcyA9IHQucHJldl9sZW5ndGgsXFxcXG4gICAgICAgICAgICAgICAgICAgIG8gPSB0Lm5pY2VfbWF0Y2gsXFxcXG4gICAgICAgICAgICAgICAgICAgIGwgPSB0LnN0cnN0YXJ0ID4gdC53X3NpemUgLSBCID8gdC5zdHJzdGFydCAtICh0Lndfc2l6ZSAtIEIpIDogMCxcXFxcbiAgICAgICAgICAgICAgICAgICAgaCA9IHQud2luZG93LFxcXFxuICAgICAgICAgICAgICAgICAgICBkID0gdC53X21hc2ssXFxcXG4gICAgICAgICAgICAgICAgICAgIGYgPSB0LnByZXYsXFxcXG4gICAgICAgICAgICAgICAgICAgIF8gPSB0LnN0cnN0YXJ0ICsgeixcXFxcbiAgICAgICAgICAgICAgICAgICAgdSA9IGhbciArIHMgLSAxXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgYyA9IGhbciArIHNdO1xcXFxuICAgICAgICAgICAgICAgIHQucHJldl9sZW5ndGggPj0gdC5nb29kX21hdGNoICYmIChuID4+PSAyKSwgbyA+IHQubG9va2FoZWFkICYmIChvID0gdC5sb29rYWhlYWQpO1xcXFxuICAgICAgICAgICAgICAgIGRvIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGhbKGEgPSBlKSArIHNdID09PSBjICYmIGhbYSArIHMgLSAxXSA9PT0gdSAmJiBoW2FdID09PSBoW3JdICYmIGhbKythXSA9PT0gaFtyICsgMV0pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHIgKz0gMiwgYSsrO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZG8ge30gd2hpbGUgKGhbKytyXSA9PT0gaFsrK2FdICYmIGhbKytyXSA9PT0gaFsrK2FdICYmIGhbKytyXSA9PT0gaFsrK2FdICYmIGhbKytyXSA9PT0gaFsrK2FdICYmIGhbKytyXSA9PT0gaFsrK2FdICYmIGhbKytyXSA9PT0gaFsrK2FdICYmIGhbKytyXSA9PT0gaFsrK2FdICYmIGhbKytyXSA9PT0gaFsrK2FdICYmIHIgPCBfKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID0geiAtIChfIC0gciksIHIgPSBfIC0geiwgcyA8IGkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodC5tYXRjaF9zdGFydCA9IGUsIG8gPD0gKHMgPSBpKSkgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGhbciArIHMgLSAxXSwgYyA9IGhbciArIHNdXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9IHdoaWxlICgoZSA9IGZbZSAmIGRdKSA+IGwgJiYgMCAhPSAtLW4pO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBzIDw9IHQubG9va2FoZWFkID8gcyA6IHQubG9va2FoZWFkXFxcXG4gICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgIGZ1bmN0aW9uIEgodCkge1xcXFxuICAgICAgICAgICAgICAgIHZhciBlLCBhLCBpLCBuLCByLCBzLCBvLCBsLCBoLCBkLCBmID0gdC53X3NpemU7XFxcXG4gICAgICAgICAgICAgICAgZG8ge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAobiA9IHQud2luZG93X3NpemUgLSB0Lmxvb2thaGVhZCAtIHQuc3Ryc3RhcnQsIHQuc3Ryc3RhcnQgPj0gZiArIChmIC0gQikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoXy5hcnJheVNldCh0LndpbmRvdywgdC53aW5kb3csIGYsIGYsIDApLCB0Lm1hdGNoX3N0YXJ0IC09IGYsIHQuc3Ryc3RhcnQgLT0gZiwgdC5ibG9ja19zdGFydCAtPSBmLCBlID0gYSA9IHQuaGFzaF9zaXplOyBpID0gdC5oZWFkWy0tZV0sIHQuaGVhZFtlXSA9IGYgPD0gaSA/IGkgLSBmIDogMCwgLS1hOyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGUgPSBhID0gZjsgaSA9IHQucHJldlstLWVdLCB0LnByZXZbZV0gPSBmIDw9IGkgPyBpIC0gZiA6IDAsIC0tYTspO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbiArPSBmXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IHQuc3RybS5hdmFpbF9pbikgYnJlYWs7XFxcXG4gICAgICAgICAg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iAoYSA9IHQucGVuZGluZ19idWZfc2l6ZSAtIDUpOzspIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHQubG9va2FoZWFkIDw9IDEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChIKHQpLCAwID09PSB0Lmxvb2thaGVhZCAmJiBlID09PSBkKSByZXR1cm4gQTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSB0Lmxvb2thaGVhZCkgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB0LnN0cnN0YXJ0ICs9IHQubG9va2FoZWFkLCB0Lmxvb2thaGVhZCA9IDA7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBpID0gdC5ibG9ja19zdGFydCArIGE7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICgoMCA9PT0gdC5zdHJzdGFydCB8fCB0LnN0cnN0YXJ0ID49IGkpICYmICh0Lmxvb2thaGVhZCA9IHQuc3Ryc3RhcnQgLSBpLCB0LnN0cnN0YXJ0ID0gaSwgVSh0LCAhMSksIDAgPT09IHQuc3RybS5hdmFpbF9vdXQpKSByZXR1cm4gQTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHQuc3Ryc3RhcnQgLSB0LmJsb2NrX3N0YXJ0ID49IHQud19zaXplIC0gQiAmJiAoVSh0LCAhMSksIDAgPT09IHQuc3RybS5hdmFpbF9vdXQpKSByZXR1cm4gQVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gdC5pbnNlcnQgPSAwLCBlID09PSBmID8gKFUodCwgITApLCAwID09PSB0LnN0cm0uYXZhaWxfb3V0ID8gUiA6IEMpIDogKHQuc3Ryc3RhcnQgPiB0LmJsb2NrX3N0YXJ0ICYmIChVKHQsICExKSwgdC5zdHJtLmF2YWlsX291dCksIEEpXFxcXG4gICAgICAgICAgICB9KSwgbmV3IE0o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CBpLnBlbmRpbmcgIT09IGkucGVuZGluZ19idWZfc2l6ZSkpOykgVChpLCAyNTUgJiBpLmd6aGVhZC5leHRyYVtpLmd6aW5kZXhdKSwgaS5nemluZGV4Kys7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpLmd6aGVhZC5oY3JjICYmIGkucGVuZGluZyA+IG4gJiYgKHQuYWRsZXIgPSBjKHQuYWRsZXIsIGkucGVuZGluZ19idWYsIGkucGVuZGluZyAtIG4sIG4pKSwgaS5nemluZGV4ID09PSBpLmd6aGVhZC5leHRyYS5sZW5ndGggJiYgKGkuZ3ppbmRleCA9IDAsIGkuc3RhdHVzID0gNzMpXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpLnN0YXR1cyA9IDczO1xcXFxuICAgICAgICAgICAgICAgIGlmICg3MyA9PT0gaS5zdGF0dXMpXFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpLmd6aGVhZC5uYW1lKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBuID0gaS5wZW5kaW5nO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpLnBlbmRpbmcgPT09IGkucGVuZGluZ19idWZfc2l6ZSAmJiAoaS5nemhlYWQuaGNyYyAmJiBpLnBlbmRpbmcgPiBuICYmICh0LmFkbGVyID0gYyh0LmFkbGVyLCBpLnBlbmRpbmdfYnVmLCBpLnBlbmRpbmcgLSBuLCBuKSksIEkodCksIG4gPSBpLnBlbmRpbmcsIGkucGVuZGluZyA9PT0gaS5wZW5kaW5nX2J1Zl9zaXplKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gMTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgVChpLCByID0gaS5nemluZGV4IDwgaS5nemhlYWQubmFtZS5sZW5ndGggPyAyNTUgJiBpLmd6aGVhZC5uYW1lLmNoYXJDb2RlQXQoaS5nemluZGV4KyspIDogMClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDAgIT09IHIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaS5nemhlYWQuaGNyYyAmJiBpLnBlbmRpbmcgPiBuICYmICh0LmFkbGVyID0gYyh0LmFkbGVyLCBpLnBlbmRpbmdfYnVmLCBpLnBlbmRpbmcgLSBuLCBuKSksIDAgPT09IHIgJiYgKGkuZ3ppbmRleCA9IDAsIGkuc3RhdHVzID0gOTEpXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpLnN0YXR1cyA9IDkxO1xcXFxuICAgICAgICAgICAgICAgIGlmICg5MSA9PT0gaS5zdGF0dXMpXFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpLmd6aGVhZC5jb21tZW50KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBuID0gaS5wZW5kaW5nO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpLnBlbmRpbmcgPT09IGkucGVuZGluZ19idWZfc2l6ZSAmJiAoaS5nemhlYWQuaGNyYyAmJiBpLnBlbmRpbmcgPiBuICYmICh0LmFkbGVyID0gYyh0LmFkbGVyLCBpLnBlbmRpbmdfYnVmLCBpLnBlbmRpbmcgLSBuLCBuKSksIEkodCksIG4gPSBpLnBlbmRpbmcsIGkucGVuZGluZyA9PT0gaS5wZW5kaW5nX2J1Zl9zaXplKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gMTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICA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X2luKSByZXR1cm4gTih0LCAtNSk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKDAgIT09IHQuYXZhaWxfaW4gfHwgMCAhPT0gaS5sb29rYWhlYWQgfHwgZSAhPT0gZCAmJiA2NjYgIT09IGkuc3RhdHVzKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBvID0gMiA9PT0gaS5zdHJhdGVneSA/IGZ1bmN0aW9uKHQsIGUpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGE7Oykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSB0Lmxvb2thaGVhZCAmJiAoSCh0KSwgMCA9PT0gdC5sb29rYWhlYWQpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlID09PSBkKSByZXR1cm4gQTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHQubWF0Y2hfbGVuZ3RoID0gMCwgYSA9IGguX3RyX3RhbGx5KHQsIDAsIHQud2luZG93W3Quc3Ryc3RhcnRdKSwgdC5sb29rYWhlYWQtLSwgdC5zdHJzdGFydCsrLCBhICYmIChVKHQsICExKSwgMCA9PT0gdC5zdHJtLmF2YWlsX291dCkpIHJldHVybiBBXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdC5pbnNlcnQgPSAwLCBlID09PSBmID8gKFUodCwgITApLCAwID09PSB0LnN0cm0uYXZhaWxfb3V0ID8gUiA6IEMpIDogdC5sYXN0X2xpdCAmJiAoVSh0LCAhMSksIDAgPT09IHQuc3RybS5hdmFpbF9vdXQpID8gQSA6IFpcXFxcbiAgICAgICAgICAgICAgICAgICAgfShpLCBlKSA6IDMgPT09IGkuc3RyYXRlZ3kgPyBmdW5jdGlvbih0LCBlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBhLCBpLCBuLCByLCBzID0gdC53aW5kb3c7Oykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0Lmxvb2thaGVhZCA8PSB6KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChIKHQpLCB0Lmxvb2thaGVhZCA8PSB6ICYmIGUgPT09IGQpIHJldHVybiBBO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gdC5sb29rYWhlYWQpIGJyZWFrXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0Lm1hdGNoX2xlbmd0aCA9IDAsIHQubG9va2FoZWFkID49IHggJiYgMCA8IHQuc3Ryc3RhcnQgJiYgKGkgPSBzW24gPSB0LnN0cnN0YXJ0IC0gMV0pID09PSBzWysrbl0gJiYgaSA9PT0gc1srK25dICYmIGkgPT09IHNbKytuXSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gdC5zdHJzdGFydCArIHo7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHt9IHdoaWxlIChpID09PSBzWysrbl0gJiYgaSA9PT0gc1srK25dICYmIGkgPT09IHNbKytuXSAmJiBpID09PSBzWysrbl0gJiYgaSA9PT0gc1srK25dICYmIGkgPT09IHNbKytuXSAmJiBpID09PSBzWysrbl0gJiYgaSA9PT0gc1srK25dICYmIG4gPCByKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tYXRjaF9sZW5ndGggPSB6IC0gKHIgLSBuKSwgdC5tYXRjaF9sZW5ndGggPiB0Lmxvb2thaGVhZCAmJiAodC5tYXRjaF9sZW5ndGggPSB0Lmxvb2thaGVhZClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHQubWF0Y2hfbGVuZ3RoID49IHggPyAoYSA9IGguX3RyX3RhbGx5KHQsIDEsIHQubWF0Y2hfbGVuZ3RoIC0geCksIHQubG9va2FoZWFkIC09IHQubWF0Y2hfbGVuZ3RoLCB0LnN0cnN0YXJ0ICs9IHQubWF0Y2hfbGVuZ3RoLCB0Lm1hdGNoX2xlbmd0aCA9IDApIDogKGEgPSBoLl90cl90YWxseSh0LCAwLCB0LndpbmRvd1t0LnN0cnN0YXJ0XSksIHQubG9va2FoZWFkLS0sIHQuc3Ryc3RhcnQrKyksIGEgJiYgKFUodCwgITEpLCAwID09PSB0LnN0cm0uYXZhaWxfb3V0KSkgcmV0dXJuIEFcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0Lmluc2VydCA9IDAsIGUgPT09IGYgPyAoVSh0LCAhMCksIDAgPT09IHQuc3RybS5hdmFpbF9vdXQgPyBSIDogQykgOiB0Lmxhc3RfbGl0ICYmIChVKHQsICExKSwgMCA9PT0gdC5zdHJtLmF2YWlsX291dCkgPyBBIDogWlxcXFxuICAgICAgICAgICAgICAgICAgICB9KGksIGUpIDogbFtpLmxldmVsXS5mdW5jKGksIGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAobyAhPT0gUiAmJiBvICE9PSBDIHx8IChpLnN0YXR1cyA9IDY2NiksIG8gPT09IEEgfHwgbyA9PT0gUikgcmV0dXJuIDAgPT09IHQuYXZhaWxfb3V0ICYmIChpLmxhc3RfZmx1c2ggPSAtMSksIGI7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChvID09PSBaICYmICgxID09PSBlID8gaC5fdHJfYWxpZ24oaSkgOiA1ICE9PSBlICYmIChoLl90cl9zdG9yZWRfYmxvY2soaSwgMCwgMCwgITEpLCAzID09PSBlICYmIChEKG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sZW5iaXRzKSAtIDEsIHcgPSAoMSA8PCBhLmRpc3RiaXRzKSAtIDE7XFxcXG4gICAgICAgICAgICAgICAgdDogZG8ge1xcXFxuICAgICAgICAgICAgICAgICAgICBjIDwgMTUgJiYgKHUgKz0gQltpKytdIDw8IGMsIGMgKz0gOCwgdSArPSBCW2krK10gPDwgYywgYyArPSA4KSwgcCA9IGJbdSAmIG1dO1xcXFxuICAgICAgICAgICAgICAgICAgICBlOiBmb3IgKDs7KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodSA+Pj49IHYgPSBwID4+PiAyNCwgYyAtPSB2LCAwID09PSAodiA9IHAgPj4+IDE2ICYgMjU1KSkgU1tyKytdID0gNjU1MzUgJiBwO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEoMTYgJiB2KSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PSAoNjQgJiB2KSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IGJbKDY1NTM1ICYgcCkgKyAodSAmICgxIDw8IHYpIC0gMSldO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWUgZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgzMiAmIHYpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEubW9kZSA9IDEyO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgdFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcXFxcXCJpbnZhbGlkIGxpdGVyYWwvbGVuZ3RoIGNvZGVcXFxcXFxcIiwgYS5tb2RlID0gMzA7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIHRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgayA9IDY1NTM1ICYgcCwgKHYgJj0gMTUpICYmIChjIDwgdiAmJiAodSArPSBCW2krK10gPDwgYywgYyArPSA4KSwgayArPSB1ICYgKDEgPDwgdikgLSAxLCB1ID4+Pj0gdiwgYyAtPSB2KSwgYyA8IDE1ICYmICh1ICs9IEJbaSsrXSA8PCBjLCBjICs9IDgsIHUgKz0gQltpKytdIDw8IGMsIGMgKz0gOCksIHAgPSBnW3UgJiB3XTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhOiBmb3IgKDs7KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1ID4+Pj0gdiA9IHAgPj4+IDI0LCBjIC09IHYsICEoMTYgJiAodiA9IHAgPj4+IDE2ICYgMjU1KSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09ICg2NCAmIHYpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IGdbKDY1NTM1ICYgcCkgKyAodSAmICgxIDw8IHYpIC0gMSldO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIGFcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcXFxcXCJpbnZhbGlkIGRpc3RhbmNlIGNvZGVcXFxcXFxcIiwgYS5tb2RlID0gMzA7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayB0XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHkgPSA2NTUzNSAmIHAsIGMgPCAodiAmPSAxNSkgJiYgKHUgKz0gQltpKytdIDw8IGMsIChjICs9IDgpIDwgdiAmJiAodSArPSBCW2krK10gPDwgYywgYyArPSA4KSksIGwgPCAoeSArPSB1ICYgKDEgPDwgdikgLSAxKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFxcXFxcImludmFsaWQgZGlzdGFuY2UgdG9vIGZhciBiYWNrXFxcXFxcXCIsIGEubW9kZSA9IDMwO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgdFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1ID4+Pj0gdiwgYyAtPSB2LCAodiA9IHIgLSBzKSA8IHkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkIDwgKHYgPSB5IC0gdikgJiYgYS5zYW5lKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFxcXFxcImludmFsaWQgZGlzdGFuY2UgdG9vIGZhciBiYWNrXFxcXFxcXCIsIGEubW9kZSA9IDMwO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIHRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh6ID0gXywgKHggPSAwKSA9PT0gZikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh4ICs9IGggLSB2LCB2IDwgaykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGsgLT0gdjsgU1tyKytdID0gX1t4KytdLCAtLXY7KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCA9IHIgLSB5LCB6ID0gU1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZiA8IHYpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoeCArPSBoICsgZiAtIHYsICh2IC09IGYpIDwgaykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGsgLT0gdjsgU1tyKytdID0gX1t4KytdLCAtLXY7KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHggPSAwLCBmIDwgaykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChrIC09IHYgPSBmOyBTW3IrK10gPSBfW3grK10sIC0tdjspO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCA9IHIgLSB5LCB6ID0gU1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh4ICs9IGYgLSB2LCB2IDwgaykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoayAtPSB2OyBTW3IrK10gPSBfW3grK10sIC0tdjspO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggPSByIC0geSwgeiA9IFNcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyAyIDwgazspIFNbcisrXSA9IHpbeCsrXSwgU1tyKytdID0gelt4KytdLCBTW3IrK10gPSB6W3grK10sIGsgLT0gMztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgJiYgKFNbcisrXSA9IHpbeCsrXSwgMSA8IGsgJiYgKFNbcisrXSA9IHpbeCsrXSkpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHggPSByIC0geTsgU1tyKytdID0gU1t4KytdLCBTW3IrK10gPSBTW3grK10sIFNbcisrXSA9IFNbeCsrXSwgMiA8IChrIC09IDMpOyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrICYmIChTW3IrK10gPSBTW3grK10sIDEgPCBrICYmIChTW3IrK10gPSBTW3grK10pKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKGkgPCBuICYmIHIgPCBvKTtcXFxcbiAgICAgICAgICAgICAgICBpIC09IGsgPSBjID4+IDMsIHUgJj0gKDEgPDwgKGMgLT0gayA8PCAzKSkgLSAxLCB0Lm5leHRfaW4gPSBpLCB0Lm5leHRfb3V0ID0gciwgdC5hdmFpbF9pbiA9IGkgPCBuID8gbiAtIGkgKyA1IDogNSAtIChpIC0gbiksIHQuYXZhaWxfb3V0ID0gciA8IG8gPyBvIC0gciArIDI1NyA6IDI1NyAtIChyIC0gbyksIGEuaG9sZCA9IHUsIGEuYml0cyA9IGNcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSwge31dLFxcXFxuICAgICAgICAxMTogW2Z1bmN0aW9uKHQsIGUsIGEpIHtcXFxcbiAgICAgICAgICAgIFxcXFxcXFwidXNlIHN0cmljdFxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgdmFyIFogPSB0KFxcXFxcXFwiLi4vdXRpbHMvY29tbW9uXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgIFIgPSB0KFxcXFxcXFwiLi9hZGxlcjMyXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgIEMgPSB0KFxcXFxcXFwiLi9jcmMzMlxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICBOID0gdChcXFxcXFxcIi4vaW5mZmFzdFxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICBPID0gdChcXFxcXFxcIi4vaW5mdHJlZXNcXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgRCA9IDEsXFxcXG4gICAgICAgICAgICAgICAgSSA9IDIsXFxcXG4gICAgICAgICAgICAgICAgVSA9IDAsXFxcXG4gICAgICAgICAgICAgICAgVCA9IC0yLFxcXFxuICAgICAgICAgICAgICAgIEYgPSAxLFxcXFxuICAgICAgICAgICAgICAgIGkgPSA4NTIsXFxcXG4gICAgICAgICAgICAgICAgbiA9IDU5MjtcXFxcblxcXFxuICAgICAgICAgICAgZnVuY3Rpb24gTCh0KSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICh0ID4+PiAyNCAmIDI1NSkgKyAodCA+Pj4gOCAmIDY1MjgwKSArICgoNjUyODAgJiB0KSA8PCA4KSArICgoMjU1ICYgdCkgPDwgMjQpXFxcXG4gICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgIGZ1bmN0aW9uIH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5jdGlvbiBoKHQsIGUpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgYSwgaTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gdCA/IChpID0gbmV3IHIsICh0LnN0YXRlID0gaSkud2luZG93ID0gbnVsbCwgKGEgPSBsKHQsIGUpKSAhPT0gVSAmJiAodC5zdGF0ZSA9IG51bGwpLCBhKSA6IFRcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHZhciBkLCBmLCBfID0gITA7XFxcXG5cXFxcbiAgICAgICAgICAgIGZ1bmN0aW9uIEgodCkge1xcXFxuICAgICAgICAgICAgICAgIGlmIChfKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBlO1xcXFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGQgPSBuZXcgWi5CdWYzMig1MTIpLCBmID0gbmV3IFouQnVmMzIoMzIpLCBlID0gMDsgZSA8IDE0NDspIHQubGVuc1tlKytdID0gODtcXFxcbiAgICAgICAgICAgICAgICAgICAgZm9yICg7IGUgPCAyNTY7KSB0LmxlbnNbZSsrXSA9IDk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoOyBlIDwgMjgwOykgdC5sZW5zW2UrK10gPSA3O1xcXFxuICAgICAgICAgICAgICAgICAgICBmb3IgKDsgZSA8IDI4ODspIHQubGVuc1tlKytdID0gODtcXFxcbiAgICAgICAgICAgICAgICAgICAgZm9yIChPKEQsIHQubGVucywgMCwgMjg4LCBkLCAwLCB0LndvcmssIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaXRzOiA5XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSwgZSA9IDA7IGUgPCAzMjspIHQubGVuc1tlKytdID0gNTtcXFxcbiAgICAgICAgICAgICAgICAgICAgTyhJLCB0LmxlbnMsIDAsIDMyLCBmLCAwLCB0LndvcmssIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJpdHM6IDVcXFxcbiAgICAgICAgICAgICAgICAgICAgfSksIF8gPSAhMVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB0LmxlbmNvZGUgPSBkLCB0LmxlbmJpdHMgPSA5LCB0LmRpc3Rjb2RlID0gZiwgdC5kaXN0Yml0cyA9IDVcXFxcbiAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgZnVuY3Rpb24gaih0LCBlLCBhLCBpKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIG4sIHIgPSB0LnN0YXRlO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsID09PSByLndpbmRvdyAmJiAoci53c2l6ZSA9IDEgPDwgci53Yml0cywgci53bmV4dCA9IDAsIHIud2hhdmUgPSAwLCByLndpbmRvdyA9IG5ldyBaLkJ1Zjgoci53c2l6ZSkpLCBpID49IHIud3NpemUgPyAoWi5hcnJheVNldChyLndpbmRvdywgZSwgYSAtIHIud3NpemUsIHIud3NpemUsIDApLCByLnduZXh0ID0gMCwgci53aGF2ZSA9IHIud3NpemUpIDogKGkgPCAobiA9IHIud3NpemUgLSByLnduZXh0KSAmJiAobiA9IGkpLCBaLmFycmF5U2V0KHIud2luZG93LCBlLCBhIC0gaSwgbiwgci53bmV4dCksIChpIC09IG4pID8gKFouYXJyYXlTZXQoci53aW5kb3csIGUsIGEgLSBpLCBpLCAwKSwgci53bmV4dCA9IGksIHIud2hhdmUgPSByLndzaXplKSA6IChyLnduZXh0ICs9IG4sIHIud25leHQgPT09IHIud3NpemUgJiYgKHIud25leHQgPSAwKSwgci53aGF2ZSA8IHIud3NpemUgJiYgKHIud2hhdmUgKz0gbikpKSwgMFxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgYS5pbmZsYXRlUmVzZXQgPSBvLCBhLmluZmxhdGVSZXNldDIgPSBsLCBhLmluZmxhdGVSZXNldEtlZXAgPSBzLCBhLmluZmxhdGVJbml0ID0gZnVuY3Rpb24odCkge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBoKHQsIDE1KVxcXFxuICAgICAgICAgICAgfSwgYS5pbmZsYXRlSW5pdDIgPSBoLCBhLmluZmxhdGUgPSBmdW5jdGlvbih0LCBlKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIGEsIGksIG4sIHIsIHMsIG8sIGwsIGgsIGQsIGYsIF8sIHUsIGMsIGIsIGcsIG0sIHcsIHAsIHYsIGssIHksIHgsIHosIEIsIFMgPSAwLFxcXFxuICAgICAgICAgICAgICAgICAgICBFID0gbmV3IFouQnVmOCg0KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgQSA9IFsxNiwgMTcsIDE4LCAwLCA4LCA3LCA5LCA2LCAxMCwgNSwgMTEsIDQsIDEyLCAzLCAxMywgMiwgMTQsIDEsIDE1XTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoIXQgfHwgIXQuc3RhdGUgfHwgIXQub3V0cHV0IHx8ICF0LmlucHV0ICYmIDAgIT09IHQuYXZhaWxfaW4pIHJldHVybiBUO1xcXFxuICAgICAgICAgICAgICAgIDEyID09PSAoYSA9IHQuc3RhdGUpLm1vZGUgJiYgKGEubW9kZSA9IDEzKSwgcyA9IHQubmV4dF9vdXQsIG4gPSB0Lm91dHB1dCwgbCA9IHQuYXZhaWxfb3V0LCByID0gdC5uZXh0X2luLCBpID0gdC5pbnB1dCwgbyA9IHQuYXZhaWxfaW4sIGggPSBhLmhvbGQsIGQgPSBhLmJpdHMsIGYgPSBvLCBfID0gbCwgeCA9IFU7XFxcXG4gICAgICAgICAgICAgICAgdDogZm9yICg7Oykgc3dpdGNoIChhLm1vZGUpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSBGOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IGEud3JhcCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEubW9kZSA9IDEzO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgZCA8IDE2Oykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoMiAmIGEud3JhcCAmJiAzNTYxNSA9PT0gaCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVbYS5jaGVjayA9IDBdID0gMjU1ICYgaCwgRVsxXSA9IGggPj4+IDggJiAyNTUsIGEuY2hlY2sgPSBDKGEuY2hlY2ssIEUsIDIsIDApLCBkID0gaCA9IDAsIGEubW9kZSA9IDI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhLmZsYWdzID0gMCwgYS5oZWFkICYmIChhLmhlYWQuZG9uZSA9ICExKSwgISgxICYgYS53cmFwKSB8fCAoKCgyNTUgJiBoKSA8PCA4KSArIChoID4+IDgpKSAlIDMxKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFxcXFxcImluY29ycmVjdCBoZWFkZXIgY2hlY2tcXFxcXFxcIiwgYS5tb2RlID0gMzA7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICg4ICE9ICgxNSAmIGgpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFxcXFxcInVua25vd24gY29tcHJlc3Npb24gbWV0aG9kXFxcXFxcXCIsIGEubW9kZSA9IDMwO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZCAtPSA0LCB5ID0gOCArICgxNSAmIChoID4+Pj0gNCkpLCAwID09PSBhLndiaXRzKSBhLndiaXRzID0geTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHkgPiBhLndiaXRzKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFxcXFxcImludmFsaWQgd2luZG93IHNpemVcXFxcXFxcIiwgYS5tb2RlID0gMzA7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGEuZG1heCA9IDEgPDwgeSwgdC5hZGxlciA9IGEuY2hlY2sgPSAxLCBhLm1vZGUgPSA1MTIgJiBoID8gMTAgOiAxMiwgZCA9IGggPSAwO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBkIDwgMTY7KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgby0tLCBoICs9IGlbcisrXSA8PCBkLCBkICs9IDhcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhLmZsYWdzID0gaCwgOCAhPSAoMjU1ICYgYS5mbGFncykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXFxcXFwidW5rbm93biBjb21wcmVzc2lvbiBtZXRob2RcXFxcXFxcIiwgYS5tb2RlID0gMzA7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICg1NzM0NCAmIGEuZmxhZ3MpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXFxcXFwidW5rbm93biBoZWFkZXIgZmxhZ3Mgc2V0XFxcXFxcXCIsIGEubW9kZSA9IDMwO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBhLmhlYWQgJiYgKGEuaGVhZC50ZXh0ID0gaCA+PiA4ICYgMSksIDUxMiAmIGEuZmxhZ3MgJiYgKEVbMF0gPSAyNTUgJiBoLCBFWzFdID0gaCA+Pj4gOCAmIDI1NSwgYS5jaGVjayA9IEMoYS5jaGVjaywgRSwgMiwgMCkpLCBkID0gaCA9IDAsIGEubW9kZSA9IDM7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBkIDwgMzI7KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgby0tLCBoICs9IGlbcisrXSA8PCBkLCBkICs9IDhcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGEuaGVhZCAmJiAoYS5oZWFkLnRpbWUgPSBoKSwgNTEyICYgYS5mbGFncyAmJiAoRVswXSA9IDI1NSAmIGgsIEVbMV0gPSBoID4+PiA4ICYgMjU1LCBFWzJdID0gaCA+Pj4gMTYgJiAyNTUsIEVbM10gPSBoID4+PiAyNCAmIDI1NSwgYS5jaGVjayA9IEMoYS5jaGVjaywgRSwgNCwgMCkpLCBkID0gaCA9IDAsIGEubW9kZSA9IDQ7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNDpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBkIDwgMTY7KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgby0tLCBoICs9IGlbcisrXSA8PCBkLCBkICs9IDhcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGEuaGVhZCAmJiAoYS5oZWFkLnhmbGFncyA9IDI1NSAmIGgsIGEuaGVhZC5vcyA9IGggPj4gOCksIDUxMiAmIGEuZmxhZ3MgJiYgKEVbMF0gPSAyNTUgJiBoLCBFWzFdID0gaCA+Pj4gOCAmIDI1NSwgYS5jaGVjayA9IEMoYS5jaGVjaywgRSwgMiwgMCkpLCBkID0gaCA9IDAsIGEubW9kZSA9IDU7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNTpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgxMDI0ICYgYS5mbGFncykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBkIDwgMTY7KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhLmxlbmd0aCA9IGgsIGEuaGVhZCAmJiAoYS5oZWFkLmV4dHJhX2xlbiA9IGgpLCA1MTIgJiBhLmZsYWdzICYmIChFWzBdID0gMjU1ICYgaCwgRVsxXSA9IGggPj4+IDggJiAyNTUsIGEuY2hlY2sgPSBDKGEuY2hlY2ssIEUsIDIsIDApKSwgZCA9IGggPSAwXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgYS5oZWFkICYmIChhLmhlYWQuZXh0cmEgPSBudWxsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGEubW9kZSA9IDY7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgxMDI0ICYgYS5mbGFncyAmJiAobyA8ICh1ID0gYS5sZW5ndGgpICYmICh1ID0gbyksIHUgJiYgKGEuaGVhZCAmJiAoeSA9IGEuaGVhZC5leHRyYV9sZW4gLSBhLmxlbmd0aCwgYS5oZWFkLmV4dHJhIHx8IChhLmhlYWQuZXh0cmEgPSBuZXcgQXJyYXkoYS5oZWFkLmV4dHJhX2xlbikpLCBaLmFycmF5U2V0KGEuaGVhZC5leHRyYSwgaSwgciwgdSwgeSkpLCA1MTIgJiBhLmZsYWdzICYmIChhLmNoZWNrID0gQyhhLmNoZWNrLCBpLCB1LCByKSksIG8gLT0gdSwgciArPSB1LCBhLmxlbmd0aCAtPSB1KSwgYS5sZW5ndGgpKSBicmVhayB0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYS5sZW5ndGggPSAwLCBhLm1vZGUgPSA3O1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDc6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoMjA0OCAmIGEuZmxhZ3MpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHUgPSAwOyB5ID0gaVtyICsgdSsrXSwgYS5oZWFkICYmIHkgJiYgYS5sZW5ndGggPCA2NTUzNiAmJiAoYS5oZWFkLm5hbWUgKz0gU3RyaW5nLmZyb21DaGFyQ29kZSh5KSksIHkgJiYgdSA8IG87KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoNTEyICYgYS5mbGFncyAmJiAoYS5jaGVjayA9IEMoYS5jaGVjaywgaSwgdSwgcikpLCBvIC09IHUsIHIgKz0gdSwgeSkgYnJlYWsgdFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGEuaGVhZCAmJiAoYS5oZWFkLm5hbWUgPSBudWxsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGEubGVuZ3RoID0gMCwgYS5tb2RlID0gODtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA4OlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDQwOTYgJiBhLmZsYWdzKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh1ID0gMDsgeSA9IGlbciArIHUrK10sIGEuaGVhZCAmJiB5ICYmIGEubGVuZ3RoIDwgNjU1MzYgJiYgKGEuaGVhZC5jb21tZW50ICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoeSkpLCB5ICYmIHUgPCBvOyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDUxMiAmIGEuZmxhZ3MgJiYgKGEuY2hlY2sgPSBDKGEuY2hlY2ssIGksIHUsIHIpKSwgbyAtPSB1LCByICs9IHUsIHkpIGJyZWFrIHRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBhLmhlYWQgJiYgKGEuaGVhZC5jb21tZW50ID0gbnVsbCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBhLm1vZGUgPSA5O1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDk6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoNTEyICYgYS5mbGFncykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBkIDwgMTY7KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaCAhPT0gKDY1NTM1ICYgYS5jaGVjaykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFxcXFxcImhlYWRlciBjcmMgbWlzbWF0Y2hcXFxcXFxcIiwgYS5tb2RlID0gMzA7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSBoID0gMFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYS5oZWFkICYmIChhLmhlYWQuaGNyYyA9IGEuZmxhZ3MgPj4gOSAmIDEsIGEuaGVhZC5kb25lID0gITApLCB0LmFkbGVyID0gYS5jaGVjayA9IDAsIGEubW9kZSA9IDEyO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTA6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgZCA8IDMyOykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0LmFkbGVyID0gYS5jaGVjayA9IEwoaCksIGQgPSBoID0gMCwgYS5tb2RlID0gMTE7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTE6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gYS5oYXZlZGljdCkgcmV0dXJuIHQubmV4dF9vdXQgPSBzLCB0LmF2YWlsX291dCA9IGwsIHQubmV4dF9pbiA9IHIsIHQuYXZhaWxfaW4gPSBvLCBhLmhvbGQgPSBoLCBhLmJpdHMgPSBkLCAyO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdC5hZGxlciA9IGEuY2hlY2sgPSAxLCBhLm1vZGUgPSAxMjtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxMjpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICg1ID09PSBlIHx8IDYgPT09IGUpIGJyZWFrIHQ7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTM6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5sYXN0KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA+Pj49IDcgJiBkLCBkIC09IDcgJiBkLCBhLm1vZGUgPSAyNztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICg7IGQgPCAzOykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGEubGFzdCA9IDEgJiBoLCBkIC09IDEsIDMgJiAoaCA+Pj49IDEpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhLm1vZGUgPSAxNDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoSChhKSwgYS5tb2RlID0gMjAsIDYgIT09IGUpIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoID4+Pj0gMiwgZCAtPSAyO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayB0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYS5tb2RlID0gMTc7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFxcXFxcImludmFsaWQgYmxvY2sgdHlwZVxcXFxcXFwiLCBhLm1vZGUgPSAzMFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaCA+Pj49IDIsIGQgLT0gMjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDE0OlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChoID4+Pj0gNyAmIGQsIGQgLT0gNyAmIGQ7IGQgPCAzMjspIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCg2NTUzNSAmIGgpICE9IChoID4+PiAxNiBeIDY1NTM1KSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcXFxcXCJpbnZhbGlkIHN0b3JlZCBibG9jayBsZW5ndGhzXFxcXFxcXCIsIGEubW9kZSA9IDMwO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5sZW5ndGggPSA2NTUzNSAmIGgsIGQgPSBoID0gMCwgYS5tb2RlID0gMTUsIDYgPT09IGUpIGJyZWFrIHQ7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTU6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBhLm1vZGUgPSAxNjtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxNjpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1ID0gYS5sZW5ndGgpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobyA8IHUgJiYgKHUgPSBvKSwgbCA8IHUgJiYgKHUgPSBsKSwgMCA9PT0gdSkgYnJlYWsgdDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBaLmFycmF5U2V0KG4sIGksIHIsIHUsIHMpLCBvIC09IHUsIHIgKz0gdSwgbCAtPSB1LCBzICs9IHUsIGEubGVuZ3RoIC09IHU7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGEubW9kZSA9IDEyO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTc6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgZCA8IDE0Oykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5ubGVuID0gMjU3ICsgKDMxICYgaCksIGggPj4+PSA1LCBkIC09IDUsIGEubmRpc3QgPSAxICsgKDMxICYgaCksIGggPj4+PSA1LCBkIC09IDUsIGEubmNvZGUgPSA0ICsgKDE1ICYgaCksIGggPj4+PSA0LCBkIC09IDQsIDI4NiA8IGEubmxlbiB8fCAzMCA8IGEubmRpc3QpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXFxcXFwidG9vIG1hbnkgbGVuZ3RoIG9yIGRpc3RhbmNlIHN5bWJvbHNcXFxcXFxcIiwgYS5tb2RlID0gMzA7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGEuaGF2ZSA9IDAsIGEubW9kZSA9IDE4O1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDE4OlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICg7IGEuaGF2ZSA8IGEubmNvZGU7KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICg7IGQgPCAzOykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgby0tLCBoICs9IGlbcisrXSA8PCBkLCBkICs9IDhcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYS5sZW5zW0FbYS5oYXZlKytdXSA9IDcgJiBoLCBoID4+Pj0gMywgZCAtPSAzXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgYS5oYXZlIDwgMTk7KSBhLmxlbnNbQVthLmhhdmUrK11dID0gMDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhLmxlbmNvZGUgPSBhLmxlbmR5biwgYS5sZW5iaXRzID0gNywgeiA9IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYml0czogYS5sZW5iaXRzXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgeCA9IE8oMCwgYS5sZW5zLCAwLCAxOSwgYS5sZW5jb2RlLCAwLCBhLndvcmssIHopLCBhLmxlbmJpdHMgPSB6LmJpdHMsIHgpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXFxcXFwiaW52YWxpZCBjb2RlIGxlbmd0aHMgc2V0XFxcXFxcXCIsIGEubW9kZSA9IDMwO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBhLmhhdmUgPSAwLCBhLm1vZGUgPSAxOTtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxOTpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBhLmhhdmUgPCBhLm5sZW4gKyBhLm5kaXN0Oykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBtID0gKFMgPSBhLmxlbmNvZGVbaCAmICgxIDw8IGEubGVuYml0cykgLSAxXSkgPj4+IDE2ICYgMjU1LCB3ID0gNjU1MzUgJiBTLCAhKChnID0gUyA+Pj4gMjQpIDw9IGQpOykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgby0tLCBoICs9IGlbcisrXSA8PCBkLCBkICs9IDhcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHcgPCAxNikgaCA+Pj49IGcsIGQgLT0gZywgYS5sZW5zW2EuaGF2ZSsrXSA9IHc7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgxNiA9PT0gdykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChCID0gZyArIDI7IGQgPCBCOykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaCA+Pj49IGcsIGQgLT0gZywgMCA9PT0gYS5oYXZlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFxcXFxcImludmFsaWQgYml0IGxlbmd0aCByZXBlYXRcXFxcXFxcIiwgYS5tb2RlID0gMzA7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHkgPSBhLmxlbnNbYS5oYXZlIC0gMV0sIHUgPSAzICsgKDMgJiBoKSwgaCA+Pj49IDIsIGQgLT0gMlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKDE3ID09PSB3KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKEIgPSBnICsgMzsgZCA8IEI7KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgby0tLCBoICs9IGlbcisrXSA8PCBkLCBkICs9IDhcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgLT0gZywgeSA9IDAsIHUgPSAzICsgKDcgJiAoaCA+Pj49IGcpKSwgaCA+Pj49IDMsIGQgLT0gM1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChCID0gZyArIDc7IGQgPCBCOykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkIC09IGcsIHkgPSAwLCB1ID0gMTEgKyAoMTI3ICYgKGggPj4+PSBnKSksIGggPj4+PSA3LCBkIC09IDdcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5oYXZlICsgdSA+IGEubmxlbiArIGEubmRpc3QpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcXFxcXCJpbnZhbGlkIGJpdCBsZW5ndGggcmVwZWF0XFxcXFxcXCIsIGEubW9kZSA9IDMwO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgdS0tOykgYS5sZW5zW2EuaGF2ZSsrXSA9IHlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoMzAgPT09IGEubW9kZSkgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gYS5sZW5zWzI1Nl0pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXFxcXFwiaW52YWxpZCBjb2RlIC0tIG1pc3NpbmcgZW5kLW9mLWJsb2NrXFxcXFxcXCIsIGEubW9kZSA9IDMwO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5sZW5iaXRzID0gOSwgeiA9IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYml0czogYS5sZW5iaXRzXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgeCA9IE8oRCwgYS5sZW5zLCAwLCBhLm5sZW4sIGEubGVuY29kZSwgMCwgYS53b3JrLCB6KSwgYS5sZW5iaXRzID0gei5iaXRzLCB4KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFxcXFxcImludmFsaWQgbGl0ZXJhbC9sZW5ndGhzIHNldFxcXFxcXFwiLCBhLm1vZGUgPSAzMDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGEuZGlzdGJpdHMgPSA2LCBhLmRpc3Rjb2RlID0gYS5kaXN0ZHluLCB6ID0ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaXRzOiBhLmRpc3RiaXRzXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgeCA9IE8oSSwgYS5sZW5zLCBhLm5sZW4sIGEubmRpc3QsIGEuZGlzdGNvZGUsIDAsIGEud29yaywgeiksIGEuZGlzdGJpdHMgPSB6LmJpdHMsIHgpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXFxcXFwiaW52YWxpZCBkaXN0YW5jZXMgc2V0XFxcXFxcXCIsIGEubW9kZSA9IDMwO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5tb2RlID0gMjAsIDYgPT09IGUpIGJyZWFrIHQ7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjA6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBhLm1vZGUgPSAyMTtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyMTpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICg2IDw9IG8gJiYgMjU4IDw9IGwpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm5leHRfb3V0ID0gcywgdC5hdmFpbF9vdXQgPSBsLCB0Lm5leHRfaW4gPSByLCB0LmF2YWlsX2luID0gbywgYS5ob2xkID0gaCwgYS5iaXRzID0gZCwgTih0LCBfKSwgcyA9IHQubmV4dF9vdXQsIG4gPSB0Lm91dHB1dCwgbCA9IHQuYXZhaWxfb3V0LCByID0gdC5uZXh0X2luLCBpID0gdC5pbnB1dCwgbyA9IHQuYXZhaWxfaW4sIGggPSBhLmhvbGQsIGQgPSBhLmJpdHMsIDEyID09PSBhLm1vZGUgJiYgKGEuYmFjayA9IC0xKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChhLmJhY2sgPSAwOyBtID0gKFMgPSBhLmxlbmNvZGVbaCAmICgxIDw8IGEubGVuYml0cykgLSAxXSkgPj4+IDE2ICYgMjU1LCB3ID0gNjU1MzUgJiBTLCAhKChnID0gUyA+Pj4gMjQpIDw9IGQpOykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobSAmJiAwID09ICgyNDAgJiBtKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAocCA9IGcsIHYgPSBtLCBrID0gdzsgbSA9IChTID0gYS5sZW5jb2RlW2sgKyAoKGggJiAoMSA8PCBwICsgdikgLSAxKSA+PiBwKV0pID4+PiAxNiAmIDI1NSwgdyA9IDY1NTM1ICYgUywgIShwICsgKGcgPSBTID4+PiAyNCkgPD0gZCk7KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoID4+Pj0gcCwgZCAtPSBwLCBhLmJhY2sgKz0gcFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGggPj4+PSBnLCBkIC09IGcsIGEuYmFjayArPSBnLCBhLmxlbmd0aCA9IHcsIDAgPT09IG0pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhLm1vZGUgPSAyNjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDMyICYgbSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEuYmFjayA9IC0xLCBhLm1vZGUgPSAxMjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDY0ICYgbSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcXFxcXCJpbnZhbGlkIGxpdGVyYWwvbGVuZ3RoIGNvZGVcXFxcXFxcIiwgYS5tb2RlID0gMzA7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGEuZXh0cmEgPSAxNSAmIG0sIGEubW9kZSA9IDIyO1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlIDIyOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGEuZXh0cmEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKEIgPSBhLmV4dHJhOyBkIDwgQjspIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8tLSwgaCArPSBpW3IrK10gPDwgZCwgZCArPSA4XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEubGVuZ3RoICs9IGggJiAoMSA8PCBhLmV4dHJhKSAtIDEsIGggPj4+PSBhLmV4dHJhLCBkIC09IGEuZXh0cmEsIGEuYmFjayArPSBhLmV4dHJhXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBhLndhcyA9IGEubGVuZ3RoLCBhLm1vZGUgPSAyMztcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyMzpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBtID0gKFMgPSBhLmRpc3Rjb2RlW2ggJiAoMSA8PCBhLmRpc3RiaXRzKSAtIDFdKSA+Pj4gMTYgJiAyNTUsIHcgPSA2NTUzNSAmIFMsICEoKGcgPSBTID4+PiAyNCkgPD0gZCk7KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT09IG8pIGJyZWFrIHQ7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgby0tLCBoICs9IGlbcisrXSA8PCBkLCBkICs9IDhcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09ICgyNDAgJiBtKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAocCA9IGcsIHYgPSBtLCBrID0gdzsgbSA9IChTID0gYS5kaXN0Y29kZVtrICsgKChoICYgKDEgPDwgcCArIHYpIC0gMSkgPj4gcCldKSA+Pj4gMTYgJiAyNTUsIHcgPSA2NTUzNSAmIFMsICEocCArIChnID0gUyA+Pj4gMjQpIDw9IGQpOykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgby0tLCBoICs9IGlbcisrXSA8PCBkLCBkICs9IDhcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA+Pj49IHAsIGQgLT0gcCwgYS5iYWNrICs9IHBcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoID4+Pj0gZywgZCAtPSBnLCBhLmJhY2sgKz0gZywgNjQgJiBtKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFxcXFxcImludmFsaWQgZGlzdGFuY2UgY29kZVxcXFxcXFwiLCBhLm1vZGUgPSAzMDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYS5vZmZzZXQgPSB3LCBhLmV4dHJhID0gMTUgJiBtLCBhLm1vZGUgPSAyNDtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyNDpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhLmV4dHJhKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChCID0gYS5leHRyYTsgZCA8IEI7KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhLm9mZnNldCArPSBoICYgKDEgPDwgYS5leHRyYSkgLSAxLCBoID4+Pj0gYS5leHRyYSwgZCAtPSBhLmV4dHJhLCBhLmJhY2sgKz0gYS5leHRyYVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGEub2Zmc2V0ID4gYS5kbWF4KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5tc2cgPSBcXFxcXFxcImludmFsaWQgZGlzdGFuY2UgdG9vIGZhciBiYWNrXFxcXFxcXCIsIGEubW9kZSA9IDMwO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBhLm1vZGUgPSAyNTtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyNTpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBsKSBicmVhayB0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHUgPSBfIC0gbCwgYS5vZmZzZXQgPiB1KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh1ID0gYS5vZmZzZXQgLSB1KSA+IGEud2hhdmUgJiYgYS5zYW5lKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcXFxcXCJpbnZhbGlkIGRpc3RhbmNlIHRvbyBmYXIgYmFja1xcXFxcXFwiLCBhLm1vZGUgPSAzMDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA+IGEud25leHQgPyAodSAtPSBhLnduZXh0LCBjID0gYS53c2l6ZSAtIHUpIDogYyA9IGEud25leHQgLSB1LCB1ID4gYS5sZW5ndGggJiYgKHUgPSBhLmxlbmd0aCksIGIgPSBhLndpbmRvd1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGIgPSBuLCBjID0gcyAtIGEub2Zmc2V0LCB1ID0gYS5sZW5ndGg7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGwgPCB1ICYmICh1ID0gbCksIGwgLT0gdSwgYS5sZW5ndGggLT0gdTsgbltzKytdID0gYltjKytdLCAtLXU7KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDAgPT09IGEubGVuZ3RoICYmIChhLm1vZGUgPSAyMSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyNjpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBsKSBicmVhayB0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbltzKytdID0gYS5sZW5ndGgsIGwtLSwgYS5tb2RlID0gMjE7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyNzpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhLndyYXApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgZCA8IDMyOykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PT0gbykgYnJlYWsgdDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgby0tLCBoIHw9IGlbcisrXSA8PCBkLCBkICs9IDhcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8gLT0gbCwgdC50b3RhbF9vdXQgKz0gXywgYS50b3RhbCArPSBfLCBfICYmICh0LmFkbGVyID0gYS5jaGVjayA9IGEuZmxhZ3MgPyBDKGEuY2hlY2ssIG4sIF8sIHMgLSBfKSA6IFIoYS5jaGVjaywgbiwgXywgcyAtIF8pKSwgXyA9IGwsIChhLmZsYWdzID8gaCA6IEwoaCkpICE9PSBhLmNoZWNrKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQubXNnID0gXFxcXFxcXCJpbmNvcnJlY3QgZGF0YSBjaGVja1xcXFxcXFwiLCBhLm1vZGUgPSAzMDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IGggPSAwXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBhLm1vZGUgPSAyODtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyODpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhLndyYXAgJiYgYS5mbGFncykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBkIDwgMzI7KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09PSBvKSBicmVhayB0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLS0sIGggKz0gaVtyKytdIDw8IGQsIGQgKz0gOFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaCAhPT0gKDQyOTQ5NjcyOTUgJiBhLnRvdGFsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Lm1zZyA9IFxcXFxcXFwiaW5jb3JyZWN0IGxlbmd0aCBjaGVja1xcXFxcXFwiLCBhLm1vZGUgPSAzMDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IGggPSAwXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBhLm1vZGUgPSAyOTtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyOTpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHggPSAxO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgdDtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAzMDpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHggPSAtMztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIHQ7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzE6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTQ7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzI6XFxcXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gVFxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gdC5uZXh0X291dCA9IHMsIHQuYXZhaWxfb3V0ID0gbCwgdC5uZXh0X2luID0gciwgdC5hdmFpbF9pbiA9IG8sIGEuaG9sZCA9IGgsIGEuYml0cyA9IGQsIChhLndzaXplIHx8IF8gIT09IHQuYXZhaWxfb3V0ICYmIGEubW9kZSA8IDMwICYmIChhLm1vZGUgPCAyNyB8fCA0IC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ICAgICAgICAgICAgdiA9IDAsXFxcXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxcXFxuICAgICAgICAgICAgICAgICAgICB5ID0gMCxcXFxcbiAgICAgICAgICAgICAgICAgICAgeCA9IDAsXFxcXG4gICAgICAgICAgICAgICAgICAgIHogPSAwLFxcXFxuICAgICAgICAgICAgICAgICAgICBCID0gMCxcXFxcbiAgICAgICAgICAgICAgICAgICAgUyA9IDAsXFxcXG4gICAgICAgICAgICAgICAgICAgIEUgPSAwLFxcXFxuICAgICAgICAgICAgICAgICAgICBBID0gbnVsbCxcXFxcbiAgICAgICAgICAgICAgICAgICAgWiA9IDAsXFxcXG4gICAgICAgICAgICAgICAgICAgIFIgPSBuZXcgRC5CdWYxNigxNiksXFxcXG4gICAgICAgICAgICAgICAgICAgIEMgPSBuZXcgRC5CdWYxNigxNiksXFxcXG4gICAgICAgICAgICAgICAgICAgIE4gPSBudWxsLFxcXFxuICAgICAgICAgICAgICAgICAgICBPID0gMDtcXFxcbiAgICAgICAgICAgICAgICBmb3IgKHcgPSAwOyB3IDw9IDE1OyB3KyspIFJbd10gPSAwO1xcXFxuICAgICAgICAgICAgICAgIGZvciAocCA9IDA7IHAgPCBpOyBwKyspIFJbZVthICsgcF1dKys7XFxcXG4gICAgICAgICAgICAgICAgZm9yICh5ID0gbSwgayA9IDE1OyAxIDw9IGsgJiYgMCA9PT0gUltrXTsgay0tKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoayA8IHkgJiYgKHkgPSBrKSwgMCA9PT0gaykgcmV0dXJuIG5bcisrXSA9IDIwOTcxNTIwLCBuW3IrK10gPSAyMDk3MTUyMCwgby5iaXRzID0gMSwgMDtcXFxcbiAgICAgICAgICAgICAgICBmb3IgKHYgPSAxOyB2IDwgayAmJiAwID09PSBSW3ZdOyB2KyspO1xcXFxuICAgICAgICAgICAgICAgIGZvciAoeSA8IHYgJiYgKHkgPSB2KSwgdyA9IEIgPSAxOyB3IDw9IDE1OyB3KyspXFxc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IChsID0gMSA8PCB3IC0gMTsgRSAmIGw7KSBsID4+PSAxO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoMCAhPT0gbCA/IChFICY9IGwgLSAxLCBFICs9IGwpIDogRSA9IDAsIHArKywgMCA9PSAtLVJbd10pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh3ID09PSBrKSBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHcgPSBlW2EgKyBzW3BdXVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICh5IDwgdyAmJiAoRSAmIGYpICE9PSBkKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDAgPT09IHogJiYgKHogPSB5KSwgXyArPSB2LCBCID0gMSA8PCAoeCA9IHcgLSB6KTsgeCArIHogPCBrICYmICEoKEIgLT0gUlt4ICsgel0pIDw9IDApOykgeCsrLCBCIDw8PSAxO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFMgKz0gMSA8PCB4LCAxID09PSB0ICYmIDg1MiA8IFMgfHwgMiA9PT0gdCAmJiA1OTIgPCBTKSByZXR1cm4gMTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5bZCA9IEUgJiBmXSA9IHkgPDwgMjQgfCB4IDw8IDE2IHwgXyAtIHIgfCAwXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIDAgIT09IEUgJiYgKG5bXyArIEVdID0gdyAtIHogPDwgMjQgfCA2NCA8PCAxNiB8IDApLCBvLmJpdHMgPSB5LCAwXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgIFxcXFxcXFwiLi4vdXRpbHMvY29tbW9uXFxcXFxcXCI6IDNcXFxcbiAgICAgICAgfV0sXFxcXG4gICAgICAgIDEzOiB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9uXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgIG8gPSAwLFxcXFxuICAgICAgICAgICAgICAgIGggPSAxO1xcXFxuXFxcXG4gICAgICAgICAgICBmdW5jdGlvbiBpKHQpIHtcXFxcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBlID0gdC5sZW5ndGg7IDAgPD0gLS1lOykgdFtlXSA9IDBcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHZhciBkID0gMCxcXFxcbiAgICAgICAgICAgICAgICBzID0gMjksXFxcXG4gICAgICAgICAgICAgICAgZiA9IDI1NixcXFxcbiAgICAgICAgICAgICAgICBfID0gZiArIDEgKyBzLFxcXFxuICAgICAgICAgICAgICAgIHUgPSAzMCxcXFxcbiAgICAgICAgICAgICAgICBjID0gMTksXFxcXG4gICAgICAgICAgICAgICAgZyA9IDIgKiBfICsgMSxcXFxcbiAgICAgICAgICAgICAgICBtID0gMTUsXFxcXG4gICAgICAgICAgICAgICAgbiA9IDE2LFxcXFxuICAgICAgICAgICAgICAgIGIgPSA3LFxcXFxuICAgICAgICAgICAgICAgIHcgPSAyNTYsXFxcXG4gICAgICAgICAgICAgICAgcCA9IDE2LFxcXFxuICAgICAgICAgICAgICAgIHYgPSAxNyxcXFxcbiAgICAgICAgICAgICAgICBrID0gMTgsXFxcXG4gICAgICAgICAgICAgICAgeSA9IFswLCAwLCAwLCAwLCAwLCAwLCAwLCAwLCAxLCAxLCAxLCAxLCAyLCAyLCAyLCAyLCAzLCAzLCAzLCAzLCA0LCA0LCA0LCA0LCA1LCA1LCA1LCA1LCAwXSxcXFxcbiAgICAgICAgICAgICAgICB4ID0gWzAsIDAsIDAsIDAsIDEsIDEsIDIsIDIsIDMsIDMsIDQsIDQsIDUsIDUsIDYsIDYsIDcsIDcsIDgsIDgsIDksIDksIDEwLCAxMCwgMTEsIDExLCAxMiwgMTIsIDEzLCAxM10sXFxcXG4gICAgICAgICAgICAgICAgeiA9IFswLCAwLCAwLCAwL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ICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgZnVuY3Rpb24gaih0LCBlLCBhKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIGksIG4sIHIgPSBuZXcgQXJyYXkobSArIDEpLFxcXFxuICAgICAgICAgICAgICAgICAgICBzID0gMDtcXFxcbiAgICAgICAgICAgICAgICBmb3IgKGkgPSAxOyBpIDw9IG07IGkrKykgcltpXSA9IHMgPSBzICsgYVtpIC0gMV0gPDwgMTtcXFxcbiAgICAgICAgICAgICAgICBmb3IgKG4gPSAwOyBuIDw9IGU7IG4rKykge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgbyA9IHRbMiAqIG4gKyAxXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgMCAhPT0gbyAmJiAodFsyICogbl0gPSBIKHJbb10rKywgbykpXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgICAgICBmdW5jdGlvbiBLKHQpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgZTtcXFxcbiAgICAgICAgICAgICAgICBmb3IgKGUgPSAwOyBlIDwgXzsgZSsrKSB0LmR5bl9sdHJlZVsyICogZV0gPSAwO1xcXFxuICAgICAgICAgICAgICAgIGZvciAoZSA9IDA7IGUgPCB1OyBlKyspIHQuZHluX2R0cmVlWzIgKiBlXSA9IDA7XFxcXG4gICAgICAgICAgICAgICAgZm9yIChlID0gMDsgZSA8IGM7IGUrKykgdC5ibF90cmVlWzIgKiBlXSA9IDA7XFxcXG4gICAgICAgICAgICAgICAgdC5keW5fbHRyZWVbMiAqIHddID0gMSwgdC5vcHRfbGVuID0gdC5zdGF0aWNfbGVuID0gMCwgdC5sYXN0X2xpdCA9IHQubWF0Y2hlcyA9IDBcXFxcbiAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgZnVuY3Rpb24gTSh0KSB7XFxcXG4gICAgICAgICAgICAgICAgOCA8IHQuYmlfdmFsa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tuXSA9IDAsIHQub3B0X2xlbi0tLCBvICYmICh0LnN0YXRpY19sZW4gLT0gc1syICogbiArIDFdKTtcXFxcbiAgICAgICAgICAgICAgICBmb3IgKGUubWF4X2NvZGUgPSBoLCBhID0gdC5oZWFwX2xlbiA+PiAxOyAxIDw9IGE7IGEtLSkgWSh0LCByLCBhKTtcXFxcbiAgICAgICAgICAgICAgICBmb3IgKG4gPSBsOyBhID0gdC5oZWFwWzFdLCB0LmhlYXBbMV0gPSB0LmhlYXBbdC5oZWFwX2xlbi0tXSwgWSh0LCByLCAxKSwgaSA9IHQuaGVhcFsxXSwgdC5oZWFwWy0tdC5oZWFwX21heF0gPSBhLCB0LmhlYXBbLS10LmhlYXBfbWF4XSA9IGksIHJbMiAqIG5dID0gclsyICogYV0gKyByWzIgKiBpXSwgdC5kZXB0aFtuXSA9ICh0LmRlcHRoW2FdID49IHQuZGVwdGhbaV0gPyB0LmRlcHRoW2FdIDogdC5kZXB0aFtpXSkgKyAxLCByWzIgKiBhICsgMV0gPSByWzIgKiBpICsgMV0gPSBuLCB0LmhlYXBbMV0gPSBuKyssIFkodCwgciwgMSksIDIgPD0gdC5oZWFwX2xlbjspO1xcXFxuICAgICAgICAgICAgICAgIHQuaGVhcFstLXQuaGVhcF9tYXhdID0gdC5oZWFwWzFdLFxcXFxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbih0LCBlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgYSwgaSwgbiwgciwgcywgbywgbCA9IGUuZHluX3RyZWUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA9IGUubWF4X2NvZGUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IGUuc3RhdF9kZXNjLnN0YXRpY190cmVlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSBlLnN0YXRfZGVzYy5oYXNfc3RyZWUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXyA9IGUuc3RhdF9kZXNjLmV4dHJhX2JpdHMsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGUuc3RhdF9kZXNjLmV4dHJhX2Jhc2UsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYyA9IGUuc3RhdF9kZXNjLm1heF9sZW5ndGgsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9IDA7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHIgPSAwOyByIDw9IG07IHIrKykgdC5ibF9jb3VudFtyXSA9IDA7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxbMiAqIHQuaGVhcFt0LmhlYXBfbWF4XSArIDFdID0gMCwgYSA9IHQuaGVhcF9tYXggKyAxOyBhIDwgZzsgYSsrKSBjIDwgKHIgPSBsWzIgKiBsWzIgKiAoaSA9IHQuaGVhcFthXSkgKyAxXSArIDFdICsgMSkgJiYgKHIgPSBjLCBiKyspLCBsWzIgKiBpICsgMV0gPSByLCBoIDwgaSB8fCAodC5ibF9jb3VudFtyXSsrLCBzID0gMCwgdSA8PSBpICYmIChzID0gX1tpIC0gdV0pLCBvID0gbFsyICogaV0sIHQub3B0X2xlbiArPSBvICogKHIgKyBzKSwgZiAmJiAodC5zdGF0aWNfbGVuICs9IG8gKiAoZFsyICogaSArIDFdICsgcykpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwICE9PSBiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHIgPSBjIC0gMTsgMCA9PT0gdC5ibF9jb3VudFtyXTspIHItLTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5ibF9jb3VudFtyXS0tLCB0LmJsX2NvdW50W3IgKyAxXSArPSAyLCB0LmJsX2NvdW50W2NdLS0sIGIgLT0gMlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDAgPCBiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHIgPSBjOyAwICE9PSByOyByLS0pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IHQuYmxfY291bnRbcl07IDAgIT09IGk7KSBoIDwgKG4gPSB0LmhlYXBbLS1hXSkgfHwgKGxbMiAqIG4gKyAxXSAhPT0gciAmJiAodC5vcHRfbGVuICs9IChyIC0gbFsyICogbiArIDFdKSAqIGxbMiAqIG5dLCBsWzIgKiBuICsgMV0gPSByKSwgaS0tKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KHQsIGUpLCBqKHIsIGgsIHQuYmxfY291bnQpXFxcXG4gICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgIGZ1bmN0aW9uIFgodCwgZSwgYSkge1xcXFxuICAgICAgICAgICAgICAgIHZhciBpLCBuLCByID0gLTEsXFxcXG4gICAgICAgICAgICAgICAgICAgIHMgPSBlWzFdLFxcXFxuICAgICAgICAgICAgICAgICAgICBvID0gMCxcXFxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDcsXFxcXG4gICAgICAgICAgICAgICAgICAgIGggPSA0O1xcXFxuICAgICAgICAgICAgICAgIGZvciAoMCA9PT0gcyAmJiAobCA9IDEzOCwgaCA9IDMpLCBlWzIgKiAoYSArIDEpICsgMV0gPSA2NTUzNSwgaSA9IDA7IGkgPD0gYTsgaSsrKSBuID0gcywgcyA9IGVbMiAqIChpICsgMSkgKyAxXSwgKytvIDwgbCAmJiBuID09PSBzIHx8IChvIDwgaCA/IHQuYmxfdHJlZVsyICogbl0gKz0gbyA6IDAgIT09IG4gPyAobiAhPT0gciAmJiB0LmJsX3RyZWVbMiAqIG5dKyssIHQuYmxfdHJlZVsyICogcF0rKykgOiBvIDw9IDEwID8gdC5ibF90cmVlWzIgKiB2XSsrIDogdC5ibF90cmVlWzIgKiBrXSsrLCByID0gbiwgKG8gPSAwKSA9PT0gcyA/IChsID0gMTM4LCBoID0gMykgOiBuID09PSBzID8gKGwgPSA2LCBoID0gMykgOiAobCA9IDcsIGggPSA0KSlcXFxcbiAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgZnVuY3Rpb24gVyh0LCBlLCBhKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIGksIG4sIHIgPSAtMSxcXFxcbiAgICAgICAgICAgICAgICAgICAgcyA9IGVbMV0sXFxcXG4gICAgICAgICAgICAgICAgICAgIG8gPSAwLFxcXFxuICAgICAgICAgICAgICAgICAgICBsID0gNyxcXFxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDQ7XFxcXG4gICAgICAgICAgICAgICAgZm9yICgwID09PSBzICYmIChsID0gMTM4LCBoID0gMyksIGkgPSAwOyBpIDw9IGE7IGkrKylcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKG4gPSBzLCBzID0gZVsyICogKGkgKyAxKSArIDFdLCAhKCsrbyA8IGwgJiYgbiA9PT0gcykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvIDwgaClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgTCh0LCBuLCB0LmJsX3RyZWUpLCAwICE9IC0tbzspO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSAwICE9PSBuID8gKG4gIT09IHIgJiYgKEwodCwgbiwgdC5ibF90cmVlKSwgby0tKSwgTCh0LCBwLCB0LmJsX3RyZWUpLCBGKHQsIG8gLSAzLCAyKSkgOiBvIDw9IDEwID8gKEwodCwgdiwgdC5ibF90cmVlKSwgRih0LCBvIC0gMywgMykpIDogKEwodCwgaywgdC5ibF90cmVlKSwgRih0LCBvIC0gMTEsIDcpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBuLCAobyA9IDApID09PSBzID8gKGwgPSAxMzgsIGggPSAzKSA6IG4gPT09IHMgPyAobCA9IDYsIGggPSAzKSA6IChsID0gNywgaCA9IDQpXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGkoRCk7XFxcXG4gICAgICAgICAgICB2YXIgSiA9ICExO1xcXFxuXFxcXG4gICAgICAgICAgICBmdW5jdGlvbiBRKHQsIGUsIGEsIGkpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgbiwgciwgcywgbztcXFxcbiAgICAgICAgICAgICAgICBGKHQsIChkIDw8IDEpICsgKGkgPyAxIDogMCksIDMpLCByID0gZSwgcyA9IGEsIG8gPSAhMCwgTShuID0gdCksIG8gJiYgKFQobiwgcyksIFQobiwgfnMpKSwgbC5hcnJheVNldChuLnBlbmRpbmdfYnVmLCBuLndpbmRvdywgciwgcywgbi5wZW5kaW5nKSwgbi5wZW5kaW5nICs9IHNcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGEuX3RyX2luaXQgPSBmdW5jdGlvbih0KSB7XFxcXG4gICAgICAgICAgICAgICAgSiB8fCAoZnVuY3Rpb24oKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0LCBlLCBhLCBpLCBuLCByID0gbmV3IEFycmF5KG0gKyAxKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gYSA9IDA7IGkgPCBzIC0gMTsgaSsrKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChSW2ldID0gYSwgdCA9IDA7IHQgPCAxIDw8IHlbaV07IHQrKykgWlthKytdID0gaTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZm9yIChaW2EgLSAxXSA9IGksIGkgPSBuID0gMDsgaSA8IDE2OyBpKyspXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKERbaV0gPSBuLCB0ID0gMDsgdCA8IDEgPDwgeFtpXTsgdCsrKSBBW24rK10gPSBpO1xcXFxuICAgICAgICAgICAgICAgICAgICBmb3IgKG4gPj49IDc7IGkgPCB1OyBpKyspXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKERbaV0gPSBuIDw8IDcsIHQgPSAwOyB0IDwgMSA8PCB4W2ldIC0gNzsgdCsrKSBBWzI1NiArIG4rK10gPSBpO1xcXFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGUgPSAwOyBlIDw9IG07IGUrKykgcltlXSA9IDA7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZvciAodCA9IDA7IHQgPD0gMTQzOykgU1syICogdCArIDFdID0gOCwgdCsrLCByWzhdKys7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoOyB0IDw9IDI1NTspIFNbMiAqIHQgKyAxXSA9IDksIHQrKywgcls5XSsrO1xcXFxuICAgICAgICAgICAgICAgICAgICBmb3IgKDsgdCA8PSAyNzk7KSBTWzIgKiB0ICsgMV0gPSA3LCB0KyssIHJbN10rKztcXFxcbiAgICAgICAgICAgICAgICAgICAgZm9yICg7IHQgPD0gMjg3OykgU1syICogdCArIDFdID0gOCwgdCsrLCByWzhdKys7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaihTLCBfICsgMSwgciksIHQgPSAwOyB0IDwgdTsgdCsrKSBFWzIgKiB0ICsgMV0gPSA1LCBFWzIgKiB0XSA9IEgodCwgNSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIEMgPSBuZXcgSShTLCB5LCBmICsgMSwgXywgbSksIE4gPSBuZXcgSShFLCB4LCAwLCB1LCBtKSwgTyA9IG5ldyBJKG5ldyBBcnJheSgwKSwgeiwgMCwgYywgYilcXFxcbiAgICAgICAgICAgICAgICB9KCksIEogPSAhMCksIHQubF9kZXNjID0gbmV3IHIodC5keW5fbHRyZWUsIEMpLCB0LmRfZGVzYyA9IG5ldyByKHQuZHluX2R0cmVlLCBOKSwgdC5ibF9kZXNjID0gbmV3IHIodC5ibF90cmVlLCBPKSwgdC5iaV9idWYgPSAwLCB0LmJpX3ZhbGlkID0gMCwgSyh0KVxcXFxuICAgICAgICAgICAgfSwgYS5fdHJfc3RvcmVkX2Jsb2NrID0gUSwgYS5fdHJfZmx1c2hfYmxvY2sgPSBmdW5jdGlvbih0LCBlLCBhLCBpKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIG4sIHIsIHMgPSAwO1xcXFxuICAgICAgICAgICAgICAgIDAgPCB0LmxldmVsID8gKDIgPT09IHQuc3RybS5kYXRhX3R5cGUgJiYgKHQuc3RybS5kYXRhX3R5cGUgPSBmdW5jdGlvbih0KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBlLCBhID0gNDA5MzYyNDQ0NztcXFxcbiAgICAgICAgICAgICAgICAgICAgZm9yIChlID0gMDsgZSA8PSAzMTsgZSsrLCBhID4+Pj0gMSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgxICYgYSAmJiAwICE9PSB0LmR5bl9sdHJlZVsyICogZV0pIHJldHVybiBvO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoMCAhPT0gdC5keW5fbHRyZWVbMThdIHx8IDAgIT09IHQuZHluX2x0cmVlWzIwXSB8fCAwICE9PSB0LmR5bl9sdHJlZVsyNl0pIHJldHVybiBoO1xcXFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGUgPSAzMjsgZSA8IGY7IGUrKylcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwICE9PSB0LmR5bl9sdHJlZVsyICogZV0pIHJldHVybiBoO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb1xcXFxuICAgICAgICAgICAgICAgIH0odCkpLCBHKHQsIHQubF9kZXNjKSwgRyh0LCB0LmRfZGVzYyksIHMgPSBmdW5jdGlvbih0KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBlO1xcXFxuICAgICAgICAgICAgICAgICAgICBmb3IgKFgodCwgdC5keW5fbHRyZWUsIHQubF9kZ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Vlc3QoaG9tZSkpO1xcXFxuICAgICAgICAgICAgbGV0IGhhc1J1bGUgPSBydWxlTGlzdC5zb21lKGl0ZW0gPT4gaXRlbS50aXRsZSA9PT0gb2JqLm5hbWUpO1xcXFxuICAgICAgICAgICAgaWYgKGhhc1J1bGUgfHwgb2JqLm5hbWUgPT0gJycpIHtcXFxcbiAgICAgICAgICAgICAgICAvL3RvYXN0KFxcXFxcXFwi6K+36YWN572u5b+r6YCf5pCc57SiXFxcXFxcXCIpXFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3NlYXJjaD9zPScgKyB0aXRsZSArICcmcnVsZT0nICsgb2JqLm5hbWU7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgaWYgKG9iai5oYXNPd25Qcm9wZXJ0eShcXFxcXFxcInJ1bGVcXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9iai5ydWxlLmluZGV4T2YoJ2NvcHknKSE9LTEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXFxcXFwi5bey57uP5aSN5Yi26K+35a+85YWl6KeE5YiZXFxcXFxcXCIpXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9iai5ydWxlXFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/or7flronoo4VcXFxcXFxcIiArIG9iai5uYW1lICsgXFxcXFxcXCLlsI/nqIvluo9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0sIG9iaiwgXFxcXFxcXCJoaWtlcjovL2hvbWVcXFxcXFxcIiwgdGl0bGUpLFxcXFxuICAgICAgICBwaWNfdXJsOiBvYmoucGljLFx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