From 6b2a529c51f121b3e03154ae592731e4b624f932 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2020 07:52:18 +0000 Subject: [PATCH 1/5] Bump @babel/runtime from 7.8.3 to 7.8.4 Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.8.3 to 7.8.4. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.8.4/packages/babel-runtime) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7b84321..918b5cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2965,9 +2965,9 @@ } }, "@babel/runtime": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.8.3.tgz", - "integrity": "sha512-fVHx1rzEmwB130VTkLnxR+HmxcTjGzH12LYQcFFoBwakMd3aOMD4OsRN7tGG/UOYE2ektgFrS8uACAoRk1CY0w==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.8.4.tgz", + "integrity": "sha512-neAp3zt80trRVBI1x0azq6c57aNBqYZH8KhMm3TaB7wEI5Q4A2SHfBHE8w9gOhI/lrqxtEbXZgQIrHP+wvSGwQ==", "dev": true, "requires": { "regenerator-runtime": "^0.13.2" diff --git a/package.json b/package.json index b529b16..b2d9531 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "@babel/plugin-transform-runtime": "^7.3.4", "@babel/preset-env": "^7.3.4", "@babel/register": "^7.7.4", - "@babel/runtime": "^7.3.4", + "@babel/runtime": "^7.8.4", "babel-loader": "^8.0.5", "clean-webpack-plugin": "^3.0.0", "documentation": "^12.1.4", From 63498141642dc47ca394fba68430b4286ed8a6da Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" Date: Fri, 31 Jan 2020 07:54:07 +0000 Subject: [PATCH 2/5] New build --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 4b35eba..1f96ce4 100644 --- a/index.js +++ b/index.js @@ -1 +1 @@ -!function(g,I){"object"==typeof exports&&"object"==typeof module?module.exports=I():"function"==typeof define&&define.amd?define([],I):"object"==typeof exports?exports["web-midi-player"]=I():g["web-midi-player"]=I()}(window,(function(){return function(g){var I={};function A(C){if(I[C])return I[C].exports;var i=I[C]={i:C,l:!1,exports:{}};return g[C].call(i.exports,i,i.exports,A),i.l=!0,i.exports}return A.m=g,A.c=I,A.d=function(g,I,C){A.o(g,I)||Object.defineProperty(g,I,{enumerable:!0,get:C})},A.r=function(g){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(g,"__esModule",{value:!0})},A.t=function(g,I){if(1&I&&(g=A(g)),8&I)return g;if(4&I&&"object"==typeof g&&g&&g.__esModule)return g;var C=Object.create(null);if(A.r(C),Object.defineProperty(C,"default",{enumerable:!0,value:g}),2&I&&"string"!=typeof g)for(var i in g)A.d(C,i,function(I){return g[I]}.bind(null,i));return C},A.n=function(g){var I=g&&g.__esModule?function(){return g.default}:function(){return g};return A.d(I,"a",I),I},A.o=function(g,I){return Object.prototype.hasOwnProperty.call(g,I)},A.p="",A(A.s=18)}([function(module,__webpack_exports__,__webpack_require__){"use strict";eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"g\", function() { return MAX_I16; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"h\", function() { return MIDI_AUDIO_BUFFER_SIZE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"i\", function() { return MIDI_AUDIO_S16LSB; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"j\", function() { return MIDI_DEFAULT_PATCH_URL; });\n/* unused harmony export MIDI_PLAYER_MESSAGE_PREFIX */\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"e\", function() { return LIBTIMIDITY_PATCH_DIRECTORY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"f\", function() { return LIBTIMIDITY_PATCH_DRUM_DIRECTORY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return LIBTIMIDITY_CONFIG_FILE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return LIBTIMIDITY_ERROR_CODES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return LIBTIMIDITY_ERROR_MESSAGES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return LIBTIMIDITY_CONFIG_DATA; });\nvar MAX_I16 = Math.pow(2, 15);\nvar MIDI_AUDIO_BUFFER_SIZE = 8192;\nvar MIDI_AUDIO_S16LSB = 0x8010;\nvar MIDI_DEFAULT_PATCH_URL = 'https://cdn.jsdelivr.net/npm/midi-instrument-patches@latest/';\nvar MIDI_PLAYER_MESSAGE_PREFIX = 'Midi player:';\nvar LIBTIMIDITY_PATCH_DIRECTORY = 'pat';\nvar LIBTIMIDITY_PATCH_DRUM_DIRECTORY = 'MT32Drums';\nvar LIBTIMIDITY_CONFIG_FILE = 'timidity.cfg';\nvar LIBTIMIDITY_ERROR_CODES = {\n EPERM: 1,\n ENOENT: 2,\n ESRCH: 3,\n EINTR: 4,\n EIO: 5,\n ENXIO: 6,\n E2BIG: 7,\n ENOEXEC: 8,\n EBADF: 9,\n ECHILD: 10,\n EAGAIN: 11,\n EWOULDBLOCK: 11,\n ENOMEM: 12,\n EACCES: 13,\n EFAULT: 14,\n ENOTBLK: 15,\n EBUSY: 16,\n EEXIST: 17,\n EXDEV: 18,\n ENODEV: 19,\n ENOTDIR: 20,\n EISDIR: 21,\n EINVAL: 22,\n ENFILE: 23,\n EMFILE: 24,\n ENOTTY: 25,\n ETXTBSY: 26,\n EFBIG: 27,\n ENOSPC: 28,\n ESPIPE: 29,\n EROFS: 30,\n EMLINK: 31,\n EPIPE: 32,\n EDOM: 33,\n ERANGE: 34,\n ENOMSG: 42,\n EIDRM: 43,\n ECHRNG: 44,\n EL2NSYNC: 45,\n EL3HLT: 46,\n EL3RST: 47,\n ELNRNG: 48,\n EUNATCH: 49,\n ENOCSI: 50,\n EL2HLT: 51,\n EDEADLK: 35,\n ENOLCK: 37,\n EBADE: 52,\n EBADR: 53,\n EXFULL: 54,\n ENOANO: 55,\n EBADRQC: 56,\n EBADSLT: 57,\n EDEADLOCK: 35,\n EBFONT: 59,\n ENOSTR: 60,\n ENODATA: 61,\n ETIME: 62,\n ENOSR: 63,\n ENONET: 64,\n ENOPKG: 65,\n EREMOTE: 66,\n ENOLINK: 67,\n EADV: 68,\n ESRMNT: 69,\n ECOMM: 70,\n EPROTO: 71,\n EMULTIHOP: 72,\n EDOTDOT: 73,\n EBADMSG: 74,\n ENOTUNIQ: 76,\n EBADFD: 77,\n EREMCHG: 78,\n ELIBACC: 79,\n ELIBBAD: 80,\n ELIBSCN: 81,\n ELIBMAX: 82,\n ELIBEXEC: 83,\n ENOSYS: 38,\n ENOTEMPTY: 39,\n ENAMETOOLONG: 36,\n ELOOP: 40,\n EOPNOTSUPP: 95,\n EPFNOSUPPORT: 96,\n ECONNRESET: 104,\n ENOBUFS: 105,\n EAFNOSUPPORT: 97,\n EPROTOTYPE: 91,\n ENOTSOCK: 88,\n ENOPROTOOPT: 92,\n ESHUTDOWN: 108,\n ECONNREFUSED: 111,\n EADDRINUSE: 98,\n ECONNABORTED: 103,\n ENETUNREACH: 101,\n ENETDOWN: 100,\n ETIMEDOUT: 110,\n EHOSTDOWN: 112,\n EHOSTUNREACH: 113,\n EINPROGRESS: 115,\n EALREADY: 114,\n EDESTADDRREQ: 89,\n EMSGSIZE: 90,\n EPROTONOSUPPORT: 93,\n ESOCKTNOSUPPORT: 94,\n EADDRNOTAVAIL: 99,\n ENETRESET: 102,\n EISCONN: 106,\n ENOTCONN: 107,\n ETOOMANYREFS: 109,\n EUSERS: 87,\n EDQUOT: 122,\n ESTALE: 116,\n ENOTSUP: 95,\n ENOMEDIUM: 123,\n EILSEQ: 84,\n EOVERFLOW: 75,\n ECANCELED: 125,\n ENOTRECOVERABLE: 131,\n EOWNERDEAD: 130,\n ESTRPIPE: 86\n};\nvar LIBTIMIDITY_ERROR_MESSAGES = {\n 0: 'Success',\n 1: 'Not super-user',\n 2: 'No such file or directory',\n 3: 'No such process',\n 4: 'Interrupted system call',\n 5: 'I/O error',\n 6: 'No such device or address',\n 7: 'Arg list too long',\n 8: 'Exec format error',\n 9: 'Bad file number',\n 10: 'No children',\n 11: 'No more processes',\n 12: 'Not enough core',\n 13: 'Permission denied',\n 14: 'Bad address',\n 15: 'Block device required',\n 16: 'Mount device busy',\n 17: 'File exists',\n 18: 'Cross-device link',\n 19: 'No such device',\n 20: 'Not a directory',\n 21: 'Is a directory',\n 22: 'Invalid argument',\n 23: 'Too many open files in system',\n 24: 'Too many open files',\n 25: 'Not a typewriter',\n 26: 'Text file busy',\n 27: 'File too large',\n 28: 'No space left on device',\n 29: 'Illegal seek',\n 30: 'Read only file system',\n 31: 'Too many links',\n 32: 'Broken pipe',\n 33: 'Math arg out of domain of func',\n 34: 'Math result not representable',\n 35: 'File locking deadlock error',\n 36: 'File or path name too long',\n 37: 'No record locks available',\n 38: 'Function not implemented',\n 39: 'Directory not empty',\n 40: 'Too many symbolic links',\n 42: 'No message of desired type',\n 43: 'Identifier removed',\n 44: 'Channel number out of range',\n 45: 'Level 2 not synchronized',\n 46: 'Level 3 halted',\n 47: 'Level 3 reset',\n 48: 'Link number out of range',\n 49: 'Protocol driver not attached',\n 50: 'No CSI structure available',\n 51: 'Level 2 halted',\n 52: 'Invalid exchange',\n 53: 'Invalid request descriptor',\n 54: 'Exchange full',\n 55: 'No anode',\n 56: 'Invalid request code',\n 57: 'Invalid slot',\n 59: 'Bad font file fmt',\n 60: 'Device not a stream',\n 61: 'No data (for no delay io)',\n 62: 'Timer expired',\n 63: 'Out of streams resources',\n 64: 'Machine is not on the network',\n 65: 'Package not installed',\n 66: 'The object is remote',\n 67: 'The link has been severed',\n 68: 'Advertise error',\n 69: 'Srmount error',\n 70: 'Communication error on send',\n 71: 'Protocol error',\n 72: 'Multihop attempted',\n 73: 'Cross mount point (not really error)',\n 74: 'Trying to read unreadable message',\n 75: 'Value too large for defined data type',\n 76: 'Given log. name not unique',\n 77: 'f.d. invalid for this operation',\n 78: 'Remote address changed',\n 79: 'Can access a needed shared lib',\n 80: 'Accessing a corrupted shared lib',\n 81: '.lib section in a.out corrupted',\n 82: 'Attempting to link in too many libs',\n 83: 'Attempting to exec a shared library',\n 84: 'Illegal byte sequence',\n 86: 'Streams pipe error',\n 87: 'Too many users',\n 88: 'Socket operation on non-socket',\n 89: 'Destination address required',\n 90: 'Message too long',\n 91: 'Protocol wrong type for socket',\n 92: 'Protocol not available',\n 93: 'Unknown protocol',\n 94: 'Socket type not supported',\n 95: 'Not supported',\n 96: 'Protocol family not supported',\n 97: 'Address family not supported by protocol family',\n 98: 'Address already in use',\n 99: 'Address not available',\n 100: 'Network interface is not configured',\n 101: 'Network is unreachable',\n 102: 'Connection reset by network',\n 103: 'Connection aborted',\n 104: 'Connection reset by peer',\n 105: 'No buffer space available',\n 106: 'Socket is already connected',\n 107: 'Socket is not connected',\n 108: \"Can't send after socket shutdown\",\n 109: 'Too many references',\n 110: 'Connection timed out',\n 111: 'Connection refused',\n 112: 'Host is down',\n 113: 'Host is unreachable',\n 114: 'Socket already connected',\n 115: 'Connection already in progress',\n 116: 'Stale file handle',\n 122: 'Quota exceeded',\n 123: 'No medium (in tape drive)',\n 125: 'Operation canceled',\n 130: 'Previous owner died',\n 131: 'State not recoverable'\n}; // prettier-ignore\n\nvar LIBTIMIDITY_CONFIG_DATA = [100, 105, 114, 32, 46, 47, 112, 97, 116, 10, 10, 100, 114, 117, 109, 115, 101, 116, 32, 48, 10, 10, 32, 51, 53, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 48, 46, 112, 97, 116, 10, 32, 51, 54, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 46, 112, 97, 116, 10, 32, 51, 55, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 46, 112, 97, 116, 10, 32, 51, 56, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 46, 112, 97, 116, 10, 32, 51, 57, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 52, 46, 112, 97, 116, 10, 32, 52, 48, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 53, 46, 112, 97, 116, 10, 32, 52, 49, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 54, 46, 112, 97, 116, 10, 32, 52, 50, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 55, 46, 112, 97, 116, 10, 32, 52, 51, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 56, 46, 112, 97, 116, 10, 32, 52, 52, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 57, 46, 112, 97, 116, 10, 32, 52, 53, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 48, 46, 112, 97, 116, 10, 32, 52, 54, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 49, 46, 112, 97, 116, 10, 32, 52, 55, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 50, 46, 112, 97, 116, 10, 32, 52, 56, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 51, 46, 112, 97, 116, 10, 32, 52, 57, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 52, 46, 112, 97, 116, 10, 32, 53, 48, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 53, 46, 112, 97, 116, 10, 32, 53, 49, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 54, 46, 112, 97, 116, 10, 32, 53, 50, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 55, 46, 112, 97, 116, 10, 32, 53, 51, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 56, 46, 112, 97, 116, 10, 32, 53, 52, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 57, 46, 112, 97, 116, 10, 32, 53, 53, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 48, 46, 112, 97, 116, 10, 32, 53, 54, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 49, 46, 112, 97, 116, 10, 32, 53, 55, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 50, 46, 112, 97, 116, 10, 32, 53, 56, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 51, 46, 112, 97, 116, 10, 32, 53, 57, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 52, 46, 112, 97, 116, 10, 32, 54, 48, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 53, 46, 112, 97, 116, 10, 32, 54, 49, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 54, 46, 112, 97, 116, 10, 32, 54, 50, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 55, 46, 112, 97, 116, 10, 32, 54, 51, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 56, 46, 112, 97, 116, 10, 32, 54, 52, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 57, 46, 112, 97, 116, 10, 32, 54, 53, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 48, 46, 112, 97, 116, 10, 32, 54, 54, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 49, 46, 112, 97, 116, 10, 32, 54, 55, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 50, 46, 112, 97, 116, 10, 32, 54, 56, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 51, 46, 112, 97, 116, 10, 32, 54, 57, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 52, 46, 112, 97, 116, 10, 32, 55, 48, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 53, 46, 112, 97, 116, 10, 32, 55, 49, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 54, 46, 112, 97, 116, 10, 32, 55, 50, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 55, 46, 112, 97, 116, 10, 32, 55, 51, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 56, 46, 112, 97, 116, 10, 32, 55, 52, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 57, 46, 112, 97, 116, 10, 32, 55, 53, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 52, 48, 46, 112, 97, 116, 10, 32, 55, 54, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 52, 49, 46, 112, 97, 116, 10, 32, 55, 55, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 52, 50, 46, 112, 97, 116, 10, 32, 55, 56, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 52, 51, 46, 112, 97, 116, 10, 32, 55, 57, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 52, 52, 46, 112, 97, 116, 10, 32, 56, 48, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 52, 53, 46, 112, 97, 116, 10, 32, 56, 49, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 52, 54, 46, 112, 97, 116, 10, 10, 98, 97, 110, 107, 32, 48, 10, 10, 32, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 50, 55, 46, 112, 97, 116, 10, 32, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 50, 54, 46, 112, 97, 116, 10, 32, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 50, 53, 46, 112, 97, 116, 10, 32, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 50, 52, 46, 112, 97, 116, 10, 32, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 50, 51, 46, 112, 97, 116, 10, 32, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 50, 50, 46, 112, 97, 116, 10, 32, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 50, 49, 46, 112, 97, 116, 10, 32, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 50, 48, 46, 112, 97, 116, 10, 32, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 57, 46, 112, 97, 116, 10, 32, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 56, 46, 112, 97, 116, 10, 32, 49, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 55, 46, 112, 97, 116, 10, 32, 49, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 54, 46, 112, 97, 116, 10, 32, 49, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 53, 46, 112, 97, 116, 10, 32, 49, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 52, 46, 112, 97, 116, 10, 32, 49, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 51, 46, 112, 97, 116, 10, 32, 49, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 50, 46, 112, 97, 116, 10, 32, 49, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 49, 46, 112, 97, 116, 10, 32, 49, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 48, 46, 112, 97, 116, 10, 32, 49, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 57, 46, 112, 97, 116, 10, 32, 49, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 56, 46, 112, 97, 116, 10, 32, 50, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 55, 46, 112, 97, 116, 10, 32, 50, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 54, 46, 112, 97, 116, 10, 32, 50, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 53, 46, 112, 97, 116, 10, 32, 50, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 52, 46, 112, 97, 116, 10, 32, 50, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 51, 46, 112, 97, 116, 10, 32, 50, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 50, 46, 112, 97, 116, 10, 32, 50, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 49, 46, 112, 97, 116, 10, 32, 50, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 48, 46, 112, 97, 116, 10, 32, 50, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 57, 46, 112, 97, 116, 10, 32, 50, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 56, 46, 112, 97, 116, 10, 32, 51, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 55, 46, 112, 97, 116, 10, 32, 51, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 54, 46, 112, 97, 116, 10, 32, 51, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 53, 46, 112, 97, 116, 10, 32, 51, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 52, 46, 112, 97, 116, 10, 32, 51, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 51, 46, 112, 97, 116, 10, 32, 51, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 50, 46, 112, 97, 116, 10, 32, 51, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 49, 46, 112, 97, 116, 10, 32, 51, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 48, 46, 112, 97, 116, 10, 32, 51, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 57, 46, 112, 97, 116, 10, 32, 51, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 56, 46, 112, 97, 116, 10, 32, 52, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 55, 46, 112, 97, 116, 10, 32, 52, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 54, 46, 112, 97, 116, 10, 32, 52, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 53, 46, 112, 97, 116, 10, 32, 52, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 52, 46, 112, 97, 116, 10, 32, 52, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 51, 46, 112, 97, 116, 10, 32, 52, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 50, 46, 112, 97, 116, 10, 32, 52, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 49, 46, 112, 97, 116, 10, 32, 52, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 48, 46, 112, 97, 116, 10, 32, 52, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 57, 46, 112, 97, 116, 10, 32, 52, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 56, 46, 112, 97, 116, 10, 32, 53, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 55, 46, 112, 97, 116, 10, 32, 53, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 54, 46, 112, 97, 116, 10, 32, 53, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 53, 46, 112, 97, 116, 10, 32, 53, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 52, 46, 112, 97, 116, 10, 32, 53, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 51, 46, 112, 97, 116, 10, 32, 53, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 50, 46, 112, 97, 116, 10, 32, 53, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 49, 46, 112, 97, 116, 10, 32, 53, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 48, 46, 112, 97, 116, 10, 32, 53, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 57, 46, 112, 97, 116, 10, 32, 53, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 56, 46, 112, 97, 116, 10, 32, 54, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 55, 46, 112, 97, 116, 10, 32, 54, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 54, 46, 112, 97, 116, 10, 32, 54, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 53, 46, 112, 97, 116, 10, 32, 54, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 52, 46, 112, 97, 116, 10, 32, 54, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 51, 46, 112, 97, 116, 10, 32, 54, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 50, 46, 112, 97, 116, 10, 32, 54, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 49, 46, 112, 97, 116, 10, 32, 54, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 48, 46, 112, 97, 116, 10, 32, 54, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 57, 46, 112, 97, 116, 10, 32, 54, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 56, 46, 112, 97, 116, 10, 32, 55, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 55, 46, 112, 97, 116, 10, 32, 55, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 54, 46, 112, 97, 116, 10, 32, 55, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 53, 46, 112, 97, 116, 10, 32, 55, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 52, 46, 112, 97, 116, 10, 32, 55, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 51, 46, 112, 97, 116, 10, 32, 55, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 50, 46, 112, 97, 116, 10, 32, 55, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 49, 46, 112, 97, 116, 10, 32, 55, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 48, 46, 112, 97, 116, 10, 32, 55, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 57, 46, 112, 97, 116, 10, 32, 55, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 56, 46, 112, 97, 116, 10, 32, 56, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 55, 46, 112, 97, 116, 10, 32, 56, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 54, 46, 112, 97, 116, 10, 32, 56, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 53, 46, 112, 97, 116, 10, 32, 56, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 52, 46, 112, 97, 116, 10, 32, 56, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 51, 46, 112, 97, 116, 10, 32, 56, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 50, 46, 112, 97, 116, 10, 32, 56, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 49, 46, 112, 97, 116, 10, 32, 56, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 48, 46, 112, 97, 116, 10, 32, 56, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 57, 46, 112, 97, 116, 10, 32, 56, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 56, 46, 112, 97, 116, 10, 32, 57, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 55, 46, 112, 97, 116, 10, 32, 57, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 54, 46, 112, 97, 116, 10, 32, 57, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 53, 46, 112, 97, 116, 10, 32, 57, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 52, 46, 112, 97, 116, 10, 32, 57, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 51, 46, 112, 97, 116, 10, 32, 57, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 50, 46, 112, 97, 116, 10, 32, 57, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 49, 46, 112, 97, 116, 10, 32, 57, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 48, 46, 112, 97, 116, 10, 32, 57, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 57, 46, 112, 97, 116, 10, 32, 57, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 56, 46, 112, 97, 116, 10, 32, 49, 48, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 55, 46, 112, 97, 116, 10, 32, 49, 48, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 54, 46, 112, 97, 116, 10, 32, 49, 48, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 53, 46, 112, 97, 116, 10, 32, 49, 48, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 52, 46, 112, 97, 116, 10, 32, 49, 48, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 51, 46, 112, 97, 116, 10, 32, 49, 48, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 50, 46, 112, 97, 116, 10, 32, 49, 48, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 49, 46, 112, 97, 116, 10, 32, 49, 48, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 48, 46, 112, 97, 116, 10, 32, 49, 48, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 57, 46, 112, 97, 116, 10, 32, 49, 48, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 56, 46, 112, 97, 116, 10, 32, 49, 49, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 55, 46, 112, 97, 116, 10, 32, 49, 49, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 54, 46, 112, 97, 116, 10, 32, 49, 49, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 53, 46, 112, 97, 116, 10, 32, 49, 49, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 52, 46, 112, 97, 116, 10, 32, 49, 49, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 51, 46, 112, 97, 116, 10, 32, 49, 49, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 50, 46, 112, 97, 116, 10, 32, 49, 49, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 46, 112, 97, 116, 10, 32, 49, 49, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 46, 112, 97, 116, 10, 32, 49, 49, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 46, 112, 97, 116, 10, 32, 49, 49, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 46, 112, 97, 116, 10, 32, 49, 50, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 46, 112, 97, 116, 10, 32, 49, 50, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 46, 112, 97, 116, 10, 32, 49, 50, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 46, 112, 97, 116, 10, 32, 49, 50, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 46, 112, 97, 116, 10, 32, 49, 50, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 46, 112, 97, 116, 10, 32, 49, 50, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 46, 112, 97, 116, 10, 32, 49, 50, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 46, 112, 97, 116, 10, 32, 49, 50, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 48, 46, 112, 97, 116, 10];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taWRpL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QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUF2SEE7QUFDQTtBQTBIQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///0\n")},function(module,__webpack_exports__,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(0);\n// https://github.com/kripken/emscripten/wiki/\nvar INT_TYPES={i1:0,i8:0,i16:0,i32:0,i64:0};var FLOAT_TYPES={\"float\":0,\"double\":0};/** @class */var LibTiMidity=/**\n * Library to allow the handling of MIDI files.\n * @param {undefined}\n * @return {object} The module of an instance of LibTiMidity.\n */function LibTiMidity(){_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4___default()(this,LibTiMidity);var Runtime={stackSave:function stackSave(){return STACKTOP;},stackRestore:function stackRestore(stackTop){STACKTOP=stackTop;},isNumberType:function isNumberType(type){return type in INT_TYPES||type in FLOAT_TYPES;},isPointerType:function isPointerType(type){return type[type.length-1]=='*';},isStructType:function isStructType(type){if(isPointerType(type))return false;if(isArrayType(type))return true;if(/?/.test(type))return true;// { i32, i8 } etc. - anonymous struct types\n// See comment in isStructPointerType()\nreturn type[0]=='%';},getNativeTypeSize:function getNativeTypeSize(type){switch(type){case'i1':case'i8':return 1;case'i16':return 2;case'i32':return 4;case'i64':return 8;case'float':return 4;case'double':return 8;default:{if(type[type.length-1]==='*'){return Runtime.QUANTUM_SIZE;// A pointer\n}else if(type[0]==='i'){var bits=parseInt(type.substr(1));assert(bits%8===0);return bits/8;}}}},getNativeFieldSize:function getNativeFieldSize(type){return Math.max(Runtime.getNativeTypeSize(type),Runtime.QUANTUM_SIZE);},dedup:function dedup(items,ident){var seen={};if(ident){return items.filter(function(item){if(seen[item[ident]])return false;seen[item[ident]]=true;return true;});}else{return items.filter(function(item){if(seen[item])return false;seen[item]=true;return true;});}},set:function set(){var args=_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_3___default()(arguments[0])==='object'?arguments[0]:arguments;var ret={};for(var i=0;i=0){diffs.push(curr-prev);}prev=curr;return curr;});type.flatSize=Runtime.alignMemory(type.flatSize,type.alignSize);if(diffs.length==0){type.flatFactor=type.flatSize;}else if(Runtime.dedup(diffs).length==1){type.flatFactor=diffs[0];}type.needsFlattening=type.flatFactor!=1;return type.flatIndexes;},generateStructInfo:function generateStructInfo(struct,typeName,offset){var type,alignment;if(typeName){offset=offset||0;type=(typeof Types==='undefined'?Runtime.typeInfo:Types.types)[typeName];if(!type)return null;if(type.fields.length!=struct.length){console.warn('Number of named fields must match the type for '+typeName+': possibly duplicate struct names. Cannot return structInfo');return null;}alignment=type.flatIndexes;}else{var type={fields:struct.map(function(item){return item[0];})};alignment=Runtime.calculateStructAlignment(type);}var ret={__size__:type.flatSize};if(typeName){struct.forEach(function(item,i){if(typeof item==='string'){ret[item]=alignment[i]+offset;}else{// embedded struct\nvar key;for(var k in item){key=k;}ret[key]=Runtime.generateStructInfo(item[key],type.fields[i],alignment[i]);}});}else{struct.forEach(function(item,i){ret[item[1]]=alignment[i];});}return ret;},dynCall:function dynCall(sig,ptr,args){if(args&&args.length){if(!args.splice)args=Array.prototype.slice.call(args);args.splice(0,0,ptr);return Module['dynCall_'+sig].apply(null,args);}else{return Module['dynCall_'+sig].call(null,ptr);}},functionPointers:[],warnOnce:function warnOnce(text){if(!Runtime.warnOnce.shown)Runtime.warnOnce.shown={};if(!Runtime.warnOnce.shown[text]){Runtime.warnOnce.shown[text]=1;console.warn(text);}},funcWrappers:{},UTF8Processor:function UTF8Processor(){var buffer=[];var needed=0;this.processCChar=function(code){code=code&0xff;if(buffer.length==0){if((code&0x80)==0x00){// 0xxxxxxx\nreturn String.fromCharCode(code);}buffer.push(code);if((code&0xe0)==0xc0){// 110xxxxx\nneeded=1;}else if((code&0xf0)==0xe0){// 1110xxxx\nneeded=2;}else{// 11110xxx\nneeded=3;}return'';}if(needed){buffer.push(code);needed--;if(needed>0)return'';}var c1=buffer[0];var c2=buffer[1];var c3=buffer[2];var c4=buffer[3];var ret;if(buffer.length==2){ret=String.fromCharCode((c1&0x1f)<<6|c2&0x3f);}else if(buffer.length==3){ret=String.fromCharCode((c1&0x0f)<<12|(c2&0x3f)<<6|c3&0x3f);}else{// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\nvar codePoint=(c1&0x07)<<18|(c2&0x3f)<<12|(c3&0x3f)<<6|c4&0x3f;ret=String.fromCharCode(Math.floor((codePoint-0x10000)/0x400)+0xd800,(codePoint-0x10000)%0x400+0xdc00);}buffer.length=0;return ret;};this.processJSString=function(string){string=unescape(encodeURIComponent(string));var ret=[];for(var i=0;i=TOTAL_MEMORY)enlargeMemory();return ret;},alignMemory:function alignMemory(size,quantum){var ret=size=Math.ceil(size/(quantum?quantum:8))*(quantum?quantum:8);return ret;},makeBigInt:function makeBigInt(low,high,unsigned){var ret=unsigned?+(low>>>0)+ +(high>>>0)*+4294967296:+(low>>>0)+ +(high|0)*+4294967296;return ret;},GLOBAL_BASE:8,QUANTUM_SIZE:4};var Module={};this.Module=Module;Module.arguments=arguments;if(!Module['arguments']){Module['arguments']=[];}Module.read=function(url){var xhr=new XMLHttpRequest();xhr.open('GET',url,false);xhr.send(null);return xhr.responseText;};Module.print=function(message){console.log(message);};Module.preRun=[];Module.postRun=[];var ABORT=false;// whether we are quitting the application. no code should run after this. set in exit() and abort()\nvar tempI64;function ExitStatus(status){this.name='ExitStatus';this.message='Program terminated with exit('+status+')';this.status=status;}ExitStatus.prototype=new Error();ExitStatus.prototype.constructor=ExitStatus;/**\n * Exits the script.\n * @function exit\n * @memberof LibTiMidity\n * @instance\n * @param {string} status The message to display.\n */function exit(status){ABORT=true;STACKTOP=initialStackTop;// exit the runtime\nexitRuntime();throw new ExitStatus(status);}Module.exit=exit;/**\n * Throws an error that aborts the execution of the script.\n * @function abort\n * @memberof LibTiMidity\n * @instance\n * @param {string} text The message to display.\n */function abort(text){ABORT=true;throw new Error(text).stack;}Module.abort=abort;/**\n * Aborts the execution of the script if assertion fails.\n * @function assert\n * @memberof LibTiMidity\n * @instance\n * @param {boolean} condition The assertion to test.\n * @param {string} text The message to display if the assertion fails.\n */function assert(condition,text){if(!condition){abort(text);}}Module.assert=assert;/**\n * A wrapper to call functions.\n * @function call\n * @memberof LibTiMidity\n * @instance\n * @param {string} ident The name of the function to call.\n * @param {string} returnType The return type of the function, one of the JS types 'number', 'string' or 'array' (use 'number' for any C pointer, and 'array' for JavaScript arrays and typed arrays; note that arrays are 8-bit).\n * @param {array} argTypes An array of the types of arguments for the function (if there are no arguments, this can be ommitted). Types are as in returnType, except that 'array' is not possible (there is no way for us to know the length of the array)\n * @param {array} args An array of the arguments to the function, as native JS values (as in returnType). Note that string arguments will be stored on the stack (the JS string will become a C string on the stack).\n * @return Native JS value (as in returnType)\n */Module.call=function call(ident,returnType,argTypes,args){var func=Module['_'+ident];if(!func){abort(\"Unknown function: \\\"\".concat(ident,\"\\\".\"));}var stack=0;function toC(value,type){if(type=='string'){if(value===null||value===undefined||value===0)return 0;// null string\nvalue=intArrayFromString(value);type='array';}if(type=='array'){if(!stack)stack=Runtime.stackSave();var ret=Runtime.stackAlloc(value.length);writeArrayToMemory(value,ret);return ret;}return value;}function fromC(value,type){if(type=='string'){return Pointer_stringify(value);}assert(type!='array');return value;}var i=0;var cArgs=args?args.map(function(arg){return toC(arg,argTypes[i++]);}):[];var ret=fromC(func.apply(null,cArgs),returnType);if(stack)Runtime.stackRestore(stack);return ret;};/**\n * Dynamically sets a value in memory at runtime. Only does *aligned* writes. This is a lower-level operation.\n * @function setValue\n * @memberof LibTiMidity\n * @instance\n * @param ptr Pointer.\n * @param value\n * @param {string} type LLVM type ('i8', , 'i16', 'i32', 'i64', 'float', 'double')\n */function setValue(ptr,value,type){type=type||'i8';if(type.charAt(type.length-1)==='*')type='i32';// pointers are 32-bit\nswitch(type){case'i1':HEAP8[ptr]=value;break;case'i8':HEAP8[ptr]=value;break;case'i16':HEAP16[ptr>>1]=value;break;case'i32':HEAP32[ptr>>2]=value;break;case'i64':tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=+1?tempDouble>+0?(Math_min(+Math_floor(tempDouble/+4294967296),+4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/+4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case'float':HEAPF32[ptr>>2]=value;break;case'double':HEAPF64[ptr>>3]=value;break;default:abort('invalid type for setValue: '+type);}}Module.setValue=setValue;/**\n * Dynamically gets a value in memory at runtime. Only does *aligned* reads. This is a lower-level operation.\n * @function getValue\n * @memberof LibTiMidity\n * @instance\n * @param ptr Pointer.\n * @param {string} type LLVM type ('i8', , 'i16', 'i32', 'i64', 'float', 'double')\n */function getValue(ptr,type){type=type||'i8';if(type.charAt(type.length-1)==='*')type='i32';// pointers are 32-bit\nswitch(type){case'i1':return HEAP8[ptr];case'i8':return HEAP8[ptr];case'i16':return HEAP16[ptr>>1];case'i32':return HEAP32[ptr>>2];case'i64':return HEAP32[ptr>>2];case'float':return HEAPF32[ptr>>2];case'double':return HEAPF64[ptr>>3];default:abort('invalid type for getValue: '+type);}return null;}Module['getValue']=getValue;var ALLOC_NORMAL=0;// Tries to use _malloc()\nvar ALLOC_STACK=1;// Lives for the duration of the current function call\nvar ALLOC_STATIC=2;// Cannot be freed\nvar ALLOC_DYNAMIC=3;// Cannot be freed except through sbrk\nvar ALLOC_NONE=4;// Do not allocate\nModule['ALLOC_NORMAL']=ALLOC_NORMAL;Module['ALLOC_STACK']=ALLOC_STACK;Module['ALLOC_STATIC']=ALLOC_STATIC;Module['ALLOC_DYNAMIC']=ALLOC_DYNAMIC;Module['ALLOC_NONE']=ALLOC_NONE;/**\n * This is for internal use. Optimized for multiple syntaxes to save space in generated code. You should allocate memory using _malloc(), initialize it with setValue(), and so forth.\n * @function allocate\n * @memberof LibTiMidity\n * @instance\n * @param slab An array of data or a number. If a number, then the size of the block to allocate in *bytes* (note that this is sometimes confusing: the next parameter does not affect this).\n * @param types Either an array of types, one for each byte (or 0 if no type at that position), or a single type which is used for the entire block. This only matters if there is initial data. If slab is a number, then this does not matter at all and is ignored.\n * @param allocator How to allocate memory, see ALLOC_*\n */function allocate(slab,types,allocator,ptr){var zeroinit,size;if(typeof slab==='number'){zeroinit=true;size=slab;}else{zeroinit=false;size=slab.length;}var singleType=typeof types==='string'?types:null;var ret;if(allocator==ALLOC_NONE){ret=ptr;}else{ret=[_malloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][allocator===undefined?ALLOC_STATIC:allocator](Math.max(size,singleType?1:types.length));}if(zeroinit){var ptr=ret,stop;assert((ret&3)==0);stop=ret+(size&~3);for(;ptr>2]=0;}stop=ret+size;while(ptr=128)hasUtf=true;else if(t==0&&!length)break;i++;if(length&&i==length)break;}if(!length)length=i;var ret='';if(!hasUtf){var MAX_CHUNK=1024;// split up into chunks, because .apply on a huge string can overflow the stack\nvar curr;while(length>0){curr=String.fromCharCode.apply(String,HEAPU8.subarray(ptr,ptr+Math.min(length,MAX_CHUNK)));ret=ret?ret+curr:curr;ptr+=MAX_CHUNK;length-=MAX_CHUNK;}return ret;}var utf8=new Runtime.UTF8Processor();for(i=0;i>1];if(codeUnit==0)return str;++i;// fromCharCode constructs a character from a UTF-16 code unit, so we can pass the UTF16 string right through.\nstr+=String.fromCharCode(codeUnit);}}Module['UTF16ToString']=UTF16ToString;/**\n * Copies a JavaScript string to the emscripten HEAP. The copy is null-terminated and encoded in UTF16LE form. The copy will require at most (str.length*2+1)*2 bytes of space in the HEAP.\n * @function stringToUTF16\n * @memberof LibTiMidity\n * @instance\n * @param {string} str JavaScript string.\n * @param outPtr HEAP address (pointer).\n */function stringToUTF16(str,outPtr){for(var i=0;i>1]=codeUnit;}// Null-terminate the pointer to the HEAP.\nHEAP16[outPtr+str.length*2>>1]=0;}Module['stringToUTF16']=stringToUTF16;/**\n * @function UTF32ToString\n * @memberof LibTiMidity\n * @instance\n * @param ptr Pointer to a null-terminated UTF32LE-encoded string in the emscripten HEAP.\n * @return\n */function UTF32ToString(ptr){var i=0;var str='';while(1){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)return str;++i;// Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing.\nif(utf32>=0x10000){var ch=utf32-0x10000;str+=String.fromCharCode(0xd800|ch>>10,0xdc00|ch&0x3ff);}else{str+=String.fromCharCode(utf32);}}}Module['UTF32ToString']=UTF32ToString;/**\n * Copies a JavaScript string to the emscripten HEAP. The copy is null-terminated and encoded in UTF32LE form. The copy will require at most (str.length+1)*4 bytes of space in the HEAP.\n * @function stringToUTF32\n * @memberof LibTiMidity\n * @instance\n * @param {string} str JavaScript string.\n * @param outPtr HEAP address (pointer).\n */function stringToUTF32(str,outPtr){var iChar=0;for(var iCodeUnit=0;iCodeUnit=0xd800&&codeUnit<=0xdfff){var trailSurrogate=str.charCodeAt(++iCodeUnit);codeUnit=0x10000+((codeUnit&0x3ff)<<10)|trailSurrogate&0x3ff;}HEAP32[outPtr+iChar*4>>2]=codeUnit;++iChar;}// Null-terminate the pointer to the HEAP.\nHEAP32[outPtr+iChar*4>>2]=0;}Module['stringToUTF32']=stringToUTF32;// Memory management\nvar PAGE_SIZE=4096;function alignMemoryPage(x){return x+4095&-4096;}var HEAP;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;var STATIC_BASE=0,STATICTOP=0;var STACK_BASE=0,STACKTOP=0,STACK_MAX=0;// stack area\nvar DYNAMIC_BASE=0,DYNAMICTOP=0;// dynamic area handled by sbrk\nfunction enlargeMemory(){abort('Cannot enlarge memory arrays in asm.js. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value '+TOTAL_MEMORY+', or (2) set Module.TOTAL_MEMORY before the program runs.');}Module['TOTAL_STACK']||5242880;var TOTAL_MEMORY=Module['TOTAL_MEMORY']||67108864;Module['FAST_MEMORY']||2097152;// Initialize the runtime's memory\n// check for full engine support (use string 'subarray' to avoid closure compiler confusion)\nassert(typeof Int32Array!=='undefined'&&typeof Float64Array!=='undefined'&&!!new Int32Array(1)['subarray']&&!!new Int32Array(1)['set'],'Cannot fallback to non-typed array case: Code is too specialized');var buffer=new ArrayBuffer(TOTAL_MEMORY);HEAP8=new Int8Array(buffer);HEAP16=new Int16Array(buffer);HEAP32=new Int32Array(buffer);HEAPU8=new Uint8Array(buffer);HEAPU16=new Uint16Array(buffer);HEAPU32=new Uint32Array(buffer);HEAPF32=new Float32Array(buffer);HEAPF64=new Float64Array(buffer);// Endianness check (note: assumes compiler arch was little-endian)\nHEAP32[0]=255;assert(HEAPU8[0]===255&&HEAPU8[3]===0,'Typed arrays 2 must be run on a little-endian system');Module['HEAP']=HEAP;Module['HEAP8']=HEAP8;Module['HEAP16']=HEAP16;Module['HEAP32']=HEAP32;Module['HEAPU8']=HEAPU8;Module['HEAPU16']=HEAPU16;Module['HEAPU32']=HEAPU32;Module['HEAPF32']=HEAPF32;Module['HEAPF64']=HEAPF64;/**\n * @function callRuntimeCallbacks\n * @memberof LibTiMidity\n * @instance\n * @param callbacks\n */function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=='function'){callback();continue;}var func=callback.func;if(typeof func==='number'){if(callback.arg===undefined){Runtime.dynCall('v',func);}else{Runtime.dynCall('vi',func,[callback.arg]);}}else{func(callback.arg===undefined?null:callback.arg);}}}var __ATPRERUN__=[];// functions called before the runtime is initialized\nvar __ATINIT__=[];// functions called during startup\nvar __ATMAIN__=[];// functions called when main() is to be run\nvar __ATEXIT__=[];// functions called during shutdown\nvar __ATPOSTRUN__=[];// functions called after the runtime has exited\nvar runtimeInitialized=false;function preRun(){// compatibility - merge in anything from Module['preRun'] at this time\nif(Module['preRun']){if(typeof Module['preRun']=='function')Module['preRun']=[Module['preRun']];while(Module['preRun'].length){addOnPreRun(Module['preRun'].shift());}}callRuntimeCallbacks(__ATPRERUN__);}function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__);}function preMain(){callRuntimeCallbacks(__ATMAIN__);}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__);}function postRun(){// compatibility - merge in anything from Module['postRun'] at this time\nif(Module['postRun']){if(typeof Module['postRun']=='function')Module['postRun']=[Module['postRun']];while(Module['postRun'].length){addOnPostRun(Module['postRun'].shift());}}callRuntimeCallbacks(__ATPOSTRUN__);}/**\n * @function addOnPreRun\n * @memberof LibTiMidity\n * @instance\n * @param cb Callback.\n */function addOnPreRun(cb){__ATPRERUN__.unshift(cb);}Module['addOnPreRun']=Module.addOnPreRun=addOnPreRun;/**\n * @function addOnInit\n * @memberof LibTiMidity\n * @instance\n * @param cb Callback.\n */function addOnInit(cb){__ATINIT__.unshift(cb);}Module['addOnInit']=addOnInit;/**\n * @function addOnPreMain\n * @memberof LibTiMidity\n * @instance\n * @param cb Callback.\n */function addOnPreMain(cb){__ATMAIN__.unshift(cb);}Module['addOnPreMain']=addOnPreMain;/**\n * @function addOnExit\n * @memberof LibTiMidity\n * @instance\n * @param cb Callback.\n */function addOnExit(cb){__ATEXIT__.unshift(cb);}Module['addOnExit']=addOnExit;/**\n * @function addOnPostRun\n * @memberof LibTiMidity\n * @instance\n * @param cb Callback.\n */function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb);}Module['addOnPostRun']=addOnPostRun;/**\n * @function intArrayFromString\n * @memberof LibTiMidity\n * @instance\n * @param stringy\n * @param dontAddNull\n * @param length\n */ // Tools\n// This processes a JS string into a C-line array of numbers, 0-terminated.\n// For LLVM-originating strings, see parser.js:parseLLVMString function\nfunction intArrayFromString(stringy,dontAddNull,length/* optional */){var ret=new Runtime.UTF8Processor().processJSString(stringy);if(length){ret.length=length;}if(!dontAddNull){ret.push(0);}return ret;}Module['intArrayFromString']=intArrayFromString;/**\n * @function intArrayToString\n * @memberof LibTiMidity\n * @instance\n * @param array\n */function intArrayToString(array){var ret=[];for(var i=0;i0xff){chr&=0xff;}ret.push(String.fromCharCode(chr));}return ret.join('');}Module['intArrayToString']=intArrayToString;/**\n * @function writeStringToMemory\n * @memberof LibTiMidity\n * @instance\n * @param string\n * @param buffer\n * @param dontAddNull\n */ // Write a Javascript array to somewhere in the heap\nfunction writeStringToMemory(string,buffer,dontAddNull){var array=intArrayFromString(string,dontAddNull);var i=0;while(i=0){return value;}return bits<=32?2*Math.abs(1<=half&&(bits<=32||value>half)){// for huge values, we can hit the precision limit and always get true here. so don't do that\n// but, in general there is no perfect solution here. With 64-bit ints, we get rounding and errors\n// TODO: In i64 mode 1, resign the two parts separately and safely\nvalue=-2*half+value;// Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts\n}return value;}if(!Math['imul'])Math['imul']=function(a,b){var ah=a>>>16;var al=a&0xffff;var bh=b>>>16;var bl=b&0xffff;return al*bl+(ah*bl+al*bh<<16)|0;};Math.imul=Math['imul'];var Math_abs=Math.abs;var Math_sin=Math.sin;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_pow=Math.pow;var Math_min=Math.min;// A counter of dependencies for calling run(). If we need to\n// do asynchronous work before running, increment this and\n// decrement it. Incrementing must happen in a place like\n// PRE_RUN_ADDITIONS (used by emcc to add file preloading).\n// Note that you can add dependencies in preRun, even though\n// it happens right before run - run will be postponed until\n// the dependencies are met.\nvar runDependencies=0;var runDependencyTracking={};var runDependencyWatcher=null;var dependenciesFulfilled=null;// overridden to take different actions when all run dependencies are fulfilled\nfunction addRunDependency(id){runDependencies++;if(Module['monitorRunDependencies']){Module['monitorRunDependencies'](runDependencies);}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;}else{console.warn('warning: run dependency added without ID');}}Module['addRunDependency']=addRunDependency;function removeRunDependency(id){runDependencies--;if(Module['monitorRunDependencies']){Module['monitorRunDependencies'](runDependencies);}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id];}else{console.warn('warning: run dependency removed without ID');}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null;}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback();// can add another dependenciesFulfilled\n}}}Module['removeRunDependency']=removeRunDependency;Module['preloadedImages']={};// maps url to image data\nModule['preloadedAudios']={};// maps url to audio data\nvar memoryInitializer=null;// === Body ===\nSTATIC_BASE=8;STATICTOP=STATIC_BASE+8448;/* global initializers */__ATINIT__.push({func:function func(){runPostSets();}});var _stderr;var _stderr=_stderr=allocate([0,0,0,0,0,0,0,0],'i8',ALLOC_STATIC);/* memory initializer */ // prettier-ignore\nallocate([0,0,0,0,0,0,144,63,75,191,53,65,90,136,144,63,241,46,189,130,62,21,145,63,249,198,51,115,211,166,145,63,194,109,221,10,65,61,146,63,61,194,157,150,176,216,146,63,232,234,78,195,76,121,147,63,204,6,121,169,65,31,148,63,172,119,109,217,188,202,148,63,136,88,201,103,237,123,149,63,154,143,98,250,3,51,150,63,89,8,163,213,50,240,150,63,69,192,85,234,173,179,151,63,98,112,233,227,170,125,152,63,242,189,44,55,97,78,153,63,189,253,135,49,10,38,154,63,84,184,184,8,225,4,155,63,232,64,19,235,34,235,155,63,101,213,78,16,15,217,156,63,82,228,224,202,230,206,157,63,110,60,236,153,237,204,158,63,149,18,201,59,105,211,159,63,39,122,149,224,80,113,160,63,129,244,116,208,112,253,160,63,39,24,58,230,58,142,161,63,74,29,119,226,214,35,162,63,50,84,131,216,109,190,162,63,137,39,194,57,42,94,163,63,195,57,74,225,55,3,164,63,225,208,239,31,196,173,164,63,141,222,181,200,253,93,165,63,62,15,169,61,21,20,166,63,223,103,40,125,60,208,166,63,155,23,159,47,167,146,167,63,148,66,179,181,138,91,168,63,80,170,237,54,30,43,169,63,237,57,222,176,154,1,170,63,104,158,193,6,59,223,170,63,182,54,172,17,60,196,171,63,248,203,62,177,220,176,172,63,49,168,233,220,93,165,173,63,115,200,194,181,2,162,174,63,108,16,244,152,16,167,175,63,78,71,99,153,103,90,176,63,213,5,40,73,196,229,176,63,17,38,228,158,196,117,177,63,185,204,197,35,144,10,178,63,128,43,232,177,79,164,178,63,152,204,138,127,45,67,179,63,121,115,168,42,85,231,179,63,129,193,240,196,243,144,180,63,19,232,39,224,55,64,181,63,242,205,239,154,81,245,181,63,121,42,254,173,114,176,182,63,62,55,195,121,206,113,183,63,150,183,132,20,154,57,184,63,124,53,241,88,12,8,185,63,40,116,47,245,93,221,185,63,234,58,110,122,201,185,186,63,0,190,248,108,139,157,187,63,185,15,212,84,226,136,188,63,119,41,234,206,14,124,189,63,90,67,199,158,83,119,190,63,113,89,238,192,245,122,191,63,90,243,228,62,158,67,192,63,134,4,159,190,56,206,192,63,250,182,112,109,112,93,193,63,134,74,113,157,108,241,193,63,158,146,207,239,85,138,194,63,241,160,249,95,86,40,195,63,53,128,35,79,153,203,195,63,8,41,48,144,75,116,196,63,52,246,255,115,155,34,197,63,60,249,39,214,184,214,197,63,231,172,21,42,213,144,198,63,103,161,162,136,35,81,199,63,64,220,27,190,216,23,200,63,253,197,192,88,43,229,200,63,169,160,189,183,83,185,201,63,151,163,165,26,140,148,202,63,112,252,112,177,16,119,203,63,132,25,3,173,31,97,204,63,196,198,61,80,249,82,205,63,129,205,165,1,224,76,206,63,12,239,157,93,24,79,207,63,179,157,158,164,244,44,208,63,24,248,226,2,206,182,208,63,221,27,97,34,62,69,209,63,241,38,102,30,108,216,209,63,184,223,131,95,128,112,210,63,143,212,168,166,164,13,211,63,246,6,151,24,4,176,211,63,25,72,188,73,203,87,212,63,38,135,111,74,40,5,213,63,234,109,150,179,74,184,213,63,94,196,182,179,99,113,214,63,191,49,119,28,166,48,215,63,64,16,147,112,70,246,215,63,245,39,69,242,122,194,216,63,68,70,45,178,123,149,217,63,234,200,180,158,130,111,218,63,100,86,246,147,203,80,219,63,204,33,45,108,148,57,220,63,17,61,176,16,29,42,221,63,59,163,126,139,167,34,222,63,13,204,96,25,120,35,223,63,161,97,82,158,106,22,224,63,42,244,60,232,131,159,224,63,162,211,120,142,45,45,225,63,38,84,213,117,142,191,225,63,187,17,150,206,206,86,226,63,84,154,123,31,24,243,226,63,218,31,42,81,149,148,227,63,89,83,241,185,114,59,228,63,111,165,248,41,222,231,228,63,145,67,211,247,6,154,229,63,32,70,127,13,30,82,230,63,216,160,211,245,85,16,231,63,137,133,96,234,226,212,231,63,76,8,198,225,250,159,232,63,27,245,132,158,213,113,233,63,9,232,77,190,172,74,234,63,44,220,210,201,187,42,235,63,254,136,31,69,64,18,236,63,11,11,125,192,121,1,237,63,244,122,229,233,169,248,237,63,130,61,12,159,20,248,238,63,0,0,0,0,0,0,240,63,0,0,128,63,0,0,0,0,0,0,220,67,0,0,0,0,168,25,0,0,0,0,0,0,240,31,0,0,214,33,0,0,217,35,0,0,251,37,0,0,61,40,0,0,161,42,0,0,42,45,0,0,218,47,0,0,178,50,0,0,182,53,0,0,232,56,0,0,74,60,0,0,224,63,0,0,172,67,0,0,178,71,0,0,245,75,0,0,122,80,0,0,67,85,0,0,85,90,0,0,180,95,0,0,101,101,0,0,108,107,0,0,207,113,0,0,148,120,0,0,191,127,0,0,88,135,0,0,100,143,0,0,235,151,0,0,243,160,0,0,134,170,0,0,169,180,0,0,103,191,0,0,201,202,0,0,216,214,0,0,158,227,0,0,39,241,0,0,126,255,0,0,176,14,1,0,200,30,1,0,214,47,1,0,231,65,1,0,11,85,1,0,83,105,1,0,207,126,1,0,146,149,1,0,176,173,1,0,61,199,1,0,79,226,1,0,253,254,1,0,95,29,2,0,144,61,2,0,171,95,2,0,206,131,2,0,22,170,2,0,165,210,2,0,158,253,2,0,36,43,3,0,96,91,3,0,122,142,3,0,158,196,3,0,250,253,3,0,191,58,4,0,33,123,4,0,87,191,4,0,156,7,5,0,44,84,5,0,74,165,5,0,59,251,5,0,73,86,6,0,192,182,6,0,244,28,7,0,59,137,7,0,243,251,7,0,125,117,8,0,66,246,8,0,174,126,9,0,55,15,10,0,88,168,10,0,149,74,11,0,119,246,11,0,145,172,12,0,128,109,13,0,232,57,14,0,119,18,15,0,230,247,15,0,251,234,16,0,131,236,17,0,92,253,18,0,110,30,20,0,177,80,21,0,42,149,22,0,238,236,23,0,35,89,25,0,0,219,26,0,207,115,28,0,237,36,30,0,205,239,31,0,245,213,33,0,6,217,35,0,184,250,37,0,220,60,40,0,98,161,42,0,83,42,45,0,219,217,47,0,70,178,50,0,0,182,53,0,158,231,56,0,218,73,60,0,153,223,63,0,234,171,67,0,12,178,71,0,112,245,75,0,185,121,80,0,196,66,85,0,167,84,90,0,183,179,95,0,139,100,101,0,0,108,107,0,60,207,113,0,181,147,120,0,50,191,127,0,212,87,135,0,25,100,143,0,223,234,151,0,114,243,160,0,135,133,170,0,78,169,180,0,110,103,191,0,32,161,7,0,0,0,0,0,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,240,63,113,93,245,158,236,0,240,63,84,18,150,75,217,1,240,63,207,232,226,5,198,2,240,63,21,171,220,205,178,3,240,63,102,35,132,163,159,4,240,63,10,28,218,134,140,5,240,63,88,95,223,119,121,6,240,63,177,183,148,118,102,7,240,63,131,239,250,130,83,8,240,63,70,209,18,157,64,9,240,63,127,39,221,196,45,10,240,63,191,188,90,250,26,11,240,63,160,91,140,61,8,12,240,63,204,206,114,142,245,12,240,63,245,224,14,237,226,13,240,63,218,92,97,89,208,14,240,63,71,13,107,211,189,15,240,63,17,189,44,91,171,16,240,63,28,55,167,240,152,17,240,63,85,70,219,147,134,18,240,63,181,181,201,68,116,19,240,63,66,80,115,3,98,20,240,63,14,225,216,207,79,21,240,63,53,51,251,169,61,22,240,63,224,17,219,145,43,23,240,63,68,72,121,135,25,24,240,63,159,161,214,138,7,25,240,63,63,233,243,155,245,25,240,63,122,234,209,186,227,26,240,63,180,112,113,231,209,27,240,63,93,71,211,33,192,28,240,63,238,57,248,105,174,29,240,63,239,19,225,191,156,30,240,63,242,160,142,35,139,31,240,63,148,172,1,149,121,32,240,63,129,2,59,20,104,33,240,63,109,110,59,161,86,34,240,63,26,188,3,60,69,35,240,63,85,183,148,228,51,36,240,63,247,43,239,154,34,37,240,63,228,229,19,95,17,38,240,63,14,177,3,49,0,39,240,63,112,89,191,16,239,39,240,63,19,171,71,254,221,40,240,63,10,114,157,249,204,41,240,63,117,122,193,2,188,42,240,63,128,144,180,25,171,43,240,63,97,128,119,62,154,44,240,63,92,22,11,113,137,45,240,63,191,30,112,177,120,46,240,63,230,101,167,255,103,47,240,63,54,184,177,91,87,48,240,63,34,226,143,197,70,49,240,63,39,176,66,61,54,50,240,63,209,238,202,194,37,51,240,63,180,106,41,86,21,52,240,63,113,240,94,247,4,53,240,63,183,76,108,166,244,53,240,63,63,76,82,99,228,54,240,63,204,187,17,46,212,55,240,63,49,104,171,6,196,56,240,63,73,30,32,237,179,57,240,63,254,170,112,225,163,58,240,63,67,219,157,227,147,59,240,63,24,124,168,243,131,60,240,63,138,90,145,17,116,61,240,63,177,67,89,61,100,62,240,63,176,4,1,119,84,63,240,63,182,106,137,190,68,64,240,63,0,67,243,19,53,65,240,63,212,90,63,119,37,66,240,63,133,127,110,232,21,67,240,63,114,126,129,103,6,68,240,63,7,37,121,244,246,68,240,63,185,64,86,143,231,69,240,63,12,159,25,56,216,70,240,63,141,13,196,238,200,71,240,63,216,89,86,179,185,72,240,63,146,81,209,133,170,73,240,63,109,194,53,102,155,74,240,63,40,122,132,84,140,75,240,63,140,70,190,80,125,76,240,63,110,245,227,90,110,77,240,63,177,84,246,114,95,78,240,63,66,50,246,152,80,79,240,63,26,92,228,204,65,80,240,63,63,160,193,14,51,81,240,63,194,204,142,94,36,82,240,63,192,175,76,188,21,83,240,63,98,23,252,39,7,84,240,63,220,209,157,161,248,84,240,63,112,173,50,41,234,85,240,63,107,120,187,190,219,86,240,63,37,1,57,98,205,87,240,63,2,22,172,19,191,88,240,63,116,133,21,211,176,89,240,63,247,29,118,160,162,90,240,63,18,174,206,123,148,91,240,63,91,4,32,101,134,92,240,63,113,239,106,92,120,93,240,63,1,62,176,97,106,94,240,63,194,190,240,116,92,95,240,63,122,64,45,150,78,96,240,63,247,145,102,197,64,97,240,63,22,130,157,2,51,98,240,63,191,223,210,77,37,99,240,63,229,121,7,167,23,100,240,63,137,31,60,14,10,101,240,63,181,159,113,131,252,101,240,63,130,201,168,6,239,102,240,63,20,108,226,151,225,103,240,63,154,86,31,55,212,104,240,63,79,88,96,228,198,105,240,63,124,64,166,159,185,106,240,63,115,222,241,104,172,107,240,63,149,1,68,64,159,108,240,63,77,121,157,37,146,109,240,63,18,21,255,24,133,110,240,63,104,164,105,26,120,111,240,63,222,246,221,41,107,112,240,63,16,220,92,71,94,113,240,63,165,35,231,114,81,114,240,63,81,157,125,172,68,115,240,63,211,24,33,244,55,116,240,63,246,101,210,73,43,117,240,63,147,84,146,173,30,118,240,63,140,180,97,31,18,119,240,63,209,85,65,159,5,120,240,63,93,8,50,45,249,120,240,63,57,156,52,201,236,121,240,63,118,225,73,115,224,122,240,63,54,168,114,43,212,123,240,63,163,192,175,241,199,124,240,63,246,250,1,198,187,125,240,63,113,39,106,168,175,126,240,63,101,22,233,152,163,127,240,63,44,152,127,151,151,128,240,63,48,125,46,164,139,129,240,63,226,149,246,190,127,130,240,63,197,178,216,231,115,131,240,63,98,164,213,30,104,132,240,63,82,59,238,99,92,133,240,63,58,72,35,183,80,134,240,63,200,155,117,24,69,135,240,63,185,6,230,135,57,136,240,63,214,89,117,5,46,137,240,63,242,101,36,145,34,138,240,63,237,251,243,42,23,139,240,63,180,236,228,210,11,140,240,63,63,9,248,136,0,141,240,63,147,34,46,77,245,141,240,63,192,9,136,31,234,142,240,63,226,143,6,0,223,143,240,63,35,134,170,238,211,144,240,63,184,189,116,235,200,145,240,63,224,7,102,246,189,146,240,63,233,53,127,15,179,147,240,63,44,25,193,54,168,148,240,63,13,131,44,108,157,149,240,63,0,69,194,175,146,150,240,63,127,48,131,1,136,151,240,63,22,23,112,97,125,152,240,63,89,202,137,207,114,153,240,63,234,27,209,75,104,154,240,63,119,221,70,214,93,155,240,63,185,224,235,110,83,156,240,63,119,247,192,21,73,157,240,63,131,243,198,202,62,158,240,63,187,166,254,141,52,159,240,63,9,227,104,95,42,160,240,63,99,122,6,63,32,161,240,63,205,62,216,44,22,162,240,63,85,2,223,40,12,163,240,63,21,151,27,51,2,164,240,63,53,207,142,75,248,164,240,63,233,124,57,114,238,165,240,63,110,114,28,167,228,166,240,63,17,130,56,234,218,167,240,63,40,126,142,59,209,168,240,63,25,57,31,155,199,169,240,63,83,133,235,8,190,170,240,63,81,53,244,132,180,171,240,63,156,27,58,15,171,172,240,63,200,10,190,167,161,173,240,63,118,213,128,78,152,174,240,63,82,78,131,3,143,175,240,63,22,72,198,198,133,176,240,63,134,149,74,152,124,177,240,63,116,9,17,120,115,178,240,63,188,118,26,102,106,179,240,63,73,176,103,98,97,180,240,63,15,137,249,108,88,181,240,63,18,212,208,133,79,182,240,63,95,100,238,172,70,183,240,63,17,13,83,226,61,184,240,63,78,161,255,37,53,185,240,63,72,244,244,119,44,186,240,63,63,217,51,216,35,187,240,63,125,35,189,70,27,188,240,63,91,166,145,195,18,189,240,63,59,53,178,78,10,190,240,63,142,163,31,232,1,191,240,63,206,196,218,143,249,191,240,63,133,108,228,69,241,192,240,63,71,110,61,10,233,193,240,63,180,157,230,220,224,194,240,63,122,206,224,189,216,195,240,63,80,212,44,173,208,196,240,63,253,130,203,170,200,197,240,63,83,174,189,182,192,198,240,63,46,42,4,209,184,199,240,63,121,202,159,249,176,200,240,63,42,99,145,48,169,201,240,63,67,200,217,117,161,202,240,63,212,205,121,201,153,203,240,63,247,71,114,43,146,204,240,63,212,10,196,155,138,205,240,63,158,234,111,26,131,206,240,63,148,187,118,167,123,207,240,63,3,82,217,66,116,208,240,63,68,130,152,236,108,209,240,63,186,32,181,164,101,210,240,63,214,1,48,107,94,211,240,63,22,250,9,64,87,212,240,63,2,222,67,35,80,213,240,63,50,130,222,20,73,214,240,63,69,187,218,20,66,215,240,63,236,93,57,35,59,216,240,63,223,62,251,63,52,217,240,63,230,50,33,107,45,218,240,63,213,14,172,164,38,219,240,63,137,167,156,236,31,220,240,63,240,209,243,66,25,221,240,63,0,99,178,167,18,222,240,63,191,47,217,26,12,223,240,63,61,13,105,156,5,224,240,63,150,208,98,44,255,224,240,63,245,78,199,202,248,225,240,63,141,93,151,119,242,226,240,63,162,209,211,50,236,227,240,63,129,128,125,252,229,228,240,63,133,63,149,212,223,229,240,63,21,228,27,187,217,230,240,63,163,67,18,176,211,231,240,63,176,51,121,179,205,232,240,63,198,137,81,197,199,233,240,63,127,27,156,229,193,234,240,63,126,190,89,20,188,235,240,63,116,72,139,81,182,236,240,63,31,143,49,157,176,237,240,63,72,104,77,247,170,238,240,63,197,169,223,95,165,239,240,63,119,41,233,214,159,240,240,63,79,189,106,92,154,241,240,63,69,59,101,240,148,242,240,63,0,0,0,0,0,0,240,63,99,121,217,146,143,243,240,63,192,214,199,195,154,245,241,63,21,183,49,10,254,6,243,63,139,114,141,249,162,40,244,63,94,236,240,8,129,91,245,63,205,59,127,102,158,160,246,63,176,207,104,215,16,249,247,63,60,110,61,165,254,101,249,63,173,211,90,153,159,232,250,63,41,193,78,7,62,130,252,63,67,19,16,231,55,52,254,63,0,0,0,0,0,0,0,64,99,121,217,146,143,243,0,64,192,214,199,195,154,245,1,64,21,183,49,10,254,6,3,64,139,114,141,249,162,40,4,64,94,236,240,8,129,91,5,64,205,59,127,102,158,160,6,64,176,207,104,215,16,249,7,64,61,110,61,165,254,101,9,64,173,211,90,153,159,232,10,64,41,193,78,7,62,130,12,64,68,19,16,231,55,52,14,64,0,0,0,0,0,0,16,64,99,121,217,146,143,243,16,64,191,214,199,195,154,245,17,64,21,183,49,10,254,6,19,64,139,114,141,249,162,40,20,64,93,236,240,8,129,91,21,64,205,59,127,102,158,160,22,64,177,207,104,215,16,249,23,64,60,110,61,165,254,101,25,64,173,211,90,153,159,232,26,64,42,193,78,7,62,130,28,64,67,19,16,231,55,52,30,64,0,0,0,0,0,0,32,64,99,121,217,146,143,243,32,64,191,214,199,195,154,245,33,64,21,183,49,10,254,6,35,64,139,114,141,249,162,40,36,64,93,236,240,8,129,91,37,64,205,59,127,102,158,160,38,64,177,207,104,215,16,249,39,64,60,110,61,165,254,101,41,64,173,211,90,153,159,232,42,64,42,193,78,7,62,130,44,64,67,19,16,231,55,52,46,64,0,0,0,0,0,0,48,64,98,121,217,146,143,243,48,64,193,214,199,195,154,245,49,64,21,183,49,10,254,6,51,64,138,114,141,249,162,40,52,64,95,236,240,8,129,91,53,64,205,59,127,102,158,160,54,64,175,207,104,215,16,249,55,64,62,110,61,165,254,101,57,64,173,211,90,153,159,232,58,64,40,193,78,7,62,130,60,64,69,19,16,231,55,52,62,64,0,0,0,0,0,0,64,64,98,121,217,146,143,243,64,64,193,214,199,195,154,245,65,64,21,183,49,10,254,6,67,64,138,114,141,249,162,40,68,64,95,236,240,8,129,91,69,64,205,59,127,102,158,160,70,64,175,207,104,215,16,249,71,64,62,110,61,165,254,101,73,64,173,211,90,153,159,232,74,64,40,193,78,7,62,130,76,64,69,19,16,231,55,52,78,64,0,0,0,0,0,0,80,64,98,121,217,146,143,243,80,64,193,214,199,195,154,245,81,64,21,183,49,10,254,6,83,64,138,114,141,249,162,40,84,64,95,236,240,8,129,91,85,64,205,59,127,102,158,160,86,64,175,207,104,215,16,249,87,64,62,110,61,165,254,101,89,64,173,211,90,153,159,232,90,64,40,193,78,7,62,130,92,64,69,19,16,231,55,52,94,64,0,0,0,0,0,0,96,64,98,121,217,146,143,243,96,64,193,214,199,195,154,245,97,64,21,183,49,10,254,6,99,64,138,114,141,249,162,40,100,64,95,236,240,8,129,91,101,64,205,59,127,102,158,160,102,64,175,207,104,215,16,249,103,64,62,110,61,165,254,101,105,64,173,211,90,153,159,232,106,64,40,193,78,7,62,130,108,64,69,19,16,231,55,52,110,64,0,0,0,0,0,0,112,64,101,121,217,146,143,243,112,64,190,214,199,195,154,245,113,64,21,183,49,10,254,6,115,64,141,114,141,249,162,40,116,64,92,236,240,8,129,91,117,64,205,59,127,102,158,160,118,64,179,207,104,215,16,249,119,64,58,110,61,165,254,101,121,64,173,211,90,153,159,232,122,64,45,193,78,7,62,130,124,64,64,19,16,231,55,52,126,64,0,0,0,0,0,0,128,64,101,121,217,146,143,243,128,64,190,214,199,195,154,245,129,64,21,183,49,10,254,6,131,64,141,114,141,249,162,40,132,64,92,236,240,8,129,91,133,64,205,59,127,102,158,160,134,64,179,207,104,215,16,249,135,64,58,110,61,165,254,101,137,64,173,211,90,153,159,232,138,64,45,193,78,7,62,130,140,64,64,19,16,231,55,52,142,64,0,0,0,0,0,0,144,64,101,121,217,146,143,243,144,64,190,214,199,195,154,245,145,64,21,183,49,10,254,6,147,64,141,114,141,249,162,40,148,64,92,236,240,8,129,91,149,64,205,59,127,102,158,160,150,64,179,207,104,215,16,249,151,64,77,84,104,100,0,0,0,0,86,101,108,111,99,105,116,121,32,37,100,32,37,100,10,0,70,84,80,112,114,111,120,121,0,0,0,0,0,0,0,0,72,84,84,80,112,114,111,120,121,0,0,0,0,0,0,0,99,111,109,109,0,0,0,0,35,101,120,116,101,110,115,105,111,110,0,0,0,0,0,0,78,117,109,32,77,105,115,115,105,110,103,32,112,97,116,99,104,101,115,58,32,37,100,10,0,0,0,0,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,115,116,114,105,112,32,109,117,115,116,32,98,101,32,101,110,118,44,32,108,111,111,112,44,32,111,114,32,116,97,105,108,10,0,0,116,97,105,108,0,0,0,0,115,116,114,105,112,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,107,101,101,112,32,109,117,115,116,32,98,101,32,101,110,118,32,111,114,32,108,111,111,112,10,0,0,108,111,111,112,0,0,0,0,101,110,118,0,0,0,0,0,107,101,101,112,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,112,97,110,110,105,110,103,32,109,117,115,116,32,98,101,32,108,101,102,116,44,32,114,105,103,104,116,44,32,99,101,110,116,101,114,44,32,111,114,32,98,101,116,119,101,101,110,32,45,49,48,48,32,97,110,100,32,49,48,48,10,0,0,0,0,0,0,32,9,160,0,0,0,0,0,114,105,103,104,116,0,0,0,108,101,102,116,0,0,0,0,77,105,115,115,105,110,103,32,112,97,116,99,104,58,32,37,115,10,0,0,0,0,0,0,99,101,110,116,101,114,0,0,112,97,110,0,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,110,111,116,101,32,109,117,115,116,32,98,101,32,98,101,116,119,101,101,110,32,48,32,97,110,100,32,49,50,55,10,0,0,0,0,110,111,116,101,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,97,109,112,108,105,102,105,99,97,116,105,111,110,32,109,117,115,116,32,98,101,32,98,101,116,119,101,101,110,32,48,32,97,110,100,32,37,100,10,0,0,0,0,97,109,112,0,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,98,97,100,32,112,97,116,99,104,32,111,112,116,105,111,110,32,37,115,10,0,0,0,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,77,117,115,116,32,115,112,101,99,105,102,121,32,116,111,110,101,32,98,97,110,107,32,111,114,32,100,114,117,109,32,115,101,116,32,98,101,102,111,114,101,32,97,115,115,105,103,110,109,101,110,116,10,0,0,0,0,0,0,67,111,110,102,105,103,117,114,97,116,105,111,110,32,102,105,108,101,32,37,115,32,110,111,116,32,102,111,117,110,100,10,0,0,0,0,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,80,114,111,103,114,97,109,32,109,117,115,116,32,98,101,32,98,101,116,119,101,101,110,32,48,32,97,110,100,32,49,50,55,10,0,37,115,58,32,108,105,110,101,32,37,100,58,32,115,121,110,116,97,120,32,101,114,114,111,114,10,0,0,0,0,0,0,63,63,63,63,63,63,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,84,111,110,101,32,98,97,110,107,32,109,117,115,116,32,98,101,32,98,101,116,119,101,101,110,32,48,32,97,110,100,32,49,50,55,10,0,0,0,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,78,111,32,98,97,110,107,32,110,117,109,98,101,114,32,103,105,118,101,110,10,0,0,0,0,0,0,98,97,110,107,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,68,114,117,109,32,115,101,116,32,109,117,115,116,32,98,101,32,98,101,116,119,101,101,110,32,48,32,97,110,100,32,49,50,55,10,0,0,0,0,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,78,111,32,100,114,117,109,32,115,101,116,32,110,117,109,98,101,114,32,103,105,118,101,110,10,0,0,100,114,117,109,115,101,116,0,37,115,58,32,108,105,110,101,32,37,100,58,32,77,117,115,116,32,115,112,101,99,105,102,121,32,101,120,97,99,116,108,121,32,111,110,101,32,112,97,116,99,104,32,110,97,109,101,10,0,0,0,0,0,0,0,100,101,102,97,117,108,116,0,80,114,111,98,97,98,108,101,32,115,111,117,114,99,101,32,108,111,111,112,32,105,110,32,99,111,110,102,105,103,117,114,97,116,105,111,110,32,102,105,108,101,115,10,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,78,111,32,102,105,108,101,32,110,97,109,101,32,103,105,118,101,110,10,0,0,0,0,0,0,0,0,115,111,117,114,99,101,0,0,71,70,49,80,65,84,67,72,49,48,48,0,73,68,35,48,48,48,48,48,50,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,78,111,32,100,105,114,101,99,116,111,114,121,32,103,105,118,101,110,10,0,0,0,0,0,0,0,0,100,105,114,0,0,0,0,0,70,73,88,77,69,58,32,73,109,112,108,101,109,101,110,116,32,34,109,97,112,34,32,105,110,32,84,105,77,105,100,105,116,121,32,99,111,110,102,105,103,46,10,0,0,0,0,0,109,97,112,0,0,0,0,0,70,73,88,77,69,58,32,73,109,112,108,101,109,101,110,116,32,34,112,114,111,103,98,97,115,101,34,32,105,110,32,84,105,77,105,100,105,116,121,32,99,111,110,102,105,103,46,10,0,0,0,0,0,0,0,0,112,114,111,103,98,97,115,101,0,0,0,0,0,0,0,0,70,73,88,77,69,58,32,73,109,112,108,109,101,109,101,110,116,32,34,37,115,34,32,105,110,32,84,105,77,105,100,105,116,121,32,99,111,110,102,105,103,46,10,0,0,0,0,0,102,111,110,116,0,0,0,0,85,110,115,117,112,112,111,114,116,101,100,32,97,117,100,105,111,32,102,111,114,109,97,116,10,0,0,0,0,0,0,0,115,111,117,110,100,102,111,110,116,0,0,0,0,0,0,0,70,73,88,77,69,58,32,73,109,112,108,101,109,101,110,116,32,34,97,108,116,97,115,115,105,103,110,34,32,105,110,32,84,105,77,105,100,105,116,121,32,99,111,110,102,105,103,46,10,0,0,0,0,0,0,0,71,70,49,80,65,84,67,72,49,49,48,0,73,68,35,48,48,48,48,48,50,0,0,0,77,84,114,107,0,0,0,0,97,108,116,97,115,115,105,103,110,0,0,0,0,0,0,0,70,73,88,77,69,58,32,73,109,112,108,101,109,101,110,116,32,34,117,110,100,101,102,34,32,105,110,32,84,105,77,105,100,105,116,121,32,99,111,110,102,105,103,46,10,0,0,0,117,110,100,101,102,0,0,0,70,73,88,77,69,58,32,73,109,112,108,101,109,101,110,116,32,34,37,115,34,32,105,110,32,84,105,77,105,100,105,116,121,32,99,111,110,102,105,103,46,10,0,0,0,0,0,0,99,111,112,121,98,97,110,107,0,0,0,0,0,0,0,0,99,111,112,121,100,114,117,109,115,101,116,0,0,0,0,0,70,73,88,77,69,58,32,73,109,112,108,101,109,101,110,116,32,34,116,105,109,101,111,117,116,34,32,105,110,32,84,105,77,105,100,105,116,121,32,99,111,110,102,105,103,46,10,0,97,100,100,32,116,111,32,112,97,116,104,108,105,115,116,58,32,37,115,10,0,0,0,0,116,105,109,101,111,117,116,0,46,0,0,0,0,0,0,0,116,105,109,105,100,105,116,121,46,99,102,103,0,0,0,0,111,112,116,0,0,0,0,0,114,98,0,0,0,0,0,0,109,97,105,108,97,100,100,114,0,0,0,0,0,0,0,0,46,112,97,116,0,0,0,0,114,98,0,0,0,0,0,0],\"i8\",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=Runtime.alignMemory(allocate(12,'i8',ALLOC_STATIC),8);assert(tempDoublePtr%8==0);var ___errno_state=0;function ___setErrNo(value){// For convenient setting and returning of errno.\nHEAP32[___errno_state>>2]=value;return value;}var PATH={splitPath:function splitPath(filename){var splitPathRe=/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;return splitPathRe.exec(filename).slice(1);},normalizeArray:function normalizeArray(parts,allowAboveRoot){// if the path tries to go above the root, `up` ends up > 0\nvar up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}// if the path is allowed to go above the root, restore leading ..s\nif(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;},normalize:function normalize(path){var isAbsolute=path.charAt(0)==='/',trailingSlash=path.substr(-1)==='/';// Normalize the path\npath=PATH.normalizeArray(path.split('/').filter(function(p){return!!p;}),!isAbsolute).join('/');if(!path&&!isAbsolute){path='.';}if(path&&trailingSlash){path+='/';}return(isAbsolute?'/':'')+path;},dirname:function dirname(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){// No dirname whatsoever\nreturn'.';}if(dir){// It has a dirname, strip trailing slash\ndir=dir.substr(0,dir.length-1);}return root+dir;},basename:function basename(path,ext){// EMSCRIPTEN return '/'' for '/', not an empty string\nif(path==='/')return'/';var f=PATH.splitPath(path)[2];if(ext&&f.substr(-1*ext.length)===ext){f=f.substr(0,f.length-ext.length);}return f;},extname:function extname(path){return PATH.splitPath(path)[3];},join:function join(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.filter(function(p,index){if(typeof p!=='string'){throw new TypeError('Arguments to path.join must be strings');}return p;}).join('/'));},resolve:function resolve(){var resolvedPath='',resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();// Skip empty and invalid entries\nif(typeof path!=='string'){throw new TypeError('Arguments to path.resolve must be strings');}else if(!path){continue;}resolvedPath=path+'/'+resolvedPath;resolvedAbsolute=path.charAt(0)==='/';}// At this point the path should be resolved to a full absolute path, but\n// handle relative paths to be safe (might happen when process.cwd() fails)\nresolvedPath=PATH.normalizeArray(resolvedPath.split('/').filter(function(p){return!!p;}),!resolvedAbsolute).join('/');return(resolvedAbsolute?'/':'')+resolvedPath||'.';},relative:function relative(from,to){from=PATH.resolve(from).substr(1);to=PATH.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=='')break;}if(start>end)return[];return arr.slice(start,end-start+1);}var fromParts=trim(from.split('/'));var toParts=trim(to.split('/'));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;icontents.length){contents.push(0);}}},lookup:function lookup(parent,name){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENOENT);},mknod:function mknod(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev);},rename:function rename(old_node,new_dir,new_name){// if we're overwriting a directory at new_name, make sure it's empty.\nif(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name);}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENOTEMPTY);}}}// do the internal rewiring\ndelete old_node.parent.contents[old_node.name];old_node.name=new_name;new_dir.contents[new_name]=old_node;},unlink:function unlink(parent,name){delete parent.contents[name];},rmdir:function rmdir(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENOTEMPTY);}delete parent.contents[name];},readdir:function readdir(node){var entries=['.','..'];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue;}entries.push(key);}return entries;},symlink:function symlink(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node;},readlink:function readlink(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}return node.link;}},stream_ops:{read:function read(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(size>8&&contents.subarray){// non-trivial, and typed array\nbuffer.set(contents.subarray(position,position+size),offset);}else{for(var i=0;icontents.length){contents.push(0);}},mmap:function mmap(stream,buffer,offset,length,position,prot,flags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENODEV);}var ptr;var allocated;var contents=stream.node.contents;// Only make a new copy when MAP_PRIVATE is specified.\nif(!(flags&2)&&(contents.buffer===buffer||contents.buffer===buffer.buffer)){// We can't emulate MAP_SHARED when the file is not backed by the buffer\n// we're mapping to (e.g. the HEAP buffer).\nallocated=false;ptr=contents.byteOffset;}else{// Try to avoid unnecessary slices.\nif(position>0||position+lengthe2.timestamp){create[key]=e;total++;}}var remove={};for(var key in dst.files){if(!dst.files.hasOwnProperty(key))continue;var e=dst.files[key];var e2=src.files[key];if(!e2){remove[key]=e;total++;}}if(!total){// early out\nreturn callback(null);}var completed=0;var done=function done(err){if(err)return callback(err);if(++completed>=total){return callback(null);}};// create a single transaction to handle and IDB reads / writes we'll need to do\nvar db=src.type==='remote'?src.db:dst.db;var transaction=db.transaction([IDBFS.DB_STORE_NAME],'readwrite');transaction.onerror=function(){callback(this.error);};var store=transaction.objectStore(IDBFS.DB_STORE_NAME);for(var path in create){if(!create.hasOwnProperty(path))continue;var entry=create[path];if(dst.type==='local'){// save file to local\ntry{if(FS.isDir(entry.mode)){FS.mkdir(path,entry.mode);}else if(FS.isFile(entry.mode)){var stream=FS.open(path,'w+',438);FS.write(stream,entry.contents,0,entry.contents.length,0,true/* canOwn */);FS.close(stream);}done(null);}catch(e){return done(e);}}else{// save file to IDB\nvar req=store.put(entry,path);req.onsuccess=function(){done(null);};req.onerror=function(){done(this.error);};}}for(var path in remove){if(!remove.hasOwnProperty(path))continue;var entry=remove[path];if(dst.type==='local'){// delete file from local\ntry{if(FS.isDir(entry.mode)){// TODO recursive delete?\nFS.rmdir(path);}else if(FS.isFile(entry.mode)){FS.unlink(path);}done(null);}catch(e){return done(e);}}else{// delete file from IDB\nvar req=store[\"delete\"](path);req.onsuccess=function(){done(null);};req.onerror=function(){done(this.error);};}}},getLocalSet:function getLocalSet(mount,callback){var files={};var isRealDir=function isRealDir(p){return p!=='.'&&p!=='..';};var toAbsolute=function toAbsolute(root){return function(p){return PATH.join(root,p);};};var check=FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));while(check.length){var path=check.pop();var stat,node;try{var lookup=FS.lookupPath(path);node=lookup.node;stat=FS.stat(path);}catch(e){return callback(e);}if(FS.isDir(stat.mode)){check.push.apply(check,FS.readdir(path).filter(isRealDir).map(toAbsolute(path)));files[path]={mode:stat.mode,timestamp:stat.mtime};}else if(FS.isFile(stat.mode)){files[path]={contents:node.contents,mode:stat.mode,timestamp:stat.mtime};}else{return callback(new Error('node type not supported'));}}return callback(null,{type:'local',files:files});},getDB:function getDB(name,callback){// look it up in the cache\nvar db=IDBFS.dbs[name];if(db){return callback(null,db);}var req;try{req=IDBFS.indexedDB().open(name,IDBFS.DB_VERSION);}catch(e){return onerror(e);}req.onupgradeneeded=function(){db=req.result;db.createObjectStore(IDBFS.DB_STORE_NAME);};req.onsuccess=function(){db=req.result;// add to the cache\nIDBFS.dbs[name]=db;callback(null,db);};req.onerror=function(){callback(this.error);};},getRemoteSet:function getRemoteSet(mount,callback){var files={};IDBFS.getDB(mount.mountpoint,function(err,db){if(err)return callback(err);var transaction=db.transaction([IDBFS.DB_STORE_NAME],'readonly');transaction.onerror=function(){callback(this.error);};var store=transaction.objectStore(IDBFS.DB_STORE_NAME);store.openCursor().onsuccess=function(event){var cursor=event.target.result;if(!cursor){return callback(null,{type:'remote',db:db,files:files});}files[cursor.key]=cursor.value;cursor[\"continue\"]();};});}};var NODEFS={mount:function mount(){},createNode:function createNode(parent,name,mode,dev){if(!FS.isDir(mode)&&!FS.isFile(mode)&&!FS.isLink(mode)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}var node=FS.createNode(parent,name,mode);node.node_ops=NODEFS.node_ops;node.stream_ops=NODEFS.stream_ops;return node;},getMode:function getMode(path){var stat;try{stat=fs.lstatSync(path);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}return stat.mode;},realPath:function realPath(node){var parts=[];while(node.parent!==node){parts.push(node.name);node=node.parent;}parts.push(node.mount.opts.root);parts.reverse();return PATH.join.apply(null,parts);},node_ops:{getattr:function getattr(node){var path=NODEFS.realPath(node);var stat;try{stat=fs.lstatSync(path);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}return{dev:stat.dev,ino:stat.ino,mode:stat.mode,nlink:stat.nlink,uid:stat.uid,gid:stat.gid,rdev:stat.rdev,size:stat.size,atime:stat.atime,mtime:stat.mtime,ctime:stat.ctime,blksize:stat.blksize,blocks:stat.blocks};},setattr:function setattr(node,attr){var path=NODEFS.realPath(node);try{if(attr.mode!==undefined){fs.chmodSync(path,attr.mode);// update the common node structure mode as well\nnode.mode=attr.mode;}if(attr.timestamp!==undefined){var date=new Date(attr.timestamp);fs.utimesSync(path,date,date);}if(attr.size!==undefined){fs.truncateSync(path,attr.size);}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}},lookup:function lookup(parent,name){var path=PATH.join(NODEFS.realPath(parent),name);var mode=NODEFS.getMode(path);return NODEFS.createNode(parent,name,mode);},mknod:function mknod(parent,name,mode,dev){var node=NODEFS.createNode(parent,name,mode,dev);// create the backing node for this in the fs root as well\nvar path=NODEFS.realPath(node);try{if(FS.isDir(node.mode)){fs.mkdirSync(path,node.mode);}else{fs.writeFileSync(path,'',{mode:node.mode});}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}return node;},rename:function rename(oldNode,newDir,newName){var oldPath=NODEFS.realPath(oldNode);var newPath=PATH.join(NODEFS.realPath(newDir),newName);try{fs.renameSync(oldPath,newPath);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}},unlink:function unlink(parent,name){var path=PATH.join(NODEFS.realPath(parent),name);try{fs.unlinkSync(path);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}},rmdir:function rmdir(parent,name){var path=PATH.join(NODEFS.realPath(parent),name);try{fs.rmdirSync(path);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}},readdir:function readdir(node){var path=NODEFS.realPath(node);try{return fs.readdirSync(path);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}},symlink:function symlink(parent,newName,oldPath){var newPath=PATH.join(NODEFS.realPath(parent),newName);try{fs.symlinkSync(oldPath,newPath);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}},readlink:function readlink(node){var path=NODEFS.realPath(node);try{return fs.readlinkSync(path);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}}},stream_ops:{open:function open(stream){var path=NODEFS.realPath(stream.node);try{if(FS.isFile(stream.node.mode)){stream.nfd=fs.openSync(path,stream.flags);}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}},close:function close(stream){try{if(FS.isFile(stream.node.mode)){fs.closeSync(stream.nfd);}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}},read:function read(stream,buffer,offset,length,position){// FIXME this is terrible.\nvar nbuffer=new Buffer(length);var res;try{res=fs.readSync(stream.nfd,nbuffer,0,length,position);}catch(e){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}if(res>0){for(var i=0;i8){// max recursive lookup of 8\nthrow new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ELOOP);}// split the path\nvar parts=PATH.normalizeArray(path.split('/').filter(function(p){return!!p;}),false);// start at the root\nvar current=FS.root;var current_path='/';for(var i=0;i40){// limit max consecutive symlinks to 40 (SYMLOOP_MAX).\nthrow new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ELOOP);}}}}return{path:current_path,node:current};},getPath:function getPath(node){var path;while(true){if(FS.isRoot(node)){return path?PATH.join(node.mount.mountpoint,path):node.mount.mountpoint;}path=path?PATH.join(node.name,path):node.name;node=node.parent;}},hashName:function hashName(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length;},hashAddNode:function hashAddNode(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node;},hashRemoveNode:function hashRemoveNode(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next;}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break;}current=current.name_next;}}},lookupNode:function lookupNode(parent,name){var err=FS.mayLookup(parent);if(err){throw new FS.ErrnoError(err,name);}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node;}}// if we failed to find it in the cache, call into the VFS\nreturn FS.lookup(parent,name);},createNode:function createNode(parent,name,mode,rdev){var node={id:FS.nextInode++,name:name,mode:mode,node_ops:{},stream_ops:{},rdev:rdev,parent:null,mount:null};if(!parent){parent=node;// root node sets parent to itself\n}node.parent=parent;node.mount=parent.mount;// compatibility\nvar readMode=292|73;var writeMode=146;// NOTE we must use Object.defineProperties instead of individual calls to\n// Object.defineProperty in order to make closure compiler happy\nObject.defineProperties(node,{read:{get:function get(){return(node.mode&readMode)===readMode;},set:function set(val){val?node.mode|=readMode:node.mode&=~readMode;}},write:{get:function get(){return(node.mode&writeMode)===writeMode;},set:function set(val){val?node.mode|=writeMode:node.mode&=~writeMode;}},isFolder:{get:function get(){return FS.isDir(node.mode);}},isDevice:{get:function get(){return FS.isChrdev(node.mode);}}});FS.hashAddNode(node);return node;},destroyNode:function destroyNode(node){FS.hashRemoveNode(node);},isRoot:function isRoot(node){return node===node.parent;},isMountpoint:function isMountpoint(node){return node.mounted;},isFile:function isFile(mode){return(mode&61440)===32768;},isDir:function isDir(mode){return(mode&61440)===16384;},isLink:function isLink(mode){return(mode&61440)===40960;},isChrdev:function isChrdev(mode){return(mode&61440)===8192;},isBlkdev:function isBlkdev(mode){return(mode&61440)===24576;},isFIFO:function isFIFO(mode){return(mode&61440)===4096;},isSocket:function isSocket(mode){return(mode&49152)===49152;},flagModes:{r:0,rs:1052672,'r+':2,w:577,wx:705,xw:705,'w+':578,'wx+':706,'xw+':706,a:1089,ax:1217,xa:1217,'a+':1090,'ax+':1218,'xa+':1218},modeStringToFlags:function modeStringToFlags(str){var flags=FS.flagModes[str];if(typeof flags==='undefined'){throw new Error('Unknown file open mode: '+str);}return flags;},flagsToPermissionString:function flagsToPermissionString(flag){var accmode=flag&2097155;var perms=['r','w','rw'][accmode];if(flag&512){perms+='w';}return perms;},nodePermissions:function nodePermissions(node,perms){if(FS.ignorePermissions){return 0;}// return 0 if any user, group or owner bits are set.\nif(perms.indexOf('r')!==-1&&!(node.mode&292)){return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EACCES;}else if(perms.indexOf('w')!==-1&&!(node.mode&146)){return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EACCES;}else if(perms.indexOf('x')!==-1&&!(node.mode&73)){return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EACCES;}return 0;},mayLookup:function mayLookup(dir){return FS.nodePermissions(dir,'x');},mayCreate:function mayCreate(dir,name){try{FS.lookupNode(dir,name);return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EEXIST;}catch(e){}return FS.nodePermissions(dir,'wx');},mayDelete:function mayDelete(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name);}catch(e){return e.errno;}var err=FS.nodePermissions(dir,'wx');if(err){return err;}if(isdir){if(!FS.isDir(node.mode)){return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENOTDIR;}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBUSY;}}else{if(FS.isDir(node.mode)){return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EISDIR;}}return 0;},mayOpen:function mayOpen(node,flags){if(!node){return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENOENT;}if(FS.isLink(node.mode)){return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ELOOP;}else if(FS.isDir(node.mode)){if((flags&2097155)!==0||// opening for write\nflags&512){return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EISDIR;}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags));},MAX_OPEN_FDS:4096,nextfd:function nextfd(fd_start,fd_end){fd_start=fd_start||1;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd;}}throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EMFILE);},getStream:function getStream(fd){return FS.streams[fd];},createStream:function createStream(stream,fd_start,fd_end){var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;// compatibility\nObject.defineProperties(stream,{object:{get:function get(){return stream.node;},set:function set(val){stream.node=val;}},isRead:{get:function get(){return(stream.flags&2097155)!==1;}},isWrite:{get:function get(){return(stream.flags&2097155)!==0;}},isAppend:{get:function get(){return stream.flags&1024;}}});FS.streams[fd]=stream;return stream;},closeStream:function closeStream(fd){FS.streams[fd]=null;},chrdev_stream_ops:{open:function open(stream){var device=FS.getDevice(stream.node.rdev);// override node's stream ops with the device's\nstream.stream_ops=device.stream_ops;// forward the open call\nif(stream.stream_ops.open){stream.stream_ops.open(stream);}},llseek:function llseek(){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ESPIPE);}},major:function major(dev){return dev>>8;},minor:function minor(dev){return dev&0xff;},makedev:function makedev(ma,mi){return ma<<8|mi;},registerDevice:function registerDevice(dev,ops){FS.devices[dev]={stream_ops:ops};},getDevice:function getDevice(dev){return FS.devices[dev];},syncfs:function syncfs(populate,callback){if(typeof populate==='function'){callback=populate;populate=false;}var completed=0;var total=FS.mounts.length;var done=function done(err){if(err){return callback(err);}if(++completed>=total){callback(null);}};// sync all mounts\nfor(var i=0;i3&&arguments[3]!==undefined?arguments[3]:true;var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var error=FS.mayCreate(parent,name);if(error){if(throwError){throw new FS.ErrnoError(error,path);}return;}if(!parent.node_ops.mknod){if(throwError){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM,path);}return;}return parent.node_ops.mknod(parent,name,mode,dev);},create:function create(path,mode){var throwError=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0,throwError);},mkdir:function mkdir(path,mode){var throwError=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0,throwError);},mkdev:function mkdev(path,mode,dev){if(typeof dev==='undefined'){dev=mode;mode=438;}mode|=8192;return FS.mknod(path,mode,dev);},symlink:function symlink(oldpath,newpath){var lookup=FS.lookupPath(newpath,{parent:true});var parent=lookup.node;var newname=PATH.basename(newpath);var err=FS.mayCreate(parent,newname);if(err){throw new FS.ErrnoError(err);}if(!parent.node_ops.symlink){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM);}return parent.node_ops.symlink(parent,newname,oldpath);},rename:function rename(old_path,new_path){var old_dirname=PATH.dirname(old_path);var new_dirname=PATH.dirname(new_path);var old_name=PATH.basename(old_path);var new_name=PATH.basename(new_path);// parents must exist\nvar lookup,old_dir,new_dir;try{lookup=FS.lookupPath(old_path,{parent:true});old_dir=lookup.node;lookup=FS.lookupPath(new_path,{parent:true});new_dir=lookup.node;}catch(e){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBUSY);}// need to be part of the same mount\nif(old_dir.mount!==new_dir.mount){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EXDEV);}// source must exist\nvar old_node=FS.lookupNode(old_dir,old_name);// old path should not be an ancestor of the new path\nvar relative=PATH.relative(old_path,new_dirname);if(relative.charAt(0)!=='.'){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}// new path should not be an ancestor of the old path\nrelative=PATH.relative(new_path,old_dirname);if(relative.charAt(0)!=='.'){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENOTEMPTY);}// see if the new path already exists\nvar new_node;try{new_node=FS.lookupNode(new_dir,new_name);}catch(e){}// not fatal\n// early out if nothing needs to change\nif(old_node===new_node){return;}// we'll need to delete the old entry\nvar isdir=FS.isDir(old_node.mode);var err=FS.mayDelete(old_dir,old_name,isdir);if(err){throw new FS.ErrnoError(err);}// need delete permissions if we'll be overwriting.\n// need create permissions if new doesn't already exist.\nerr=new_node?FS.mayDelete(new_dir,new_name,isdir):FS.mayCreate(new_dir,new_name);if(err){throw new FS.ErrnoError(err);}if(!old_dir.node_ops.rename){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM);}if(FS.isMountpoint(old_node)||new_node&&FS.isMountpoint(new_node)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBUSY);}// if we are going to change the parent, check write permissions\nif(new_dir!==old_dir){err=FS.nodePermissions(old_dir,'w');if(err){throw new FS.ErrnoError(err);}}// remove the node from the lookup hash\nFS.hashRemoveNode(old_node);// do the underlying fs rename\ntry{old_dir.node_ops.rename(old_node,new_dir,new_name);}catch(e){throw e;}finally{// add the node back to the hash (in case node_ops.rename\n// changed its name)\nFS.hashAddNode(old_node);}},rmdir:function rmdir(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var err=FS.mayDelete(parent,name,true);if(err){throw new FS.ErrnoError(err);}if(!parent.node_ops.rmdir){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM);}if(FS.isMountpoint(node)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBUSY);}parent.node_ops.rmdir(parent,name);FS.destroyNode(node);},readdir:function readdir(path){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node.node_ops.readdir){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENOTDIR);}return node.node_ops.readdir(node);},unlink:function unlink(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var err=FS.mayDelete(parent,name,false);if(err){// POSIX says unlink should set EPERM, not EISDIR\nif(err===_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EISDIR)err=_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM;throw new FS.ErrnoError(err);}if(!parent.node_ops.unlink){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM);}if(FS.isMountpoint(node)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBUSY);}parent.node_ops.unlink(parent,name);FS.destroyNode(node);},readlink:function readlink(path){var lookup=FS.lookupPath(path,{follow:false});var link=lookup.node;if(!link.node_ops.readlink){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}return link.node_ops.readlink(link);},stat:function stat(path,dontFollow){var lookup=FS.lookupPath(path,{follow:!dontFollow});var node=lookup.node;if(!node.node_ops.getattr){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM);}return node.node_ops.getattr(node);},lstat:function lstat(path){return FS.stat(path,true);},chmod:function chmod(path,mode,dontFollow){var node;if(typeof path==='string'){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node;}else{node=path;}if(!node.node_ops.setattr){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM);}node.node_ops.setattr(node,{mode:mode&4095|node.mode&~4095,timestamp:Date.now()});},lchmod:function lchmod(path,mode){FS.chmod(path,mode,true);},fchmod:function fchmod(fd,mode){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBADF);}FS.chmod(stream.node,mode);},chown:function chown(path,uid,gid,dontFollow){var node;if(typeof path==='string'){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node;}else{node=path;}if(!node.node_ops.setattr){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM);}node.node_ops.setattr(node,{timestamp:Date.now()// we ignore the uid / gid for now\n});},lchown:function lchown(path,uid,gid){FS.chown(path,uid,gid,true);},fchown:function fchown(fd,uid,gid){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBADF);}FS.chown(stream.node,uid,gid);},truncate:function truncate(path,len){if(len<0){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}var node;if(typeof path==='string'){var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;}else{node=path;}if(!node.node_ops.setattr){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM);}if(FS.isDir(node.mode)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EISDIR);}if(!FS.isFile(node.mode)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}var err=FS.nodePermissions(node,'w');if(err){throw new FS.ErrnoError(err);}node.node_ops.setattr(node,{size:len,timestamp:Date.now()});},ftruncate:function ftruncate(fd,len){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBADF);}if((stream.flags&2097155)===0){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}FS.truncate(stream.node,len);},utime:function utime(path,atime,mtime){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;node.node_ops.setattr(node,{timestamp:Math.max(atime,mtime)});},open:function open(path,flags,mode,fd_start,fd_end){path=PATH.normalize(path);flags=typeof flags==='string'?FS.modeStringToFlags(flags):flags;mode=typeof mode==='undefined'?438:mode;if(flags&64){mode=mode&4095|32768;}else{mode=0;}var node;try{var lookup=FS.lookupPath(path,{follow:!(flags&131072)});node=lookup.node;}catch(e){}// ignore\n// perhaps we need to create the node\nif(flags&64){if(node){// if O_CREAT and O_EXCL are set, error out if the node already exists\nif(flags&128){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EEXIST);}}else{// node doesn't exist, try to create it\nnode=FS.mknod(path,mode,0);}}if(!node){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENOENT);}// can't truncate a device\nif(FS.isChrdev(node.mode)){flags&=~512;}// check permissions\nvar err=FS.mayOpen(node,flags);if(err){throw new FS.ErrnoError(err);}// do truncation if necessary\nif(flags&512){FS.truncate(node,0);}// we've already handled these, don't pass down to the underlying vfs\nflags&=~(128|512);// register the stream with the filesystem\nvar stream=FS.createStream({node:node,path:FS.getPath(node),// we want the absolute path to the node\nflags:flags,seekable:true,position:0,stream_ops:node.stream_ops,// used by the file family libc calls (fopen, fwrite, ferror, etc.)\nungotten:[],error:false},fd_start,fd_end);// call the new stream's open function\nif(stream.stream_ops.open){stream.stream_ops.open(stream);}if(Module['logReadFiles']&&!(flags&1)){if(!FS.readFiles)FS.readFiles={};if(!(path in FS.readFiles)){FS.readFiles[path]=1;console.warn('read file: '+path);}}return stream;},close:function close(stream){try{if(stream.stream_ops.close){stream.stream_ops.close(stream);}}catch(e){throw e;}finally{FS.closeStream(stream.fd);}},llseek:function llseek(stream,offset,whence){if(!stream.seekable||!stream.stream_ops.llseek){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ESPIPE);}return stream.stream_ops.llseek(stream,offset,whence);},read:function read(stream,buffer,offset,length,position){if(length<0||position<0){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}if((stream.flags&2097155)===1){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBADF);}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EISDIR);}if(!stream.stream_ops.read){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}var seeking=true;if(typeof position==='undefined'){position=stream.position;seeking=false;}else if(!stream.seekable){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ESPIPE);}var bytesRead=stream.stream_ops.read(stream,buffer,offset,length,position);if(!seeking)stream.position+=bytesRead;return bytesRead;},write:function write(stream,buffer,offset,length,position,canOwn){if(length<0||position<0){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}if((stream.flags&2097155)===0){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBADF);}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EISDIR);}if(!stream.stream_ops.write){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}var seeking=true;if(typeof position==='undefined'){position=stream.position;seeking=false;}else if(!stream.seekable){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ESPIPE);}if(stream.flags&1024){// seek to the end before writing in append mode\nFS.llseek(stream,0,2);}var bytesWritten=stream.stream_ops.write(stream,buffer,offset,length,position,canOwn);if(!seeking)stream.position+=bytesWritten;return bytesWritten;},allocate:function allocate(stream,offset,length){if(offset<0||length<=0){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}if((stream.flags&2097155)===0){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBADF);}if(!FS.isFile(stream.node.mode)&&!FS.isDir(node.mode)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENODEV);}if(!stream.stream_ops.allocate){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EOPNOTSUPP);}stream.stream_ops.allocate(stream,offset,length);},mmap:function mmap(stream,buffer,offset,length,position,prot,flags){// TODO if PROT is PROT_WRITE, make sure we have write access\nif((stream.flags&2097155)===1){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EACCES);}if(!stream.stream_ops.mmap){throw new FS.errnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENODEV);}return stream.stream_ops.mmap(stream,buffer,offset,length,position,prot,flags);},ioctl:function ioctl(stream,cmd,arg){if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENOTTY);}return stream.stream_ops.ioctl(stream,cmd,arg);},readFile:function readFile(path,opts){opts=opts||{};opts.flags=opts.flags||'r';opts.encoding=opts.encoding||'binary';var ret;var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==='utf8'){ret='';var utf8=new Runtime.UTF8Processor();for(var i=0;i>2]=stdin.fd;assert(stdin.fd===1,'invalid handle for stdin ('+stdin.fd+')');var stdout=FS.open('/dev/stdout','w');HEAP32[_stdout>>2]=stdout.fd;assert(stdout.fd===2,'invalid handle for stdout ('+stdout.fd+')');var stderr=FS.open('/dev/stderr','w');HEAP32[_stderr>>2]=stderr.fd;assert(stderr.fd===3,'invalid handle for stderr ('+stderr.fd+')');},staticInit:function staticInit(){FS.nameTable=new Array(4096);FS.root=FS.createNode(null,'/',16384|511,0);FS.mount(MEMFS,{},'/');FS.createDefaultDirectories();FS.createDefaultDevices();},init:function init(input,output,error){assert(!FS.init.initialized,'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)');FS.init.initialized=true;// Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here\nModule['stdin']=input||Module['stdin'];Module['stdout']=output||Module['stdout'];Module['stderr']=error||Module['stderr'];FS.createStandardStreams();},quit:function quit(){FS.init.initialized=false;for(var i=0;i2&&arguments[2]!==undefined?arguments[2]:true;var parts=path.split('/').reverse();while(parts.length){var part=parts.pop();if(!part){continue;}var current=PATH.join(parent,part);try{FS.mkdir(current,undefined,throwError);}catch(error){// console.error(error)\n}parent=current;}},/**\n * Creates a file.\n * @function createFile\n * @memberof LibTiMidity\n * @instance\n * @param {string} parent The parent folder.\n * @param {string} name The path to create.\n * @param {boolean} canRead\n * @param {boolean} canWrite\n */createFile:function createFile(parent,name,canRead,canWrite){var path=PATH.join(typeof parent==='string'?parent:FS.getPath(parent),name);var mode=FS.getMode(canRead,canWrite);return FS.create(path,mode);},/**\n * Creates a data file and writes data to it.\n * @function createDataFile\n * @memberof LibTiMidity\n * @instance\n * @param {string} parent\n * @param {string} name\n * @param {array} data\n * @param {boolean} canRead\n * @param {boolean} canWrite\n * @param {boolean} [canOwn]\n * @param {boolean} [throwError = true] If file creation failed, throw an error.\n */createDataFile:function createDataFile(parent,name,data,canRead,canWrite,canOwn){var throwError=arguments.length>6&&arguments[6]!==undefined?arguments[6]:true;var path=name?PATH.join(typeof parent==='string'?parent:FS.getPath(parent),name):parent;var mode=FS.getMode(canRead,canWrite);if(throwError){FS.create(path,mode);}else{try{FS.create(path,mode);}catch(error){return;}}if(data){if(typeof data==='string'){var arr=new Array(data.length);for(var i=0,len=data.length;i=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){// normal array\nfor(var i=0;i>2];path=Pointer_stringify(path);try{var stream=FS.open(path,oflag,mode);return stream.fd;}catch(e){FS.handleFSError(e);return-1;}}function _fopen(filename,mode){// FILE *fopen(const char *restrict filename, const char *restrict mode);\n// http://pubs.opengroup.org/onlinepubs/000095399/functions/fopen.html\nvar flags;mode=Pointer_stringify(mode);if(mode[0]=='r'){if(mode.indexOf('+')!=-1){flags=2;}else{flags=0;}}else if(mode[0]=='w'){if(mode.indexOf('+')!=-1){flags=2;}else{flags=1;}flags|=64;flags|=512;}else if(mode[0]=='a'){if(mode.indexOf('+')!=-1){flags=2;}else{flags=1;}flags|=64;flags|=1024;}else{___setErrNo(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);return 0;}var ret=_open(filename,flags,allocate([0x1ff,0,0,0],'i32',ALLOC_STACK));// All creation permissions.\nreturn ret==-1?0:ret;}Module['_strlen']=_strlen;Module['_strcpy']=_strcpy;Module['_strcat']=_strcat;var SOCKFS={mount:function mount(){return FS.createNode(null,'/',16384|511,0);},createSocket:function createSocket(family,type,protocol){var streaming=type==1;if(protocol){assert(streaming==(protocol==6));// if SOCK_STREAM, must be tcp\n}// create our internal socket structure\nvar sock={family:family,type:type,protocol:protocol,server:null,peers:{},pending:[],recv_queue:[],sock_ops:SOCKFS.websocket_sock_ops};// create the filesystem node to store the socket structure\nvar name=SOCKFS.nextname();var node=FS.createNode(SOCKFS.root,name,49152,0);node.sock=sock;// and the wrapping stream that enables library functions such\n// as read and write to indirectly interact with the socket\nvar stream=FS.createStream({path:name,node:node,flags:FS.modeStringToFlags('r+'),seekable:false,stream_ops:SOCKFS.stream_ops});// map the new stream to the socket structure (sockets have a 1:1\n// relationship with a stream)\nsock.stream=stream;return sock;},getSocket:function getSocket(fd){var stream=FS.getStream(fd);if(!stream||!FS.isSocket(stream.node.mode)){return null;}return stream.node.sock;},stream_ops:{poll:function poll(stream){var sock=stream.node.sock;return sock.sock_ops.poll(sock);},ioctl:function ioctl(stream,request,varargs){var sock=stream.node.sock;return sock.sock_ops.ioctl(sock,request,varargs);},read:function read(stream,buffer,offset,length){var sock=stream.node.sock;var msg=sock.sock_ops.recvmsg(sock,length);if(!msg){// socket is closed\nreturn 0;}buffer.set(msg.buffer,offset);return msg.buffer.length;},write:function write(stream,buffer,offset,length){var sock=stream.node.sock;return sock.sock_ops.sendmsg(sock,buffer,offset,length);},close:function close(stream){var sock=stream.node.sock;sock.sock_ops.close(sock);}},nextname:function nextname(){if(!SOCKFS.nextname.current){SOCKFS.nextname.current=0;}return'socket['+SOCKFS.nextname.current++ +']';},websocket_sock_ops:{createPeer:function createPeer(sock,addr,port){var ws;if(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_3___default()(addr)==='object'){ws=addr;addr=null;port=null;}if(ws){// for sockets that've already connected (e.g. we're the server)\n// we can inspect the _socket property for the address\nif(ws._socket){addr=ws._socket.remoteAddress;port=ws._socket.remotePort;}// if we're just now initializing a connection to the remote,\n// inspect the url property\nelse{var result=/ws[s]?:\\/\\/([^:]+):(\\d+)/.exec(ws.url);if(!result){throw new Error('WebSocket URL must be in the format ws(s)://address:port');}addr=result[1];port=parseInt(result[2],10);}}else{// create the actual websocket object and connect\ntry{var url='ws://'+addr+':'+port;// the node ws library API is slightly different than the browser's\nvar opts=['binary'];ws=new WebSocket(url,opts);ws.binaryType='arraybuffer';}catch(e){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EHOSTUNREACH);}}var peer={addr:addr,port:port,socket:ws,dgram_send_queue:[]};SOCKFS.websocket_sock_ops.addPeer(sock,peer);SOCKFS.websocket_sock_ops.handlePeerEvents(sock,peer);// if this is a bound dgram socket, send the port number first to allow\n// us to override the ephemeral port reported to us by remotePort on the\n// remote end.\nif(sock.type===2&&typeof sock.sport!=='undefined'){peer.dgram_send_queue.push(new Uint8Array([255,255,255,255,'p'.charCodeAt(0),'o'.charCodeAt(0),'r'.charCodeAt(0),'t'.charCodeAt(0),(sock.sport&0xff00)>>8,sock.sport&0xff]));}return peer;},getPeer:function getPeer(sock,addr,port){return sock.peers[addr+':'+port];},addPeer:function addPeer(sock,peer){sock.peers[peer.addr+':'+peer.port]=peer;},removePeer:function removePeer(sock,peer){delete sock.peers[peer.addr+':'+peer.port];},handlePeerEvents:function handlePeerEvents(sock,peer){var first=true;var handleOpen=function handleOpen(){try{var queued=peer.dgram_send_queue.shift();while(queued){peer.socket.send(queued);queued=peer.dgram_send_queue.shift();}}catch(e){// not much we can do here in the way of proper error handling as we've already\n// lied and said this data was sent. shut it down.\npeer.socket.close();}};var handleMessage=function handleMessage(data){assert(typeof data!=='string'&&data.byteLength!==undefined);// must receive an ArrayBuffer\ndata=new Uint8Array(data);// make a typed array view on the array buffer\n// if this is the port message, override the peer's port with it\nvar wasfirst=first;first=false;if(wasfirst&&data.length===10&&data[0]===255&&data[1]===255&&data[2]===255&&data[3]===255&&data[4]==='p'.charCodeAt(0)&&data[5]==='o'.charCodeAt(0)&&data[6]==='r'.charCodeAt(0)&&data[7]==='t'.charCodeAt(0)){// update the peer's port and it's key in the peer map\nvar newport=data[8]<<8|data[9];SOCKFS.websocket_sock_ops.removePeer(sock,peer);peer.port=newport;SOCKFS.websocket_sock_ops.addPeer(sock,peer);return;}sock.recv_queue.push({addr:peer.addr,port:peer.port,data:data});};peer.socket.onopen=handleOpen;peer.socket.onmessage=function(event){handleMessage(event.data);};},poll:function poll(sock){if(sock.type===1&&sock.server){// listen sockets should only say they're available for reading\n// if there are pending clients.\nreturn sock.pending.length?64|1:0;}var mask=0;var dest=sock.type===1// we only care about the socket state for connection-based sockets\n?SOCKFS.websocket_sock_ops.getPeer(sock,sock.daddr,sock.dport):null;if(sock.recv_queue.length||!dest||// connection-less sockets are always ready to read\ndest&&dest.socket.readyState===dest.socket.CLOSING||dest&&dest.socket.readyState===dest.socket.CLOSED){// let recv return 0 once closed\nmask|=64|1;}if(!dest||// connection-less sockets are always ready to write\ndest&&dest.socket.readyState===dest.socket.OPEN){mask|=4;}if(dest&&dest.socket.readyState===dest.socket.CLOSING||dest&&dest.socket.readyState===dest.socket.CLOSED){mask|=16;}return mask;},ioctl:function ioctl(sock,request,arg){switch(request){case 21531:var bytes=0;if(sock.recv_queue.length){bytes=sock.recv_queue[0].data.length;}HEAP32[arg>>2]=bytes;return 0;default:return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL;}},close:function close(sock){// if we've spawned a listen server, close it\nif(sock.server){try{sock.server.close();}catch(e){}sock.server=null;}// close any peer connections\nvar peers=Object.keys(sock.peers);for(var i=0;i>3];}else if(type=='i64'){ret=[HEAP32[varargs+argIndex>>2],HEAP32[varargs+(argIndex+8)>>2]];argIndex+=8;// each 32-bit chunk is in a 64-bit block\n}else{type='i32';// varargs are always i32, i64, or double\nret=HEAP32[varargs+argIndex>>2];}argIndex+=Math.max(Runtime.getNativeFieldSize(type),Runtime.getAlignSize(type,null,true));return ret;}var ret=[];var curr,next,currArg;while(1){var startTextIndex=textIndex;curr=HEAP8[textIndex];if(curr===0)break;next=HEAP8[textIndex+1|0];if(curr==37){// Handle flags.\nvar flagAlwaysSigned=false;var flagLeftAlign=false;var flagAlternative=false;var flagZeroPad=false;var flagPadSign=false;flagsLoop:while(1){switch(next){case 43:flagAlwaysSigned=true;break;case 45:flagLeftAlign=true;break;case 35:flagAlternative=true;break;case 48:if(flagZeroPad){break flagsLoop;}else{flagZeroPad=true;break;}case 32:flagPadSign=true;break;default:break flagsLoop;}textIndex++;next=HEAP8[textIndex+1|0];}// Handle width.\nvar width=0;if(next==42){width=getNextArg('i32');textIndex++;next=HEAP8[textIndex+1|0];}else{while(next>=48&&next<=57){width=width*10+(next-48);textIndex++;next=HEAP8[textIndex+1|0];}}// Handle precision.\nvar precisionSet=false;if(next==46){var precision=0;precisionSet=true;textIndex++;next=HEAP8[textIndex+1|0];if(next==42){precision=getNextArg('i32');textIndex++;}else{while(1){var precisionChr=HEAP8[textIndex+1|0];if(precisionChr<48||precisionChr>57)break;precision=precision*10+(precisionChr-48);textIndex++;}}next=HEAP8[textIndex+1|0];}else{var precision=6;// Standard default.\n}// Handle integer sizes. WARNING: These assume a 32-bit architecture!\nvar argSize;switch(String.fromCharCode(next)){case'h':var nextNext=HEAP8[textIndex+2|0];if(nextNext==104){textIndex++;argSize=1;// char (actually i32 in varargs)\n}else{argSize=2;// short (actually i32 in varargs)\n}break;case'l':var nextNext=HEAP8[textIndex+2|0];if(nextNext==108){textIndex++;argSize=8;// long long\n}else{argSize=4;// long\n}break;case'L':// long long\ncase'q':// int64_t\ncase'j':// intmax_t\nargSize=8;break;case'z':// size_t\ncase't':// ptrdiff_t\ncase'I':// signed ptrdiff_t or unsigned size_t\nargSize=4;break;default:argSize=null;}if(argSize)textIndex++;next=HEAP8[textIndex+1|0];// Handle type specifier.\nswitch(String.fromCharCode(next)){case'd':case'i':case'u':case'o':case'x':case'X':case'p':{// Integer.\nvar signed=next==100||next==105;argSize=argSize||4;var currArg=getNextArg('i'+argSize*8);var origArg=currArg;var argText;// Flatten i64-1 [low, high] into a (slightly rounded) double\nif(argSize==8){currArg=Runtime.makeBigInt(currArg[0],currArg[1],next==117);}// Truncate to requested size.\nif(argSize<=4){var limit=Math.pow(256,argSize)-1;currArg=(signed?reSign:unSign)(currArg&limit,argSize*8);}// Format the number.\nvar currAbsArg=Math.abs(currArg);var prefix='';if(next==100||next==105){if(argSize==8&&i64Math)argText=i64Math.stringify(origArg[0],origArg[1],null);else argText=reSign(currArg,8*argSize,1).toString(10);}else if(next==117){if(argSize==8&&i64Math)argText=i64Math.stringify(origArg[0],origArg[1],true);else argText=unSign(currArg,8*argSize,1).toString(10);currArg=Math.abs(currArg);}else if(next==111){argText=(flagAlternative?'0':'')+currAbsArg.toString(8);}else if(next==120||next==88){prefix=flagAlternative&&currArg!=0?'0x':'';if(argSize==8&&i64Math){if(origArg[1]){argText=(origArg[1]>>>0).toString(16);var lower=(origArg[0]>>>0).toString(16);while(lower.length<8){lower='0'+lower;}argText+=lower;}else{argText=(origArg[0]>>>0).toString(16);}}else if(currArg<0){// Represent negative numbers in hex as 2's complement.\ncurrArg=-currArg;argText=(currAbsArg-1).toString(16);var buffer=[];for(var i=0;i=0){if(flagAlwaysSigned){prefix='+'+prefix;}else if(flagPadSign){prefix=' '+prefix;}}// Move sign to prefix so we zero-pad after the sign\nif(argText.charAt(0)=='-'){prefix='-'+prefix;argText=argText.substr(1);}// Add padding.\nwhile(prefix.length+argText.lengthexponent&&exponent>=-4){next=(next==103?'f':'F').charCodeAt(0);precision-=exponent+1;}else{next=(next==103?'e':'E').charCodeAt(0);precision--;}effectivePrecision=Math.min(precision,20);}if(next==101||next==69){argText=currArg.toExponential(effectivePrecision);// Make sure the exponent has at least 2 digits.\nif(/[eE][-+]\\d$/.test(argText)){argText=argText.slice(0,-1)+'0'+argText.slice(-1);}}else if(next==102||next==70){argText=currArg.toFixed(effectivePrecision);if(currArg===0&&__reallyNegative(currArg)){argText='-'+argText;}}var parts=argText.split('e');if(isGeneral&&!flagAlternative){// Discard trailing zeros and periods.\nwhile(parts[0].length>1&&parts[0].indexOf('.')!=-1&&(parts[0].slice(-1)=='0'||parts[0].slice(-1)=='.')){parts[0]=parts[0].slice(0,-1);}}else{// Make sure we have a period in alternative mode.\nif(flagAlternative&&argText.indexOf('.')==-1)parts[0]+='.';// Zero pad until required precision.\nwhile(precision>effectivePrecision++){parts[0]+='0';}}argText=parts[0]+(parts.length>1?'e'+parts[1]:'');// Capitalize 'E' if needed.\nif(next==69)argText=argText.toUpperCase();// Add sign.\nif(currArg>=0){if(flagAlwaysSigned){argText='+'+argText;}else if(flagPadSign){argText=' '+argText;}}}// Add padding.\nwhile(argText.length0){ret.push(32);}if(!flagLeftAlign)ret.push(getNextArg('i8'));break;}case'n':{// Write the length written so far to the next parameter.\nvar ptr=getNextArg('i32*');HEAP32[ptr>>2]=ret.length;break;}case'%':{// Literal percent sign.\nret.push(curr);break;}default:{// Unknown specifiers remain untouched.\nfor(var i=startTextIndex;i0){HEAP8[ptr++|0]=streamObj.ungotten.pop();bytesToRead--;bytesRead++;}var err=_read(stream,ptr,bytesToRead);if(err==-1){if(streamObj)streamObj.error=true;return 0;}bytesRead+=err;if(bytesRead>2];return _fprintf(stdout,format,varargs);}Module['_memset']=_memset;var _llvm_memset_p0i8_i32=_memset;Module['_memcpy']=_memcpy;var _llvm_memcpy_p0i8_p0i8_i32=_memcpy;var _llvm_pow_f64=Math_pow;var _sin=Math_sin;function _strrchr(ptr,chr){var ptr2=ptr+_strlen(ptr);do{if(HEAP8[ptr2]==chr)return ptr2;ptr2--;}while(ptr2>=ptr);return 0;}var ___strtok_state=0;function _strtok_r(s,delim,lasts){var skip_leading_delim=1;var spanp;var c,sc;var tok;if(s==0&&(s=getValue(lasts,'i8*'))==0){return 0;}cont:while(1){c=getValue(s++,'i8');for(spanp=delim;(sc=getValue(spanp++,'i8'))!=0;){if(c==sc){if(skip_leading_delim){continue cont;}else{setValue(lasts,s,'i8*');setValue(s-1,0,'i8');return s-1;}}}break;}if(c==0){setValue(lasts,0,'i8*');return 0;}tok=s-1;for(;;){c=getValue(s++,'i8');spanp=delim;do{if((sc=getValue(spanp++,'i8'))==c){if(c==0){s=0;}else{setValue(s-1,0,'i8');}setValue(lasts,s,'i8*');return tok;}}while(sc!=0);}abort('strtok_r error!');}function _strtok(s,delim){return _strtok_r(s,delim,___strtok_state);}function _strncmp(px,py,n){var i=0;while(iy?1:-1;}}return 0;}function _strcmp(px,py){return _strncmp(px,py,TOTAL_MEMORY);}Module['_strncpy']=_strncpy;function _isspace(chr){return chr==32||chr>=9&&chr<=13;}function __parseInt(str,endptr,base,min,max,bits,unsign){// Skip space.\nwhile(_isspace(HEAP8[str])){str++;}// Check for a plus/minus sign.\nvar multiplier=1;if(HEAP8[str]==45){multiplier=-1;str++;}else if(HEAP8[str]==43){str++;}// Find base.\nvar finalBase=base;if(!finalBase){if(HEAP8[str]==48){if(HEAP8[str+1|0]==120||HEAP8[str+1|0]==88){finalBase=16;str+=2;}else{finalBase=8;str++;}}}else if(finalBase==16){if(HEAP8[str]==48){if(HEAP8[str+1|0]==120||HEAP8[str+1|0]==88){str+=2;}}}if(!finalBase)finalBase=10;// Get digits.\nvar chr;var ret=0;while((chr=HEAP8[str])!=0){var digit=parseInt(String.fromCharCode(chr),finalBase);if(isNaN(digit)){break;}else{ret=ret*finalBase+digit;str++;}}// Apply sign.\nret*=multiplier;// Set end pointer.\nif(endptr){HEAP32[endptr>>2]=str;}// Unsign if needed.\nif(unsign){if(Math.abs(ret)>max){ret=max;___setErrNo(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ERANGE);}else{ret=unSign(ret,bits);}}// Validate range.\nif(ret>max||retmax?max:min;___setErrNo(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ERANGE);}if(bits==64){return(asm['setTempRet0']((tempDouble=ret,+Math_abs(tempDouble)>=+1?tempDouble>+0?(Math_min(+Math_floor(tempDouble/+4294967296),+4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/+4294967296)>>>0:0)),ret>>>0)|0;}return ret;}function _strtol(str,endptr,base){return __parseInt(str,endptr,base,-2147483648,2147483647,32);// LONG_MIN, LONG_MAX.\n}function _atoi(ptr){return _strtol(ptr,null,10);}function _strchr(ptr,chr){ptr--;do{ptr++;var val=HEAP8[ptr];if(val==chr)return ptr;}while(val);return 0;}function _abort(){Module['abort']();}function ___errno_location(){return ___errno_state;}function _sbrk(bytes){// Implement a Linux-like 'memory area' for our 'process'.\n// Changes the size of the memory area by |bytes|; returns the\n// address of the previous top ('break') of the memory area\n// We control the \"dynamic\" memory - DYNAMIC_BASE to DYNAMICTOP\nvar self=_sbrk;if(!self.called){DYNAMICTOP=alignMemoryPage(DYNAMICTOP);// make sure we start out aligned\nself.called=true;assert(Runtime.dynamicAlloc);self.alloc=Runtime.dynamicAlloc;Runtime.dynamicAlloc=function(){abort('cannot dynamically allocate, sbrk now has control');};}var ret=DYNAMICTOP;if(bytes!=0)self.alloc(bytes);return ret;// Previous break location.\n}function _sysconf(name){// long sysconf(int name);\n// http://pubs.opengroup.org/onlinepubs/009695399/functions/sysconf.html\nswitch(name){case 30:return PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 79:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1000;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return 1;}___setErrNo(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);return-1;}function _time(ptr){var ret=Math.floor(Date.now()/1000);if(ptr){HEAP32[ptr>>2]=ret;}return ret;}var Browser={mainLoop:{scheduler:null,shouldPause:false,paused:false,queue:[],pause:function pause(){Browser.mainLoop.shouldPause=true;},resume:function resume(){if(Browser.mainLoop.paused){Browser.mainLoop.paused=false;Browser.mainLoop.scheduler();}Browser.mainLoop.shouldPause=false;},updateStatus:function updateStatus(){if(Module['setStatus']){var message=Module['statusMessage']||'Please wait...';var remaining=Browser.mainLoop.remainingBlockers;var expected=Browser.mainLoop.expectedBlockers;if(remaining){if(remaining=6){var curr=leftchar>>leftbits-6&0x3f;leftbits-=6;ret+=BASE[curr];}}if(leftbits==2){ret+=BASE[(leftchar&3)<<4];ret+=PAD+PAD;}else if(leftbits==4){ret+=BASE[(leftchar&0xf)<<2];ret+=PAD;}return ret;}audio.src='data:audio/x-'+name.substr(-3)+';base64,'+encode64(byteArray);finish(audio);// we don't wait for confirmation this worked - but it's worth trying\n};audio.src=url;// workaround for chrome bug 124926 - we do not always get oncanplaythrough or onerror\nBrowser.safeSetTimeout(function(){finish(audio);// try to use it even though it is not necessarily ready to play\n},10000);}else{return fail();}};Module['preloadPlugins'].push(audioPlugin);// Canvas event setup\nvar canvas=Module['canvas'];canvas.requestPointerLock=canvas['requestPointerLock']||canvas['mozRequestPointerLock']||canvas['webkitRequestPointerLock'];canvas.exitPointerLock=document['exitPointerLock']||document['mozExitPointerLock']||document['webkitExitPointerLock']||function(){};// no-op if function does not exist\ncanvas.exitPointerLock=canvas.exitPointerLock.bind(document);function pointerLockChange(){Browser.pointerLock=document['pointerLockElement']===canvas||document['mozPointerLockElement']===canvas||document['webkitPointerLockElement']===canvas;}document.addEventListener('pointerlockchange',pointerLockChange,false);document.addEventListener('mozpointerlockchange',pointerLockChange,false);document.addEventListener('webkitpointerlockchange',pointerLockChange,false);if(Module['elementPointerLock']){canvas.addEventListener('click',function(ev){if(!Browser.pointerLock&&canvas.requestPointerLock){canvas.requestPointerLock();ev.preventDefault();}},false);}},createContext:function createContext(canvas,useWebGL,setInModule){var ctx;try{if(useWebGL){ctx=canvas.getContext('experimental-webgl',{alpha:false});}else{ctx=canvas.getContext('2d');}if(!ctx)throw':(';}catch(e){console.error('Could not create canvas - '+e);return null;}if(useWebGL){// Set the background of the WebGL canvas to black\ncanvas.style.backgroundColor='black';// Warn on context loss\ncanvas.addEventListener('webglcontextlost',function(event){alert('WebGL context lost. You will need to reload the page.');},false);}if(setInModule){Module.ctx=ctx;Module.useWebGL=useWebGL;Browser.moduleContextCreatedCallbacks.forEach(function(callback){callback();});Browser.init();}return ctx;},destroyContext:function destroyContext(canvas,useWebGL,setInModule){},fullScreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullScreen:function requestFullScreen(lockPointer,resizeCanvas){Browser.lockPointer=lockPointer;Browser.resizeCanvas=resizeCanvas;if(typeof Browser.lockPointer==='undefined')Browser.lockPointer=true;if(typeof Browser.resizeCanvas==='undefined')Browser.resizeCanvas=false;var canvas=Module['canvas'];function fullScreenChange(){Browser.isFullScreen=false;if((document['webkitFullScreenElement']||document['webkitFullscreenElement']||document['mozFullScreenElement']||document['mozFullscreenElement']||document['fullScreenElement']||document['fullscreenElement'])===canvas){canvas.cancelFullScreen=document['cancelFullScreen']||document['mozCancelFullScreen']||document['webkitCancelFullScreen'];canvas.cancelFullScreen=canvas.cancelFullScreen.bind(document);if(Browser.lockPointer)canvas.requestPointerLock();Browser.isFullScreen=true;if(Browser.resizeCanvas)Browser.setFullScreenCanvasSize();}else if(Browser.resizeCanvas){Browser.setWindowedCanvasSize();}if(Module['onFullScreen'])Module['onFullScreen'](Browser.isFullScreen);}if(!Browser.fullScreenHandlersInstalled){Browser.fullScreenHandlersInstalled=true;document.addEventListener('fullscreenchange',fullScreenChange,false);document.addEventListener('mozfullscreenchange',fullScreenChange,false);document.addEventListener('webkitfullscreenchange',fullScreenChange,false);}canvas.requestFullScreen=canvas['requestFullScreen']||canvas['mozRequestFullScreen']||(canvas['webkitRequestFullScreen']?function(){canvas['webkitRequestFullScreen'](Element['ALLOW_KEYBOARD_INPUT']);}:null);canvas.requestFullScreen();},requestAnimationFrame:function requestAnimationFrame(func){if(!window.requestAnimationFrame){window.requestAnimationFrame=window['requestAnimationFrame']||window['mozRequestAnimationFrame']||window['webkitRequestAnimationFrame']||window['msRequestAnimationFrame']||window['oRequestAnimationFrame']||window['setTimeout'];}window.requestAnimationFrame(func);},safeCallback:function safeCallback(func){return function(){if(!ABORT)return func.apply(null,arguments);};},safeRequestAnimationFrame:function safeRequestAnimationFrame(func){return Browser.requestAnimationFrame(function(){if(!ABORT)func();});},safeSetTimeout:function safeSetTimeout(func,timeout){return setTimeout(function(){if(!ABORT)func();},timeout);},safeSetInterval:function safeSetInterval(func,timeout){return setInterval(function(){if(!ABORT)func();},timeout);},getMimetype:function getMimetype(name){return{jpg:'image/jpeg',jpeg:'image/jpeg',png:'image/png',bmp:'image/bmp',ogg:'audio/ogg',wav:'audio/wav',mp3:'audio/mpeg'}[name.substr(name.lastIndexOf('.')+1)];},getUserMedia:function getUserMedia(func){if(!window.getUserMedia){window.getUserMedia=navigator['getUserMedia']||navigator['mozGetUserMedia'];}window.getUserMedia(func);},getMovementX:function getMovementX(event){return event['movementX']||event['mozMovementX']||event['webkitMovementX']||0;},getMovementY:function getMovementY(event){return event['movementY']||event['mozMovementY']||event['webkitMovementY']||0;},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,calculateMouseEvent:function calculateMouseEvent(event){// event should be mousemove, mousedown or mouseup\nif(Browser.pointerLock){// When the pointer is locked, calculate the coordinates\n// based on the movement of the mouse.\n// Workaround for Firefox bug 764498\nif(event.type!='mousemove'&&'mozMovementX'in event){Browser.mouseMovementX=Browser.mouseMovementY=0;}else{Browser.mouseMovementX=Browser.getMovementX(event);Browser.mouseMovementY=Browser.getMovementY(event);}// check if SDL is available\nif(typeof SDL!='undefined'){Browser.mouseX=SDL.mouseX+Browser.mouseMovementX;Browser.mouseY=SDL.mouseY+Browser.mouseMovementY;}else{// just add the mouse delta to the current absolut mouse position\n// FIXME: ideally this should be clamped against the canvas size and zero\nBrowser.mouseX+=Browser.mouseMovementX;Browser.mouseY+=Browser.mouseMovementY;}}else{// Otherwise, calculate the movement based on the changes\n// in the coordinates.\nvar rect=Module['canvas'].getBoundingClientRect();var x,y;if(event.type=='touchstart'||event.type=='touchend'||event.type=='touchmove'){var t=event.touches.item(0);if(t){x=t.pageX-(window.scrollX+rect.left);y=t.pageY-(window.scrollY+rect.top);}else{return;}}else{x=event.pageX-(window.scrollX+rect.left);y=event.pageY-(window.scrollY+rect.top);}// the canvas might be CSS-scaled compared to its backbuffer;\n// SDL-using content will want mouse coordinates in terms\n// of backbuffer units.\nvar cw=Module['canvas'].width;var ch=Module['canvas'].height;x=x*(cw/rect.width);y=y*(ch/rect.height);Browser.mouseMovementX=x-Browser.mouseX;Browser.mouseMovementY=y-Browser.mouseY;Browser.mouseX=x;Browser.mouseY=y;}},xhrLoad:function xhrLoad(url,onload,onerror){var xhr=new XMLHttpRequest();xhr.open('GET',url,true);xhr.responseType='arraybuffer';xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){// file URLs can return 0\nonload(xhr.response);}else{onerror();}};xhr.onerror=onerror;xhr.send(null);},asyncLoad:function asyncLoad(url,onload,onerror,noRunDep){Browser.xhrLoad(url,function(arrayBuffer){assert(arrayBuffer,'Loading data file \"'+url+'\" failed (no arrayBuffer).');onload(new Uint8Array(arrayBuffer));if(!noRunDep)removeRunDependency('al '+url);},function(){if(onerror){onerror();}else{throw'Loading data file \"'+url+'\" failed.';}});if(!noRunDep)addRunDependency('al '+url);},resizeListeners:[],updateResizeListeners:function updateResizeListeners(){var canvas=Module['canvas'];Browser.resizeListeners.forEach(function(listener){listener(canvas.width,canvas.height);});},setCanvasSize:function setCanvasSize(width,height,noUpdates){var canvas=Module['canvas'];canvas.width=width;canvas.height=height;if(!noUpdates)Browser.updateResizeListeners();},windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function setFullScreenCanvasSize(){var canvas=Module['canvas'];this.windowedWidth=canvas.width;this.windowedHeight=canvas.height;canvas.width=screen.width;canvas.height=screen.height;// check if SDL is available\nif(typeof SDL!='undefined'){var flags=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];flags=flags|0x00800000;// set SDL_FULLSCREEN flag\nHEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=flags;}Browser.updateResizeListeners();},setWindowedCanvasSize:function setWindowedCanvasSize(){var canvas=Module['canvas'];canvas.width=this.windowedWidth;canvas.height=this.windowedHeight;// check if SDL is available\nif(typeof SDL!='undefined'){var flags=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];flags=flags&~0x00800000;// clear SDL_FULLSCREEN flag\nHEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=flags;}Browser.updateResizeListeners();}};FS.staticInit();__ATINIT__.unshift({func:function func(){if(!Module['noFSInit']&&!FS.init.initialized)FS.init();}});__ATMAIN__.push({func:function func(){FS.ignorePermissions=false;}});__ATEXIT__.push({func:function func(){FS.quit();}});Module['FS_createFolder']=FS.createFolder;Module.createPath=FS.createPath;Module.createDataFile=FS.createDataFile;Module.loadPatchFromUrl=FS.loadPatchFromUrl;Module['FS_createPreloadedFile']=FS.createPreloadedFile;Module['FS_createLazyFile']=FS.createLazyFile;Module['FS_createLink']=FS.createLink;Module['FS_createDevice']=FS.createDevice;___errno_state=Runtime.staticAlloc(4);HEAP32[___errno_state>>2]=0;__ATINIT__.unshift({func:function func(){TTY.init();}});__ATEXIT__.push({func:function func(){TTY.shutdown();}});TTY.utf8=new Runtime.UTF8Processor();__ATINIT__.push({func:function func(){SOCKFS.root=FS.mount(SOCKFS,{},null);}});___strtok_state=Runtime.staticAlloc(4);Module['requestFullScreen']=function(lockPointer,resizeCanvas){Browser.requestFullScreen(lockPointer,resizeCanvas);};Module['requestAnimationFrame']=function(func){Browser.requestAnimationFrame(func);};Module['setCanvasSize']=function(width,height,noUpdates){Browser.setCanvasSize(width,height,noUpdates);};Module['pauseMainLoop']=function(){Browser.mainLoop.pause();};Module['resumeMainLoop']=function(){Browser.mainLoop.resume();};Module['getUserMedia']=function(){Browser.getUserMedia();};STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP);STACK_MAX=STACK_BASE+5242880;DYNAMIC_BASE=DYNAMICTOP=Runtime.alignMemory(STACK_MAX);assert(DYNAMIC_BASE>2]|0)|0;if((l|0)!=0){m=e|0;n=c[b>>2]|0;c2(m|0,n|0)|0;if((a[e+(l-1)|0]|0)!=47){a[e+l|0]=47;a[e+(l+1)|0]=0;}}c3(e|0,f|0)|0;l=av(e|0,6576)|0;g=l;if((l|0)!=0){break;}b=c[b+4>>2]|0;}if((k|0)==16){break;}h=g;j=h;i=d;return j|0;}}while(0);h=0;j=h;i=d;return j|0;}}while(0);h=0;j=h;i=d;return j|0;}function bi(a){a=a|0;var b=0;b=c$(a)|0;return b|0;}function bj(a){a=a|0;var b=0,d=0,e=0;b=a;a=bi(8)|0;if((a|0)==0){return;}c[a>>2]=bi((c1(b|0)|0)+1|0)|0;if((c[a>>2]|0)==0){c0(a);return;}else{d=c[a>>2]|0;e=b;c2(d|0,e|0)|0;c[a+4>>2]=c[1664];c[1664]=a;return;}}function bk(){var a=0,b=0;a=c[1664]|0;while(1){if((a|0)==0){break;}b=c[a+4>>2]|0;c0(c[a>>2]|0);c0(a);a=b;}c[1664]=0;return;}function bl(f,h,j,k,l,n,o,p,q){f=f|0;h=h|0;j=j|0;k=k|0;l=l|0;n=n|0;o=o|0;p=p|0;q=q|0;var r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;j=i;i=i+1056|0;r=j|0;s=j+1024|0;t=j+1032|0;u=j+1040|0;v=j+1048|0;w=f;f=h;h=k;k=l;l=n;n=o;o=p;p=q;q=0;if((f|0)==0){x=0;y=x;i=j;return y|0;}z=bh(f)|0;A=z;if((z|0)==0){z=c[m>>2]|0;ar(z|0,6512,(z=i,i=i+1|0,i=i+7&-8,c[z>>2]=0,z)|0)|0;i=z;q=1;B=0;while(1){if((c[1048+(B<<2)>>2]|0)==0){break;}z=c1(f|0)|0;if((z+(c1(c[1048+(B<<2)>>2]|0)|0)|0)>>>0<1024){z=r|0;C=f;c2(z|0,C|0)|0;C=r|0;z=c[1048+(B<<2)>>2]|0;c3(C|0,z|0)|0;z=bh(r|0)|0;A=z;if((z|0)!=0){D=46;break;}}B=B+1|0;}if((D|0)==46){q=0;f=r|0;}}if((q|0)!=0){x=0;y=x;i=j;return y|0;}do{if(239==(an(r|0,1,239,A|0)|0)){if((c4(r|0,6248,22)|0)!=0){if((c4(r|0,5888,22)|0)!=0){break;}}do{if((a[r+82|0]|0)!=1){if((a[r+82|0]|0)==0){break;}x=0;y=x;i=j;return y|0;}}while(0);do{if((a[r+151|0]|0)!=1){if((a[r+151|0]|0)==0){break;}x=0;y=x;i=j;return y|0;}}while(0);q=bi(8)|0;c[q>>2]=a[r+198|0]|0;c[q+4>>2]=bi((c[q>>2]|0)*116|0)|0;B=0;while(1){if((B|0)>=(c[q>>2]|0)){D=162;break;}aB(A|0,7,1)|0;if(1!=(an(s|0,1,1,A|0)|0)){D=66;break;}f=(c[q+4>>2]|0)+(B*116|0)|0;if(1!=(an(t|0,4,1,A|0)|0)){D=73;break;}c[f+8>>2]=c[t>>2];if(1!=(an(t|0,4,1,A|0)|0)){D=75;break;}c[f>>2]=c[t>>2];if(1!=(an(t|0,4,1,A|0)|0)){D=77;break;}c[f+4>>2]=c[t>>2];if(1!=(an(u|0,2,1,A|0)|0)){D=79;break;}c[f+12>>2]=e[u>>1]|0;if(1!=(an(t|0,4,1,A|0)|0)){D=81;break;}c[f+24>>2]=c[t>>2];if(1!=(an(t|0,4,1,A|0)|0)){D=83;break;}c[f+28>>2]=c[t>>2];if(1!=(an(t|0,4,1,A|0)|0)){D=85;break;}c[f+32>>2]=c[t>>2];c[f+16>>2]=0;c[f+20>>2]=127;aB(A|0,2,1)|0;if(1!=(an(v|0,1,1,A|0)|0)){D=87;break;}a[r|0]=a[v]|0;if((h|0)==-1){a[f+111|0]=(a[r|0]<<3)+4&127;}else{a[f+111|0]=h&127;}if(18!=(an(r|0,1,18,A|0)|0)){D=92;break;}do{if((a[r+13|0]|0)!=0){if((a[r+14|0]|0)==0){D=95;break;}c[f+92>>2]=bm(w,a[r+12|0]|0)|0;c[f+96>>2]=bn(w,a[r+13|0]|0)|0;a[f+108|0]=a[r+14|0]|0;}else{D=95;}}while(0);if((D|0)==95){D=0;a[f+108|0]=0;c[f+96>>2]=0;c[f+92>>2]=0;}do{if((a[r+16|0]|0)!=0){if((a[r+17|0]|0)==0){D=99;break;}c[f+104>>2]=bo(w,a[r+16|0]|0)|0;c[f+100>>2]=bp(w,a[r+15|0]|0,c[f+104>>2]|0)|0;a[f+109|0]=a[r+17|0]|0;}else{D=99;}}while(0);if((D|0)==99){D=0;a[f+109|0]=0;c[f+104>>2]=0;c[f+100>>2]=0;}if(1!=(an(v|0,1,1,A|0)|0)){D=102;break;}a[f+110|0]=a[v]|0;aB(A|0,40,1)|0;if((l|0)!=-1){a[f+112|0]=l&255;}else{a[f+112|0]=0;}if((a[f+110|0]&4|0)!=0){z=f+110|0;a[z]=(d[z]|32)&255;}do{if((n|0)==1){if((a[f+110|0]&60|0)==0){break;}z=f+110|0;a[z]=d[z]&-61&255;}}while(0);if((o|0)==1){(a[f+110|0]&64|0)!=0;z=f+110|0;a[z]=d[z]&-65&255;}else{if((o|0)!=0){if((a[f+110|0]&28|0)!=0){do{if((c4(r|0,5512,6)|0)!=0){if((a[r+11|0]|0)>=100){D=120;break;}if((a[f+110|0]&32|0)==0){z=f+110|0;a[z]=d[z]&-65&255;}}else{D=120;}}while(0);if((D|0)==120){D=0;z=f+110|0;a[z]=d[z]&-65&255;}}else{z=f+110|0;a[z]=d[z]&-97&255;}}}E=0;while(1){if((E|0)>=6){break;}c[f+36+(E<<2)>>2]=bq(w,a[r+E|0]|0)|0;c[f+60+(E<<2)>>2]=br(a[r+(E+6)|0]|0)|0;E=E+1|0;}c[f+88>>2]=bi(c[f+8>>2]|0)|0;if(1!=(an(c[f+88>>2]|0,c[f+8>>2]|0,1,A|0)|0)){D=132;break;}if((a[f+110|0]&1|0)==0){z=c[f+8>>2]|0;C=c[f+88>>2]|0;F=bi(c[f+8>>2]<<1)|0;G=F;H=F;while(1){F=z;z=F-1|0;if((F|0)==0){break;}F=C;C=F+1|0;I=H;H=I+2|0;b[I>>1]=(a[F]&255)<<8&65535;}C=c[f+88>>2]|0;c[f+88>>2]=G;c0(C);H=f+8|0;c[H>>2]=c[H>>2]<<1;H=f|0;c[H>>2]=c[H>>2]<<1;H=f+4|0;c[H>>2]=c[H>>2]<<1;}if((a[f+110|0]&2|0)!=0){H=(c[f+8>>2]|0)/2|0;z=c[f+88>>2]|0;while(1){F=H;H=F-1|0;if((F|0)==0){break;}F=z;z=F+2|0;b[F>>1]=(b[F>>1]^32768)&65535;}}if((a[f+110|0]&16|0)!=0){bs(c[f+88>>2]|0,0,(c[f+8>>2]|0)/2|0);z=c[f>>2]|0;c[f>>2]=(c[f+8>>2]|0)-(c[f+4>>2]|0);c[f+4>>2]=(c[f+8>>2]|0)-z;z=f+110|0;a[z]=d[z]&-17&255;z=f+110|0;a[z]=(d[z]|4)&255;}if((k|0)!=-1){g[f+84>>2]=+(k|0)/100.0;}else{z=(c[f+8>>2]|0)/2|0;H=0;C=c[f+88>>2]|0;while(1){G=z;z=G-1|0;if((G|0)==0){break;}G=C;C=G+2|0;F=b[G>>1]|0;if((F<<16>>16|0)<0){F=-(F<<16>>16)&65535;}if((F<<16>>16|0)>(H<<16>>16|0)){H=F;}}g[f+84>>2]=32768.0/+(H<<16>>16|0);}C=f+8|0;c[C>>2]=(c[C>>2]|0)/2|0;C=f|0;c[C>>2]=(c[C>>2]|0)/2|0;C=f+4|0;c[C>>2]=(c[C>>2]|0)/2|0;C=f+8|0;c[C>>2]=c[C>>2]<<12;C=f|0;c[C>>2]=c[C>>2]<<12;C=f+4|0;c[C>>2]=c[C>>2]<<12;C=f|0;c[C>>2]=c[C>>2]|(a[s]&15)<<8;C=f+4|0;c[C>>2]=c[C>>2]|(d[s]>>4&15)<<8;do{if((a[f+112|0]|0)!=0){if((a[f+110|0]&4|0)!=0){break;}cF(w,f);}}while(0);if((p|0)==1){c[f+8>>2]=c[f+4>>2];}B=B+1|0;}if((D|0)!=66)if((D|0)!=73)if((D|0)!=75)if((D|0)!=77)if((D|0)!=79)if((D|0)!=81)if((D|0)!=83)if((D|0)!=85)if((D|0)!=87)if((D|0)!=92)if((D|0)!=102)if((D|0)!=132)if((D|0)==162){ao(A|0)|0;x=q;y=x;i=j;return y|0;}E=0;while(1){if((E|0)>=(B|0)){break;}c0(c[(c[q+4>>2]|0)+(E*116|0)+88>>2]|0);E=E+1|0;}c0(c[q+4>>2]|0);c0(q);x=0;y=x;i=j;return y|0;}}while(0);x=0;y=x;i=j;return y|0;}function bm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=a;a=b;if(a<<24>>24!=0){b=((c[d+13060>>2]|0)*38|0)<<16;e=(b|0)/(_(c[d+4>>2]|0,a&255)|0)|0;f=e;return f|0;}else{e=0;f=e;return f|0;}return 0;}function bn(a,b){a=a|0;b=b|0;var d=0;d=a;a=(_(c[d+13060>>2]<<10,b&255)|0)<<5;return(a|0)/((c[d+4>>2]|0)*38|0|0)|0|0;}function bo(a,b){a=a|0;b=b|0;return((c[a+4>>2]|0)*38|0|0)/((b&255)<<1<<5|0)|0|0;}function bp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=b;if(e<<24>>24!=0){f=~~(+(d|0)*38.0*65536.0/+(_(c[a+4>>2]|0,e&255)|0));g=f;return g|0;}else{f=0;g=f;return g|0;}return 0;}function bq(a,b){a=a|0;b=b|0;var d=0;d=a;a=b;b=3-((a&255)>>6&3)|0;b=b*3|0;b=(a&63)<>2]|0)|0,c[d+13060>>2]|0)|0;return b<<10|0;}function br(a){a=a|0;return(a&255)<<22|0;}function bs(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,f=0;e=a;a=c;c=d;d=e+(c<<1)|0;e=e+(a<<1)|0;c=c-a|0;c=(c|0)/2|0;while(1){a=c;c=a-1|0;if((a|0)==0){break;}a=b[e>>1]|0;f=e;e=f+2|0;b[f>>1]=b[d>>1]|0;f=d;d=f-2|0;b[f>>1]=a;}return;}function bt(a){a=a|0;return c[a+13136>>2]|0;}function bu(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=a;a=b;do{if((a|0)>=0){// stops when reached last instrument\nif((a|0)>=(c[d+13136>>2]|0)){break;}// path to patch file\ne=c[d+13140+(a<<2)>>2]|0;f=e;return f|0;}}while(0);e=0;f=e;return f|0;}function bv(a){a=a|0;var b=0,d=0,e=0;b=a;a=128;d=0;c[b+13136>>2]=0;while(1){e=a;a=e-1|0;if((e|0)==0){break;}if((c[b+28+(a<<2)>>2]|0)!=0){d=d+(bw(b,0,a)|0)|0;}if((c[b+540+(a<<2)>>2]|0)!=0){d=d+(bw(b,1,a)|0)|0;}}return d|0;}function bw(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;e=i;f=a;a=b;b=d;d=0;if((a|0)!=0){g=c[f+540+(b<<2)>>2]|0;}else{g=c[f+28+(b<<2)>>2]|0;}h=g;if((h|0)==0){j=0;k=j;i=e;return k|0;}g=0;while(1){if((g|0)>=128){break;}do{if((c[h+4+(g<<2)>>2]|0)==-1){c[h+4+(g<<2)>>2]=bB(f,a,b,g)|0;if((c[h+4+(g<<2)>>2]|0)!=0){break;}if((c[(c[h>>2]|0)+(g*28|0)>>2]|0)!=0){l=f;n=c[(c[h>>2]|0)+(g*28|0)>>2]|0;o=(a|0)!=0?1:0;p=c[(c[h>>2]|0)+(g*28|0)+12>>2]|0;q=c[(c[h>>2]|0)+(g*28|0)+8>>2]|0;if((c[(c[h>>2]|0)+(g*28|0)+4>>2]|0)!=-1){r=c[(c[h>>2]|0)+(g*28|0)+4>>2]|0;}else{if((a|0)!=0){s=g;}else{s=-1;}r=s;}if((c[(c[h>>2]|0)+(g*28|0)+16>>2]|0)!=-1){t=c[(c[h>>2]|0)+(g*28|0)+16>>2]|0;}else{t=(a|0)!=0?1:-1;}if((c[(c[h>>2]|0)+(g*28|0)+20>>2]|0)!=-1){u=c[(c[h>>2]|0)+(g*28|0)+20>>2]|0;}else{u=(a|0)!=0?1:-1;}v=bl(l,n,o,p,q,r,t,u,c[(c[h>>2]|0)+(g*28|0)+24>>2]|0)|0;c[h+4+(g<<2)>>2]=v;if((v|0)==0){v=c[m>>2]|0;q=c[(c[h>>2]|0)+(g*28|0)>>2]|0;ar(v|0,5120,(v=i,i=i+8|0,c[v>>2]=q,v)|0)|0;i=v;if((c[f+13136>>2]|0)<256){q=c[m>>2]|0;p=c[f+13136>>2]|0;ar(q|0,4856,(v=i,i=i+8|0,c[v>>2]=p,v)|0)|0;i=v;c[f+13140+(c[f+13136>>2]<<2)>>2]=c[(c[h>>2]|0)+(g*28|0)>>2];v=f+13136|0;c[v>>2]=(c[v>>2]|0)+1;}d=d+1|0;}}else{if((b|0)!=0){if((a|0)!=0){if((c[(c[f+540>>2]|0)+4+(g<<2)>>2]|0)==0){c[(c[f+540>>2]|0)+4+(g<<2)>>2]=-1;}}else{if((c[(c[f+28>>2]|0)+4+(g<<2)>>2]|0)==0){c[(c[f+28>>2]|0)+4+(g<<2)>>2]=-1;}}}c[h+4+(g<<2)>>2]=0;d=d+1|0;}w=246;}else{w=246;}}while(0);if((w|0)==246){w=0;}g=g+1|0;}j=d;k=j;i=e;return k|0;}function bx(a){a=a|0;var b=0,d=0;b=a;a=128;while(1){d=a;a=d-1|0;if((d|0)==0){break;}if((c[b+28+(a<<2)>>2]|0)!=0){by(b,0,a);}if((c[b+540+(a<<2)>>2]|0)!=0){by(b,1,a);}}return;}function by(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=a;a=d;if((b|0)!=0){f=c[e+540+(a<<2)>>2]|0;}else{f=c[e+28+(a<<2)>>2]|0;}a=f;f=0;while(1){if((f|0)>=128){break;}if((c[a+4+(f<<2)>>2]|0)!=0){if((c[a+4+(f<<2)>>2]|0)!=-1){bA(c[a+4+(f<<2)>>2]|0);}c[a+4+(f<<2)>>2]=0;}f=f+1|0;}return;}function bz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=a;a=bl(d,b,0,-1,-1,-1,0,0,0)|0;if((a|0)!=0){c[d+1052>>2]=a;c[d+1056>>2]=-1;e=0;f=e;return f|0;}else{e=-1;f=e;return f|0;}return 0;}function bA(a){a=a|0;var b=0;b=a;if((b|0)==0){return;}a=0;while(1){if((a|0)>=(c[b>>2]|0)){break;}c0(c[(c[b+4>>2]|0)+(a*116|0)+88>>2]|0);a=a+1|0;}c0(c[b+4>>2]|0);c0(b);return;}function bB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=a;a=b;b=d;d=e;if((c[f+24>>2]|0)==0){g=0;h=g;return h|0;}a=(a|0)!=0?-2147483648:0;e=0;L368:while(1){if(e>>>0>=(c[(c[f+24>>2]|0)+4>>2]|0)>>>0){break;}i=(c[(c[f+24>>2]|0)+8>>2]|0)+(e*20|0)|0;do{if((c[(c[i+4>>2]|0)+4>>2]&-2147483648|0)==(a|0)){if(((c[(c[i+4>>2]|0)+4>>2]|0)>>>8&255|0)!=(b|0)){break;}if((c[(c[i+4>>2]|0)+8>>2]|0)==(d|0)){j=295;break L368;}}}while(0);e=e+1|0;}do{if((e|0)==(c[(c[f+24>>2]|0)+4>>2]|0)){if((b|0)!=0){break;}e=0;while(1){if(e>>>0>=(c[(c[f+24>>2]|0)+4>>2]|0)>>>0){break;}i=(c[(c[f+24>>2]|0)+8>>2]|0)+(e*20|0)|0;if((c[(c[i+4>>2]|0)+4>>2]&-2147483648|0)==(a|0)){if((c[(c[i+4>>2]|0)+8>>2]|0)==(d|0)){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|36)&255;c[b>>2]=((c[(c[h+12>>2]|0)+8>>2]|0)>>>0)/2|0;c[b+4>>2]=(c[b>>2]|0)+(((c[(c[h+12>>2]|0)+12>>2]|0)>>>0)/2|0);}g[b+84>>2]=1.0;if((a[b+110|0]&32|0)==0){n=b;o=n+8|0;p=c[o>>2]|0;q=p<<12;c[o>>2]=q;r=b;s=r|0;t=c[s>>2]|0;u=t<<12;c[s>>2]=u;v=b;w=v+4|0;x=c[w>>2]|0;y=x<<12;c[w>>2]=y;return;}m=0;l=0;do{if((c[f+12>>2]|0)!=0){if((c[(c[f+12>>2]|0)+4>>2]|0)>>>0<=0){z=326;break;}if((c[f+16>>2]|0)==0){z=326;break;}m=c[f+12>>2]|0;l=c[f+16>>2]|0;}else{z=326;}}while(0);if((z|0)==326){m=c[h+16>>2]|0;l=c[h+20>>2]|0;}h=bD(c[m+4>>2]|0,l,518)|0;A=+bE(h);h=bD(c[m+4>>2]|0,l,524)|0;B=+bE(h);h=bD(c[m+4>>2]|0,l,519)|0;C=+bE(h);h=bD(c[m+4>>2]|0,l,521)|0;D=+bE(h);h=bD(c[m+4>>2]|0,l,522)|0;z=~~((1.0-+bF(h))*250.0);h=bD(c[m+4>>2]|0,l,4)|0;a[b+111|0]=~~((+bF(h)+0.5)*127.0)&255;c[b+60>>2]=bG(255)|0;c[b+36>>2]=bH(j,255,c[b+12>>2]|0,A)|0;c[b+64>>2]=bG(250)|0;c[b+40>>2]=bH(j,5,c[b+12>>2]|0,B)|0;c[b+68>>2]=bG(z)|0;c[b+44>>2]=bH(j,255-z|0,c[b+12>>2]|0,C)|0;c[b+72>>2]=bG(0)|0;c[b+48>>2]=bH(j,z+5|0,c[b+12>>2]|0,D)|0;c[b+76>>2]=bG(0)|0;c[b+52>>2]=bG(1)|0;c[b+80>>2]=bG(0)|0;c[b+56>>2]=bG(1)|0;z=b+110|0;a[z]=(d[z]|0|64)&255;n=b;o=n+8|0;p=c[o>>2]|0;q=p<<12;c[o>>2]=q;r=b;s=r|0;t=c[s>>2]|0;u=t<<12;c[s>>2]=u;v=b;w=v+4|0;x=c[w>>2]|0;y=x<<12;c[w>>2]=y;return;}function bD(a,b,d){a=a|0;b=b|0;d=d|0;var f=0,g=0,h=0;f=a;a=b;b=d;d=0;g=0;while(1){if(g>>>0>=f>>>0){break;}h=a+(g*12|0)|0;if((e[h+4>>1]|0|0)==(b&65535|0)){do{if((e[h>>1]|0|0)==0){if((e[h+2>>1]|0|0)!=0){break;}if((e[h+6>>1]|0|0)!=0){break;}d=d+(c[h+8>>2]|0)|0;}}while(0);}g=g+1|0;}return d|0;}function bE(a){a=a|0;var b=0,c=0.0,d=0.0;b=a;do{if((b|0)!=-2147483648){if((b|0)==0){break;}c=+P(2.0,+(+((b|0)/65536|0|0)/1200.0))*1.0e3;d=c;return+d;}}while(0);c=0.0;d=c;return+d;}function bF(a){a=a|0;return+(+((a|0)/65536|0|0)/1.0e3);}function bG(a){a=a|0;return a<<22|0;}function bH(a,b,d,e){a=a|0;b=b|0;d=d|0;e=+e;var f=0.0;d=a;a=b;f=e;if(f<6.0){f=6.0;}if((a|0)==0){a=255;}a=a<<22;return~~(+(a|0)/+(c[d+4>>2]|0)*+(c[d+13060>>2]|0)*1.0e3/f)|0;}function bI(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0;f=b;b=e;e=c[f+1724+(b*236|0)+220>>2]|0;if((e|0)>5){a[f+1724+(b*236|0)|0]=0;g=1;h=g;return h|0;}if((a[(c[f+1724+(b*236|0)+4>>2]|0)+110|0]&64|0)!=0){if((d[f+1724+(b*236|0)|0]|0|0)==1){i=361;}else{if((d[f+1724+(b*236|0)|0]|0|0)==2){i=361;}}do{if((i|0)==361){if((e|0)<=2){break;}c[f+1724+(b*236|0)+32>>2]=0;g=0;h=g;return h|0;}}while(0);}c[f+1724+(b*236|0)+220>>2]=e+1;if((c[f+1724+(b*236|0)+24>>2]|0)==(c[(c[f+1724+(b*236|0)+4>>2]|0)+60+(e<<2)>>2]|0)){g=bI(f,b)|0;h=g;return h|0;}c[f+1724+(b*236|0)+28>>2]=c[(c[f+1724+(b*236|0)+4>>2]|0)+60+(e<<2)>>2];c[f+1724+(b*236|0)+32>>2]=c[(c[f+1724+(b*236|0)+4>>2]|0)+36+(e<<2)>>2];if((c[f+1724+(b*236|0)+28>>2]|0)<(c[f+1724+(b*236|0)+24>>2]|0)){c[f+1724+(b*236|0)+32>>2]=-(c[f+1724+(b*236|0)+32>>2]|0);}g=0;h=g;return h|0;}function bJ(b,e){b=b|0;e=e|0;var f=0,i=0.0,j=0,l=0.0;f=b;b=e;i=+g[f+1724+(b*236|0)+68>>2];if((c[f+1724+(b*236|0)+232>>2]|0)!=0){if((c[f+1724+(b*236|0)+48>>2]|0)!=0){i=i*+g[f+1724+(b*236|0)+76>>2];}if((a[(c[f+1724+(b*236|0)+4>>2]|0)+110|0]&64|0)!=0){e=8+(c[f+1724+(b*236|0)+24>>2]>>23<<3)|0;i=i*(c[k>>2]=d[e]|d[e+1|0]<<8|d[e+2|0]<<16|d[e+3|0]<<24,c[k+4>>2]=d[e+4|0]|d[e+5|0]<<8|d[e+6|0]<<16|d[e+7|0]<<24,+h[k>>3]);}j=~~(i*4096.0);if((j|0)>8191){j=8191;}c[f+1724+(b*236|0)+60>>2]=j;return;}l=+g[f+1724+(b*236|0)+72>>2];if((c[f+1724+(b*236|0)+48>>2]|0)!=0){i=i*+g[f+1724+(b*236|0)+76>>2];l=l*+g[f+1724+(b*236|0)+76>>2];}if((a[(c[f+1724+(b*236|0)+4>>2]|0)+110|0]&64|0)!=0){e=8+(c[f+1724+(b*236|0)+24>>2]>>23<<3)|0;i=i*(c[k>>2]=d[e]|d[e+1|0]<<8|d[e+2|0]<<16|d[e+3|0]<<24,c[k+4>>2]=d[e+4|0]|d[e+5|0]<<8|d[e+6|0]<<16|d[e+7|0]<<24,+h[k>>3]);e=8+(c[f+1724+(b*236|0)+24>>2]>>23<<3)|0;l=l*(c[k>>2]=d[e]|d[e+1|0]<<8|d[e+2|0]<<16|d[e+3|0]<<24,c[k+4>>2]=d[e+4|0]|d[e+5|0]<<8|d[e+6|0]<<16|d[e+7|0]<<24,+h[k>>3]);}j=~~(i*4096.0);if((j|0)>8191){j=8191;}e=~~(l*4096.0);if((e|0)>8191){e=8191;}c[f+1724+(b*236|0)+60>>2]=j;c[f+1724+(b*236|0)+64>>2]=e;return;}function bK(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0;h=i;i=i+8|0;j=h|0;k=b;b=e;e=f;c[j>>2]=g;g=k+1724+(e*236|0)|0;if((d[g|0]|0|0)==4){if((c[j>>2]|0)>=20){c[j>>2]=20;}l=cy(k,e,j)|0;bL(k,l,b,e,c[j>>2]|0);a[g|0]=0;i=h;return;}l=cy(k,e,j)|0;if((c[k+8>>2]&1|0)!=0){do{if((c[g+32>>2]|0)!=0){m=402;}else{if((c[g+48>>2]|0)!=0){m=402;break;}bN(k,l,b,e,c[j>>2]|0);}}while(0);if((m|0)==402){bM(k,l,b,e,c[j>>2]|0);}}else{if((c[g+232>>2]|0)==0){do{if((c[g+32>>2]|0)!=0){m=408;}else{if((c[g+48>>2]|0)!=0){m=408;break;}bP(k,l,b,e,c[j>>2]|0);}}while(0);if((m|0)==408){bO(k,l,b,e,c[j>>2]|0);}}else{if((c[g+232>>2]|0)==3){do{if((c[g+32>>2]|0)!=0){m=414;}else{if((c[g+48>>2]|0)!=0){m=414;break;}bR(k,l,b,e,c[j>>2]|0);}}while(0);if((m|0)==414){bQ(k,l,b,e,c[j>>2]|0);}}else{if((c[g+232>>2]|0)==2){b=b+4|0;}do{if((c[g+32>>2]|0)!=0){m=421;}else{if((c[g+48>>2]|0)!=0){m=421;break;}bT(k,l,b,e,c[j>>2]|0);}}while(0);if((m|0)==421){bS(k,l,b,e,c[j>>2]|0);}}}}i=h;return;}function bL(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;h=a;a=d;d=e;e=f;f=g;g=0;if((f|0)==0){f=1;}i=c[h+1724+(e*236|0)+60>>2]|0;j=-((i|0)/(f|0)|0)|0;if((j|0)==0){j=-1;}if((c[h+8>>2]&1|0)!=0){while(1){k=f;f=k-1|0;if((k|0)==0){l=474;break;}i=i+j|0;if((i|0)<0){l=472;break;}k=a;a=k+2|0;g=b[k>>1]|0;k=_(i,g<<16>>16)|0;m=d;d=m+4|0;c[m>>2]=(c[m>>2]|0)+k;}if((l|0)==472){return;}else if((l|0)==474){return;}}if((c[h+1724+(e*236|0)+232>>2]|0)==0){k=c[h+1724+(e*236|0)+64>>2]|0;m=-((k|0)/(f|0)|0)|0;while(1){n=f;f=n-1|0;if((n|0)==0){break;}i=i+j|0;if((i|0)<0){i=0;}k=k+m|0;if((k|0)<0){k=0;}n=a;a=n+2|0;g=b[n>>1]|0;n=_(i,g<<16>>16)|0;o=d;d=o+4|0;c[o>>2]=(c[o>>2]|0)+n;n=_(k,g<<16>>16)|0;o=d;d=o+4|0;c[o>>2]=(c[o>>2]|0)+n;}}else{do{if((c[h+1724+(e*236|0)+232>>2]|0)==3){while(1){k=f;f=k-1|0;if((k|0)==0){l=450;break;}i=i+j|0;if((i|0)<0){break;}k=a;a=k+2|0;g=b[k>>1]|0;k=_(i,g<<16>>16)|0;m=d;d=m+4|0;c[m>>2]=(c[m>>2]|0)+k;k=_(i,g<<16>>16)|0;m=d;d=m+4|0;c[m>>2]=(c[m>>2]|0)+k;}if((l|0)==450){break;}return;}else{do{if((c[h+1724+(e*236|0)+232>>2]|0)==1){while(1){k=f;f=k-1|0;if((k|0)==0){l=457;break;}i=i+j|0;if((i|0)<0){break;}k=a;a=k+2|0;g=b[k>>1]|0;k=_(i,g<<16>>16)|0;m=d;d=m+4|0;c[m>>2]=(c[m>>2]|0)+k;d=d+4|0;}if((l|0)==457){break;}return;}else{do{if((c[h+1724+(e*236|0)+232>>2]|0)==2){while(1){k=f;f=k-1|0;if((k|0)==0){l=464;break;}i=i+j|0;if((i|0)<0){break;}k=a;a=k+2|0;g=b[k>>1]|0;d=d+4|0;k=_(i,g<<16>>16)|0;m=d;d=m+4|0;c[m>>2]=(c[m>>2]|0)+k;}if((l|0)==464){break;}return;}}while(0);}}while(0);}}while(0);}return;}function bM(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0;h=a;a=d;d=e;e=f;f=g;g=h+1724+(e*236|0)|0;i=c[g+60>>2]|0;j=c[g+224>>2]|0;k=j;do{if((j|0)==0){k=c[h+13060>>2]|0;if((bU(h,e)|0)==0){i=c[g+60>>2]|0;break;}return;}}while(0);while(1){if((f|0)==0){l=502;break;}if((k|0)>=(f|0)){l=495;break;}f=f-k|0;while(1){j=k;k=j-1|0;if((j|0)==0){break;}j=a;a=j+2|0;m=b[j>>1]|0;j=_(i,m<<16>>16)|0;n=d;d=n+4|0;c[n>>2]=(c[n>>2]|0)+j;}k=c[h+13060>>2]|0;if((bU(h,e)|0)!=0){l=493;break;}i=c[g+60>>2]|0;}if((l|0)==502){return;}else if((l|0)==493){return;}else if((l|0)==495){c[g+224>>2]=k-f;while(1){k=f;f=k-1|0;if((k|0)==0){break;}k=a;a=k+2|0;m=b[k>>1]|0;k=_(i,m<<16>>16)|0;g=d;d=g+4|0;c[g>>2]=(c[g>>2]|0)+k;}return;}}function bN(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;h=d;d=e;e=g;g=c[a+1724+(f*236|0)+60>>2]|0;while(1){f=e;e=f-1|0;if((f|0)==0){break;}f=h;h=f+2|0;a=_(g,b[f>>1]|0)|0;f=d;d=f+4|0;c[f>>2]=(c[f>>2]|0)+a;}return;}function bO(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;h=a;a=d;d=e;e=f;f=g;g=h+1724+(e*236|0)|0;i=c[g+60>>2]|0;j=c[g+64>>2]|0;k=c[g+224>>2]|0;l=k;do{if((k|0)==0){l=c[h+13060>>2]|0;if((bU(h,e)|0)==0){i=c[g+60>>2]|0;j=c[g+64>>2]|0;break;}return;}}while(0);while(1){if((f|0)==0){m=530;break;}if((l|0)>=(f|0)){m=522;break;}f=f-l|0;while(1){k=l;l=k-1|0;if((k|0)==0){break;}k=a;a=k+2|0;n=b[k>>1]|0;k=_(i,n<<16>>16)|0;o=d;d=o+4|0;c[o>>2]=(c[o>>2]|0)+k;k=_(j,n<<16>>16)|0;o=d;d=o+4|0;c[o>>2]=(c[o>>2]|0)+k;}l=c[h+13060>>2]|0;if((bU(h,e)|0)!=0){m=520;break;}i=c[g+60>>2]|0;j=c[g+64>>2]|0;}if((m|0)==522){c[g+224>>2]=l-f;while(1){l=f;f=l-1|0;if((l|0)==0){break;}l=a;a=l+2|0;n=b[l>>1]|0;l=_(i,n<<16>>16)|0;g=d;d=g+4|0;c[g>>2]=(c[g>>2]|0)+l;l=_(j,n<<16>>16)|0;g=d;d=g+4|0;c[g>>2]=(c[g>>2]|0)+l;}return;}else if((m|0)==520){return;}else if((m|0)==530){return;}}function bP(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;h=a;a=d;d=e;e=f;f=g;g=c[h+1724+(e*236|0)+60>>2]|0;i=c[h+1724+(e*236|0)+64>>2]|0;while(1){e=f;f=e-1|0;if((e|0)==0){break;}e=a;a=e+2|0;h=b[e>>1]|0;e=_(g,h<<16>>16)|0;j=d;d=j+4|0;c[j>>2]=(c[j>>2]|0)+e;e=_(i,h<<16>>16)|0;h=d;d=h+4|0;c[h>>2]=(c[h>>2]|0)+e;}return;}function bQ(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0;h=a;a=d;d=e;e=f;f=g;g=h+1724+(e*236|0)|0;i=c[g+60>>2]|0;j=c[g+224>>2]|0;k=j;do{if((j|0)==0){k=c[h+13060>>2]|0;if((bU(h,e)|0)==0){i=c[g+60>>2]|0;break;}return;}}while(0);while(1){if((f|0)==0){l=556;break;}if((k|0)>=(f|0)){l=549;break;}f=f-k|0;while(1){j=k;k=j-1|0;if((j|0)==0){break;}j=a;a=j+2|0;m=b[j>>1]|0;j=_(i,m<<16>>16)|0;n=d;d=n+4|0;c[n>>2]=(c[n>>2]|0)+j;j=_(i,m<<16>>16)|0;n=d;d=n+4|0;c[n>>2]=(c[n>>2]|0)+j;}k=c[h+13060>>2]|0;if((bU(h,e)|0)!=0){l=547;break;}i=c[g+60>>2]|0;}if((l|0)==549){c[g+224>>2]=k-f;while(1){k=f;f=k-1|0;if((k|0)==0){break;}k=a;a=k+2|0;m=b[k>>1]|0;k=_(i,m<<16>>16)|0;g=d;d=g+4|0;c[g>>2]=(c[g>>2]|0)+k;k=_(i,m<<16>>16)|0;g=d;d=g+4|0;c[g>>2]=(c[g>>2]|0)+k;}return;}else if((l|0)==556){return;}else if((l|0)==547){return;}}function bR(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;h=d;d=e;e=g;g=c[a+1724+(f*236|0)+60>>2]|0;while(1){f=e;e=f-1|0;if((f|0)==0){break;}f=h;h=f+2|0;a=b[f>>1]|0;f=_(g,a<<16>>16)|0;i=d;d=i+4|0;c[i>>2]=(c[i>>2]|0)+f;f=_(g,a<<16>>16)|0;a=d;d=a+4|0;c[a>>2]=(c[a>>2]|0)+f;}return;}function bS(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0;h=a;a=d;d=e;e=f;f=g;g=h+1724+(e*236|0)|0;i=c[g+60>>2]|0;j=c[g+224>>2]|0;k=j;do{if((j|0)==0){k=c[h+13060>>2]|0;if((bU(h,e)|0)==0){i=c[g+60>>2]|0;break;}return;}}while(0);while(1){if((f|0)==0){l=582;break;}if((k|0)>=(f|0)){l=576;break;}f=f-k|0;while(1){j=k;k=j-1|0;if((j|0)==0){break;}j=a;a=j+2|0;m=b[j>>1]|0;j=_(i,m<<16>>16)|0;n=d;d=n+4|0;c[n>>2]=(c[n>>2]|0)+j;d=d+4|0;}k=c[h+13060>>2]|0;if((bU(h,e)|0)!=0){l=574;break;}i=c[g+60>>2]|0;}if((l|0)==582){return;}else if((l|0)==576){c[g+224>>2]=k-f;while(1){k=f;f=k-1|0;if((k|0)==0){break;}k=a;a=k+2|0;m=b[k>>1]|0;k=_(i,m<<16>>16)|0;g=d;d=g+4|0;c[g>>2]=(c[g>>2]|0)+k;d=d+4|0;}return;}else if((l|0)==574){return;}}function bT(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;h=d;d=e;e=g;g=c[a+1724+(f*236|0)+60>>2]|0;while(1){f=e;e=f-1|0;if((f|0)==0){break;}f=h;h=f+2|0;a=_(g,b[f>>1]|0)|0;f=d;d=f+4|0;c[f>>2]=(c[f>>2]|0)+a;d=d+4|0;}return;}function bU(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=a;a=b;do{if((c[d+1724+(a*236|0)+32>>2]|0)!=0){if((bV(d,a)|0)==0){break;}e=1;f=e;return f|0;}}while(0);if((c[d+1724+(a*236|0)+48>>2]|0)!=0){bW(d,a);}bJ(d,a);e=0;f=e;return f|0;}function bV(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=a;a=b;b=d+1724+(a*236|0)+24|0;c[b>>2]=(c[b>>2]|0)+(c[d+1724+(a*236|0)+32>>2]|0);if((c[d+1724+(a*236|0)+32>>2]|0)<0){if((c[d+1724+(a*236|0)+24>>2]|0)<=(c[d+1724+(a*236|0)+28>>2]|0)){e=603;}else{e=601;}}else{e=601;}do{if((e|0)==601){if((c[d+1724+(a*236|0)+32>>2]|0)<=0){break;}if((c[d+1724+(a*236|0)+24>>2]|0)>=(c[d+1724+(a*236|0)+28>>2]|0)){e=603;}}}while(0);do{if((e|0)==603){c[d+1724+(a*236|0)+24>>2]=c[d+1724+(a*236|0)+28>>2];if((bI(d,a)|0)==0){break;}f=1;g=f;return g|0;}}while(0);f=0;g=f;return g|0;}function bW(a,b){a=a|0;b=b|0;var e=0,f=0;e=a;a=b;b=(d[(c[e+1724+(a*236|0)+4>>2]|0)+108|0]|0)<<7;if((c[e+1724+(a*236|0)+36>>2]|0)!=0){f=e+1724+(a*236|0)+40|0;c[f>>2]=(c[f>>2]|0)+(c[e+1724+(a*236|0)+36>>2]|0);if((c[e+1724+(a*236|0)+40>>2]|0)>=65536){c[e+1724+(a*236|0)+36>>2]=0;}else{b=_(b,c[e+1724+(a*236|0)+40>>2]|0)|0;b=b>>16;}}f=e+1724+(a*236|0)+44|0;c[f>>2]=(c[f>>2]|0)+(c[e+1724+(a*236|0)+48>>2]|0);g[e+1724+(a*236|0)+76>>2]=1.0-(+R(+(+(c[e+1724+(a*236|0)+44>>2]>>5|0)*0.006135923151542565))+1.0)*+(b|0)*1.0*762939453125.0e-17;return;}function bX(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=d;d=e;e=b;while(1){b=d;d=b-1|0;if((b|0)==0){break;}b=f;f=b+4|0;g=c[b>>2]>>21;if((g|0)>127){g=127;}else{if((g|0)<-128){g=-128;}}b=e;e=b+1|0;a[b]=g&255;}return;}function bY(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=d;d=e;e=b;while(1){b=d;d=b-1|0;if((b|0)==0){break;}b=f;f=b+4|0;g=c[b>>2]>>21;if((g|0)>127){g=127;}else{if((g|0)<-128){g=-128;}}b=e;e=b+1|0;a[b]=(128^g&255)&255;}return;}function bZ(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0;f=d;d=e;e=a;while(1){a=d;d=a-1|0;if((a|0)==0){break;}a=f;f=a+4|0;g=c[a>>2]>>13;if((g|0)>32767){g=32767;}else{if((g|0)<-32768){g=-32768;}}a=e;e=a+2|0;b[a>>1]=g&65535;}return;}function b_(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0;f=d;d=e;e=a;while(1){a=d;d=a-1|0;if((a|0)==0){break;}a=f;f=a+4|0;g=c[a>>2]>>13;if((g|0)>32767){g=32767;}else{if((g|0)<-32768){g=-32768;}}a=e;e=a+2|0;b[a>>1]=(32768^g&65535)&65535;}return;}function b$(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0;f=d;d=e;e=a;while(1){a=d;d=a-1|0;if((a|0)==0){break;}a=f;f=a+4|0;g=c[a>>2]>>13;if((g|0)>32767){g=32767;}else{if((g|0)<-32768){g=-32768;}}a=e;e=a+2|0;b[a>>1]=(((g&65535)<<16>>16&255)<<8|(g&65535)<<16>>16>>8&255)&65535;}return;}function b0(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=i;i=i+8|0;h=g|0;c[h>>2]=0;a[h+5|0]=1;a[h+4|0]=d&255;a[h+6|0]=e&255;a[h+7|0]=f&255;b1(b,h);i=g;return;}function b1(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0;f=b;b=e;e=c[f+13052>>2]|0;g=-1;h=2147483647;if(0==(b|0)){i=c[f+13080>>2]|0;}else{i=b;}while(1){b=e;e=b-1|0;if((b|0)==0){break;}if((d[f+1724+(e*236|0)|0]|0|0)==0){g=e;}else{do{if((d[f+1724+(e*236|0)+1|0]|0|0)==(d[i+4|0]|0|0)){if((d[f+1724+(e*236|0)+2|0]|0|0)!=(d[i+6|0]|0|0)){if((c[f+1084+((d[f+1724+(e*236|0)+1|0]|0)*40|0)+28>>2]|0)==0){break;}}ch(f,e);}}while(0);}}if((g|0)!=-1){cn(f,i,g);return;}e=c[f+13052>>2]|0;while(1){b=e;e=b-1|0;if((b|0)==0){break;}do{if((d[f+1724+(e*236|0)|0]|0|0)!=1){if((d[f+1724+(e*236|0)|0]|0|0)==4){break;}b=c[f+1724+(e*236|0)+60>>2]|0;do{if((c[f+1724+(e*236|0)+232>>2]|0)==0){if((c[f+1724+(e*236|0)+64>>2]|0)<=(b|0)){break;}b=c[f+1724+(e*236|0)+64>>2]|0;}}while(0);if((b|0)<(h|0)){h=b;g=e;}}}while(0);}if((g|0)!=-1){e=f+13068|0;c[e>>2]=(c[e>>2]|0)+1;a[f+1724+(g*236|0)|0]=0;cn(f,i,g);return;}else{g=f+13064|0;c[g>>2]=(c[g>>2]|0)+1;return;}}function b2(b,e){b=b|0;e=e|0;var f=0,g=0,h=0;f=b;b=e;e=c[f+13052>>2]|0;if(0==(b|0)){g=c[f+13080>>2]|0;}else{g=b;}L890:while(1){b=e;e=b-1|0;if((b|0)==0){h=709;break;}do{if((d[f+1724+(e*236|0)|0]|0|0)==1){if((d[f+1724+(e*236|0)+1|0]|0|0)!=(d[g+4|0]|0|0)){break;}if((d[f+1724+(e*236|0)+2|0]|0|0)==(d[g+6|0]|0|0)){break L890;}}}while(0);}if((h|0)==709){return;}if((c[f+1084+((d[g+4|0]|0)*40|0)+12>>2]|0)!=0){a[f+1724+(e*236|0)|0]=2;}else{ci(f,e);}return;}function b3(a){a=a|0;var b=0;b=a;c[b>>2]=1;b4(b);b5(b,0);return;}function b4(a){a=a|0;var b=0;b=a;g[b+16>>2]=+(c[b+20>>2]|0)/100.0;return;}function b5(a,b){a=a|0;b=b|0;var d=0;d=a;a=b;if((c[d+13088>>2]|0)>(a|0)){c[d+13088>>2]=0;}ck(d);c[d+13080>>2]=c[d+13076>>2];c[392]=5e5;if((a|0)==0){return;}cl(d,a);return;}function b6(b,e,f,h){b=b|0;e=e|0;f=f|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0;j=i;i=i+8|0;k=j|0;l=b;c[k>>2]=e;e=h;if((c[l>>2]|0)==0){m=0;n=m;i=j;return n|0;}h=(f>>>0)/((c[l+12>>2]|0)>>>0)|0;f=c[l+13088>>2]|0;b=(c[l+13088>>2]|0)+h|0;L920:while(1){if((c[l+13088>>2]|0)>=(b|0)){o=758;break;}while(1){if(~~(+(c[c[l+13080>>2]>>2]|0)/+g[258])>>>0>(c[l+13088>>2]|0)>>>0){break;}switch(d[(c[l+13080>>2]|0)+5|0]|0){case 99:{if(0==(e|0)){o=752;break L920;}break;}case 6:{c[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)+12>>2]=d[(c[l+13080>>2]|0)+6|0]|0;if((a[(c[l+13080>>2]|0)+6|0]|0)==0){ca(l);}break;}case 3:{b7(l);break;}case 11:{c[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)+32>>2]=d[(c[l+13080>>2]|0)+6|0]|0;g[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)+36>>2]=0.0;break;}case 14:{cc(l);break;}case 12:{cd(l);break;}case 13:{cb(l,d[(c[l+13080>>2]|0)+4|0]|0);break;}case 9:{if((c[l+13056>>2]&1<>2]|0)+4|0]|0)!=0){c[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)>>2]=d[(c[l+13080>>2]|0)+6|0]|0;}else{c[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)+4>>2]=d[(c[l+13080>>2]|0)+6|0]|0;}break;}case 5:{c[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)+16>>2]=d[(c[l+13080>>2]|0)+6|0]|0;break;}case 7:{c[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)+24>>2]=d[(c[l+13080>>2]|0)+6|0]|0;b9(l);break;}case 1:{if((a[(c[l+13080>>2]|0)+7|0]|0)!=0){b1(l,0);}else{b2(l,0);}break;}case 15:{c[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)>>2]=d[(c[l+13080>>2]|0)+6|0]|0;break;}case 10:{c[392]=(d[(c[l+13080>>2]|0)+4|0]|0)+(d[(c[l+13080>>2]|0)+7|0]<<8)+(d[(c[l+13080>>2]|0)+6|0]<<16);break;}case 8:{c[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)+20>>2]=(d[(c[l+13080>>2]|0)+6|0]|0)+(d[(c[l+13080>>2]|0)+7|0]<<7);g[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)+36>>2]=0.0;b8(l);break;}case 4:{c[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)+8>>2]=d[(c[l+13080>>2]|0)+6|0]|0;b9(l);break;}case 2:{b2(l,0);break;}default:{}}p=l+13080|0;c[p>>2]=(c[p>>2]|0)+8;}if(~~(+(c[c[l+13080>>2]>>2]|0)/+g[258])>>>0>b>>>0){ce(l,k,b-(c[l+13088>>2]|0)|0);}else{ce(l,k,~~(+(c[c[l+13080>>2]>>2]|0)/+g[258])-(c[l+13088>>2]|0)|0);}}if((o|0)==752){c[l>>2]=0;m=_((c[l+13088>>2]|0)-f|0,c[l+12>>2]|0)|0;n=m;i=j;return n|0;}else if((o|0)==758){m=_(h,c[l+12>>2]|0)|0;n=m;i=j;return n|0;}return 0;}function b7(b){b=b|0;var e=0,f=0,g=0,h=0;e=b;b=c[e+13080>>2]|0;f=c[e+13052>>2]|0;L967:while(1){g=f;f=g-1|0;if((g|0)==0){h=772;break;}do{if((d[e+1724+(f*236|0)|0]|0|0)==1){if((d[e+1724+(f*236|0)+1|0]|0|0)!=(d[b+4|0]|0|0)){break;}if((d[e+1724+(f*236|0)+2|0]|0|0)==(d[b+6|0]|0|0)){break L967;}}}while(0);}if((h|0)==772){return;}a[e+1724+(f*236|0)+3|0]=a[b+7|0]|0;cf(e,f);bJ(e,f);return;}function b8(a){a=a|0;var b=0,e=0,f=0;b=a;a=d[(c[b+13080>>2]|0)+4|0]|0;e=c[b+13052>>2]|0;while(1){f=e;e=f-1|0;if((f|0)==0){break;}do{if((d[b+1724+(e*236|0)|0]|0|0)!=0){if((d[b+1724+(e*236|0)+1|0]|0|0)!=(a|0)){break;}cj(b,e);}}while(0);}return;}function b9(a){a=a|0;var b=0,e=0,f=0;b=a;a=d[(c[b+13080>>2]|0)+4|0]|0;e=c[b+13052>>2]|0;while(1){f=e;e=f-1|0;if((f|0)==0){break;}do{if((d[b+1724+(e*236|0)+1|0]|0|0)==(a|0)){if((d[b+1724+(e*236|0)|0]|0|0)!=1){if((d[b+1724+(e*236|0)|0]|0|0)!=2){break;}}cf(b,e);bJ(b,e);}}while(0);}return;}function ca(a){a=a|0;var b=0,e=0,f=0;b=a;a=c[b+13052>>2]|0;e=d[(c[b+13080>>2]|0)+4|0]|0;while(1){f=a;a=f-1|0;if((f|0)==0){break;}do{if((d[b+1724+(a*236|0)|0]|0|0)==2){if((d[b+1724+(a*236|0)+1|0]|0|0)!=(e|0)){break;}ci(b,a);}}while(0);}return;}function cb(a,b){a=a|0;b=b|0;var d=0;d=a;a=b;c[d+1084+(a*40|0)+8>>2]=90;c[d+1084+(a*40|0)+24>>2]=127;c[d+1084+(a*40|0)+12>>2]=0;c[d+1084+(a*40|0)+20>>2]=8192;g[d+1084+(a*40|0)+36>>2]=0.0;return;}function cc(b){b=b|0;var e=0,f=0,g=0;e=b;b=c[e+13052>>2]|0;f=d[(c[e+13080>>2]|0)+4|0]|0;while(1){g=b;b=g-1|0;if((g|0)==0){break;}do{if((d[e+1724+(b*236|0)|0]|0|0)==1){if((d[e+1724+(b*236|0)+1|0]|0|0)!=(f|0)){break;}if((c[e+1084+(f*40|0)+12>>2]|0)!=0){a[e+1724+(b*236|0)|0]=2;}else{ci(e,b);}}}while(0);}return;}function cd(a){a=a|0;var b=0,e=0,f=0;b=a;a=c[b+13052>>2]|0;e=d[(c[b+13080>>2]|0)+4|0]|0;while(1){f=a;a=f-1|0;if((f|0)==0){break;}do{if((d[b+1724+(a*236|0)+1|0]|0|0)==(e|0)){if((d[b+1724+(a*236|0)|0]|0|0)==0){break;}if((d[b+1724+(a*236|0)|0]|0|0)==4){break;}ch(b,a);}}while(0);}return;}function ce(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=a;a=b;b=d;if((c[e+8>>2]&1|0)!=0){f=1;}else{f=2;}while(1){if((b|0)==0){break;}d=b;if((d|0)>(c[e+1064>>2]|0)){d=c[e+1064>>2]|0;}cg(e,d);g=c[e+1060>>2]|0;h=c[a>>2]|0;i=c[e+1072>>2]|0;j=_(f,d)|0;aZ[g&15](h,i,j);j=_(c[e+12>>2]|0,d)|0;i=a;c[i>>2]=(c[i>>2]|0)+j;b=b-d|0;}return;}function cf(a,b){a=a|0;b=b|0;var e=0,f=0,h=0;e=a;a=b;b=_(d[e+1724+(a*236|0)+3|0]|0,c[e+1084+((d[e+1724+(a*236|0)+1|0]|0)*40|0)+8>>2]|0)|0;f=_(b,c[e+1084+((d[e+1724+(a*236|0)+1|0]|0)*40|0)+24>>2]|0)|0;if((c[e+8>>2]&1|0)!=0){c[e+1724+(a*236|0)+232>>2]=3;g[e+1724+(a*236|0)+68>>2]=+(f|0)*+g[(c[e+1724+(a*236|0)+4>>2]|0)+84>>2]*+g[e+16>>2]*4.76837158203125e-7;return;}do{if((c[e+1724+(a*236|0)+228>>2]|0)>60){if((c[e+1724+(a*236|0)+228>>2]|0)>=68){h=827;break;}c[e+1724+(a*236|0)+232>>2]=3;g[e+1724+(a*236|0)+68>>2]=+(f|0)*+g[(c[e+1724+(a*236|0)+4>>2]|0)+84>>2]*+g[e+16>>2]*4.76837158203125e-7;}else{h=827;}}while(0);if((h|0)==827){if((c[e+1724+(a*236|0)+228>>2]|0)<5){c[e+1724+(a*236|0)+232>>2]=1;g[e+1724+(a*236|0)+68>>2]=+(f|0)*+g[(c[e+1724+(a*236|0)+4>>2]|0)+84>>2]*+g[e+16>>2]*9.5367431640625e-7;}else{if((c[e+1724+(a*236|0)+228>>2]|0)>123){c[e+1724+(a*236|0)+232>>2]=2;g[e+1724+(a*236|0)+68>>2]=+(f|0)*+g[(c[e+1724+(a*236|0)+4>>2]|0)+84>>2]*+g[e+16>>2]*9.5367431640625e-7;}else{c[e+1724+(a*236|0)+232>>2]=0;g[e+1724+(a*236|0)+68>>2]=+(f|0)*+g[(c[e+1724+(a*236|0)+4>>2]|0)+84>>2]*+g[e+16>>2]*7.450580596923828e-9;g[e+1724+(a*236|0)+72>>2]=+g[e+1724+(a*236|0)+68>>2]*+(c[e+1724+(a*236|0)+228>>2]|0);f=e+1724+(a*236|0)+68|0;g[f>>2]=+g[f>>2]*+(127-(c[e+1724+(a*236|0)+228>>2]|0)|0);}}}return;}function cg(a,b){a=a|0;b=b|0;var e=0,f=0;e=a;a=b;if((c[e+8>>2]&1|0)!=0){f=a<<2;}else{f=a<<3;}c5(c[e+1072>>2]|0,0,f|0);f=0;while(1){if((f|0)>=(c[e+13052>>2]|0)){break;}if((d[e+1724+(f*236|0)|0]|0|0)!=0){bK(e,c[e+1072>>2]|0,f,a);}f=f+1|0;}f=e+13088|0;c[f>>2]=(c[f>>2]|0)+a;return;}function ch(b,c){b=b|0;c=c|0;a[b+1724+(c*236|0)|0]=4;return;}function ci(b,d){b=b|0;d=d|0;var e=0,f=0;e=b;b=d;if((a[(c[e+1724+(b*236|0)+4>>2]|0)+110|0]&64|0)!=0){c[e+1724+(b*236|0)+220>>2]=3;a[e+1724+(b*236|0)|0]=3;d=e;f=b;bI(d,f)|0;bJ(e,b);return;}else{a[e+1724+(b*236|0)|0]=3;return;}}function cj(a,b){a=a|0;b=b|0;var e=0,f=0,i=0,j=0,l=0,m=0.0;e=a;a=b;b=(c[e+1724+(a*236|0)+20>>2]|0)<0|0;f=c[e+1084+((d[e+1724+(a*236|0)+1|0]|0)*40|0)+20>>2]|0;if((c[(c[e+1724+(a*236|0)+4>>2]|0)+12>>2]|0)==0){return;}if((c[e+1724+(a*236|0)+212>>2]|0)!=0){i=32;while(1){j=i;i=j-1|0;if((j|0)==0){break;}c[e+1724+(a*236|0)+80+(i<<2)>>2]=0;}}do{if((f|0)==8192){l=866;}else{if((f|0)<0){l=866;break;}if((f|0)>16383){l=866;break;}f=f-8192|0;if(+g[e+1084+((d[e+1724+(a*236|0)+1|0]|0)*40|0)+36>>2]==0.0){i=_(f,c[e+1084+((d[e+1724+(a*236|0)+1|0]|0)*40|0)+32>>2]|0)|0;if((f|0)<0){i=-i|0;}j=1704+((i>>5&255)<<3)|0;m=(c[k>>2]=d[j]|d[j+1|0]<<8|d[j+2|0]<<16|d[j+3|0]<<24,c[k+4>>2]=d[j+4|0]|d[j+5|0]<<8|d[j+6|0]<<16|d[j+7|0]<<24,+h[k>>3]);j=3752+(i>>13<<3)|0;g[e+1084+((d[e+1724+(a*236|0)+1|0]|0)*40|0)+36>>2]=m*(c[k>>2]=d[j]|d[j+1|0]<<8|d[j+2|0]<<16|d[j+3|0]<<24,c[k+4>>2]=d[j+4|0]|d[j+5|0]<<8|d[j+6|0]<<16|d[j+7|0]<<24,+h[k>>3]);}if((f|0)>0){c[e+1724+(a*236|0)+12>>2]=~~(+g[e+1084+((d[e+1724+(a*236|0)+1|0]|0)*40|0)+36>>2]*+(c[e+1724+(a*236|0)+8>>2]|0));}else{c[e+1724+(a*236|0)+12>>2]=~~(+(c[e+1724+(a*236|0)+8>>2]|0)/+g[e+1084+((d[e+1724+(a*236|0)+1|0]|0)*40|0)+36>>2]);}}}while(0);if((l|0)==866){c[e+1724+(a*236|0)+12>>2]=c[e+1724+(a*236|0)+8>>2];}m=+(c[(c[e+1724+(a*236|0)+4>>2]|0)+12>>2]|0)*+(c[e+1724+(a*236|0)+12>>2]|0)/(+(c[(c[e+1724+(a*236|0)+4>>2]|0)+32>>2]|0)*+(c[e+4>>2]|0))*4096.0;if((b|0)!=0){m=-0.0-m;}c[e+1724+(a*236|0)+20>>2]=~~m;return;}function ck(a){a=a|0;var b=0;b=a;a=0;while(1){if((a|0)>=16){break;}cb(b,a);c[b+1084+(a*40|0)+4>>2]=c[b+1056>>2];c[b+1084+(a*40|0)+16>>2]=-1;c[b+1084+(a*40|0)+32>>2]=2;c[b+1084+(a*40|0)>>2]=0;a=a+1|0;}cm(b);return;}function cl(a,b){a=a|0;b=b|0;var e=0,f=0;e=a;a=b;cm(e);L1123:while(1){if(+(c[c[e+13080>>2]>>2]|0)/+g[258]>=+(a|0)){break;}switch(d[(c[e+13080>>2]|0)+5|0]|0|0){case 7:{c[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)+24>>2]=d[(c[e+13080>>2]|0)+6|0]|0;break;}case 13:{cb(e,d[(c[e+13080>>2]|0)+4|0]|0);break;}case 4:{c[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)+8>>2]=d[(c[e+13080>>2]|0)+6|0]|0;break;}case 11:{c[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)+32>>2]=d[(c[e+13080>>2]|0)+6|0]|0;g[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)+36>>2]=0.0;break;}case 99:{f=902;break L1123;break;}case 9:{if((c[e+13056>>2]&1<<(d[(c[e+13080>>2]|0)+4|0]|0)|0)!=0){c[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)>>2]=d[(c[e+13080>>2]|0)+6|0]|0;}else{c[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)+4>>2]=d[(c[e+13080>>2]|0)+6|0]|0;}break;}case 8:{c[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)+20>>2]=(d[(c[e+13080>>2]|0)+6|0]|0)+((d[(c[e+13080>>2]|0)+7|0]|0)<<7);g[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)+36>>2]=0.0;break;}case 15:{c[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)>>2]=d[(c[e+13080>>2]|0)+6|0]|0;break;}case 10:{c[392]=(d[(c[e+13080>>2]|0)+4|0]|0)+((d[(c[e+13080>>2]|0)+7|0]|0)<<8)+((d[(c[e+13080>>2]|0)+6|0]|0)<<16);break;}case 5:{c[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)+16>>2]=d[(c[e+13080>>2]|0)+6|0]|0;break;}case 6:{c[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)+12>>2]=d[(c[e+13080>>2]|0)+6|0]|0;break;}default:{}}b=e+13080|0;c[b>>2]=(c[b>>2]|0)+8;}if((f|0)==902){c[e+13088>>2]=~~(+(c[c[e+13080>>2]>>2]|0)/+g[258]);return;}if((c[e+13080>>2]|0)!=(c[e+13076>>2]|0)){f=e+13080|0;c[f>>2]=(c[f>>2]|0)-8;}c[e+13088>>2]=a;return;}function cm(b){b=b|0;var c=0;c=b;b=0;while(1){if((b|0)>=48){break;}a[c+1724+(b*236|0)|0]=0;b=b+1|0;}return;}function cn(b,e,f){b=b|0;e=e|0;f=f|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=b;b=e;e=f;if((c[h+13056>>2]&1<>2]<<2)>>2]|0)+4+(d[b+6|0]<<2)>>2]|0;i=f;do{if((f|0)==0){j=c[(c[h+540>>2]|0)+4+(d[b+6|0]<<2)>>2]|0;i=j;if((j|0)!=0){break;}return;}}while(0);(c[i>>2]|0)!=1;if((a[(c[i+4>>2]|0)+112|0]|0)!=0){f=1056+(a[(c[i+4>>2]|0)+112|0]<<2)|0;c[h+1724+(e*236|0)+8>>2]=d[f]|d[f+1|0]<<8|d[f+2|0]<<16|d[f+3|0]<<24;}else{f=1056+((a[b+6|0]&127)<<2)|0;c[h+1724+(e*236|0)+8>>2]=d[f]|d[f+1|0]<<8|d[f+2|0]<<16|d[f+3|0]<<24;}c[h+1724+(e*236|0)+4>>2]=c[i+4>>2];}else{if(-1!=(c[1640+(d[b+4|0]<<2)>>2]|0)){f=c[h+28+(c[h+1084+((d[b+4|0]|0)*40|0)>>2]<<2)>>2]|0;j=c[1640+(d[b+4|0]<<2)>>2]|0;if(0==(c[f+4+(j<<2)>>2]|0)){k=0;l=h;m=c[(c[f>>2]|0)+(j*28|0)>>2]|0;n=(k|0)!=0?1:0;o=c[(c[f>>2]|0)+(j*28|0)+12>>2]|0;p=c[(c[f>>2]|0)+(j*28|0)+8>>2]|0;if((c[(c[f>>2]|0)+(j*28|0)+4>>2]|0)!=-1){q=c[(c[f>>2]|0)+(j*28|0)+4>>2]|0;}else{if((k|0)!=0){r=j;}else{r=-1;}q=r;}if((c[(c[f>>2]|0)+(j*28|0)+16>>2]|0)!=-1){s=c[(c[f>>2]|0)+(j*28|0)+16>>2]|0;}else{s=(k|0)!=0?1:-1;}if((c[(c[f>>2]|0)+(j*28|0)+20>>2]|0)!=-1){t=c[(c[f>>2]|0)+(j*28|0)+20>>2]|0;}else{t=(k|0)!=0?1:-1;}c[f+4+(j<<2)>>2]=bl(l,m,n,o,p,q,s,t,c[(c[f>>2]|0)+(j*28|0)+24>>2]|0)|0;}i=c[f+4+(j<<2)>>2]|0;}else{if((c[h+1084+((d[b+4|0]|0)*40|0)+4>>2]|0)==-1){i=c[h+1052>>2]|0;}else{j=c[(c[h+28+(c[h+1084+((d[b+4|0]|0)*40|0)>>2]<<2)>>2]|0)+4+(c[h+1084+((d[b+4|0]|0)*40|0)+4>>2]<<2)>>2]|0;i=j;do{if((j|0)==0){f=c[(c[h+28>>2]|0)+4+(c[h+1084+((d[b+4|0]|0)*40|0)+4>>2]<<2)>>2]|0;i=f;if((f|0)!=0){break;}return;}}while(0);}}if((a[(c[i+4>>2]|0)+112|0]|0)!=0){j=1056+(a[(c[i+4>>2]|0)+112|0]<<2)|0;c[h+1724+(e*236|0)+8>>2]=d[j]|d[j+1|0]<<8|d[j+2|0]<<16|d[j+3|0]<<24;}else{j=1056+(((d[b+6|0]|0)+(c[1662]|0)&127)<<2)|0;c[h+1724+(e*236|0)+8>>2]=d[j]|d[j+1|0]<<8|d[j+2|0]<<16|d[j+3|0]<<24;}c[h+1724+(e*236|0)+8>>2]=~~(+(c[h+1724+(e*236|0)+8>>2]|0)*+g[260]/440.0);co(h,e,i,d[b+7|0]|0);}a[h+1724+(e*236|0)|0]=1;a[h+1724+(e*236|0)+1|0]=a[b+4|0]|0;a[h+1724+(e*236|0)+2|0]=a[b+6|0]|0;a[h+1724+(e*236|0)+3|0]=cp(a[b+7|0]|0,+g[1576+(d[b+4|0]<<2)>>2])|0;c[h+1724+(e*236|0)+16>>2]=0;c[h+1724+(e*236|0)+20>>2]=0;c[h+1724+(e*236|0)+44>>2]=0;c[h+1724+(e*236|0)+48>>2]=c[(c[h+1724+(e*236|0)+4>>2]|0)+96>>2];c[h+1724+(e*236|0)+36>>2]=c[(c[h+1724+(e*236|0)+4>>2]|0)+92>>2];c[h+1724+(e*236|0)+40>>2]=0;c[h+1724+(e*236|0)+52>>2]=c[(c[h+1724+(e*236|0)+4>>2]|0)+100>>2];c[h+1724+(e*236|0)+56>>2]=0;c[h+1724+(e*236|0)+212>>2]=c[(c[h+1724+(e*236|0)+4>>2]|0)+104>>2];c[h+1724+(e*236|0)+208>>2]=0;c[h+1724+(e*236|0)+216>>2]=0;i=0;while(1){if((i|0)>=32){break;}c[h+1724+(e*236|0)+80+(i<<2)>>2]=0;i=i+1|0;}if((c[h+1084+((d[b+4|0]|0)*40|0)+16>>2]|0)!=-1){c[h+1724+(e*236|0)+228>>2]=c[h+1084+((d[b+4|0]|0)*40|0)+16>>2];}else{c[h+1724+(e*236|0)+228>>2]=a[(c[h+1724+(e*236|0)+4>>2]|0)+111|0]|0;}cj(h,e);cf(h,e);if((a[(c[h+1724+(e*236|0)+4>>2]|0)+110|0]&64|0)!=0){c[h+1724+(e*236|0)+220>>2]=0;c[h+1724+(e*236|0)+24>>2]=0;c[h+1724+(e*236|0)+224>>2]=0;b=h;i=e;bI(b,i)|0;bJ(h,e);return;}else{c[h+1724+(e*236|0)+32>>2]=0;bJ(h,e);return;}}function co(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=a;a=b;b=d;d=e;e=c[b>>2]|0;g=c[b+4>>2]|0;if((e|0)==1){c[f+1724+(a*236|0)+4>>2]=g;return;}h=c[f+1724+(a*236|0)+8>>2]|0;i=0;L1232:while(1){if((i|0)>=(e|0)){break;}do{if((c[g+16>>2]|0)<=(d|0)){if((c[g+20>>2]|0)<(d|0)){break;}if((c[g+24>>2]|0)>(h|0)){break;}if((c[g+28>>2]|0)>=(h|0)){j=977;break L1232;}}}while(0);g=g+116|0;i=i+1|0;}if((j|0)==977){c[f+1724+(a*236|0)+4>>2]=g;return;}j=2147483647;d=c[b+4>>2]|0;g=d;b=d;i=0;while(1){if((i|0)>=(e|0)){break;}d=(c[g+32>>2]|0)-h|0;if((d|0)<0){d=-d|0;}if((d|0)<(j|0)){j=d;b=g;}g=g+116|0;i=i+1|0;}c[f+1724+(a*236|0)+4>>2]=b;return;}function cp(a,b){a=a|0;b=+b;var d=0,e=0,f=0.0,g=0,h=0,j=0,k=0;d=i;e=a;f=b;if(f<=1.0){g=~~(+(e&255|0)*f);h=g;i=d;return h|0;}else{a=(e&255)+(~~(+(127-(e&255)|0)*(f-1.0))&255)&255;j=e&255;e=a&255;aG(4784,(k=i,i=i+16|0,c[k>>2]=j,c[k+8>>2]=e,k)|0)|0;i=k;g=a;h=g;i=d;return h|0;}return 0;}function cq(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;h=i;i=i+40|0;j=h|0;k=h+8|0;l=h+16|0;m=h+24|0;n=h+32|0;o=d;d=e;e=f;f=g;c[d+13092>>2]=0;c[d+13096>>2]=0;c[d+13084>>2]=0;do{if((cP(o,n|0,1,4)|0)==4){if((cP(o,j,4,1)|0)!=1){break;}c[j>>2]=(c[j>>2]&255)<<24|(c[j>>2]&65280)<<8|(c[j>>2]&16711680)>>8|c[j>>2]>>24&255;do{if((c4(n|0,4776,4)|0)==0){if((c[j>>2]|0)<6){break;}g=o;p=k;cP(g,p,2,1)|0;p=o;g=l;cP(p,g,2,1)|0;g=o;p=m;cP(g,p,2,1)|0;b[k>>1]=((b[k>>1]&255)<<8|b[k>>1]>>8&255)&65535;b[l>>1]=((b[l>>1]&255)<<8|b[l>>1]>>8&255)&65535;b[m>>1]=((b[m>>1]&255)<<8|b[m>>1]>>8&255)&65535;if((b[m>>1]|0)<0){q=_(-((b[m>>1]|0)/256|0)|0,b[m>>1]&255)|0;}else{q=b[m>>1]|0;}if((c[j>>2]|0)>6){cQ(o,(c[j>>2]|0)-6|0);}do{if((b[k>>1]|0)>=0){if((b[k>>1]|0)>2){break;}c[d+13084>>2]=bi(12)|0;c[c[d+13084>>2]>>2]=0;a[(c[d+13084>>2]|0)+5|0]=0;c[(c[d+13084>>2]|0)+8>>2]=0;p=d+13092|0;c[p>>2]=(c[p>>2]|0)+1;p=b[k>>1]|0;do{if((p|0)==1){r=0;while(1){if((r|0)>=(b[l>>1]|0)){s=1023;break;}if((cr(o,d,0)|0)!=0){break;}r=r+1|0;}if((s|0)==1023){break;}cs(d);t=0;u=t;i=h;return u|0;}else if((p|0)==2){r=0;while(1){if((r|0)>=(b[l>>1]|0)){s=1030;break;}if((cr(o,d,1)|0)!=0){break;}r=r+1|0;}if((s|0)==1030){break;}cs(d);t=0;u=t;i=h;return u|0;}else if((p|0)==0){if((cr(o,d,0)|0)==0){break;}cs(d);t=0;u=t;i=h;return u|0;}}while(0);t=ct(d,q,e,f)|0;u=t;i=h;return u|0;}}while(0);t=0;u=t;i=h;return u|0;}}while(0);t=0;u=t;i=h;return u|0;}}while(0);t=0;u=t;i=h;return u|0;}function cr(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;e=i;i=i+16|0;f=e|0;g=e+8|0;h=a;a=b;b=c[a+13084>>2]|0;do{if((d|0)!=0){if((b|0)==0){j=1047;break;}while(1){if((c[b+8>>2]|0)==0){break;}b=c[b+8>>2]|0;}c[a+13096>>2]=c[b>>2];}else{j=1047;}}while(0);if((j|0)==1047){c[a+13096>>2]=0;}do{if((cP(h,g|0,1,4)|0)==4){if((cP(h,f,4,1)|0)!=1){break;}c[f>>2]=(c[f>>2]&255)<<24|(c[f>>2]&65280)<<8|(c[f>>2]&16711680)>>8|c[f>>2]>>24&255;if((c4(g|0,6272,4)|0)!=0){k=-2;l=k;i=e;return l|0;}while(1){d=cv(h,a)|0;m=d;if((d|0)==0){j=1055;break;}if((m|0)==-1){j=1057;break;}d=c[b+8>>2]|0;while(1){if((d|0)!=0){n=(c[d>>2]|0)<(c[m>>2]|0);}else{n=0;}if(!n){break;}b=d;d=c[b+8>>2]|0;}c[m+8>>2]=d;c[b+8>>2]=m;o=a+13092|0;c[o>>2]=(c[o>>2]|0)+1;b=m;}if((j|0)==1055){k=-2;l=k;i=e;return l|0;}else if((j|0)==1057){k=0;l=k;i=e;return l|0;}}}while(0);k=-1;l=k;i=e;return l|0;}function cs(a){a=a|0;var b=0,d=0;b=a;a=c[b+13084>>2]|0;d=a;if((a|0)==0){return;}while(1){if((d|0)==0){break;}a=c[d+8>>2]|0;c0(d);d=a;}c[b+13084>>2]=0;return;}function ct(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;h=i;i=i+192|0;j=h|0;k=h+64|0;l=h+128|0;m=b;b=e;e=f;f=g;g=0;while(1){if((g|0)>=16){break;}c[j+(g<<2)>>2]=0;c[k+(g<<2)>>2]=0;c[l+(g<<2)>>2]=c[m+1056>>2];g=g+1|0;}n=5e5;cu(m,n,b);o=bi((c[m+13092>>2]|0)+1<<3)|0;p=o;q=o;o=c[m+13084>>2]|0;r=0;s=0;t=0;u=0;v=0;g=0;while(1){if((g|0)>=(c[m+13092>>2]|0)){break;}w=0;x=d[o+5|0]|0;do{if((x|0)==9){if((c[m+13056>>2]&1<<(d[o+4|0]|0)|0)!=0){if((c[m+540+((d[o+6|0]|0)<<2)>>2]|0)!=0){y=d[o+6|0]|0;}else{a[o+6|0]=0;y=0;}if((c[k+((d[o+4|0]|0)<<2)>>2]|0)!=(y|0)){c[k+((d[o+4|0]|0)<<2)>>2]=y;}else{w=1;}}else{y=d[o+6|0]|0;do{if((c[l+((d[o+4|0]|0)<<2)>>2]|0)!=-1){if((c[l+((d[o+4|0]|0)<<2)>>2]|0)==(y|0)){z=1096;break;}c[l+((d[o+4|0]|0)<<2)>>2]=y;}else{z=1096;}}while(0);if((z|0)==1096){z=0;w=1;}}}else if((x|0)==15){if((c[m+13056>>2]&1<<(d[o+4|0]|0)|0)!=0){w=1;break;}if((c[m+28+((d[o+6|0]|0)<<2)>>2]|0)!=0){y=d[o+6|0]|0;}else{a[o+6|0]=0;y=0;}if((c[j+((d[o+4|0]|0)<<2)>>2]|0)!=(y|0)){c[j+((d[o+4|0]|0)<<2)>>2]=y;}else{w=1;}}else if((x|0)==1){if((v|0)!=0){v=1;}if((c[m+13056>>2]&1<<(d[o+4|0]|0)|0)!=0){if((c[(c[m+540+(c[k+((d[o+4|0]|0)<<2)>>2]<<2)>>2]|0)+4+((d[o+6|0]|0)<<2)>>2]|0)==0){c[(c[m+540+(c[k+((d[o+4|0]|0)<<2)>>2]<<2)>>2]|0)+4+((d[o+6|0]|0)<<2)>>2]=-1;}}else{if((c[l+((d[o+4|0]|0)<<2)>>2]|0)==-1){break;}if((c[(c[m+28+(c[j+((d[o+4|0]|0)<<2)>>2]<<2)>>2]|0)+4+(c[l+((d[o+4|0]|0)<<2)>>2]<<2)>>2]|0)==0){c[(c[m+28+(c[j+((d[o+4|0]|0)<<2)>>2]<<2)>>2]|0)+4+(c[l+((d[o+4|0]|0)<<2)>>2]<<2)>>2]=-1;}}}}while(0);x=(c[o>>2]|0)-t|0;A=x;do{if((x|0)!=0){if((v|0)!=0){z=1125;break;}B=_(c[m+1076>>2]|0,A)|0;s=s+(_(c[m+1080>>2]|0,A)|0)|0;if((s&-65536|0)!=0){B=B+(s>>16&65535)|0;s=s&65535;}u=u+B|0;}else{z=1125;}}while(0);if((z|0)==1125){z=0;if((v|0)==1){v=0;}}if((d[o+5|0]|0|0)==10){n=(d[o+4|0]|0)+((d[o+7|0]|0)<<8)+((d[o+6|0]|0)<<16)|0;cu(m,n,b);}if((w|0)==0){A=p;x=o|0;c[A>>2]=c[x>>2];c[A+4>>2]=c[x+4>>2];c[p>>2]=u;p=p+8|0;r=r+1|0;}t=c[o>>2]|0;o=c[o+8>>2]|0;g=g+1|0;}c[p>>2]=u;a[p+5|0]=99;r=r+1|0;cs(m);c[e>>2]=r;c[f>>2]=u;i=h;return q|0;}function cu(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0;e=a;f=+(b|0)*+(c[e+4>>2]|0)*0.065536/+(d|0);c[e+1080>>2]=~~f&65535;c[e+1076>>2]=~~f>>16;return;}function cv(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;f=i;i=i+40|0;g=f|0;h=f+8|0;j=f+16|0;k=f+24|0;l=f+32|0;m=b;b=e;L1442:while(1){e=cw(m)|0;n=b+13096|0;c[n>>2]=(c[n>>2]|0)+e;if((cP(m,g,1,1)|0)!=1){o=1138;break;}do{if((d[g]|0)==240){o=1141;}else{if((d[g]|0)==247){o=1141;break;}if((d[g]|0)==255){e=m;cP(e,h,1,1)|0;p=cw(m)|0;do{if((d[h]|0)>0){if((d[h]|0)>=16){o=1146;break;}e=m;n=p;q=a[h]|0;r=b;cx(e,n,q,r)|0;}else{o=1146;}}while(0);if((o|0)==1146){o=0;r=d[h]|0;if((r|0)==47){o=1147;break L1442;}else if((r|0)==81){o=1148;break L1442;}cQ(m,p);}}else{a[j]=a[g]|0;if((a[j]&128|0)!=0){a[6632]=d[j]&15;a[6624]=d[j]>>4&7;r=m;cP(r,j,1,1)|0;a[j]=d[j]&127;}switch(d[6624]|0){case 1:{o=1156;break L1442;break;}case 6:{o=1188;break L1442;break;}case 4:{o=1186;break L1442;break;}case 5:{break;}case 0:{o=1155;break L1442;break;}case 2:{o=1157;break L1442;break;}case 3:{cP(m,k,1,1)|0;a[k]=d[k]&127;s=255;L1466:do{switch(d[j]|0){case 98:{a[6616]=1;a[6600+(d[6632]|0)|0]=a[k]|0;break;}case 6:{if((a[6616]|0)!=0){break L1466;}r=d[6584+(d[6632]|0)|0]<<8|d[6600+(d[6632]|0)|0];if((r|0)==0){s=11;}else if((r|0)==32639){o=1179;break L1442;}break;}case 7:{s=4;break;}case 10:{s=5;break;}case 11:{s=7;break;}case 64:{s=6;break;}case 120:{s=12;break;}case 121:{s=13;break;}case 123:{s=14;break;}case 0:{s=15;break;}case 32:{if((d[k]|0)==0){s=15;}break;}case 100:{a[6616]=0;a[6584+(d[6632]|0)|0]=a[k]|0;break;}case 101:{a[6616]=0;a[6600+(d[6632]|0)|0]=a[k]|0;break;}case 99:{a[6616]=1;a[6584+(d[6632]|0)|0]=a[k]|0;break;}default:{}}}while(0);if((s|0)!=255){o=1184;break L1442;}break;}default:{}}}}}while(0);if((o|0)==1141){o=0;p=cw(m)|0;cQ(m,p);}}if((o|0)==1184){t=bi(12)|0;c[t>>2]=c[b+13096>>2];a[t+5|0]=s&255;a[t+4|0]=a[6632]|0;a[t+6|0]=a[k]|0;a[t+7|0]=0;c[t+8>>2]=0;u=t;v=u;i=f;return v|0;}else if((o|0)==1156){cP(m,k,1,1)|0;a[k]=d[k]&127;t=bi(12)|0;c[t>>2]=c[b+13096>>2];a[t+5|0]=1;a[t+4|0]=a[6632]|0;a[t+6|0]=a[j]|0;a[t+7|0]=a[k]|0;c[t+8>>2]=0;u=t;v=u;i=f;return v|0;}else if((o|0)==1179){t=bi(12)|0;c[t>>2]=c[b+13096>>2];a[t+5|0]=11;a[t+4|0]=a[6632]|0;a[t+6|0]=2;a[t+7|0]=0;c[t+8>>2]=0;u=t;v=u;i=f;return v|0;}else if((o|0)==1138){u=0;v=u;i=f;return v|0;}else if((o|0)==1188){cP(m,k,1,1)|0;a[k]=d[k]&127;t=bi(12)|0;c[t>>2]=c[b+13096>>2];a[t+5|0]=8;a[t+4|0]=a[6632]|0;a[t+6|0]=a[j]|0;a[t+7|0]=a[k]|0;c[t+8>>2]=0;u=t;v=u;i=f;return v|0;}else if((o|0)==1186){a[j]=d[j]&127;t=bi(12)|0;c[t>>2]=c[b+13096>>2];a[t+5|0]=9;a[t+4|0]=a[6632]|0;a[t+6|0]=a[j]|0;a[t+7|0]=0;c[t+8>>2]=0;u=t;v=u;i=f;return v|0;}else if((o|0)==1147){u=-1;v=u;i=f;return v|0;}else if((o|0)==1148){cP(m,j,1,1)|0;cP(m,k,1,1)|0;cP(m,l,1,1)|0;t=bi(12)|0;c[t>>2]=c[b+13096>>2];a[t+5|0]=10;a[t+4|0]=a[l]|0;a[t+6|0]=a[j]|0;a[t+7|0]=a[k]|0;c[t+8>>2]=0;u=t;v=u;i=f;return v|0;}else if((o|0)==1155){cP(m,k,1,1)|0;a[k]=d[k]&127;t=bi(12)|0;c[t>>2]=c[b+13096>>2];a[t+5|0]=2;a[t+4|0]=a[6632]|0;a[t+6|0]=a[j]|0;a[t+7|0]=a[k]|0;c[t+8>>2]=0;u=t;v=u;i=f;return v|0;}else if((o|0)==1157){cP(m,k,1,1)|0;a[k]=d[k]&127;t=bi(12)|0;c[t>>2]=c[b+13096>>2];a[t+5|0]=3;a[t+4|0]=a[6632]|0;a[t+6|0]=a[j]|0;a[t+7|0]=a[k]|0;c[t+8>>2]=0;u=t;v=u;i=f;return v|0;}return 0;}function cw(b){b=b|0;var c=0,d=0,e=0;c=i;i=i+8|0;d=c|0;e=b;b=0;while(1){cP(e,d,1,1)|0;b=b+(a[d]&127)|0;if((a[d]&128|0)==0){break;}b=b<<7;}i=c;return b|0;}function cx(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;h=e;e=f;f=g;g=bi(h+1|0)|0;if((h|0)!=(cP(b,g,1,h)|0)){c0(g);i=-1;j=i;return j|0;}a[g+h|0]=0;while(1){b=h;h=b-1|0;if((b|0)==0){break;}if((d[g+h|0]|0|0)<32){a[g+h|0]=46;}}h=e&255;if((h|0)==1){k=0;}else if((h|0)==2){k=1;}else{c0(g);g=0;}if((g|0)!=0){if((c[f+13104+(k<<2)>>2]|0)!=0){c0(c[f+13104+(k<<2)>>2]|0);}c[f+13104+(k<<2)>>2]=g;}i=0;j=i;return j|0;}function cy(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;g=b;b=e;e=f;f=g+1724+(b*236|0)|0;if((c[(c[f+4>>2]|0)+12>>2]|0)==0){h=c[f+16>>2]>>12;if((c[e>>2]|0)>=((c[(c[f+4>>2]|0)+8>>2]>>12)-h|0)){a[f|0]=0;c[e>>2]=(c[(c[f+4>>2]|0)+8>>2]>>12)-h;}else{i=f+16|0;c[i>>2]=(c[i>>2]|0)+(c[e>>2]<<12);}j=(c[(c[f+4>>2]|0)+88>>2]|0)+(h<<1)|0;k=j;return k|0;}h=a[(c[f+4>>2]|0)+110|0]|0;if((c[f+212>>2]|0)!=0){L1575:do{if((h&4|0)!=0){do{if((h&64|0)==0){if((d[f|0]|0|0)==1){break;}if((d[f|0]|0|0)!=2){break L1575;}}}while(0);if((h&8|0)!=0){j=cz(g,f,c[e>>2]|0)|0;k=j;return k|0;}else{j=cA(g,f,c[e>>2]|0)|0;k=j;return k|0;}}}while(0);j=cB(g,b,e)|0;k=j;return k|0;}else{L1561:do{if((h&4|0)!=0){do{if((h&64|0)==0){if((d[f|0]|0|0)==1){break;}if((d[f|0]|0|0)!=2){break L1561;}}}while(0);if((h&8|0)!=0){j=cC(g,f,c[e>>2]|0)|0;k=j;return k|0;}else{j=cD(g,f,c[e>>2]|0)|0;k=j;return k|0;}}}while(0);j=cE(g,b,e)|0;k=j;return k|0;}return 0;}function cz(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;f=a;a=d;d=e;e=c[a+16>>2]|0;g=c[a+20>>2]|0;h=c[(c[a+4>>2]|0)+4>>2]|0;i=c[c[a+4>>2]>>2]|0;j=c[f+1068>>2]|0;k=c[(c[a+4>>2]|0)+88>>2]|0;l=c[a+216>>2]|0;m=h<<1;n=i<<1;o=0;while(1){if((d|0)!=0){p=(e|0)<=(i|0);}else{p=0;}if(!p){break;}q=((i-e|0)/(g|0)|0)+1|0;if((q|0)>(d|0)){q=d;}if((q|0)>(l|0)){q=l;o=1;}else{l=l-q|0;}d=d-q|0;while(1){r=q;q=r-1|0;if((r|0)==0){break;}s=b[k+(e>>12<<1)>>1]|0;t=b[k+((e>>12)+1<<1)>>1]|0;r=j;j=r+2|0;b[r>>1]=(s<<16>>16)+((_((t<<16>>16)-(s<<16>>16)|0,e&4095)|0)>>>12)&65535;e=e+g|0;}if((o|0)!=0){l=c[a+212>>2]|0;g=cG(f,a,0)|0;o=0;}}while(1){if((d|0)==0){break;}if((g|0)>0){u=h;}else{u=i;}q=((u-e|0)/(g|0)|0)+1|0;if((q|0)>(d|0)){q=d;}if((q|0)>(l|0)){q=l;o=1;}else{l=l-q|0;}d=d-q|0;while(1){p=q;q=p-1|0;if((p|0)==0){break;}s=b[k+(e>>12<<1)>>1]|0;t=b[k+((e>>12)+1<<1)>>1]|0;p=j;j=p+2|0;b[p>>1]=(s<<16>>16)+((_((t<<16>>16)-(s<<16>>16)|0,e&4095)|0)>>>12)&65535;e=e+g|0;}if((o|0)!=0){l=c[a+212>>2]|0;g=cG(f,a,(g|0)<0|0)|0;o=0;}if((e|0)>=(h|0)){e=m-e|0;g=g*-1|0;}else{if((e|0)<=(i|0)){e=n-e|0;g=g*-1|0;}}}c[a+216>>2]=l;c[a+20>>2]=g;c[a+16>>2]=e;return c[f+1068>>2]|0;}function cA(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;f=a;a=d;d=e;e=c[a+16>>2]|0;g=c[a+20>>2]|0;h=c[(c[a+4>>2]|0)+4>>2]|0;i=h-(c[c[a+4>>2]>>2]|0)|0;j=c[f+1068>>2]|0;k=c[(c[a+4>>2]|0)+88>>2]|0;l=c[a+216>>2]|0;m=0;while(1){if((d|0)==0){break;}if((e|0)>=(h|0)){e=e-i|0;}n=((h-e|0)/(g|0)|0)+1|0;if((n|0)>(d|0)){n=d;}if((n|0)>(l|0)){n=l;m=1;}else{l=l-n|0;}d=d-n|0;while(1){o=n;n=o-1|0;if((o|0)==0){break;}o=b[k+(e>>12<<1)>>1]|0;p=j;j=p+2|0;b[p>>1]=(o<<16>>16)+((_((b[k+((e>>12)+1<<1)>>1]|0)-(o<<16>>16)|0,e&4095)|0)>>>12)&65535;e=e+g|0;}if((m|0)!=0){l=c[a+212>>2]|0;g=cG(f,a,0)|0;m=0;}}c[a+216>>2]=l;c[a+20>>2]=g;c[a+16>>2]=e;return c[f+1068>>2]|0;}function cB(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;g=d;d=f;f=g+1724+(e*236|0)|0;e=c[g+1068>>2]|0;h=c[(c[f+4>>2]|0)+88>>2]|0;i=c[(c[f+4>>2]|0)+8>>2]|0;j=c[f+16>>2]|0;k=c[f+20>>2]|0;l=c[d>>2]|0;m=c[f+216>>2]|0;if((k|0)<0){k=-k|0;}do{n=l;l=n-1|0;if((n|0)==0){o=1322;break;}n=m;m=n-1|0;if((n|0)==0){m=c[f+212>>2]|0;k=cG(g,f,0)|0;}n=b[h+(j>>12<<1)>>1]|0;p=e;e=p+2|0;b[p>>1]=(n<<16>>16)+((_((b[h+((j>>12)+1<<1)>>1]|0)-(n<<16>>16)|0,j&4095)|0)>>>12)&65535;j=j+k|0;}while((j|0)<(i|0));if((o|0)==1322){q=m;r=f;s=r+216|0;c[s>>2]=q;t=k;u=f;v=u+20|0;c[v>>2]=t;w=j;x=f;y=x+16|0;c[y>>2]=w;z=g;A=z+1068|0;B=c[A>>2]|0;return B|0;}if((j|0)==(i|0)){i=e;e=i+2|0;b[i>>1]=b[h+(j>>12<<1)>>1]|0;}a[f|0]=0;h=d;c[h>>2]=(c[h>>2]|0)-(l+1);q=m;r=f;s=r+216|0;c[s>>2]=q;t=k;u=f;v=u+20|0;c[v>>2]=t;w=j;x=f;y=x+16|0;c[y>>2]=w;z=g;A=z+1068|0;B=c[A>>2]|0;return B|0;}function cC(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;f=a;a=d;d=e;e=c[a+16>>2]|0;g=c[a+20>>2]|0;h=c[(c[a+4>>2]|0)+4>>2]|0;i=c[c[a+4>>2]>>2]|0;j=c[f+1068>>2]|0;k=c[(c[a+4>>2]|0)+88>>2]|0;l=h<<1;m=i<<1;if((e|0)<=(i|0)){n=((i-e|0)/(g|0)|0)+1|0;if((n|0)>(d|0)){n=d;d=0;}else{d=d-n|0;}while(1){o=n;n=o-1|0;if((o|0)==0){break;}p=b[k+(e>>12<<1)>>1]|0;q=b[k+((e>>12)+1<<1)>>1]|0;o=j;j=o+2|0;b[o>>1]=(p<<16>>16)+((_((q<<16>>16)-(p<<16>>16)|0,e&4095)|0)>>>12)&65535;e=e+g|0;}}while(1){if((d|0)==0){break;}if((g|0)>0){r=h;}else{r=i;}n=((r-e|0)/(g|0)|0)+1|0;if((n|0)>(d|0)){n=d;d=0;}else{d=d-n|0;}while(1){o=n;n=o-1|0;if((o|0)==0){break;}p=b[k+(e>>12<<1)>>1]|0;q=b[k+((e>>12)+1<<1)>>1]|0;o=j;j=o+2|0;b[o>>1]=(p<<16>>16)+((_((q<<16>>16)-(p<<16>>16)|0,e&4095)|0)>>>12)&65535;e=e+g|0;}if((e|0)>=(h|0)){e=l-e|0;g=g*-1|0;}else{if((e|0)<=(i|0)){e=m-e|0;g=g*-1|0;}}}c[a+20>>2]=g;c[a+16>>2]=e;return c[f+1068>>2]|0;}function cD(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;f=a;a=d;d=e;e=c[a+16>>2]|0;g=c[a+20>>2]|0;h=c[(c[a+4>>2]|0)+4>>2]|0;i=h-(c[c[a+4>>2]>>2]|0)|0;j=c[f+1068>>2]|0;k=c[(c[a+4>>2]|0)+88>>2]|0;while(1){if((d|0)==0){break;}if((e|0)>=(h|0)){e=e-i|0;}l=((h-e|0)/(g|0)|0)+1|0;if((l|0)>(d|0)){l=d;d=0;}else{d=d-l|0;}while(1){m=l;l=m-1|0;if((m|0)==0){break;}m=b[k+(e>>12<<1)>>1]|0;n=j;j=n+2|0;b[n>>1]=(m<<16>>16)+((_((b[k+((e>>12)+1<<1)>>1]|0)-(m<<16>>16)|0,e&4095)|0)>>>12)&65535;e=e+g|0;}}c[a+16>>2]=e;return c[f+1068>>2]|0;}function cE(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;g=d;d=f;f=g+1724+(e*236|0)|0;e=c[g+1068>>2]|0;h=c[(c[f+4>>2]|0)+88>>2]|0;i=c[f+16>>2]|0;j=c[f+20>>2]|0;k=c[(c[f+4>>2]|0)+8>>2]|0;l=c[d>>2]|0;if((j|0)<0){j=-j|0;}m=((k-i|0)/(j|0)|0)+1|0;if((m|0)>(l|0)){m=l;l=0;}else{l=l-m|0;}while(1){n=m;m=n-1|0;if((n|0)==0){break;}n=b[h+(i>>12<<1)>>1]|0;o=e;e=o+2|0;b[o>>1]=(n<<16>>16)+((_((b[h+((i>>12)+1<<1)>>1]|0)-(n<<16>>16)|0,i&4095)|0)>>>12)&65535;i=i+j|0;}if((i|0)<(k|0)){p=i;q=f;r=q+16|0;c[r>>2]=p;s=g;t=s+1068|0;u=c[t>>2]|0;return u|0;}if((i|0)==(k|0)){k=e;e=k+2|0;b[k>>1]=b[h+(i>>12<<1)>>1]|0;}a[f|0]=0;h=d;c[h>>2]=(c[h>>2]|0)-(l+1);p=i;q=f;r=q+16|0;c[r>>2]=p;s=g;t=s+1068|0;u=c[t>>2]|0;return u|0;}function cF(e,f){e=e|0;f=f|0;var g=0,h=0,i=0.0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0.0,C=0.0,D=0,E=0,F=0,G=0,H=0,I=0,J=0.0,K=0.0,L=0.0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0;g=f;f=c[g+88>>2]|0;h=1056+(a[g+112|0]<<2)|0;i=+(c[g+12>>2]|0)*+(d[h]|d[h+1|0]<<8|d[h+2|0]<<16|d[h+3|0]<<24|0)/(+(c[g+32>>2]|0)*+(c[e+4>>2]|0));e=~~(+(c[g+8>>2]|0)/i);h=bi(e>>11)|0;j=h;k=h;h=(e>>12)-1|0;l=((c[g+8>>2]|0)-4096|0)/(h|0)|0;m=l;n=l;l=h-1|0;h=l;if((l|0)!=0){l=k;k=l+2|0;b[l>>1]=b[f>>1]|0;}while(1){l=h-1|0;h=l;if((l|0)==0){break;}l=f+(n>>12<<1)|0;if(l>>>0>f>>>0){o=b[l-2>>1]|0;}else{o=0;}p=o&65535;q=b[l>>1]|0;r=b[l+2>>1]|0;s=b[l+4>>1]|0;t=+((n&4095)>>>0>>>0)*0.000244140625;l=k;k=l+2|0;b[l>>1]=~~(+(q<<16>>16|0)+t/6.0*(+(((p<<16>>16)*-2|0)-((q<<16>>16)*3|0)+((r<<16>>16)*6|0)-(s<<16>>16)|0)+t*(+(((p<<16>>16)-(q<<16>>16<<1)+(r<<16>>16)|0)*3|0|0)+t*+((-(p<<16>>16)|0)+(((q<<16>>16)-(r<<16>>16)|0)*3|0)+(s<<16>>16)|0))));n=n+m|0;}if((n&4095|0)!=0){p=b[f+(n>>12<<1)>>1]|0;q=b[f+((n>>12)+1<<1)>>1]|0;m=k;k=m+2|0;b[m>>1]=(p<<16>>16)+((_((q<<16>>16)-(p<<16>>16)|0,n&4095)|0)>>>12)&65535;u=e;v=g;w=v+8|0;c[w>>2]=u;x=g;y=x|0;z=c[y>>2]|0;A=+(z|0);B=i;C=A/B;D=~~C;E=g;F=E|0;c[F>>2]=D;G=g;H=G+4|0;I=c[H>>2]|0;J=+(I|0);K=i;L=J/K;M=~~L;N=g;O=N+4|0;c[O>>2]=M;P=g;Q=P+88|0;R=c[Q>>2]|0;S=R;c0(S);T=j;U=g;V=U+88|0;c[V>>2]=T;W=g;X=W+12|0;c[X>>2]=0;return;}else{p=k;k=p+2|0;b[p>>1]=b[f+(n>>12<<1)>>1]|0;u=e;v=g;w=v+8|0;c[w>>2]=u;x=g;y=x|0;z=c[y>>2]|0;A=+(z|0);B=i;C=A/B;D=~~C;E=g;F=E|0;c[F>>2]=D;G=g;H=G+4|0;I=c[H>>2]|0;J=+(I|0);K=i;L=J/K;M=~~L;N=g;O=N+4|0;c[O>>2]=M;P=g;Q=P+88|0;R=c[Q>>2]|0;S=R;c0(S);T=j;U=g;V=U+88|0;c[V>>2]=T;W=g;X=W+12|0;c[X>>2]=0;return;}}function cG(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,i=0,j=0,l=0,m=0.0,n=0.0;f=a;a=b;b=e;e=a+208|0;g=c[e>>2]|0;c[e>>2]=g+1;if((g|0)>=63){c[a+208>>2]=0;}g=cH(c[a+208>>2]|0)|0;if((c[a+80+(g<<2)>>2]|0)!=0){if((b|0)!=0){i=-(c[a+80+(g<<2)>>2]|0)|0;j=i;return j|0;}else{i=c[a+80+(g<<2)>>2]|0;j=i;return j|0;}}e=(d[(c[a+4>>2]|0)+109|0]|0)<<7;if((c[a+52>>2]|0)!=0){l=a+56|0;c[l>>2]=(c[l>>2]|0)+(c[a+52>>2]|0);if((c[a+56>>2]|0)>=65536){c[a+52>>2]=0;}else{e=_(e,c[a+56>>2]|0)|0;e=e>>16;}}m=+(c[(c[a+4>>2]|0)+12>>2]|0)*+(c[a+12>>2]|0)/(+(c[(c[a+4>>2]|0)+32>>2]|0)*+(c[f+4>>2]|0))*4096.0;f=~~(+R(+(+(c[a+208>>2]<<4|0)*0.006135923151542565))*+(e|0)*1.0);if((f|0)<0){f=-f|0;e=1704+((f>>5&255)<<3)|0;n=(c[k>>2]=d[e]|d[e+1|0]<<8|d[e+2|0]<<16|d[e+3|0]<<24,c[k+4>>2]=d[e+4|0]|d[e+5|0]<<8|d[e+6|0]<<16|d[e+7|0]<<24,+h[k>>3]);e=3752+(f>>13<<3)|0;m=m/(n*(c[k>>2]=d[e]|d[e+1|0]<<8|d[e+2|0]<<16|d[e+3|0]<<24,c[k+4>>2]=d[e+4|0]|d[e+5|0]<<8|d[e+6|0]<<16|d[e+7|0]<<24,+h[k>>3]));}else{e=1704+((f>>5&255)<<3)|0;n=(c[k>>2]=d[e]|d[e+1|0]<<8|d[e+2|0]<<16|d[e+3|0]<<24,c[k+4>>2]=d[e+4|0]|d[e+5|0]<<8|d[e+6|0]<<16|d[e+7|0]<<24,+h[k>>3]);e=3752+(f>>13<<3)|0;m=m*n*(c[k>>2]=d[e]|d[e+1|0]<<8|d[e+2|0]<<16|d[e+3|0]<<24,c[k+4>>2]=d[e+4|0]|d[e+5|0]<<8|d[e+6|0]<<16|d[e+7|0]<<24,+h[k>>3]);}if((c[a+52>>2]|0)==0){c[a+80+(g<<2)>>2]=~~m;}if((b|0)!=0){m=-0.0-m;}i=~~m;j=i;return j|0;}function cH(a){a=a|0;var b=0,c=0;b=a;do{if((b|0)<16){c=15-b|0;}else{if((b|0)>=48){c=79-b|0;break;}else{c=b-16|0;break;}}}while(0);return c|0;}function cI(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;return an(b|0,d|0,e|0,c[a>>2]|0)|0;}function cJ(a){a=a|0;var b=0,d=0,e=0;b=a;a=0;if((c[b+4>>2]|0)==0){d=b;c0(d);e=a;return e|0;}a=ao(c[b>>2]|0)|0;d=b;c0(d);e=a;return e|0;}function cK(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=d;d=a;a=e;e=c[d+4>>2]|0;g=e+(_(a,f)|0)|0;if(g>>>0>(c[d+8>>2]|0)>>>0){a=(((c[d+8>>2]|0)-(c[d+4>>2]|0)|0)>>>0)/(f>>>0)|0;}g=b;b=c[d+4>>2]|0;e=_(a,f)|0;c6(g|0,b|0,e)|0;e=_(a,f)|0;f=d+4|0;c[f>>2]=(c[f>>2]|0)+e;return a|0;}function cL(a){a=a|0;var b=0,d=0;b=a;if((c[b+12>>2]|0)==0){d=b;c0(d);return 0;}c0(c[b>>2]|0);d=b;c0(d);return 0;}function cM(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=bi(12)|0;if((d|0)==0){e=0;f=e;return f|0;}g=bi(8)|0;if((g|0)==0){c0(d);e=0;f=e;return f|0;}else{c[g>>2]=a;c[g+4>>2]=b;c[d+8>>2]=g;c[d>>2]=2;c[d+4>>2]=4;e=d;f=e;return f|0;}return 0;}function cN(a){a=a|0;var b=0,c=0,d=0;b=av(a|0,6544)|0;if((b|0)==0){c=0;d=c;return d|0;}else{c=cM(b,1)|0;d=c;return d|0;}return 0;}function cO(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=a;a=bi(12)|0;if((a|0)==0){f=0;g=f;return g|0;}h=bi(16)|0;if((h|0)==0){c0(a);f=0;g=f;return g|0;}else{c[h>>2]=e;c[h+4>>2]=e;c[h+8>>2]=e+b;c[h+12>>2]=d;c[a+8>>2]=h;c[a>>2]=4;c[a+4>>2]=2;f=a;g=f;return g|0;}return 0;}function cP(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=a;return aY[c[f>>2]&7](c[f+8>>2]|0,b,d,e)|0;}function cQ(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=i;i=i+1024|0;d=c|0;e=a;a=b;while(1){if(a>>>0<=0){break;}b=a;if(b>>>0>1024){b=1024;}a=a-b|0;(b|0)!=(cP(e,d|0,1,b)|0);}i=c;return;}function cR(a){a=a|0;var b=0;b=a;a=aW[c[b+4>>2]&7](c[b+8>>2]|0)|0;c0(b);return a|0;}function cS(){var a=0;c[1676]=bi(516)|0;c5(c[1676]|0,0,516);a=bi(3584)|0;c[c[1676]>>2]=a;c5(c[c[1676]>>2]|0,0,3584);c[1804]=bi(516)|0;c5(c[1804]|0,0,516);a=bi(3584)|0;c[c[1804]>>2]=a;c5(c[c[1804]>>2]|0,0,3584);return 0;}function cT(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;i=i+1024|0;e=d|0;f=b;do{if((f|0)!=0){if((c1(f|0)|0)>>>0>=1024){break;}b=e|0;g=f;c2(b|0,g|0)|0;g=aE(f|0,47)|0;if((g|0)!=0){a[e+(g-f)|0]=0;g=c[m>>2]|0;b=e|0;ar(g|0,6480,(g=i,i=i+8|0,c[g>>2]=b,g)|0)|0;i=g;bj(e|0);}}}while(0);cS()|0;do{if((f|0)!=0){if((a[f]|0)==0){break;}h=f;j=cU(h)|0;i=d;return j|0;}}while(0);f=6520;h=f;j=cU(h)|0;i=d;return j|0;}function cU(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;d=i;i=i+1064|0;e=d|0;f=d+1024|0;g=b;b=0;h=0;if((c[1660]|0)>50){j=c[m>>2]|0;ar(j|0,5792,(k=i,i=i+1|0,i=i+7&-8,c[k>>2]=0,k)|0)|0;i=k;l=-1;n=l;i=d;return n|0;}j=bh(g)|0;o=j;if((j|0)==0){j=c[m>>2]|0;p=g;ar(j|0,5392,(k=i,i=i+8|0,c[k>>2]=p,k)|0)|0;i=k;l=-1;n=l;i=d;return n|0;}L1881:while(1){if((c_(e|0,1024,o)|0)==0){q=1646;break;}h=h+1|0;p=0;c[f>>2]=ay(e|0,5096)|0;if((c[f>>2]|0)==0){continue;}do{if((aV(c[f>>2]|0,4840)|0)==0){p=-1;}else{if((a[c[f>>2]|0]|0)==35){continue L1881;}else{break;}}}while(0);while(1){do{if((c[f+(p<<2)>>2]|0)!=0){if((a[c[f+(p<<2)>>2]|0]|0)==35){r=0;break;}r=(p|0)<10;}else{r=0;}}while(0);if(!r){break;}j=p+1|0;p=j;c[f+(j<<2)>>2]=ay(0,5096)|0;}do{if((aV(c[f>>2]|0,4832)|0)!=0){if((aV(c[f>>2]|0,4816)|0)==0){q=1504;break;}if((aV(c[f>>2]|0,4800)|0)==0){q=1504;break;}if((aV(c[f>>2]|0,6552)|0)==0){q=1504;break;}if((aV(c[f>>2]|0,6536)|0)==0){q=1504;break;}if((aV(c[f>>2]|0,6504)|0)!=0){do{if((aV(c[f>>2]|0,6416)|0)!=0){if((aV(c[f>>2]|0,6400)|0)==0){q=1509;break;}if((aV(c[f>>2]|0,6344)|0)!=0){if((aV(c[f>>2]|0,6280)|0)!=0){do{if((aV(c[f>>2]|0,6176)|0)!=0){if((aV(c[f>>2]|0,6136)|0)==0){q=1516;break;}if((aV(c[f>>2]|0,6072)|0)!=0){if((aV(c[f>>2]|0,6008)|0)!=0){if((aV(c[f>>2]|0,5952)|0)!=0){if((aV(c[f>>2]|0,5880)|0)!=0){if((aV(c[f>>2]|0,5784)|0)!=0){if((aV(c[f>>2]|0,5720)|0)!=0){if((aV(c[f>>2]|0,5616)|0)!=0){if((p|0)<2){q=1562;break L1881;}if((a[c[f>>2]|0]|0)<48){q=1562;break L1881;}if((a[c[f>>2]|0]|0)>57){q=1562;break L1881;}s=aL(c[f>>2]|0)|0;if((s|0)<0){q=1565;break L1881;}if((s|0)>127){q=1565;break L1881;}if((b|0)==0){q=1567;break L1881;}if((c[(c[b>>2]|0)+(s*28|0)>>2]|0)!=0){c0(c[(c[b>>2]|0)+(s*28|0)>>2]|0);}j=bi((c1(c[f+4>>2]|0)|0)+1|0)|0;c[(c[b>>2]|0)+(s*28|0)>>2]=j;t=c[f+4>>2]|0;c2(j|0,t|0)|0;c[(c[b>>2]|0)+(s*28|0)+24>>2]=-1;c[(c[b>>2]|0)+(s*28|0)+20>>2]=-1;c[(c[b>>2]|0)+(s*28|0)+16>>2]=-1;c[(c[b>>2]|0)+(s*28|0)+12>>2]=-1;c[(c[b>>2]|0)+(s*28|0)+8>>2]=-1;c[(c[b>>2]|0)+(s*28|0)+4>>2]=-1;u=2;while(1){if((u|0)>=(p|0)){break;}t=aH(c[f+(u<<2)>>2]|0,61)|0;j=t;if((t|0)==0){q=1573;break L1881;}t=j;j=t+1|0;a[t]=0;if((aV(c[f+(u<<2)>>2]|0,5272)|0)!=0){if((aV(c[f+(u<<2)>>2]|0,5208)|0)!=0){if((aV(c[f+(u<<2)>>2]|0,5152)|0)!=0){if((aV(c[f+(u<<2)>>2]|0,5008)|0)!=0){if((aV(c[f+(u<<2)>>2]|0,4944)|0)!=0){q=1625;break L1881;}if((aV(j|0,5e3)|0)!=0){if((aV(j|0,4992)|0)!=0){if((aV(j|0,4936)|0)!=0){q=1621;break L1881;}c[(c[b>>2]|0)+(s*28|0)+24>>2]=1;}else{c[(c[b>>2]|0)+(s*28|0)+16>>2]=1;}}else{c[(c[b>>2]|0)+(s*28|0)+20>>2]=1;}}else{if((aV(j|0,5e3)|0)!=0){if((aV(j|0,4992)|0)!=0){q=1611;break L1881;}c[(c[b>>2]|0)+(s*28|0)+16>>2]=0;}else{c[(c[b>>2]|0)+(s*28|0)+20>>2]=0;}}}else{if((aV(j|0,5144)|0)!=0){if((aV(j|0,5112)|0)!=0){if((aV(j|0,5104)|0)!=0){v=(((aL(j|0)|0)+100|0)*100|0|0)/157|0;}else{v=127;}}else{v=0;}}else{v=64;}if((v|0)<0){q=1604;break L1881;}if((v|0)>127){q=1604;break L1881;}do{if((v|0)==0){if((a[j]|0)==45){break;}if((a[j]|0)<48){q=1604;break L1881;}if((a[j]|0)>57){q=1604;break L1881;}}}while(0);c[(c[b>>2]|0)+(s*28|0)+12>>2]=v;}}else{v=aL(j|0)|0;if((v|0)<0){q=1586;break L1881;}if((v|0)>127){q=1586;break L1881;}if((a[j]|0)<48){q=1586;break L1881;}if((a[j]|0)>57){q=1586;break L1881;}c[(c[b>>2]|0)+(s*28|0)+4>>2]=v;}}else{v=aL(j|0)|0;if((v|0)<0){q=1579;break L1881;}if((v|0)>800){q=1579;break L1881;}if((a[j]|0)<48){q=1579;break L1881;}if((a[j]|0)>57){q=1579;break L1881;}c[(c[b>>2]|0)+(s*28|0)+8>>2]=v;}u=u+1|0;}}else{if((p|0)<2){q=1552;break L1881;}s=aL(c[f+4>>2]|0)|0;if((s|0)<0){q=1555;break L1881;}if((s|0)>127){q=1555;break L1881;}if((c[6704+(s<<2)>>2]|0)==0){c[6704+(s<<2)>>2]=bi(516)|0;c5(c[6704+(s<<2)>>2]|0,0,516);t=bi(3584)|0;c[c[6704+(s<<2)>>2]>>2]=t;c5(c[c[6704+(s<<2)>>2]>>2]|0,0,3584);}b=c[6704+(s<<2)>>2]|0;}}else{if((p|0)<2){q=1543;break L1881;}s=aL(c[f+4>>2]|0)|0;if((s|0)<0){q=1546;break L1881;}if((s|0)>127){q=1546;break L1881;}if((c[7216+(s<<2)>>2]|0)==0){c[7216+(s<<2)>>2]=bi(516)|0;c5(c[7216+(s<<2)>>2]|0,0,516);t=bi(3584)|0;c[c[7216+(s<<2)>>2]>>2]=t;c5(c[c[7216+(s<<2)>>2]>>2]|0,0,3584);}b=c[7216+(s<<2)>>2]|0;}}else{if((p|0)!=2){q=1539;break L1881;}t=c[f+4>>2]|0;c7(7728,t|0,255)|0;a[7983]=0;}}else{if((p|0)<2){q=1531;break L1881;}s=1;while(1){if((s|0)>=(p|0)){break;}c[1660]=(c[1660]|0)+1;cU(c[f+(s<<2)>>2]|0)|0;c[1660]=(c[1660]|0)-1;s=s+1|0;}}}else{if((p|0)<2){q=1523;break L1881;}s=1;while(1){if((s|0)>=(p|0)){break;}bj(c[f+(s<<2)>>2]|0);s=s+1|0;}}}else{t=c[m>>2]|0;ar(t|0,5960,(k=i,i=i+1|0,i=i+7&-8,c[k>>2]=0,k)|0)|0;i=k;}}else{t=c[m>>2]|0;ar(t|0,6016,(k=i,i=i+1|0,i=i+7&-8,c[k>>2]=0,k)|0)|0;i=k;}}else{q=1516;}}while(0);if((q|0)==1516){q=0;t=c[m>>2]|0;w=c[f>>2]|0;ar(t|0,6088,(k=i,i=i+8|0,c[k>>2]=w,k)|0)|0;i=k;}}else{w=c[m>>2]|0;ar(w|0,6192,(k=i,i=i+1|0,i=i+7&-8,c[k>>2]=0,k)|0)|0;i=k;}}else{w=c[m>>2]|0;ar(w|0,6296,(k=i,i=i+1|0,i=i+7&-8,c[k>>2]=0,k)|0)|0;i=k;}}else{q=1509;}}while(0);if((q|0)==1509){q=0;w=c[m>>2]|0;t=c[f>>2]|0;ar(w|0,6352,(k=i,i=i+8|0,c[k>>2]=t,k)|0)|0;i=k;}}else{t=c[m>>2]|0;ar(t|0,6432,(k=i,i=i+1|0,i=i+7&-8,c[k>>2]=0,k)|0)|0;i=k;}}else{q=1504;}}while(0);if((q|0)==1504){q=0;}}if((q|0)==1523){s=c[m>>2]|0;b=g;v=h;ar(s|0,5912,(k=i,i=i+16|0,c[k>>2]=b,c[k+8>>2]=v,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1555){ar(c[m>>2]|0,5520,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1562){ar(c[m>>2]|0,5480,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1565){ar(c[m>>2]|0,5432,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1567){ar(c[m>>2]|0,5320,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1539){ar(c[m>>2]|0,5728,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1531){ar(c[m>>2]|0,5840,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1552){ar(c[m>>2]|0,5576,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1579){ar(c[m>>2]|0,5216,(k=i,i=i+24|0,c[k>>2]=g,c[k+8>>2]=h,c[k+16>>2]=800,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1586){ar(c[m>>2]|0,5160,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1611){ar(c[m>>2]|0,4952,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1621){ar(c[m>>2]|0,4888,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1625){v=c[f+(u<<2)>>2]|0;ar(c[m>>2]|0,5280,(k=i,i=i+24|0,c[k>>2]=g,c[k+8>>2]=h,c[k+16>>2]=v,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1546){ar(c[m>>2]|0,5624,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1543){ar(c[m>>2]|0,5680,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1604){ar(c[m>>2]|0,5016,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1573){v=c[f+(u<<2)>>2]|0;ar(c[m>>2]|0,5280,(k=i,i=i+24|0,c[k>>2]=g,c[k+8>>2]=h,c[k+16>>2]=v,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1646){ao(o|0)|0;l=0;n=l;i=d;return n|0;}return 0;}function cV(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;c[1672]=d;b[3346]=e;a[6694]=f;b[3348]=g;return 6688;}function cW(f,g,h){f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,n=0;j=i;k=f;f=h;if((k|0)==0){l=0;n=l;i=j;return n|0;}h=bi(14164)|0;c5(h|0,0,14164);c[h+24>>2]=g;g=0;while(1){if((g|0)>=128){break;}if((c[6704+(g<<2)>>2]|0)!=0){c[h+28+(g<<2)>>2]=bi(516)|0;c5(c[h+28+(g<<2)>>2]|0,0,516);c[c[h+28+(g<<2)>>2]>>2]=c[c[6704+(g<<2)>>2]>>2];}if((c[7216+(g<<2)>>2]|0)!=0){c[h+540+(g<<2)>>2]=bi(516)|0;c5(c[h+540+(g<<2)>>2]|0,0,516);c[c[h+540+(g<<2)>>2]>>2]=c[c[7216+(g<<2)>>2]>>2];}g=g+1|0;}c[h+20>>2]=70;c[h+13052>>2]=32;c[h+13056>>2]=33280;c[h+4>>2]=c[f>>2];c[h+8>>2]=0;if((b[f+4>>1]&255|0)==16){g=h+8|0;c[g>>2]=c[g>>2]|4;}if((b[f+4>>1]&32768|0)!=0){g=h+8|0;c[g>>2]=c[g>>2]|2;}if((d[f+6|0]|0)==1){g=h+8|0;c[g>>2]=c[g>>2]|1;}g=e[f+4>>1]|0;if((g|0)==36880){c[h+1060>>2]=4;}else if((g|0)==16){c[h+1060>>2]=6;}else if((g|0)==32776){c[h+1060>>2]=10;}else if((g|0)==8){c[h+1060>>2]=8;}else if((g|0)==32784){c[h+1060>>2]=2;}else{ar(c[m>>2]|0,6144,(g=i,i=i+1|0,i=i+7&-8,c[g>>2]=0,g)|0)|0;i=g;c[h+1060>>2]=6;}c[h+1064>>2]=e[f+8>>1]|0;c[h+1068>>2]=bi(e[f+8>>1]<<1)|0;c[h+1072>>2]=bi(e[f+8>>1]<<1<<2)|0;c[h+12>>2]=_((c[h+8>>2]&1|0)!=0?1:2,(c[h+8>>2]&4|0)!=0?2:1)|0;c[h+13060>>2]=(c[f>>2]|0)/1e3|0;if((c[h+13060>>2]|0)<1){c[h+13060>>2]=1;}else{if((c[h+13060>>2]|0)>255){c[h+13060>>2]=255;}}c[h+13064>>2]=0;c[h+13068>>2]=0;c[h+13076>>2]=cq(k,h,h+13100|0,h+13072|0)|0;if((c[h+13076>>2]|0)==0){c0(h);l=0;n=l;i=j;return n|0;}c[h+1052>>2]=0;c[h+1056>>2]=0;if((a[7728]|0)!=0){k=h;bz(k,7728)|0;}bv(h)|0;l=h;n=l;i=j;return n|0;}function cX(a,b){a=a|0;b=b|0;return cW(a,0,b)|0;}function cY(a){a=a|0;var b=0;b=a;bx(b);a=0;while(1){if((a|0)>=128){break;}if((c[b+28+(a<<2)>>2]|0)!=0){c0(c[b+28+(a<<2)>>2]|0);}if((c[b+540+(a<<2)>>2]|0)!=0){c0(c[b+540+(a<<2)>>2]|0);}a=a+1|0;}c0(c[b+1072>>2]|0);c0(c[b+1068>>2]|0);c0(c[b+13076>>2]|0);a=0;while(1){if(a>>>0>=8){break;}if((c[b+13104+(a<<2)>>2]|0)!=0){c0(c[b+13104+(a<<2)>>2]|0);}a=a+1|0;}c0(b);return;}function cZ(){var a=0,b=0,d=0,e=0;a=0;while(1){if((a|0)>=128){break;}if((c[6704+(a<<2)>>2]|0)!=0){b=c[c[6704+(a<<2)>>2]>>2]|0;if((b|0)!=0){d=0;while(1){if((d|0)>=128){break;}if((c[b+(d*28|0)>>2]|0)!=0){c0(c[b+(d*28|0)>>2]|0);}d=d+1|0;}c0(b);}c0(c[6704+(a<<2)>>2]|0);}if((c[7216+(a<<2)>>2]|0)!=0){e=c[c[7216+(a<<2)>>2]>>2]|0;if((e|0)!=0){d=0;while(1){if((d|0)>=128){break;}if((c[e+(d*28|0)>>2]|0)!=0){c0(c[e+(d*28|0)>>2]|0);}d=d+1|0;}c0(e);}c0(c[7216+(a<<2)>>2]|0);}a=a+1|0;}bk();return;}function c_(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=b;b=c;c=d;d=0;f=0;while(1){if((d|0)<(b|0)){g=(f|0)!=0^1;}else{g=0;}if(!g){break;}if((an(e+d|0,1,1,c|0)|0)!=1){h=1752;break;}if((a[e+d|0]|0)==10){h=1755;}else{if((a[e+d|0]|0)==13){h=1755;}}if((h|0)==1755){h=0;a[e+d|0]=0;f=1;}d=d+1|0;}a[e+d|0]=0;if((d|0)!=0){i=e;return i|0;}else{i=0;return i|0;}return 0;}function c$(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ab=0,ac=0,ad=0,ae=0,af=0,ag=0,ah=0,ai=0,aj=0,ak=0,al=0,an=0,ao=0,ap=0,ar=0,as=0,at=0,au=0,av=0,aw=0,ax=0,ay=0,az=0,aA=0,aB=0,aC=0,aD=0,aE=0,aF=0,aG=0,aH=0,aI=0;do{if(a>>>0<245){if(a>>>0<11){b=16;}else{b=a+11&-8;}d=b>>>3;e=c[1996]|0;f=e>>>(d>>>0);if((f&3|0)!=0){g=(f&1^1)+d|0;h=g<<1;i=8024+(h<<2)|0;j=8024+(h+2<<2)|0;h=c[j>>2]|0;k=h+8|0;l=c[k>>2]|0;do{if((i|0)==(l|0)){c[1996]=e&~(1<>>0<(c[2e3]|0)>>>0){aq();return 0;}m=l+12|0;if((c[m>>2]|0)==(h|0)){c[m>>2]=i;c[j>>2]=l;break;}else{aq();return 0;}}}while(0);l=g<<3;c[h+4>>2]=l|3;j=h+(l|4)|0;c[j>>2]=c[j>>2]|1;n=k;return n|0;}if(b>>>0<=(c[1998]|0)>>>0){o=b;break;}if((f|0)!=0){j=2<>>12&16;i=j>>>(l>>>0);j=i>>>5&8;m=i>>>(j>>>0);i=m>>>2&4;p=m>>>(i>>>0);m=p>>>1&2;q=p>>>(m>>>0);p=q>>>1&1;r=(j|l|i|m|p)+(q>>>(p>>>0))|0;p=r<<1;q=8024+(p<<2)|0;m=8024+(p+2<<2)|0;p=c[m>>2]|0;i=p+8|0;l=c[i>>2]|0;do{if((q|0)==(l|0)){c[1996]=e&~(1<>>0<(c[2e3]|0)>>>0){aq();return 0;}j=l+12|0;if((c[j>>2]|0)==(p|0)){c[j>>2]=q;c[m>>2]=l;break;}else{aq();return 0;}}}while(0);l=r<<3;m=l-b|0;c[p+4>>2]=b|3;q=p;e=q+b|0;c[q+(b|4)>>2]=m|1;c[q+l>>2]=m;l=c[1998]|0;if((l|0)!=0){q=c[2001]|0;d=l>>>3;l=d<<1;f=8024+(l<<2)|0;k=c[1996]|0;h=1<>2]|0;if(g>>>0>=(c[2e3]|0)>>>0){s=g;t=d;break;}aq();return 0;}}while(0);c[t>>2]=q;c[s+12>>2]=q;c[q+8>>2]=s;c[q+12>>2]=f;}c[1998]=m;c[2001]=e;n=i;return n|0;}l=c[1997]|0;if((l|0)==0){o=b;break;}h=(l&-l)-1|0;l=h>>>12&16;k=h>>>(l>>>0);h=k>>>5&8;p=k>>>(h>>>0);k=p>>>2&4;r=p>>>(k>>>0);p=r>>>1&2;d=r>>>(p>>>0);r=d>>>1&1;g=c[8288+((h|l|k|p|r)+(d>>>(r>>>0))<<2)>>2]|0;r=g;d=g;p=(c[g+4>>2]&-8)-b|0;while(1){g=c[r+16>>2]|0;if((g|0)==0){k=c[r+20>>2]|0;if((k|0)==0){break;}else{u=k;}}else{u=g;}g=(c[u+4>>2]&-8)-b|0;k=g>>>0

>>0;r=u;d=k?u:d;p=k?g:p;}r=d;i=c[2e3]|0;if(r>>>0>>0){aq();return 0;}e=r+b|0;m=e;if(r>>>0>=e>>>0){aq();return 0;}e=c[d+24>>2]|0;f=c[d+12>>2]|0;do{if((f|0)==(d|0)){q=d+20|0;g=c[q>>2]|0;if((g|0)==0){k=d+16|0;l=c[k>>2]|0;if((l|0)==0){v=0;break;}else{w=l;x=k;}}else{w=g;x=q;}while(1){q=w+20|0;g=c[q>>2]|0;if((g|0)!=0){w=g;x=q;continue;}q=w+16|0;g=c[q>>2]|0;if((g|0)==0){break;}else{w=g;x=q;}}if(x>>>0>>0){aq();return 0;}else{c[x>>2]=0;v=w;break;}}else{q=c[d+8>>2]|0;if(q>>>0>>0){aq();return 0;}g=q+12|0;if((c[g>>2]|0)!=(d|0)){aq();return 0;}k=f+8|0;if((c[k>>2]|0)==(d|0)){c[g>>2]=f;c[k>>2]=q;v=f;break;}else{aq();return 0;}}}while(0);L2304:do{if((e|0)!=0){f=d+28|0;i=8288+(c[f>>2]<<2)|0;do{if((d|0)==(c[i>>2]|0)){c[i>>2]=v;if((v|0)!=0){break;}c[1997]=c[1997]&~(1<>2]);break L2304;}else{if(e>>>0<(c[2e3]|0)>>>0){aq();return 0;}q=e+16|0;if((c[q>>2]|0)==(d|0)){c[q>>2]=v;}else{c[e+20>>2]=v;}if((v|0)==0){break L2304;}}}while(0);if(v>>>0<(c[2e3]|0)>>>0){aq();return 0;}c[v+24>>2]=e;f=c[d+16>>2]|0;do{if((f|0)!=0){if(f>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[v+16>>2]=f;c[f+24>>2]=v;break;}}}while(0);f=c[d+20>>2]|0;if((f|0)==0){break;}if(f>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[v+20>>2]=f;c[f+24>>2]=v;break;}}}while(0);if(p>>>0<16){e=p+b|0;c[d+4>>2]=e|3;f=r+(e+4)|0;c[f>>2]=c[f>>2]|1;}else{c[d+4>>2]=b|3;c[r+(b|4)>>2]=p|1;c[r+(p+b)>>2]=p;f=c[1998]|0;if((f|0)!=0){e=c[2001]|0;i=f>>>3;f=i<<1;q=8024+(f<<2)|0;k=c[1996]|0;g=1<>2]|0;if(l>>>0>=(c[2e3]|0)>>>0){y=l;z=i;break;}aq();return 0;}}while(0);c[z>>2]=e;c[y+12>>2]=e;c[e+8>>2]=y;c[e+12>>2]=q;}c[1998]=p;c[2001]=m;}f=d+8|0;if((f|0)==0){o=b;break;}else{n=f;}return n|0;}else{if(a>>>0>4294967231){o=-1;break;}f=a+11|0;g=f&-8;k=c[1997]|0;if((k|0)==0){o=g;break;}r=-g|0;i=f>>>8;do{if((i|0)==0){A=0;}else{if(g>>>0>16777215){A=31;break;}f=(i+1048320|0)>>>16&8;l=i<>>16&4;j=l<>>16&2;B=14-(h|f|l)+(j<>>15)|0;A=g>>>((B+7|0)>>>0)&1|B<<1;}}while(0);i=c[8288+(A<<2)>>2]|0;L2352:do{if((i|0)==0){C=0;D=r;E=0;}else{if((A|0)==31){F=0;}else{F=25-(A>>>1)|0;}d=0;m=r;p=i;q=g<>2]&-8;l=B-g|0;if(l>>>0>>0){if((B|0)==(g|0)){C=p;D=l;E=p;break L2352;}else{G=p;H=l;}}else{G=d;H=m;}l=c[p+20>>2]|0;B=c[p+16+(q>>>31<<2)>>2]|0;j=(l|0)==0|(l|0)==(B|0)?e:l;if((B|0)==0){C=G;D=H;E=j;break;}else{d=G;m=H;p=B;q=q<<1;e=j;}}}}while(0);if((E|0)==0&(C|0)==0){i=2<>>12&16;e=i>>>(r>>>0);i=e>>>5&8;q=e>>>(i>>>0);e=q>>>2&4;p=q>>>(e>>>0);q=p>>>1&2;m=p>>>(q>>>0);p=m>>>1&1;I=c[8288+((i|r|e|q|p)+(m>>>(p>>>0))<<2)>>2]|0;}else{I=E;}if((I|0)==0){J=D;K=C;}else{p=I;m=D;q=C;while(1){e=(c[p+4>>2]&-8)-g|0;r=e>>>0>>0;i=r?e:m;e=r?p:q;r=c[p+16>>2]|0;if((r|0)!=0){p=r;m=i;q=e;continue;}r=c[p+20>>2]|0;if((r|0)==0){J=i;K=e;break;}else{p=r;m=i;q=e;}}}if((K|0)==0){o=g;break;}if(J>>>0>=((c[1998]|0)-g|0)>>>0){o=g;break;}q=K;m=c[2e3]|0;if(q>>>0>>0){aq();return 0;}p=q+g|0;k=p;if(q>>>0>=p>>>0){aq();return 0;}e=c[K+24>>2]|0;i=c[K+12>>2]|0;do{if((i|0)==(K|0)){r=K+20|0;d=c[r>>2]|0;if((d|0)==0){j=K+16|0;B=c[j>>2]|0;if((B|0)==0){L=0;break;}else{M=B;N=j;}}else{M=d;N=r;}while(1){r=M+20|0;d=c[r>>2]|0;if((d|0)!=0){M=d;N=r;continue;}r=M+16|0;d=c[r>>2]|0;if((d|0)==0){break;}else{M=d;N=r;}}if(N>>>0>>0){aq();return 0;}else{c[N>>2]=0;L=M;break;}}else{r=c[K+8>>2]|0;if(r>>>0>>0){aq();return 0;}d=r+12|0;if((c[d>>2]|0)!=(K|0)){aq();return 0;}j=i+8|0;if((c[j>>2]|0)==(K|0)){c[d>>2]=i;c[j>>2]=r;L=i;break;}else{aq();return 0;}}}while(0);L2402:do{if((e|0)!=0){i=K+28|0;m=8288+(c[i>>2]<<2)|0;do{if((K|0)==(c[m>>2]|0)){c[m>>2]=L;if((L|0)!=0){break;}c[1997]=c[1997]&~(1<>2]);break L2402;}else{if(e>>>0<(c[2e3]|0)>>>0){aq();return 0;}r=e+16|0;if((c[r>>2]|0)==(K|0)){c[r>>2]=L;}else{c[e+20>>2]=L;}if((L|0)==0){break L2402;}}}while(0);if(L>>>0<(c[2e3]|0)>>>0){aq();return 0;}c[L+24>>2]=e;i=c[K+16>>2]|0;do{if((i|0)!=0){if(i>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[L+16>>2]=i;c[i+24>>2]=L;break;}}}while(0);i=c[K+20>>2]|0;if((i|0)==0){break;}if(i>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[L+20>>2]=i;c[i+24>>2]=L;break;}}}while(0);do{if(J>>>0<16){e=J+g|0;c[K+4>>2]=e|3;i=q+(e+4)|0;c[i>>2]=c[i>>2]|1;}else{c[K+4>>2]=g|3;c[q+(g|4)>>2]=J|1;c[q+(J+g)>>2]=J;i=J>>>3;if(J>>>0<256){e=i<<1;m=8024+(e<<2)|0;r=c[1996]|0;j=1<>2]|0;if(d>>>0>=(c[2e3]|0)>>>0){O=d;P=i;break;}aq();return 0;}}while(0);c[P>>2]=k;c[O+12>>2]=k;c[q+(g+8)>>2]=O;c[q+(g+12)>>2]=m;break;}e=p;j=J>>>8;do{if((j|0)==0){Q=0;}else{if(J>>>0>16777215){Q=31;break;}r=(j+1048320|0)>>>16&8;i=j<>>16&4;B=i<>>16&2;l=14-(d|r|i)+(B<>>15)|0;Q=J>>>((l+7|0)>>>0)&1|l<<1;}}while(0);j=8288+(Q<<2)|0;c[q+(g+28)>>2]=Q;c[q+(g+20)>>2]=0;c[q+(g+16)>>2]=0;m=c[1997]|0;l=1<>2]=e;c[q+(g+24)>>2]=j;c[q+(g+12)>>2]=e;c[q+(g+8)>>2]=e;break;}if((Q|0)==31){R=0;}else{R=25-(Q>>>1)|0;}l=J<>2]|0;while(1){if((c[m+4>>2]&-8|0)==(J|0)){break;}S=m+16+(l>>>31<<2)|0;j=c[S>>2]|0;if((j|0)==0){T=1913;break;}else{l=l<<1;m=j;}}if((T|0)==1913){if(S>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[S>>2]=e;c[q+(g+24)>>2]=m;c[q+(g+12)>>2]=e;c[q+(g+8)>>2]=e;break;}}l=m+8|0;j=c[l>>2]|0;i=c[2e3]|0;if(m>>>0>>0){aq();return 0;}if(j>>>0>>0){aq();return 0;}else{c[j+12>>2]=e;c[l>>2]=e;c[q+(g+8)>>2]=j;c[q+(g+12)>>2]=m;c[q+(g+24)>>2]=0;break;}}}while(0);q=K+8|0;if((q|0)==0){o=g;break;}else{n=q;}return n|0;}}while(0);K=c[1998]|0;if(o>>>0<=K>>>0){S=K-o|0;J=c[2001]|0;if(S>>>0>15){R=J;c[2001]=R+o;c[1998]=S;c[R+(o+4)>>2]=S|1;c[R+K>>2]=S;c[J+4>>2]=o|3;}else{c[1998]=0;c[2001]=0;c[J+4>>2]=K|3;S=J+(K+4)|0;c[S>>2]=c[S>>2]|1;}n=J+8|0;return n|0;}J=c[1999]|0;if(o>>>0>>0){S=J-o|0;c[1999]=S;J=c[2002]|0;K=J;c[2002]=K+o;c[K+(o+4)>>2]=S|1;c[J+4>>2]=o|3;n=J+8|0;return n|0;}do{if((c[1666]|0)==0){J=am(30)|0;if((J-1&J|0)==0){c[1668]=J;c[1667]=J;c[1669]=-1;c[1670]=-1;c[1671]=0;c[2107]=0;c[1666]=(aJ(0)|0)&-16^1431655768;break;}else{aq();return 0;}}}while(0);J=o+48|0;S=c[1668]|0;K=o+47|0;R=S+K|0;Q=-S|0;S=R&Q;if(S>>>0<=o>>>0){n=0;return n|0;}O=c[2106]|0;do{if((O|0)!=0){P=c[2104]|0;L=P+S|0;if(L>>>0<=P>>>0|L>>>0>O>>>0){n=0;}else{break;}return n|0;}}while(0);L2494:do{if((c[2107]&4|0)==0){O=c[2002]|0;L2496:do{if((O|0)==0){T=1943;}else{L=O;P=8432;while(1){U=P|0;M=c[U>>2]|0;if(M>>>0<=L>>>0){V=P+4|0;if((M+(c[V>>2]|0)|0)>>>0>L>>>0){break;}}M=c[P+8>>2]|0;if((M|0)==0){T=1943;break L2496;}else{P=M;}}if((P|0)==0){T=1943;break;}L=R-(c[1999]|0)&Q;if(L>>>0>=2147483647){W=0;break;}m=aS(L|0)|0;e=(m|0)==((c[U>>2]|0)+(c[V>>2]|0)|0);X=e?m:-1;Y=e?L:0;Z=m;_=L;T=1952;}}while(0);do{if((T|0)==1943){O=aS(0)|0;if((O|0)==-1){W=0;break;}g=O;L=c[1667]|0;m=L-1|0;if((m&g|0)==0){$=S;}else{$=S-g+(m+g&-L)|0;}L=c[2104]|0;g=L+$|0;if(!($>>>0>o>>>0&$>>>0<2147483647)){W=0;break;}m=c[2106]|0;if((m|0)!=0){if(g>>>0<=L>>>0|g>>>0>m>>>0){W=0;break;}}m=aS($|0)|0;g=(m|0)==(O|0);X=g?O:-1;Y=g?$:0;Z=m;_=$;T=1952;}}while(0);L2516:do{if((T|0)==1952){m=-_|0;if((X|0)!=-1){aa=Y;ab=X;T=1963;break L2494;}do{if((Z|0)!=-1&_>>>0<2147483647&_>>>0>>0){g=c[1668]|0;O=K-_+g&-g;if(O>>>0>=2147483647){ac=_;break;}if((aS(O|0)|0)==-1){aS(m|0)|0;W=Y;break L2516;}else{ac=O+_|0;break;}}else{ac=_;}}while(0);if((Z|0)==-1){W=Y;}else{aa=ac;ab=Z;T=1963;break L2494;}}}while(0);c[2107]=c[2107]|4;ad=W;T=1960;}else{ad=0;T=1960;}}while(0);do{if((T|0)==1960){if(S>>>0>=2147483647){break;}W=aS(S|0)|0;Z=aS(0)|0;if(!((Z|0)!=-1&(W|0)!=-1&W>>>0>>0)){break;}ac=Z-W|0;Z=ac>>>0>(o+40|0)>>>0;Y=Z?W:-1;if((Y|0)!=-1){aa=Z?ac:ad;ab=Y;T=1963;}}}while(0);do{if((T|0)==1963){ad=(c[2104]|0)+aa|0;c[2104]=ad;if(ad>>>0>(c[2105]|0)>>>0){c[2105]=ad;}ad=c[2002]|0;L2536:do{if((ad|0)==0){S=c[2e3]|0;if((S|0)==0|ab>>>0>>0){c[2e3]=ab;}c[2108]=ab;c[2109]=aa;c[2111]=0;c[2005]=c[1666];c[2004]=-1;S=0;do{Y=S<<1;ac=8024+(Y<<2)|0;c[8024+(Y+3<<2)>>2]=ac;c[8024+(Y+2<<2)>>2]=ac;S=S+1|0;}while(S>>>0<32);S=ab+8|0;if((S&7|0)==0){ae=0;}else{ae=-S&7;}S=aa-40-ae|0;c[2002]=ab+ae;c[1999]=S;c[ab+(ae+4)>>2]=S|1;c[ab+(aa-36)>>2]=40;c[2003]=c[1670];}else{S=8432;while(1){af=c[S>>2]|0;ag=S+4|0;ah=c[ag>>2]|0;if((ab|0)==(af+ah|0)){T=1975;break;}ac=c[S+8>>2]|0;if((ac|0)==0){break;}else{S=ac;}}do{if((T|0)==1975){if((c[S+12>>2]&8|0)!=0){break;}ac=ad;if(!(ac>>>0>=af>>>0&ac>>>0>>0)){break;}c[ag>>2]=ah+aa;ac=c[2002]|0;Y=(c[1999]|0)+aa|0;Z=ac;W=ac+8|0;if((W&7|0)==0){ai=0;}else{ai=-W&7;}W=Y-ai|0;c[2002]=Z+ai;c[1999]=W;c[Z+(ai+4)>>2]=W|1;c[Z+(Y+4)>>2]=40;c[2003]=c[1670];break L2536;}}while(0);if(ab>>>0<(c[2e3]|0)>>>0){c[2e3]=ab;}S=ab+aa|0;Y=8432;while(1){aj=Y|0;if((c[aj>>2]|0)==(S|0)){T=1985;break;}Z=c[Y+8>>2]|0;if((Z|0)==0){break;}else{Y=Z;}}do{if((T|0)==1985){if((c[Y+12>>2]&8|0)!=0){break;}c[aj>>2]=ab;S=Y+4|0;c[S>>2]=(c[S>>2]|0)+aa;S=ab+8|0;if((S&7|0)==0){ak=0;}else{ak=-S&7;}S=ab+(aa+8)|0;if((S&7|0)==0){al=0;}else{al=-S&7;}S=ab+(al+aa)|0;Z=S;W=ak+o|0;ac=ab+W|0;_=ac;K=S-(ab+ak)-o|0;c[ab+(ak+4)>>2]=o|3;do{if((Z|0)==(c[2002]|0)){J=(c[1999]|0)+K|0;c[1999]=J;c[2002]=_;c[ab+(W+4)>>2]=J|1;}else{if((Z|0)==(c[2001]|0)){J=(c[1998]|0)+K|0;c[1998]=J;c[2001]=_;c[ab+(W+4)>>2]=J|1;c[ab+(J+W)>>2]=J;break;}J=aa+4|0;X=c[ab+(J+al)>>2]|0;if((X&3|0)==1){$=X&-8;V=X>>>3;L2571:do{if(X>>>0<256){U=c[ab+((al|8)+aa)>>2]|0;Q=c[ab+(aa+12+al)>>2]|0;R=8024+(V<<1<<2)|0;do{if((U|0)!=(R|0)){if(U>>>0<(c[2e3]|0)>>>0){aq();return 0;}if((c[U+12>>2]|0)==(Z|0)){break;}aq();return 0;}}while(0);if((Q|0)==(U|0)){c[1996]=c[1996]&~(1<>>0<(c[2e3]|0)>>>0){aq();return 0;}m=Q+8|0;if((c[m>>2]|0)==(Z|0)){an=m;break;}aq();return 0;}}while(0);c[U+12>>2]=Q;c[an>>2]=U;}else{R=S;m=c[ab+((al|24)+aa)>>2]|0;P=c[ab+(aa+12+al)>>2]|0;do{if((P|0)==(R|0)){O=al|16;g=ab+(J+O)|0;L=c[g>>2]|0;if((L|0)==0){e=ab+(O+aa)|0;O=c[e>>2]|0;if((O|0)==0){ao=0;break;}else{ap=O;ar=e;}}else{ap=L;ar=g;}while(1){g=ap+20|0;L=c[g>>2]|0;if((L|0)!=0){ap=L;ar=g;continue;}g=ap+16|0;L=c[g>>2]|0;if((L|0)==0){break;}else{ap=L;ar=g;}}if(ar>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[ar>>2]=0;ao=ap;break;}}else{g=c[ab+((al|8)+aa)>>2]|0;if(g>>>0<(c[2e3]|0)>>>0){aq();return 0;}L=g+12|0;if((c[L>>2]|0)!=(R|0)){aq();return 0;}e=P+8|0;if((c[e>>2]|0)==(R|0)){c[L>>2]=P;c[e>>2]=g;ao=P;break;}else{aq();return 0;}}}while(0);if((m|0)==0){break;}P=ab+(aa+28+al)|0;U=8288+(c[P>>2]<<2)|0;do{if((R|0)==(c[U>>2]|0)){c[U>>2]=ao;if((ao|0)!=0){break;}c[1997]=c[1997]&~(1<>2]);break L2571;}else{if(m>>>0<(c[2e3]|0)>>>0){aq();return 0;}Q=m+16|0;if((c[Q>>2]|0)==(R|0)){c[Q>>2]=ao;}else{c[m+20>>2]=ao;}if((ao|0)==0){break L2571;}}}while(0);if(ao>>>0<(c[2e3]|0)>>>0){aq();return 0;}c[ao+24>>2]=m;R=al|16;P=c[ab+(R+aa)>>2]|0;do{if((P|0)!=0){if(P>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[ao+16>>2]=P;c[P+24>>2]=ao;break;}}}while(0);P=c[ab+(J+R)>>2]|0;if((P|0)==0){break;}if(P>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[ao+20>>2]=P;c[P+24>>2]=ao;break;}}}while(0);as=ab+(($|al)+aa)|0;at=$+K|0;}else{as=Z;at=K;}J=as+4|0;c[J>>2]=c[J>>2]&-2;c[ab+(W+4)>>2]=at|1;c[ab+(at+W)>>2]=at;J=at>>>3;if(at>>>0<256){V=J<<1;X=8024+(V<<2)|0;P=c[1996]|0;m=1<>2]|0;if(U>>>0>=(c[2e3]|0)>>>0){au=U;av=J;break;}aq();return 0;}}while(0);c[av>>2]=_;c[au+12>>2]=_;c[ab+(W+8)>>2]=au;c[ab+(W+12)>>2]=X;break;}V=ac;m=at>>>8;do{if((m|0)==0){aw=0;}else{if(at>>>0>16777215){aw=31;break;}P=(m+1048320|0)>>>16&8;$=m<>>16&4;U=$<>>16&2;Q=14-(J|P|$)+(U<<$>>>15)|0;aw=at>>>((Q+7|0)>>>0)&1|Q<<1;}}while(0);m=8288+(aw<<2)|0;c[ab+(W+28)>>2]=aw;c[ab+(W+20)>>2]=0;c[ab+(W+16)>>2]=0;X=c[1997]|0;Q=1<>2]=V;c[ab+(W+24)>>2]=m;c[ab+(W+12)>>2]=V;c[ab+(W+8)>>2]=V;break;}if((aw|0)==31){ax=0;}else{ax=25-(aw>>>1)|0;}Q=at<>2]|0;while(1){if((c[X+4>>2]&-8|0)==(at|0)){break;}ay=X+16+(Q>>>31<<2)|0;m=c[ay>>2]|0;if((m|0)==0){T=2058;break;}else{Q=Q<<1;X=m;}}if((T|0)==2058){if(ay>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[ay>>2]=V;c[ab+(W+24)>>2]=X;c[ab+(W+12)>>2]=V;c[ab+(W+8)>>2]=V;break;}}Q=X+8|0;m=c[Q>>2]|0;$=c[2e3]|0;if(X>>>0<$>>>0){aq();return 0;}if(m>>>0<$>>>0){aq();return 0;}else{c[m+12>>2]=V;c[Q>>2]=V;c[ab+(W+8)>>2]=m;c[ab+(W+12)>>2]=X;c[ab+(W+24)>>2]=0;break;}}}while(0);n=ab+(ak|8)|0;return n|0;}}while(0);Y=ad;W=8432;while(1){az=c[W>>2]|0;if(az>>>0<=Y>>>0){aA=c[W+4>>2]|0;aB=az+aA|0;if(aB>>>0>Y>>>0){break;}}W=c[W+8>>2]|0;}W=az+(aA-39)|0;if((W&7|0)==0){aC=0;}else{aC=-W&7;}W=az+(aA-47+aC)|0;ac=W>>>0<(ad+16|0)>>>0?Y:W;W=ac+8|0;_=ab+8|0;if((_&7|0)==0){aD=0;}else{aD=-_&7;}_=aa-40-aD|0;c[2002]=ab+aD;c[1999]=_;c[ab+(aD+4)>>2]=_|1;c[ab+(aa-36)>>2]=40;c[2003]=c[1670];c[ac+4>>2]=27;c[W>>2]=c[2108];c[W+4>>2]=c[2109];c[W+8>>2]=c[2110];c[W+12>>2]=c[2111];c[2108]=ab;c[2109]=aa;c[2111]=0;c[2110]=W;W=ac+28|0;c[W>>2]=7;if((ac+32|0)>>>0>>0){_=W;while(1){W=_+4|0;c[W>>2]=7;if((_+8|0)>>>0>>0){_=W;}else{break;}}}if((ac|0)==(Y|0)){break;}_=ac-ad|0;W=Y+(_+4)|0;c[W>>2]=c[W>>2]&-2;c[ad+4>>2]=_|1;c[Y+_>>2]=_;W=_>>>3;if(_>>>0<256){K=W<<1;Z=8024+(K<<2)|0;S=c[1996]|0;m=1<>2]|0;if(Q>>>0>=(c[2e3]|0)>>>0){aE=Q;aF=W;break;}aq();return 0;}}while(0);c[aF>>2]=ad;c[aE+12>>2]=ad;c[ad+8>>2]=aE;c[ad+12>>2]=Z;break;}K=ad;m=_>>>8;do{if((m|0)==0){aG=0;}else{if(_>>>0>16777215){aG=31;break;}S=(m+1048320|0)>>>16&8;Y=m<>>16&4;W=Y<>>16&2;Q=14-(ac|S|Y)+(W<>>15)|0;aG=_>>>((Q+7|0)>>>0)&1|Q<<1;}}while(0);m=8288+(aG<<2)|0;c[ad+28>>2]=aG;c[ad+20>>2]=0;c[ad+16>>2]=0;Z=c[1997]|0;Q=1<>2]=K;c[ad+24>>2]=m;c[ad+12>>2]=ad;c[ad+8>>2]=ad;break;}if((aG|0)==31){aH=0;}else{aH=25-(aG>>>1)|0;}Q=_<>2]|0;while(1){if((c[Z+4>>2]&-8|0)==(_|0)){break;}aI=Z+16+(Q>>>31<<2)|0;m=c[aI>>2]|0;if((m|0)==0){T=2093;break;}else{Q=Q<<1;Z=m;}}if((T|0)==2093){if(aI>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[aI>>2]=K;c[ad+24>>2]=Z;c[ad+12>>2]=ad;c[ad+8>>2]=ad;break;}}Q=Z+8|0;_=c[Q>>2]|0;m=c[2e3]|0;if(Z>>>0>>0){aq();return 0;}if(_>>>0>>0){aq();return 0;}else{c[_+12>>2]=K;c[Q>>2]=K;c[ad+8>>2]=_;c[ad+12>>2]=Z;c[ad+24>>2]=0;break;}}}while(0);ad=c[1999]|0;if(ad>>>0<=o>>>0){break;}_=ad-o|0;c[1999]=_;ad=c[2002]|0;Q=ad;c[2002]=Q+o;c[Q+(o+4)>>2]=_|1;c[ad+4>>2]=o|3;n=ad+8|0;return n|0;}}while(0);c[(aQ()|0)>>2]=12;n=0;return n|0;}function c0(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;if((a|0)==0){return;}b=a-8|0;d=b;e=c[2e3]|0;if(b>>>0>>0){aq();}f=c[a-4>>2]|0;g=f&3;if((g|0)==1){aq();}h=f&-8;i=a+(h-8)|0;j=i;L2753:do{if((f&1|0)==0){k=c[b>>2]|0;if((g|0)==0){return;}l=-8-k|0;m=a+l|0;n=m;o=k+h|0;if(m>>>0>>0){aq();}if((n|0)==(c[2001]|0)){p=a+(h-4)|0;if((c[p>>2]&3|0)!=3){q=n;r=o;break;}c[1998]=o;c[p>>2]=c[p>>2]&-2;c[a+(l+4)>>2]=o|1;c[i>>2]=o;return;}p=k>>>3;if(k>>>0<256){k=c[a+(l+8)>>2]|0;s=c[a+(l+12)>>2]|0;t=8024+(p<<1<<2)|0;do{if((k|0)!=(t|0)){if(k>>>0>>0){aq();}if((c[k+12>>2]|0)==(n|0)){break;}aq();}}while(0);if((s|0)==(k|0)){c[1996]=c[1996]&~(1<>>0>>0){aq();}v=s+8|0;if((c[v>>2]|0)==(n|0)){u=v;break;}aq();}}while(0);c[k+12>>2]=s;c[u>>2]=k;q=n;r=o;break;}t=m;p=c[a+(l+24)>>2]|0;v=c[a+(l+12)>>2]|0;do{if((v|0)==(t|0)){w=a+(l+20)|0;x=c[w>>2]|0;if((x|0)==0){y=a+(l+16)|0;z=c[y>>2]|0;if((z|0)==0){A=0;break;}else{B=z;C=y;}}else{B=x;C=w;}while(1){w=B+20|0;x=c[w>>2]|0;if((x|0)!=0){B=x;C=w;continue;}w=B+16|0;x=c[w>>2]|0;if((x|0)==0){break;}else{B=x;C=w;}}if(C>>>0>>0){aq();}else{c[C>>2]=0;A=B;break;}}else{w=c[a+(l+8)>>2]|0;if(w>>>0>>0){aq();}x=w+12|0;if((c[x>>2]|0)!=(t|0)){aq();}y=v+8|0;if((c[y>>2]|0)==(t|0)){c[x>>2]=v;c[y>>2]=w;A=v;break;}else{aq();}}}while(0);if((p|0)==0){q=n;r=o;break;}v=a+(l+28)|0;m=8288+(c[v>>2]<<2)|0;do{if((t|0)==(c[m>>2]|0)){c[m>>2]=A;if((A|0)!=0){break;}c[1997]=c[1997]&~(1<>2]);q=n;r=o;break L2753;}else{if(p>>>0<(c[2e3]|0)>>>0){aq();}k=p+16|0;if((c[k>>2]|0)==(t|0)){c[k>>2]=A;}else{c[p+20>>2]=A;}if((A|0)==0){q=n;r=o;break L2753;}}}while(0);if(A>>>0<(c[2e3]|0)>>>0){aq();}c[A+24>>2]=p;t=c[a+(l+16)>>2]|0;do{if((t|0)!=0){if(t>>>0<(c[2e3]|0)>>>0){aq();}else{c[A+16>>2]=t;c[t+24>>2]=A;break;}}}while(0);t=c[a+(l+20)>>2]|0;if((t|0)==0){q=n;r=o;break;}if(t>>>0<(c[2e3]|0)>>>0){aq();}else{c[A+20>>2]=t;c[t+24>>2]=A;q=n;r=o;break;}}else{q=d;r=h;}}while(0);d=q;if(d>>>0>=i>>>0){aq();}A=a+(h-4)|0;e=c[A>>2]|0;if((e&1|0)==0){aq();}do{if((e&2|0)==0){if((j|0)==(c[2002]|0)){B=(c[1999]|0)+r|0;c[1999]=B;c[2002]=q;c[q+4>>2]=B|1;if((q|0)!=(c[2001]|0)){return;}c[2001]=0;c[1998]=0;return;}if((j|0)==(c[2001]|0)){B=(c[1998]|0)+r|0;c[1998]=B;c[2001]=q;c[q+4>>2]=B|1;c[d+B>>2]=B;return;}B=(e&-8)+r|0;C=e>>>3;L2856:do{if(e>>>0<256){u=c[a+h>>2]|0;g=c[a+(h|4)>>2]|0;b=8024+(C<<1<<2)|0;do{if((u|0)!=(b|0)){if(u>>>0<(c[2e3]|0)>>>0){aq();}if((c[u+12>>2]|0)==(j|0)){break;}aq();}}while(0);if((g|0)==(u|0)){c[1996]=c[1996]&~(1<>>0<(c[2e3]|0)>>>0){aq();}f=g+8|0;if((c[f>>2]|0)==(j|0)){D=f;break;}aq();}}while(0);c[u+12>>2]=g;c[D>>2]=u;}else{b=i;f=c[a+(h+16)>>2]|0;t=c[a+(h|4)>>2]|0;do{if((t|0)==(b|0)){p=a+(h+12)|0;v=c[p>>2]|0;if((v|0)==0){m=a+(h+8)|0;k=c[m>>2]|0;if((k|0)==0){E=0;break;}else{F=k;G=m;}}else{F=v;G=p;}while(1){p=F+20|0;v=c[p>>2]|0;if((v|0)!=0){F=v;G=p;continue;}p=F+16|0;v=c[p>>2]|0;if((v|0)==0){break;}else{F=v;G=p;}}if(G>>>0<(c[2e3]|0)>>>0){aq();}else{c[G>>2]=0;E=F;break;}}else{p=c[a+h>>2]|0;if(p>>>0<(c[2e3]|0)>>>0){aq();}v=p+12|0;if((c[v>>2]|0)!=(b|0)){aq();}m=t+8|0;if((c[m>>2]|0)==(b|0)){c[v>>2]=t;c[m>>2]=p;E=t;break;}else{aq();}}}while(0);if((f|0)==0){break;}t=a+(h+20)|0;u=8288+(c[t>>2]<<2)|0;do{if((b|0)==(c[u>>2]|0)){c[u>>2]=E;if((E|0)!=0){break;}c[1997]=c[1997]&~(1<>2]);break L2856;}else{if(f>>>0<(c[2e3]|0)>>>0){aq();}g=f+16|0;if((c[g>>2]|0)==(b|0)){c[g>>2]=E;}else{c[f+20>>2]=E;}if((E|0)==0){break L2856;}}}while(0);if(E>>>0<(c[2e3]|0)>>>0){aq();}c[E+24>>2]=f;b=c[a+(h+8)>>2]|0;do{if((b|0)!=0){if(b>>>0<(c[2e3]|0)>>>0){aq();}else{c[E+16>>2]=b;c[b+24>>2]=E;break;}}}while(0);b=c[a+(h+12)>>2]|0;if((b|0)==0){break;}if(b>>>0<(c[2e3]|0)>>>0){aq();}else{c[E+20>>2]=b;c[b+24>>2]=E;break;}}}while(0);c[q+4>>2]=B|1;c[d+B>>2]=B;if((q|0)!=(c[2001]|0)){H=B;break;}c[1998]=B;return;}else{c[A>>2]=e&-2;c[q+4>>2]=r|1;c[d+r>>2]=r;H=r;}}while(0);r=H>>>3;if(H>>>0<256){d=r<<1;e=8024+(d<<2)|0;A=c[1996]|0;E=1<>2]|0;if(h>>>0>=(c[2e3]|0)>>>0){I=h;J=r;break;}aq();}}while(0);c[J>>2]=q;c[I+12>>2]=q;c[q+8>>2]=I;c[q+12>>2]=e;return;}e=q;I=H>>>8;do{if((I|0)==0){K=0;}else{if(H>>>0>16777215){K=31;break;}J=(I+1048320|0)>>>16&8;d=I<>>16&4;A=d<>>16&2;r=14-(E|J|d)+(A<>>15)|0;K=H>>>((r+7|0)>>>0)&1|r<<1;}}while(0);I=8288+(K<<2)|0;c[q+28>>2]=K;c[q+20>>2]=0;c[q+16>>2]=0;r=c[1997]|0;d=1<>2]=e;c[q+24>>2]=I;c[q+12>>2]=q;c[q+8>>2]=q;}else{if((K|0)==31){L=0;}else{L=25-(K>>>1)|0;}A=H<>2]|0;while(1){if((c[J+4>>2]&-8|0)==(H|0)){break;}M=J+16+(A>>>31<<2)|0;E=c[M>>2]|0;if((E|0)==0){N=2270;break;}else{A=A<<1;J=E;}}if((N|0)==2270){if(M>>>0<(c[2e3]|0)>>>0){aq();}else{c[M>>2]=e;c[q+24>>2]=J;c[q+12>>2]=q;c[q+8>>2]=q;break;}}A=J+8|0;B=c[A>>2]|0;E=c[2e3]|0;if(J>>>0>>0){aq();}if(B>>>0>>0){aq();}else{c[B+12>>2]=e;c[A>>2]=e;c[q+8>>2]=B;c[q+12>>2]=J;c[q+24>>2]=0;break;}}}while(0);q=(c[2004]|0)-1|0;c[2004]=q;if((q|0)==0){O=8440;}else{return;}while(1){q=c[O>>2]|0;if((q|0)==0){break;}else{O=q+8|0;}}c[2004]=-1;return;}function c1(b){b=b|0;var c=0;c=b;while(a[c]|0){c=c+1|0;}return c-b|0;}function c2(b,c){b=b|0;c=c|0;var d=0;do{a[b+d|0]=a[c+d|0];d=d+1|0;}while(a[c+(d-1)|0]|0);return b|0;}function c3(b,c){b=b|0;c=c|0;var d=0,e=0;d=b+(c1(b)|0)|0;do{a[d+e|0]=a[c+e|0];e=e+1|0;}while(a[c+(e-1)|0]|0);return b|0;}function c4(a,b,c){a=a|0;b=b|0;c=c|0;var e=0,f=0,g=0;while((e|0)<(c|0)){f=d[a+e|0]|0;g=d[b+e|0]|0;if((f|0)!=(g|0))return((f|0)>(g|0)?1:-1)|0;e=e+1|0;}return 0;}function c5(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;f=b+e|0;if((e|0)>=20){d=d&255;e=b&3;g=d|d<<8|d<<16|d<<24;h=f&~3;if(e){e=b+4-e|0;while((b|0)<(e|0)){a[b]=d;b=b+1|0;}}while((b|0)<(h|0)){c[b>>2]=g;b=b+4|0;}}while((b|0)<(f|0)){a[b]=d;b=b+1|0;}}function c6(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;f=b|0;if((b&3)==(d&3)){while(b&3){if((e|0)==0)return f|0;a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0;}while((e|0)>=4){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;e=e-4|0;}}while((e|0)>0){a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0;}return f|0;}function c7(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0;while((e|0)<(d|0)){a[b+e|0]=f?0:a[c+e|0]|0;f=f?1:(a[c+e|0]|0)==0;e=e+1|0;}return b|0;}function c8(a,b){a=a|0;b=b|0;return aW[a&7](b|0)|0;}function c9(a,b){a=a|0;b=b|0;aX[a&1](b|0);}function da(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return aY[a&7](b|0,c|0,d|0,e|0)|0;}function db(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;aZ[a&15](b|0,c|0,d|0);}function dc(a){a=a|0;a_[a&1]();}function dd(a,b,c){a=a|0;b=b|0;c=c|0;return a$[a&1](b|0,c|0)|0;}function de(a){a=a|0;$(0);return 0;}function df(a){a=a|0;$(1);}function dg(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;$(2);return 0;}function dh(a,b,c){a=a|0;b=b|0;c=c|0;$(3);}function di(){$(4);}function dj(a,b){a=a|0;b=b|0;$(5);return 0;}// EMSCRIPTEN_END_FUNCS\nvar aW=[de,de,cL,de,cJ,de,de,de];var aX=[df,df];var aY=[dg,dg,cI,dg,cK,dg,dg,dg];var aZ=[dh,dh,bZ,dh,b$,dh,b_,dh,bY,dh,bX,dh,dh,dh,dh,dh];var a_=[di,di];var a$=[dj,dj];return{_strlen:c1,_strcat:c3,_mid_create_options:cV,_mid_istream_open_mem:cO,_mid_istream_open_file:cN,_mid_song_read_wave:b6,_mid_exit:cZ,_mid_song_note_on:b0,_strncpy:c7,_memset:c5,_memcpy:c6,_mid_song_get_missing_instrument:bu,_mid_istream_close:cR,_mid_song_free:cY,_mid_init:cT,_mid_song_load:cX,_mid_song_start:b3,_mid_song_get_num_missing_instruments:bt,_memcmp:c4,_free:c0,_malloc:c$,_strcpy:c2,runPostSets:bg,stackAlloc:a0,stackSave:a1,stackRestore:a2,setThrew:a3,setTempRet0:a6,setTempRet1:a7,setTempRet2:a8,setTempRet3:a9,setTempRet4:ba,setTempRet5:bb,setTempRet6:bc,setTempRet7:bd,setTempRet8:be,setTempRet9:bf,dynCall_ii:c8,dynCall_vi:c9,dynCall_iiiii:da,dynCall_viii:db,dynCall_v:dc,dynCall_iii:dd};}(// EMSCRIPTEN_END_ASM\n{Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array},{abort:abort,assert:assert,asmPrintInt:asmPrintInt,asmPrintFloat:asmPrintFloat,min:Math_min,invoke_ii:invoke_ii,invoke_vi:invoke_vi,invoke_iiiii:invoke_iiiii,invoke_viii:invoke_viii,invoke_v:invoke_v,invoke_iii:invoke_iii,_strncmp:_strncmp,_lseek:_lseek,_sysconf:_sysconf,_fread:_fread,_fclose:_fclose,_strtok_r:_strtok_r,_abort:_abort,_fprintf:_fprintf,_close:_close,_pread:_pread,_fflush:_fflush,_fopen:_fopen,_open:_open,_strtol:_strtol,_strtok:_strtok,___setErrNo:___setErrNo,__reallyNegative:__reallyNegative,_fseek:_fseek,_send:_send,_write:_write,_strrchr:_strrchr,_sin:_sin,_printf:_printf,_strchr:_strchr,_read:_read,_time:_time,__formatString:__formatString,_atoi:_atoi,_recv:_recv,_pwrite:_pwrite,_llvm_pow_f64:_llvm_pow_f64,_fsync:_fsync,___errno_location:___errno_location,_isspace:_isspace,_sbrk:_sbrk,__parseInt:__parseInt,_fwrite:_fwrite,_strcmp:_strcmp,STACKTOP:STACKTOP,STACK_MAX:STACK_MAX,tempDoublePtr:tempDoublePtr,ABORT:ABORT,NaN:NaN,Infinity:Infinity,_stderr:_stderr},buffer);var _strlen=Module['_strlen']=asm['_strlen'];var _strcat=Module['_strcat']=asm['_strcat'];var _mid_create_options=Module['_mid_create_options']=asm['_mid_create_options'];var _mid_istream_open_mem=Module['_mid_istream_open_mem']=asm['_mid_istream_open_mem'];var _mid_istream_open_file=Module['_mid_istream_open_file']=asm['_mid_istream_open_file'];var _mid_song_read_wave=Module['_mid_song_read_wave']=asm['_mid_song_read_wave'];var _mid_exit=Module['_mid_exit']=asm['_mid_exit'];var _mid_song_note_on=Module['_mid_song_note_on']=asm['_mid_song_note_on'];var _strncpy=Module['_strncpy']=asm['_strncpy'];var _memset=Module['_memset']=asm['_memset'];var _memcpy=Module['_memcpy']=asm['_memcpy'];var _mid_song_get_missing_instrument=Module['_mid_song_get_missing_instrument']=asm['_mid_song_get_missing_instrument'];var _mid_istream_close=Module['_mid_istream_close']=asm['_mid_istream_close'];var _mid_song_free=Module['_mid_song_free']=asm['_mid_song_free'];var _mid_init=Module['_mid_init']=asm['_mid_init'];var _mid_song_load=Module['_mid_song_load']=asm['_mid_song_load'];var _mid_song_start=Module['_mid_song_start']=asm['_mid_song_start'];var _mid_song_get_num_missing_instruments=Module['_mid_song_get_num_missing_instruments']=asm['_mid_song_get_num_missing_instruments'];var _memcmp=Module['_memcmp']=asm['_memcmp'];var _free=Module['_free']=asm['_free'];var _malloc=Module._malloc=asm['_malloc'];var _strcpy=Module['_strcpy']=asm['_strcpy'];var runPostSets=Module['runPostSets']=asm['runPostSets'];var dynCall_ii=Module['dynCall_ii']=asm['dynCall_ii'];var dynCall_vi=Module['dynCall_vi']=asm['dynCall_vi'];var dynCall_iiiii=Module['dynCall_iiiii']=asm['dynCall_iiiii'];var dynCall_viii=Module['dynCall_viii']=asm['dynCall_viii'];var dynCall_v=Module['dynCall_v']=asm['dynCall_v'];var dynCall_iii=Module['dynCall_iii']=asm['dynCall_iii'];Runtime.stackAlloc=function(size){return asm['stackAlloc'](size);};Runtime.stackSave=function(){return asm['stackSave']();};Runtime.stackRestore=function(top){asm['stackRestore'](top);};// Warning: printing of i64 values may be slightly rounded! No deep i64 math used, so precise i64 code not included\nvar i64Math=null;// === Auto-generated postamble setup entry stuff ===\nif(memoryInitializer){var applyData=function applyData(data){HEAPU8.set(data,STATIC_BASE);};addRunDependency('memory initializer');Browser.asyncLoad(memoryInitializer,function(data){applyData(data);removeRunDependency('memory initializer');},function(data){throw'could not load memory initializer '+memoryInitializer;});}var initialStackTop;var preloadStartTime=null;var calledRun=false;dependenciesFulfilled=function runCaller(){// If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)\nif(!calledRun&&shouldRunNow)run();if(!calledRun)dependenciesFulfilled=runCaller;// try this again later, after new deps are fulfilled\n};Module['callMain']=Module.callMain=function callMain(args){assert(runDependencies==0,'cannot call main when async dependencies remain! (listen on __ATMAIN__)');assert(__ATPRERUN__.length==0,'cannot call main when preRun functions remain to be called');args=args||[];if(preloadStartTime!==null){console.warn('preload time: '+(Date.now()-preloadStartTime)+' ms');}ensureInitRuntime();var argc=args.length+1;function pad(){for(var i=0;i<4-1;i++){argv.push(0);}}var argv=[allocate(intArrayFromString('/bin/this.program'),'i8',ALLOC_NORMAL)];pad();for(var i=0;i0){console.warn('run() called, but dependencies remain, so not running');return FS;}preRun();if(runDependencies>0){// a preRun added a dependency, run will be called later\nreturn FS;}function doRun(){ensureInitRuntime();preMain();calledRun=true;if(Module['_main']&&shouldRunNow){Module['callMain'](args);}postRun();}if(Module['setStatus']){Module['setStatus']('Running...');setTimeout(function(){setTimeout(function(){Module['setStatus']('');},1);if(!ABORT)doRun();},1);}else{doRun();}return FS;}Module.run=run;/**\n * Initializes the library.\n * @function init\n * @memberof LibTiMidity\n * @param {boolean} [throwError = true] Throw an error if file/folder creation failed.\n * @instance\n */Module.init=function(){var throwError=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;// creates folders for instrument patches\nModule.createPath('/',_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_PATCH_DIRECTORY */ \"e\"],throwError);Module.createPath(\"/\".concat(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_PATCH_DIRECTORY */ \"e\"]),_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_PATCH_DRUM_DIRECTORY */ \"f\"],throwError);// creates config file\nModule.createDataFile('/',_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_CONFIG_FILE */ \"b\"],_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_CONFIG_DATA */ \"a\"],true,true,undefined,throwError);};// shouldRunNow refers to calling main(), not run().\nvar shouldRunNow=true;if(Module['noInitialRun']){shouldRunNow=false;}Module.FS=run();this.Module=Module;};var libtimidity=new LibTiMidity();/* harmony default export */ __webpack_exports__[\"a\"] = (libtimidity.Module);\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(12).Buffer))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL3NyYy9MaWJUaU1pZGl0eS5qcz9jYjIwIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7XG4gICAgTElCVElNSURJVFlfUEFUQ0hfRElSRUNUT1JZLFxuICAgIExJQlRJTUlESVRZX1BBVENIX0RSVU1fRElSRUNUT1JZLFxuICAgIExJQlRJTUlESVRZX0NPTkZJR19G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R5cGUgaW4gRkxPQVRfVFlQRVM7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaXNQb2ludGVyVHlwZTogZnVuY3Rpb24gaXNQb2ludGVyVHlwZSh0eXBlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHR5cGVbdHlwZS5sZW5ndGggLSAxXSA9PSAnKic7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaXNTdHJ1Y3RUeXBlOiBmdW5jdGlvbiBpc1N0cnVjdFR5cGUodHlwZSkge1xuICAgICAgICAgICAgICAgIGlmIChpc1BvaW50ZXJUeXBlKHR5cGUpKSByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgaWYgKGlzQXJyYXlUeXBlKHR5cGUpKSByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICBpZiAoLzw/eyA/W159XSogP30+Py8udGVzdCh0eXBlKSkgcmV0dXJuIHRydWU7IC8vIHsgaTMyLCBpOCB9IGV0Yy4gLSBhbm9ueW1vdXMgc3RydWN0IHR5cGVzXG4gICAgICAgICAgICAgICAgLy8gU2VlIGNvbW1lbnQgaW4gaXNTdHJ1Y3RQb2ludGVyVHlwZSgpXG4gICAgICAgICAgICAgICAgcmV0dXJuIHR5cGVbMF0gPT0gJyUnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdldE5hdGl2ZVR5cGVTaXplOiBmdW5jdGlvbih0eXBlKSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh0eXBlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2kxJzpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnaTgnOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDE7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2kxNic6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMjtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnaTMyJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiA0O1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdpNjQnOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDg7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2Zsb2F0JzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiA0O1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdkb3VibGUnOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDg7XG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlW3R5cGUubGVuZ3RoIC0gMV0gPT09ICcqJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBSdW50aW1lLlFVQU5UVU1fU0laRTsgLy8gQSBwb2ludGVyXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVbMF0gPT09ICdpJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBiaXRzID0gcGFyc2VJbnQodHlwZS5zdWJzdHIoMSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFzc2VydChiaXRzICUgOCA9PT0gMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJpdHMgLyA4O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdldE5hdGl2ZUZpZWxkU2l6ZTogZnVuY3Rpb24odHlwZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBNYXRoLm1heChcbiAgICAgICAgICAgICAgICAgICAgUnVudGltZS5nZXROYXRpdmVUeXBlU2l6ZSh0eXBlKSxcbiAgICAgICAgICAgICAgICAgICAgUnVudGltZS5RVUFOVFVNX1NJWkVcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGRlZHVwOiBmdW5jdGlvbiBkZWR1cChpdGVtcywgaWRlbnQpIHtcbiAgICAgICAgICAgICAgICB2YXIgc2VlbiA9IHt9O1xuICAgICAgICAgICAgICAgIGlmIChpZGVudCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXRlbXMuZmlsdGVyKGZ1bmN0aW9uKGl0ZW0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZWVuW2l0ZW1baWRlbnRdXSkgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VlbltpdGVtW2lkZW50XV0gPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpdGVtcy5maWx0ZXIoZnVuY3Rpb24oaXRlbSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlZW5baXRlbV0pIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlZW5baXRlbV0gPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzZXQ6IGZ1bmN0aW9uIHNldCgpIHtcbiAgICAgICAgICAgICAgICB2YXIgYXJncyA9XG4gICAgICAgICAgICAgICAgICAgIHR5cGVvZiBhcmd1bWVudHNbMF0gPT09ICdvYmplY3QnID8gYXJndW1lbnRzWzBdIDogYXJndW1lbnRzO1xuICAgICAgICAgICAgICAgIHZhciByZXQgPSB7fTtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGFyZ3MubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0W2FyZ3NbaV1dID0gMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBnZXRBbGlnblNpemU6IGZ1bmN0aW9uKHR5cGUsIHNpemUsIHZhcmFyZykge1xuICAgICAgICAgICAgICAgIC8vIHdlIGFsaWduIGk2NHMgYW5kIGRvdWJsZXMgb24gNjQtYml0IGJvdW5kYXJpZXMsIHVubGlrZSB4ODZcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PSAnaTY0JyB8fCB0eXBlID09ICdkb3VibGUnIHx8IHZhcmFyZykgcmV0dXJuIDg7XG4gICAgICAgICAgICAgICAgaWYgKCF0eXBlKSByZXR1cm4gTWF0aC5taW4oc2l6ZSwgOCk7IC8vIGFsaWduIHN0cnVjdHVyZXMgaW50ZXJuYWxseSB0byA2NCBiaXRzXG4gICAgICAgICAgICAgICAgcmV0dXJuIE1hdGgubWluKFxuICAgICAgICAgICAgICAgICAgICBzaXplIHx8ICh0eXBlID8gUnVudGltZS5nZXROYXRpdmVGaWVsZFNpemUodHlwZSkgOiAwKSxcbiAgICAgICAgICAgICAgICAgICAgUnVudGltZS5RVUFOVFVNX1NJWkVcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNhbGN1bGF0ZVN0cnVjdEFsaWdubWVudDogZnVuY3Rpb24gY2FsY3VsYXRlU3RydWN0QWxpZ25tZW50KHR5cGUpIHtcbiAgICAgICAgICAgICAgICB0eXBlLmZsYXRTaXplID0gMDtcbiAgICAgICAgICAgICAgICB0eXBlLmFsaWduU2l6ZSA9IDA7XG4gICAgICAgICAgICAgICAgdmFyIGRpZmZzID0gW107XG4gICAgICAgICAgICAgICAgdmFyIHByZXYgPSAtMTtcbiAgICAgICAgICAgICAgICB0eXBlLmZsYXRJbmRleGVzID0gdHlwZS5maWVsZHMubWFwKGZ1bmN0aW9uKGZpZWxkKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBzaXplLCBhbGlnblNpemU7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIFJ1bnRpbWUuaXNOdW1iZXJUeXBlKGZpZWxkKSB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgUnVudGltZS5pc1BvaW50ZXJUeXBlKGZpZWxkKVxuICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNpemUgPSBSdW50aW1lLmdldE5hdGl2ZVR5cGVTaXplKGZpZWxkKTsgLy8gcGFjayBjaGFyOyBjaGFyOyBpbiBzdHJ1Y3RzLCBhbHNvIGNoYXJbWF1zLlxuICAgICAgICAgICAgICAgICAgICAgICAgYWxpZ25TaXplID0gUnVudGltZS5nZXRBbGlnblNpemUoZmllbGQsIHNpemUpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKFJ1bnRpbWUuaXNTdHJ1Y3RUeXBlKGZpZWxkKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpZWxkWzFdID09PSAnMCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGlzIFswIHggc29tZXRoaW5nXS4gV2hlbiBpbnNpZGUgYW5vdGhlciBzdHJ1Y3R1cmUgbGlrZSBoZXJlLCBpdCBtdXN0IGJlIGF0IHRoZSBlbmQsIGFuZCBpdCBhZGRzIG5vIHNpemVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGhhcHBlbnMgaW4gamF2YS1uYm9keSBmb3IgZXhhbXBsZS4uLiBhc3NlcnQoaW5kZXggPT09IHR5cGUuZmllbGRzLmxlbmd0aCwgJ3plcm8tbGVuZ3RoIGluIHRoZSBtaWRkbGUhJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFR5cGVzLnR5cGVzW2ZpZWxkXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGlnblNpemUgPSBSdW50aW1lLmdldEFsaWduU2l6ZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUeXBlcy50eXBlc1tmaWVsZF0uYWxpZ25TaXplXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxpZ25TaXplID0gdHlwZS5hbGlnblNpemUgfHwgUVVBTlRVTV9TSVpFO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSA9IFR5cGVzLnR5cGVzW2ZpZWxkXS5mbGF0U2l6ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGlnblNpemUgPSBSdW50aW1lLmdldEFsaWduU2l6ZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVHlwZXMudHlwZXNbZmllbGRdLmFsaWduU2l6ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZmllbGRbMF0gPT0gJ2InKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBiTiwgbGFyZ2UgbnVtYmVyIGZpZWxkLCBsaWtlIGEgW04geCBpOF1cbiAgICAgICAgICAgICAgICAgICAgICAgIHNpemUgPSBmaWVsZC5zdWJzdHIoMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgYWxpZ25TaXplID0gMTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93ICdVbmNsZWFyIHR5cGUgaW4gc3RydWN0OiAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWVsZCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJywgaW4gJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZS5uYW1lXyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJyA6OiAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkdW1wKFR5cGVzLnR5cGVzW3R5cGUubmFtZV9dKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZS5wYWNrZWQpIGFsaWduU2l6ZSA9IDE7XG4gICAgICAgICAgICAgICAgICAgIHR5cGUuYWxpZ25TaXplID0gTWF0aC5tYXgodHlwZS5hbGlnblNpemUsIGFsaWduU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjdXJyID0gUnVudGltZS5hbGlnbk1lbW9yeSh0eXBlLmZsYXRTaXplLCBhbGlnblNpemUpOyAvLyBpZiBuZWNlc3NhcnksIHBsYWNlIHRoaXMgb24gYWxpZ25lZCBtZW1vcnlcbiAgICAgICAgICAgICAgICAgICAgdHlwZS5mbGF0U2l6ZSA9IGN1cnIgKyBzaXplO1xuICAgICAgICAgICAgICAgICAgICBpZiAocHJldiA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkaWZmcy5wdXNoKGN1cnIgLSBwcmV2KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBwcmV2ID0gY3VycjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGN1cnI7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgdHlwZS5mbGF0U2l6ZSA9IFJ1bnRpbWUuYWxpZ25NZW1vcnkoXG4gICAgICAgICAgICAgICAgICAgIHR5cGUuZmxhdFNpemUsXG4gICAgICAgICAgICAgICAgICAgIHR5cGUuYWxpZ25TaXplXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICBpZiAoZGlmZnMubGVuZ3RoID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZS5mbGF0RmFjdG9yID0gdHlwZS5mbGF0U2l6ZTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKFJ1bnRpbWUuZGVkdXAoZGlmZnMpLmxlbmd0aCA9PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHR5cGUuZmxhdEZhY3RvciA9IGRpZmZzWzBdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0eXBlLm5lZWRzRmxhdHRlbmluZyA9IHR5cGUuZmxhdEZhY3RvciAhPSAxO1xuICAgICAgICAgICAgICAgIHJldHVybiB0eXBlLmZsYXRJbmRleGVzO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdlbmVyYXRlU3RydWN0SW5mbzogZnVuY3Rpb24oc3RydWN0LCB0eXBlTmFtZSwgb2Zmc2V0KSB7XG4gICAgICAgICAgICAgICAgdmFyIHR5cGUsIGFsaWdubWVudDtcbiAgICAgICAgICAgICAgICBpZiAodHlwZU5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gb2Zmc2V0IHx8IDA7XG4gICAgICAgICAgICAgICAgICAgIHR5cGUgPSAodHlwZW9mIFR5cGVzID09PSAndW5kZWZpbmVkJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBSdW50aW1lLnR5cGVJbmZvXG4gICAgICAgICAgICAgICAgICAgICAgICA6IFR5cGVzLnR5cGVzKVt0eXBlTmFtZV07XG4gICAgICAgICAgICAgICAgICAgIGlmICghdHlwZSkgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlLmZpZWxkcy5sZW5ndGggIT0gc3RydWN0Lmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdOdW1iZXIgb2YgbmFtZWQgZmllbGRzIG11c3QgbWF0Y2ggdGhlIHR5cGUgZm9yICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlTmFtZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICc6IHBvc3NpYmx5IGR1cGxpY2F0ZSBzdHJ1Y3QgbmFtZXMuIENhbm5vdCByZXR1cm4gc3RydWN0SW5mbydcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBhbGlnbm1lbnQgPSB0eXBlLmZsYXRJbmRleGVzO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0eXBlID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgZmllbGRzOiBzdHJ1Y3QubWFwKGZ1bmN0aW9uKGl0ZW0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXRlbVswXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIGFsaWdubWVudCA9IFJ1bnRpbWUuY2FsY3VsYXRlU3RydWN0QWxpZ25tZW50KHR5cGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgcmV0ID0ge1xuICAgICAgICAgICAgICAgICAgICBfX3NpemVfXzogdHlwZS5mbGF0U2l6ZVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVOYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIHN0cnVjdC5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0sIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgaXRlbSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXRbaXRlbV0gPSBhbGlnbm1lbnRbaV0gKyBvZmZzZXQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGVtYmVkZGVkIHN0cnVjdFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBrZXk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgayBpbiBpdGVtKSBrZXkgPSBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldFtrZXldID0gUnVudGltZS5nZW5lcmF0ZVN0cnVjdEluZm8oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1ba2V5XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZS5maWVsZHNbaV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsaWdubWVudFtpXVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHN0cnVjdC5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0sIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldFtpdGVtWzFdXSA9IGFsaWdubWVudFtpXTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZHluQ2FsbDogZnVuY3Rpb24oc2lnLCBwdHIsIGFyZ3MpIHtcbiAgICAgICAgICAgICAgICBpZiAoYXJncyAmJiBhcmdzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWFyZ3Muc3BsaWNlKSBhcmdzID0gQXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoYXJncyk7XG4gICAgICAgICAgICAgICAgICAgIGFyZ3Muc3BsaWNlKDAsIDAsIHB0cik7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBNb2R1bGVbJ2R5bkNhbGxfJyArIHNpZ10uYXBwbHkobnVsbCwgYXJncyk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE1vZHVsZVsnZHluQ2FsbF8nICsgc2lnXS5jYWxsKG51bGwsIHB0cik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGZ1bmN0aW9uUG9pbnRlcnM6IFtdLFxuICAgICAgICAgICAgd2Fybk9uY2U6IGZ1bmN0aW9uKHRleHQpIHtcbiAgICAgICAgICAgICAgICBpZiAoIVJ1bnRpbWUud2Fybk9uY2Uuc2hvd24pIFJ1bnRpbWUud2Fybk9uY2Uuc2hvd24gPSB7fTtcbiAgICAgICAgICAgICAgICBpZiAoIVJ1bnRpbWUud2Fybk9uY2Uuc2hvd25bdGV4dF0pIHtcbiAgICAgICAgICAgICAgICAgICAgUnVudGltZS53YXJuT25jZS5zaG93blt0ZXh0XSA9IDE7XG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2Fybih0ZXh0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZnVuY1dyYXBwZXJzOiB7fSxcbiAgICAgICAgICAgIFVURjhQcm9jZXNzb3I6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHZhciBidWZmZXIgPSBbXTtcbiAgICAgICAgICAgICAgICB2YXIgbmVlZGVkID0gMDtcbiAgICAgICAgICAgICAgICB0aGlzLnByb2Nlc3NDQ2hhciA9IGZ1bmN0aW9uKGNvZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgY29kZSA9IGNvZGUgJiAweGZmO1xuICAgICAgICAgICAgICAgICAgICBpZiAoYnVmZmVyLmxlbmd0aCA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNvZGUgJiAweDgwKSA9PSAweDAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gMHh4eHh4eHhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gU3RyaW5nLmZyb21DaGFyQ29kZShjb2RlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlci5wdXNoKGNvZGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjb2RlICYgMHhlMCkgPT0gMHhjMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDExMHh4eHh4XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmVlZGVkID0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKGNvZGUgJiAweGYwKSA9PSAweGUwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gMTExMHh4eHhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWVkZWQgPSAyO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAxMTExMHh4eFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRlZCA9IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJyc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKG5lZWRlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLnB1c2goY29kZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZWVkZWQtLTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZWVkZWQgPiAwKSByZXR1cm4gJyc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdmFyIGMxID0gYnVmZmVyWzBdO1xuICAgICAgICAgICAgICAgICAgICB2YXIgYzIgPSBidWZmZXJbMV07XG4gICAgICAgICAgICAgICAgICAgIHZhciBjMyA9IGJ1ZmZlclsyXTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGM0ID0gYnVmZmVyWzNdO1xuICAgICAgICAgICAgICAgICAgICB2YXIgcmV0O1xuICAgICAgICAgICAgICAgICAgICBpZiAoYnVmZmVyLmxlbmd0aCA9PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXQgPSBTdHJpbmcuZnJvbUNoYXJDb2RlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoYzEgJiAweDFmKSA8PCA2KSB8IChjMiAmIDB4M2YpXG4gICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGJ1ZmZlci5sZW5ndGggPT0gMykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0ID0gU3RyaW5nLmZyb21DaGFyQ29kZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGMxICYgMHgwZikgPDwgMTIpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjMiAmIDB4M2YpIDw8IDYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGMzICYgMHgzZilcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBodHRwOi8vbWF0aGlhc2J5bmVucy5iZS9ub3Rlcy9qYXZhc2NyaXB0LWVuY29kaW5nI3N1cnJvZ2F0ZS1mb3JtdWxhZVxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvZGVQb2ludCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjMSAmIDB4MDcpIDw8IDE4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjMiAmIDB4M2YpIDw8IDEyKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjMyAmIDB4M2YpIDw8IDYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYzQgJiAweDNmKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldCA9IFN0cmluZy5mcm9tQ2hhckNvZGUoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgTWF0aC5mbG9vcigoY29kZVBvaW50IC0gMHgxMDAwMCkgLyAweDQwMCkgKyAweGQ4MDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjb2RlUG9pbnQgLSAweDEwMDAwKSAlIDB4NDAwKSArIDB4ZGMwMFxuICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBidWZmZXIubGVuZ3RoID0gMDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHRoaXMucHJvY2Vzc0pTU3RyaW5nID0gZnVuY3Rpb24oc3RyaW5nKSB7XG4gICAgICAgICAgICAgICAgICAgIHN0cmluZyA9IHVuZXNjYXBlKGVuY29kZVVSSUNvbXBvbmVudChzdHJpbmcpKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJldCA9IFtdO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0cmluZy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0LnB1c2goc3RyaW5nLmNoYXJDb2RlQXQoaSkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzdGFja0FsbG9jOiBmdW5jdGlvbihzaXplKSB7XG4gICAgICAgICAgICAgICAgdmFyIHJldCA9IFNUQUNLVE9QO1xuICAgICAgICAgICAgICAgIFNUQUNLVE9QID0gKFNUQUNLVE9QICsgc2l6ZSkgfCAwO1xuICAgICAgICAgICAgICAgIFNUQUNLVE9QID0gKFNUQUNLVE9QICsgNykgJiAtODtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHN0YXRpY0FsbG9jOiBmdW5jdGlvbihzaXplKSB7XG4gICAgICAgICAgICAgICAgdmFyIHJldCA9IFNUQVRJQ1RPUDtcbiAgICAgICAgICAgICAgICBTVEFUSUNUT1AgPSAoU1RBVElDVE9QICsgc2l6ZSkgfCAwO1xuICAgICAgICAgICAgICAgIFNUQVRJQ1RPUCA9IChTVEFUSUNUT1AgKyA3KSAmIC04O1xuICAgICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZHluYW1pY0FsbG9jOiBmdW5jdGlvbihzaXplKSB7XG4gICAgICAgICAgICAgICAgdmFyIHJldCA9IERZTkFNSUNUT1A7XG4gICAgICAgICAgICAgICAgRFlOQU1JQ1RPUCA9IChEWU5BTUlDVE9QICsgc2l6ZSkgfCAwO1xuICAgICAgICAgICAgICAgIERZTkFNSUNUT1AgPSAoRFlOQU1JQ1RPUCArIDcpICYgLTg7XG4gICAgICAgICAgICAgICAgaWYgKERZTkFNSUNUT1AgPj0gVE9UQUxfTUVNT1JZKSBlbmxhcmdlTWVtb3J5KCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBhbGlnbk1lbW9yeTogZnVuY3Rpb24oc2l6ZSwgcXVhbnR1bSkge1xuICAgICAgICAgICAgICAgIHZhciByZXQgPSAoc2l6ZSA9XG4gICAgICAgICAgICAgICAgICAgIE1hdGguY2VpbChzaXplIC8gKHF1YW50dW0gPyBxdWFudHVtIDogOCkpICpcbiAgICAgICAgICAgICAgICAgICAgKHF1YW50dW0gPyBxdWFudHVtIDogOCkpO1xuICAgICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbWFrZUJpZ0ludDogZnVuY3Rpb24obG93LCBoaWdoLCB1bnNpZ25lZCkge1xuICAgICAgICAgICAgICAgIHZhciByZXQgPSB1bnNpZ25lZFxuICAgICAgICAgICAgICAgICAgICA/ICsobG93ID4+PiAwKSArICsoaGlnaCA+Pj4gMCkgKiArNDI5NDk2NzI5NlxuICAgICAgICAgICAgICAgICAgICA6ICsobG93ID4+PiAwKSArICsoaGlnaCB8IDApICogKzQyOTQ5NjcyOTY7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBHTE9CQUxfQkFTRTogOCxcbiAgICAgICAgICAgIFFVQU5UVU1fU0laRTogNFxuICAgICAgICB9O1xuXG4gICAgICAgIHZhciBNb2R1bGUgPSB7fTtcbiAgICAgICAgdGhpcy5Nb2R1bGUgPSBNb2R1bGU7XG5cbiAgICAgICAgTW9kdWxlLmFyZ3VtZW50cyA9IGFyZ3VtZW50cztcblxuICAgICAgICBpZiAoIU1vZHVsZVsnYXJndW1lbnRzJ10pIHtcbiAgICAgICAgICAgIE1vZHVsZVsnYXJndW1lbnRzJ10gPSBbXTtcbiAgICAgICAgfVxuXG4gICAgICAgIE1vZHVsZS5yZWFkID0gZnVuY3Rpb24odXJsKSB7XG4gICAgICAgICAgICB2YXIgeGhyID0gbmV3IFhNTEh0dHBSZXF1ZXN0KCk7XG4gICAgICAgICAgICB4aHIub3BlbignR0VUJywgdXJsLCBmYWxzZSk7XG4gICAgICAgICAgICB4aHIuc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ICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlID09PSBudWxsIHx8IHZhbHVlID09PSB1bmRlZmluZWQgfHwgdmFsdWUgPT09IDApXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDsgLy8gbnVsbCBzdHJpbmdcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBpbnRBcnJheUZyb21TdHJpbmcodmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICB0eXBlID0gJ2FycmF5JztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHR5cGUgPT0gJ2FycmF5Jykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXN0YWNrKSBzdGFjayA9IFJ1bnRpbWUuc3RhY2tTYXZlKCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciByZXQgPSBSdW50aW1lLnN0YWNrQWxsb2ModmFsdWUubGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVBcnJheVRvTWVtb3J5KHZhbHVlLCByZXQpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGZyb21DKHZhbHVlLCB0eXBlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGUgPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBvaW50ZXJfc3RyaW5naWZ5KHZhbHVlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYXNzZXJ0KHR5cGUgIT0gJ2FycmF5Jyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgaSA9IDA7XG4gICAgICAgICAgICB2YXIgY0FyZ3MgPSBhcmdzXG4gICAgICAgICAgICAgICAgPyBhcmdzLm1hcChmdW5jdGlvbihhcmcpIHtcbiAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdG9DKGFyZywgYXJnVHlwZXNbaSsrXSk7XG4gICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIDogW107XG4gICAgICAgICAgICB2YXIgcmV0ID0gZnJvbUMoZnVuYy5hcHBseShudWxsLCBjQXJncyksIHJldHVyblR5cGUpO1xuICAgICAgICAgICAgaWYgKHN0YWNrKSBSdW50aW1lLnN0YWNrUmVzdG9yZShzdGFjayk7XG4gICAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICB9O1xuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBEeW5hbWljYWxseSBzZXRzIGEgdmFsdWUgaW4gbWVtb3J5IGF0IHJ1bnRpbWUuIE9ubHkgZG9lcyAqYWxpZ25lZCogd3JpdGVzLiBUaGlzIGlzIGEgbG93ZXItbGV2ZWwgb3BlcmF0aW9uLlxuICAgICAgICAgKiBAZnVuY3Rpb24gc2V0VmFsdWVcbiAgICAgICAgICogQG1lbWJlcm9mIExpYlRpTWlkaXR5XG4gICAgICAgICAqIEBpbnN0YW5jZVxuICAgICAgICAgKiBAcGFyYW0gcHRyIFBvaW50ZXIuXG4gICAgICAgICAqIEBwYXJhbSB2YWx1ZVxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gdHlwZSBMTFZNIHR5cGUgKCdpOCcsICwgJ2kxNicsICdpMzInLCAnaTY0JywgJ2Zsb2F0JywgJ2RvdWJsZScpXG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiBzZXRWYWx1ZShwdHIsIHZhbHVlLCB0eXBlKSB7XG4gICAgICAgICAgICB0eXBlID0gdHlwZSB8fCAnaTgnO1xuICAgICAgICAgICAgaWYgKHR5cGUuY2hhckF0KHR5cGUubGVuZ3RoIC0gMSkgPT09ICcqJykgdHlwZSA9ICdpMzInOyAvLyBwb2ludGVycyBhcmUgMzItYml0XG4gICAgICAgICAgICBzd2l0Y2ggKHR5cGUpIHtcbiAgICAgICAgICAgICAgICBjYXNlICdpMSc6XG4gICAgICAgICAgICAgICAgICAgIEhFQVA4W3B0cl0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAnaTgnOlxuICAgICAgICAgICAgICAgICAgICBIRUFQOFtwdHJdID0gdmFsdWU7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2kxNic6XG4gICAgICAgICAgICAgICAgICAgIEhFQVAxNltwdHIgPj4gMV0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAnaTMyJzpcbiAgICAgICAgICAgICAgICAgICAgSEVBUDMyW3B0ciA+PiAyXSA9IHZhbHVlO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdpNjQnOlxuICAgICAgICAgICAgICAgICAgICAodGVtcEk2NCA9IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID4+PiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgKCh0ZW1wRG91YmxlID0gdmFsdWUpLFxuICAgICAgICAgICAgICAgICAgICAgICAgK01hdGhfYWJzKHRlbXBEb3VibGUpID49ICsxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0ZW1wRG91YmxlID4gKzBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAoTWF0aF9taW4oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICtNYXRoX2Zsb29yKHRlbXBEb3VibGUgLyArNDI5NDk2NzI5NiksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICs0Mjk0OTY3Mjk1XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB+fitNYXRoX2NlaWwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0ZW1wRG91YmxlIC0gKyh+fnRlbXBEb3VibGUgPj4+IDApKSAvXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArNDI5NDk2NzI5NlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgPj4+IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IDApXG4gICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgKEhFQVAzMltwdHIgPj4gMl0gPSB0ZW1wSTY0WzBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChIRUFQMzJbKHB0ciArIDQpID4+IDJdID0gdGVtcEk2NFsxXSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2Zsb2F0JzpcbiAgICAgICAgICAgICAgICAgICAgSEVBUEYzMltwdHIgPj4gMl0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAnZG91YmxlJzpcbiAgICAgICAgICAgICAgICAgICAgSEVBUEY2NFtwdHIgPj4gM10gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgYWJvcnQoJ2ludmFsaWQgdHlwZSBmb3Igc2V0VmFsdWU6ICcgKyB0eXBlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBNb2R1bGUuc2V0VmFsdWUgPSBzZXRWYWx1ZTtcblxuICAgICAgICAvKipcbiAgICAgICAgICogRHluYW1pY2FsbHkgZ2V0cyBhIHZhbHVlIGluIG1lbW9yeSBhdCBydW50aW1lLiBPbmx5IGRvZXMgKmFsaWduZWQqIHJlYWRzLiBUaGlzIGlzIGEgbG93ZXItbGV2ZWwgb3BlcmF0aW9uLlxuICAgICAgICAgKiBAZnVuY3Rpb24gZ2V0VmFsdWVcbiAgICAgICAgICogQG1lbWJlcm9mIExpYlRpTWlkaXR5XG4gICAgICAgICAqIEBpbnN0YW5jZVxuICAgICAgICAgKiBAcGFyYW0gcHRyIFBvaW50ZXIuXG4gICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSB0eXBlIExMVk0gdHlwZSAoJ2k4JywgLCAnaTE2JywgJ2kzMicsICdpNjQnLCAnZmxvYXQnLCAnZG91YmxlJylcbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uIGdldFZhbHVlKHB0ciwgdHlwZSkge1xuICAgICAgICAgICAgdHlwZSA9IHR5cGUgfHwgJ2k4JztcbiAgICAgICAgICAgIGlmICh0eXBlLmNoYXJBdCh0eXBlLmxlbmd0aCAtIDEpID09PSAnKicpIHR5cGUgPSAnaTMyJzsgLy8gcG9pbnRlcnMgYXJlIDMyLWJpdFxuICAgICAgICAgICAgc3dpdGNoICh0eXBlKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnaTEnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gSEVBUDhbcHRyXTtcbiAgICAgICAgICAgICAgICBjYXNlICdpOCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBIRUFQOFtwdHJdO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2kxNic6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBIRUFQMTZbcHRyID4+IDFdO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2kzMic6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBIRUFQMzJbcHRyID4+IDJdO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2k2NCc6XG4gICAgICAgICA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B0aGVuIHRoaXMgZG9lcyBub3QgbWF0dGVyIGF0IGFsbCBhbmQgaXMgaWdub3JlZC5cbiAgICAgICAgICogQHBhcmFtIGFsbG9jYXRvciBIb3cgdG8gYWxsb2NhdGUgbWVtb3J5LCBzZWUgQUxMT0NfKlxuICAgICAgICAgKi9cblxuICAgICAgICBmdW5jdGlvbiBhbGxvY2F0ZShzbGFiLCB0eXBlcywgYWxsb2NhdG9yLCBwdHIpIHtcbiAgICAgICAgICAgIHZhciB6ZXJvaW5pdCwgc2l6ZTtcbiAgICAgICAgICAgIGlmICh0eXBlb2Ygc2xhYiA9PT0gJ251bWJlcicpIHtcbiAgICAgICAgICAgICAgICB6ZXJvaW5pdCA9IHRydWU7XG4gICAgICAgICAgICAgICAgc2l6ZSA9IHNsYWI7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHplcm9pbml0ID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgc2l6ZSA9IHNsYWIubGVuZ3RoO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHNpbmdsZVR5cGUgPSB0eXBlb2YgdHlwZXMgPT09ICdzdHJpbmcnID8gdHlwZXMgOiBudWxsO1xuICAgICAgICAgICAgdmFyIHJldDtcbiAgICAgICAgICAgIGlmIChhbGxvY2F0b3IgPT0gQUxMT0NfTk9ORSkge1xuICAgICAgICAgICAgICAgIHJldCA9IHB0cjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0ID0gW1xuICAgICAgICAgICAgICAgICAgICBfbWFsbG9jLFxuICAgICAgICAgICAgICAgICAgICBSdW50aW1lLnN0YWNrQWxsb2MsXG4gICAgICAgICAgICAgICAgICAgIFJ1bnRpbWUuc3RhdGljQWxsb2MsXG4gICAgICAgICAgICAgICAgICAgIFJ1bnRpbWUuZHluYW1pY0FsbG9jXG4gICAgICAgICAgICAgICAgXVthbGxvY2F0b3IgPT09IHVuZGVmaW5lZCA/IEFMTE9DX1NUQVRJQyA6IGFsbG9jYXRvcl0oXG4gICAgICAgICAgICAgICAgICAgIE1hdGgubWF4KHNpemUsIHNpbmdsZVR5cGUgPyAxIDogdHlwZXMubGVuZ3RoKVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoemVyb2luaXQpIHtcbiAgICAgICAgICAgICAgICB2YXIgcHRyID0gcmV0LFxuICAgICAgICAgICAgICAgICAgICBzdG9wO1xuICAgICAgICAgICAgICAgIGFzc2VydCgocmV0ICYgMykgPT0gMCk7XG4gICAgICAgICAgICAgICAgc3RvcCA9IHJldCArIChzaXplICYgfjMpO1xuICAgICAgICAgICAgICAgIGZvciAoOyBwdHIgPCBzdG9wOyBwdHIgKz0gNCkge1xuICAgICAgICAgICAgICAgICAgICBIRUFQMzJbcHRyID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc3RvcCA9IHJldCArIHNpemU7XG4gICAgICAgICAgICAgICAgd2hpbGUgKHB0ciA8IHN0b3ApIHtcbiAgICAgICAgICAgICAgICAgICAgSEVBUDhbcHRyKysgfCAwXSA9IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoc2luZ2xlVHlwZSA9PT0gJ2k4Jykge1xuICAgICAgICAgICAgICAgIGlmIChzbGFiLnN1YmFycmF5IHx8IHNsYWIuc2xpY2UpIHtcbiAgICAgICAgICAgICAgICAgICAgSEVBUFU4LnNldChzbGFiLCByZXQpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIEhFQVBVOC5zZXQobmV3IFVpbnQ4QXJyYXkoc2xhYiksIHJldCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgaSA9IDAsXG4gICAgICAgICAgICAgICAgdHlwZSxcbiAgICAgICAgICAgICAgICB0eXBlU2l6ZSxcbiAgICAgICAgICAgICAgICBwcmV2aW91c1R5cGU7XG4gICAgICAgICAgICB3aGlsZSAoaSA8IHNpemUpIHtcbiAgICAgICAgICAgICAgICB2YXIgY3VyciA9IHNsYWJbaV07XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBjdXJyID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgICAgIGN1cnIgPSBSdW50aW1lLmdldEZ1bmN0aW9uSW5kZXgoY3Vycik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHR5cGUgPSBzaW5nbGVUeXBlIHx8IHR5cGVzW2ldO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGkrKztcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09ICdpNjQnKSB0eXBlID0gJ2kzMic7IC8vIHNwZWNpYWwgY2FzZTogd2UgaGF2ZSBvbmUgaTMyIGhlcmUsIGFuZCBvbmUgaTMyIGxhdGVyXG4gICAgICAgICAgICAgICAgc2V0VmFsdWUocmV0ICsgaSwgY3VyciwgdHlwZSk7XG4gICAgICAgICAgICAgICAgLy8gbm8gbmVlZCB0byBsb29rIHVwIHNpemUgdW5sZXNzIHR5cGUgY2hhbmdlcywgc28gY2FjaGUgaXRcbiAgICAgICAgICAgICAgICBpZiAocHJldmlvdXNUeXBlICE9PSB0eXBlKSB7XG4gICAgICAgICAgICAgICAgICAgIHR5cGVTaXplID0gUnVudGltZS5nZXROYXRpdmVUeXBlU2l6ZSh0eXBlKTtcbiAgICAgICAgICAgICAgICAgICAgcHJldmlvdXNUeXBlID0gdHlwZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaSArPSB0eXBlU2l6ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgIH1cblxuICAgICAgICBNb2R1bGVbJ2FsbG9jYXRlJ10gPSBhbGxvY2F0ZTtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQGZ1bmN0aW9uIFBvaW50ZXJfc3RyaW5naWZ5XG4gICAgICAgICAqIEBtZW1iZXJvZiBMaWJUaU1pZGl0eVxuICAgICAgICAgKiBAaW5zdGFuY2VcbiAgICAgICAgICogQHBhcmFtIHB0ciBQb2ludGVyLlxuICAgICAgICAgKiBAcGFyYW0geyp9IFtsZW5ndGhdXG4gICAgICAgICAqL1xuXG4gICAgICAgIGZ1bmN0aW9uIFBvaW50ZXJfc3RyaW5naWZ5KHB0ciwgbGVuZ3RoKSB7XG4gICAgICAgICAgICAvLyBUT0RPOiB1c2UgVGV4dERlY29kZXJcbiAgICAgICAgICAgIC8vIEZpbmQgdGhlIGxlbmd0aCwgYW5kIGNoZWNrIGZvciBVVEYgd2hpbGUgZG9pbmcgc29cbiAgICAgICAgICAgIHZhciBoYXNVdGYgPSBmYWxzZTtcbiAgICAgICAgICAgIHZhciB0O1xuICAgICAgICAgICAgdmFyIGkgPSAwO1xuICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICB0ID0gSEVBUFU4WyhwdHIgKyBpKSB8IDBdO1xuICAgICAgICAgICAgICAgIGlmICh0ID49IDEyOCkgaGFzVXRmID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBlbHNlIGlmICh0ID09IDAgJiYgIWxlbmd0aCkgYnJlYWs7XG4gICAgICAgICAgICAgICAgaSsrO1xuICAgICAgICAgICAgICAgIGlmIChsZW5ndGggJiYgaSA9PSBsZW5ndGgpIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFsZW5ndGgpIGxlbmd0aCA9IGk7XG4gICAgICAgICAgICB2YXIgcmV0ID0gJyc7XG4gICAgICAgICAgICBpZiAoIWhhc1V0Zikge1xuICAgICAgICAgICAgICAgIHZhciBNQVhfQ0hVTksgPSAxMDI0OyAvLyBzcGxpdCB1cCBpbnRvIGNodW5rcywgYmVjYXVzZSAuYXBwbHkgb24gYSBodWdlIHN0cmluZyBjYW4gb3ZlcmZsb3cgdGhlIHN0YWNrXG4gICAgICAgICAgICAgICAgdmFyIGN1cnI7XG4gICAgICAgICAgICAgICAgd2hpbGUgKGxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgY3VyciA9IFN0cmluZy5mcm9tQ2hhckNvZGUuYXBwbHkoXG4gICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcsXG4gICAgICAgICAgICAgICAgICAgICAgICBIRUFQVTguc3ViYXJyYXkocHRyLCBwdHIgKyBNYXRoLm1pbihsZW5ndGgsIE1BWF9DSFVOSykpXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIHJldCA9IHJldCA/IHJldCArIGN1cnIgOiBjdXJyO1xuICAgICAgICAgICAgICAgICAgICBwdHIgKz0gTUFYX0NIVU5LO1xuICAgICAgICAgICAgICAgICAgICBsZW5ndGggLT0gTUFYX0NIVU5LO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHV0ZjggPSBuZXcgUnVudGltZS5VVEY4UHJvY2Vzc29yKCk7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICB0ID0gSEVBUFU4WyhwdHIgKyBpKSB8IDBdO1xuICAgICAgICAgICAgICAgIHJldCArPSB1dGY4LnByb2Nlc3NDQ2hhcih0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgIH1cblxuICAgICAgICBNb2R1bGVbJ1BvaW50ZXJfc3RyaW5naWZ5J10gPSB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ZVsnc3RyaW5nVG9VVEYxNiddID0gc3RyaW5nVG9VVEYxNjtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQGZ1bmN0aW9uIFVURjMyVG9TdHJpbmdcbiAgICAgICAgICogQG1lbWJlcm9mIExpYlRpTWlkaXR5XG4gICAgICAgICAqIEBpbnN0YW5jZVxuICAgICAgICAgKiBAcGFyYW0gcHRyIFBvaW50ZXIgdG8gYSBudWxsLXRlcm1pbmF0ZWQgVVRGMzJMRS1lbmNvZGVkIHN0cmluZyBpbiB0aGUgZW1zY3JpcHRlbiBIRUFQLlxuICAgICAgICAgKiBAcmV0dXJuXG4gICAgICAgICAqL1xuXG4gICAgICAgIGZ1bmN0aW9uIFVURjMyVG9TdHJpbmcocHRyKSB7XG4gICAgICAgICAgICB2YXIgaSA9IDA7XG4gICAgICAgICAgICB2YXIgc3RyID0gJyc7XG4gICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgIHZhciB1dGYzMiA9IEhFQVAzMlsocHRyICsgaSAqIDQpID4+IDJdO1xuICAgICAgICAgICAgICAgIGlmICh1dGYzMiA9PSAwKSByZXR1cm4gc3RyO1xuICAgICAgICAgICAgICAgICsraTtcbiAgICAgICAgICAgICAgICAvLyBHb3RjaGE6IGZyb21DaGFyQ29kZSBjb25zdHJ1Y3RzIGEgY2hhcmFjdGVyIGZyb20gYSBVVEYtMTYgZW5jb2RlZCBjb2RlIChwYWlyKSwgbm90IGZyb20gYSBVbmljb2RlIGNvZGUgcG9pbnQhIFNvIGVuY29kZSB0aGUgY29kZSBwb2ludCB0byBVVEYtMTYgZm9yIGNvbnN0cnVjdGluZy5cbiAgICAgICAgICAgICAgICBpZiAodXRmMzIgPj0gMHgxMDAwMCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgY2ggPSB1dGYzMiAtIDB4MTAwMDA7XG4gICAgICAgICAgICAgICAgICAgIHN0ciArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKFxuICAgICAgICAgICAgIC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29kZVVuaXQpIHtcbiAgICAgICAgICAgICAgICAvLyBHb3RjaGE6IGNoYXJDb2RlQXQgcmV0dXJucyBhIDE2LWJpdCB3b3JkIHRoYXQgaXMgYSBVVEYtMTYgZW5jb2RlZCBjb2RlIHVuaXQsIG5vdCBhIFVuaWNvZGUgY29kZSBwb2ludCBvZiB0aGUgY2hhcmFjdGVyISBXZSBtdXN0IGRlY29kZSB0aGUgc3RyaW5nIHRvIFVURi0zMiB0byB0aGUgaGVhcC5cbiAgICAgICAgICAgICAgICB2YXIgY29kZVVuaXQgPSBzdHIuY2hhckNvZGVBdChpQ29kZVVuaXQpOyAvLyBwb3NzaWJseSBhIGxlYWQgc3Vycm9nYXRlXG4gICAgICAgICAgICAgICAgaWYgKGNvZGVVbml0ID49IDB4ZDgwMCAmJiBjb2RlVW5pdCA8PSAweGRmZmYpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRyYWlsU3Vycm9nYXRlID0gc3RyLmNoYXJDb2RlQXQoKytpQ29kZVVuaXQpO1xuICAgICAgICAgICAgICAgICAgICBjb2RlVW5pdCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAoMHgxMDAwMCArICgoY29kZVVuaXQgJiAweDNmZikgPDwgMTApKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAodHJhaWxTdXJyb2dhdGUgJiAweDNmZik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIEhFQVAzMlsob3V0UHRyICsgaUNoYXIgKiA0KSA+PiAyXSA9IGNvZGVVbml0O1xuICAgICAgICAgICAgICAgICsraUNoYXI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBOdWxsLXRlcm1pbmF0ZSB0aGUgcG9pbnRlciB0byB0aGUgSEVBUC5cbiAgICAgICAgICAgIEhFQVAzMlsob3V0UHRyICsgaUNoYXIgKiA0KSA+PiAyXSA9IDA7XG4gICAgICAgIH1cblxuICAgICAgICBNb2R1bGVbJ3N0cmluZ1RvVVRGMzInXS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sUnVudGltZUNhbGxiYWNrc1xuICAgICAgICAgKiBAbWVtYmVyb2YgTGliVGlNaWRpdHlcbiAgICAgICAgICogQGluc3RhbmNlXG4gICAgICAgICAqIEBwYXJhbSBjYWxsYmFja3NcbiAgICAgICAgICovXG5cbiAgICAgICAgZnVuY3Rpb24gY2FsbFJ1bnRpbWVDYWxsYmFja3MoY2FsbGJhY2tzKSB7XG4gICAgICAgICAgICB3aGlsZSAoY2FsbGJhY2tzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICB2YXIgY2FsbGJhY2sgPSBjYWxsYmFja3Muc2hpZnQoKTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNhbGxiYWNrID09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2soKTtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBmdW5jID0gY2FsbGJhY2suZnVuYztcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGZ1bmMgPT09ICdudW1iZXInKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjYWxsYmFjay5hcmcgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgUnVudGltZS5keW5DYWxsKCd2JywgZnVuYyk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBSdW50aW1lLmR5bkNhbGwoJ3ZpJywgZnVuYywgW2NhbGxiYWNrLmFyZ10pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZnVuYyhjYWxsYmFjay5hcmcgPT09IHVuZGVmaW5lZCA/IG51bGwgOiBjYWxsYmFjay5hcmcpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgIC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biAgICAgICAgICAgIGNhbGxSdW50aW1lQ2FsbGJhY2tzKF9fQVRQUkVSVU5fXyk7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBlbnN1cmVJbml0UnVudGltZSgpIHtcbiAgICAgICAgICAgIGlmIChydW50aW1lSW5pdGlhbGl6ZWQpIHJldHVybjtcbiAgICAgICAgICAgIHJ1bnRpbWVJbml0aWFsaXplZCA9IHRydWU7XG4gICAgICAgICAgICBjYWxsUnVudGltZUNhbGxiYWNrcyhfX0FUSU5JVF9fKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHByZU1haW4oKSB7XG4gICAgICAgICAgICBjYWxsUnVudGltZUNhbGxiYWNrcyhfX0FUTUFJTl9fKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGV4aXRSdW50aW1lKCkge1xuICAgICAgICAgICAgY2FsbFJ1bnRpbWVDYWxsYmFja3MoX19BVEVYSVRfXyk7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBwb3N0UnVuKCkge1xuICAgICAgICAgICAgLy8gY29tcGF0aWJpbGl0eSAtIG1lcmdlIGluIGFueXRoaW5nIGZyb20gTW9kdWxlWydwb3N0UnVuJ10gYXQgdGhpcyB0aW1lXG4gICAgICAgICAgICBpZiAoTW9kdWxlWydwb3N0UnVuJ10pIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIE1vZHVsZVsncG9zdFJ1biddID09ICdmdW5jdGlvbicpXG4gICAgICAgICAgICAgICAgICAgIE1vZHVsZVsncG9zdFJ1biddID0gW01vZHVsZVsncG9zdFJ1biddXTtcbiAgICAgICAgICAgICAgICB3aGlsZSAoTW9kdWxlWydwb3N0UnVuJ10ubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGFkZE9uUG9zdFJ1bihNb2R1bGVbJ3Bvc3RSdW4nXS5zaGlmdCgpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYWxsUnVudGltZUNhbGxiYWNrcyhfX0FUUE9TVFJVTl9fKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAZnVuY3Rpb24gYWRkT25QcmVSdW5cbiAgICAgICAgICogQG1lbWJlcm9mIExpYlRpTWlkaXR5XG4gICAgICAgICAqIEBpbnN0YW5jZVxuICAgICAgICAgKiBAcGFyYW0gY2IgQ2FsbGJhY2suXG4gICAgICAgICAqL1xuXG4gICAgICAgIGZ1bmN0aW9uIGFkZE9uUHJlUnVuKGNiKSB7XG4gICAgICAgICAgICBfX0FUUFJFUlVOX18udW5zaGlmdChjYik7XG4gICAgICAgIH1cblxuICAgICAgICBNb2R1bGVbJ2FkZE9uUHJlUnVuJ10gPSBNb2R1bGUuYWRkT25QcmVSdW4gPSBhZGRPblByZVJ1bjtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQGZ1bmN0aW9uIGFkZE9uSW5pdFxuICAgICAgICAgKiBAbWVtYmVyb2YgTGliVGlNaWRpdHlcbiAgICAgICAgICogQGluc3RhbmNlXG4gICAgICAgICAqIEBwYXJhbSBjYiBDYWxsYmFjay5cbiAgICAgICAgICovXG5cbiAgICAgICAgZnVuY3Rpb24gYWRkT25Jbml0KGNiKSB7XG4gICAgICAgICAgICBfX0FUSU5JVF9fLnVuc2hpZnQoY2IpO1xuICAgICAgICB9XG5cbiAgICAgICAgTW9kdWxlWydhZGRPbkluaXQnXSA9IGFkZE9uSW5pdDtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQGZ1bmN0aW9uIGFkZE9uUHJlTWFpblxuICAgICAgICAgKiBAbWVtYmVyb2YgTGliVGlNaWRpdHlcbiAgICAgICAgICogQGluc3RhbmNlXG4gICAgICAgICAqIEBwYXJhbSBjYiBDYWxsYmFjay5cbiAgICAgICAgICovXG5cbiAgICAgICAgZnVuY3Rpb24gYWRkT25QcmVNYWluKGNiKSB7XG4gICAgICAgICAgICBfX0FUTUFJTl9fLnVuc2hpZnQoY2IpO1xuICAgICAgICB9XG5cbiAgICAgICAgTW9kdWxlWydhZGRPblByZU1haW4nXSA9IGFkZE9uUHJlTWFpbjtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQGZ1bmN0aW9uIGFkZE9uRXhpdFxuICAgICAgICAgKiBAbWVtYmVyb2YgTGliVGlNaWRpdHlcbiAgICAgICAgICogQGluc3RhbmNlXG4gICAgICAgICAqIEBwYXJhbSBjYiBDYWxsYmFjay5cbiAgICAgICAgICovXG5cbiAgICAgICAgZnVuY3Rpb24gYWRkT25FeGl0KGNiKSB7XG4gICAgICAgICAgICBfX0FURVhJVF9fLnVuc2hpZnQoY2IpO1xuICAgICAgICB9XG5cbiAgICAgICAgTW9kdWxlWydhZGRPbkV4aXQnXSA9IGFkZE9uRXhpdDtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQGZ1bmN0aW9uIGFkZE9uUG9zdFJ1blxuICAgICAgICAgKiBAbWVtYmVyb2YgTGliVGlNaWRpdHlcbiAgICAgICAgICogQGluc3RhbmNlXG4gICAgICAgICAqIEBwYXJhbSBjYiBDYWxsYmFjay5cbiAgICAgICAgICovXG5cbiAgICAgICAgZnVuY3Rpb24gYWRkT25Qb3N0UnVuKGNiKSB7XG4gICAgICAgICAgICBfX0FUUE9TVFJVTl9fLnVuc2hpZnQoY2IpO1xuICAgICAgICB9XG5cbiAgICAgICAgTW9kdWxlWydhZGRPblBvc3RSdW4nXSA9IGFkZE9uUG9zdFJ1bjtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQGZ1bmN0aW9uIGludEFycmF5RnJvbVN0cmluZ1xuICAgICAgICAgKiBAbWVtYmVyb2YgTGliVGlNaWRpdHlcbiAgICAgICAgICogQGluc3RhbmNlXG4gICAgICAgICAqIEBwYXJhbSBzdHJpbmd5XG4gICAgICAgICAqIEBwYXJhbSBkb250QWRkTnVsbFxuICAgICAgICAgKiBAcGFyYW0gbGVuZ3RoXG4gICAgICAgICAqL1xuXG4gICAgICAgIC8vIFRvb2xzXG4gICAgICAgIC8vIFRoaXMgcHJvY2Vzc2VzIGEgSlMgc3RyaW5nIGludG8gYSBDLWxpbmUgYXJyYXkgb2YgbnVtYmVycywgMC10ZXJtaW5hdGVkLlxuICAgICAgICAvLyBGb3IgTExWTS1vcmlnaW5hdGluZyBzdHJpbmdzLCBzZWUgcGFyc2VyLmpzOnBhcnNlTExWTVN0cmluZyBmdW5jdGlvblxuICAgICAgICBmdW5jdGlvbiBpbnRBcnJheUZyb21TdHJpbmcoXG4gICAgICAgICAgICBzdHJpbmd5LFxuICAgICAgICAgICAgZG9udEFkZE51bGwsXG4gICAgICAgICAgICBsZW5ndGggLyogb3B0aW9uYWwgKi9cbiAgICAgICAgKSB7XG4gICAgICAgICAgICB2YXIgcmV0ID0gbmV3IFJ1bnRpbWUuVVRGOFByb2Nlc3NvcigpLnByb2Nlc3NKU1N0cmluZyhzdHJpbmd5KTtcbiAgICAgICAgICAgIGlmIChsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICByZXQubGVuZ3RoID0gbGVuZ3RoO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFkb250QWRkTnVsbCkge1xuICAgICAgICAgICAgICAgIHJldC5wdXNoKDApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgICAgfVxuXG4gICAgICAgIE1vZHVsZVsnaW50QXJyYXlGcm9tU3RyaW5nJ10gPSBpbnRBcnJheUZyb21TdHJpbmc7XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBmdW5jdGlvbiBpbnRBcnJheVRvU3RyaW5nXG4gICAgICAgICAqIEBtZW1iZXJvZiBMaWJUaU1pZGl0eVxuICAgICAgICAgKiBAaW5zdGFuY2VcbiAgICAgICAgICogQHBhcmFtIGFycmF5XG4gICAgICAgICAqL1xuXG4gICAgICAgIGZ1bmN0aW9uIGludEFycmF5VG9TdHJpbmcoYXJyYXkpIHtcbiAgICAgICAgICAgIHZhciByZXQgPSBbXTtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXJyYXkubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgY2hyID0gYXJyYXlbaV07XG4gICAgICAgICAgICAgICAgaWYgKGNociA+IDB4ZmYpIHtcbiAgICAgICAgICAgICAgICAgICAgY2hyICY9IDB4ZmY7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldC5wdXNoKFN0cmluZy5mcm9tQ2hhckNvZGUoY2hyKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmV0LmpvaW4oJycpO1xuICAgICAgICB9XG5cbiAgICAgICAgTW9kdWxlWydpbnRBcnJheVRvU3RyaW5nJ10gPSBpbnRBcnJheVRvU3RyaW5nO1xuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAZnVuY3Rpb24gd3JpdGVTdHJpbmdUb01lbW9yeVxuICAgICAgICAgKiBAbWVtYmVyb2YgTGliVGlNaWRpdHlcbiAgICAgICAgICogQGluc3RhbmNlXG4gICAgICAgICAqIEBwYXJhbSBzdHJpbmdcbiAgICAgICAgICogQHBhcmFtIGJ1ZmZlclxuICAgICAgICAgKiBAcGFyYW0gZG9udEFkZE51bGxcbiAgICAgICAgICovXG5cbiAgICAgICAgLy8gV3JpdGUgYSBKYXZhc2NyaXB0IGFycmF5IHRvIHNvbWV3aGVyZSBpbiB0aGUgaGVhcFxuICAgICAgICBmdW5jdGlvbiB3cml0ZVN0cmluZ1RvTWVtb3J5KHN0cmluZywgYnVmZmVyLCBkb250QWRkTnVsbCkge1xuICAgICAgICAgICAgdmFyIGFycmF5ID0gaW50QXJyYXlGcm9tU3RyaW5nKHN0cmluZywgZG9udEFkZE51bGwpO1xuICAgICAgICAgICAgdmFyIGkgPSAwO1xuICAgICAgICAgICAgd2hpbGUgKGkgPCBhcnJheS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB2YXIgY2hyID0gYXJyYXlbaV07XG4gICAgICAgICAgICAgICAgSEVBUDhbKGJ1ZmZlciArIGkpIHwgMF0gPSBjaHI7XG4gICAgICAgICAgICAgICAgaSA9IGkgKyAxO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgTW9kdWxlWyd3cml0ZVN0cmluZ1RvTWVtb3J5J10gPSB3cml0ZVN0cmluZ1RvTWVtb3J5O1xuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAZnVuY3Rpb24gd3JpdGVBcnJheVRvTWVtb3J5XG4gICAgICAgICAqIEBtZW1iZXJvZiBMaWJUaU1pZGl0eVxuICAgICAgICAgKiBAaW5zdGFuY2VcbiAgICAgICAgICogQHBhcmFtIGFycmF5XG4gICAgICAgICAqIEBwYXJhbSBidWZmZXJcbiAgICAgICAgICovXG5cbiAgICAgICAgZnVuY3Rpb24gd3JpdGVBcnJheVRvTWVtb3J5KGFycmF5LCBidWZmZXIpIHtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXJyYXkubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBIRUFQOFsoYnVmZmVyICsgaSkgfCAwXSA9IGFycmF5W2ldO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgTW9kdWxlWyd3cml0ZUFycmF5VG9NZW1vcnknXSA9IHdyaXRlQXJyYXlUb01lbW9yeTtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQGZ1bmN0aW9uIHdyaXRlQXNjaWlUb01lbW9yeVxuICAgICAgICAgKiBAbWVtYmVyb2YgTGliVGlNaWRpdHlcbiAgICAgICAgICogQGluc3RhbmNlXG4gICAgICAgICAqIEBwYXJhbSBzdHJcbiAgICAgICAgICogQHBhcmFtIGJ1ZmZlclxuICAgICAgICAgKiBAcGFyYW0gZG9udEFkZE51bGxcbiAgICAgICAgICovXG5cbiAgICAgICAgZnVuY3Rpb24gd3JpdGVBc2NpaVRvTWVtb3J5KHN0ciwgYnVmZmVyLCBkb250QWRkTnVsbCkge1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzdHIubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBIRUFQOFsoYnVmZmVyICsgaSkgfCAwXSA9IHN0ci5jaGFyQ29kZUF0KGkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFkb250QWRkTnVsbCkgSEVBUDhbKGJ1ZmZlciArIHN0ci5sZW5ndGgpIHwgMF0gPSAwO1xuICAgICAgICB9XG5cbiAgICAgICAgTW9kdWxlWyd3cml0ZUFzY2lpVG9NZW1vcnknXSA9IHdyaXRlQXNjaWlUb01lbW9yeTtcblxuICAgICAgICBmdW5jdGlvbiB1blNpZ24odmFsdWUsIGJpdHMsIGlnbm9yZSwgc2lnKSB7XG4gICAgICAgICAgICBpZiAodmFsdWUgPj0gMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBiaXRzIDw9IDMyXG4gICAgICAgICAgICAgICAgPyAyICogTWF0aC5hYnMoMSA8PCAoYml0cyAtIDEpKSArIHZhbHVlIC8vIE5lZWQgc29tZSB0cmlja2VyeSwgc2luY2UgaWYgYml0cyA9PSAzMiwgd2UgYXJlIHJpZ2h0IGF0IHRoZSBsaW1pdCBvZiB0aGUgYml0cyBKUyB1c2VzIGluIGJpdHNoaWZ0c1xuICAgICAgICAgICAgICAgIDogTWF0aC5wb3coMiwgYml0cykgKyB2YWx1ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlU2lnbih2YWx1ZSwgYml0cykge1xuICAgICAgICAgICAgaWYgKHZhbHVlIDw9IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgaGFsZiA9XG4gICAgICAgICAgICAgICAgYml0cyA8PS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lbmNpZXMtLTtcbiAgICAgICAgICAgIGlmIChNb2R1bGVbJ21vbml0b3JSdW5EZXBlbmRlbmNpZXMnXSkge1xuICAgICAgICAgICAgICAgIE1vZHVsZVsnbW9uaXRvclJ1bkRlcGVuZGVuY2llcyddKHJ1bkRlcGVuZGVuY2llcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaWQpIHtcbiAgICAgICAgICAgICAgICBhc3NlcnQocnVuRGVwZW5kZW5jeVRyYWNraW5nW2lkXSk7XG4gICAgICAgICAgICAgICAgZGVsZXRlIHJ1bkRlcGVuZGVuY3lUcmFja2luZ1tpZF07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbnNvbGUud2Fybignd2FybmluZzogcnVuIGRlcGVuZGVuY3kgcmVtb3ZlZCB3aXRob3V0IElEJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAocnVuRGVwZW5kZW5jaWVzID09IDApIHtcbiAgICAgICAgICAgICAgICBpZiAocnVuRGVwZW5kZW5jeVdhdGNoZXIgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbChydW5EZXBlbmRlbmN5V2F0Y2hlcik7XG4gICAgICAgICAgICAgICAgICAgIHJ1bkRlcGVuZGVuY3lXYXRjaGVyID0gbnVsbDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGRlcGVuZGVuY2llc0Z1bGZpbGxlZCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgY2FsbGJhY2sgPSBkZXBlbmRlbmNpZXNGdWxmaWxsZWQ7XG4gICAgICAgICAgICAgICAgICAgIGRlcGVuZGVuY2llc0Z1bGZpbGxlZCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKCk7IC8vIGNhbiBhZGQgYW5vdGhlciBkZXBlbmRlbmNpZXNGdWxmaWxsZWRcbiAgICAgICAgICAgICAgICB9XG4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AgICAgICAgICAgIHJldHVybiBzcGxpdFBhdGhSZS5leGVjKGZpbGVuYW1lKS5zbGljZSgxKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBub3JtYWxpemVBcnJheTogZnVuY3Rpb24ocGFydHMsIGFsbG93QWJvdmVSb290KSB7XG4gICAgICAgICAgICAgICAgLy8gaWYgdGhlIHBhdGggdHJpZXMgdG8gZ28gYWJvdmUgdGhlIHJvb3QsIGB1cGAgZW5kcyB1cCA+IDBcbiAgICAgICAgICAgICAgICB2YXIgdXAgPSAwO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSBwYXJ0cy5sZW5ndGggLSAxOyBpID49IDA7IGktLSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbGFzdCA9IHBhcnRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAobGFzdCA9PT0gJy4nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJ0cy5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobGFzdCA9PT0gJy4uJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFydHMuc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdXArKztcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh1cCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFydHMuc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdXAtLTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBpZiB0aGUgcGF0aCBpcyBhbGxvd2VkIHRvIGdvIGFib3ZlIHRoZSByb290LCByZXN0b3JlIGxlYWRpbmcgLi5zXG4gICAgICAgICAgICAgICAgaWYgKGFsbG93QWJvdmVSb290KSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAoOyB1cC0tOyB1cCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFydHMudW5zaGlmdCgnLi4nKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcGFydHM7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbm9ybWFsaXplOiBmdW5jdGlvbihwYXRoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGlzQWJzb2x1dGUgPSBwYXRoLmNoYXJBdCgwKSA9PT0gJy8nLFxuICAgICAgICAgICAgICAgICAgICB0cmFpbGluZ1NsYXNoID0gcGF0aC5zdWJzdHIoLTEpID09PSAnLyc7XG4gICAgICAgICAgICAgICAgLy8gTm9ybWFsaXplIHRoZSBwYXRoXG4gICAgICAgICAgICAgICAgcGF0aCA9IFBBVEgubm9ybWFsaXplQXJyYXkoXG4gICAgICAgICAgICAgICAgICAgIHBhdGguc3BsaXQoJy8nKS5maWx0ZXIoZnVuY3Rpb24ocCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICEhcDtcbiAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICAgICFpc0Fic29sdXRlXG4gICAgICAgICAgICAgICAgKS5qb2luKCcvJyk7XG4gICAgICAgICAgICAgICAgaWYgKCFwYXRoICYmICFpc0Fic29sdXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIHBhdGggPSAnLic7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChwYXRoICYmIHRyYWlsaW5nU2xhc2gpIHtcbiAgICAgICAgICAgICAgICAgICAgcGF0aCArPSAnLyc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiAoaXNBYnNvbHV0ZSA/ICcvJyA6ICcnKSArIHBhdGg7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZGlybmFtZTogZnVuY3Rpb24ocGF0aCkge1xuICAgICAgICAgICAgICAgIHZhciByZXN1bHQgPSBQQVRILnNwbGl0UGF0aChwYXRoKSxcbiAgICAgICAgICAgICAgICAgICAgcm9vdCA9IHJlc3VsdFswXSxcbiAgICAgICAgICAgICAgICAgICAgZGlyID0gcmVzdWx0WzFdO1xuICAgICAgICAgICAgICAgIGlmICghcm9vdCAmJiAhZGlyKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIE5vIGRpcm5hbWUgd2hhdHNvZXZlclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJy4nO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoZGlyKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIEl0IGhhcyBhIGRpcm5hbWUsIHN0cmlwIHRyYWlsaW5nIHNsYXNoXG4gICAgICAgICAgICAgICAgICAgIGRpciA9IGRpci5zdWJzdHIoMCwgZGlyLmxlbmd0aCAtIDEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcm9vdCArIGRpcjtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBiYXNlbmFtZTogZnVuY3Rpb24ocGF0aCwgZXh0KSB7XG4gICAgICAgICAgICAgICAgLy8gRU1TQ1JJUFRFTiByZXR1cm4gJy8nJyBmb3IgJy8nLCBub3QgYW4gZW1wdHkgc3RyaW5nXG4gICAgICAgICAgICAgICAgaWYgKHBhdGggPT09ICcvJykgcmV0dXJuICcvJztcbiAgICAgICAgICAgICAgICB2YXIgZiA9IFBBVEguc3BsaXRQYXRoKHBhdGgpWzJdO1xuICAgICAgICAgICAgICAgIGlmIChleHQgJiYgZi5zdWJzdHIoLTEgKiBleHQubGVuZ3RoKSA9PT0gZXh0KSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPSBmLnN1YnN0cigwLCBmLmxlbmd0aCAtIGV4dC5sZW5ndGgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gZjtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBleHRuYW1lOiBmdW5jdGlvbihwYXRoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFBBVEguc3BsaXRQYXRoKHBhdGgpWzNdO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGpvaW46IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHZhciBwYXRocyA9IEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKGFyZ3VtZW50cywgMCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFBBVEgubm9ybWFsaXplKFxuICAgICAgICAgICAgICAgICAgICBwYXRoc1xuICAgICAgICAgICAgICAgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbihwLCBpbmRleCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcCAhPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdBcmd1bWVudHMgdG8gcGF0aC5qb2luIG11c3QgYmUgc3RyaW5ncydcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgLmpvaW4oJy8nKVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcmVzb2x2ZTogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgdmFyIHJlc29sdmVkUGF0aCA9ICcnLFxuICAgICAgICAgICAgICAgICAgICByZXNvbHZlZEFic29sdXRlID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgZm9yIChcbiAgICAgICAgICAgICAgICAgICAgdmFyIGkgPSBhcmd1bWVudHMubGVuZ3RoIC0gMTtcbiAgICAgICAgICAgICAgICAgICAgaSA+PSAtMSAmJiAhcmVzb2x2ZWRBYnNvbHV0ZTtcbiAgICAgICAgICAgICAgICAgICAgaS0tXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXRoID0gaSA+PSAwID8gYXJndW1lbnRzW2ldIDogRlMuY3dkKCk7XG4gICAgICAgICAgICAgICAgICAgIC8vIFNraXAgZW1wdHkgYW5kIGludmFsaWQgZW50cmllc1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHBhdGggIT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdBcmd1bWVudHMgdG8gcGF0aC5yZXNvbHZlIG11c3QgYmUgc3RyaW5ncydcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIXBhdGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJlc29sdmVkUGF0aCA9IHBhdGggKyAnLycgKyByZXNvbHZlZFBhdGg7XG4gICAgICAgICAgICAgICAgICAgIHJlc29sdmVkQWJzb2x1dGUgPSBwYXRoLmNoYXJBdCgwKSA9PT0gJy8nO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBBdCB0aGlzIHBvaW50IHRoZSBwYXRoIHNob3VsZCBiZSByZXNvbHZlZCB0byBhIGZ1bGwgYWJzb2x1dGUgcGF0aCwgYnV0XG4gICAgICAgICAgICAgICAgLy8gaGFuZGxlIHJlbGF0aXZlIHBhdGhzIHRvIGJlIHNhZmUgKG1pZ2h0IGhhcHBlbiB3aGVuIHByb2Nlc3MuY3dkKCkgZmFpbHMpXG4gICAgICAgICAgICAgICAgcmVzb2x2ZWRQYXRoID0gUEFUSC5ub3JtYWxpemVBcnJheShcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZWRQYXRoLnNwbGl0KCcvJykuZmlsdGVyKGZ1bmN0aW9uKHApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAhIXA7XG4gICAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgICAhcmVzb2x2ZWRBYnNvbHV0ZVxuICAgICAgICAgICAgICAgICkuam9pbignLycpO1xuICAgICAgICAgICAgICAgIHJldHVybiAocmVzb2x2ZWRBYnNvbHV0ZSA/ICcvJyA6ICcnKSArIHJlc29sdmVkUGF0aCB8fCAnLic7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcmVsYXRpdmU6IGZ1bmN0aW9uKGZyb20sIHRvKSB7XG4gICAgICAgICAgICAgICAgZnJvbSA9IFBBVEgucmVzb2x2ZShmcm9tKS5zdWJzdHIoMSk7XG4gICAgICAgICAgICAgICAgdG8gPSBQQVRILnJlc29sdmUodG8pLnN1YnN0cigxKTtcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiB0cmltKGFycikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgc3RhcnQgPSAwO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKDsgc3RhcnQgPCBhcnIubGVuZ3RoOyBzdGFydCsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXJyW3N0YXJ0XSAhPT0gJycpIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHZhciBlbmQgPSBhcnIubGVuZ3RoIC0gMTtcbiAgICAgICAgICAgICAgICAgICAgZm9yICg7IGVuZCA+PSAwOyBlbmQtLSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFycltlbmRdICE9PSAnJykgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXJ0ID4gZW5kKSByZXR1cm4gW107XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnIuc2xpY2Uoc3RhcnQsIGVuZCAtIHN0YXJ0ICsgMSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBmcm9tUGFydHMgPSB0cmltKGZyb20uc3BsaXQoJy8nKSk7XG4gICAgICAgICAgICAgICAgdmFyIHRvUGFydHMgPSB0cmltKHRvLnNwbGl0KCcvJykpO1xuICAgICAgICAgICAgICAgIHZhciBsZW5ndGggPSBNYXRoLm1pbihmcm9tUGFydHMubGVuZ3RoLCB0b1BhcnRzLmxlbmd0aCk7XG4gICAgICAgICAgICAgICAgdmFyIHNhbWVQYXJ0c0xlbmd0aCA9IGxlbmd0aDtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChmcm9tUGFydHNbaV0gIT09IHRvUGFydHNbaV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNhbWVQYXJ0c0xlbmd0aCA9IGk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgb3V0cHV0UGFydHMgPSBbXTtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gc2FtZVBhcnRzTGVuZ3RoOyBpIDwgZnJvbVBhcnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dFBhcnRzLnB1c2goJy4uJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG91dHB1dFBhcnRzID0gb3V0cHV0UGFydHMuY29uY2F0KFxuICAgICAgICAgICAgICAgICAgICB0b1BhcnRzLnNsaWNlKHNhbWVQYXJ0c0xlbmd0aClcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIHJldHVybiBvdXRwdXRQYXJ0cy5qb2luKCcvJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIHZhciBUVFkgPSB7XG4gICAgICAgICAgICB0dHlzOiBbXSxcbiAgICAgICAgICAgIGluaXQ6IGZ1bmN0aW9uKCkge30sXG4gICAgICAgICAgICBzaHV0ZG93bjogZnVuY3Rpb24oKSB7fSxcbiAgICAgICAgICAgIHJlZ2lzdGVyOiBmdW5jdGlvbihkZXYsIG9wcykge1xuICAgICAgICAgICAgICAgIFRUWS50dHlzW2Rldl0gPSB7IGlucHV0OiBbXSwgb3V0cHV0OiBbXSwgb3BzOiBvcHMgfTtcbiAgICAgICAgICAgICAgICBGUy5yZWdpc3RlckRldmljZShkZXYsIFRUWS5zdHJlYW1fb3BzKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzdHJlYW1fb3BzOiB7XG4gICAgICAgICAgICAgICAgb3BlbjogZnVuY3Rpb24oc3RyZWFtKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0dHkgPSBUVFkudHR5c1tzdHJlYW0ubm9kZS5yZGV2XTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0dHkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOT0RFVik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgc3RyZWFtLnR0eSA9IHR0eTtcbiAgICAgICAgICAgICAgICAgICAgc3RyZWFtLnNlZWthYmxlID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBjbG9zZTogZnVuY3Rpb24oc3RyZWFtKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGZsdXNoIGFueSBwZW5kaW5nIGxpbmUgZGF0YVxuICAgICAgICAgICAgICAgICAgICBpZiAoc3RyZWFtLnR0eS5vdXRwdXQubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW0udHR5Lm9wcy5wdXRfY2hhcihzdHJlYW0udHR5LCAxMCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHJlYWQ6IGZ1bmN0aW9uKFxuICAgICAgICAgICAgICAgICAgICBzdHJlYW0sXG4gICAgICAgICAgICAgICAgICAgIGJ1ZmZlcixcbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0LFxuICAgICAgICAgICAgICAgICAgICBsZW5ndGgsXG4gICAgICAgICAgICAgICAgICAgIHBvcyAvKiBpZ25vcmVkICovXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghc3RyZWFtLnR0eSB8fCAhc3RyZWFtLnR0eS5vcHMuZ2V0X2NoYXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOWElPKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB2YXIgYnl0ZXNSZWFkID0gMDtcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gc3RyZWFtLnR0eS5vcHMuZ2V0X2NoYXIoc3RyZWFtLnR0eSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUlPKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQgPT09IHVuZGVmaW5lZCAmJiBieXRlc1JlYWQgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FQUdBSU4pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCA9PT0gbnVsbCB8fCByZXN1bHQgPT09IHVuZGVmaW5lZCkgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICBieXRlc1JlYWQrKztcbiAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlcltvZmZzZXQgKyBpXSA9IHJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoYnl0ZXNSZWFkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW0ubm9kZS50aW1lc3RhbXAgPSBEYXRlLm5vdygpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBieXRlc1JlYWQ7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB3cml0ZTogZnVuY3Rpb24oc3RyZWFtLCBidWZmZXIsIG9mZnNldCwgbGVuZ3RoLCBwb3MpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzdHJlYW0udHR5IHx8ICFzdHJlYW0udHR5Lm9wcy5wdXRfY2hhcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRU5YSU8pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtLnR0eS5vcHMucHV0X2NoYXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbS50dHksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlcltvZmZzZXQgKyBpXVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUlPKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAobGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW0ubm9kZS50aW1lc3RhbXAgPSBEYXRlLm5vdygpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBkZWZhdWx0X3R0eV9vcHM6IHtcbiAgICAgICAgICAgICAgICBnZXRfY2hhcjogZnVuY3Rpb24odHR5KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghdHR5LmlucHV0Lmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlc3VsdCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZW9mIHdpbmRvdyAhPSAndW5kZWZpbmVkJyAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVvZiB3aW5kb3cucHJvbXB0ID09ICdmdW5jdGlvbidcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEJyb3dzZXIuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gd2luZG93LnByb21wdCgnSW5wdXQ6ICcpOyAvLyByZXR1cm5zIG51bGwgb24gY2FuY2VsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ1xcbic7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgcmVhZGxpbmUgPT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIENvbW1hbmQgbGluZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSByZWFkbGluZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdcXG4nO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghcmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB0dHkuaW5wdXQgPSBpbnRBcnJheUZyb21TdHJpbmcocmVzdWx0LCB0cnVlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHR5LmlucHV0LnNoaWZ0KCk7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBwdXRfY2hhcjogZnVuY3Rpb24odHR5LCB2YWwpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHZhbCA9PT0gbnVsbCB8fCB2YWwgPT09IDEwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyh0dHkub3V0cHV0LmpvaW4oJycpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHR0eS5vdXRwdXQgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHR0eS5vdXRwdXQucHVzaChUVFkudXRmOC5wcm9jZXNzQ0NoYXIodmFsKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZGVmYXVsdF90dHkxX29wczoge1xuICAgICAgICAgICAgICAgIHB1dF9jaGFyOiBmdW5jdGlvbih0dHksIHZhbCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodmFsID09PSBudWxsIHx8IHZhbCA9PT0gMTApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2Fybih0dHkub3V0cHV0LmpvaW4oJycpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHR0eS5vdXRwdXQgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHR0eS5vdXRwdXQucHVzaChUVFkudXRmOC5wcm9jZXNzQ0NoYXIodmFsKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIHZhciBNRU1GUyA9IHtcbiAgICAgICAgICAgIENPTlRFTlRfT1dOSU5HOiAxLFxuICAgICAgICAgICAgQ09OVEVOVF9GTEVYSUJMRTogMixcbiAgICAgICAgICAgIENPTlRFTlRfRklYRUQ6IDMsXG4gICAgICAgICAgICBtb3VudDogZnVuY3Rpb24obW91bnQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gTUVNRlMuY3JlYXRlTm9kZShudWxsLCAnLycsIDE2Mzg0IHwgMG83NzcsIDApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNyZWF0ZU5vZGU6IGZ1bmN0aW9uKHBhcmVudCwgbmFtZSwgbW9kZSwgZGV2KSB7XG4gICAgICAgICAgICAgICAgaWYgKEZTLmlzQmxrZGV2KG1vZGUpIHx8IEZTLmlzRklGTyhtb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBubyBzdXBwb3J0ZWRcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRVBFUk0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgbm9kZSA9IEZTLmNyZWF0ZU5vZGUocGFyZW50LCBuYW1lLCBtb2RlLCBkZXYpO1xuICAgICAgICAgICAgICAgIGlmIChGUy5pc0Rpcihub2RlLm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUubm9kZV9vcHMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBnZXRhdHRyOiBNRU1GUy5ub2RlX29wcy5nZXRhdHRyLFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0YXR0cjogTUVNRlMubm9kZV9vcHMuc2V0YXR0cixcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvb2t1cDogTUVNRlMubm9kZV9vcHMubG9va3VwLFxuICAgICAgICAgICAgICAgICAgICAgICAgbWtub2Q6IE1FTUZTLm5vZGVfb3BzLm1rbm9kLFxuICAgICAgICAgICAgICAgICAgICAgICAgbWtub2Q6IE1FTUZTLm5vZGVfb3BzLm1rbm9kLFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVuYW1lOiBNRU1GUy5ub2RlX29wcy5yZW5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICB1bmxpbms6IE1FTUZTLm5vZGVfb3BzLnVubGluayxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJtZGlyOiBNRU1GUy5ub2RlX29wcy5ybWRpcixcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlYWRkaXI6IE1FTUZTLm5vZGVfb3BzLnJlYWRkaXIsXG4gICAgICAgICAgICAgICAgICAgICAgICBzeW1saW5rOiBNRU1GUy5ub2RlX29wcy5zeW1saW5rXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIG5vZGUuc3RyZWFtX29wcyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxsc2VlazogTUVNRlMuc3RyZWFtX29wcy5sbHNlZWtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5jb250ZW50cyA9IHt9O1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoRlMuaXNGaWxlKG5vZGUubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5ub2RlX29wcyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGdldGF0dHI6IE1FTUZTLm5vZGVfb3BzLmdldGF0dHIsXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRhdHRyOiBNRU1GUy5ub2RlX29wcy5zZXRhdHRyXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIG5vZGUuc3RyZWFtX29wcyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxsc2VlazogTUVNRlMuc3RyZWFtX29wcy5sbHNlZWssXG4gICAgICAgICAgICAgICAgICAgICAgICByZWFkOiBNRU1GUy5zdHJlYW1fb3BzLnJlYWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZTogTUVNRlMuc3RyZWFtX29wcy53cml0ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFsbG9jYXRlOiBNRU1GUy5zdHJlYW1fb3BzLmFsbG9jYXRlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbW1hcDogTUVNRlMuc3RyZWFtX29wcy5tbWFwXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIG5vZGUuY29udGVudHMgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5jb250ZW50TW9kZSA9IE1FTUZTLkNPTlRFTlRfRkxFWElCTEU7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChGUy5pc0xpbmsobm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICBub2RlLm5vZGVfb3BzID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgZ2V0YXR0cjogTUVNRlMubm9kZV9vcHMuZ2V0YXR0cixcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldGF0dHI6IE1FTUZTLm5vZGVfb3BzLnNldGF0dHIsXG4gICAgICAgICAgICAgICAgICAgICAgICByZWFkbGluazogTUVNRlMubm9kZV9vcHMucmVhZGxpbmtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5zdHJlYW1fb3BzID0ge307XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChGUy5pc0NocmRldihub2RlLm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUubm9kZV9vcHMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBnZXRhdHRyOiBNRU1GUy5ub2RlX29wcy5nZXRhdHRyLFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0YXR0cjogTUVNRlMubm9kZV9vcHMuc2V0YXR0clxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICBub2RlLnN0cmVhbV9vcHMgPSBGUy5jaHJkZXZfc3RyZWFtX29wcztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbm9kZS50aW1lc3RhbXAgPSBEYXRlLm5vdygpO1xuICAgICAgICAgICAgICAgIC8vIGFkZCB0aGUgbmV3IG5vZGUgdG8gdGhlIHBhcmVudFxuICAgICAgICAgICAgICAgIGlmIChwYXJlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyZW50LmNvbnRlbnRzW25hbWVdID0gbm9kZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5vZGU7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZW5zdXJlRmxleGlibGU6IGZ1bmN0aW9uKG5vZGUpIHtcbiAgICAgICAgICAgICAgICBpZiAobm9kZS5jb250ZW50TW9kZSAhPT0gTUVNRlMuQ09OVEVOVF9GTEVYSUJMRSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgY29udGVudHMgPSBub2RlLmNvbnRlbnRzO1xuICAgICAgICAgICAgICAgICAgICBub2RlLmNvbnRlbnRzID0gQXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoY29udGVudHMpO1xuICAgICAgICAgICAgICAgICAgICBub2RlLmNvbnRlbnRNb2RlID0gTUVNRlMuQ09OVEVOVF9GTEVYSUJMRTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbm9kZV9vcHM6IHtcbiAgICAgICAgICAgICAgICBnZXRhdHRyOiBmdW5jdGlvbihub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBhdHRyID0ge307XG4gICAgICAgICAgICAgICAgICAgIC8vIGRldmljZSBudW1iZXJzIHJldXNlIGlub2RlIG51bWJlcnMuXG4gICAgICAgICAgICAgICAgICAgIGF0dHIuZGV2ID0gRlMuaXNDaHJkZXYobm9kZS5tb2RlKSA/IG5vZGUuaWQgOiAxO1xuICAgICAgICAgICAgICAgICAgICBhdHRyLmlubyA9IG5vZGUuaWQ7XG4gICAgICAgICAgICAgICAgICAgIGF0dHIubW9kZSA9IG5vZGUubW9kZTtcbiAgICAgICAgICAgICAgICAgICAgYXR0ci5ubGluayA9IDE7XG4gICAgICAgICAgICAgICAgICAgIGF0dHIudWlkID0gMDtcbiAgICAgICAgICAgICAgICAgICAgYXR0ci5naWQgPSAwO1xuICAgICAgICAgICAgICAgICAgICBhdHRyLnJkZXYgPSBub2RlLnJkZXY7XG4gICAgICAgICAgICAgICAgICAgIGlmIChGUy5pc0Rpcihub2RlLm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhdHRyLnNpemUgPSA0MDk2O1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKEZTLmlzRmlsZShub2RlLm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhdHRyLnNpemUgPSBub2RlLmNvbnRlbnRzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChGUy5pc0xpbmsobm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYXR0ci5zaXplID0gbm9kZS5saW5rLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGF0dHIuc2l6ZSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYXR0ci5hdGltZSA9IG5ldyBEYXRlKG5vZGUudGltZXN0YW1wKTtcbiAgICAgICAgICAgICAgICAgICAgYXR0ci5tdGltZSA9IG5ldyBEYXRlKG5vZGUudGltZXN0YW1wKTtcbiAgICAgICAgICAgICAgICAgICAgYXR0ci5jdGltZSA9IG5ldyBEYXRlKG5vZGUudGltZXN0YW1wKTtcbiAgICAgICAgICAgICAgICAgICAgLy8gTk9URTogSW4gb3VyIGltcGxlbWVudGF0aW9uLCBzdF9ibG9ja3MgPSBNYXRoLmNlaWwoc3Rfc2l6ZS9zdF9ibGtzaXplKSxcbiAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgYnV0IHRoaXMgaXMgbm90IHJlcXVpcmVkIGJ5IHRoZSBzdGFuZGFyZC5cbiAgICAgICAgICAgICAgICAgICAgYXR0ci5ibGtzaXplID0gNDA5NjtcbiAgICAgICAgICAgICAgICAgICAgYXR0ci5ibG9ja3MgPSBNYXRoLmNlaWwoYXR0ci5zaXplIC8gYXR0ci5ibGtzaXplKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF0dHI7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBzZXRhdHRyOiBmdW5jdGlvbihub2RlLCBhdHRyKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhdHRyLm1vZGUgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5tb2RlID0gYXR0ci5tb2RlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChhdHRyLnRpbWVzdGFtcCAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLnRpbWVzdGFtcCA9IGF0dHIudGltZXN0YW1wO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChhdHRyLnNpemUgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgTUVNRlMuZW5zdXJlRmxleGlibGUobm9kZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29udGVudHMgPSBub2RlLmNvbnRlbnRzO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGF0dHIuc2l6ZSA8IGNvbnRlbnRzLmxlbmd0aClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50cy5sZW5ndGggPSBhdHRyLnNpemU7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGF0dHIuc2l6ZSA+IGNvbnRlbnRzLmxlbmd0aClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudHMucHVzaCgwKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgbG9va3VwOiBmdW5jdGlvbihwYXJlbnQsIG5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRU5PRU5UKTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIG1rbm9kOiBmdW5jdGlvbihwYXJlbnQsIG5hbWUsIG1vZGUsIGRldikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gTUVNRlMuY3JlYXRlTm9kZShwYXJlbnQsIG5hbWUsIG1vZGUsIGRldik7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICByZW5hbWU6IGZ1bmN0aW9uKG9sZF9ub2RlLCBuZXdfZGlyLCBuZXdfbmFtZSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBpZiB3ZSdyZSBvdmVyd3JpdGluZyBhIGRpcmVjdG9yeSBhdCBuZXdfbmFtZSwgbWFrZSBzdXJlIGl0J3MgZW1wdHkuXG4gICAgICAgICAgICAgICAgICAgIGlmIChGUy5pc0RpcihvbGRfbm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG5ld19ub2RlO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfbm9kZSA9IEZTLmxvb2t1cE5vZGUobmV3X2RpciwgbmV3X25hbWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXdfbm9kZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgaW4gbmV3X25vZGUuY29udGVudHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRU5PVEVNUFRZKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgLy8gZG8gdGhlIGludGVybmFsIHJld2lyaW5nXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBvbGRfbm9kZS5wYXJlbnQuY29udGVudHNbb2xkX25vZGUubmFtZV07XG4gICAgICAgICAgICAgICAgICAgIG9sZF9ub2RlLm5hbWUgPSBuZXdfbmFtZTtcbiAgICAgICAgICAgICAgICAgICAgbmV3X2Rpci5jb250ZW50c1tuZXdfbmFtZV0gPSBvbGRfbm9kZTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHVubGluazogZnVuY3Rpb24ocGFyZW50LCBuYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBwYXJlbnQuY29udGVudHNbbmFtZV07XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBybWRpcjogZnVuY3Rpb24ocGFyZW50LCBuYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBub2RlID0gRlMubG9va3VwTm9kZShwYXJlbnQsIG5hbWUpO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpIGluIG5vZGUuY29udGVudHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOT1RFTVBUWSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHBhcmVudC5jb250ZW50c1tuYW1lXTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHJlYWRkaXI6IGZ1bmN0aW9uKG5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGVudHJpZXMgPSBbJy4nLCAnLi4nXTtcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIga2V5IGluIG5vZGUuY29udGVudHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbm9kZS5jb250ZW50cy5oYXNPd25Qcm9wZXJ0eShrZXkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbnRyaWVzLnB1c2goa2V5KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZW50cmllcztcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHN5bWxpbms6IGZ1bmN0aW9uKHBhcmVudCwgbmV3bmFtZSwgb2xkcGF0aCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbm9kZSA9IE1FTUZTLmNyZWF0ZU5vZGUoXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnQsXG4gICAgICAgICAgICAgICAgICAgICAgICBuZXduYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgMG83NzcgfCA0MDk2MCxcbiAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5saW5rID0gb2xkcGF0aDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5vZGU7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICByZWFkbGluazogZnVuY3Rpb24obm9kZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIUZTLmlzTGluayhub2RlLm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSU5WQUwpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBub2RlLmxpbms7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHN0cmVhbV9vcHM6IHtcbiAgICAgICAgICAgICAgICByZWFkOiBmdW5jdGlvbihzdHJlYW0sIGJ1ZmZlciwgb2Zmc2V0LCBsZW5ndGgsIHBvc2l0aW9uKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjb250ZW50cyA9IHN0cmVhbS5ub2RlLmNvbnRlbnRzO1xuICAgICAgICAgICAgICAgICAgICBpZiAocG9zaXRpb24gPj0gY29udGVudHMubGVuZ3RoKSByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNpemUgPSBNYXRoLm1pbihjb250ZW50cy5sZW5ndGggLSBwb3NpdGlvbiwgbGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgYXNzZXJ0KHNpemUgPj0gMCk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzaXplID4gOCAmJiBjb250ZW50cy5zdWJhcnJheSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm9uLXRyaXZpYWwsIGFuZCB0eXBlZCBhcnJheVxuICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLnNldChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50cy5zdWJhcnJheShwb3NpdGlvbiwgcG9zaXRpb24gKyBzaXplKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXRcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpemU7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlcltvZmZzZXQgKyBpXSA9IGNvbnRlbnRzW3Bvc2l0aW9uICsgaV07XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNpemU7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB3cml0ZTogZnVuY3Rpb24oXG4gICAgICAgICAgICAgICAgICAgIHN0cmVhbSxcbiAgICAgICAgICAgICAgICAgICAgYnVmZmVyLFxuICAgICAgICAgICAgICAgICAgICBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgIGxlbmd0aCxcbiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24sXG4gICAgICAgICAgICAgICAgICAgIGNhbk93blxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbm9kZSA9IHN0cmVhbS5ub2RlO1xuICAgICAgICAgICAgICAgICAgICBub2RlLnRpbWVzdGFtcCA9IERhdGUubm93KCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjb250ZW50cyA9IG5vZGUuY29udGVudHM7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudHMubGVuZ3RoID09PSAwICYmXG4gICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9PT0gMCAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLnN1YmFycmF5XG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8ganVzdCByZXBsYWNlIGl0IHdpdGggdGhlIG5ldyBkYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICBhc3NlcnQoYnVmZmVyLmxlbmd0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FuT3duICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLmJ1ZmZlciA9PT0gSEVBUDguYnVmZmVyICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID09PSAwXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLmNvbnRlbnRzID0gYnVmZmVyOyAvLyB0aGlzIGlzIGEgc3ViYXJyYXkgb2YgdGhlIGhlYXAsIGFuZCB3ZSBjYW4gb3duIGl0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5jb250ZW50TW9kZSA9IE1FTUZTLkNPTlRFTlRfT1dOSU5HO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLmNvbnRlbnRzID0gbmV3IFVpbnQ4QXJyYXkoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlci5zdWJhcnJheShvZmZzZXQsIG9mZnNldCArIGxlbmd0aClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUuY29udGVudE1vZGUgPSBNRU1GUy5DT05URU5UX0ZJWEVEO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBNRU1GUy5lbnN1cmVGbGV4aWJsZShub2RlKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRlbnRzID0gbm9kZS5jb250ZW50cztcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGNvbnRlbnRzLmxlbmd0aCA8IHBvc2l0aW9uKSBjb250ZW50cy5wdXNoKDApO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50c1twb3NpdGlvbiArIGldID0gYnVmZmVyW29mZnNldCArIGldO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBsZW5ndGg7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBsbHNlZWs6IGZ1bmN0aW9uKHN0cmVhbSwgb2Zmc2V0LCB3aGVuY2UpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBvc2l0aW9uID0gb2Zmc2V0O1xuICAgICAgICAgICAgICAgICAgICBpZiAod2hlbmNlID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBTRUVLX0NVUi5cbiAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uICs9IHN0cmVhbS5wb3NpdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3aGVuY2UgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNFRUtfRU5ELlxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEZTLmlzRmlsZShzdHJlYW0ubm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uICs9IHN0cmVhbS5ub2RlLmNvbnRlbnRzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAocG9zaXRpb24gPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSU5WQUwpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHN0cmVhbS51bmdvdHRlbiA9IFtdO1xuICAgICAgICAgICAgICAgICAgICBzdHJlYW0ucG9zaXRpb24gPSBwb3NpdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBvc2l0aW9uO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgYWxsb2NhdGU6IGZ1bmN0aW9uKHN0cmVhbSwgb2Zmc2V0LCBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgTUVNRlMuZW5zdXJlRmxleGlibGUoc3RyZWFtLm5vZGUpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgY29udGVudHMgPSBzdHJlYW0ubm9kZS5jb250ZW50cztcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxpbWl0ID0gb2Zmc2V0ICsgbGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAobGltaXQgPiBjb250ZW50cy5sZW5ndGgpIGNvbnRlbnRzLnB1c2goMCk7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBtbWFwOiBmdW5jdGlvbihcbiAgICAgICAgICAgICAgICAgICAgc3RyZWFtLFxuICAgICAgICAgICAgICAgICAgICBidWZmZXIsXG4gICAgICAgICAgICAgICAgICAgIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbixcbiAgICAgICAgICAgICAgICAgICAgcHJvdCxcbiAgICAgICAgICAgICAgICAgICAgZmxhZ3NcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFGUy5pc0ZpbGUoc3RyZWFtLm5vZGUubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOT0RFVik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdmFyIHB0cjtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGFsbG9jYXRlZDtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRlbnRzID0gc3RyZWFtLm5vZGUuY29udGVudHM7XG4gICAgICAgICAgICAgICAgICAgIC8vIE9ubHkgbWFrZSBhIG5ldyBjb3B5IHdoZW4gTUFQX1BSSVZBVEUgaXMgc3BlY2lmaWVkLlxuICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAhKGZsYWdzICYgMikgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIChjb250ZW50cy5idWZmZXIgPT09IGJ1ZmZlciB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnRzLmJ1ZmZlciA9PT0gYnVmZmVyLmJ1ZmZlcilcbiAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBjYW4ndCBlbXVsYXRlIE1BUF9TSEFSRUQgd2hlbiB0aGUgZmlsZSBpcyBub3QgYmFja2VkIGJ5IHRoZSBidWZmZXJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlJ3JlIG1hcHBpbmcgdG8gKGUuZy4gdGhlIEhFQVAgYnVmZmVyKS5cbiAgICAgICAgICAgICAgICAgICAgICAgIGFsbG9jYXRlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgcHRyID0gY29udGVudHMuYnl0ZU9mZnNldDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRyeSB0byBhdm9pZCB1bm5lY2Vzc2FyeSBzbGljZXMuXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPiAwIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gKyBsZW5ndGggPCBjb250ZW50cy5sZW5ndGhcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb250ZW50cy5zdWJhcnJheSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50cyA9IGNvbnRlbnRzLnN1YmFycmF5KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiArIGxlbmd0aFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnRzID0gQXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50cyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gKyBsZW5ndGhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBhbGxvY2F0ZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgcHRyID0gX21hbGxvYyhsZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFwdHIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FTk9NRU0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLnNldChjb250ZW50cywgcHRyKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4geyBwdHI6IHB0ciwgYWxsb2NhdGVkOiBhbGxvY2F0ZWQgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIHZhciBJREJGUyA9IHtcbiAgICAgICAgICAgIGRiczoge30sXG4gICAgICAgICAgICBpbmRleGVkREI6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5pbmRleGVkREIgfHxcbiAgICAgICAgICAgICAgICAgICAgd2luZG93Lm1vekluZGV4ZWREQiB8fFxuICAgICAgICAgICAgICAgICAgICB3aW5kb3cud2Via2l0SW5kZXhlZERCIHx8XG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5tc0luZGV4ZWREQlxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgREJfVkVSU0lPTjogMjAsXG4gICAgICAgICAgICBEQl9TVE9SRV9OQU1FOiAnRklMRV9EQVRBJyxcbiAgICAgICAgICAgIG1vdW50OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gTUVNRlMubW91bnQuYXBwbHkobnVsbCwgYXJndW1lbnRzKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzeW5jZnM6IGZ1bmN0aW9uKG1vdW50LCBwb3B1bGF0ZSwgY2FsbGJhY2spIHtcbiAgICAgICAgICAgICAgICBJREJGUy5nZXRMb2NhbFNldChtb3VudCwgZnVuY3Rpb24oZXJyLCBsb2NhbCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoZXJyKSByZXR1cm4gY2FsbGJhY2soZXJyKTtcbiAgICAgICAgICAgICAgICAgICAgSURCRlMuZ2V0UmVtb3RlU2V0KG1vdW50LCBmdW5jdGlvbihlcnIsIHJlbW90ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVycikgcmV0dXJuIGNhbGxiYWNrKGVycik7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3JjID0gcG9wdWxhdGUgPyByZW1vdGUgOiBsb2NhbDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkc3QgPSBwb3B1bGF0ZSA/IGxvY2FsIDogcmVtb3RlO1xuICAgICAgICAgICAgICAgICAgICAgICAgSURCRlMucmVjb25jaWxlKHNyYywgZHN0LCBjYWxsYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHJlY29uY2lsZTogZnVuY3Rpb24oc3JjLCBkc3QsIGNhbGxiYWNrKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRvdGFsID0gMDtcbiAgICAgICAgICAgICAgICB2YXIgY3JlYXRlID0ge307XG4gICAgICAgICAgICAgICAgZm9yICh2YXIga2V5IGluIHNyYy5maWxlcykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXNyYy5maWxlcy5oYXNPd25Qcm9wZXJ0eShrZXkpKSBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGUgPSBzcmMuZmlsZXNba2V5XTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGUyID0gZHN0LmZpbGVzW2tleV07XG4gICAgICAgICAgICAgICAgICAgIGlmICghZTIgfHwgZS50aW1lc3RhbXAgPiBlMi50aW1lc3RhbXApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNyZWF0ZVtrZXldID0gZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvdGFsKys7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIHJlbW92ZSA9IHt9O1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGtleSBpbiBkc3QuZmlsZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFkc3QuZmlsZXMuaGFzT3duUHJvcGVydHkoa2V5KSkgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgIHZhciBlID0gZHN0LmZpbGVzW2tleV07XG4gICAgICAgICAgICAgICAgICAgIHZhciBlMiA9IHNyYy5maWxlc1trZXldO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWUyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVba2V5XSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICB0b3RhbCsrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghdG90YWwpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gZWFybHkgb3V0XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhudWxsKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIGNvbXBsZXRlZCA9IDA7XG4gICAgICAgICAgICAgICAgdmFyIGRvbmUgPSBmdW5jdGlvbihlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycikgcmV0dXJuIGNhbGxiYWNrKGVycik7XG4gICAgICAgICAgICAgICAgICAgIGlmICgrK2NvbXBsZXRlZCA+PSB0b3RhbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKG51bGwpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAvLyBjcmVhdGUgYSBzaW5nbGUgdHJhbnNhY3Rpb24gdG8gaGFuZGxlIGFuZCBJREIgcmVhZHMgLyB3cml0ZXMgd2UnbGwgbmVlZCB0byBkb1xuICAgICAgICAgICAgICAgIHZhciBkYiA9IHNyYy50eXBlID09PSAncmVtb3RlJyA/IHNyYy5kYiA6IGRzdC5kYjtcbiAgICAgICAgICAgICAgICB2YXIgdHJhbnNhY3Rpb24gPSBkYi50cmFuc2FjdGlvbihcbiAgICAgICAgICAgICAgICAgICAgW0lEQkZTLkRCX1NUT1JFX05BTUVdLFxuICAgICAgICAgICAgICAgICAgICAncmVhZHdyaXRlJ1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgdHJhbnNhY3Rpb24ub25lcnJvciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayh0aGlzLmVycm9yKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHZhciBzdG9yZSA9IHRyYW5zYWN0aW9uLm9iamVjdFN0b3JlKElEQkZTLkRCX1NUT1JFX05BTUUpO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIHBhdGggaW4gY3JlYXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghY3JlYXRlLmhhc093blByb3BlcnR5KHBhdGgpKSBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGVudHJ5ID0gY3JlYXRlW3BhdGhdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZHN0LnR5cGUgPT09ICdsb2NhbCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNhdmUgZmlsZSB0byBsb2NhbFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoRlMuaXNEaXIoZW50cnkubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlMubWtkaXIocGF0aCwgZW50cnkubW9kZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChGUy5pc0ZpbGUoZW50cnkubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN0cmVhbSA9IEZTLm9wZW4ocGF0aCwgJ3crJywgMG82NjYpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUy53cml0ZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudHJ5LmNvbnRlbnRzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudHJ5LmNvbnRlbnRzLmxlbmd0aCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnVlIC8qIGNhbk93biAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUy5jbG9zZShzdHJlYW0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb25lKG51bGwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkb25lKGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2F2ZSBmaWxlIHRvIElEQlxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcSA9IHN0b3JlLnB1dChlbnRyeSwgcGF0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXEub25zdWNjZXNzID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9uZShudWxsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICByZXEub25lcnJvciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvbmUodGhpcy5lcnJvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGZvciAodmFyIHBhdGggaW4gcmVtb3ZlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcmVtb3ZlLmhhc093blByb3BlcnR5KHBhdGgpKSBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGVudHJ5ID0gcmVtb3ZlW3BhdGhdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZHN0LnR5cGUgPT09ICdsb2NhbCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRlbGV0ZSBmaWxlIGZyb20gbG9jYWxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEZTLmlzRGlyKGVudHJ5Lm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPRE8gcmVjdXJzaXZlIGRlbGV0ZT9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlMucm1kaXIocGF0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChGUy5pc0ZpbGUoZW50cnkubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlMudW5saW5rKHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb25lKG51bGwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkb25lKGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZGVsZXRlIGZpbGUgZnJvbSBJREJcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXEgPSBzdG9yZS5kZWxldGUocGF0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXEub25zdWNjZXNzID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9uZShudWxsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICByZXEub25lcnJvciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvbmUodGhpcy5lcnJvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdldExvY2FsU2V0OiBmdW5jdGlvbihtb3VudCwgY2FsbGJhY2spIHtcbiAgICAgICAgICAgICAgICB2YXIgZmlsZXMgPSB7fTtcbiAgICAgICAgICAgICAgICB2YXIgaXNSZWFsRGlyID0gZnVuY3Rpb24ocCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcCAhPT0gJy4nICYmIHAgIT09ICcuLic7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB2YXIgdG9BYnNvbHV0ZSA9IGZ1bmN0aW9uKHJvb3QpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBQQVRILmpvaW4ocm9vdCwgcCk7XG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB2YXIgY2hlY2sgPSBGUy5yZWFkZGlyKG1vdW50Lm1vdW50cG9pbnQpXG4gICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoaXNSZWFsRGlyKVxuICAgICAgICAgICAgICAgICAgICAubWFwKHRvQWJzb2x1dGUobW91bnQubW91bnRwb2ludCkpO1xuICAgICAgICAgICAgICAgIHdoaWxlIChjaGVjay5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBhdGggPSBjaGVjay5wb3AoKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHN0YXQsIG5vZGU7XG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgbG9va3VwID0gRlMubG9va3VwUGF0aChwYXRoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUgPSBsb29rdXAubm9kZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXQgPSBGUy5zdGF0KHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2FsbGJhY2soZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKEZTLmlzRGlyKHN0YXQubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrLnB1c2guYXBwbHkoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hlY2ssXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRlMucmVhZGRpcihwYXRoKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZmlsdGVyKGlzUmVhbERpcilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm1hcCh0b0Fic29sdXRlKHBhdGgpKVxuICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVzW3BhdGhdID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGU6IHN0YXQubW9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lc3RhbXA6IHN0YXQubXRpbWVcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoRlMuaXNGaWxlKHN0YXQubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVzW3BhdGhdID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnRzOiBub2RlLmNvbnRlbnRzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGU6IHN0YXQubW9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lc3RhbXA6IHN0YXQubXRpbWVcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2FsbGJhY2sobmV3IEVycm9yKCdub2RlIHR5cGUgbm90IHN1cHBvcnRlZCcpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gY2FsbGJhY2sobnVsbCwgeyB0eXBlOiAnbG9jYWwnLCBmaWxlczogZmlsZXMgfSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZ2V0REI6IGZ1bmN0aW9uKG5hbWUsIGNhbGxiYWNrKSB7XG4gICAgICAgICAgICAgICAgLy8gbG9vayBpdCB1cCBpbiB0aGUgY2FjaGVcbiAgICAgICAgICAgICAgICB2YXIgZGIgPSBJREJGUy5kYnNbbmFtZV07XG4gICAgICAgICAgICAgICAgaWYgKGRiKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhudWxsLCBkYik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciByZXE7XG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgcmVxID0gSURCRlMuaW5kZXhlZERCKCkub3BlbihuYW1lLCBJREJGUy5EQl9WRVJTSU9OKTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBvbmVycm9yKGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXEub251cGdyYWRlbmVlZGVkID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIGRiID0gcmVxLnJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgZGIuY3JlYXRlT2JqZWN0U3RvcmUoSURCRlMuREJfU1RPUkVfTkFNRSk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICByZXEub25zdWNjZXNzID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIGRiID0gcmVxLnJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgLy8gYWRkIHRvIHRoZSBjYWNoZVxuICAgICAgICAgICAgICAgICAgICBJREJGUy5kYnNbbmFtZV0gPSBkYjtcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2sobnVsbCwgZGIpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgcmVxLm9uZXJyb3IgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2sodGhpcy5lcnJvcik7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBnZXRSZW1vdGVTZXQ6IGZ1bmN0aW9uKG1vdW50LCBjYWxsYmFjaykge1xuICAgICAgICAgICAgICAgIHZhciBmaWxlcyA9IHt9O1xuICAgICAgICAgICAgICAgIElEQkZTLmdldERCKG1vdW50Lm1vdW50cG9pbnQsIGZ1bmN0aW9uKGVyciwgZGIpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycikgcmV0dXJuIGNhbGxiYWNrKGVycik7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0cmFuc2FjdGlvbiA9IGRiLnRyYW5zYWN0aW9uKFxuICAgICAgICAgICAgICAgICAgICAgICAgW0lEQkZTLkRCX1NUT1JFX05BTUVdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlYWRvbmx5J1xuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICB0cmFuc2FjdGlvbi5vbmVycm9yID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayh0aGlzLmVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHN0b3JlID0gdHJhbnNhY3Rpb24ub2JqZWN0U3RvcmUoSURCRlMuREJfU1RPUkVfTkFNRSk7XG4gICAgICAgICAgICAgICAgICAgIHN0b3JlLm9wZW5DdXJzb3IoKS5vbnN1Y2Nlc3MgPSBmdW5jdGlvbihldmVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnNvciA9IGV2ZW50LnRhcmdldC5yZXN1bHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWN1cnNvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhudWxsLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdyZW1vdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYjogZGIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVzOiBmaWxlc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZmlsZXNbY3Vyc29yLmtleV0gPSBjdXJzb3IudmFsdWU7XG4gICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3IuY29udGludWUoKTtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgdmFyIE5PREVGUyA9IHtcbiAgICAgICAgICAgIG1vdW50OiBmdW5jdGlvbigpIHt9LFxuICAgICAgICAgICAgY3JlYXRlTm9kZTogZnVuY3Rpb24ocGFyZW50LCBuYW1lLCBtb2RlLCBkZXYpIHtcbiAgICAgICAgICAgICAgICBpZiAoIUZTLmlzRGlyKG1vZGUpICYmICFGUy5pc0ZpbGUobW9kZSkgJiYgIUZTLmlzTGluayhtb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSU5WQUwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgbm9kZSA9IEZTLmNyZWF0ZU5vZGUocGFyZW50LCBuYW1lLCBtb2RlKTtcbiAgICAgICAgICAgICAgICBub2RlLm5vZGVfb3BzID0gTk9ERUZTLm5vZGVfb3BzO1xuICAgICAgICAgICAgICAgIG5vZGUuc3RyZWFtX29wcyA9IE5PREVGUy5zdHJlYW1fb3BzO1xuICAgICAgICAgICAgICAgIHJldHVybiBub2RlO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdldE1vZGU6IGZ1bmN0aW9uKHBhdGgpIHtcbiAgICAgICAgICAgICAgICB2YXIgc3RhdDtcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBzdGF0ID0gZnMubHN0YXRTeW5jKHBhdGgpO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFlLmNvZGUpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTW2UuY29kZV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gc3RhdC5tb2RlO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHJlYWxQYXRoOiBmdW5jdGlvbihub2RlKSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhcnRzID0gW107XG4gICAgICAgICAgICAgICAgd2hpbGUgKG5vZGUucGFyZW50ICE9PSBub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgIHBhcnRzLnB1c2gobm9kZS5uYW1lKTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZSA9IG5vZGUucGFyZW50O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBwYXJ0cy5wdXNoKG5vZGUubW91bnQub3B0cy5yb290KTtcbiAgICAgICAgICAgICAgICBwYXJ0cy5yZXZlcnNlKCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFBBVEguam9pbi5hcHBseShudWxsLCBwYXJ0cyk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbm9kZV9vcHM6IHtcbiAgICAgICAgICAgICAgICBnZXRhdHRyOiBmdW5jdGlvbihub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXRoID0gTk9ERUZTLnJlYWxQYXRoKG5vZGUpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgc3RhdDtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXQgPSBmcy5sc3RhdFN5bmMocGF0aCk7XG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZS5jb2RlKSB0aHJvdyBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVNbZS5jb2RlXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRldjogc3RhdC5kZXYsXG4gICAgICAgICAgICAgICAgICAgICAgICBpbm86IHN0YXQuaW5vLFxuICAgICAgICAgICAgICAgICAgICAgICAgbW9kZTogc3RhdC5tb2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbmxpbms6IHN0YXQubmxpbmssXG4gICAgICAgICAgICAgICAgICAgICAgICB1aWQ6IHN0YXQudWlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgZ2lkOiBzdGF0LmdpZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJkZXY6IHN0YXQucmRldixcbiAgICAgICAgICAgICAgICAgICAgICAgIHNpemU6IHN0YXQuc2l6ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGF0aW1lOiBzdGF0LmF0aW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgbXRpbWU6IHN0YXQubXRpbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBjdGltZTogc3RhdC5jdGltZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJsa3NpemU6IHN0YXQuYmxrc2l6ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJsb2Nrczogc3RhdC5ibG9ja3NcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHNldGF0dHI6IGZ1bmN0aW9uKG5vZGUsIGF0dHIpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBhdGggPSBOT0RFRlMucmVhbFBhdGgobm9kZSk7XG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXR0ci5tb2RlICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcy5jaG1vZFN5bmMocGF0aCwgYXR0ci5tb2RlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB1cGRhdGUgdGhlIGNvbW1vbiBub2RlIHN0cnVjdHVyZSBtb2RlIGFzIHdlbGxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLm1vZGUgPSBhdHRyLm1vZGU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXR0ci50aW1lc3RhbXAgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkYXRlID0gbmV3IERhdGUoYXR0ci50aW1lc3RhbXApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZzLnV0aW1lc1N5bmMocGF0aCwgZGF0ZSwgZGF0ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXR0ci5zaXplICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcy50cnVuY2F0ZVN5bmMocGF0aCwgYXR0ci5zaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlLmNvZGUpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFU1tlLmNvZGVdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgbG9va3VwOiBmdW5jdGlvbihwYXJlbnQsIG5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBhdGggPSBQQVRILmpvaW4oTk9ERUZTLnJlYWxQYXRoKHBhcmVudCksIG5hbWUpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgbW9kZSA9IE5PREVGUy5nZXRNb2RlKHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gTk9ERUZTLmNyZWF0ZU5vZGUocGFyZW50LCBuYW1lLCBtb2RlKTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIG1rbm9kOiBmdW5jdGlvbihwYXJlbnQsIG5hbWUsIG1vZGUsIGRldikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbm9kZSA9IE5PREVGUy5jcmVhdGVOb2RlKHBhcmVudCwgbmFtZSwgbW9kZSwgZGV2KTtcbiAgICAgICAgICAgICAgICAgICAgLy8gY3JlYXRlIHRoZSBiYWNraW5nIG5vZGUgZm9yIHRoaXMgaW4gdGhlIGZzIHJvb3QgYXMgd2VsbFxuICAgICAgICAgICAgICAgICAgICB2YXIgcGF0aCA9IE5PREVGUy5yZWFsUGF0aChub2RlKTtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGUy5pc0Rpcihub2RlLm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnMubWtkaXJTeW5jKHBhdGgsIG5vZGUubW9kZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZzLndyaXRlRmlsZVN5bmMocGF0aCwgJycsIHsgbW9kZTogbm9kZS5tb2RlIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWUuY29kZSkgdGhyb3cgZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTW2UuY29kZV0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBub2RlO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgcmVuYW1lOiBmdW5jdGlvbihvbGROb2RlLCBuZXdEaXIsIG5ld05hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG9sZFBhdGggPSBOT0RFRlMucmVhbFBhdGgob2xkTm9kZSk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBuZXdQYXRoID0gUEFUSC5qb2luKE5PREVGUy5yZWFsUGF0aChuZXdEaXIpLCBuZXdOYW1lKTtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZzLnJlbmFtZVN5bmMob2xkUGF0aCwgbmV3UGF0aCk7XG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZS5jb2RlKSB0aHJvdyBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVNbZS5jb2RlXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHVubGluazogZnVuY3Rpb24ocGFyZW50LCBuYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXRoID0gUEFUSC5qb2luKE5PREVGUy5yZWFsUGF0aChwYXJlbnQpLCBuYW1lKTtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZzLnVubGlua1N5bmMocGF0aCk7XG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZS5jb2RlKSB0aHJvdyBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVNbZS5jb2RlXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHJtZGlyOiBmdW5jdGlvbihwYXJlbnQsIG5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBhdGggPSBQQVRILmpvaW4oTk9ERUZTLnJlYWxQYXRoKHBhcmVudCksIG5hbWUpO1xuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZnMucm1kaXJTeW5jKHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWUuY29kZSkgdGhyb3cgZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTW2UuY29kZV0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICByZWFkZGlyOiBmdW5jdGlvbihub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXRoID0gTk9ERUZTLnJlYWxQYXRoKG5vZGUpO1xuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZzLnJlYWRkaXJTeW5jKHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWUuY29kZSkgdGhyb3cgZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTW2UuY29kZV0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBzeW1saW5rOiBmdW5jdGlvbihwYXJlbnQsIG5ld05hbWUsIG9sZFBhdGgpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG5ld1BhdGggPSBQQVRILmpvaW4oTk9ERUZTLnJlYWxQYXRoKHBhcmVudCksIG5ld05hbWUpO1xuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZnMuc3ltbGlua1N5bmMob2xkUGF0aCwgbmV3UGF0aCk7XG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZS5jb2RlKSB0aHJvdyBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVNbZS5jb2RlXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHJlYWRsaW5rOiBmdW5jdGlvbihub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXRoID0gTk9ERUZTLnJlYWxQYXRoKG5vZGUpO1xuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZzLnJlYWRsaW5rU3luYyhwYXRoKTtcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlLmNvZGUpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFU1tlLmNvZGVdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzdHJlYW1fb3BzOiB7XG4gICAgICAgICAgICAgICAgb3BlbjogZnVuY3Rpb24oc3RyZWFtKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXRoID0gTk9ERUZTLnJlYWxQYXRoKHN0cmVhbS5ub2RlKTtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGUy5pc0ZpbGUoc3RyZWFtLm5vZGUubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW0ubmZkID0gZnMub3BlblN5bmMocGF0aCwgc3RyZWFtLmZsYWdzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlLmNvZGUpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFU1tlLmNvZGVdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgY2xvc2U6IGZ1bmN0aW9uKHN0cmVhbSkge1xuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEZTLmlzRmlsZShzdHJlYW0ubm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZzLmNsb3NlU3luYyhzdHJlYW0ubmZkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlLmNvZGUpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFU1tlLmNvZGVdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgcmVhZDogZnVuY3Rpb24oc3RyZWFtLCBidWZmZXIsIG9mZnNldCwgbGVuZ3RoLCBwb3NpdGlvbikge1xuICAgICAgICAgICAgICAgICAgICAvLyBGSVhNRSB0aGlzIGlzIHRlcnJpYmxlLlxuICAgICAgICAgICAgICAgICAgICB2YXIgbmJ1ZmZlciA9IG5ldyBCdWZmZXIobGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlcztcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcyA9IGZzLnJlYWRTeW5jKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbS5uZmQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmJ1ZmZlcixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVNbZS5jb2RlXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcmVzOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWZmZXJbb2Zmc2V0ICsgaV0gPSBuYnVmZmVyW2ldO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXM7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB3cml0ZTogZnVuY3Rpb24oc3RyZWFtLCBidWZmZXIsIG9mZnNldCwgbGVuZ3RoLCBwb3NpdGlvbikge1xuICAgICAgICAgICAgICAgICAgICAvLyBGSVhNRSB0aGlzIGlzIHRlcnJpYmxlLlxuICAgICAgICAgICAgICAgICAgICB2YXIgbmJ1ZmZlciA9IG5ldyBCdWZmZXIoXG4gICAgICAgICAgICAgICAgICAgICAgICBidWZmZXIuc3ViYXJyYXkob2Zmc2V0LCBvZmZzZXQgKyBsZW5ndGgpXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIHZhciByZXM7XG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXMgPSBmcy53cml0ZVN5bmMoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtLm5mZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYnVmZmVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uXG4gICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFU1tlLmNvZGVdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgbGxzZWVrOiBmdW5jdGlvbihzdHJlYW0sIG9mZnNldCwgd2hlbmNlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwb3NpdGlvbiA9IG9mZnNldDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHdoZW5jZSA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gU0VFS19DVVIuXG4gICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiArPSBzdHJlYW0ucG9zaXRpb247XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAod2hlbmNlID09PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBTRUVLX0VORC5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGUy5pc0ZpbGUoc3RyZWFtLm5vZGUubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3RhdCA9IGZzLmZzdGF0U3luYyhzdHJlYW0ubmZkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gKz0gc3RhdC5zaXplO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVNbZS5jb2RlXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChwb3NpdGlvbiA8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlZBTCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgc3RyZWFtLnBvc2l0aW9uID0gcG9zaXRpb247XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwb3NpdGlvbjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIHZhciBfc3RkaW4gPSBhbGxvY2F0ZSgxLCAnaTMyKicsIEFMTE9DX1NUQVRJQyk7XG4gICAgICAgIHZhciBfc3Rkb3V0ID0gYWxsb2NhdGUoMSwgJ2kzMionLCBBTExPQ19TVEFUSUMpO1xuICAgICAgICB2YXIgX3N0ZGVyciA9IGFsbG9jYXRlKDEsICdpMzIqJywgQUxMT0NfU1RBVElDKTtcbiAgICAgICAgZnVuY3Rpb24gX2ZmbHVzaChzdHJlYW0pIHtcbiAgICAgICAgICAgIC8vIGludCBmZmx1c2goRklMRSAqc3RyZWFtKTtcbiAgICAgICAgICAgIC8vIGh0dHA6Ly9wdWJzLm9wZW5ncm91cC5vcmcvb25saW5lcHVicy8wMDAwOTUzOTkvZnVuY3Rpb25zL2ZmbHVzaC5odG1sXG4gICAgICAgICAgICAvLyB3ZSBkb24ndCBjdXJyZW50bHkgcGVyZm9ybSBhbnkgdXNlci1zcGFjZSBidWZmZXJpbmcgb2YgZGF0YVxuICAgICAgICB9XG4gICAgICAgIHZhciBGUyA9IHtcbiAgICAgICAgICAgIHJvb3Q6IG51bGwsXG4gICAgICAgICAgICBtb3VudHM6IFtdLFxuICAgICAgICAgICAgZGV2aWNlczogW251bGxdLFxuICAgICAgICAgICAgc3RyZWFtczogW251bGxdLFxuICAgICAgICAgICAgbmV4dElub2RlOiAxLFxuICAgICAgICAgICAgbmFtZVRhYmxlOiBudWxsLFxuICAgICAgICAgICAgY3VycmVudFBhdGg6ICcvJyxcbiAgICAgICAgICAgIGluaXRpYWxpemVkOiBmYWxzZSxcbiAgICAgICAgICAgIGlnbm9yZVBlcm1pc3Npb25zOiB0cnVlLFxuICAgICAgICAgICAgLy8gZXJyb3IgaW5zdGFuY2VcbiAgICAgICAgICAgIEVycm5vRXJyb3I6IGZ1bmN0aW9uIEVycm5vRXJyb3IoZXJyb3JOdW1iZXIsIGRldGFpbHMpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmVycm9yTnVtYmVyID0gZXJyb3JOdW1iZXI7XG4gICAgICAgICAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gRVJSTk9fQ09ERVMpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKEVSUk5PX0NPREVTW2tleV0gPT09IGVycm9yTnVtYmVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyByZW1vdmUgdGhlIHByZWZpeCAnRSdcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY29kZSA9IGtleS5zdWJzdHJpbmcoMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLm1lc3NhZ2UgPSBFUlJOT19NRVNTQUdFU1tlcnJvck51bWJlcl07XG4gICAgICAgICAgICAgICAgdGhpcy5kZXRhaWxzID0gZGV0YWlscyB8fCAnJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBoYW5kbGVGU0Vycm9yOiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCEoZSBpbnN0YW5jZW9mIEZTLkVycm5vRXJyb3IpKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBlICsgJyA6ICcgKyBuZXcgRXJyb3IoKS5zdGFjaztcbiAgICAgICAgICAgICAgICByZXR1cm4gX19fc2V0RXJyTm8oZS5lcnJubyk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbG9va3VwUGF0aDogZnVuY3Rpb24ocGF0aCwgb3B0cykge1xuICAgICAgICAgICAgICAgIHBhdGggPSBQQVRILnJlc29sdmUoRlMuY3dkKCksIHBhdGgpO1xuICAgICAgICAgICAgICAgIG9wdHMgPSBvcHRzIHx8IHsgcmVjdXJzZV9jb3VudDogMCB9O1xuICAgICAgICAgICAgICAgIGlmIChvcHRzLnJlY3Vyc2VfY291bnQgPiA4KSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIG1heCByZWN1cnNpdmUgbG9va3VwIG9mIDhcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUxPT1ApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBzcGxpdCB0aGUgcGF0aFxuICAgICAgICAgICAgICAgIHZhciBwYXJ0cyA9IFBBVEgubm9ybWFsaXplQXJyYXkoXG4gICAgICAgICAgICAgICAgICAgIHBhdGguc3BsaXQoJy8nKS5maWx0ZXIoZnVuY3Rpb24ocCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICEhcDtcbiAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICAgIGZhbHNlXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAvLyBzdGFydCBhdCB0aGUgcm9vdFxuICAgICAgICAgICAgICAgIHZhciBjdXJyZW50ID0gRlMucm9vdDtcbiAgICAgICAgICAgICAgICB2YXIgY3VycmVudF9wYXRoID0gJy8nO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcGFydHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGlzbGFzdCA9IGkgPT09IHBhcnRzLmxlbmd0aCAtIDE7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc2xhc3QgJiYgb3B0cy5wYXJlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN0b3AgcmVzb2x2aW5nXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjdXJyZW50ID0gRlMubG9va3VwTm9kZShjdXJyZW50LCBwYXJ0c1tpXSk7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfcGF0aCA9IFBBVEguam9pbihjdXJyZW50X3BhdGgsIHBhcnRzW2ldKTtcbiAgICAgICAgICAgICAgICAgICAgLy8ganVtcCB0byB0aGUgbW91bnQncyByb290IG5vZGUgaWYgdGhpcyBpcyBhIG1vdW50cG9pbnRcbiAgICAgICAgICAgICAgICAgICAgaWYgKEZTLmlzTW91bnRwb2ludChjdXJyZW50KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudCA9IGN1cnJlbnQubW91bnQucm9vdDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBmb2xsb3cgc3ltbGlua3NcbiAgICAgICAgICAgICAgICAgICAgLy8gYnkgZGVmYXVsdCwgbG9va3VwUGF0aCB3aWxsIG5vdCBmb2xsb3cgYSBzeW1saW5rIGlmIGl0IGlzIHRoZSBmaW5hbCBwYXRoIGNvbXBvbmVudC5cbiAgICAgICAgICAgICAgICAgICAgLy8gc2V0dGluZyBvcHRzLmZvbGxvdyA9IHRydWUgd2lsbCBvdmVycmlkZSB0aGlzIGJlaGF2aW9yLlxuICAgICAgICAgICAgICAgICAgICBpZiAoIWlzbGFzdCB8fCBvcHRzLmZvbGxvdykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvdW50ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChGUy5pc0xpbmsoY3VycmVudC5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5rID0gRlMucmVhZGxpbmsoY3VycmVudF9wYXRoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50X3BhdGggPSBQQVRILnJlc29sdmUoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBBVEguZGlybmFtZShjdXJyZW50X3BhdGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5rXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbG9va3VwID0gRlMubG9va3VwUGF0aChjdXJyZW50X3BhdGgsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjdXJzZV9jb3VudDogb3B0cy5yZWN1cnNlX2NvdW50XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudCA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb3VudCsrID4gNDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbGltaXQgbWF4IGNvbnNlY3V0aXZlIHN5bWxpbmtzIHRvIDQwIChTWU1MT09QX01BWCkuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVMT09QKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHsgcGF0aDogY3VycmVudF9wYXRoLCBub2RlOiBjdXJyZW50IH07XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZ2V0UGF0aDogZnVuY3Rpb24obm9kZSkge1xuICAgICAgICAgICAgICAgIHZhciBwYXRoO1xuICAgICAgICAgICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChGUy5pc1Jvb3Qobm9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwYXRoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBQQVRILmpvaW4obm9kZS5tb3VudC5tb3VudHBvaW50LCBwYXRoKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbm9kZS5tb3VudC5tb3VudHBvaW50O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHBhdGggPSBwYXRoID8gUEFUSC5qb2luKG5vZGUubmFtZSwgcGF0aCkgOiBub2RlLm5hbWU7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUgPSBub2RlLnBhcmVudDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaGFzaE5hbWU6IGZ1bmN0aW9uKHBhcmVudGlkLCBuYW1lKSB7XG4gICAgICAgICAgICAgICAgdmFyIGhhc2ggPSAwO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbmFtZS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBoYXNoID0gKChoYXNoIDw8IDUpIC0gaGFzaCArIG5hbWUuY2hhckNvZGVBdChpKSkgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gKChwYXJlbnRpZCArIGhhc2gpID4+PiAwKSAlIEZTLm5hbWVUYWJsZS5sZW5ndGg7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaGFzaEFkZE5vZGU6IGZ1bmN0aW9uKG5vZGUpIHtcbiAgICAgICAgICAgICAgICB2YXIgaGFzaCA9IEZTLmhhc2hOYW1lKG5vZGUucGFyZW50LmlkLCBub2RlLm5hbWUpO1xuICAgICAgICAgICAgICAgIG5vZGUubmFtZV9uZXh0ID0gRlMubmFtZVRhYmxlW2hhc2hdO1xuICAgICAgICAgICAgICAgIEZTLm5hbWVUYWJsZVtoYXNoXSA9IG5vZGU7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaGFzaFJlbW92ZU5vZGU6IGZ1bmN0aW9uKG5vZGUpIHtcbiAgICAgICAgICAgICAgICB2YXIgaGFzaCA9IEZTLmhhc2hOYW1lKG5vZGUucGFyZW50LmlkLCBub2RlLm5hbWUpO1xuICAgICAgICAgICAgICAgIGlmIChGUy5uYW1lVGFibGVbaGFzaF0gPT09IG5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgRlMubmFtZVRhYmxlW2hhc2hdID0gbm9kZS5uYW1lX25leHQ7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnJlbnQgPSBGUy5uYW1lVGFibGVbaGFzaF07XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlIChjdXJyZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudC5uYW1lX25leHQgPT09IG5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50Lm5hbWVfbmV4dCA9IG5vZGUubmFtZV9uZXh0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudCA9IGN1cnJlbnQubmFtZV9uZXh0O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxvb2t1cE5vZGU6IGZ1bmN0aW9uKHBhcmVudCwgbmFtZSkge1xuICAgICAgICAgICAgICAgIHZhciBlcnIgPSBGUy5tYXlMb29rdXAocGFyZW50KTtcbiAgICAgICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKGVyciwgbmFtZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBoYXNoID0gRlMuaGFzaE5hbWUocGFyZW50LmlkLCBuYW1lKTtcbiAgICAgICAgICAgICAgICBmb3IgKFxuICAgICAgICAgICAgICAgICAgICB2YXIgbm9kZSA9IEZTLm5hbWVUYWJsZVtoYXNoXTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZSA9IG5vZGUubmFtZV9uZXh0XG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBub2RlTmFtZSA9IG5vZGUubmFtZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG5vZGUucGFyZW50LmlkID09PSBwYXJlbnQuaWQgJiYgbm9kZU5hbWUgPT09IG5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBub2RlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGlmIHdlIGZhaWxlZCB0byBmaW5kIGl0IGluIHRoZSBjYWNoZSwgY2FsbCBpbnRvIHRoZSBWRlNcbiAgICAgICAgICAgICAgICByZXR1cm4gRlMubG9va3VwKHBhcmVudCwgbmFtZSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY3JlYXRlTm9kZTogZnVuY3Rpb24ocGFyZW50LCBuYW1lLCBtb2RlLCByZGV2KSB7XG4gICAgICAgICAgICAgICAgdmFyIG5vZGUgPSB7XG4gICAgICAgICAgICAgICAgICAgIGlkOiBGUy5uZXh0SW5vZGUrKyxcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogbmFtZSxcbiAgICAgICAgICAgICAgICAgICAgbW9kZTogbW9kZSxcbiAgICAgICAgICAgICAgICAgICAgbm9kZV9vcHM6IHt9LFxuICAgICAgICAgICAgICAgICAgICBzdHJlYW1fb3BzOiB7fSxcbiAgICAgICAgICAgICAgICAgICAgcmRldjogcmRldixcbiAgICAgICAgICAgICAgICAgICAgcGFyZW50OiBudWxsLFxuICAgICAgICAgICAgICAgICAgICBtb3VudDogbnVsbFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgaWYgKCFwYXJlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyZW50ID0gbm9kZTsgLy8gcm9vdCBub2RlIHNldHMgcGFyZW50IHRvIGl0c2VsZlxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBub2RlLnBhcmVudCA9IHBhcmVudDtcbiAgICAgICAgICAgICAgICBub2RlLm1vdW50ID0gcGFyZW50Lm1vdW50O1xuICAgICAgICAgICAgICAgIC8vIGNvbXBhdGliaWxpdHlcbiAgICAgICAgICAgICAgICB2YXIgcmVhZE1vZGUgPSAyOTIgfCA3MztcbiAgICAgICAgICAgICAgICB2YXIgd3JpdGVNb2RlID0gMTQ2O1xuICAgICAgICAgICAgICAgIC8vIE5PVEUgd2UgbXVzdCB1c2UgT2JqZWN0LmRlZmluZVByb3BlcnRpZXMgaW5zdGVhZCBvZiBpbmRpdmlkdWFsIGNhbGxzIHRvXG4gICAgICAgICAgICAgICAgLy8gT2JqZWN0LmRlZmluZVByb3BlcnR5IGluIG9yZGVyIHRvIG1ha2UgY2xvc3VyZSBjb21waWxlciBoYXBweVxuICAgICAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0aWVzKG5vZGUsIHtcbiAgICAgICAgICAgICAgICAgICAgcmVhZDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgZ2V0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKG5vZGUubW9kZSAmIHJlYWRNb2RlKSA9PT0gcmVhZE1vZGU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0OiBmdW5jdGlvbih2YWwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAobm9kZS5tb2RlIHw9IHJlYWRNb2RlKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChub2RlLm1vZGUgJj0gfnJlYWRNb2RlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgd3JpdGU6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGdldDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChub2RlLm1vZGUgJiB3cml0ZU1vZGUpID09PSB3cml0ZU1vZGU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0OiBmdW5jdGlvbih2YWwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAobm9kZS5tb2RlIHw9IHdyaXRlTW9kZSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAobm9kZS5tb2RlICY9IH53cml0ZU1vZGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBpc0ZvbGRlcjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgZ2V0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gRlMuaXNEaXIobm9kZS5tb2RlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgaXNEZXZpY2U6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGdldDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEZTLmlzQ2hyZGV2KG5vZGUubW9kZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBGUy5oYXNoQWRkTm9kZShub2RlKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBkZXN0cm95Tm9kZTogZnVuY3Rpb24obm9kZSkge1xuICAgICAgICAgICAgICAgIEZTLmhhc2hSZW1vdmVOb2RlKG5vZGUpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGlzUm9vdDogZnVuY3Rpb24obm9kZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBub2RlID09PSBub2RlLnBhcmVudDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBpc01vdW50cG9pbnQ6IGZ1bmN0aW9uKG5vZGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZS5tb3VudGVkO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGlzRmlsZTogZnVuY3Rpb24obW9kZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAobW9kZSAmIDYxNDQwKSA9PT0gMzI3Njg7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaXNEaXI6IGZ1bmN0aW9uKG1vZGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKG1vZGUgJiA2MTQ0MCkgPT09IDE2Mzg0O1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGlzTGluazogZnVuY3Rpb24obW9kZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAobW9kZSAmIDYxNDQwKSA9PT0gNDA5NjA7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaXNDaHJkZXY6IGZ1bmN0aW9uKG1vZGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKG1vZGUgJiA2MTQ0MCkgPT09IDgxOTI7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaXNCbGtkZXY6IGZ1bmN0aW9uKG1vZGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKG1vZGUgJiA2MTQ0MCkgPT09IDI0NTc2O1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGlzRklGTzogZnVuY3Rpb24obW9kZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAobW9kZSAmIDYxNDQwKSA9PT0gNDA5NjtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBpc1NvY2tldDogZnVuY3Rpb24obW9kZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAobW9kZSAmIDQ5MTUyKSA9PT0gNDkxNTI7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZmxhZ01vZGVzOiB7XG4gICAgICAgICAgICAgICAgcjogMCxcbiAgICAgICAgICAgICAgICByczogMTA1MjY3MixcbiAgICAgICAgICAgICAgICAncisnOiAyLFxuICAgICAgICAgICAgICAgIHc6IDU3NyxcbiAgICAgICAgICAgICAgICB3eDogNzA1LFxuICAgICAgICAgICAgICAgIHh3OiA3MDUsXG4gICAgICAgICAgICAgICAgJ3crJzogNTc4LFxuICAgICAgICAgICAgICAgICd3eCsnOiA3MDYsXG4gICAgICAgICAgICAgICAgJ3h3Kyc6IDcwNixcbiAgICAgICAgICAgICAgICBhOiAxMDg5LFxuICAgICAgICAgICAgICAgIGF4OiAxMjE3LFxuICAgICAgICAgICAgICAgIHhhOiAxMjE3LFxuICAgICAgICAgICAgICAgICdhKyc6IDEwOTAsXG4gICAgICAgICAgICAgICAgJ2F4Kyc6IDEyMTgsXG4gICAgICAgICAgICAgICAgJ3hhKyc6IDEyMThcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBtb2RlU3RyaW5nVG9GbGFnczogZnVuY3Rpb24oc3RyKSB7XG4gICAgICAgICAgICAgICAgdmFyIGZsYWdzID0gRlMuZmxhZ01vZGVzW3N0cl07XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBmbGFncyA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdVbmtub3duIGZpbGUgb3BlbiBtb2RlOiAnICsgc3RyKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZsYWdzO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGZsYWdzVG9QZXJtaXNzaW9uU3RyaW5nOiBmdW5jdGlvbihmbGFnKSB7XG4gICAgICAgICAgICAgICAgdmFyIGFjY21vZGUgPSBmbGFnICYgMjA5NzE1NTtcbiAgICAgICAgICAgICAgICB2YXIgcGVybXMgPSBbJ3InLCAndycsICdydyddW2FjY21vZGVdO1xuICAgICAgICAgICAgICAgIGlmIChmbGFnICYgNTEyKSB7XG4gICAgICAgICAgICAgICAgICAgIHBlcm1zICs9ICd3JztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBlcm1zO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG5vZGVQZXJtaXNzaW9uczogZnVuY3Rpb24obm9kZSwgcGVybXMpIHtcbiAgICAgICAgICAgICAgICBpZiAoRlMuaWdub3JlUGVybWlzc2lvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIHJldHVybiAwIGlmIGFueSB1c2VyLCBncm91cCBvciBvd25lciBiaXRzIGFyZSBzZXQuXG4gICAgICAgICAgICAgICAgaWYgKHBlcm1zLmluZGV4T2YoJ3InKSAhPT0gLTEgJiYgIShub2RlLm1vZGUgJiAyOTIpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBFUlJOT19DT0RFUy5FQUNDRVM7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwZXJtcy5pbmRleE9mKCd3JykgIT09IC0xICYmICEobm9kZS5tb2RlICYgMTQ2KSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gRVJSTk9fQ09ERVMuRUFDQ0VTO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocGVybXMuaW5kZXhPZigneCcpICE9PSAtMSAmJiAhKG5vZGUubW9kZSAmIDczKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gRVJSTk9fQ09ERVMuRUFDQ0VTO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBtYXlMb29rdXA6IGZ1bmN0aW9uKGRpcikge1xuICAgICAgICAgICAgICAgIHJldHVybiBGUy5ub2RlUGVybWlzc2lvbnMoZGlyLCAneCcpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG1heUNyZWF0ZTogZnVuY3Rpb24oZGlyLCBuYW1lKSB7XG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgRlMubG9va3VwTm9kZShkaXIsIG5hbWUpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gRVJSTk9fQ09ERVMuRUVYSVNUO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XG4gICAgICAgICAgICAgICAgcmV0dXJuIEZTLm5vZGVQZXJtaXNzaW9ucyhkaXIsICd3eCcpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG1heURlbGV0ZTogZnVuY3Rpb24oZGlyLCBuYW1lLCBpc2Rpcikge1xuICAgICAgICAgICAgICAgIHZhciBub2RlO1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUgPSBGUy5sb29rdXBOb2RlKGRpciwgbmFtZSk7XG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZS5lcnJubztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIGVyciA9IEZTLm5vZGVQZXJtaXNzaW9ucyhkaXIsICd3eCcpO1xuICAgICAgICAgICAgICAgIGlmIChlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVycjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzZGlyKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghRlMuaXNEaXIobm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk5PX0NPREVTLkVOT1RESVI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKEZTLmlzUm9vdChub2RlKSB8fCBGUy5nZXRQYXRoKG5vZGUpID09PSBGUy5jd2QoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk5PX0NPREVTLkVCVVNZO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKEZTLmlzRGlyKG5vZGUubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBFUlJOT19DT0RFUy5FSVNESVI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbWF5T3BlbjogZnVuY3Rpb24obm9kZSwgZmxhZ3MpIHtcbiAgICAgICAgICAgICAgICBpZiAoIW5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk5PX0NPREVTLkVOT0VOVDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKEZTLmlzTGluayhub2RlLm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBFUlJOT19DT0RFUy5FTE9PUDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKEZTLmlzRGlyKG5vZGUubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgKGZsYWdzICYgMjA5NzE1NSkgIT09IDAgfHwgLy8gb3BlbmluZyBmb3Igd3JpdGVcbiAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdzICYgNTEyXG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk5PX0NPREVTLkVJU0RJUjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gRlMubm9kZVBlcm1pc3Npb25zKFxuICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICBGUy5mbGFnc1RvUGVybWlzc2lvblN0cmluZyhmbGFncylcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIE1BWF9PUEVOX0ZEUzogNDA5NixcbiAgICAgICAgICAgIG5leHRmZDogZnVuY3Rpb24oZmRfc3RhcnQsIGZkX2VuZCkge1xuICAgICAgICAgICAgICAgIGZkX3N0YXJ0ID0gZmRfc3RhcnQgfHwgMTtcbiAgICAgICAgICAgICAgICBmZF9lbmQgPSBmZF9lbmQgfHwgRlMuTUFYX09QRU5fRkRTO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGZkID0gZmRfc3RhcnQ7IGZkIDw9IGZkX2VuZDsgZmQrKykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIUZTLnN0cmVhbXNbZmRdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRU1GSUxFKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBnZXRTdHJlYW06IGZ1bmN0aW9uKGZkKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEZTLnN0cmVhbXNbZmRdO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNyZWF0ZVN0cmVhbTogZnVuY3Rpb24oc3RyZWFtLCBmZF9zdGFydCwgZmRfZW5kKSB7XG4gICAgICAgICAgICAgICAgdmFyIGZkID0gRlMubmV4dGZkKGZkX3N0YXJ0LCBmZF9lbmQpO1xuICAgICAgICAgICAgICAgIHN0cmVhbS5mZCA9IGZkO1xuICAgICAgICAgICAgICAgIC8vIGNvbXBhdGliaWxpdHlcbiAgICAgICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydGllcyhzdHJlYW0sIHtcbiAgICAgICAgICAgICAgICAgICAgb2JqZWN0OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBnZXQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdHJlYW0ubm9kZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXQ6IGZ1bmN0aW9uKHZhbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbS5ub2RlID0gdmFsO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBpc1JlYWQ6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGdldDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChzdHJlYW0uZmxhZ3MgJiAyMDk3MTU1KSAhPT0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgaXNXcml0ZToge1xuICAgICAgICAgICAgICAgICAgICAgICAgZ2V0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKHN0cmVhbS5mbGFncyAmIDIwOTcxNTUpICE9PSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBpc0FwcGVuZDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgZ2V0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3RyZWFtLmZsYWdzICYgMTAyNDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIEZTLnN0cmVhbXNbZmRdID0gc3RyZWFtO1xuICAgICAgICAgICAgICAgIHJldHVybiBzdHJlYW07XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY2xvc2VTdHJlYW06IGZ1bmN0aW9uKGZkKSB7XG4gICAgICAgICAgICAgICAgRlMuc3RyZWFtc1tmZF0gPSBudWxsO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNocmRldl9zdHJlYW1fb3BzOiB7XG4gICAgICAgICAgICAgICAgb3BlbjogZnVuY3Rpb24oc3RyZWFtKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBkZXZpY2UgPSBGUy5nZXREZXZpY2Uoc3RyZWFtLm5vZGUucmRldik7XG4gICAgICAgICAgICAgICAgICAgIC8vIG92ZXJyaWRlIG5vZGUncyBzdHJlYW0gb3BzIHdpdGggdGhlIGRldmljZSdzXG4gICAgICAgICAgICAgICAgICAgIHN0cmVhbS5zdHJlYW1fb3BzID0gZGV2aWNlLnN0cmVhbV9vcHM7XG4gICAgICAgICAgICAgICAgICAgIC8vIGZvcndhcmQgdGhlIG9wZW4gY2FsbFxuICAgICAgICAgICAgICAgICAgICBpZiAoc3RyZWFtLnN0cmVhbV9vcHMub3Blbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtLnN0cmVhbV9vcHMub3BlbihzdHJlYW0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBsbHNlZWs6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FU1BJUEUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBtYWpvcjogZnVuY3Rpb24oZGV2KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGRldiA+PiA4O1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG1pbm9yOiBmdW5jdGlvbihkZXYpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZGV2ICYgMHhmZjtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBtYWtlZGV2OiBmdW5jdGlvbihtYSwgbWkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKG1hIDw8IDgpIHwgbWk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcmVnaXN0ZXJEZXZpY2U6IGZ1bmN0aW9uKGRldiwgb3BzKSB7XG4gICAgICAgICAgICAgICAgRlMuZGV2aWNlc1tkZXZdID0geyBzdHJlYW1fb3BzOiBvcHMgfTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBnZXREZXZpY2U6IGZ1bmN0aW9uKGRldikge1xuICAgICAgICAgICAgICAgIHJldHVybiBGUy5kZXZpY2VzW2Rldl07XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc3luY2ZzOiBmdW5jdGlvbihwb3B1bGF0ZSwgY2FsbGJhY2spIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHBvcHVsYXRlID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrID0gcG9wdWxhdGU7XG4gICAgICAgICAgICAgICAgICAgIHBvcHVsYXRlID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBjb21wbGV0ZWQgPSAwO1xuICAgICAgICAgICAgICAgIHZhciB0b3RhbCA9IEZTLm1vdW50cy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgdmFyIGRvbmUgPSBmdW5jdGlvbihlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGVycik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCsrY29tcGxldGVkID49IHRvdGFsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayhudWxsKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgLy8gc3luYyBhbGwgbW91bnRzXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBGUy5tb3VudHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG1vdW50ID0gRlMubW91bnRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIW1vdW50LnR5cGUuc3luY2ZzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkb25lKG51bGwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbW91bnQudHlwZS5zeW5jZnMobW91bnQsIHBvcHVsYXRlLCBkb25lKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbW91bnQ6IGZ1bmN0aW9uKHR5cGUsIG9wdHMsIG1vdW50cG9pbnQpIHtcbiAgICAgICAgICAgICAgICB2YXIgbG9va3VwO1xuICAgICAgICAgICAgICAgIGlmIChtb3VudHBvaW50KSB7XG4gICAgICAgICAgICAgICAgICAgIGxvb2t1cCA9IEZTLmxvb2t1cFBhdGgobW91bnRwb2ludCwgeyBmb2xsb3c6IGZhbHNlIH0pO1xuICAgICAgICAgICAgICAgICAgICBtb3VudHBvaW50ID0gbG9va3VwLnBhdGg7IC8vIHVzZSB0aGUgYWJzb2x1dGUgcGF0aFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgbW91bnQgPSB7XG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IHR5cGUsXG4gICAgICAgICAgICAgICAgICAgIG9wdHM6IG9wdHMsXG4gICAgICAgICAgICAgICAgICAgIG1vdW50cG9pbnQ6IG1vdW50cG9pbnQsXG4gICAgICAgICAgICAgICAgICAgIHJvb3Q6IG51bGxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIC8vIGNyZWF0ZSBhIHJvb3Qgbm9kZSBmb3IgdGhlIGZzXG4gICAgICAgICAgICAgICAgdmFyIHJvb3QgPSB0eXBlLm1vdW50KG1vdW50KTtcbiAgICAgICAgICAgICAgICByb290Lm1vdW50ID0gbW91bnQ7XG4gICAgICAgICAgICAgICAgbW91bnQucm9vdCA9IHJvb3Q7XG4gICAgICAgICAgICAgICAgLy8gYXNzaWduIHRoZSBtb3VudCBpbmZvIHRvIHRoZSBtb3VudHBvaW50J3Mgbm9kZVxuICAgICAgICAgICAgICAgIGlmIChsb29rdXApIHtcbiAgICAgICAgICAgICAgICAgICAgbG9va3VwLm5vZGUubW91bnQgPSBtb3VudDtcbiAgICAgICAgICAgICAgICAgICAgbG9va3VwLm5vZGUubW91bnRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbXBhdGliaWxpdHkgdXBkYXRlIEZTLnJvb3QgaWYgd2UgbW91bnQgdG8gL1xuICAgICAgICAgICAgICAgICAgICBpZiAobW91bnRwb2ludCA9PT0gJy8nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBGUy5yb290ID0gbW91bnQucm9vdDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBhZGQgdG8gb3VyIGNhY2hlZCBsaXN0IG9mIG1vdW50c1xuICAgICAgICAgICAgICAgIEZTLm1vdW50cy5wdXNoKG1vdW50KTtcbiAgICAgICAgICAgICAgICByZXR1cm4gcm9vdDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsb29rdXA6IGZ1bmN0aW9uKHBhcmVudCwgbmFtZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBwYXJlbnQubm9kZV9vcHMubG9va3VwKHBhcmVudCwgbmFtZSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbWtub2Q6IGZ1bmN0aW9uKHBhdGgsIG1vZGUsIGRldiwgdGhyb3dFcnJvciA9IHRydWUpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBsb29rdXAgPSBGUy5sb29rdXBQYXRoKHBhdGgsIHsgcGFyZW50OiB0cnVlIH0pO1xuICAgICAgICAgICAgICAgIGNvbnN0IHBhcmVudCA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgIGNvbnN0IG5hbWUgPSBQQVRILmJhc2VuYW1lKHBhdGgpO1xuICAgICAgICAgICAgICAgIGNvbnN0IGVycm9yID0gRlMubWF5Q3JlYXRlKHBhcmVudCwgbmFtZSk7XG4gICAgICAgICAgICAgICAgaWYgKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aHJvd0Vycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihlcnJvciwgcGF0aCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIXBhcmVudC5ub2RlX29wcy5ta25vZCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhyb3dFcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRVBFUk0sIHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcmVudC5ub2RlX29wcy5ta25vZChwYXJlbnQsIG5hbWUsIG1vZGUsIGRldik7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY3JlYXRlOiBmdW5jdGlvbihwYXRoLCBtb2RlLCB0aHJvd0Vycm9yID0gdHJ1ZSkge1xuICAgICAgICAgICAgICAgIG1vZGUgPSBtb2RlICE9PSB1bmRlZmluZWQgPyBtb2RlIDogMG82NjY7XG4gICAgICAgICAgICAgICAgbW9kZSAmPSA0MDk1O1xuICAgICAgICAgICAgICAgIG1vZGUgfD0gMzI3Njg7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEZTLm1rbm9kKHBhdGgsIG1vZGUsIDAsIHRocm93RXJyb3IpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG1rZGlyOiBmdW5jdGlvbihwYXRoLCBtb2RlLCB0aHJvd0Vycm9yID0gdHJ1ZSkge1xuICAgICAgICAgICAgICAgIG1vZGUgPSBtb2RlICE9PSB1bmRlZmluZWQgPyBtb2RlIDogMG83Nzc7XG4gICAgICAgICAgICAgICAgbW9kZSAmPSA1MTEgfCA1MTI7XG4gICAgICAgICAgICAgICAgbW9kZSB8PSAxNjM4NDtcbiAgICAgICAgICAgICAgICByZXR1cm4gRlMubWtub2QocGF0aCwgbW9kZSwgMCwgdGhyb3dFcnJvcik7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbWtkZXY6IGZ1bmN0aW9uKHBhdGgsIG1vZGUsIGRldikge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZGV2ID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICBkZXYgPSBtb2RlO1xuICAgICAgICAgICAgICAgICAgICBtb2RlID0gMG82NjY7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG1vZGUgfD0gODE5MjtcbiAgICAgICAgICAgICAgICByZXR1cm4gRlMubWtub2QocGF0aCwgbW9kZSwgZGV2KTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzeW1saW5rOiBmdW5jdGlvbihvbGRwYXRoLCBuZXdwYXRoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGxvb2t1cCA9IEZTLmxvb2t1cFBhdGgobmV3cGF0aCwgeyBwYXJlbnQ6IHRydWUgfSk7XG4gICAgICAgICAgICAgICAgdmFyIHBhcmVudCA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgIHZhciBuZXduYW1lID0gUEFUSC5iYXNlbmFtZShuZXdwYXRoKTtcbiAgICAgICAgICAgICAgICB2YXIgZXJyID0gRlMubWF5Q3JlYXRlKHBhcmVudCwgbmV3bmFtZSk7XG4gICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihlcnIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIXBhcmVudC5ub2RlX29wcy5zeW1saW5rKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVQRVJNKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcmVudC5ub2RlX29wcy5zeW1saW5rKHBhcmVudCwgbmV3bmFtZSwgb2xkcGF0aCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcmVuYW1lOiBmdW5jdGlvbihvbGRfcGF0aCwgbmV3X3BhdGgpIHtcbiAgICAgICAgICAgICAgICB2YXIgb2xkX2Rpcm5hbWUgPSBQQVRILmRpcm5hbWUob2xkX3BhdGgpO1xuICAgICAgICAgICAgICAgIHZhciBuZXdfZGlybmFtZSA9IFBBVEguZGlybmFtZShuZXdfcGF0aCk7XG4gICAgICAgICAgICAgICAgdmFyIG9sZF9uYW1lID0gUEFUSC5iYXNlbmFtZShvbGRfcGF0aCk7XG4gICAgICAgICAgICAgICAgdmFyIG5ld19uYW1lID0gUEFUSC5iYXNlbmFtZShuZXdfcGF0aCk7XG4gICAgICAgICAgICAgICAgLy8gcGFyZW50cyBtdXN0IGV4aXN0XG4gICAgICAgICAgICAgICAgdmFyIGxvb2t1cCwgb2xkX2RpciwgbmV3X2RpcjtcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBsb29rdXAgPSBGUy5sb29rdXBQYXRoKG9sZF9wYXRoLCB7IHBhcmVudDogdHJ1ZSB9KTtcbiAgICAgICAgICAgICAgICAgICAgb2xkX2RpciA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgICAgICBsb29rdXAgPSBGUy5sb29rdXBQYXRoKG5ld19wYXRoLCB7IHBhcmVudDogdHJ1ZSB9KTtcbiAgICAgICAgICAgICAgICAgICAgbmV3X2RpciA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUJVU1kpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBuZWVkIHRvIGJlIHBhcnQgb2YgdGhlIHNhbWUgbW91bnRcbiAgICAgICAgICAgICAgICBpZiAob2xkX2Rpci5tb3VudCAhPT0gbmV3X2Rpci5tb3VudCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FWERFVik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIHNvdXJjZSBtdXN0IGV4aXN0XG4gICAgICAgICAgICAgICAgdmFyIG9sZF9ub2RlID0gRlMubG9va3VwTm9kZShvbGRfZGlyLCBvbGRfbmFtZSk7XG4gICAgICAgICAgICAgICAgLy8gb2xkIHBhdGggc2hvdWxkIG5vdCBiZSBhbiBhbmNlc3RvciBvZiB0aGUgbmV3IHBhdGhcbiAgICAgICAgICAgICAgICB2YXIgcmVsYXRpdmUgPSBQQVRILnJlbGF0aXZlKG9sZF9wYXRoLCBuZXdfZGlybmFtZSk7XG4gICAgICAgICAgICAgICAgaWYgKHJlbGF0aXZlLmNoYXJBdCgwKSAhPT0gJy4nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlZBTCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIG5ldyBwYXRoIHNob3VsZCBub3QgYmUgYW4gYW5jZXN0b3Igb2YgdGhlIG9sZCBwYXRoXG4gICAgICAgICAgICAgICAgcmVsYXRpdmUgPSBQQVRILnJlbGF0aXZlKG5ld19wYXRoLCBvbGRfZGlybmFtZSk7XG4gICAgICAgICAgICAgICAgaWYgKHJlbGF0aXZlLmNoYXJBdCgwKSAhPT0gJy4nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOT1RFTVBUWSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIHNlZSBpZiB0aGUgbmV3IHBhdGggYWxyZWFkeSBleGlzdHNcbiAgICAgICAgICAgICAgICB2YXIgbmV3X25vZGU7XG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgbmV3X25vZGUgPSBGUy5sb29rdXBOb2RlKG5ld19kaXIsIG5ld19uYW1lKTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIG5vdCBmYXRhbFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBlYXJseSBvdXQgaWYgbm90aGluZyBuZWVkcyB0byBjaGFuZ2VcbiAgICAgICAgICAgICAgICBpZiAob2xkX25vZGUgPT09IG5ld19ub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gd2UnbGwgbmVlZCB0byBkZWxldGUgdGhlIG9sZCBlbnRyeVxuICAgICAgICAgICAgICAgIHZhciBpc2RpciA9IEZTLmlzRGlyKG9sZF9ub2RlLm1vZGUpO1xuICAgICAgICAgICAgICAgIHZhciBlcnIgPSBGUy5tYXlEZWxldGUob2xkX2Rpciwgb2xkX25hbWUsIGlzZGlyKTtcbiAgICAgICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKGVycik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIG5lZWQgZGVsZXRlIHBlcm1pc3Npb25zIGlmIHdlJ2xsIGJlIG92ZXJ3cml0aW5nLlxuICAgICAgICAgICAgICAgIC8vIG5lZWQgY3JlYXRlIHBlcm1pc3Npb25zIGlmIG5ldyBkb2Vzbid0IGFscmVhZHkgZXhpc3QuXG4gICAgICAgICAgICAgICAgZXJyID0gbmV3X25vZGVcbiAgICAgICAgICAgICAgICAgICAgPyBGUy5tYXlEZWxldGUobmV3X2RpciwgbmV3X25hbWUsIGlzZGlyKVxuICAgICAgICAgICAgICAgICAgICA6IEZTLm1heUNyZWF0ZShuZXdfZGlyLCBuZXdfbmFtZSk7XG4gICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihlcnIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIW9sZF9kaXIubm9kZV9vcHMucmVuYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVQRVJNKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICBGUy5pc01vdW50cG9pbnQob2xkX25vZGUpIHx8XG4gICAgICAgICAgICAgICAgICAgIChuZXdfbm9kZSAmJiBGUy5pc01vdW50cG9pbnQobmV3X25vZGUpKVxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FQlVTWSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGlmIHdlIGFyZSBnb2luZyB0byBjaGFuZ2UgdGhlIHBhcmVudCwgY2hlY2sgd3JpdGUgcGVybWlzc2lvbnNcbiAgICAgICAgICAgICAgICBpZiAobmV3X2RpciAhPT0gb2xkX2Rpcikge1xuICAgICAgICAgICAgICAgICAgICBlcnIgPSBGUy5ub2RlUGVybWlzc2lvbnMob2xkX2RpciwgJ3cnKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoZXJyKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyByZW1vdmUgdGhlIG5vZGUgZnJvbSB0aGUgbG9va3VwIGhhc2hcbiAgICAgICAgICAgICAgICBGUy5oYXNoUmVtb3ZlTm9kZShvbGRfbm9kZSk7XG4gICAgICAgICAgICAgICAgLy8gZG8gdGhlIHVuZGVybHlpbmcgZnMgcmVuYW1lXG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgb2xkX2Rpci5ub2RlX29wcy5yZW5hbWUob2xkX25vZGUsIG5ld19kaXIsIG5ld19uYW1lKTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IGU7XG4gICAgICAgICAgICAgICAgfSBmaW5hbGx5IHtcbiAgICAgICAgICAgICAgICAgICAgLy8gYWRkIHRoZSBub2RlIGJhY2sgdG8gdGhlIGhhc2ggKGluIGNhc2Ugbm9kZV9vcHMucmVuYW1lXG4gICAgICAgICAgICAgICAgICAgIC8vIGNoYW5nZWQgaXRzIG5hbWUpXG4gICAgICAgICAgICAgICAgICAgIEZTLmhhc2hBZGROb2RlKG9sZF9ub2RlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcm1kaXI6IGZ1bmN0aW9uKHBhdGgpIHtcbiAgICAgICAgICAgICAgICB2YXIgbG9va3VwID0gRlMubG9va3VwUGF0aChwYXRoLCB7IHBhcmVudDogdHJ1ZSB9KTtcbiAgICAgICAgICAgICAgICB2YXIgcGFyZW50ID0gbG9va3VwLm5vZGU7XG4gICAgICAgICAgICAgICAgdmFyIG5hbWUgPSBQQVRILmJhc2VuYW1lKHBhdGgpO1xuICAgICAgICAgICAgICAgIHZhciBub2RlID0gRlMubG9va3VwTm9kZShwYXJlbnQsIG5hbWUpO1xuICAgICAgICAgICAgICAgIHZhciBlcnIgPSBGUy5tYXlEZWxldGUocGFyZW50LCBuYW1lLCB0cnVlKTtcbiAgICAgICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKGVycik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghcGFyZW50Lm5vZGVfb3BzLnJtZGlyKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVQRVJNKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKEZTLmlzTW91bnRwb2ludChub2RlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FQlVTWSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHBhcmVudC5ub2RlX29wcy5ybWRpcihwYXJlbnQsIG5hbWUpO1xuICAgICAgICAgICAgICAgIEZTLmRlc3Ryb3lOb2RlKG5vZGUpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHJlYWRkaXI6IGZ1bmN0aW9uKHBhdGgpIHtcbiAgICAgICAgICAgICAgICB2YXIgbG9va3VwID0gRlMubG9va3VwUGF0aChwYXRoLCB7IGZvbGxvdzogdHJ1ZSB9KTtcbiAgICAgICAgICAgICAgICB2YXIgbm9kZSA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgIGlmICghbm9kZS5ub2RlX29wcy5yZWFkZGlyKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOT1RESVIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZS5ub2RlX29wcy5yZWFkZGlyKG5vZGUpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHVubGluazogZnVuY3Rpb24ocGF0aCkge1xuICAgICAgICAgICAgICAgIHZhciBsb29rdXAgPSBGUy5sb29rdXBQYXRoKHBhdGgsIHsgcGFyZW50OiB0cnVlIH0pO1xuICAgICAgICAgICAgICAgIHZhciBwYXJlbnQgPSBsb29rdXAubm9kZTtcbiAgICAgICAgICAgICAgICB2YXIgbmFtZSA9IFBBVEguYmFzZW5hbWUocGF0aCk7XG4gICAgICAgICAgICAgICAgdmFyIG5vZGUgPSBGUy5sb29rdXBOb2RlKHBhcmVudCwgbmFtZSk7XG4gICAgICAgICAgICAgICAgdmFyIGVyciA9IEZTLm1heURlbGV0ZShwYXJlbnQsIG5hbWUsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIFBPU0lYIHNheXMgdW5saW5rIHNob3VsZCBzZXQgRVBFUk0sIG5vdCBFSVNESVJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVyciA9PT0gRVJSTk9fQ09ERVMuRUlTRElSKSBlcnIgPSBFUlJOT19DT0RFUy5FUEVSTTtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoZXJyKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFwYXJlbnQubm9kZV9vcHMudW5saW5rKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVQRVJNKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKEZTLmlzTW91bnRwb2ludChub2RlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FQlVTWSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHBhcmVudC5ub2RlX29wcy51bmxpbmsocGFyZW50LCBuYW1lKTtcbiAgICAgICAgICAgICAgICBGUy5kZXN0cm95Tm9kZShub2RlKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICByZWFkbGluazogZnVuY3Rpb24ocGF0aCkge1xuICAgICAgICAgICAgICAgIHZhciBsb29rdXAgPSBGUy5sb29rdXBQYXRoKHBhdGgsIHsgZm9sbG93OiBmYWxzZSB9KTtcbiAgICAgICAgICAgICAgICB2YXIgbGluayA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgIGlmICghbGluay5ub2RlX29wcy5yZWFkbGluaykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSU5WQUwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gbGluay5ub2RlX29wcy5yZWFkbGluayhsaW5rKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzdGF0OiBmdW5jdGlvbihwYXRoLCBkb250Rm9sbG93KSB7XG4gICAgICAgICAgICAgICAgdmFyIGxvb2t1cCA9IEZTLmxvb2t1cFBhdGgocGF0aCwgeyBmb2xsb3c6ICFkb250Rm9sbG93IH0pO1xuICAgICAgICAgICAgICAgIHZhciBub2RlID0gbG9va3VwLm5vZGU7XG4gICAgICAgICAgICAgICAgaWYgKCFub2RlLm5vZGVfb3BzLmdldGF0dHIpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRVBFUk0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZS5ub2RlX29wcy5nZXRhdHRyKG5vZGUpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxzdGF0OiBmdW5jdGlvbihwYXRoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEZTLnN0YXQocGF0aCwgdHJ1ZSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY2htb2Q6IGZ1bmN0aW9uKHBhdGgsIG1vZGUsIGRvbnRGb2xsb3cpIHtcbiAgICAgICAgICAgICAgICB2YXIgbm9kZTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHBhdGggPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBsb29rdXAgPSBGUy5sb29rdXBQYXRoKHBhdGgsIHsgZm9sbG93OiAhZG9udEZvbGxvdyB9KTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZSA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUgPSBwYXRoO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIW5vZGUubm9kZV9vcHMuc2V0YXR0cikge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FUEVSTSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5vZGUubm9kZV9vcHMuc2V0YXR0cihub2RlLCB7XG4gICAgICAgICAgICAgICAgICAgIG1vZGU6IChtb2RlICYgNDA5NSkgfCAobm9kZS5tb2RlICYgfjQwOTUpLFxuICAgICAgICAgICAgICAgICAgICB0aW1lc3RhbXA6IERhdGUubm93KClcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsY2htb2Q6IGZ1bmN0aW9uKHBhdGgsIG1vZGUpIHtcbiAgICAgICAgICAgICAgICBGUy5jaG1vZChwYXRoLCBtb2RlLCB0cnVlKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBmY2htb2Q6IGZ1bmN0aW9uKGZkLCBtb2RlKSB7XG4gICAgICAgICAgICAgICAgdmFyIHN0cmVhbSA9IEZTLmdldFN0cmVhbShmZCk7XG4gICAgICAgICAgICAgICAgaWYgKCFzdHJlYW0pIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUJBREYpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBGUy5jaG1vZChzdHJlYW0ubm9kZSwgbW9kZSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY2hvd246IGZ1bmN0aW9uKHBhdGgsIHVpZCwgZ2lkLCBkb250Rm9sbG93KSB7XG4gICAgICAgICAgICAgICAgdmFyIG5vZGU7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwYXRoID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbG9va3VwID0gRlMubG9va3VwUGF0aChwYXRoLCB7IGZvbGxvdzogIWRvbnRGb2xsb3cgfSk7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUgPSBsb29rdXAubm9kZTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBub2RlID0gcGF0aDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFub2RlLm5vZGVfb3BzLnNldGF0dHIpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRVBFUk0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBub2RlLm5vZGVfb3BzLnNldGF0dHIobm9kZSwge1xuICAgICAgICAgICAgICAgICAgICB0aW1lc3RhbXA6IERhdGUubm93KClcbiAgICAgICAgICAgICAgICAgICAgLy8gd2UgaWdub3JlIHRoZSB1aWQgLyBnaWQgZm9yIG5vd1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxjaG93bjogZnVuY3Rpb24ocGF0aCwgdWlkLCBnaWQpIHtcbiAgICAgICAgICAgICAgICBGUy5jaG93bihwYXRoLCB1aWQsIGdpZCwgdHJ1ZSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZmNob3duOiBmdW5jdGlvbihmZCwgdWlkLCBnaWQpIHtcbiAgICAgICAgICAgICAgICB2YXIgc3RyZWFtID0gRlMuZ2V0U3RyZWFtKGZkKTtcbiAgICAgICAgICAgICAgICBpZiAoIXN0cmVhbSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FQkFERik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIEZTLmNob3duKHN0cmVhbS5ub2RlLCB1aWQsIGdpZCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgdHJ1bmNhdGU6IGZ1bmN0aW9uKHBhdGgsIGxlbikge1xuICAgICAgICAgICAgICAgIGlmIChsZW4gPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlZBTCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBub2RlO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcGF0aCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxvb2t1cCA9IEZTLmxvb2t1cFBhdGgocGF0aCwgeyBmb2xsb3c6IHRydWUgfSk7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUgPSBsb29rdXAubm9kZTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBub2RlID0gcGF0aDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFub2RlLm5vZGVfb3BzLnNldGF0dHIpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRVBFUk0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoRlMuaXNEaXIobm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSVNESVIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIUZTLmlzRmlsZShub2RlLm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlZBTCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBlcnIgPSBGUy5ub2RlUGVybWlzc2lvbnMobm9kZSwgJ3cnKTtcbiAgICAgICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKGVycik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5vZGUubm9kZV9vcHMuc2V0YXR0cihub2RlLCB7XG4gICAgICAgICAgICAgICAgICAgIHNpemU6IGxlbixcbiAgICAgICAgICAgICAgICAgICAgdGltZXN0YW1wOiBEYXRlLm5vdygpXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZnRydW5jYXRlOiBmdW5jdGlvbihmZCwgbGVuKSB7XG4gICAgICAgICAgICAgICAgdmFyIHN0cmVhbSA9IEZTLmdldFN0cmVhbShmZCk7XG4gICAgICAgICAgICAgICAgaWYgKCFzdHJlYW0pIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUJBREYpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKHN0cmVhbS5mbGFncyAmIDIwOTcxNTUpID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlZBTCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIEZTLnRydW5jYXRlKHN0cmVhbS5ub2RlLCBsZW4pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHV0aW1lOiBmdW5jdGlvbihwYXRoLCBhdGltZSwgbXRpbWUpIHtcbiAgICAgICAgICAgICAgICB2YXIgbG9va3VwID0gRlMubG9va3VwUGF0aChwYXRoLCB7IGZvbGxvdzogdHJ1ZSB9KTtcbiAgICAgICAgICAgICAgICB2YXIgbm9kZSA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgIG5vZGUubm9kZV9vcHMuc2V0YXR0cihub2RlLCB7XG4gICAgICAgICAgICAgICAgICAgIHRpbWVzdGFtcDogTWF0aC5tYXgoYXRpbWUsIG10aW1lKVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG9wZW46IGZ1bmN0aW9uKHBhdGgsIGZsYWdzLCBtb2RlLCBmZF9zdGFydCwgZmRfZW5kKSB7XG4gICAgICAgICAgICAgICAgcGF0aCA9IFBBVEgubm9ybWFsaXplKHBhdGgpO1xuICAgICAgICAgICAgICAgIGZsYWdzID1cbiAgICAgICAgICAgICAgICAgICAgdHlwZW9mIGZsYWdzID09PSAnc3RyaW5nJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBGUy5tb2RlU3RyaW5nVG9GbGFncyhmbGFncylcbiAgICAgICAgICAgICAgICAgICAgICAgIDogZmxhZ3M7XG4gICAgICAgICAgICAgICAgbW9kZSA9IHR5cGVvZiBtb2RlID09PSAndW5kZWZpbmVkJyA/IDBvNjY2IDogbW9kZTtcbiAgICAgICAgICAgICAgICBpZiAoZmxhZ3MgJiA2NCkge1xuICAgICAgICAgICAgICAgICAgICBtb2RlID0gKG1vZGUgJiA0MDk1KSB8IDMyNzY4O1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG1vZGUgPSAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgbm9kZTtcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbG9va3VwID0gRlMubG9va3VwUGF0aChwYXRoLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb2xsb3c6ICEoZmxhZ3MgJiAxMzEwNzIpXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBub2RlID0gbG9va3VwLm5vZGU7XG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBpZ25vcmVcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gcGVyaGFwcyB3ZSBuZWVkIHRvIGNyZWF0ZSB0aGUgbm9kZVxuICAgICAgICAgICAgICAgIGlmIChmbGFncyAmIDY0KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiBPX0NSRUFUIGFuZCBPX0VYQ0wgYXJlIHNldCwgZXJyb3Igb3V0IGlmIHRoZSBub2RlIGFscmVhZHkgZXhpc3RzXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmxhZ3MgJiAxMjgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FRVhJU1QpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm9kZSBkb2Vzbid0IGV4aXN0LCB0cnkgdG8gY3JlYXRlIGl0XG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlID0gRlMubWtub2QocGF0aCwgbW9kZSwgMCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOT0VOVCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGNhbid0IHRydW5jYXRlIGEgZGV2aWNlXG4gICAgICAgICAgICAgICAgaWYgKEZTLmlzQ2hyZGV2KG5vZGUubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgZmxhZ3MgJj0gfjUxMjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gY2hlY2sgcGVybWlzc2lvbnNcbiAgICAgICAgICAgICAgICB2YXIgZXJyID0gRlMubWF5T3Blbihub2RlLCBmbGFncyk7XG4gICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihlcnIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBkbyB0cnVuY2F0aW9uIGlmIG5lY2Vzc2FyeVxuICAgICAgICAgICAgICAgIGlmIChmbGFncyAmIDUxMikge1xuICAgICAgICAgICAgICAgICAgICBGUy50cnVuY2F0ZShub2RlLCAwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gd2UndmUgYWxyZWFkeSBoYW5kbGVkIHRoZXNlLCBkb24ndCBwYXNzIGRvd24gdG8gdGhlIHVuZGVybHlpbmcgdmZzXG4gICAgICAgICAgICAgICAgZmxhZ3MgJj0gfigxMjggfCA1MTIpO1xuICAgICAgICAgICAgICAgIC8vIHJlZ2lzdGVyIHRoZSBzdHJlYW0gd2l0aCB0aGUgZmlsZXN5c3RlbVxuICAgICAgICAgICAgICAgIHZhciBzdHJlYW0gPSBGUy5jcmVhdGVTdHJlYW0oXG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGU6IG5vZGUsXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiBGUy5nZXRQYXRoKG5vZGUpLCAvLyB3ZSB3YW50IHRoZSBhYnNvbHV0ZSBwYXRoIHRvIHRoZSBub2RlXG4gICAgICAgICAgICAgICAgICAgICAgICBmbGFnczogZmxhZ3MsXG4gICAgICAgICAgICAgICAgICAgICAgICBzZWVrYWJsZTogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtX29wczogbm9kZS5zdHJlYW1fb3BzLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gdXNlZCBieSB0aGUgZmlsZSBmYW1pbHkgbGliYyBjYWxscyAoZm9wZW4sIGZ3cml0ZSwgZmVycm9yLCBldGMuKVxuICAgICAgICAgICAgICAgICAgICAgICAgdW5nb3R0ZW46IFtdLFxuICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3I6IGZhbHNlXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIGZkX3N0YXJ0LFxuICAgICAgICAgICAgICAgICAgICBmZF9lbmRcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIC8vIGNhbGwgdGhlIG5ldyBzdHJlYW0ncyBvcGVuIGZ1bmN0aW9uXG4gICAgICAgICAgICAgICAgaWYgKHN0cmVhbS5zdHJlYW1fb3BzLm9wZW4pIHtcbiAgICAgICAgICAgICAgICAgICAgc3RyZWFtLnN0cmVhbV9vcHMub3BlbihzdHJlYW0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoTW9kdWxlWydsb2dSZWFkRmlsZXMnXSAmJiAhKGZsYWdzICYgMSkpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFGUy5yZWFkRmlsZXMpIEZTLnJlYWRGaWxlcyA9IHt9O1xuICAgICAgICAgICAgICAgICAgICBpZiAoIShwYXRoIGluIEZTLnJlYWRGaWxlcykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIEZTLnJlYWRGaWxlc1twYXRoXSA9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oJ3JlYWQgZmlsZTogJyArIHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBzdHJlYW07XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY2xvc2U6IGZ1bmN0aW9uKHN0cmVhbSkge1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzdHJlYW0uc3RyZWFtX29wcy5jbG9zZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtLnN0cmVhbV9vcHMuY2xvc2Uoc3RyZWFtKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgZTtcbiAgICAgICAgICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgICAgICAgICAgICBGUy5jbG9zZVN0cmVhbShzdHJlYW0uZmQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsbHNlZWs6IGZ1bmN0aW9uKHN0cmVhbSwgb2Zmc2V0LCB3aGVuY2UpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXN0cmVhbS5zZWVrYWJsZSB8fCAhc3RyZWFtLnN0cmVhbV9vcHMubGxzZWVrKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVTUElQRSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBzdHJlYW0uc3RyZWFtX29wcy5sbHNlZWsoc3RyZWFtLCBvZmZzZXQsIHdoZW5jZSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcmVhZDogZnVuY3Rpb24oc3RyZWFtLCBidWZmZXIsIG9mZnNldCwgbGVuZ3RoLCBwb3NpdGlvbikge1xuICAgICAgICAgICAgICAgIGlmIChsZW5ndGggPCAwIHx8IHBvc2l0aW9uIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSU5WQUwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKHN0cmVhbS5mbGFncyAmIDIwOTcxNTUpID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVCQURGKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKEZTLmlzRGlyKHN0cmVhbS5ub2RlLm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJU0RJUik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghc3RyZWFtLnN0cmVhbV9vcHMucmVhZCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSU5WQUwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgc2Vla2luZyA9IHRydWU7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwb3NpdGlvbiA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzdHJlYW0ucG9zaXRpb247XG4gICAgICAgICAgICAgICAgICAgIHNlZWtpbmcgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFzdHJlYW0uc2Vla2FibGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRVNQSVBFKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIGJ5dGVzUmVhZCA9IHN0cmVhbS5zdHJlYW1fb3BzLnJlYWQoXG4gICAgICAgICAgICAgICAgICAgIHN0cmVhbSxcbiAgICAgICAgICAgICAgICAgICAgYnVmZmVyLFxuICAgICAgICAgICAgICAgICAgICBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgIGxlbmd0aCxcbiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb25cbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIGlmICghc2Vla2luZykgc3RyZWFtLnBvc2l0aW9uICs9IGJ5dGVzUmVhZDtcbiAgICAgICAgICAgICAgICByZXR1cm4gYnl0ZXNSZWFkO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHdyaXRlOiBmdW5jdGlvbihzdHJlYW0sIGJ1ZmZlciwgb2Zmc2V0LCBsZW5ndGgsIHBvc2l0aW9uLCBjYW5Pd24pIHtcbiAgICAgICAgICAgICAgICBpZiAobGVuZ3RoIDwgMCB8fCBwb3NpdGlvbiA8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUlOVkFMKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKChzdHJlYW0uZmxhZ3MgJiAyMDk3MTU1KSA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FQkFERik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChGUy5pc0RpcihzdHJlYW0ubm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSVNESVIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIXN0cmVhbS5zdHJlYW1fb3BzLndyaXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlZBTCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBzZWVraW5nID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHBvc2l0aW9uID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHN0cmVhbS5wb3NpdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgc2Vla2luZyA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIXN0cmVhbS5zZWVrYWJsZSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FU1BJUEUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoc3RyZWFtLmZsYWdzICYgMTAyNCkge1xuICAgICAgICAgICAgICAgICAgICAvLyBzZWVrIHRvIHRoZSBlbmQgYmVmb3JlIHdyaXRpbmcgaW4gYXBwZW5kIG1vZGVcbiAgICAgICAgICAgICAgICAgICAgRlMubGxzZWVrKHN0cmVhbSwgMCwgMik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBieXRlc1dyaXR0ZW4gPSBzdHJlYW0uc3RyZWFtX29wcy53cml0ZShcbiAgICAgICAgICAgICAgICAgICAgc3RyZWFtLFxuICAgICAgICAgICAgICAgICAgICBidWZmZXIsXG4gICAgICAgICAgICAgICAgICAgIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbixcbiAgICAgICAgICAgICAgICAgICAgY2FuT3duXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICBpZiAoIXNlZWtpbmcpIHN0cmVhbS5wb3NpdGlvbiArPSBieXRlc1dyaXR0ZW47XG4gICAgICAgICAgICAgICAgcmV0dXJuIGJ5dGVzV3JpdHRlbjtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBhbGxvY2F0ZTogZnVuY3Rpb24oc3RyZWFtLCBvZmZzZXQsIGxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGlmIChvZmZzZXQgPCAwIHx8IGxlbmd0aCA8PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlZBTCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoc3RyZWFtLmZsYWdzICYgMjA5NzE1NSkgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUJBREYpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIUZTLmlzRmlsZShzdHJlYW0ubm9kZS5tb2RlKSAmJiAhRlMuaXNEaXIobm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FTk9ERVYpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIXN0cmVhbS5zdHJlYW1fb3BzLmFsbG9jYXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVPUE5PVFNVUFApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBzdHJlYW0uc3RyZWFtX29wcy5hbGxvY2F0ZShzdHJlYW0sIG9mZnNldCwgbGVuZ3RoKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBtbWFwOiBmdW5jdGlvbihcbiAgICAgICAgICAgICAgICBzdHJlYW0sXG4gICAgICAgICAgICAgICAgYnVmZmVyLFxuICAgICAgICAgICAgICAgIG9mZnNldCxcbiAgICAgICAgICAgICAgICBsZW5ndGgsXG4gICAgICAgICAgICAgICAgcG9zaXRpb24sXG4gICAgICAgICAgICAgICAgcHJvdCxcbiAgICAgICAgICAgICAgICBmbGFnc1xuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgLy8gVE9ETyBpZiBQUk9UIGlzIFBST1RfV1JJVEUsIG1ha2Ugc3VyZSB3ZSBoYXZlIHdyaXRlIGFjY2Vzc1xuICAgICAgICAgICAgICAgIGlmICgoc3RyZWFtLmZsYWdzICYgMjA5NzE1NSkgPT09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUFDQ0VTKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFzdHJlYW0uc3RyZWFtX29wcy5tbWFwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5lcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOT0RFVik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBzdHJlYW0uc3RyZWFtX29wcy5tbWFwKFxuICAgICAgICAgICAgICAgICAgICBzdHJlYW0sXG4gICAgICAgICAgICAgICAgICAgIGJ1ZmZlcixcbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0LFxuICAgICAgICAgICAgICAgICAgICBsZW5ndGgsXG4gICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uLFxuICAgICAgICAgICAgICAgICAgICBwcm90LFxuICAgICAgICAgICAgICAgICAgICBmbGFnc1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaW9jdGw6IGZ1bmN0aW9uKHN0cmVhbSwgY21kLCBhcmcpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXN0cmVhbS5zdHJlYW1fb3BzLmlvY3RsKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOT1RUWSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBzdHJlYW0uc3RyZWFtX29wcy5pb2N0bChzdHJlYW0sIGNtZCwgYXJnKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICByZWFkRmlsZTogZnVuY3Rpb24ocGF0aCwgb3B0cykge1xuICAgICAgICAgICAgICAgIG9wdHMgPSBvcHRzIHx8IHt9O1xuICAgICAgICAgICAgICAgIG9wdHMuZmxhZ3MgPSBvcHRzLmZsYWdzIHx8ICdyJztcbiAgICAgICAgICAgICAgICBvcHRzLmVuY29kaW5nID0gb3B0cy5lbmNvZGluZyB8fCAnYmluYXJ5JztcbiAgICAgICAgICAgICAgICB2YXIgcmV0O1xuICAgICAgICAgICAgICAgIHZhciBzdHJlYW0gPSBGUy5vcGVuKHBhdGgsIG9wdHMuZmxhZ3MpO1xuICAgICAgICAgICAgICAgIHZhciBzdGF0ID0gRlMuc3RhdChwYXRoKTtcbiAgICAgICAgICAgICAgICB2YXIgbGVuZ3RoID0gc3RhdC5zaXplO1xuICAgICAgICAgICAgICAgIHZhciBidWYgPSBuZXcgVWludDhBcnJheShsZW5ndGgpO1xuICAgICAgICAgICAgICAgIEZTLnJlYWQoc3RyZWFtLCBidWYsIDAsIGxlbmd0aCwgMCk7XG4gICAgICAgICAgICAgICAgaWYgKG9wdHMuZW5jb2RpbmcgPT09ICd1dGY4Jykge1xuICAgICAgICAgICAgICAgICAgICByZXQgPSAnJztcbiAgICAgICAgICAgICAgICAgICAgdmFyIHV0ZjggPSBuZXcgUnVudGltZS5VVEY4UHJvY2Vzc29yKCk7XG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldCArPSB1dGY4LnByb2Nlc3NDQ2hhcihidWZbaV0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChvcHRzLmVuY29kaW5nID09PSAnYmluYXJ5Jykge1xuICAgICAgICAgICAgICAgICAgICByZXQgPSBidWY7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ludmFsaWQgZW5jb2RpbmcgdHlwZSBcIicgKyBvcHRzLmVuY29kaW5nICsgJ1wiJ1xuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBGUy5jbG9zZShzdHJlYW0pO1xuICAgICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgd3JpdGVGaWxlOiBmdW5jdGlvbihwYXRoLCBkYXRhLCBvcHRzKSB7XG4gICAgICAgICAgICAgICAgb3B0cyA9IG9wdHMgfHwge307XG4gICAgICAgICAgICAgICAgb3B0cy5mbGFncyA9IG9wdHMuZmxhZ3MgfHwgJ3cnO1xuICAgICAgICAgICAgICAgIG9wdHMuZW5jb2RpbmcgPSBvcHRzLmVuY29kaW5nIHx8ICd1dGY4JztcbiAgICAgICAgICAgICAgICB2YXIgc3RyZWFtID0gRlMub3BlbihwYXRoLCBvcHRzLmZsYWdzLCBvcHRzLm1vZGUpO1xuICAgICAgICAgICAgICAgIGlmIChvcHRzLmVuY29kaW5nID09PSAndXRmOCcpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHV0ZjggPSBuZXcgUnVudGltZS5VVEY4UHJvY2Vzc29yKCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBidWYgPSBuZXcgVWludDhBcnJheSh1dGY4LnByb2Nlc3NKU1N0cmluZyhkYXRhKSk7XG4gICAgICAgICAgICAgICAgICAgIEZTLndyaXRlKHN0cmVhbSwgYnVmLCAwLCBidWYubGVuZ3RoLCAwKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9wdHMuZW5jb2RpbmcgPT09ICdiaW5hcnknKSB7XG4gICAgICAgICAgICAgICAgICAgIEZTLndyaXRlKHN0cmVhbSwgZGF0YSwgMCwgZGF0YS5sZW5ndGgsIDApO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbiAgICAgICAgICAgICAgICAgICAgICAgICdJbnZhbGlkIGVuY29kaW5nIHR5cGUgXCInICsgb3B0cy5lbmNvZGluZyArICdcIidcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgRlMuY2xvc2Uoc3RyZWFtKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBjd2Q6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBGUy5jdXJyZW50UGF0aDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBjaGRpcjogZnVuY3Rpb24ocGF0aCkge1xuICAgICAgICAgICAgICAgIHZhciBsb29rdXAgPSBGUy5sb29rdXBQYXRoKHBhdGgsIHsgZm9sbG93OiB0cnVlIH0pO1xuICAgICAgICAgICAgICAgIGlmICghRlMuaXNEaXIobG9va3VwLm5vZGUubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRU5PVERJUik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBlcnIgPSBGUy5ub2RlUGVybWlzc2lvbnMobG9va3VwLm5vZGUsICd4Jyk7XG4gICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihlcnIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBGUy5jdXJyZW50UGF0aCA9IGxvb2t1cC5wYXRoO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNyZWF0ZURlZmF1bHREaXJlY3RvcmllczogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgRlMubWtkaXIoJy90bXAnKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBjcmVhdGVEZWZhdWx0RGV2aWNlczogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgLy8gY3JlYXRlIC9kZXZcbiAgICAgICAgICAgICAgICBGUy5ta2RpcignL2RldicpO1xuICAgICAgICAgICAgICAgIC8vIHNldHVwIC9kZXYvbnVsbFxuICAgICAgICAgICAgICAgIEZTLnJlZ2lzdGVyRGV2aWNlKEZTLm1ha2VkZXYoMSwgMyksIHtcbiAgICAgICAgICAgICAgICAgICAgcmVhZDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgd3JpdGU6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBGUy5ta2RldignL2Rldi9udWxsJywgRlMubWFrZWRldigxLCAzKSk7XG4gICAgICAgICAgICAgICAgLy8gc2V0dXAgL2Rldi90dHkgYW5kIC9kZXYvdHR5MVxuICAgICAgICAgICAgICAgIC8vIHN0ZGVyciBuZWVkcyB0byBwcmludCBvdXRwdXQgdXNpbmcgY29uc29sZS53YXJuXG4gICAgICAgICAgICAgICAgLy8gc28gd2UgcmVnaXN0ZXIgYSBzZWNvbmQgdHR5IGp1c3QgZm9yIGl0LlxuICAgICAgICAgICAgICAgIFRUWS5yZWdpc3RlcihGUy5tYWtlZGV2KDUsIDApLCBUVFkuZGVmYXVsdF90dHlfb3BzKTtcbiAgICAgICAgICAgICAgICBUVFkucmVnaXN0ZXIoRlMubWFrZWRldig2LCAwKSwgVFRZLmRlZmF1bHRfdHR5MV9vcHMpO1xuICAgICAgICAgICAgICAgIEZTLm1rZGV2KCcvZGV2L3R0eScsIEZTLm1ha2VkZXYoNSwgMCkpO1xuICAgICAgICAgICAgICAgIEZTLm1rZGV2KCcvZGV2L3R0eTEnLCBGUy5tYWtlZGV2KDYsIDApKTtcbiAgICAgICAgICAgICAgICAvLyB3ZSdyZSBub3QgZ29pbm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J10pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIEZTLnN5bWxpbmsoJy9kZXYvdHR5JywgJy9kZXYvc3RkaW4nKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKE1vZHVsZVsnc3Rkb3V0J10pIHtcbiAgICAgICAgICAgICAgICAgICAgRlMuY3JlYXRlRGV2aWNlKCcvZGV2JywgJ3N0ZG91dCcsIG51bGwsIE1vZHVsZVsnc3Rkb3V0J10pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIEZTLnN5bWxpbmsoJy9kZXYvdHR5JywgJy9kZXYvc3Rkb3V0Jyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChNb2R1bGVbJ3N0ZGVyciddKSB7XG4gICAgICAgICAgICAgICAgICAgIEZTLmNyZWF0ZURldmljZSgnL2RldicsICdzdGRlcnInLCBudWxsLCBNb2R1bGVbJ3N0ZGVyciddKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBGUy5zeW1saW5rKCcvZGV2L3R0eTEnLCAnL2Rldi9zdGRlcnInKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gb3BlbiBkZWZhdWx0IHN0cmVhbXMgZm9yIHRoZSBzdGRpbiwgc3Rkb3V0IGFuZCBzdGRlcnIgZGV2aWNlc1xuICAgICAgICAgICAgICAgIHZhciBzdGRpbiA9IEZTLm9wZW4oJy9kZXYvc3RkaW4nLCAncicpO1xuICAgICAgICAgICAgICAgIEhFQVAzMltfc3RkaW4gPj4gMl0gPSBzdGRpbi5mZDtcbiAgICAgICAgICAgICAgICBhc3NlcnQoXG4gICAgICAgICAgICAgICAgICAgIHN0ZGluLmZkID09PSAxLFxuICAgICAgICAgICAgICAgICAgICAnaW52YWxpZCBoYW5kbGUgZm9yIHN0ZGluICgnICsgc3RkaW4uZmQgKyAnKSdcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIHZhciBzdGRvdXQgPSBGUy5vcGVuKCcvZGV2L3N0ZG91dCcsICd3Jyk7XG4gICAgICAgICAgICAgICAgSEVBUDMyW19zdGRvdXQgPj4gMl0gPSBzdGRvdXQuZmQ7XG4gICAgICAgICAgICAgICAgYXNzZXJ0KFxuICAgICAgICAgICAgICAgICAgICBzdGRvdXQuZmQgPT09IDIsXG4gICAgICAgICAgICAgICAgICAgICdpbnZhbGlkIGhhbmRsZSBmb3Igc3Rkb3V0ICgnICsgc3Rkb3V0LmZkICsgJyknXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB2YXIgc3RkZXJyID0gRlMub3BlbignL2Rldi9zdGRlcnInLCAndycpO1xuICAgICAgICAgICAgICAgIEhFQVAzMltfc3RkZXJyID4+IDJdID0gc3RkZXJyLmZkO1xuICAgICAgICAgICAgICAgIGFzc2VydChcbiAgICAgICAgICAgICAgICAgICAgc3RkZXJyLmZkID09PSAzLFxuICAgICAgICAgICAgICAgICAgICAnaW52YWxpZCBoYW5kbGUgZm9yIHN0ZGVyciAoJyArIHN0ZGVyci5mZCArICcpJ1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc3RhdGljSW5pdDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgRlMubmFtZVRhYmxlID0gbmV3IEFycmF5KDQwOTYpO1xuICAgICAgICAgICAgICAgIEZTLnJvb3QgPSBGUy5jcmVhdGVOb2RlKG51bGwsICcvJywgMTYzODQgfCAwbzc3NywgMCk7XG4gICAgICAgICAgICAgICAgRlMubW91bnQoTUVNRlMsIHt9LCAnLycpO1xuICAgICAgICAgICAgICAgIEZTLmNyZWF0ZURlZmF1bHREaXJlY3RvcmllcygpO1xuICAgICAgICAgICAgICAgIEZTLmNyZWF0ZURlZmF1bHREZXZpY2VzKCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaW5pdDogZnVuY3Rpb24oaW5wdXQsIG91dHB1dCwgZXJyb3IpIHtcbiAgICAgICAgICAgICAgICBhc3NlcnQoXG4gICAgICAgICAgICAgICAgICAgICFGUy5pbml0LmluaXRpYWxpemVkLFxuICAgICAgICAgICAgICAgICAgICAnRlMuaW5pdCB3YXMgcHJldmlvdXNseSBjYWxsZWQuIElmIHlvdSB3YW50IHRvIGluaXRpYWxpemUgbGF0ZXIgd2l0aCBjdXN0b20gcGFyYW1ldGVycywgcmVtb3ZlIGFueSBlYXJsaWVyIGNhbGxzIChub3RlIHRoYXQgb25lIGlzIGF1dG9tYXRpY2FsbHkgYWRkZWQgdG8gdGhlIGdlbmVyYXRlZCBjb2RlKSdcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIEZTLmluaXQuaW5pdGlhbGl6ZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIC8vIEFsbG93IE1vZHVsZS5zdGRpbiBldGMuIHRvIHByb3ZpZGUgZGVmYXVsdHMsIGlmIG5vbmUgZXhwbGljaXRseSBwYXNzZWQgdG8gdXMgaGVyZVxuICAgICAgICAgICAgICAgIE1vZHVsZVsnc3RkaW4nXSA9IGlucHV0IHx8IE1vZHVsZVsnc3RkaW4nXTtcbiAgICAgICAgICAgICAgICBNb2R1bGVbJ3N0ZG91dCddID0gb3V0cHV0IHx8IE1vZHVsZVsnc3Rkb3V0J107XG4gICAgICAgICAgICAgICAgTW9kdWxlWydzdGRlcnInXSA9IGVycm9yIHx8IE1vZHVsZVsnc3RkZXJyJ107XG4gICAgICAgICAgICAgICAgRlMuY3JlYXRlU3RhbmRhcmRTdHJlYW1zKCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcXVpdDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgRlMuaW5pdC5pbml0aWFsaXplZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgRlMuc3RyZWFtcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgc3RyZWFtID0gRlMuc3RyZWFtc1tpXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzdHJlYW0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIEZTLmNsb3NlKHN0cmVhbSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdldE1vZGU6IGZ1bmN0aW9uKGNhblJlYWQsIGNhbldyaXRlKSB7XG4gICAgICAgICAgICAgICAgdmFyIG1vZGUgPSAwO1xuICAgICAgICAgICAgICAgIGlmIChjYW5SZWFkKSBtb2RlIHw9IDI5MiB8IDczO1xuICAgICAgICAgICAgICAgIGlmIChjYW5Xcml0ZSkgbW9kZSB8PSAxNDY7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1vZGU7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgam9pblBhdGg6IGZ1bmN0aW9uKHBhcnRzLCBmb3JjZVJlbGF0aXZlKSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhdGggPSBQQVRILmpvaW4uYXBwbHkobnVsbCwgcGFydHMpO1xuICAgICAgICAgICAgICAgIGlmIChmb3JjZVJlbGF0aXZlICYmIHBhdGhbMF0gPT0gJy8nKSBwYXRoID0gcGF0aC5zdWJzdHIoMSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhdGg7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYWJzb2x1dGVQYXRoOiBmdW5jdGlvbihyZWxhdGl2ZSwgYmFzZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBQQVRILnJlc29sdmUoYmFzZSwgcmVsYXRpdmUpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHN0YW5kYXJkaXplUGF0aDogZnVuY3Rpb24ocGF0aCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBQQVRILm5vcm1hbGl6ZShwYXRoKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBmaW5kT2JqZWN0OiBmdW5jdGlvbihwYXRoLCBkb250UmVzb2x2ZUxhc3RMaW5rKSB7XG4gICAgICAgICAgICAgICAgdmFyIHJldCA9IEZTLmFuYWx5emVQYXRoKHBhdGgsIGRvbnRSZXNvbHZlTGFzdExpbmspO1xuICAgICAgICAgICAgICAgIGlmIChyZXQuZXhpc3RzKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXQub2JqZWN0O1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIF9fX3NldEVyck5vKHJldC5lcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBhbmFseXplUGF0aDogZnVuY3Rpb24ocGF0aCwgZG9udFJlc29sdmVMYXN0TGluaykge1xuICAgICAgICAgICAgICAgIC8vIG9wZXJhdGUgZnJvbSB3aXRoaW4gdGhlIGNvbnRleHQgb2YgdGhlIHN5bWxpbmsncyB0YXJnZXRcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbG9va3VwID0gRlMubG9va3VwUGF0aChwYXRoLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb2xsb3c6ICFkb250UmVzb2x2ZUxhc3RMaW5rXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBwYXRoID0gbG9va3VwLnBhdGg7XG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cbiAgICAgICAgICAgICAgICB2YXIgcmV0ID0ge1xuICAgICAgICAgICAgICAgICAgICBpc1Jvb3Q6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICBleGlzdHM6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICBlcnJvcjogMCxcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgcGF0aDogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgb2JqZWN0OiBudWxsLFxuICAgICAgICAgICAgICAgICAgICBwYXJlbnRFeGlzdHM6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICBwYXJlbnRQYXRoOiBudWxsLFxuICAgICAgICAgICAgICAgICAgICBwYXJlbnRPYmplY3Q6IG51bGxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBsb29rdXAgPSBGUy5sb29rdXBQYXRoKHBhdGgsIHsgcGFyZW50OiB0cnVlIH0pO1xuICAgICAgICAgICAgICAgICAgICByZXQucGFyZW50RXhpc3RzID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0LnBhcmVudFBhdGggPSBsb29rdXAucGF0aDtcbiAgICAgICAgICAgICAgICAgICAgcmV0LnBhcmVudE9iamVjdCA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgICAgICByZXQubmFtZSA9IFBBVEguYmFzZW5hbWUocGF0aCk7XG4gICAgICAgICAgICAgICAgICAgIGxvb2t1cCA9IEZTLmxvb2t1cFBhdGgocGF0aCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9sbG93OiAhZG9udFJlc29sdmVMYXN0TGlua1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0LmV4aXN0cyA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIHJldC5wYXRoID0gbG9va3VwLnBhdGg7XG4gICAgICAgICAgICAgICAgICAgIHJldC5vYmplY3QgPSBsb29rdXAubm9kZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0Lm5hbWUgPSBsb29rdXAubm9kZS5uYW1lO1xuICAgICAgICAgICAgICAgICAgICByZXQuaXNSb290ID0gbG9va3VwLnBhdGggPT09ICcvJztcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldC5lcnJvciA9IGUuZXJybm87XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY3JlYXRlRm9sZGVyOiBmdW5jdGlvbihwYXJlbnQsIG5hbWUsIGNhblJlYWQsIGNhbldyaXRlKSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhdGggPSBQQVRILmpvaW4oXG4gICAgICAgICAgICAgICAgICAgIHR5cGVvZiBwYXJlbnQgPT09ICdzdHJpbmcnID8gcGFyZW50IDogRlMuZ2V0UGF0aChwYXJlbnQpLFxuICAgICAgICAgICAgICAgICAgICBuYW1lXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB2YXIgbW9kZSA9IEZTLmdldE1vZGUoY2FuUmVhZCwgY2FuV3JpdGUpO1xuICAgICAgICAgICAgICAgIHJldHVybiBGUy5ta2RpcihwYXRoLCBtb2RlKTtcbiAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQ3JlYXRlcyBhIGRpcmVjdG9yeS5cbiAgICAgICAgICAgICAqIEBmdW5jdGlvbiBjcmVhdGVQYXRoXG4gICAgICAgICAgICAgKiBAbWVtYmVyb2YgTGliVGlNaWRpdHlcbiAgICAgICAgICAgICAqIEBpbnN0YW5jZVxuICAgICAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IHBhcmVudCBUaGUgcGFyZW50IGZvbGRlci5cbiAgICAgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBwYXRoIFRoZSBwYXRoIHRvIGNyZWF0ZS5cbiAgICAgICAgICAgICAqIEBwYXJhbSB7Ym9vbGVhbn0gW3Rocm93RXJyb3IgPSB0cnVlXSBJZiBkaXJlY3RvcnkgY3JlYXRpb24gZmFpbGVkLCB0aHJvdyBhbiBlcnJvci5cbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgY3JlYXRlUGF0aDogZnVuY3Rpb24ocGFyZW50LCBwYXRoLCB0aHJvd0Vycm9yID0gdHJ1ZSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHBhcnRzID0gcGF0aC5zcGxpdCgnLycpLnJldmVyc2UoKTtcbiAgICAgICAgICAgICAgICB3aGlsZSAocGFydHMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHBhcnQgPSBwYXJ0cy5wb3AoKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFwYXJ0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjb25zdCBjdXJyZW50ID0gUEFUSC5qb2luKHBhcmVudCwgcGFydCk7XG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBGUy5ta2RpcihjdXJyZW50LCB1bmRlZmluZWQsIHRocm93RXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29uc29sZS5lcnJvcihlcnJvcilcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBwYXJlbnQgPSBjdXJyZW50O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQ3JlYXRlcyBhIGZpbGUuXG4gICAgICAgICAgICAgKiBAZnVuY3Rpb24gY3JlYXRlRmlsZVxuICAgICAgICAgICAgICogQG1lbWJlcm9mIExpYlRpTWlkaXR5XG4gICAgICAgICAgICAgKiBAaW5zdGFuY2VcbiAgICAgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBwYXJlbnQgVGhlIHBhcmVudCBmb2xkZXIuXG4gICAgICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbmFtZSBUaGUgcGF0aCB0byBjcmVhdGUuXG4gICAgICAgICAgICAgKiBAcGFyYW0ge2Jvb2xlYW59IGNhblJlYWRcbiAgICAgICAgICAgICAqIEBwYXJhbSB7Ym9vbGVhbn0gY2FuV3JpdGVcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgY3JlYXRlRmlsZTogZnVuY3Rpb24ocGFyZW50LCBuYW1lLCBjYW5SZWFkLCBjYW5Xcml0ZSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHBhdGggPSBQQVRILmpvaW4oXG4gICAgICAgICAgICAgICAgICAgIHR5cGVvZiBwYXJlbnQgPT09ICdzdHJpbmcnID8gcGFyZW50IDogRlMuZ2V0UGF0aChwYXJlbnQpLFxuICAgICAgICAgICAgICAgICAgICBuYW1lXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICBjb25zdCBtb2RlID0gRlMuZ2V0TW9kZShjYW5SZWFkLCBjYW5Xcml0ZSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEZTLmNyZWF0ZShwYXRoLCBtb2RlKTtcbiAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQ3JlYXRlcyBhIGRhdGEgZmlsZSBhbmQgd3JpdGVzIGRhdGEgdG8gaXQuXG4gICAgICAgICAgICAgKiBAZnVuY3Rpb24gY3JlYXRlRGF0YUZpbGVcbiAgICAgICAgICAgICAqIEBtZW1iZXJvZiBMaWJUaU1pZGl0eVxuICAgICAgICAgICAgICogQGluc3RhbmNlXG4gICAgICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gcGFyZW50XG4gICAgICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbmFtZVxuICAgICAgICAgICAgICogQHBhcmFtIHthcnJheX0gZGF0YVxuICAgICAgICAgICAgICogQHBhcmFtIHtib29sZWFufSBjYW5SZWFkXG4gICAgICAgICAgICAgKiBAcGFyYW0ge2Jvb2xlYW59IGNhbldyaXRlXG4gICAgICAgICAgICAgKiBAcGFyYW0ge2Jvb2xlYW59IFtjYW5Pd25dXG4gICAgICAgICAgICAgKiBAcGFyYW0ge2Jvb2xlYW59IFt0aHJvd0Vycm9yID0gdHJ1ZV0gSWYgZmlsZSBjcmVhdGlvbiBmYWlsZWQsIHRocm93IGFuIGVycm9yLlxuICAgICAgICAgICAgICovXG5cbiAgICAgICAgICAgIGNyZWF0ZURhdGFGaWxlOiBmdW5jdGlvbihcbiAgICAgICAgICAgICAgICBwYXJlbnQsXG4gICAgICAgICAgICAgICAgbmFtZSxcbiAgICAgICAgICAgICAgICBkYXRhLFxuICAgICAgICAgICAgICAgIGNhblJlYWQsXG4gICAgICAgICAgICAgICAgY2FuV3JpdGUsXG4gICAgICAgICAgICAgICAgY2FuT3duLFxuICAgICAgICAgICAgICAgIHRocm93RXJyb3IgPSB0cnVlXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBjb25zdCBwYXRoID0gbmFtZVxuICAgICAgICAgICAgICAgICAgICA/IFBBVEguam9pbihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZW9mIHBhcmVudCA9PT0gJ3N0cmluZydcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcGFyZW50XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IEZTLmdldFBhdGgocGFyZW50KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZVxuICAgICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgICAgOiBwYXJlbnQ7XG4gICAgICAgICAgICAgICAgY29uc3QgbW9kZSA9IEZTLmdldE1vZGUoY2FuUmVhZCwgY2FuV3JpdGUpO1xuXG4gICAgICAgICAgICAgICAgaWYgKHRocm93RXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgRlMuY3JlYXRlKHBhdGgsIG1vZGUpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBGUy5jcmVhdGUocGF0aCwgbW9kZSk7XG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGRhdGEgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXJyID0gbmV3IEFycmF5KGRhdGEubGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwLCBsZW4gPSBkYXRhLmxlbmd0aDsgaSA8IGxlbjsgKytpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyW2ldID0gZGF0YS5jaGFyQ29kZUF0KGkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSA9IGFycjtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIC8vIG1ha2Ugc3VyZSB3ZSBjYW4gd3JpdGUgdG8gdGhlIGZpbGVcbiAgICAgICAgICAgICAgICAgICAgRlMuY2htb2QocGF0aCwgbW9kZSB8IDE0Nik7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHN0cmVhbSA9IEZTLm9wZW4ocGF0aCwgJ3cnKTtcbiAgICAgICAgICAgICAgICAgICAgRlMud3JpdGUoc3RyZWFtLCBkYXRhLCAwLCBkYXRhLmxlbmd0aCwgMCwgY2FuT3duKTtcbiAgICAgICAgICAgICAgICAgICAgRlMuY2xvc2Uoc3RyZWFt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gYXdhaXQgcmVzcG9uc2UuYXJyYXlCdWZmZXIoKTtcblxuICAgICAgICAgICAgICAgIGNvbnN0IGRhdGEgPSBuZXcgSW50OEFycmF5KGFycmF5QnVmZmVyKTtcbiAgICAgICAgICAgICAgICBjb25zdCBtb2RlID0gRlMuZ2V0TW9kZSh0cnVlLCB0cnVlKTtcbiAgICAgICAgICAgICAgICBjb25zdCBwYXRoID0gUEFUSC5qb2luKExJQlRJTUlESVRZX1BBVENIX0RJUkVDVE9SWSwgZmlsZW5hbWUpO1xuXG4gICAgICAgICAgICAgICAgRlMuY3JlYXRlKHBhdGgsIG1vZGUpO1xuICAgICAgICAgICAgICAgIEZTLmNobW9kKHBhdGgsIG1vZGUgfCAxNDYpO1xuICAgICAgICAgICAgICAgIGNvbnN0IHN0cmVhbSA9IEZTLm9wZW4ocGF0aCwgJ3cnKTtcbiAgICAgICAgICAgICAgICBGUy53cml0ZShzdHJlYW0sIGRhdGEsIDAsIGRhdGEubGVuZ3RoLCAwLCB1bmRlZmluZWQpO1xuICAgICAgICAgICAgICAgIEZTLmNsb3NlKHN0cmVhbSk7XG4gICAgICAgICAgICAgICAgRlMuY2htb2QocGF0aCwgbW9kZSk7XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICBjcmVhdGVEZXZpY2U6IGZ1bmN0aW9uKHBhcmVudCwgbmFtZSwgaW5wdXQsIG91dHB1dCkge1xuICAgICAgICAgICAgICAgIHZhciBwYXRoID0gUEFUSC5qb2luKFxuICAgICAgICAgICAgICAgICAgICB0eXBlb2YgcGFyZW50ID09PSAnc3RyaW5nJyA/IHBhcmVudCA6IEZTLmdldFBhdGgocGFyZW50KSxcbiAgICAgICAgICAgICAgICAgICAgbmFtZVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgdmFyIG1vZGUgPSBGUy5nZXRNb2RlKCEhaW5wdXQsICEhb3V0cHV0KTtcbiAgICAgICAgICAgICAgICBpZiAoIUZTLmNyZWF0ZURldmljZS5tYWpvcikgRlMuY3JlYXRlRGV2aWNlLm1ham9yID0gNjQ7XG4gICAgICAgICAgICAgICAgdmFyIGRldiA9IEZTLm1ha2VkZXYoRlMuY3JlYXRlRGV2aWNlLm1ham9yKyssIDApO1xuICAgICAgICAgICAgICAgIC8vIENyZWF0ZSBhIGZha2UgZGV2aWNlIHRoYXQgYSBzZXQgb2Ygc3RyZWFtIG9wcyB0byBlbXVsYXRlXG4gICAgICAgICAgICAgICAgLy8gdGhlIG9sZCBiZWhhdmlvci5cbiAgICAgICAgICAgICAgICBGUy5yZWdpc3RlckRldmljZShkZXYsIHtcbiAgICAgICAgICAgICAgICAgICAgb3BlbjogZnVuY3Rpb24oc3RyZWFtKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW0uc2Vla2FibGUgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgY2xvc2U6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmx1c2ggYW55IHBlbmRpbmcgbGluZSBkYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3V0cHV0ICYmIG91dHB1dC5idWZmZXIgJiYgb3V0cHV0LmJ1ZmZlci5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRwdXQoMTApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICByZWFkOiBmdW5jdGlvbihcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlcixcbiAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvcyAvKiBpZ25vcmVkICovXG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGJ5dGVzUmVhZCA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBpbnB1dCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUlPKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCA9PT0gdW5kZWZpbmVkICYmIGJ5dGVzUmVhZCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FQUdBSU4pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0ID09PSBudWxsIHx8IHJlc3VsdCA9PT0gdW5kZWZpbmVkKSBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlc1JlYWQrKztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWZmZXJbb2Zmc2V0ICsgaV0gPSByZXN1bHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYnl0ZXNSZWFkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtLm5vZGUudGltZXN0YW1wID0gRGF0ZS5ub3coKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBieXRlc1JlYWQ7XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlOiBmdW5jdGlvbihzdHJlYW0sIGJ1ZmZlciwgb2Zmc2V0LCBsZW5ndGgsIHBvcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dHB1dChidWZmZXJbb2Zmc2V0ICsgaV0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUlPKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtLm5vZGUudGltZXN0YW1wID0gRGF0ZS5ub3coKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEZTLm1rZGV2KHBhdGgsIG1vZGUsIGRldik7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY3JlYXRlTGluazogZnVuY3Rpb24ocGFyZW50LCBuYW1lLCB0YXJnZXQsIGNhblJlYWQsIGNhbldyaXRlKSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhdGggPSBQQVRILmpvaW4oXG4gICAgICAgICAgICAgICAgICAgIHR5cGVvZiBwYXJlbnQgPT09ICdzdHJpbmcnID8gcGFyZW50IDogRlMuZ2V0UGF0aChwYXJlbnQpLFxuICAgICAgICAgICAgICAgICAgICBuYW1lXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gRlMuc3ltbGluayh0YXJnZXQsIHBhdGgpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGZvcmNlTG9hZEZpbGU6IGZ1bmN0aW9uKG9iaikge1xuICAgICAgICAgICAgICAgIGlmIChvYmouaXNEZXZpY2UgfHwgb2JqLmlzRm9sZGVyIHx8IG9iai5saW5rIHx8IG9iai5jb250ZW50cylcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgdmFyIHN1Y2Nlc3MgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgWE1MSHR0cFJlcXVlc3QgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbiAgICAgICAgICAgICAgICAgICAgICAgICdMYXp5IGxvYWRpbmcgc2hvdWxkIGhhdmUgYmVlbiBwZXJmb3JtZWQgKGNvbnRlbnRzIHNldCkgaW4gY3JlYXRlTGF6eUZpbGUsIGJ1dCBpdCB3YXMgbm90LiBMYXp5IGxvYWRpbmcgb25seSB3b3JrcyBpbiB3ZWIgd29ya2Vycy4gVXNlIC0tZW1iZWQtZmlsZSBvciAtLXByZWxvYWQtZmlsZSBpbiBlbWNjIG9uIHRoZSBtYWluIHRocmVhZC4nXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChNb2R1bGVbJ3JlYWQnXSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBDb21tYW5kLWxpbmUuXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBXQVJOSU5HOiBDYW4ndCByZWFkIGJpbmFyeSBmaWxlcyBpbiBWOCdzIGQ4IG9yIHRyYWNlbW9ua2V5J3MganMsIGFzXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICByZWFkKCkgd2lsbCB0cnkgdG8gcGFyc2UgVVRGOC5cbiAgICAgICAgICAgICAgICAgICAgICAgIG9iai5jb250ZW50cyA9IGludEFycmF5RnJvbVN0cmluZyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBNb2R1bGVbJ3JlYWQnXShvYmoudXJsKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnVlXG4gICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdWNjZXNzID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2Fubm90IGxvYWQgd2l0aG91dCByZWFkKCkgb3IgWE1MSHR0cFJlcXVlc3QuJ1xuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIXN1Y2Nlc3MpIF9fX3NldEVyck5vKEVSUk5PX0NPREVTLkVJTyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHN1Y2Nlc3M7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY3JlYXRlTGF6eUZpbGU6IGZ1bmN0aW9uKHBhcmVudCwgbmFtZSwgdXJsLCBjYW5SZWFkLCBjYW5Xcml0ZSkge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgWE1MSHR0cFJlcXVlc3QgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93ICdDYW5ub3QgZG8gc3luY2hyb25vdXMgYmluYXJ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HRoYXQgdHJpZXMgdG8gZm9yY2UgbG9hZCB0aGUgbGF6eSBmaWxlIGZpcnN0XG4gICAgICAgICAgICAgICAgdmFyIHN0cmVhbV9vcHMgPSB7fTtcbiAgICAgICAgICAgICAgICB2YXIga2V5cyA9IE9iamVjdC5rZXlzKG5vZGUuc3RyZWFtX29wcyk7XG4gICAgICAgICAgICAgICAga2V5cy5mb3JFYWNoKGZ1bmN0aW9uKGtleSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZm4gPSBub2RlLnN0cmVhbV9vcHNba2V5XTtcbiAgICAgICAgICAgICAgICAgICAgc3RyZWFtX29wc1trZXldID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUZTLmZvcmNlTG9hZEZpbGUobm9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSU8pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZuLmFwcGx5KG51bGwsIGFyZ3VtZW50cyk7XG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgLy8gdXNlIGEgY3VzdG9tIHJlYWQgZnVuY3Rpb25cbiAgICAgICAgICAgICAgICBzdHJlYW1fb3BzLnJlYWQgPSBmdW5jdGlvbihcbiAgICAgICAgICAgICAgICAgICAgc3RyZWFtLFxuICAgICAgICAgICAgICAgICAgICBidWZmZXIsXG4gICAgICAgICAgICAgICAgICAgIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvblxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIUZTLmZvcmNlTG9hZEZpbGUobm9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRlbnRzID0gc3RyZWFtLm5vZGUuY29udGVudHM7XG4gICAgICAgICAgICAgICAgICAgIGlmIChwb3NpdGlvbiA+PSBjb250ZW50cy5sZW5ndGgpIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICB2YXIgc2l6ZSA9IE1hdGgubWluKGNvbnRlbnRzLmxlbmd0aCAtIHBvc2l0aW9uLCBsZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICBhc3NlcnQoc2l6ZSA+PSAwKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnRlbnRzLnNsaWNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBub3JtYWwgYXJyYXlcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2l6ZTsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyW29mZnNldCArIGldID0gY29udGVudHNbcG9zaXRpb24gKyBpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2l6ZTsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTGF6eVVpbnQ4QXJyYXkgZnJvbSBzeW5jIGJpbmFyeSBYSFJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWZmZXJbb2Zmc2V0ICsgaV0gPSBjb250ZW50cy5nZXQocG9zaXRpb24gKyBpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2l6ZTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIG5vZGUuc3RyZWFtX29wcyA9IHN0cmVhbV9vcHM7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5vZGU7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY3JlYXRlUHJlbG9hZGVkRmlsZTogZnVuY3Rpb24oXG4gICAgICAgICAgICAgICAgcGFyZW50LFxuICAgICAgICAgICAgICAgIG5hbWUsXG4gICAgICAgICAgICAgICAgdXJsLFxuICAgICAgICAgICAgICAgIGNhblJlYWQsXG4gICAgICAgICAgICAgICAgY2FuV3JpdGUsXG4gICAgICAgICAgICAgICAgb25sb2FkLFxuICAgICAgICAgICAgICAgIG9uZXJyb3IsXG4gICAgICAgICAgICAgICAgZG9udENyZWF0ZUZpbGUsXG4gICAgICAgICAgICAgICAgY2FuT3duXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBCcm93c2VyLmluaXQoKTtcbiAgICAgICAgICAgICAgICAvLyBUT0RPIHdlIHNob3VsZCBhbGxvdyBwZW9wbGUgdG8ganVzdCBwYXNzIGluIGEgY29tcGxldGUgZmlsZW5hbWUgaW5zdGVhZFxuICAgICAgICAgICAgICAgIC8vIG9mIHBhcmVudCBhbmQgbmFtZSBiZWluZyB0aGF0IHdlIGp1c3Qgam9pbiB0aGVtIGFueXdheXNcbiAgICAgICAgICAgICAgICB2YXIgZnVsbG5hbWUgPSBuYW1lXG4gICAgICAgICAgICAgICAgICAgID8gUEFUSC5yZXNvbHZlKFBBVEguam9pbihwYXJlbnQsIG5hbWUpKVxuICAgICAgICAgICAgICAgICAgICA6IHBhcmVudDtcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBwcm9jZXNzRGF0YShieXRlQXJyYXkpIHtcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gZmluaXNoKGJ5dGVBcnJheSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFkb250Q3JlYXRlRmlsZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZTLmNyZWF0ZURhdGFGaWxlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVBcnJheSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FuUmVhZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FuV3JpdGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbk93blxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob25sb2FkKSBvbmxvYWQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZVJ1bkRlcGVuZGVuY3koJ2NwICcgKyBmdWxsbmFtZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdmFyIGhhbmRsZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgTW9kdWxlWydwcmVsb2FkUGx1Z2lucyddLmZvckVhY2goZnVuY3Rpb24ocGx1Z2luKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGFuZGxlZCkgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBsdWdpblsnY2FuSGFuZGxlJ10oZnVsbG5hbWUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGx1Z2luWydoYW5kbGUnXShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUFycmF5LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdWxsbmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluaXNoLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvbmVycm9yKSBvbmVycm9yKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVSdW5EZXBlbmRlbmN5KCdjcCAnICsgZnVsbG5hbWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghaGFuZGxlZCkgZmluaXNoKGJ5dGVBcnJheSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGFkZFJ1bkRlcGVuZGVuY3koJ2NwICcgKyBmdWxsbmFtZSk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB1cmwgPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5hc3luY0xvYWQoXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwsXG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbihieXRlQXJyYXkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9jZXNzRGF0YShieXRlQXJyYXkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uZXJyb3JcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwcm9jZXNzRGF0YSh1cmwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBpbmRleGVkREI6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5pbmRleGVkREIgfHxcbiAgICAgICAgICAgICAgICAgICAgd2luZG93Lm1vekluZGV4ZWREQiB8fFxuICAgICAgICAgICAgICAgICAgICB3aW5kb3cud2Via2l0SW5kZXhlZERCIHx8XG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5tc0luZGV4ZWREQlxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgREJfTkFNRTogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdFTV9GU18nICsgd2luZG93LmxvY2F0aW9uLnBhdGhuYW1lO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIERCX1ZFUlNJT046IDIwLFxuICAgICAgICAgICAgREJfU1RPUkVfTkFNRTogJ0ZJTEVfREFUQScsXG4gICAgICAgICAgICBzYXZlRmlsZXNUb0RCOiBmdW5jdGlvbihwYXRocywgb25sb2FkLCBvbmVycm9yKSB7XG4gICAgICAgICAgICAgICAgb25sb2FkID0gb25sb2FkIHx8IGZ1bmN0aW9uKCkge307XG4gICAgICAgICAgICAgICAgb25lcnJvciA9IG9uZXJyb3IgfHwgZnVuY3Rpb24oKSB7fTtcbiAgICAgICAgICAgICAgICB2YXIgaW5kZXhlZERCID0gRlMuaW5kZXhlZERCKCk7XG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG9wZW5SZXF1ZXN0ID0gaW5kZXhlZERCLm9wZW4oXG4gICAgICAgICAgICAgICAgICAgICAgICBGUy5EQl9OQU1FKCksXG4gICAgICAgICAgICAgICAgICAgICAgICBGUy5EQl9WRVJTSU9OXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb25lcnJvcihlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgb3BlblJlcXVlc3Qub251cGdyYWRlbmVlZGVkID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKCdjcmVhdGluZyBkYicpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZGIgPSBvcGVuUmVxdWVzdC5yZXN1bHQ7XG4gICAgICAgICAgICAgICAgICAgIGRiLmNyZWF0ZU9iamVjdFN0b3JlKEZTLkRCX1NUT1JFX05BTUUpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgb3BlblJlcXVlc3Qub25zdWNjZXNzID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBkYiA9IG9wZW5SZXF1ZXN0LnJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRyYW5zYWN0aW9uID0gZGIudHJhbnNhY3Rpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICBbRlMuREJfU1RPUkVfTkFNRV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVhZHdyaXRlJ1xuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZmlsZXMgPSB0cmFuc2FjdGlvbi5vYmplY3RTdG9yZShGUy5EQl9TVE9SRV9OQU1FKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG9rID0gMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZhaWwgPSAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgdG90YWwgPSBwYXRocy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGZpbmlzaCgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmYWlsID09IDApIG9ubG9hZCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBvbmVycm9yKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcGF0aHMuZm9yRWFjaChmdW5jdGlvbihwYXRoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHV0UmVxdWVzdCA9IGZpbGVzLnB1dChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUy5hbmFseXplUGF0aChwYXRoKS5vYmplY3QuY29udGVudHMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aFxuICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFJlcXVlc3Qub25zdWNjZXNzID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb2srKztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob2sgKyBmYWlsID09IHRvdGFsKSBmaW5pc2goKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRSZXF1ZXN0Lm9uZXJyb3IgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWlsKys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9rICsgZmFpbCA9PSB0b3RhbCkgZmluaXNoKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgdHJhbnNhY3Rpb24ub25lcnJvciA9IG9uZXJyb3I7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBvcGVuUmVxdWVzdC5vbmVycm9yID0gb25lcnJvcjtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsb2FkRmlsZXNGcm9tREI6IGZ1bmN0aW9uKHBhdGhzLCBvbmxvYWQsIG9uZXJyb3IpIHtcbiAgICAgICAgICAgICAgICBvbmxvYWQgPSBvbmxvYWQgfHwgZnVuY3Rpb24oKSB7fTtcbiAgICAgICAgICAgICAgICBvbmVycm9yID0gb25lcnJvciB8fCBmdW5jdGlvbigpIHt9O1xuICAgICAgICAgICAgICAgIHZhciBpbmRleGVkREIgPSBGUy5pbmRleGVkREIoKTtcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgb3BlblJlcXVlc3QgPSBpbmRleGVkREIub3BlbihcbiAgICAgICAgICAgICAgICAgICAgICAgIEZTLkRCX05BTUUoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIEZTLkRCX1ZFUlNJT05cbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBvbmVycm9yKGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBvcGVuUmVxdWVzdC5vbnVwZ3JhZGVuZWVkZWQgPSBvbmVycm9yOyAvLyBubyBkYXRhYmFzZSB0byBsb2FkIGZyb21cbiAgICAgICAgICAgICAgICBvcGVuUmVxdWVzdC5vbnN1Y2Nlc3MgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRiID0gb3BlblJlcXVlc3QucmVzdWx0O1xuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRyYW5zYWN0aW9uID0gZGIudHJhbnNhY3Rpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgW0ZTLkRCX1NUT1JFX05BTUVdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdyZWFkb25seSdcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uZXJyb3IoZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdmFyIGZpbGVzID0gdHJhbnNhY3Rpb24ub2JqZWN0U3RvcmUoRlMuREJfU1RPUkVfTkFNRSk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBvayA9IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICBmYWlsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvdGFsID0gcGF0aHMubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBmaW5pc2goKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmFpbCA9PSAwKSBvbmxvYWQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Ugb25lcnJvcigpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHBhdGhzLmZvckVhY2goZnVuY3Rpb24ocGF0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGdldFJlcXVlc3QgPSBmaWxlcy5nZXQocGF0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBnZXRSZXF1ZXN0Lm9uc3VjY2VzcyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGUy5hbmFseXplUGF0aChwYXRoKS5leGlzdHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlMudW5saW5rKHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUy5jcmVhdGVEYXRhRmlsZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUEFUSC5kaXJuYW1lKHBhdGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQQVRILmJhc2VuYW1lKHBhdGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRSZXF1ZXN0LnJlc3VsdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb2srKztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob2sgKyBmYWlsID09IHRvdGFsKSBmaW5pc2goKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICBnZXRSZXF1ZXN0Lm9uZXJyb3IgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWlsKys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9rICsgZmFpbCA9PSB0b3RhbCkgZmluaXNoKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgdHJhbnNhY3Rpb24ub25lcnJvciA9IG9uZXJyb3I7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBvcGVuUmVxdWVzdC5vbmVycm9yID0gb25lcnJvcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgZnVuY3Rpb24gX29wZW4ocGF0aCwgb2ZsYWcsIHZhcmFyZ3MpIHtcbiAgICAgICAgICAgIC8vIGludCBvcGVuKGNvbnN0IGNoYXIgKnBhdGgsIGludCBvZmxhZywgLi4uKTtcbiAgICAgICAgICAgIC8vIGh0dHA6Ly9wdWJzLm9wZW5ncm91cC5vcmcvb25saW5lcHVicy8wMDk2OTUzOTkvZnVuY3Rpb25zL29wZW4uaHRtbFxuICAgICAgICAgICAgdmFyIG1vZGUgPSBIRUFQMzJbdmFyYXJncyA+PiAyXTtcbiAgICAgICAgICAgIHBhdGggPSBQb2ludGVyX3N0cmluZ2lmeShwYXRoKTtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgdmFyIHN0cmVhbSA9IEZTLm9wZW4ocGF0aCwgb2ZsYWcsIG1vZGUpO1xuICAgICAgICAgICAgICAgIHJldHVybiBzdHJlYW0uZmQ7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgRlMuaGFuZGxlRlNFcnJvcihlKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gLTE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX2ZvcGVuKGZpbGVuYW1lLCBtb2RlKSB7XG4gICAgICAgICAgICAvLyBGSUxFICpmb3Blbihjb25zdCBjaGFyICpyZXN0cmljdCBmaWxlbmFtZSwgY29uc3QgY2hhciAqcmVzdHJpY3QgbW9kZSk7XG4gICAgICAgICAgICAvLyBodHRwOi8vcHVicy5vcGVuZ3JvdXAub3JnL29ubGluZXB1YnMvMDAwMDk1Mzk5L2Z1bmN0aW9ucy9mb3Blbi5odG1sXG4gICAgICAgICAgICB2YXIgZmxhZ3M7XG4gICAgICAgICAgICBtb2RlID0gUG9pbnRlcl9zdHJpbmdpZnkobW9kZSk7XG4gICAgICAgICAgICBpZiAobW9kZVswXSA9PSAncicpIHtcbiAgICAgICAgICAgICAgICBpZiAobW9kZS5pbmRleE9mKCcrJykgIT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgZmxhZ3MgPSAyO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGZsYWdzID0gMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1vZGVbMF0gPT0gJ3cnKSB7XG4gICAgICAgICAgICAgICAgaWYgKG1vZGUuaW5kZXhPZignKycpICE9IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIGZsYWdzID0gMjtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBmbGFncyA9IDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGZsYWdzIHw9IDY0O1xuICAgICAgICAgICAgICAgIGZsYWdzIHw9IDUxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobW9kZVswXSA9PSAnYScpIHtcbiAgICAgICAgICAgICAgICBpZiAobW9kZS5pbmRleE9mKCcrJykgIT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgZmxhZ3MgPSAyO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGZsYWdzID0gMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZmxhZ3MgfD0gNjQ7XG4gICAgICAgICAgICAgICAgZmxhZ3MgfD0gMTAyNDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgX19fc2V0RXJyTm8oRVJSTk9fQ09ERVMuRUlOVkFMKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciByZXQgPSBfb3BlbihcbiAgICAgICAgICAgICAgICBmaWxlbmFtZSxcbiAgICAgICAgICAgICAgICBmbGFncyxcbiAgICAgICAgICAgICAgICBhbGxvY2F0ZShbMHgxZmYsIDAsIDAsIDBdLCAnaTMyJywgQUxMT0NfU1RBQ0spXG4gICAgICAgICAgICApOyAvLyBBbGwgY3JlYXRpb24gcGVybWlzc2lvbnMuXG4gICAgICAgICAgICByZXR1cm4gcmV0ID09IC0xID8gMCA6IHJldDtcbiAgICAgICAgfVxuICAgICAgICBNb2R1bGVbJ19zdHJsZW4nXSA9IF9zdHJsZW47XG4gICAgICAgIE1vZHVsZVsnX3N0cmNweSddID0gX3N0cmNweTtcbiAgICAgICAgTW9kdWxlWydfc3RyY2F0J10gPSBfc3RyY2F0O1xuICAgICAgICB2YXIgU09DS0ZTID0ge1xuICAgICAgICAgICAgbW91bnQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBGUy5jcmVhdGVOb2RlKG51bGwsICcvJywgMTYzODQgfCAwbzc3NywgMCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY3JlYXRlU29ja2V0OiBmdW5jdGlvbihmYW1pbHksIHR5cGUsIHByb3RvY29sKSB7XG4gICAgICAgICAgICAgICAgdmFyIHN0cmVhbWluZyA9IHR5cGUgPT0gMTtcbiAgICAgICAgICAgICAgICBpZiAocHJvdG9jb2wpIHtcbiAgICAgICAgICAgICAgICAgICAgYXNzZXJ0KHN0cmVhbWluZyA9PSAocHJvdG9jb2wgPT0gNikpOyAvLyBpZiBTT0NLX1NUUkVBTSwgbXVzdCBiZSB0Y3BcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gY3JlYXRlIG91ciBpbnRlcm5hbCBzb2NrZXQgc3RydWN0dXJlXG4gICAgICAgICAgICAgICAgdmFyIHNvY2sgPSB7XG4gICAgICAgICAgICAgICAgICAgIGZhbWlseTogZmFtaWx5LFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiB0eXBlLFxuICAgICAgICAgICAgICAgICAgICBwcm90b2NvbDogcHJvdG9jb2wsXG4gICAgICAgICAgICAgICAgICAgIHNlcnZlcjogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgcGVlcnM6IHt9LFxuICAgICAgICAgICAgICAgICAgICBwZW5kaW5nOiBbXSxcbiAgICAgICAgICAgICAgICAgICAgcmVjdl9xdWV1ZTogW10sXG4gICAgICAgICAgICAgICAgICAgIHNvY2tfb3BzOiBTT0NLRlMud2Vic29ja2V0X3NvY2tfb3BzXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAvLyBjcmVhdGUgdGhlIGZpbGVzeXN0ZW0gbm9kZSB0byBzdG9yZSB0aGUgc29ja2V0IHN0cnVjdHVyZVxuICAgICAgICAgICAgICAgIHZhciBuYW1lID0gU09DS0ZTLm5leHRuYW1lKCk7XG4gICAgICAgICAgICAgICAgdmFyIG5vZGUgPSBGUy5jcmVhdGVOb2RlKFNPQ0tGUy5yb290LCBuYW1lLCA0OTE1MiwgMCk7XG4gICAgICAgICAgICAgICAgbm9kZS5zb2NrID0gc29jaztcbiAgICAgICAgICAgICAgICAvLyBhbmQgdGhlIHdyYXBwaW5nIHN0cmVhbSB0aGF0IGVuYWJsZXMgbGlicmFyeSBmdW5jdGlvbnMgc3VjaFxuICAgICAgICAgICAgICAgIC8vIGFzIHJlYWQgYW5kIHdyaXRlIHRvIGluZGlyZWN0bHkgaW50ZXJhY3Qgd2l0aCB0aGUgc29ja2V0XG4gICAgICAgICAgICAgICAgdmFyIHN0cmVhbSA9IEZTLmNyZWF0ZVN0cmVhbSh7XG4gICAgICAgICAgICAgICAgICAgIHBhdGg6IG5hbWUsXG4gICAgICAgICAgICAgICAgICAgIG5vZGU6IG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIGZsYWdzOiBGUy5tb2RlU3RyaW5nVG9GbGFncygncisnKSxcbiAgICAgICAgICAgICAgICAgICAgc2Vla2FibGU6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICBzdHJlYW1fb3BzOiBTT0NLRlMuc3RyZWFtX29wc1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIC8vIG1hcCB0aGUgbmV3IHN0cmVhbSB0byB0aGUgc29ja2V0IHN0cnVjdHVyZSAoc29ja2V0cyBoYXZlIGEgMToxXG4gICAgICAgICAgICAgICAgLy8gcmVsYXRpb25zaGlwIHdpdGggYSBzdHJlYW0pXG4gICAgICAgICAgICAgICAgc29jay5zdHJlYW0gPSBzdHJlYW07XG4gICAgICAgICAgICAgICAgcmV0dXJuIHNvY2s7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZ2V0U29ja2V0OiBmdW5jdGlvbihmZCkge1xuICAgICAgICAgICAgICAgIHZhciBzdHJlYW0gPSBGUy5nZXRTdHJlYW0oZmQpO1xuICAgICAgICAgICAgICAgIGlmICghc3RyZWFtIHx8ICFGUy5pc1NvY2tldChzdHJlYW0ubm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHN0cmVhbS5ub2RlLnNvY2s7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc3RyZWFtX29wczoge1xuICAgICAgICAgICAgICAgIHBvbGw6IGZ1bmN0aW9uKHN0cmVhbSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgc29jayA9IHN0cmVhbS5ub2RlLnNvY2s7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzb2NrLnNvY2tfb3BzLnBvbGwoc29jayk7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBpb2N0bDogZnVuY3Rpb24oc3RyZWFtLCByZXF1ZXN0LCB2YXJhcmdzKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBzb2NrID0gc3RyZWFtLm5vZGUuc29jaztcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNvY2suc29ja19vcHMuaW9jdGwoc29jaywgcmVxdWVzdCwgdmFyYXJncyk7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICByZWFkOiBmdW5jdGlvbihzdHJlYW0sIGJ1ZmZlciwgb2Zmc2V0LCBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNvY2sgPSBzdHJlYW0ubm9kZS5zb2NrO1xuICAgICAgICAgICAgICAgICAgICB2YXIgbXNnID0gc29jay5zb2NrX29wcy5yZWN2bXNnKHNvY2ssIGxlbmd0aCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghbXNnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzb2NrZXQgaXMgY2xvc2VkXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBidWZmZXIuc2V0KG1zZy5idWZmZXIsIG9mZnNldCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtc2cuYnVmZmVyLmxlbmd0aDtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHdyaXRlOiBmdW5jdGlvbihzdHJlYW0sIGJ1ZmZlciwgb2Zmc2V0LCBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNvY2sgPSBzdHJlYW0ubm9kZS5zb2NrO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc29jay5zb2NrX29wcy5zZW5kbXNnKHNvY2ssIGJ1ZmZlciwgb2Zmc2V0LCBsZW5ndGgpO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgY2xvc2U6IGZ1bmN0aW9uKHN0cmVhbSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgc29jayA9IHN0cmVhbS5ub2RlLnNvY2s7XG4gICAgICAgICAgICAgICAgICAgIHNvY2suc29ja19vcHMuY2xvc2Uoc29jayk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG5leHRuYW1lOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBpZiAoIVNPQ0tGUy5uZXh0bmFtZS5jdXJyZW50KSB7XG4gICAgICAgICAgICAgICAgICAgIFNPQ0tGUy5uZXh0bmFtZS5jdXJyZW50ID0gMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuICdzb2NrZXRbJyArIFNPQ0tGUy5uZXh0bmFtZS5jdXJyZW50KysgKyAnXSc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgd2Vic29ja2V0X3NvY2tfb3BzOiB7XG4gICAgICAgICAgICAgICAgY3JlYXRlUGVlcjogZnVuY3Rpb24oc29jaywgYWRkciwgcG9ydCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgd3M7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgYWRkciA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdzID0gYWRkcjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFkZHIgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgcG9ydCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKHdzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBmb3Igc29ja2V0cyB0aGF0J3ZlIGFscmVhZHkgY29ubmVjdGVkIChlLmcuIHdlJ3JlIHRoZSBzZXJ2ZXIpXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB3ZSBjYW4gaW5zcGVjdCB0aGUgX3NvY2tldCBwcm9wZXJ0eSBmb3IgdGhlIGFkZHJlc3NcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh3cy5fc29ja2V0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkciA9IHdzLl9zb2NrZXQucmVtb3RlQWRkcmVzcztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3J0ID0gd3MuX3NvY2tldC5yZW1vdGVQb3J0O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgd2UncmUganVzdCBub3cgaW5pdGlhbGl6aW5nIGEgY29ubmVjdGlvbiB0byB0aGUgcmVtb3RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW5zcGVjdCB0aGUgdXJsIHByb3BlcnR5XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVzdWx0ID0gL3dzW3NdPzpcXC9cXC8oW146XSspOihcXGQrKS8uZXhlYyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3MudXJsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXJlc3VsdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnV2ViU29ja2V0IFVSTCBtdXN0IGJlIGluIHRoZSBmb3JtYXQgd3Mocyk6Ly9hZGRyZXNzOnBvcnQnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZHIgPSByZXN1bHRbMV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9ydCA9IHBhcnNlSW50KHJlc3VsdFsyXSwgMTApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gY3JlYXRlIHRoZSBhY3R1YWwgd2Vic29ja2V0IG9iamVjdCBhbmQgY29ubmVjdFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdXJsID0gJ3dzOi8vJyArIGFkZHIgKyAnOicgKyBwb3J0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBub2RlIHdzIGxpYnJhcnkgQVBJIGlzIHNsaWdodGx5IGRpZmZlcmVudCB0aGFuIHRoZSBicm93c2VyJ3NcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb3B0cyA9IFsnYmluYXJ5J107XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd3MgPSBuZXcgV2ViU29ja2V0KHVybCwgb3B0cyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd3MuYmluYXJ5VHlwZSA9ICdhcnJheWJ1ZmZlcic7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUhPU1RVTlJFQUNIKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB2YXIgcGVlciA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFkZHI6IGFkZHIsXG4gICAgICAgICAgICAgICAgICAgICAgICBwb3J0OiBwb3J0LFxuICAgICAgICAgICAgICAgICAgICAgICAgc29ja2V0OiB3cyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRncmFtX3NlbmRfcXVldWU6IFtdXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIFNPQ0tGUy53ZWJzb2NrZXRfc29ja19vcHMuYWRkUGVlcihzb2NrLCBwZWVyKTtcbiAgICAgICAgICAgICAgICAgICAgU09DS0ZTLndlYnNvY2tldF9zb2NrX29wcy5oYW5kbGVQZWVyRXZlbnRzKHNvY2ssIHBlZXIpO1xuICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGlzIGlzIGEgYm91bmQgZGdyYW0gc29ja2V0LCBzZW5kIHRoZSBwb3J0IG51bWJlciBmaXJzdCB0byBhbGxvd1xuICAgICAgICAgICAgICAgICAgICAvLyB1cyB0byBvdmVycmlkZSB0aGUgZXBoZW1lcmFsIHBvcnQgcmVwb3J0ZWQgdG8gdXMgYnkgcmVtb3RlUG9ydCBvbiB0aGVcbiAgICAgICAgICAgICAgICAgICAgLy8gcmVtb3RlIGVuZC5cbiAgICAgICAgICAgICAgICAgICAgaWYgKHNvY2sudHlwZSA9PT0gMiAmJiB0eXBlb2Ygc29jay5zcG9ydCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBlZXIuZGdyYW1fc2VuZF9xdWV1ZS5wdXNoKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBVaW50OEFycmF5KFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjU1LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI1NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjU1LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAncCcuY2hhckNvZGVBdCgwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ28nLmNoYXJDb2RlQXQoMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdyJy5jaGFyQ29kZUF0KDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAndCcuY2hhckNvZGVBdCgwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHNvY2suc3BvcnQgJiAweGZmMDApID4+IDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvY2suc3BvcnQgJiAweGZmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSlcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBlZXI7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBnZXRQZWVyOiBmdW5jdGlvbihzb2NrLCBhZGRyLCBwb3J0KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzb2NrLnBlZXJzW2FkZHIgKyAnOicgKyBwb3J0XTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIGFkZFBlZXI6IGZ1bmN0aW9uKHNvY2ssIHBlZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgc29jay5wZWVyc1twZWVyLmFkZHIgKyAnOicgKyBwZWVyLnBvcnRdID0gcGVlcjtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHJlbW92ZVBlZXI6IGZ1bmN0aW9uKHNvY2ssIHBlZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHNvY2sucGVlcnNbcGVlci5hZGRyICsgJzonICsgcGVlci5wb3J0XTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIGhhbmRsZVBlZXJFdmVudHM6IGZ1bmN0aW9uKHNvY2ssIHBlZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZpcnN0ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGhhbmRsZU9wZW4gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHF1ZXVlZCA9IHBlZXIuZGdyYW1fc2VuZF9xdWV1ZS5zaGlmdCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChxdWV1ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVlci5zb2NrZXQuc2VuZChxdWV1ZWQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWV1ZWQgPSBwZWVyLmRncmFtX3NlbmRfcXVldWUuc2hpZnQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm90IG11Y2ggd2UgY2FuIGRvIGhlcmUgaW4gdGhlIHdheSBvZiBwcm9wZXIgZXJyb3IgaGFuZGxpbmcgYXMgd2UndmUgYWxyZWFkeVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxpZWQgYW5kIHNhaWQgdGhpcyBkYXRhIHdhcyBzZW50LiBzaHV0IGl0IGRvd24uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVlci5zb2NrZXQuY2xvc2UoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGhhbmRsZU1lc3NhZ2UgPSBmdW5jdGlvbihkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhc3NlcnQoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZW9mIGRhdGEgIT09ICdzdHJpbmcnICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEuYnl0ZUxlbmd0aCAhPT0gdW5kZWZpbmVkXG4gICAgICAgICAgICAgICAgICAgICAgICApOyAvLyBtdXN0IHJlY2VpdmUgYW4gQXJyYXlCdWZmZXJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEgPSBuZXcgVWludDhBcnJheShkYXRhKTsgLy8gbWFrZSBhIHR5cGVkIGFycmF5IHZpZXcgb24gdGhlIGFycmF5IGJ1ZmZlclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGhpcyBpcyB0aGUgcG9ydCBtZXNzYWdlLCBvdmVycmlkZSB0aGUgcGVlcidzIHBvcnQgd2l0aCBpdFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHdhc2ZpcnN0ID0gZmlyc3Q7XG4gICAgICAgICAgICAgICAgICAgICAgICBmaXJzdCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdhc2ZpcnN0ICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5sZW5ndGggPT09IDEwICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVswXSA9PT0gMjU1ICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVsxXSA9PT0gMjU1ICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVsyXSA9PT0gMjU1ICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVszXSA9PT0gMjU1ICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVs0XSA9PT0gJ3AnLmNoYXJDb2RlQXQoMCkgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzVdID09PSAnbycuY2hhckNvZGVBdCgwKSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbNl0gPT09ICdyJy5jaGFyQ29kZUF0KDApICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVs3XSA9PT0gJ3QnLmNoYXJDb2RlQXQoMClcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVwZGF0ZSB0aGUgcGVlcidzIHBvcnQgYW5kIGl0J3Mga2V5IGluIHRoZSBwZWVyIG1hcFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuZXdwb3J0ID0gKGRhdGFbOF0gPDwgOCkgfCBkYXRhWzldO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNPQ0tGUy53ZWJzb2NrZXRfc29ja19vcHMucmVtb3ZlUGVlcihzb2NrLCBwZWVyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZWVyLnBvcnQgPSBuZXdwb3J0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNPQ0tGUy53ZWJzb2NrZXRfc29ja19vcHMuYWRkUGVlcihzb2NrLCBwZWVyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBzb2NrLnJlY3ZfcXVldWUucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkcjogcGVlci5hZGRyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvcnQ6IHBlZXIucG9ydCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiBkYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgcGVlci5zb2NrZXQub25vcGVuID0gaGFuZGxlT3BlbjtcbiAgICAgICAgICAgICAgICAgICAgcGVlci5zb2NrZXQub25tZXNzYWdlID0gZnVuY3Rpb24oZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZU1lc3NhZ2UoZXZlbnQuZGF0YSk7XG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBwb2xsOiBmdW5jdGlvbihzb2NrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzb2NrLnR5cGUgPT09IDEgJiYgc29jay5zZXJ2ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxpc3RlbiBzb2NrZXRzIHNob3VsZCBvbmx5IHNheSB0aGV5J3JlIGF2YWlsYWJsZSBmb3IgcmVhZGluZ1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGhlcmUgYXJlIHBlbmRpbmcgY2xpZW50cy5cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzb2NrLnBlbmRpbmcubGVuZ3RoID8gNjQgfCAxIDogMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB2YXIgbWFzayA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHZhciBkZXN0ID1cbiAgICAgICAgICAgICAgICAgICAgICAgIHNvY2sudHlwZSA9PT0gMSAvLyB3ZSBvbmx5IGNhcmUgYWJvdXQgdGhlIHNvY2tldCBzdGF0ZSBmb3IgY29ubmVjdGlvbi1iYXNlZCBzb2NrZXRzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBTT0NLRlMud2Vic29ja2V0X3NvY2tfb3BzLmdldFBlZXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc29jayxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb2NrLmRhZGRyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvY2suZHBvcnRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIHNvY2sucmVjdl9xdWV1ZS5sZW5ndGggfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICFkZXN0IHx8IC8vIGNvbm5lY3Rpb24tbGVzcyBzb2NrZXRzIGFyZSBhbHdheXMgcmVhZHkgdG8gcmVhZFxuICAgICAgICAgICAgICAgICAgICAgICAgKGRlc3QgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXN0LnNvY2tldC5yZWFkeVN0YXRlID09PSBkZXN0LnNvY2tldC5DTE9TSU5HKSB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgKGRlc3QgJiYgZGVzdC5zb2NrZXQucmVhZHlTdGF0ZSA9PT0gZGVzdC5zb2NrZXQuQ0xPU0VEKVxuICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxldCByZWN2IHJldHVybiAwIG9uY2UgY2xvc2VkXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXNrIHw9IDY0IHwgMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAhZGVzdCB8fCAvLyBjb25uZWN0aW9uLWxlc3Mgc29ja2V0cyBhcmUgYWx3YXlzIHJlYWR5IHRvIHdyaXRlXG4gICAgICAgICAgICAgICAgICAgICAgICAoZGVzdCAmJiBkZXN0LnNvY2tldC5yZWFkeVN0YXRlID09PSBkZXN0LnNvY2tldC5PUEVOKVxuICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hc2sgfD0gNDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAoZGVzdCAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc3Quc29ja2V0LnJlYWR5U3RhdGUgPT09IGRlc3Quc29ja2V0LkNMT1NJTkcpIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAoZGVzdCAmJiBkZXN0LnNvY2tldC5yZWFkeVN0YXRlID09PSBkZXN0LnNvY2tldC5DTE9TRUQpXG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWFzayB8PSAxNjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbWFzaztcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIGlvY3RsOiBmdW5jdGlvbihzb2NrLCByZXF1ZXN0LCBhcmcpIHtcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChyZXF1ZXN0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDIxNTMxOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBieXRlcyA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNvY2sucmVjdl9xdWV1ZS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZXMgPSBzb2NrLnJlY3ZfcXVldWVbMF0uZGF0YS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhFQVAzMlthcmcgPj4gMl0gPSBieXRlcztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk5PX0NPREVTLkVJTlZBTDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgY2xvc2U6IGZ1bmN0aW9uKHNvY2spIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gaWYgd2UndmUgc3Bhd25lZCBhIGxpc3RlbiBzZXJ2ZXIsIGNsb3NlIGl0XG4gICAgICAgICAgICAgICAgICAgIGlmIChzb2NrLnNlcnZlcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb2NrLnNlcnZlci5jbG9zZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cbiAgICAgICAgICAgICAgICAgICAgICAgIHNvY2suc2VydmVyID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBjbG9zZSBhbnkgcGVlciBjb25uZWN0aW9uc1xuICAgICAgICAgICAgICAgICAgICB2YXIgcGVlcnMgPSBPYmplY3Qua2V5cyhzb2NrLnBlZXJzKTtcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBwZWVycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBlZXIgPSBzb2NrLnBlZXJzW3BlZXJzW2ldXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVlci5zb2NrZXQuY2xvc2UoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XG4gICAgICAgICAgICAgICAgICAgICAgICBTT0NLRlMud2Vic29ja2V0X3NvY2tfb3BzLnJlbW92ZVBlZXIoc29jaywgcGVlcik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBiaW5kOiBmdW5jdGlvbihzb2NrLCBhZGRyLCBwb3J0KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVvZiBzb2NrLnNhZGRyICE9PSAndW5kZWZpbmVkJyB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZW9mIHNvY2suc3BvcnQgIT09ICd1bmRlZmluZWQnXG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUlOVkFMKTsgLy8gYWxyZWFkeSBib3VuZFxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHNvY2suc2FkZHIgPSBhZGRyO1xuICAgICAgICAgICAgICAgICAgICBzb2NrLnNwb3J0ID0gcG9ydCB8fCBfbWtwb3J0KCk7XG4gICAgICAgICAgICAgICAgICAgIC8vIGluIG9yZGVyIHRvIGVtdWxhdGUgZGdyYW0gc29ja2V0cywgd2UgbmVlZCB0byBsYXVuY2ggYSBsaXN0ZW4gc2VydmVyIHdoZW5cbiAgICAgICAgICAgICAgICAgICAgLy8gYmluZGluZyBvbiBhIGNvbm5lY3Rpb24tbGVzcyBzb2NrZXRcbiAgICAgICAgICAgICAgICAgICAgLy8gbm90ZTogdGhpcyBpcyBvbmx5IHJlcXVpcmVkIG9uIHRoZSBzZXJ2ZXIgc2lkZVxuICAgICAgICAgICAgICAgICAgICBpZiAoc29jay50eXBlID09PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBjbG9zZSB0aGUgZXhpc3Rpbmcgc2VydmVyIGlmIGl0IGV4aXN0c1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNvY2suc2VydmVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc29jay5zZXJ2ZXIuY2xvc2UoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb2NrLnNlcnZlciA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzd2FsbG93IGVycm9yIG9wZXJhdGlvbiBub3Qgc3VwcG9ydGVkIGVycm9yIHRoYXQgb2NjdXJzIHdoZW4gYmluZGluZyBpbiB0aGVcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGJyb3dzZXIgd2hlcmUgdGhpcyBpc24ndCBzdXBwb3J0ZWRcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc29jay5zb2NrX29wcy5saXN0ZW4oc29jaywgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEoZSBpbnN0YW5jZW9mIEZTLkVycm5vRXJyb3IpKSB0aHJvdyBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmVycm5vICE9PSBFUlJOT19DT0RFUy5FT1BOT1RTVVBQKSB0aHJvdyBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBjb25uZWN0OiBmdW5jdGlvbihzb2NrLCBhZGRyLCBwb3J0KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzb2NrLnNlcnZlcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09EUy5FT1BOT1RTVVBQKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBUT0RPIGF1dG9iaW5kXG4gICAgICAgICAgICAgICAgICAgIC8vIGlmICghc29jay5hZGRyICYmIHNvY2sudHlwZSA9PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIH1cbiAgICAgICAgICAgICAgICAgICAgLy8gZWFybHkgb3V0IGlmIHdlJ3JlIGFscmVhZHkgY29ubmVjdGVkIC8gaW4gdGhlIG1pZGRsZSBvZiBjb25uZWN0aW5nXG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVvZiBzb2NrLmRhZGRyICE9PSAndW5kZWZpbmVkJyAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZW9mIHNvY2suZHBvcnQgIT09ICd1bmRlZmluZWQnXG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRlc3QgPSBTT0NLRlMud2Vic29ja2V0X3NvY2tfb3BzLmdldFBlZXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc29jayxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb2NrLmRhZGRyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvY2suZHBvcnRcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGVzdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdC5zb2NrZXQucmVhZHlTdGF0ZSA9PT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdC5zb2NrZXQuQ09OTkVDVElOR1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FQUxSRUFEWSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUlTQ09OTik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIC8vIGFkZCB0aGUgc29ja2V0IHRvIG91ciBwZWVyIGxpc3QgYW5kIHNldCBvdXJcbiAgICAgICAgICAgICAgICAgICAgLy8gZGVzdGluYXRpb24gYWRkcmVzcyAvIHBvcnQgdG8gbWF0Y2hcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBlZXIgPSBTT0NLRlMud2Vic29ja2V0X3NvY2tfb3BzLmNyZWF0ZVBlZXIoXG4gICAgICAgICAgICAgICAgICAgICAgICBzb2NrLFxuICAgICAgICAgICAgICAgICAgICAgICAgYWRkcixcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvcnRcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgc29jay5kYWRkciA9IHBlZXIuYWRkcjtcbiAgICAgICAgICAgICAgICAgICAgc29jay5kcG9ydCA9IHBlZXIucG9ydDtcbiAgICAgICAgICAgICAgICAgICAgLy8gYWx3YXlzIFwiZmFpbFwiIGluIG5vbi1ibG9ja2luZyBtb2RlXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlBST0dSRVNTKTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIGxpc3RlbjogZnVuY3Rpb24oc29jaykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoc29jay5zZXJ2ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlZBTCk7IC8vIGFscmVhZHkgbGlzdGVuaW5nXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdmFyIFdlYlNvY2tldFNlcnZlciA9IHJlcXVpcmUoJ3dzJykuU2VydmVyO1xuICAgICAgICAgICAgICAgICAgICB2YXIgaG9zdCA9IHNvY2suc2FkZHI7XG4gICAgICAgICAgICAgICAgICAgIHNvY2suc2VydmVyID0gbmV3IFdlYlNvY2tldFNlcnZlcih7XG4gICAgICAgICAgICAgICAgICAgICAgICBob3N0OiBob3N0LFxuICAgICAgICAgICAgICAgICAgICAgICAgcG9ydDogc29jay5zcG9ydFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgc29jay5zZXJ2ZXIub24oJ2Nvbm5lY3Rpb24nLCBmdW5jdGlvbih3cykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNvY2sudHlwZSA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuZXdzb2NrID0gU09DS0ZTLmNyZWF0ZVNvY2tldChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc29jay5mYW1pbHksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvY2sudHlwZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc29jay5wcm90b2NvbFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY3JlYXRlIGEgcGVlciBvbiB0aGUgbmV3IHNvY2tldFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwZWVyID0gU09DS0ZTLndlYnNvY2tldF9zb2NrX29wcy5jcmVhdGVQZWVyKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdzb2NrLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3c29jay5kYWRkciA9IHBlZXIuYWRkcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdzb2NrLmRwb3J0ID0gcGVlci5wb3J0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHB1c2ggdG8gcXVldWUgZm9yIGFjY2VwdCB0byBwaWNrIHVwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc29jay5wZW5kaW5nLnB1c2gobmV3c29jayk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNyZWF0ZSBhIHBlZXIgb24gdGhlIGxpc3RlbiBzb2NrZXQgc28gY2FsbGluZyBzZW5kdG9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3aXRoIHRoZSBsaXN0ZW4gc29ja2V0IGFuZCBhbiBhZGRyZXNzIHdpbGwgcmVzb2x2ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRvIHRoZSBjb3JyZWN0IGNsaWVudFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNPQ0tGUy53ZWJzb2NrZXRfc29ja19vcHMuY3JlYXRlUGVlcihzb2NrLCB3cyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBzb2NrLnNlcnZlci5vbignY2xvc2VkJywgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzb2NrLnNlcnZlciA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBzb2NrLnNlcnZlci5vbignZXJyb3InLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRvbid0IHRocm93XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgYWNjZXB0OiBmdW5jdGlvbihsaXN0ZW5zb2NrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghbGlzdGVuc29jay5zZXJ2ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlZBTCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdmFyIG5ld3NvY2sgPSBsaXN0ZW5zb2NrLnBlbmRpbmcuc2hpZnQoKTtcbiAgICAgICAgICAgICAgICAgICAgbmV3c29jay5zdHJlYW0uZmxhZ3MgPSBsaXN0ZW5zb2NrLnN0cmVhbS5mbGFncztcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ld3NvY2s7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBnZXRuYW1lOiBmdW5jdGlvbihzb2NrLCBwZWVyKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBhZGRyLCBwb3J0O1xuICAgICAgICAgICAgICAgICAgICBpZiAocGVlcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvY2suZGFkZHIgPT09IHVuZGVmaW5lZCB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvY2suZHBvcnQgPT09IHVuZGVmaW5lZFxuICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRU5PVENPTk4pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYWRkciA9IHNvY2suZGFkZHI7XG4gICAgICAgICAgICAgICAgICAgICAgICBwb3J0ID0gc29jay5kcG9ydDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPRE8gc2FkZHIgYW5kIHNwb3J0IHdpbGwgYmUgc2V0IGZvciBiaW5kKCknZCBVRFAgc29ja2V0cywgYnV0IHdoYXRcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNob3VsZCB3ZSBiZSByZXR1cm5pbmcgZm9yIFRDUCBzb2NrZXRzIHRoYXQndmUgYmVlbiBjb25uZWN0KCknZD9cbiAgICAgICAgICAgICAgICAgICAgICAgIGFkZHIgPSBzb2NrLnNhZGRyIHx8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBwb3J0ID0gc29jay5zcG9ydCB8fCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7IGFkZHI6IGFkZHIsIHBvcnQ6IHBvcnQgfTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHNlbmRtc2c6IGZ1bmN0aW9uKHNvY2ssIGJ1ZmZlciwgb2Zmc2V0LCBsZW5ndGgsIGFkZHIsIHBvcnQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNvY2sudHlwZSA9PT0gMikge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29ubmVjdGlvbi1sZXNzIHNvY2tldHMgd2lsbCBob25vciB0aGUgbWVzc2FnZSBhZGRyZXNzLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYW5kIG90aGVyd2lzZSBmYWxsIGJhY2sgdG8gdGhlIGJvdW5kIGRlc3RpbmF0aW9uIGFkZHJlc3NcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhZGRyID09PSB1bmRlZmluZWQgfHwgcG9ydCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkciA9IHNvY2suZGFkZHI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9ydCA9IHNvY2suZHBvcnQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGVyZSB3YXMgbm8gYWRkcmVzcyB0byBmYWxsIGJhY2sgdG8sIGVycm9yIG91dFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFkZHIgPT09IHVuZGVmaW5lZCB8fCBwb3J0ID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FREVTVEFERFJSRVEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29ubmVjdGlvbi1iYXNlZCBzb2NrZXRzIHdpbGwgb25seSB1c2UgdGhlIGJvdW5kXG4gICAgICAgICAgICAgICAgICAgICAgICBhZGRyID0gc29jay5kYWRkcjtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvcnQgPSBzb2NrLmRwb3J0O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIC8vIGZpbmQgdGhlIHBlZXIgZm9yIHRoZSBkZXN0aW5hdGlvbiBhZGRyZXNzXG4gICAgICAgICAgICAgICAgICAgIHZhciBkZXN0ID0gU09DS0ZTLndlYnNvY2tldF9zb2NrX29wcy5nZXRQZWVyKFxuICAgICAgICAgICAgICAgICAgICAgICAgc29jayxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFkZHIsXG4gICAgICAgICAgICAgICAgICAgICAgICBwb3J0XG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIC8vIGVhcmx5IG91dCBpZiBub3QgY29ubmVjdGVkIHdpdGggYSBjb25uZWN0aW9uLWJhc2VkIHNvY2tldFxuICAgICAgICAgICAgICAgICAgICBpZiAoc29jay50eXBlID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIWRlc3QgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXN0LnNvY2tldC5yZWFkeVN0YXRlID09PSBkZXN0LnNvY2tldC5DTE9TSU5HIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdC5zb2NrZXQucmVhZHlTdGF0ZSA9PT0gZGVzdC5zb2NrZXQuQ0xPU0VEXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FTk9UQ09OTik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc3Quc29ja2V0LnJlYWR5U3RhdGUgPT09IGRlc3Quc29ja2V0LkNPTk5FQ1RJTkdcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVBR0FJTik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgLy8gY3JlYXRlIGEgY29weSBvZiB0aGUgaW5jb21pbmcgZGF0YSB0byBzZW5kLCBhcyB0aGUgV2ViU29ja2V0IEFQSVxuICAgICAgICAgICAgICAgICAgICAvLyBkb2Vzbid0IHdvcmsgZW50aXJlbHkgd2l0aCBhbiBBcnJheUJ1ZmZlclZpZXcsIGl0J2xsIGp1c3Qgc2VuZFxuICAgICAgICAgICAgICAgICAgICAvLyB0aGUgZW50aXJlIHVuZGVybHlpbmcgYnVmZmVyXG4gICAgICAgICAgICAgICAgICAgIHZhciBkYXRhO1xuICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICBidWZmZXIgaW5zdGFuY2VvZiBBcnJheSB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyIGluc3RhbmNlb2YgQXJyYXlCdWZmZXJcbiAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhID0gYnVmZmVyLnNsaWNlKG9mZnNldCwgb2Zmc2V0ICsgbGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIEFycmF5QnVmZmVyVmlld1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSA9IGJ1ZmZlci5idWZmZXIuc2xpY2UoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLmJ5dGVPZmZzZXQgKyBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLmJ5dGVPZmZzZXQgKyBvZmZzZXQgKyBsZW5ndGhcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgLy8gaWYgd2UncmUgZW11bGF0aW5nIGEgY29ubmVjdGlvbi1sZXNzIGRncmFtIHNvY2tldCBhbmQgZG9uJ3QgaGF2ZVxuICAgICAgICAgICAgICAgICAgICAvLyBhIGNhY2hlZCBjb25uZWN0aW9uLCBxdWV1ZSB0aGUgYnVmZmVyIHRvIHNlbmQgdXBvbiBjb25uZWN0IGFuZFxuICAgICAgICAgICAgICAgICAgICAvLyBsaWUsIHNheWluZyB0aGUgZGF0YSB3YXMgc2VudCBub3cuXG4gICAgICAgICAgICAgICAgICAgIGlmIChzb2NrLnR5cGUgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAhZGVzdCB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc3Quc29ja2V0LnJlYWR5U3RhdGUgIT09IGRlc3Quc29ja2V0Lk9QRU5cbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlmIHdlJ3JlIG5vdCBjb25uZWN0ZWQsIG9wZW4gYSBuZXcgY29ubmVjdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIWRlc3QgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdC5zb2NrZXQucmVhZHlTdGF0ZSA9PT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc3Quc29ja2V0LkNMT1NJTkcgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdC5zb2NrZXQucmVhZHlTdGF0ZSA9PT0gZGVzdC5zb2NrZXQuQ0xPU0VEXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc3QgPSBTT0NLRlMud2Vic29ja2V0X3NvY2tfb3BzLmNyZWF0ZVBlZXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb2NrLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkcixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvcnRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdC5kZ3JhbV9zZW5kX3F1ZXVlLnB1c2goZGF0YSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2VuZCB0aGUgYWN0dWFsIGRhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc3Quc29ja2V0LnNlbmQoZGF0YSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSU5WQUwpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICByZWN2bXNnOiBmdW5jdGlvbihzb2NrLCBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gaHR0cDovL3B1YnMub3Blbmdyb3VwLm9yZy9vbmxpbmVwdWJzLzc5MDg3OTkveG5zL3JlY3Ztc2cuaHRtbFxuICAgICAgICAgICAgICAgICAgICBpZiAoc29jay50eXBlID09PSAxICYmIHNvY2suc2VydmVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB0Y3Agc2VydmVycyBzaG91bGQgbm90IGJlIHJlY3YoKSdpbmcgb24gdGhlIGxpc3RlbiBzb2NrZXRcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOT1RDT05OKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB2YXIgcXVldWVkID0gc29jay5yZWN2X3F1ZXVlLnNoaWZ0KCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcXVldWVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc29jay50eXBlID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRlc3QgPSBTT0NLRlMud2Vic29ja2V0X3NvY2tfb3BzLmdldFBlZXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvY2ssXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvY2suZGFkZHIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvY2suZHBvcnRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZGVzdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiB3ZSBoYXZlIGEgZGVzdGluYXRpb24gYWRkcmVzcyBidXQgYXJlIG5vdCBjb25uZWN0ZWQsIGVycm9yIG91dFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FTk9UQ09OTik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdC5zb2NrZXQucmVhZHlTdGF0ZSA9PT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc3Quc29ja2V0LkNMT1NJTkcgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdC5zb2NrZXQucmVhZHlTdGF0ZSA9PT0gZGVzdC5zb2NrZXQuQ0xPU0VEXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJldHVybiBudWxsIGlmIHRoZSBzb2NrZXQgaGFzIGNsb3NlZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBlbHNlLCBvdXIgc29ja2V0IGlzIGluIGEgdmFsaWQgc3RhdGUgYnV0IHRydWx5IGhhcyBub3RoaW5nIGF2YWlsYWJsZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FQUdBSU4pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUFHQUlOKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBxdWV1ZWQuZGF0YSB3aWxsIGJlIGFuIEFycmF5QnVmZmVyIGlmIGl0J3MgdW5hZHVsdGVyYXRlZCwgYnV0IGlmIGl0J3NcbiAgICAgICAgICAgICAgICAgICAgLy8gcmVxdWV1ZWQgVENQIGRhdGEgaXQnbGwgYmUgYW4gQXJyYXlCdWZmZXJWaWV3XG4gICAgICAgICAgICAgICAgICAgIHZhciBxdWV1ZWRMZW5ndGggPVxuICAgICAgICAgICAgICAgICAgICAgICAgcXVldWVkLmRhdGEuYnl0ZUxlbmd0aCB8fCBxdWV1ZWQuZGF0YS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgIHZhciBxdWV1ZWRPZmZzZXQgPSBxdWV1ZWQuZGF0YS5ieXRlT2Zmc2V0IHx8IDA7XG4gICAgICAgICAgICAgICAgICAgIHZhciBxdWV1ZWRCdWZmZXIgPSBxdWV1ZWQuZGF0YS5idWZmZXIgfHwgcXVldWVkLmRhdGE7XG4gICAgICAgICAgICAgICAgICAgIHZhciBieXRlc1JlYWQgPSBNYXRoLm1pbihsZW5ndGgsIHF1ZXVlZExlbmd0aCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBidWZmZXI6IG5ldyBVaW50OEFycmF5KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1ZXVlZEJ1ZmZlcixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWV1ZWRPZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZXNSZWFkXG4gICAgICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgICAgICAgYWRkcjogcXVldWVkLmFkZHIsXG4gICAgICAgICAgICAgICAgICAgICAgICBwb3J0OiBxdWV1ZWQucG9ydFxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAvLyBwdXNoIGJhY2sgYW55IHVucmVhZCBkYXRhIGZvciBUQ1AgY29ubmVjdGlvbnNcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNvY2sudHlwZSA9PT0gMSAmJiBieXRlc1JlYWQgPCBxdWV1ZWRMZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBieXRlc1JlbWFpbmluZyA9IHF1ZXVlZExlbmd0aCAtIGJ5dGVzUmVhZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHF1ZXVlZC5kYXRhID0gbmV3IFVpbnQ4QXJyYXkoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVldWVkQnVmZmVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1ZXVlZE9mZnNldCArIGJ5dGVzUmVhZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlc1JlbWFpbmluZ1xuICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNvY2sucmVjdl9xdWV1ZS51bnNoaWZ0KHF1ZXVlZCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlcztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIGZ1bmN0aW9uIF9zZW5kKGZkLCBidWYsIGxlbiwgZmxhZ3MpIHtcbiAgICAgICAgICAgIHZhciBzb2NrID0gU09DS0ZTLmdldFNvY2tldChmZCk7XG4gICAgICAgICAgICBpZiAoIXNvY2spIHtcbiAgICAgICAgICAgICAgICBfX19zZXRFcnJObyhFUlJOT19DT0RFUy5FQkFERik7XG4gICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gVE9ETyBob25vciBmbGFnc1xuICAgICAgICAgICAgcmV0dXJuIF93cml0ZShmZCwgYnVmLCBsZW4pO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIF9wd3JpdGUoZmlsZGVzLCBidWYsIG5ieXRlLCBvZmZzZXQpIHtcbiAgICAgICAgICAgIC8vIHNzaXplX3QgcHdyaXRlKGludCBmaWxkZXMsIGNvbnN0IHZvaWQgKmJ1Ziwgc2l6ZV90IG5ieXRlLCBvZmZfdCBvZmZzZXQpO1xuICAgICAgICAgICAgLy8gaHR0cDovL3B1YnMub3Blbmdyb3VwLm9yZy9vbmxpbmVwdWJzLzAwMDA5NTM5OS9mdW5jdGlvbnMvd3JpdGUuaHRtbFxuICAgICAgICAgICAgdmFyIHN0cmVhbSA9IEZTLmdldFN0cmVhbShmaWxkZXMpO1xuICAgICAgICAgICAgaWYgKCFzdHJlYW0pIHtcbiAgICAgICAgICAgICAgICBfX19zZXRFcnJObyhFUlJOT19DT0RFUy5FQkFERik7XG4gICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICB2YXIgc2xhYiA9IEhFQVA4O1xuICAgICAgICAgICAgICAgIHJldHVybiBGUy53cml0ZShzdHJlYW0sIHNsYWIsIGJ1ZiwgbmJ5dGUsIG9mZnNldCk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgRlMuaGFuZGxlRlNFcnJvcihlKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gLTE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX3dyaXRlKGZpbGRlcywgYnVmLCBuYnl0ZSkge1xuICAgICAgICAgICAgLy8gc3NpemVfdCB3cml0ZShpbnQgZmlsZGVzLCBjb25zdCB2b2lkICpidWYsIHNpemVfdCBuYnl0ZSk7XG4gICAgICAgICAgICAvLyBodHRwOi8vcHVicy5vcGVuZ3JvdXAub3JnL29ubGluZXB1YnMvMDAwMDk1Mzk5L2Z1bmN0aW9ucy93cml0ZS5odG1sXG4gICAgICAgICAgICB2YXIgc3RyZWFtID0gRlMuZ2V0U3RyZWFtKGZpbGRlcyk7XG4gICAgICAgICAgICBpZiAoIXN0cmVhbSkge1xuICAgICAgICAgICAgICAgIF9fX3NldEVyck5vKEVSUk5PX0NPREVTLkVCQURGKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gLTE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHZhciBzbGFiID0gSEVBUDg7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEZTLndyaXRlKHN0cmVhbSwgc2xhYiwgYnVmLCBuYnl0ZSk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgRlMuaGFuZGxlRlNFcnJvcihlKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gLTE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX2Z3cml0ZShwdHIsIHNpemUsIG5pdGVtcywgc3RyZWFtKSB7XG4gICAgICAgICAgICAvLyBzaXplX3QgZndyaXRlKGNvbnN0IHZvaWQgKnJlc3RyaWN0IHB0ciwgc2l6ZV90IHNpemUsIHNpemVfdCBuaXRlbXMsIEZJTEUgKnJlc3RyaWN0IHN0cmVhbSk7XG4gICAgICAgICAgICAvLyBodHRwOi8vcHVicy5vcGVuZ3JvdXAub3JnL29ubGluZXB1YnMvMDAwMDk1Mzk5L2Z1bmN0aW9ucy9md3JpdGUuaHRtbFxuICAgICAgICAgICAgdmFyIGJ5dGVzVG9Xcml0ZSA9IG5pdGVtcyAqIHNpemU7XG4gICAgICAgICAgICBpZiAoYnl0ZXNUb1dyaXRlID09IDApIHJldHVybiAwO1xuICAgICAgICAgICAgdmFyIGJ5dGVzV3JpdHRlbiA9IF93cml0ZShzdHJlYW0sIHB0ciwgYnl0ZXNUb1dyaXRlKTtcbiAgICAgICAgICAgIGlmIChieXRlc1dyaXR0ZW4gPT0gLTEpIHtcbiAgICAgICAgICAgICAgICB2YXIgc3RyZWFtT2JqID0gRlMuZ2V0U3RyZWFtKHN0cmVhbSk7XG4gICAgICAgICAgICAgICAgaWYgKHN0cmVhbU9iaikgc3RyZWFtT2JqLmVycm9yID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIE1hdGguZmxvb3IoYnl0ZXNXcml0dGVuIC8gc2l6ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX19yZWFsbHlOZWdhdGl2ZSh4KSB7XG4gICAgICAgICAgICByZXR1cm4geCA8IDAgfHwgKHggPT09IDAgJiYgMSAvIHggPT09IC1JbmZpbml0eSk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX19mb3JtYXRTdHJpbmcoZm9ybWF0LCB2YXJhcmdzKSB7XG4gICAgICAgICAgICB2YXIgdGV4dEluZGV4ID0gZm9ybWF0O1xuICAgICAgICAgICAgdmFyIGFyZ0luZGV4ID0gMDtcbiAgICAgICAgICAgIGZ1bmN0aW9uIGdldE5leHRBcmcodHlwZSkge1xuICAgICAgICAgICAgICAgIC8vIE5PVEU6IEV4cGxpY2l0bHkgaWdub3JpbmcgdHlwZSBzYWZldHkuIE90aGVyd2lzZSB0aGlzIGZhaWxzOlxuICAgICAgICAgICAgICAgIC8vICAgICAgIGludCB4ID0gNDsgcHJpbnRmKFwiJWNcXG5cIiwgKGNoYXIpeCk7XG4gICAgICAgICAgICAgICAgdmFyIHJldDtcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gJ2RvdWJsZScpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0ID0gSEVBUEY2NFsodmFyYXJncyArIGFyZ0luZGV4KSA+PiAzXTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gJ2k2NCcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0ID0gW1xuICAgICAgICAgICAgICAgICAgICAgICAgSEVBUDMyWyh2YXJhcmdzICsgYXJnSW5kZXgpID4+IDJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgSEVBUDMyWyh2YXJhcmdzICsgKGFyZ0luZGV4ICsgOCkpID4+IDJdXG4gICAgICAgICAgICAgICAgICAgIF07XG4gICAgICAgICAgICAgICAgICAgIGFyZ0luZGV4ICs9IDg7IC8vIGVhY2ggMzItYml0IGNodW5rIGlzIGluIGEgNjQtYml0IGJsb2NrXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZSA9ICdpMzInOyAvLyB2YXJhcmdzIGFyZSBhbHdheXMgaTMyLCBpNjQsIG9yIGRvdWJsZVxuICAgICAgICAgICAgICAgICAgICByZXQgPSBIRUFQMzJbKHZhcmFyZ3MgKyBhcmdJbmRleCkgPj4gMl07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGFyZ0luZGV4ICs9IE1hdGgubWF4KFxuICAgICAgICAgICAgICAgICAgICBSdW50aW1lLmdldE5hdGl2ZUZpZWxkU2l6ZSh0eXBlKSxcbiAgICAgICAgICAgICAgICAgICAgUnVudGltZS5nZXRBbGlnblNpemUodHlwZSwgbnVsbCwgdHJ1ZSlcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgcmV0ID0gW107XG4gICAgICAgICAgICB2YXIgY3VyciwgbmV4dCwgY3VyckFyZztcbiAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgdmFyIHN0YXJ0VGV4dEluZGV4ID0gdGV4dEluZGV4O1xuICAgICAgICAgICAgICAgIGN1cnIgPSBIRUFQOFt0ZXh0SW5kZXhdO1xuICAgICAgICAgICAgICAgIGlmIChjdXJyID09PSAwKSBicmVhaztcbiAgICAgICAgICAgICAgICBuZXh0ID0gSEVBUDhbKHRleHRJbmRleCArIDEpIHwgMF07XG4gICAgICAgICAgICAgICAgaWYgKGN1cnIgPT0gMzcpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gSGFuZGxlIGZsYWdzLlxuICAgICAgICAgICAgICAgICAgICB2YXIgZmxhZ0Fsd2F5c1NpZ25lZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZmxhZ0xlZnRBbGlnbiA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZmxhZ0FsdGVybmF0aXZlID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIHZhciBmbGFnWmVyb1BhZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZmxhZ1BhZFNpZ24gPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgZmxhZ3NMb29wOiB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChuZXh0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA0MzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ0Fsd2F5c1NpZ25lZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNDU6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdMZWZ0QWxpZ24gPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDM1OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGFnQWx0ZXJuYXRpdmUgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDQ4OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmxhZ1plcm9QYWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIGZsYWdzTG9vcDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdaZXJvUGFkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAzMjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ1BhZFNpZ24gPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBmbGFnc0xvb3A7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQgPSBIRUFQOFsodGV4dEluZGV4ICsgMSkgfCAwXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBIYW5kbGUgd2lkdGguXG4gICAgICAgICAgICAgICAgICAgIHZhciB3aWR0aCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmIChuZXh0ID09IDQyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3aWR0aCA9IGdldE5leHRBcmcoJ2kzMicpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID0gSEVBUDhbKHRleHRJbmRleCArIDEpIHwgMF07XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAobmV4dCA+PSA0OCAmJiBuZXh0IDw9IDU3KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGggPSB3aWR0aCAqIDEwICsgKG5leHQgLSA0OCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV4dCA9IEhFQVA4Wyh0ZXh0SW5kZXggKyAxKSB8IDBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIC8vIEhhbmRsZSBwcmVjaXNpb24uXG4gICAgICAgICAgICAgICAgICAgIHZhciBwcmVjaXNpb25TZXQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG5leHQgPT0gNDYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwcmVjaXNpb24gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uU2V0ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRJbmRleCsrO1xuICAgICAgICAgICAgICAgICAgICAgICAgbmV4dCA9IEhFQVA4Wyh0ZXh0SW5kZXggKyAxKSB8IDBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5leHQgPT0gNDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVjaXNpb24gPSBnZXROZXh0QXJnKCdpMzInKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHByZWNpc2lvbkNociA9IEhFQVA4Wyh0ZXh0SW5kZXggKyAxKSB8IDBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocHJlY2lzaW9uQ2hyIDwgNDggfHwgcHJlY2lzaW9uQ2hyID4gNTcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWNpc2lvbiAqIDEwICsgKHByZWNpc2lvbkNociAtIDQ4KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgbmV4dCA9IEhFQVA4Wyh0ZXh0SW5kZXggKyAxKSB8IDBdO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHByZWNpc2lvbiA9IDY7IC8vIFN0YW5kYXJkIGRlZmF1bHQuXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgLy8gSGFuZGxlIGludGVnZXIgc2l6ZXMuIFdBUk5JTkc6IFRoZXNlIGFzc3VtZSBhIDMyLWJpdCBhcmNoaXRlY3R1cmUhXG4gICAgICAgICAgICAgICAgICAgIHZhciBhcmdTaXplO1xuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKFN0cmluZy5mcm9tQ2hhckNvZGUobmV4dCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2gnOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuZXh0TmV4dCA9IEhFQVA4Wyh0ZXh0SW5kZXggKyAyKSB8IDBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXh0TmV4dCA9PSAxMDQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1NpemUgPSAxOyAvLyBjaGFyIChhY3R1YWxseSBpMzIgaW4gdmFyYXJncylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdTaXplID0gMjsgLy8gc2hvcnQgKGFjdHVhbGx5IGkzMiBpbiB2YXJhcmdzKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2wnOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuZXh0TmV4dCA9IEhFQVA4Wyh0ZXh0SW5kZXggKyAyKSB8IDBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXh0TmV4dCA9PSAxMDgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1NpemUgPSA4OyAvLyBsb25nIGxvbmdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdTaXplID0gNDsgLy8gbG9uZ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ0wnOiAvLyBsb25nIGxvbmdcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3EnOiAvLyBpbnQ2NF90XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdqJzogLy8gaW50bWF4X3RcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdTaXplID0gODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3onOiAvLyBzaXplX3RcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3QnOiAvLyBwdHJkaWZmX3RcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ0knOiAvLyBzaWduZWQgcHRyZGlmZl90IG9yIHVuc2lnbmVkIHNpemVfdFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1NpemUgPSA0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdTaXplID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoYXJnU2l6ZSkgdGV4dEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgIG5leHQgPSBIRUFQOFsodGV4dEluZGV4ICsgMSkgfCAwXTtcbiAgICAgICAgICAgICAgICAgICAgLy8gSGFuZGxlIHR5cGUgc3BlY2lmaWVyLlxuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKFN0cmluZy5mcm9tQ2hhckNvZGUobmV4dCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnaSc6XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICd1JzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ28nOlxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAneCc6XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdYJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3AnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSW50ZWdlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2lnbmVkID0gbmV4dCA9PSAxMDAgfHwgbmV4dCA9PSAxMDU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnU2l6ZSA9IGFyZ1NpemUgfHwgNDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY3VyckFyZyA9IGdldE5leHRBcmcoJ2knICsgYXJnU2l6ZSAqIDgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvcmlnQXJnID0gY3VyckFyZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXJnVGV4dDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBGbGF0dGVuIGk2NC0xIFtsb3csIGhpZ2hdIGludG8gYSAoc2xpZ2h0bHkgcm91bmRlZCkgZG91YmxlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFyZ1NpemUgPT0gOCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyQXJnID0gUnVudGltZS5tYWtlQmlnSW50KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VyckFyZ1swXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJBcmdbMV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID09IDExN1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUcnVuY2F0ZSB0byByZXF1ZXN0ZWQgc2l6ZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXJnU2l6ZSA8PSA0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW1pdCA9IE1hdGgucG93KDI1NiwgYXJnU2l6ZSkgLSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyQXJnID0gKHNpZ25lZCA/IHJlU2lnbiA6IHVuU2lnbikoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyQXJnICYgbGltaXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdTaXplICogOFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBGb3JtYXQgdGhlIG51bWJlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY3VyckFic0FyZyA9IE1hdGguYWJzKGN1cnJBcmcpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwcmVmaXggPSAnJztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV4dCA9PSAxMDAgfHwgbmV4dCA9PSAxMDUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFyZ1NpemUgPT0gOCAmJiBpNjRNYXRoKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCA9IGk2NE1hdGguc3RyaW5naWZ5KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9yaWdBcmdbMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3JpZ0FyZ1sxXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gcmVTaWduKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJBcmcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCAqIGFyZ1NpemUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKS50b1N0cmluZygxMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChuZXh0ID09IDExNykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXJnU2l6ZSA9PSA4ICYmIGk2NE1hdGgpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gaTY0TWF0aC5zdHJpbmdpZnkoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3JpZ0FyZ1swXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcmlnQXJnWzFdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRydWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQgPSB1blNpZ24oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VyckFyZyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4ICogYXJnU2l6ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApLnRvU3RyaW5nKDEwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VyckFyZyA9IE1hdGguYWJzKGN1cnJBcmcpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobmV4dCA9PSAxMTEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZmxhZ0FsdGVybmF0aXZlID8gJzAnIDogJycpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJBYnNBcmcudG9TdHJpbmcoOCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChuZXh0ID09IDEyMCB8fCBuZXh0ID09IDg4KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWZpeCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGFnQWx0ZXJuYXRpdmUgJiYgY3VyckFyZyAhPSAwID8gJzB4JyA6ICcnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXJnU2l6ZSA9PSA4ICYmIGk2NE1hdGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcmlnQXJnWzFdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCA9IChvcmlnQXJnWzFdID4+PiAwKS50b1N0cmluZyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsb3dlciA9IChvcmlnQXJnWzBdID4+PiAwKS50b1N0cmluZyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChsb3dlci5sZW5ndGggPCA4KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb3dlciA9ICcwJyArIGxvd2VyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQgKz0gbG93ZXI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQgPSAob3JpZ0FyZ1swXSA+Pj4gMCkudG9TdHJpbmcoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjdXJyQXJnIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gUmVwcmVzZW50IG5lZ2F0aXZlIG51bWJlcnMgaW4gaGV4IGFzIDIncyBjb21wbGVtZW50LlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VyckFyZyA9IC1jdXJyQXJnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCA9IChjdXJyQWJzQXJnIC0gMSkudG9TdHJpbmcoMTYpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGJ1ZmZlciA9IFtdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhcmdUZXh0Lmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLnB1c2goXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4ZiAtIHBhcnNlSW50KGFyZ1RleHRbaV0sIDE2KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApLnRvU3RyaW5nKDE2KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gYnVmZmVyLmpvaW4oJycpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGFyZ1RleHQubGVuZ3RoIDwgYXJnU2l6ZSAqIDIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCA9ICdmJyArIGFyZ1RleHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gY3VyckFic0FyZy50b1N0cmluZygxNik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5leHQgPT0gODgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWZpeCA9IHByZWZpeC50b1VwcGVyQ2FzZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCA9IGFyZ1RleHQudG9VcHBlckNhc2UoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobmV4dCA9PSAxMTIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJBYnNBcmcgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQgPSAnKG5pbCknO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZml4ID0gJzB4JztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQgPSBjdXJyQWJzQXJnLnRvU3RyaW5nKDE2KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocHJlY2lzaW9uU2V0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChhcmdUZXh0Lmxlbmd0aCA8IHByZWNpc2lvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCA9ICcwJyArIGFyZ1RleHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWRkIHNpZ24gaWYgbmVlZGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJBcmcgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmxhZ0Fsd2F5c1NpZ25lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZml4ID0gJysnICsgcHJlZml4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGZsYWdQYWRTaWduKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVmaXggPSAnICcgKyBwcmVmaXg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTW92ZSBzaWduIHRvIHByZWZpeCBzbyB3ZSB6ZXJvLXBhZCBhZnRlciB0aGUgc2lnblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcmdUZXh0LmNoYXJBdCgwKSA9PSAnLScpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZml4ID0gJy0nICsgcHJlZml4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gYXJnVGV4dC5zdWJzdHIoMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEFkZCBwYWRkaW5nLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChwcmVmaXgubGVuZ3RoICsgYXJnVGV4dC5sZW5ndGggPCB3aWR0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmxhZ0xlZnRBbGlnbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCArPSAnICc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmxhZ1plcm9QYWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gJzAnICsgYXJnVGV4dDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZml4ID0gJyAnICsgcHJlZml4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEluc2VydCB0aGUgcmVzdWx0IGludG8gdGhlIGJ1ZmZlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gcHJlZml4ICsgYXJnVGV4dDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0LnNwbGl0KCcnKS5mb3JFYWNoKGZ1bmN0aW9uKGNocikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXQucHVzaChjaHIuY2hhckNvZGVBdCgwKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdmJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ0YnOlxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnZSc6XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdFJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2cnOlxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnRyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBGbG9hdC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY3VyckFyZyA9IGdldE5leHRBcmcoJ2RvdWJsZScpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhcmdUZXh0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc05hTihjdXJyQXJnKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gJ25hbic7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdaZXJvUGFkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghaXNGaW5pdGUoY3VyckFyZykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCA9IChjdXJyQXJnIDwgMCA/ICctJyA6ICcnKSArICdpbmYnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGFnWmVyb1BhZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpc0dlbmVyYWwgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVmZmVjdGl2ZVByZWNpc2lvbiA9IE1hdGgubWluKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQ29udmVydCBnL0cgdG8gZi9GIG9yIGUvRSwgYXMgcGVyOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBodHRwOi8vcHVicy5vcGVuZ3JvdXAub3JnL29ubGluZXB1YnMvOTY5OTkxOTc5OS9mdW5jdGlvbnMvcHJpbnRmLmh0bWxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5leHQgPT0gMTAzIHx8IG5leHQgPT0gNzEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzR2VuZXJhbCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVjaXNpb24gPSBwcmVjaXNpb24gfHwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBleHBvbmVudCA9IHBhcnNlSW50KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJBcmdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnRvRXhwb25lbnRpYWwoZWZmZWN0aXZlUHJlY2lzaW9uKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3BsaXQoJ2UnKVsxXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVjaXNpb24gPiBleHBvbmVudCAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4cG9uZW50ID49IC00XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID0gKG5leHQgPT0gMTAzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ2YnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogJ0YnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKS5jaGFyQ29kZUF0KDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWNpc2lvbiAtPSBleHBvbmVudCArIDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5leHQgPSAobmV4dCA9PSAxMDNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAnZSdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAnRSdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApLmNoYXJDb2RlQXQoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uLS07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlZmZlY3RpdmVQcmVjaXNpb24gPSBNYXRoLm1pbihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5leHQgPT0gMTAxIHx8IG5leHQgPT0gNjkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQgPSBjdXJyQXJnLnRvRXhwb25lbnRpYWwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWZmZWN0aXZlUHJlY2lzaW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTWFrZSBzdXJlIHRoZSBleHBvbmVudCBoYXMgYXQgbGVhc3QgMiBkaWdpdHMuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL1tlRV1bLStdXFxkJC8udGVzdChhcmdUZXh0KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0LnNsaWNlKDAsIC0xKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcwJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQuc2xpY2UoLTEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG5leHQgPT0gMTAyIHx8IG5leHQgPT0gNzApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQgPSBjdXJyQXJnLnRvRml4ZWQoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWZmZWN0aXZlUHJlY2lzaW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJBcmcgPT09IDAgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX3JlYWxseU5lZ2F0aXZlKGN1cnJBcmcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gJy0nICsgYXJnVGV4dDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGFydHMgPSBhcmdUZXh0LnNwbGl0KCdlJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0dlbmVyYWwgJiYgIWZsYWdBbHRlcm5hdGl2ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gRGlzY2FyZCB0cmFpbGluZyB6ZXJvcyBhbmQgcGVyaW9kcy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJ0c1swXS5sZW5ndGggPiAxICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFydHNbMF0uaW5kZXhPZignLicpICE9IC0xICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBhcnRzWzBdLnNsaWNlKC0xKSA9PSAnMCcgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFydHNbMF0uc2xpY2UoLTEpID09ICcuJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnRzWzBdID0gcGFydHNbMF0uc2xpY2UoMCwgLTEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTWFrZSBzdXJlIHdlIGhhdmUgYSBwZXJpb2QgaW4gYWx0ZXJuYXRpdmUgbW9kZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGFnQWx0ZXJuYXRpdmUgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0LmluZGV4T2YoJy4nKSA9PSAtMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnRzWzBdICs9ICcuJztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFplcm8gcGFkIHVudGlsIHJlcXVpcmVkIHByZWNpc2lvbi5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChwcmVjaXNpb24gPiBlZmZlY3RpdmVQcmVjaXNpb24rKylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJ0c1swXSArPSAnMCc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJ0c1swXSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocGFydHMubGVuZ3RoID4gMSA/ICdlJyArIHBhcnRzWzFdIDogJycpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBDYXBpdGFsaXplICdFJyBpZiBuZWVkZWQuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXh0ID09IDY5KSBhcmdUZXh0ID0gYXJnVGV4dC50b1VwcGVyQ2FzZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBZGQgc2lnbi5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJBcmcgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZsYWdBbHdheXNTaWduZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gJysnICsgYXJnVGV4dDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZmxhZ1BhZFNpZ24pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gJyAnICsgYXJnVGV4dDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBZGQgcGFkZGluZy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoYXJnVGV4dC5sZW5ndGggPCB3aWR0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmxhZ0xlZnRBbGlnbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCArPSAnICc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ1plcm9QYWQgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYXJnVGV4dFswXSA9PSAnLScgfHwgYXJnVGV4dFswXSA9PSAnKycpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dFswXSArICcwJyArIGFyZ1RleHQuc2xpY2UoMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZmxhZ1plcm9QYWQgPyAnMCcgOiAnICcpICsgYXJnVGV4dDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBZGp1c3QgY2FzZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV4dCA8IDk3KSBhcmdUZXh0ID0gYXJnVGV4dC50b1VwcGVyQ2FzZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEluc2VydCB0aGUgcmVzdWx0IGludG8gdGhlIGJ1ZmZlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0LnNwbGl0KCcnKS5mb3JFYWNoKGZ1bmN0aW9uKGNocikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXQucHVzaChjaHIuY2hhckNvZGVBdCgwKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN0cmluZy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXJnID0gZ2V0TmV4dEFyZygnaTgqJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGFyZ0xlbmd0aCA9IGFyZ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IF9zdHJsZW4oYXJnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICcobnVsbCknLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocHJlY2lzaW9uU2V0KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdMZW5ndGggPSBNYXRoLm1pbihhcmdMZW5ndGgsIHByZWNpc2lvbik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmbGFnTGVmdEFsaWduKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChhcmdMZW5ndGggPCB3aWR0aC0tKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXQucHVzaCgzMik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFyZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGFyZ0xlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXQucHVzaChIRUFQVThbYXJnKysgfCAwXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXQgPSByZXQuY29uY2F0KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50QXJyYXlGcm9tU3RyaW5nKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcobnVsbCknLnN1YnN0cigwLCBhcmdMZW5ndGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRydWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZsYWdMZWZ0QWxpZ24pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGFyZ0xlbmd0aCA8IHdpZHRoLS0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldC5wdXNoKDMyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2MnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQ2hhcmFjdGVyLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmbGFnTGVmdEFsaWduKSByZXQucHVzaChnZXROZXh0QXJnKCdpOCcpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoLS13aWR0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0LnB1c2goMzIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWZsYWdMZWZ0QWxpZ24pIHJldC5wdXNoKGdldE5leHRBcmcoJ2k4JykpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnbic6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBXcml0ZSB0aGUgbGVuZ3RoIHdyaXR0ZW4gc28gZmFyIHRvIHRoZSBuZXh0IHBhcmFtZXRlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHRyID0gZ2V0TmV4dEFyZygnaTMyKicpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhFQVAzMltwdHIgPj4gMl0gPSByZXQubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnJSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBMaXRlcmFsIHBlcmNlbnQgc2lnbi5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXQucHVzaChjdXJyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBVbmtub3duIHNwZWNpZmllcnMgcmVtYWluIHVudG91Y2hlZC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaSA9IHN0YXJ0VGV4dEluZGV4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpIDwgdGV4dEluZGV4ICsgMjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSsrXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldC5wdXNoKEhFQVA4W2ldKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGV4dEluZGV4ICs9IDI7XG4gICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IFN1cHBvcnQgYS9BIChoZXggZmxvYXQpIGFuZCBtIChsYXN0IGVycm9yKSBzcGVjaWZpZXJzLlxuICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiBTdXBwb3J0ICUxJHtzcGVjaWZpZXJ9IGZvciBhcmcgc2VsZWN0aW9uLlxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldC5wdXNoKGN1cnIpO1xuICAgICAgICAgICAgICAgICAgICB0ZXh0SW5kZXggKz0gMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIF9mcHJpbnRmKHN0cmVhbSwgZm9ybWF0LCB2YXJhcmdzKSB7XG4gICAgICAgICAgICAvLyBpbnQgZnByaW50ZihGSUxFICpyZXN0cmljdCBzdHJlYW0sIGNvbnN0IGNoYXIgKnJlc3RyaWN0IGZvcm1hdCwgLi4uKTtcbiAgICAgICAgICAgIC8vIGh0dHA6Ly9wdWJzLm9wZW5ncm91cC5vcmcvb25saW5lcHVicy8wMDAwOTUzOTkvZnVuY3Rpb25zL3ByaW50Zi5odG1sXG4gICAgICAgICAgICB2YXIgcmVzdWx0ID0gX19mb3JtYXRTdHJpbmcoZm9ybWF0LCB2YXJhcmdzKTtcbiAgICAgICAgICAgIHZhciBzdGFjayA9IFJ1bnRpbWUuc3RhY2tTYXZlKCk7XG4gICAgICAgICAgICB2YXIgcmV0ID0gX2Z3cml0ZShcbiAgICAgICAgICAgICAgICBhbGxvY2F0ZShyZXN1bHQsICdpOCcsIEFMTE9DX1NUQUNLKSxcbiAgICAgICAgICAgICAgICAxLFxuICAgICAgICAgICAgICAgIHJlc3VsdC5sZW5ndGgsXG4gICAgICAgICAgICAgICAgc3RyZWFtXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgUnVudGltZS5zdGFja1Jlc3RvcmUoc3RhY2spO1xuICAgICAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBfcmVjdihmZCwgYnVmLCBsZW4sIGZsYWdzKSB7XG4gICAgICAgICAgICB2YXIgc29jayA9IFNPQ0tGUy5nZXRTb2NrZXQoZmQpO1xuICAgICAgICAgICAgaWYgKCFzb2NrKSB7XG4gICAgICAgICAgICAgICAgX19fc2V0RXJyTm8oRVJSTk9fQ09ERVMuRUJBREYpO1xuICAgICAgICAgICAgICAgIHJldHVybiAtMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIFRPRE8ga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ICAgICAgICAgdmFyIHN0cmVhbSA9IEZTLmdldFN0cmVhbShmaWxkZXMpO1xuICAgICAgICAgICAgaWYgKCFzdHJlYW0pIHtcbiAgICAgICAgICAgICAgICBfX19zZXRFcnJObyhFUlJOT19DT0RFUy5FQkFERik7XG4gICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICByZXR1cm4gRlMubGxzZWVrKHN0cmVhbSwgb2Zmc2V0LCB3aGVuY2UpO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgIEZTLmhhbmRsZUZTRXJyb3IoZSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIF9mc2VlayhzdHJlYW0sIG9mZnNldCwgd2hlbmNlKSB7XG4gICAgICAgICAgICAvLyBpbnQgZnNlZWsoRklMRSAqc3RyZWFtLCBsb25nIG9mZnNldCwgaW50IHdoZW5jZSk7XG4gICAgICAgICAgICAvLyBodHRwOi8vcHVicy5vcGVuZ3JvdXAub3JnL29ubGluZXB1YnMvMDAwMDk1Mzk5L2Z1bmN0aW9ucy9mc2Vlay5odG1sXG4gICAgICAgICAgICB2YXIgcmV0ID0gX2xzZWVrKHN0cmVhbSwgb2Zmc2V0LCB3aGVuY2UpO1xuICAgICAgICAgICAgaWYgKHJldCA9PSAtMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAtMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHN0cmVhbSA9IEZTLmdldFN0cmVhbShzdHJlYW0pO1xuICAgICAgICAgICAgc3RyZWFtLmVvZiA9IGZhbHNlO1xuICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX2Nsb3NlKGZpbGRlcykge1xuICAgICAgICAgICAgLy8gaW50IGNsb3NlKGludCBmaWxkZXMpO1xuICAgICAgICAgICAgLy8gaHR0cDovL3B1YnMub3Blbmdyb3VwLm9yZy9vbmxpbmVwdWJzLzAwMDA5NTM5OS9mdW5jdGlvbnMvY2xvc2UuaHRtbFxuICAgICAgICAgICAgdmFyIHN0cmVhbSA9IEZTLmdldFN0cmVhbShmaWxkZXMpO1xuICAgICAgICAgICAgaWYgKCFzdHJlYW0pIHtcbiAgICAgICAgICAgICAgICBfX19zZXRFcnJObyhFUlJOT19DT0RFUy5FQkFERik7XG4gICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBGUy5jbG9zZShzdHJlYW0pO1xuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgIEZTLmhhbmRsZUZTRXJyb3IoZSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIF9mc3luYyhmaWxkZXMpIHtcbiAgICAgICAgICAgIC8vIGludCBmc3luYyhpbnQgZmlsZGVzKTtcbiAgICAgICAgICAgIC8vIGh0dHA6Ly9wdWJzLm9wZW5ncm91cC5vcmcvb25saW5lcHVicy8wMDAwOTUzOTkvZnVuY3Rpb25zL2ZzeW5jLmh0bWxcbiAgICAgICAgICAgIHZhciBzdHJlYW0gPSBGUy5nZXRTdHJlYW0oZmlsZGVzKTtcbiAgICAgICAgICAgIGlmIChzdHJlYW0pIHtcbiAgICAgICAgICAgICAgICAvLyBXZSB3cml0ZSBkaXJlY3RseSB0byB0aGUgZmlsZSBzeXN0ZW0sIHNvIHRoZXJlJ3Mgbm90aGluZyB0byBkbyBoZXJlLlxuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgIC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hdGhfcG93O1xuICAgICAgICB2YXIgX3NpbiA9IE1hdGhfc2luO1xuICAgICAgICBmdW5jdGlvbiBfc3RycmNocihwdHIsIGNocikge1xuICAgICAgICAgICAgdmFyIHB0cjIgPSBwdHIgKyBfc3RybGVuKHB0cik7XG4gICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgaWYgKEhFQVA4W3B0cjJdID09IGNocikgcmV0dXJuIHB0cjI7XG4gICAgICAgICAgICAgICAgcHRyMi0tO1xuICAgICAgICAgICAgfSB3aGlsZSAocHRyMiA+PSBwdHIpO1xuICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIF9fX3N0cnRva19zdGF0ZSA9IDA7XG4gICAgICAgIGZ1bmN0aW9uIF9zdHJ0b2tfcihzLCBkZWxpbSwgbGFzdHMpIHtcbiAgICAgICAgICAgIHZhciBza2lwX2xlYWRpbmdfZGVsaW0gPSAxO1xuICAgICAgICAgICAgdmFyIHNwYW5wO1xuICAgICAgICAgICAgdmFyIGMsIHNjO1xuICAgICAgICAgICAgdmFyIHRvaztcbiAgICAgICAgICAgIGlmIChzID09IDAgJiYgKHMgPSBnZXRWYWx1ZShsYXN0cywgJ2k4KicpKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjb250OiB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgIGMgPSBnZXRWYWx1ZShzKyssICdpOCcpO1xuICAgICAgICAgICAgICAgIGZvciAoc3BhbnAgPSBkZWxpbTsgKHNjID0gZ2V0VmFsdWUoc3BhbnArKywgJ2k4JykpICE9IDA7ICkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoYyA9PSBzYykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNraXBfbGVhZGluZ19kZWxpbSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIGNvbnQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFZhbHVlKGxhc3RzLCBzLCAnaTgqJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VmFsdWUocyAtIDEsIDAsICdpOCcpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzIC0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjID09IDApIHtcbiAgICAgICAgICAgICAgICBzZXRWYWx1ZShsYXN0cywgMCwgJ2k4KicpO1xuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdG9rID0gcyAtIDE7XG4gICAgICAgICAgICBmb3IgKDs7KSB7XG4gICAgICAgICAgICAgICAgYyA9IGdldFZhbHVlKHMrKywgJ2k4Jyk7XG4gICAgICAgICAgICAgICAgc3BhbnAgPSBkZWxpbTtcbiAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoc2MgPSBnZXRWYWx1ZShzcGFucCsrLCAnaTgnKSkgPT0gYykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGMgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRWYWx1ZShzIC0gMSwgMCwgJ2k4Jyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRWYWx1ZShsYXN0cywgcywgJ2k4KicpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRvaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKHNjICE9IDApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYWJvcnQoJ3N0cnRva19yIGVycm9yIScpO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIF9zdHJ0b2socywgZGVsaW0pIHtcbiAgICAgICAgICAgIHJldHVybiBfc3RydG9rX3IocywgZGVsaW0sIF9fX3N0cnRva19zdGF0ZSk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX3N0cm5jbXAocHgsIHB5LCBuKSB7XG4gICAgICAgICAgICB2YXIgaSA9IDA7XG4gICAgICAgICAgICB3aGlsZSAoaSA8IG4pIHtcbiAgICAgICAgICAgICAgICB2YXIgeCA9IEhFQVBVOFsocHggKyBpKSB8IDBdO1xuICAgICAgICAgICAgICAgIHZhciB5ID0gSEVBUFU4WyhweSArIGkpIHwgMF07XG4gICAgICAgICAgICAgICAgaWYgKHggPT0geSAmJiB4ID09IDApIHJldHVybiAwO1xuICAgICAgICAgICAgICAgIGlmICh4ID09IDApIHJldHVybiAtMTtcbiAgICAgICAgICAgICAgICBpZiAoeSA9PSAwKSByZXR1cm4gMTtcbiAgICAgICAgICAgICAgICBpZiAoeCA9PSB5KSB7XG4gICAgICAgICAgICAgICAgICAgIGkrKztcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHggPiB5ID8gMSA6IC0xO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIF9zdHJjbXAocHgsIHB5KSB7XG4gICAgICAgICAgICByZXR1cm4gX3N0cm5jbXAocHgsIHB5LCBUT1RBTF9NRU1PUlkpO1xuICAgICAgICB9XG4gICAgICAgIE1vZHVsZVsnX3N0cm5jcHknXSA9IF9zdHJuY3B5O1xuICAgICAgICBmdW5jdGlvbiBfaXNzcGFjZShjaHIpIHtcbiAgICAgICAgICAgIHJldHVybiBjaHIgPT0gMzIgfHwgKGNociA+PSA5ICYmIGNociA8PSAxMyk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX19wYXJzZUludChzdHIsIGVuZHB0ciwgYmFzZSwgbWluLCBtYXgsIGJpdHMsIHVuc2lnbikge1xuICAgICAgICAgICAgLy8gU2tpcCBzcGFjZS5cbiAgICAgICAgICAgIHdoaWxlIChfaXNzcGFjZShIRUFQOFtzdHJdKSkgc3RyKys7XG4gICAgICAgICAgICAvLyBDaGVjayBmb3IgYSBwbHVzL21pbnVzIHNpZ24uXG4gICAgICAgICAgICB2YXIgbXVsdGlwbGllciA9IDE7XG4gICAgICAgICAgICBpZiAoSEVBUDhbc3RyXSA9PSA0NSkge1xuICAgICAgICAgICAgICAgIG11bHRpcGxpZXIgPSAtMTtcbiAgICAgICAgICAgICAgICBzdHIrKztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoSEVBUDhbc3RyXSA9PSA0Mykge1xuICAgICAgICAgICAgICAgIHN0cisrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gRmluZCBiYXNlLlxuICAgICAgICAgICAgdmFyIGZpbmFsQmFzZSA9IGJhc2U7XG4gICAgICAgICAgICBpZiAoIWZpbmFsQmFzZSkge1xuICAgICAgICAgICAgICAgIGlmIChIRUFQOFtzdHJdID09IDQ4KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIEhFQVA4WyhzdHIgKyAxKSB8IDBdID09IDEyMCB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgSEVBUDhbKHN0ciArIDEpIHwgMF0gPT0gODhcbiAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmaW5hbEJhc2UgPSAxNjtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ciArPSAyO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgZmluYWxCYXNlID0gODtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0cisrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmIChmaW5hbEJhc2UgPT0gMTYpIHtcbiAgICAgICAgICAgICAgICBpZiAoSEVBUDhbc3RyXSA9PSA0OCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICBIRUFQOFsoc3RyICsgMSkgfCAwXSA9PSAxMjAgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIEhFQVA4WyhzdHIgKyAxKSB8IDBdID09IDg4XG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3RyICs9IDI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIWZpbmFsQmFzZSkgZmluYWxCYXNlID0gMTA7XG4gICAgICAgICAgICAvLyBHZXQgZGlnaXRzLlxuICAgICAgICAgICAgdmFyIGNocjtcbiAgICAgICAgICAgIHZhciByZXQgPSAwO1xuICAgICAgICAgICAgd2hpbGUgKChjaHIgPSBIRUFQOFtzdHJdKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgdmFyIGRpZ2l0ID0gcGFyc2VJbnQoU3RyaW5nLmZyb21DaGFyQ29kZShjaHIpLCBmaW5hbEJhc2UpO1xuICAgICAgICAgICAgICAgIGlmIChpc05hTihkaWdpdCkpIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0ID0gcmV0ICogZmluYWxCYXNlICsgZGlnaXQ7XG4gICAgICAgICAgICAgICAgICAgIHN0cisrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIEFwcGx5IHNpZ24uXG4gICAgICAgICAgICByZXQgKj0gbXVsdGlwbGllcjtcbiAgICAgICAgICAgIC8vIFNldCBlbmQgcG9pbnRlci5cbiAgICAgICAgICAgIGlmIChlbmRwdHIpIHtcbiAgICAgICAgICAgICAgICBIRUFQMzJbZW5kcHRyID4+IDJdID0gc3RyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gVW5zaWduIGlmIG5lZWRlZC5cbiAgICAgICAgICAgIGlmICh1bnNpZ24pIHtcbiAgICAgICAgICAgICAgICBpZiAoTWF0aC5hYnMocmV0KSA+IG1heCkge1xuICAgICAgICAgICAgICAgICAgICByZXQgPSBtYXg7XG4gICAgICAgICAgICAgICAgICAgIF9fX3NldEVyck5vKEVSUk5PX0NPREVTLkVSQU5HRSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0ID0gdW5TaWduKHJldCwgYml0cyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gVmFsaWRhdGUgcmFuZ2UuXG4gICAgICAgICAgICBpZiAocmV0ID4gbWF4IHx8IHJldCA8IG1pbikge1xuICAgICAgICAgICAgICAgIHJldCA9IHJldCA+IG1heCA/IG1heCA6IG1pbjtcbiAgICAgICAgICAgICAgICBfX19zZXRFcnJObyhFUlJOT19DT0RFUy5FUkFOR0UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGJpdHMgPT0gNjQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAoYXNtWydzZXRUZW1wUmV0MCddKFxuICAgICAgICAgICAgICAgICAgICAgICAgKCh0ZW1wRG91YmxlID0gcmV0KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICtNYXRoX2Ficyh0ZW1wRG91YmxlKSA+PSArMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdGVtcERvdWJsZSA+ICswXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gKE1hdGhfbWluKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArTWF0aF9mbG9vcih0ZW1wRG91YmxlIC8gKzQyOTQ5NjcyOTYpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArNDI5NDk2NzI5NVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogfn4rTWF0aF9jZWlsKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodGVtcERvdWJsZSAtICsofn50ZW1wRG91YmxlID4+PiAwKSkgL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKzQyOTQ5NjcyOTZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApID4+PiAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAwKVxuICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgICByZXQgPj4+IDApIHwgMFxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIF9zdHJ0b2woc3RyLCBlbmRwdHIsIGJhc2UpIHtcbiAgICAgICAgICAgIHJldHVybiBfX3BhcnNlSW50KHN0ciwgZW5kcHRyLCBiYXNlLCAtMjE0NzQ4MzY0OCwgMjE0NzQ4MzY0NywgMzIpOyAvLyBMT05HX01JTiwgTE9OR19NQVguXG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX2F0b2kocHRyKSB7XG4gICAgICAgICAgICByZXR1cm4gX3N0cnRvbChwdHIsIG51bGwsIDEwKTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBfc3RyY2hyKHB0ciwgY2hyKSB7XG4gICAgICAgICAgICBwdHItLTtcbiAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICBwdHIrKztcbiAgICAgICAgICAgICAgICB2YXIgdmFsID0gSEVBUDhbcHRyXTtcbiAgICAgICAgICAgICAgICBpZiAodmFsID09IGNocikgcmV0dXJuIHB0cjtcbiAgICAgICAgICAgIH0gd2hpbGUgKHZhbCk7XG4gICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBfYWJvcnQoKSB7XG4gICAgICAgICAgICBNb2R1bGVbJ2Fib3J0J10oKTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBfX19lcnJub19sb2NhdGlvbigpIHtcbiAgICAgICAgICAgIHJldHVybiBfX19lcnJub19zdGF0ZTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBfc2JyayhieXRlcykge1xuICAgICAgICAgICAgLy8gSW1wbGVtZW50IGEgTGludXgtbGlrZSAnbWVtb3J5IGFyZWEnIGZvciBvdXIgJ3Byb2Nlc3MnLlxuICAgICAgICAgICAgLy8gQ2hhbmdlcyB0aGUgc2l6ZSBvZiB0aGUgbWVtb3J5IGFyZWEgYnkgfGJ5dGVzfDsgcmV0dXJucyB0aGVcbiAgICAgICAgICAgIC8vIGFkZHJlc3Mgb2YgdGhlIHByZXZpb3VzIHRvcCAoJ2JyZWFrJykgb2YgdGhlIG1lbW9yeSBhcmVhXG4gICAgICAgICAgICAvLyBXZSBjb250cm9sIHRoZSBcImR5bmFtaWNcIiBtZW1vcnkgLSBEWU5BTUlDX0JBU0UgdG8gRFlOQU1JQ1RPUFxuICAgICAgICAgICAgdmFyIHNlbGYgPSBfc2JyaztcbiAgICAgICAgICAgIGlmICghc2VsZi5jYWxsZWQpIHtcbiAgICAgICAgICAgICAgICBEWU5BTUlDVE9QID0gYWxpZ25NZW1vcnlQYWdlKERZTkFNSUNUT1ApOyAvLyBtYWtlIHN1cmUgd2Ugc3RhcnQgb3V0IGFsaWduZWRcbiAgICAgICAgICAgICAgICBzZWxmLmNhbGxlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgYXNzZXJ0KFJ1bnRpbWUuZHluYW1pY0FsbG9jKTtcbiAgICAgICAgICAgICAgICBzZWxmLmFsbG9jID0gUnVudGltZS5keW5hbWljQWxsb2M7XG4gICAgICAgICAgICAgICAgUnVudGltZS5keW5hbWljQWxsb2MgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgYWJvcnQoJ2Nhbm5vdCBkeW5hbWljYWxseSBhbGxvY2F0ZSwgc2JyayBub3cgaGFzIGNvbnRyb2wnKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHJldCA9IERZTkFNSUNUT1A7XG4gICAgICAgICAgICBpZiAoYnl0ZXMgIT0gMCkgc2VsZi5hbGxvYyhieXRlcyk7XG4gICAgICAgICAgICByZXR1cm4gcmV0OyAvLyBQcmV2aW91cyBicmVhayBsb2NhdGlvbi5cbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBfc3lzY29uZihuYW1lKSB7XG4gICAgICAgICAgICAvLyBsb25nIHN5c2NvbmYoaW50IG5hbWUpO1xuICAgICAgICAgICAgLy8gaHR0cDovL3B1YnMub3Blbmdyb3VwLm9yZy9vbmxpbmVwdWJzLzAwOTY5NTM5OS9mdW5jdGlvbnMvc3lzY29uZi5odG1sXG4gICAgICAgICAgICBzd2l0Y2ggKG5hbWUpIHtcbiAgICAgICAgICAgICAgICBjYXNlIDMwOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gUEFHRV9TSVpFO1xuICAgICAgICAgICAgICAgIGNhc2UgMTMyOlxuICAgICAgICAgICAgICAgIGNhc2UgMTMzOlxuICAgICAgICAgICAgICAgIGNhc2UgMTI6XG4gICAgICAgICAgICAgICAgY2FzZSAxMzc6XG4gICAgICAgICAgICAgICAgY2FzZSAxMzg6XG4gICAgICAgICAgICAgICAgY2FzZSAxNTpcbiAgICAgICAgICAgICAgICBjYXNlIDIzNTpcbiAgICAgICAgICAgICAgICBjYXNlIDE2OlxuICAgICAgICAgICAgICAgIGNhc2UgMTc6XG4gICAgICAgICAgICAgICAgY2FzZSAxODpcbiAgICAgICAgICAgICAgICBjYXNlIDE5OlxuICAgICAgICAgICAgICAgIGNhc2UgMjA6XG4gICAgICAgICAgICAgICAgY2FzZSAxNDk6XG4gICAgICAgICAgICAgICAgY2FzZSAxMzpcbiAgICAgICAgICAgICAgICBjYXNlIDEwOlxuICAgICAgICAgICAgICAgIGNhc2UgMjM2OlxuICAgICAgICAgICAgICAgIGNhc2UgMTUzOlxuICAgICAgICAgICAgICAgIGNhc2UgOTpcbiAgICAgICAgICAgICAgICBjYXNlIDIxOlxuICAgICAgICAgICAgICAgIGNhc2UgMjI6XG4gICAgICAgICAgICAgICAgY2FzZSAxNTk6XG4gICAgICAgICAgICAgICAgY2FzZSAxNTQ6XG4gICAgICAgICAgICAgICAgY2FzZSAxNDpcbiAgICAgICAgICAgICAgICBjYXNlIDc3OlxuICAgICAgICAgICAgICAgIGNhc2UgNzg6XG4gICAgICAgICAgICAgICAgY2FzZSAxMzk6XG4gICAgICAgICAgICAgICAgY2FzZSA4MDpcbiAgICAgICAgICAgICAgICBjYXNlIDgxOlxuICAgICAgICAgICAgICAgIGNhc2UgNzk6XG4gICAgICAgICAgICAgICAgY2FzZSA4MjpcbiAgICAgICAgICAgICAgICBjYXNlIDY4OlxuICAgICAgICAgICAgICAgIGNhc2UgNjc6XG4gICAgICAgICAgICAgICAgY2FzZSAxNjQ6XG4gICAgICAgICAgICAgICAgY2FzZSAxMTpcbiAgICAgICAgICAgICAgICBjYXNlIDI5OlxuICAgICAgICAgICAgICAgIGNhc2UgNDc6XG4gICAgICAgICAgICAgICAgY2FzZSA0ODpcbiAgICAgICAgICAgICAgICBjYXNlIDk1OlxuICAgICAgICAgICAgICAgIGNhc2UgNTI6XG4gICAgICAgICAgICAgICAgY2FzZSA1MTpcbiAgICAgICAgICAgICAgICBjYXNlIDQ2OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMjAwODA5O1xuICAgICAgICAgICAgICAgIGNhc2UgMjc6XG4gICAgICAgICAgICAgICAgY2FzZSAyNDY6XG4gICAgICAgICAgICAgICAgY2FzZSAxMjc6XG4gICAgICAgICAgICAgICAgY2FzZSAxMjg6XG4gICAgICAgICAgICAgICAgY2FzZSAyMzpcbiAgICAgICAgICAgICAgICBjYXNlIDI0OlxuICAgICAgICAgICAgICAgIGNhc2UgMTYwOlxuICAgICAgICAgICAgICAgIGNhc2UgMTYxOlxuICAgICAgICAgICAgICAgIGNhc2UgMTgxOlxuICAgICAgICAgICAgICAgIGNhc2UgMTgyOlxuICAgICAgICAgICAgICAgIGNhc2UgMjQyOlxuICAgICAgICAgICAgICAgIGNhc2UgMTgzOlxuICAgICAgICAgICAgICAgIGNhc2UgMTg0OlxuICAgICAgICAgICAgICAgIGNhc2UgMjQzOlxuICAgICAgICAgICAgICAgIGNhc2UgMjQ0OlxuICAgICAgICAgICAgICAgIGNhc2UgMjQ1OlxuICAgICAgICAgICAgICAgIGNhc2UgMTY1OlxuICAgICAgICAgICAgICAgIGNhc2UgMTc4OlxuICAgICAgICAgICAgICAgIGNhc2UgMTc5OlxuICAgICAgICAgICAgICAgIGNhc2UgNDk6XG4gICAgICAgICAgICAgICAgY2FzZSA1MDpcbiAgICAgICAgICAgICAgICBjYXNlIDE2ODpcbiAgICAgICAgICAgICAgICBjYXNlIDE2OTpcbiAgICAgICAgICAgICAgICBjYXNlIDE3NTpcbiAgICAgICAgICAgICAgICBjYXNlIDE3MDpcbiAgICAgICAgICAgICAgICBjYXNlIDE3MTpcbiAgICAgICAgICAgICAgICBjYXNlIDE3MjpcbiAgICAgICAgICAgICAgICBjYXNlIDk3OlxuICAgICAgICAgICAgICAgIGNhc2UgNzY6XG4gICAgICAgICAgICAgICAgY2FzZSAzMjpcbiAgICAgICAgICAgICAgICBjYXNlIDE3MzpcbiAgICAgICAgICAgICAgICBjYXNlIDM1OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTE7XG4gICAgICAgICAgICAgICAgY2FzZSAxNzY6XG4gICAgICAgICAgICAgICAgY2FzZSAxNzc6XG4gICAgICAgICAgICAgICAgY2FzZSA3OlxuICAgICAgICAgICAgICAgIGNhc2UgMTU1OlxuICAgICAgICAgICAgICAgIGNhc2UgODpcbiAgICAgICAgICAgICAgICBjYXNlIDE1NzpcbiAgICAgICAgICAgICAgICBjYXNlIDEyNTpcbiAgICAgICAgICAgICAgICBjYXNlIDEyNjpcbiAgICAgICAgICAgICAgICBjYXNlIDkyOlxuICAgICAgICAgICAgICAgIGNhc2UgOTM6XG4gICAgICAgICAgICAgICAgY2FzZSAxMjk6XG4gICAgICAgICAgICAgICAgY2FzZSAxMzA6XG4gICAgICAgICAgICAgICAgY2FzZSAxMzE6XG4gICAgICAgICAgICAgICAgY2FzZSA5NDpcbiAgICAgICAgICAgICAgICBjYXNlIDkxOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMTtcbiAgICAgICAgICAgICAgICBjYXNlIDc0OlxuICAgICAgICAgICAgICAgIGNhc2UgNjA6XG4gICAgICAgICAgICAgICAgY2FzZSA2OTpcbiAgICAgICAgICAgICAgICBjYXNlIDcwOlxuICAgICAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDEwMjQ7XG4gICAgICAgICAgICAgICAgY2FzZSAzMTpcbiAgICAgICAgICAgICAgICBjYXNlIDQyOlxuICAgICAgICAgICAgICAgIGNhc2UgNzI6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAzMjtcbiAgICAgICAgICAgICAgICBjYXNlIDg3OlxuICAgICAgICAgICAgICAgIGNhc2UgMjY6XG4gICAgICAgICAgICAgICAgY2FzZSAzMzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDIxNDc0ODM2NDc7XG4gICAgICAgICAgICAgICAgY2FzZSAzNDpcbiAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiA0NzgzOTtcbiAgICAgICAgICAgICAgICBjYXNlIDM4OlxuICAgICAgICAgICAgICAgIGNhc2UgMzY6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiA5OTtcbiAgICAgICAgICAgICAgICBjYXNlIDQzOlxuICAgICAgICAgICAgICAgIGNhc2UgMzc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAyMDQ4O1xuICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDIwOTcxNTI7XG4gICAgICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gNjU1MzY7XG4gICAgICAgICAgICAgICAgY2FzZSAyODpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDMyNzY4O1xuICAgICAgICAgICAgICAgIGNhc2UgNDQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAzMjc2NztcbiAgICAgICAgICAgICAgICBjYXNlIDc1OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMTYzODQ7XG4gICAgICAgICAgICAgICAgY2FzZSAzOTpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDEwMDA7XG4gICAgICAgICAgICAgICAgY2FzZSA4OTpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDcwMDtcbiAgICAgICAgICAgICAgICBjYXNlIDcxOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMjU2O1xuICAgICAgICAgICAgICAgIGNhc2UgNDA6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAyNTU7XG4gICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMTAwO1xuICAgICAgICAgICAgICAgIGNhc2UgMTgwOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gNjQ7XG4gICAgICAgICAgICAgICAgY2FzZSAyNTpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDIwO1xuICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDE2O1xuICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDY7XG4gICAgICAgICAgICAgICAgY2FzZSA3MzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDQ7XG4gICAgICAgICAgICAgICAgY2FzZSA4NDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBfX19zZXRFcnJObyhFUlJOT19DT0RFUy5FSU5WQUwpO1xuICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIF90aW1lKHB0cikge1xuICAgICAgICAgICAgdmFyIHJldCA9IE1hdGguZmxvb3IoRGF0ZS5ub3coKSAvIDEwMDApO1xuICAgICAgICAgICAgaWYgKHB0cikge1xuICAgICAgICAgICAgICAgIEhFQVAzMltwdHIgPj4gMl0gPSByZXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICB9XG4gICAgICAgIHZhciBCcm93c2VyID0ge1xuICAgICAgICAgICAgbWFpbkxvb3A6IHtcbiAgICAgICAgICAgICAgICBzY2hlZHVsZXI6IG51bGwsXG4gICAgICAgICAgICAgICAgc2hvdWxkUGF1c2U6IGZhbHNlLFxuICAgICAgICAgICAgICAgIHBhdXNlZDogZmFsc2UsXG4gICAgICAgICAgICAgICAgcXVldWU6IFtdLFxuICAgICAgICAgICAgICAgIHBhdXNlOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5tYWluTG9vcC5zaG91bGRQYXVzZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICByZXN1bWU6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoQnJvd3Nlci5tYWluTG9vcC5wYXVzZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIEJyb3dzZXIubWFpbkxvb3AucGF1c2VkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICBCcm93c2VyLm1haW5Mb29wLnNjaGVkdWxlcigpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIEJyb3dzZXIubWFpbkxvb3Auc2hvdWxkUGF1c2UgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHVwZGF0ZVN0YXR1czogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChNb2R1bGVbJ3NldFN0YXR1cyddKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWVzc2FnZSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgTW9kdWxlWydzdGF0dXNNZXNzYWdlJ10gfHwgJ1BsZWFzZSB3YWl0Li4uJztcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZW1haW5pbmcgPSBCcm93c2VyLm1haW5Mb29wLnJlbWFpbmluZ0Jsb2NrZXJzO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGV4cGVjdGVkID0gQnJvd3Nlci5tYWluTG9vcC5leHBlY3RlZEJsb2NrZXJzO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlbWFpbmluZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZW1haW5pbmcgPCBleHBlY3RlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNb2R1bGVbJ3NldFN0YXR1cyddKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJyAoJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGV4cGVjdGVkIC0gcmVtYWluaW5nKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJy8nICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHBlY3RlZCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJyknXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTW9kdWxlWydzZXRTdGF0dXMnXShtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1vZHVsZVsnc2V0U3RhdHVzJ10oJycpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGlzRnVsbFNjcmVlbjogZmFsc2UsXG4gICAgICAgICAgICBwb2ludGVyTG9jazogZmFsc2UsXG4gICAgICAgICAgICBtb2R1bGVDb250ZXh0Q3JlYXRlZENhbGxiYWNrczogW10sXG4gICAgICAgICAgICB3b3JrZXJzOiBbXSxcbiAgICAgICAgICAgIGluaXQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIGlmICghTW9kdWxlWydwcmVsb2FkUGx1Z2lucyddKSBNb2R1bGVbJ3ByZWxvYWRQbHVnaW5zJ10gPSBbXTsgLy8gbmVlZHMgdG8gZXhpc3QgZXZlbiBpbiB3b3JrZXJzXG4gICAgICAgICAgICAgICAgaWYgKEJyb3dzZXIuaW5pdHRlZCkgcmV0dXJuO1xuICAgICAgICAgICAgICAgIEJyb3dzZXIuaW5pdHRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgbmV3IEJsb2IoKTtcbiAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5oYXNCbG9iQ29uc3RydWN0b3IgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5oYXNCbG9iQ29uc3RydWN0b3IgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05vIGJsb2IgY29uc3RydWN0b3IsIGNhbm5vdCBjcmVhdGUgYmxvYnMgd2l0aCBtaW1ldHlwZXMnXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIEJyb3dzZXIuQmxvYkJ1aWxkZXIgPVxuICAgICAgICAgICAgICAgICAgICB0eXBlb2YgTW96QmxvYkJ1aWxkZXIgIT0gJ3VuZGVmaW5lZCdcbiAgICAgICAgICAgICAgICAgICAgICAgID8gTW96QmxvYkJ1aWxkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgIDogdHlwZW9mIFdlYktpdEJsb2JCdWlsZGVyICE9ICd1bmRlZmluZWQnXG4gICAgICAgICAgICAgICAgICAgICAgICA/IFdlYktpdEJsb2JCdWlsZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICA6ICFCcm93c2VyLmhhc0Jsb2JDb25zdHJ1Y3RvclxuICAgICAgICAgICAgICAgICAgICAgICAgPyBjb25zb2xlLndhcm4oJ05vIEJsb2JCdWlsZGVyJylcbiAgICAgICAgICAgICAgICAgICAgICAgIDogbnVsbDtcbiAgICAgICAgICAgICAgICBCcm93c2VyLlVSTE9iamVjdCA9XG4gICAgICAgICAgICAgICAgICAgIHR5cGVvZiB3aW5kb3cgIT0gJ3VuZGVmaW5lZCdcbiAgICAgICAgICAgICAgICAgICAgICAgID8gd2luZG93LlVSTFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gd2luZG93LlVSTFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogd2luZG93LndlYmtpdFVSTFxuICAgICAgICAgICAgICAgICAgICAgICAgOiB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAhTW9kdWxlLm5vSW1hZ2VEZWNvZGluZyAmJlxuICAgICAgICAgICAgICAgICAgICB0eXBlb2YgQnJvd3Nlci5VUkxPYmplY3QgPT09ICd1bmRlZmluZWQnXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2FybihcbiAgICAgICAgICAgICAgICAgICAgICAgICdCcm93c2VyIGRvZXMgbm90IHN1cHBvcnQgY3JlYXRpbmcgb2JqZWN0IFVSTHMuIEJ1aWx0LWluIGJyb3dzZXIgaW1hZ2UgZGVjb2Rpbmcgd2lsbCBub3QgYmUgYXZhaWxhYmxlLidcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgTW9kdWxlLm5vSW1hZ2VEZWNvZGluZyA9IHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIFN1cHBvcnQgZm9yIHBsdWdpbnMgdGhhdCBjYW4gcHJvY2VzcyBwcmVsb2FkZWQgZmlsZXMuIFlvdSBjYW4gYWRkIG1vcmUgb2YgdGhlc2UgdG9cbiAgICAgICAgICAgICAgICAvLyB5b3VyIGFwcCBieSBjcmVhdGluZyBhbmQgYXBwZW5kaW5nIHRvIE1vZHVsZS5wcmVsb2FkUGx1Z2lucy5cbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIC8vIEVhY2ggcGx1Z2luIGlzIGFza2VkIGlmIGl0IGNhbiBoYW5kbGUgYSBmaWxlIGJhc2VkIG9uIHRoZSBmaWxlJ3MgbmFtZS4gSWYgaXQgY2FuLFxuICAgICAgICAgICAgICAgIC8vIGl0IGlzIGdpdmVuIHRoZSBmaWxlJ3MgcmF3IGRhdGEuIFdoZW4gaXQgaXMgZG9uZSwgaXQgY2FsbHMgYSBjYWxsYmFjayB3aXRoIHRoZSBmaWxlJ3NcbiAgICAgICAgICAgICAgICAvLyAocG9zc2libHkgbW9kaWZpZWQpIGRhdGEuIEZvciBleGFtcGxlLCBhIHBsdWdpbiBtaWdodCBkZWNvbXByZXNzIGEgZmlsZSwgb3IgaXRcbiAgICAgICAgICAgICAgICAvLyBtaWdodCBjcmVhdGUgc29tZSBzaWRlIGRhdGEgc3RydWN0dXJlIGZvciB1c2UgbGF0ZXIgKGxpa2UgYW4gSW1hZ2UgZWxlbWVudCwgZXRjLikuXG4gICAgICAgICAgICAgICAgdmFyIGltYWdlUGx1Z2luID0ge307XG4gICAgICAgICAgICAgICAgaW1hZ2VQbHVnaW5bJ2NhbkhhbmRsZSddID0gZnVuY3Rpb24obmFtZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAgICAgIU1vZHVsZS5ub0ltYWdlRGVjb2RpbmcgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIC9cXC4oanBnfGpwZWd8cG5nfGJtcCkkL2kudGVzdChuYW1lKVxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgaW1hZ2VQbHVnaW5bJ2hhbmRsZSddID0gZnVuY3Rpb24oXG4gICAgICAgICAgICAgICAgICAgIGJ5dGVBcnJheSxcbiAgICAgICAgICAgICAgICAgICAgbmFtZSxcbiAgICAgICAgICAgICAgICAgICAgb25sb2FkLFxuICAgICAgICAgICAgICAgICAgICBvbmVycm9yXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBiID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKEJyb3dzZXIuaGFzQmxvYkNvbnN0cnVjdG9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPSBuZXcgQmxvYihbYnl0ZUFycmF5XSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBCcm93c2VyLmdldE1pbWV0eXBlKG5hbWUpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGIuc2l6ZSAhPT0gYnl0ZUFycmF5Lmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBTYWZhcmkgYnVnICMxMTg2MzBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2FmYXJpJ3MgQmxvYiBjYW4gb25seSB0YWtlIGFuIEFycmF5QnVmZmVyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPSBuZXcgQmxvYihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFtuZXcgVWludDhBcnJheShieXRlQXJyYXkpLmJ1ZmZlcl0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IHR5cGU6IEJyb3dzZXIuZ2V0TWltZXR5cGUobmFtZSkgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBSdW50aW1lLndhcm5PbmNlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnQmxvYiBjb25zdHJ1Y3RvciBwcmVzZW50IGJ1dCBmYWlsczogJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICc7IGZhbGxpbmcgYmFjayB0byBibG9iIGJ1aWxkZXInXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoIWIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBiYiA9IG5ldyBCcm93c2VyLkJsb2JCdWlsZGVyKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBiYi5hcHBlbmQobmV3IFVpbnQ4QXJyYXkoYnl0ZUFycmF5KS5idWZmZXIpOyAvLyB3ZSBuZWVkIHRvIHBhc3MgYSBidWZmZXIsIGFuZCBtdXN0IGNvcHkgdGhlIGFycmF5IHRvIGdldCB0aGUgcmlnaHQgZGF0YSByYW5nZVxuICAgICAgICAgICAgICAgICAgICAgICAgYiA9IGJiLmdldEJsb2IoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB2YXIgdXJsID0gQnJvd3Nlci5VUkxPYmplY3QuY3JlYXRlT2JqZWN0VVJMKGIpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgaW1nID0gbmV3IEltYWdlKCk7XG4gICAgICAgICAgICAgICAgICAgIGltZy5vbmxvYWQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFzc2VydChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWcuY29tcGxldGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0ltYWdlICcgKyBuYW1lICsgJyBjb3VsZCBub3QgYmUgZGVjb2RlZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2FudmFzID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnY2FudmFzJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMud2lkdGggPSBpbWcud2lkdGg7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMuaGVpZ2h0ID0gaW1nLmhlaWdodDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjdHggPSBjYW52YXMuZ2V0Q29udGV4dCgnMmQnKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoaW1nLCAwLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIE1vZHVsZVsncHJlbG9hZGVkSW1hZ2VzJ11bbmFtZV0gPSBjYW52YXM7XG4gICAgICAgICAgICAgICAgICAgICAgICBCcm93c2VyLlVSTE9iamVjdC5yZXZva2VPYmplY3RVUkwodXJsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvbmxvYWQpIG9ubG9hZChieXRlQXJyYXkpO1xuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICBpbWcub25lcnJvciA9IGZ1bmN0aW9uKGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKCdJbWFnZSAnICsgdXJsICsgJyBjb3VsZCBub3QgYmUgZGVjb2RlZCcpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9uZXJyb3IpIG9uZXJyb3IoKTtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgaW1nLnNyYyA9IHVybDtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIE1vZHVsZVsncHJlbG9hZFBsdWdpbnMnXS5wdXNoKGltYWdlUGx1Z2luKTtcbiAgICAgICAgICAgICAgICB2YXIgYXVkaW9QbHVnaW4gPSB7fTtcbiAgICAgICAgICAgICAgICBhdWRpb1BsdWdpblsnY2FuSGFuZGxlJ10gPSBmdW5jdGlvbihuYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAhTW9kdWxlLm5vQXVkaW9EZWNvZGluZyAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZS5zdWJzdHIoLTQpIGluIHsgJy5vZ2cnOiAxLCAnLndhdic6IDEsICcubXAzJzogMSB9XG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBhdWRpb1BsdWdpblsnaGFuZGxlJ10gPSBmdW5jdGlvbihcbiAgICAgICAgICAgICAgICAgICAgYnl0ZUFycmF5LFxuICAgICAgICAgICAgICAgICAgICBuYW1lLFxuICAgICAgICAgICAgICAgICAgICBvbmxvYWQsXG4gICAgICAgICAgICAgICAgICAgIG9uZXJyb3JcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRvbmUgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gZmluaXNoKGF1ZGlvKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZG9uZSkgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgZG9uZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICBNb2R1bGVbJ3ByZWxvYWRlZEF1ZGlvcyddW25hbWVdID0gYXVkaW87XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob25sb2FkKSBvbmxvYWQoYnl0ZUFycmF5KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBmYWlsKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRvbmUpIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvbmUgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgTW9kdWxlWydwcmVsb2FkZWRBdWRpb3MnXVtuYW1lXSA9IG5ldyBBdWRpbygpOyAvLyBlbXB0eSBzaGltXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob25lcnJvcikgb25lcnJvcigpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChCcm93c2VyLmhhc0Jsb2JDb25zdHJ1Y3Rvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYiA9IG5ldyBCbG9iKFtieXRlQXJyYXldLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IEJyb3dzZXIuZ2V0TWltZXR5cGUobmFtZSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFpbCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHVybCA9IEJyb3dzZXIuVVJMT2JqZWN0LmNyZWF0ZU9iamVjdFVSTChiKTsgLy8gWFhYIHdlIG5ldmVyIHJldm9rZSB0aGlzIVxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGF1ZGlvID0gbmV3IEF1ZGlvKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBhdWRpby5hZGRFdmVudExpc3RlbmVyKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjYW5wbGF5dGhyb3VnaCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmlzaChhdWRpbyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZVxuICAgICAgICAgICAgICAgICAgICAgICAgKTsgLy8gdXNlIGFkZEV2ZW50TGlzdGVuZXIgZHVlIHRvIGNocm9taXVtIGJ1ZyAxMjQ5MjZcbiAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvLm9uZXJyb3IgPSBmdW5jdGlvbihldmVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkb25lKSByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnQnJvd3NlciBjb3VsZCBub3QgZnVsbHkgZGVjb2RlIGF1ZGlvICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnLCB0cnlpbmcgc2xvd2VyIGJhc2U2NCBhcHByb2FjaCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGVuY29kZTY0KGRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIEJBU0UgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0FCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXowMTIzNDU2Nzg5Ky8nO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgUEFEID0gJz0nO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmV0ID0gJyc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsZWZ0Y2hhciA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsZWZ0Yml0cyA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZGF0YS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdGNoYXIgPSAobGVmdGNoYXIgPDwgOCkgfCBkYXRhW2ldO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdGJpdHMgKz0gODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChsZWZ0Yml0cyA+PSA2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnIgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobGVmdGNoYXIgPj4gKGxlZnRiaXRzIC0gNikpICYgMHgzZjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0Yml0cyAtPSA2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldCArPSBCQVNFW2N1cnJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsZWZ0Yml0cyA9PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXQgKz0gQkFTRVsobGVmdGNoYXIgJiAzKSA8PCA0XTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldCArPSBQQUQgKyBQQUQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobGVmdGJpdHMgPT0gNCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0ICs9IEJBU0VbKGxlZnRjaGFyICYgMHhmKSA8PCAyXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldCArPSBQQUQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW8uc3JjID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2RhdGE6YXVkaW8veC0nICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZS5zdWJzdHIoLTMpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJztiYXNlNjQsJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuY29kZTY0KGJ5dGVBcnJheSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluaXNoKGF1ZGlvKTsgLy8gd2UgZG9uJ3Qgd2FpdCBmb3IgY29uZmlybWF0aW9uIHRoaXMgd29ya2VkIC0gYnV0IGl0J3Mgd29ydGggdHJ5aW5nXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW8uc3JjID0gdXJsO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gd29ya2Fyb3VuZCBmb3IgY2hyb21lIGJ1ZyAxMjQ5MjYgLSB3ZSBkbyBub3QgYWx3YXlzIGdldCBvbmNhbnBsYXl0aHJvdWdoIG9yIG9uZXJyb3JcbiAgICAgICAgICAgICAgICAgICAgICAgIEJyb3dzZXIuc2FmZVNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluaXNoKGF1ZGlvKTsgLy8gdHJ5IHRvIHVzZSBpdCBldmVuIHRob3VnaCBpdCBpcyBub3QgbmVjZXNzYXJpbHkgcmVhZHkgdG8gcGxheVxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAwMDApO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhaWwoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgTW9kdWxlWydwcmVsb2FkUGx1Z2lucyddLnB1c2goYXVkaW9QbHVnaW4pO1xuICAgICAgICAgICAgICAgIC8vIENhbnZhcyBldmVudCBzZXR1cFxuICAgICAgICAgICAgICAgIHZhciBjYW52YXMgPSBNb2R1bGVbJ2NhbnZhcyddO1xuICAgICAgICAgICAgICAgIGNhbnZhcy5yZXF1ZXN0UG9pbnRlckxvY2sgPVxuICAgICAgICAgICAgICAgICAgICBjYW52YXNbJ3JlcXVlc3RQb2ludGVyTG9jayddIHx8XG4gICAgICAgICAgICAgICAgICAgIGNhbnZhc1snbW96UmVxdWVzdFBvaW50ZXJMb2NrJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgY2FudmFzWyd3ZWJraXRSZXF1ZXN0UG9pbnRlckxvY2snXTtcbiAgICAgICAgICAgICAgICBjYW52YXMuZXhpdFBvaW50ZXJMb2NrID1cbiAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnRbJ2V4aXRQb2ludGVyTG9jayddIHx8XG4gICAgICAgICAgICAgICAgICAgIGRvY3VtZW50Wydtb3pFeGl0UG9pbnRlckxvY2snXSB8fFxuICAgICAgICAgICAgICAgICAgICBkb2N1bWVudFsnd2Via2l0RXhpdFBvaW50ZXJMb2NrJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24oKSB7fTsgLy8gbm8tb3AgaWYgZnVuY3Rpb24gZG9lcyBub3QgZXhpc3RcbiAgICAgICAgICAgICAgICBjYW52YXMuZXhpdFBvaW50ZXJMb2NrID0gY2FudmFzLmV4aXRQb2ludGVyTG9jay5iaW5kKGRvY3VtZW50KTtcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBwb2ludGVyTG9ja0NoYW5nZSgpIHtcbiAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5wb2ludGVyTG9jayA9XG4gICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudFsncG9pbnRlckxvY2tFbGVtZW50J10gPT09IGNhbnZhcyB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnRbJ21velBvaW50ZXJMb2NrRWxlbWVudCddID09PSBjYW52YXMgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50Wyd3ZWJraXRQb2ludGVyTG9ja0VsZW1lbnQnXSA9PT0gY2FudmFzO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKFxuICAgICAgICAgICAgICAgICAgICAncG9pbnRlcmxvY2tjaGFuZ2UnLFxuICAgICAgICAgICAgICAgICAgICBwb2ludGVyTG9ja0NoYW5nZSxcbiAgICAgICAgICAgICAgICAgICAgZmFsc2VcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoXG4gICAgICAgICAgICAgICAgICAgICdtb3pwb2ludGVybG9ja2NoYW5nZScsXG4gICAgICAgICAgICAgICAgICAgIHBvaW50ZXJMb2NrQ2hhbmdlLFxuICAgICAgICAgICAgICAgICAgICBmYWxzZVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcihcbiAgICAgICAgICAgICAgICAgICAgJ3dlYmtpdHBvaW50ZXJsb2NrY2hhbmdlJyxcbiAgICAgICAgICAgICAgICAgICAgcG9pbnRlckxvY2tDaGFuZ2UsXG4gICAgICAgICAgICAgICAgICAgIGZhbHNlXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICBpZiAoTW9kdWxlWydlbGVtZW50UG9pbnRlckxvY2snXSkge1xuICAgICAgICAgICAgICAgICAgICBjYW52YXMuYWRkRXZlbnRMaXN0ZW5lcihcbiAgICAgICAgICAgICAgICAgICAgICAgICdjbGljaycsXG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbihldikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIUJyb3dzZXIucG9pbnRlckxvY2sgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FudmFzLnJlcXVlc3RQb2ludGVyTG9ja1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMucmVxdWVzdFBvaW50ZXJMb2NrKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNyZWF0ZUNvbnRleHQ6IGZ1bmN0aW9uKGNhbnZhcywgdXNlV2ViR0wsIHNldEluTW9kdWxlKSB7XG4gICAgICAgICAgICAgICAgdmFyIGN0eDtcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodXNlV2ViR0wpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eCA9IGNhbnZhcy5nZXRDb250ZXh0KCdleHBlcmltZW50YWwtd2ViZ2wnLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IGZhbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eCA9IGNhbnZhcy5nZXRDb250ZXh0KCcyZCcpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICghY3R4KSB0aHJvdyAnOignO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcignQ291bGQgbm90IGNyZWF0ZSBjYW52YXMgLSAnICsgZSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAodXNlV2ViR0wpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gU2V0IHRoZSBiYWNrZ3JvdW5kIG9mIHRoZSBXZWJHTCBjYW52YXMgdG8gYmxhY2tcbiAgICAgICAgICAgICAgICAgICAgY2FudmFzLnN0eWxlLmJhY2tncm91bmRDb2xvciA9ICdibGFjayc7XG4gICAgICAgICAgICAgICAgICAgIC8vIFdhcm4gb24gY29udGV4dCBsb3NzXG4gICAgICAgICAgICAgICAgICAgIGNhbnZhcy5hZGRFdmVudExpc3RlbmVyKFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dlYmdsY29udGV4dGxvc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24oZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGVydChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1dlYkdMIGNvbnRleHQgbG9zdC4gWW91IHdpbGwgbmVlZCB0byByZWxvYWQgdGhlIHBhZ2UuJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2VcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHNldEluTW9kdWxlKSB7XG4gICAgICAgICAgICAgICAgICAgIE1vZHVsZS5jdHggPSBjdHg7XG4gICAgICAgICAgICAgICAgICAgIE1vZHVsZS51c2VXZWJHTCA9IHVzZVdlYkdMO1xuICAgICAgICAgICAgICAgICAgICBCcm93c2VyLm1vZHVsZUNvbnRleHRDcmVhdGVkQ2FsbGJhY2tzLmZvckVhY2goZnVuY3Rpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFja1xuICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBCcm93c2VyLmluaXQoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGN0eDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBkZXN0cm95Q29udGV4dDogZnVuY3Rpb24oY2FudmFzLCB1c2VXZWJHTCwgc2V0SW5Nb2R1bGUpIHt9LFxuICAgICAgICAgICAgZnVsbFNjcmVlbkhhbmRsZXJzSW5zdGFsbGVkOiBmYWxzZSxcbiAgICAgICAgICAgIGxvY2tQb2ludGVyOiB1bmRlZmluZWQsXG4gICAgICAgICAgICByZXNpemVDYW52YXM6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHJlcXVlc3RGdWxsU2NyZWVuOiBmdW5jdGlvbihsb2NrUG9pbnRlciwgcmVzaXplQ2FudmFzKSB7XG4gICAgICAgICAgICAgICAgQnJvd3Nlci5sb2NrUG9pbnRlciA9IGxvY2tQb2ludGVyO1xuICAgICAgICAgICAgICAgIEJyb3dzZXIucmVzaXplQ2FudmFzID0gcmVzaXplQ2FudmFzO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgQnJvd3Nlci5sb2NrUG9pbnRlciA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIEJyb3dzZXIubG9ja1BvaW50ZXIgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgQnJvd3Nlci5yZXNpemVDYW52YXMgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBCcm93c2VyLnJlc2l6ZUNhbnZhcyA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIHZhciBjYW52YXMgPSBNb2R1bGVbJ2NhbnZhcyddO1xuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGZ1bGxTY3JlZW5DaGFuZ2UoKSB7XG4gICAgICAgICAgICAgICAgICAgIEJyb3dzZXIuaXNGdWxsU2NyZWVuID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIChkb2N1bWVudFsnd2Via2l0RnVsbFNjcmVlbkVsZW1lbnQnXSB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50Wyd3ZWJraXRGdWxsc2NyZWVuRWxlbWVudCddIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnRbJ21vekZ1bGxTY3JlZW5FbGVtZW50J10gfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudFsnbW96RnVsbHNjcmVlbkVsZW1lbnQnXSB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50WydmdWxsU2NyZWVuRWxlbWVudCddIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnRbJ2Z1bGxzY3JlZW5FbGVtZW50J10pID09PSBjYW52YXNcbiAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMuY2FuY2VsRnVsbFNjcmVlbiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnRbJ2NhbmNlbEZ1bGxTY3JlZW4nXSB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50Wydtb3pDYW5jZWxGdWxsU2NyZWVuJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudFsnd2Via2l0Q2FuY2VsRnVsbFNjcmVlbiddO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FudmFzLmNhbmNlbEZ1bGxTY3JlZW4gPSBjYW52YXMuY2FuY2VsRnVsbFNjcmVlbi5iaW5kKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50XG4gICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEJyb3dzZXIubG9ja1BvaW50ZXIpIGNhbnZhcy5yZXF1ZXN0UG9pbnRlckxvY2soKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIEJyb3dzZXIuaXNGdWxsU2NyZWVuID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChCcm93c2VyLnJlc2l6ZUNhbnZhcylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCcm93c2VyLnNldEZ1bGxTY3JlZW5DYW52YXNTaXplKCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoQnJvd3Nlci5yZXNpemVDYW52YXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIEJyb3dzZXIuc2V0V2luZG93ZWRDYW52YXNTaXplKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKE1vZHVsZVsnb25GdWxsU2NyZWVuJ10pXG4gICAgICAgICAgICAgICAgICAgICAgICBNb2R1bGVbJ29uRnVsbFNjcmVlbiddKEJyb3dzZXIuaXNGdWxsU2NyZWVuKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFCcm93c2VyLmZ1bGxTY3JlZW5IYW5kbGVyc0luc3RhbGxlZCkge1xuICAgICAgICAgICAgICAgICAgICBCcm93c2VyLmZ1bGxTY3JlZW5IYW5kbGVyc0luc3RhbGxlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVsbHNjcmVlbmNoYW5nZScsXG4gICAgICAgICAgICAgICAgICAgICAgICBmdWxsU2NyZWVuQ2hhbmdlLFxuICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2VcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcihcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb3pmdWxsc2NyZWVuY2hhbmdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZ1bGxTY3JlZW5DaGFuZ2UsXG4gICAgICAgICAgICAgICAgICAgICAgICBmYWxzZVxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dlYmtpdGZ1bGxzY3JlZW5jaGFuZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgZnVsbFNjcmVlbkNoYW5nZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNhbnZhcy5yZXF1ZXN0RnVsbFNjcmVlbiA9XG4gICAgICAgICAgICAgICAgICAgIGNhbnZhc1sncmVxdWVzdEZ1bGxTY3JlZW4nXSB8fFxuICAgICAgICAgICAgICAgICAgICBjYW52YXNbJ21velJlcXVlc3RGdWxsU2NyZWVuJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgKGNhbnZhc1snd2Via2l0UmVxdWVzdEZ1bGxTY3JlZW4nXVxuICAgICAgICAgICAgICAgICAgICAgICAgPyBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhc1snd2Via2l0UmVxdWVzdEZ1bGxTY3JlZW4nXShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbGVtZW50WydBTExPV19LRVlCT0FSRF9JTlBVVCddXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICA6IG51bGwpO1xuICAgICAgICAgICAgICAgIGNhbnZhcy5yZXF1ZXN0RnVsbFNjcmVlbigpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHJlcXVlc3RBbmltYXRpb25GcmFtZTogZnVuY3Rpb24oZnVuYykge1xuICAgICAgICAgICAgICAgIGlmICghd2luZG93LnJlcXVlc3RBbmltYXRpb25GcmFtZSkge1xuICAgICAgICAgICAgICAgICAgICB3aW5kb3cucmVxdWVzdEFuaW1hdGlvbkZyYW1lID1cbiAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvd1sncmVxdWVzdEFuaW1hdGlvbkZyYW1lJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvd1snbW96UmVxdWVzdEFuaW1hdGlvbkZyYW1lJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvd1snd2Via2l0UmVxdWVzdEFuaW1hdGlvbkZyYW1lJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvd1snbXNSZXF1ZXN0QW5pbWF0aW9uRnJhbWUnXSB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93WydvUmVxdWVzdEFuaW1hdGlvbkZyYW1lJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvd1snc2V0VGltZW91dCddO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB3aW5kb3cucmVxdWVzdEFuaW1hdGlvbkZyYW1lKGZ1bmMpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhZmVDYWxsYmFjazogZnVuY3Rpb24oZnVuYykge1xuICAgICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFBQk9SVCkgcmV0dXJuIGZ1bmMuYXBwbHkobnVsbCwgYXJndW1lbnRzKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhZmVSZXF1ZXN0QW5pbWF0aW9uRnJhbWU6IGZ1bmN0aW9uKGZ1bmMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gQnJvd3Nlci5yZXF1ZXN0QW5pbWF0aW9uRnJhbWUoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghQUJPUlQpIGZ1bmMoKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzYWZlU2V0VGltZW91dDogZnVuY3Rpb24oZnVuYywgdGltZW91dCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIUFCT1JUKSBmdW5jKCk7XG4gICAgICAgICAgICAgICAgfSwgdGltZW91dCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FmZVNldEludGVydmFsOiBmdW5jdGlvbihmdW5jLCB0aW1lb3V0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHNldEludGVydmFsKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIUFCT1JUKSBmdW5jKCk7XG4gICAgICAgICAgICAgICAgfSwgdGltZW91dCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZ2V0TWltZXR5cGU6IGZ1bmN0aW9uKG5hbWUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICBqcGc6ICdpbWFnZS9qcGVnJyxcbiAgICAgICAgICAgICAgICAgICAganBlZzogJ2ltYWdlL2pwZWcnLFxuICAgICAgICAgICAgICAgICAgICBwbmc6ICdpbWFnZS9wbmcnLFxuICAgICAgICAgICAgICAgICAgICBibXA6ICdpbWFnZS9ibXAnLFxuICAgICAgICAgICAgICAgICAgICBvZ2c6ICdhdWRpby9vZ2cnLFxuICAgICAgICAgICAgICAgICAgICB3YXY6ICdhdWRpby93YXYnLFxuICAgICAgICAgICAgICAgICAgICBtcDM6ICdhdWRpby9tcGVnJ1xuICAgICAgICAgICAgICAgIH1bbmFtZS5zdWJzdHIobmFtZS5sYXN0SW5kZXhPZignLicpICsgMSldO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdldFVzZXJNZWRpYTogZnVuY3Rpb24oZnVuYykge1xuICAgICAgICAgICAgICAgIGlmICghd2luZG93LmdldFVzZXJNZWRpYSkge1xuICAgICAgICAgICAgICAgICAgICB3aW5kb3cuZ2V0VXNlck1lZGlhID1cbiAgICAgICAgICAgICAgICAgICAgICAgIG5hdmlnYXRvclsnZ2V0VXNlck1lZGlhJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hdmlnYXRvclsnbW96R2V0VXNlck1lZGlhJ107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHdpbmRvdy5nZXRVc2VyTWVkaWEoZnVuYyk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZ2V0TW92ZW1lbnRYOiBmdW5jdGlvbihldmVudCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgIGV2ZW50Wydtb3ZlbWVudFgnXSB8fFxuICAgICAgICAgICAgICAgICAgICBldmVudFsnbW96TW92ZW1lbnRYJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgZXZlbnRbJ3dlYmtpdE1vdmVtZW50WCddIHx8XG4gICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdldE1vdmVtZW50WTogZnVuY3Rpb24oZXZlbnQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICBldmVudFsnbW92ZW1lbnRZJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgZXZlbnRbJ21vek1vdmVtZW50WSddIHx8XG4gICAgICAgICAgICAgICAgICAgIGV2ZW50Wyd3ZWJraXRNb3ZlbWVudFknXSB8fFxuICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBtb3VzZVg6IDAsXG4gICAgICAgICAgICBtb3VzZVk6IDAsXG4gICAgICAgICAgICBtb3VzZU1vdmVtZW50WDogMCxcbiAgICAgICAgICAgIG1vdXNlTW92ZW1lbnRZOiAwLFxuICAgICAgICAgICAgY2FsY3VsYXRlTW91c2VFdmVudDogZnVuY3Rpb24oZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAvLyBldmVudCBzaG91bGQgYmUgbW91c2Vtb3ZlLCBtb3VzZWRvd24gb3IgbW91c2V1cFxuICAgICAgICAgICAgICAgIGlmIChCcm93c2VyLnBvaW50ZXJMb2NrKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIFdoZW4gdGhlIHBvaW50ZXIgaXMgbG9ja2VkLCBjYWxjdWxhdGUgdGhlIGNvb3JkaW5hdGVzXG4gICAgICAgICAgICAgICAgICAgIC8vIGJhc2VkIG9uIHRoZSBtb3ZlbWVudCBvZiB0aGUgbW91c2UuXG4gICAgICAgICAgICAgICAgICAgIC8vIFdvcmthcm91bmQgZm9yIEZpcmVmb3ggYnVnIDc2NDQ5OFxuICAgICAgICAgICAgICAgICAgICBpZiAoZXZlbnQudHlwZSAhPSAnbW91c2Vtb3ZlJyAmJiAnbW96TW92ZW1lbnRYJyBpbiBldmVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5tb3VzZU1vdmVtZW50WCA9IEJyb3dzZXIubW91c2VNb3ZlbWVudFkgPSAwO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5tb3VzZU1vdmVtZW50WCA9IEJyb3dzZXIuZ2V0TW92ZW1lbnRYKGV2ZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIEJyb3dzZXIubW91c2VNb3ZlbWVudFkgPSBCcm93c2VyLmdldE1vdmVtZW50WShldmVudCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgLy8gY2hlY2sgaWYgU0RMIGlzIGF2YWlsYWJsZVxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIFNETCAhPSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5tb3VzZVggPSBTREwubW91c2VYICsgQnJvd3Nlci5tb3VzZU1vdmVtZW50WDtcbiAgICAgICAgICAgICAgICAgICAgICAgIEJyb3dzZXIubW91c2VZID0gU0RMLm1vdXNlWSArIEJyb3dzZXIubW91c2VNb3ZlbWVudFk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBqdXN0IGFkZCB0aGUgbW91c2UgZGVsdGEgdG8gdGhlIGN1cnJlbnQgYWJzb2x1dCBtb3VzZSBwb3NpdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gRklYTUU6IGlkZWFsbHkgdGhpcyBzaG91bGQgYmUgY2xhbXBlZCBhZ2FpbnN0IHRoZSBjYW52YXMgc2l6ZSBhbmQgemVyb1xuICAgICAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5tb3VzZVggKz0gQnJvd3Nlci5tb3VzZU1vdmVtZW50WDtcbiAgICAgICAgICAgICAgICAgICAgICAgIEJyb3dzZXIubW91c2VZICs9IEJyb3dzZXIubW91c2VNb3ZlbWVudFk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvLyBPdGhlcndpc2UsIGNhbGN1bGF0ZSB0aGUgbW92ZW1lbnQgYmFzZWQgb24gdGhlIGNoYW5nZXNcbiAgICAgICAgICAgICAgICAgICAgLy8gaW4gdGhlIGNvb3JkaW5hdGVzLlxuICAgICAgICAgICAgICAgICAgICB2YXIgcmVjdCA9IE1vZHVsZVsnY2FudmFzJ10uZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciB4LCB5O1xuICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICBldmVudC50eXBlID09ICd0b3VjaHN0YXJ0JyB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQudHlwZSA9PSAndG91Y2hlbmQnIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICBldmVudC50eXBlID09ICd0b3VjaG1vdmUnXG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHQgPSBldmVudC50b3VjaGVzLml0ZW0oMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggPSB0LnBhZ2VYIC0gKHdpbmRvdy5zY3JvbGxYICsgcmVjdC5sZWZ0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB5ID0gdC5wYWdlWSAtICh3aW5kb3cuc2Nyb2xsWSArIHJlY3QudG9wKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgeCA9IGV2ZW50LnBhZ2VYIC0gKHdpbmRvdy5zY3JvbGxYICsgcmVjdC5sZWZ0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHkgPSBldmVudC5wYWdlWSAtICh3aW5kb3cuc2Nyb2xsWSArIHJlY3QudG9wKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyB0aGUgY2FudmFzIG1pZ2h0IGJlIENTUy1zY2FsZWQgY29tcGFyZWQgdG8gaXRzIGJhY2tidWZmZXI7XG4gICAgICAgICAgICAgICAgICAgIC8vIFNETC11c2luZyBjb250ZW50IHdpbGwgd2FudCBtb3VzZSBjb29yZGluYXRlcyBpbiB0ZXJtc1xuICAgICAgICAgICAgICAgICAgICAvLyBvZiBiYWNrYnVmZmVyIHVuaXRzLlxuICAgICAgICAgICAgICAgICAgICB2YXIgY3cgPSBNb2R1bGVbJ2NhbnZhcyddLndpZHRoO1xuICAgICAgICAgICAgICAgICAgICB2YXIgY2ggPSBNb2R1bGVbJ2NhbnZhcyddLmhlaWdodDtcbiAgICAgICAgICAgICAgICAgICAgeCA9IHggKiAoY3cgLyByZWN0LndpZHRoKTtcbiAgICAgICAgICAgICAgICAgICAgeSA9IHkgKiAoY2ggLyByZWN0LmhlaWdodCk7XG4gICAgICAgICAgICAgICAgICAgIEJyb3dzZXIubW91c2VNb3ZlbWVudFggPSB4IC0gQnJvd3Nlci5tb3VzZVg7XG4gICAgICAgICAgICAgICAgICAgIEJyb3dzZXIubW91c2VNb3ZlbWVudFkgPSB5IC0gQnJvd3Nlci5tb3VzZVk7XG4gICAgICAgICAgICAgICAgICAgIEJyb3dzZXIubW91c2VYID0geDtcbiAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5tb3VzZVkgPSB5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB4aHJMb2FkOiBmdW5jdGlvbih1cmwsIG9ubG9hZCwgb25lcnJvcikge1xuICAgICAgICAgICAgICAgIHZhciB4aHIgPSBuZXcgWE1MSHR0cFJlcXVlc3QoKTtcbiAgICAgICAgICAgICAgICB4aHIub3BlbignR0VUJywgdXJsLCB0cnVlKTtcbiAgICAgICAgICAgICAgICB4aHIucmVzcG9uc2VUeXBlID0gJ2FycmF5YnVmZmVyJztcbiAgICAgICAgICAgICAgICB4aHIub25sb2FkID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIHhoci5zdGF0dXMgPT0gMjAwIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAoeGhyLnN0YXR1cyA9PSAwICYmIHhoci5yZXNwb25zZSlcbiAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBmaWxlIFVSTHMgY2FuIHJldHVybiAwXG4gICAgICAgICAgICAgICAgICAgICAgICBvbmxvYWQoeGhyLnJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uZXJyb3IoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgeGhyLm9uZXJyb3IgPSBvbmVycm9yO1xuICAgICAgICAgICAgICAgIHhoci5zZW5kKG51bGwpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGFzeW5jTG9hZDogZnVuY3Rpb24odXJsLCBvbmxvYWQsIG9uZXJyb3IsIG5vUnVuRGVwKSB7XG4gICAgICAgICAgICAgICAgQnJvd3Nlci54aHJMb2FkKFxuICAgICAgICAgICAgICAgICAgICB1cmwsXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uKGFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhc3NlcnQoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyYXlCdWZmZXIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0xvYWRpbmcgZGF0YSBmaWxlIFwiJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdcIiBmYWlsZWQgKG5vIGFycmF5QnVmZmVyKS4nXG4gICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgb25sb2FkKG5ldyBVaW50OEFycmF5KGFycmF5QnVmZmVyKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW5vUnVuRGVwKSByZW1vdmVSdW5EZXBlbmRlbmN5KCdhbCAnICsgdXJsKTtcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob25lcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uZXJyb3IoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgJ0xvYWRpbmcgZGF0YSBmaWxlIFwiJyArIHVybCArICdcIiBmYWlsZWQuJztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgaWYgKCFub1J1bkRlcCkgYWRkUnVuRGVwZW5kZW5jeSgnYWwgJyArIHVybCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcmVzaXplTGlzdGVuZXJzOiBbXSxcbiAgICAgICAgICAgIHVwZGF0ZVJlc2l6ZUxpc3RlbmVyczogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgdmFyIGNhbnZhcyA9IE1vZHVsZVsnY2FudmFzJ107XG4gICAgICAgICAgICAgICAgQnJvd3Nlci5yZXNpemVMaXN0ZW5lcnMuZm9yRWFjaChmdW5jdGlvbihsaXN0ZW5lcikge1xuICAgICAgICAgICAgICAgICAgICBsaXN0ZW5lcihjYW52YXMud2lkdGgsIGNhbnZhcy5oZWlnaHQpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNldENhbnZhc1NpemU6IGZ1bmN0aW9uKHdpZHRoLCBoZWlnaHQsIG5vVXBkYXRlcykge1xuICAgICAgICAgICAgICAgIHZhciBjYW52YXMgPSBNb2R1bGVbJ2NhbnZhcyddO1xuICAgICAgICAgICAgICAgIGNhbnZhcy53aWR0aCA9IHdpZHRoO1xuICAgICAgICAgICAgICAgIGNhbnZhcy5oZWlnaHQgPSBoZWlnaHQ7XG4gICAgICAgICAgICAgICAgaWYgKCFub1VwZGF0ZXMpIEJyb3dzZXIudXBkYXRlUmVzaXplTGlzdGVuZXJzKCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgd2luZG93ZWRXaWR0aDogMCxcbiAgICAgICAgICAgIHdpbmRvd2VkSGVpZ2h0OiAwLFxuICAgICAgICAgICAgc2V0RnVsbFNjcmVlbkNhbnZhc1NpemU6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHZhciBjYW52YXMgPSBNb2R1bGVbJ2NhbnZhcyddO1xuICAgICAgICAgICAgICAgIHRoaXMud2luZG93ZWRXaWR0aCA9IGNhbnZhcy53aWR0aDtcbiAgICAgICAgICAgICAgICB0aGlzLndpbmRvd2VkSGVpZ2h0ID0gY2FudmFzLmhlaWdodDtcbiAgICAgICAgICAgICAgICBjYW52YXMud2lkdGggPSBzY3JlZW4ud2lkdGg7XG4gICAgICAgICAgICAgICAgY2FudmFzLmhlaWdodCA9IHNjcmVlbi5oZWlnaHQ7XG4gICAgICAgICAgICAgICAgLy8gY2hlY2sgaWYgU0RMIGlzIGF2YWlsYWJsZVxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgU0RMICE9ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBmbGFncyA9XG4gICAgICAgICAgICAgICAgICAgICAgICBIRUFQVTMyWyhTREwuc2NyZWVuICsgUnVudGltZS5RVUFOVFVNX1NJWkUgKiAwKSA+PiAyXTtcbiAgICAgICAgICAgICAgICAgICAgZmxhZ3MgPSBmbGFncyB8IDB4MDA4MDAwMDA7IC8vIHNldCBTRExfRlVMTFNDUkVFTiBmbGFnXG4gICAgICAgICAgICAgICAgICAgIEhFQVAzMltcbiAgICAgICAgICAgICAgICAgICAgICAgIChTREwuc2NyZWVuICsgUnVudGltZS5RVUFOVFVNX1NJWkUgKiAwKSA+PiAyXG4gICAgICAgICAgICAgICAgICAgIF0gPSBmbGFncztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgQnJvd3Nlci51cGRhdGVSZXNpemVMaXN0ZW5lcnMoKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzZXRXaW5kb3dlZENhbnZhc1NpemU6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHZhciBjYW52YXMgPSBNb2R1bGVbJ2NhbnZhcyddO1xuICAgICAgICAgICAgICAgIGNhbnZhcy53aWR0aCA9IHRoaXMud2luZG93ZWRXaWR0aDtcbiAgICAgICAgICAgICAgICBjYW52YXMuaGVpZ2h0ID0gdGhpcy53aW5kb3dlZEhlaWdodDtcbiAgICAgICAgICAgICAgICAvLyBjaGVjayBpZiBTREwgaXMgYXZhaWxhYmxlXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBTREwgIT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZsYWdzID1cbiAgICAgICAgICAgICAgICAgICAgICAgIEhFQVBVMzJbKFNETC5zY3JlZW4gKyBSdW50aW1lLlFVQU5UVU1fU0laRSAqIDApID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICBmbGFncyA9IGZsYWdzICYgfjB4MDA4MDAwMDA7IC8vIGNsZWFyIFNETF9GVUxMU0NSRUVOIGZsYWdcbiAgICAgICAgICAgICAgICAgICAgSEVBUDMyW1xuICAgICAgICAgICAgICAgICAgICAgICAgKFNETC5zY3JlZW4gKyBSdW50aW1lLlFVQU5UVU1fU0laRSAqIDApID4+IDJcbiAgICAgICAgICAgICAgICAgICAgXSA9IGZsYWdzO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBCcm93c2VyLnVwZGF0ZVJlc2l6ZUxpc3RlbmVycygpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIEZTLnN0YXRpY0luaXQoKTtcbiAgICAgICAgX19BVElOSVRfXy51bnNoaWZ0KHtcbiAgICAgICAgICAgIGZ1bmM6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIGlmICghTW9kdWxlWydub0ZTSW5pdCddICYmICFGUy5pbml0LmluaXRpYWxpemVkKSBGUy5pbml0KCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBfX0FUTUFJTl9fLnB1c2goe1xuICAgICAgICAgICAgZnVuYzogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgRlMuaWdub3JlUGVybWlzc2lvbnMgPSBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIF9fQVRFWElUX18ucHVzaCh7XG4gICAgICAgICAgICBmdW5jOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBGUy5xdWl0KCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIE1vZHVsZVsnRlNfY3JlYXRlRm9sZGVyJ10gPSBGUy5jcmVhdGVGb2xkZXI7XG4gICAgICAgIE1vZHVsZS5jcmVhdGVQYXRoID0gRlMuY3JlYXRlUGF0aDtcbiAgICAgICAgTW9kdWxlLmNyZWF0ZURhdGFGaWxlID0gRlMuY3JlYXRlRGF0YUZpbGU7XG4gICAgICAgIE1vZHVsZS5sb2FkUGF0Y2hGcm9tVXJsID0gRlMubG9hZFBhdGNoRnJvbVVybDtcbiAgICAgICAgTW9kdWxlWydGU19jcmVhdGVQcmVsb2FkZWRGaWxlJ10gPSBGUy5jcmVhdGVQcmVsb2FkZWRGaWxlO1xuICAgICAgICBNb2R1bG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maXQgaW4gVE9UQUxfTUVNT1JZOyBhbGxvY2F0aW9ucyBmcm9tIGhlcmUgb24gbWF5IGVubGFyZ2UgVE9UQUxfTUVNT1JZXG4gICAgICAgIHZhciBNYXRoX21pbiA9IE1hdGgubWluO1xuXG4gICAgICAgIGZ1bmN0aW9uIGludm9rZV9paShpbmRleCwgYTEpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIE1vZHVsZVsnZHluQ2FsbF9paSddKGluZGV4LCBhMSk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBlICE9PSAnbnVtYmVyJyAmJiBlICE9PSAnbG9uZ2ptcCcpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgYXNtWydzZXRUaHJldyddKDEsIDApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gaW52b2tlX3ZpKGluZGV4LCBhMSkge1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBNb2R1bGVbJ2R5bkNhbGxfdmknXShpbmRleCwgYTEpO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZSAhPT0gJ251bWJlcicgJiYgZSAhPT0gJ2xvbmdqbXAnKSB0aHJvdyBlO1xuICAgICAgICAgICAgICAgIGFzbVsnc2V0VGhyZXcnXSgxLCAwKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGludm9rZV9paWlpaShpbmRleCwgYTEsIGEyLCBhMywgYTQpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIE1vZHVsZVsnZHluQ2FsbF9paWlpaSddKGluZGV4LCBhMSwgYTIsIGEzLCBhNCk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBlICE9PSAnbnVtYmVyJyAmJiBlICE9PSAnbG9uZ2ptcCcpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgYXNtWydzZXRUaHJldyddKDEsIDApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gaW52b2tlX3ZpaWkoaW5kZXgsIGExLCBhMiwgYTMpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgTW9kdWxlWydkeW5DYWxsX3ZpaWknXShpbmRleCwgYTEsIGEyLCBhMyk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBlICE9PSAnbnVtYmVyJyAmJiBlICE9PSAnbG9uZ2ptcCcpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgYXNtWydzZXRUaHJldyddKDEsIDApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gaW52b2tlX3YoaW5kZXgpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgTW9kdWxlWydkeW5DYWxsX3YnXShpbmRleCk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBlICE9PSAnbnVtYmVyJyAmJiBlICE9PSAnbG9uZ2ptcCcpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgYXNtWydzZXRUaHJldyddKDEsIDApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gaW52b2tlX2lpaShpbmRleCwgYTEsIGEyKSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHJldHVybiBNb2R1bGVbJ2R5bkNhbGxfaWlpJ10oaW5kZXgsIGExLCBhMik7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBlICE9PSAnbnVtYmVyJyAmJiBlICE9PSAnbG9uZ2ptcCcpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgYXNtWydzZXRUaHJldyddKDEsIDApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gYXNtUHJpbnRJbnQoeCwgeSkge1xuICAgICAgICAgICAgY29uc29sZS5sb2coJ2ludCAnICsgeCArICcsJyArIHkpOyAvLyArICcgJyArIG5ldyBFcnJvcigpLnN0YWNrKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGFzbVByaW50RmxvYXQoeCwgeSkge1xuICAgICAgICAgICAgY29uc29sZS5sb2coJ2Zsb2F0ICcgKyB4ICsgJywnICsgeSk7IC8vICsgJyAnICsgbmV3IEVycm9yKCkuc3RhY2spO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gRU1TQ1JJUFRFTl9TVEFSVF9BU01cblxuICAgICAgICB2YXIgYXNtID0gKGZ1bmN0aW9uKGdsb2JhbCwgZW52LCBidWZmZXIpIHtcbiAgICAgICAgICAgICd1c2UgYXNtJztcbiAgICAgICAgICAgIHZhciBhID0gbmV3IGdsb2JhbC5JbnQ4QXJyYXkoYnVmZmVyKTtcbiAgICAgICAgICAgIHZhciBiID0gbmV3IGdsb2JhbC5JbnQxNkFycmF5KGJ1ZmZlcik7XG4gICAgICAgICAgICB2YXIgYyA9IG5ldyBnbG9iYWwuSW50MzJBcnJheShidWZmZXIpO1xuICAgICAgICAgICAgdmFyIGQgPSBuZXcgZ2xvYmFsLlVpbnQ4QXJyYXkoYnVmZmVyKTtcbiAgICAgICAgICAgIHZhciBlID0gbmV3IGdsb2JhbC5VaW50MTZBcnJheShidWZmZXIpO1xuICAgICAgICAgICAgdmFyIGYgPSBuZXcgZ2xvYmFsLlVpbnQzMkFycmF5KGJ1ZmZlcik7XG4gICAgICAgICAgICB2YXIgZyA9IG5ldyBnbG9iYWwuRmxvYXQzMkFycmF5KGJ1ZmZlcik7XG4gICAgICAgICAgICB2YXIgaCA9IG5ldyBnbG9iYWwuRmxvYXQ2NEFycmF5KGJ1ZmZlcik7XG4gICAgICAgICAgICB2YXIgaSA9IGVudi5TVEFDS1RPUCB8IDA7XG4gICAgICAgICAgICB2YXIgaiA9IGVudi5TVEFDS19NQVggfCAwO1xuICAgICAgICAgICAgdmFyIGsgPSBlbnYudGVtcERvdWJsZVB0ciB8IDA7XG4gICAgICAgICAgICB2YXIgbCA9IGVudi5BQk9SVCB8IDA7XG4gICAgICAgICAgICB2YXIgbSA9IGVudi5fc3RkZXJyIHwgMDtcbiAgICAgICAgICAgIHZhciBuID0gK2Vudi5OYU47XG4gICAgICAgICAgICB2YXIgbyA9ICtlbnYuSW5maW5pdHk7XG4gICAgICAgICAgICB2YXIgcCA9IDA7XG4gICAgICAgICAgICB2YXIgcSA9IDA7XG4gICAgICAgICAgICB2YXIgciA9IDA7XG4gICAgICAgICAgICB2YXIgcyA9IDA7XG4gICAgICAgICAgICB2YXIgdCA9IDAsXG4gICAgICAgICAgICAgICAgdSA9IDAsXG4gICAgICAgICAgICAgICAgdiA9IDAsXG4gICAgICAgICAgICAgICAgdyA9IDAsXG4gICAgICAgICAgICAgICAgeCA9IDAuMCxcbiAgICAgICAgICAgICAgICB5ID0gMCxcbiAgICAgICAgICAgICAgICB6ID0gMCxcbiAgICAgICAgICAgICAgICBBID0gMCxcbiAgICAgICAgICAgICAgICBCID0gMC4wO1xuICAgICAgICAgICAgdmFyIEMgPSAwO1xuICAgICAgICAgICAgdmFyIEQgPSAwO1xuICAgICAgICAgICAgdmFyIEUgPSAwO1xuICAgICAgICAgICAgdmFyIEYgPSAwO1xuICAgICAgICAgICAgdmFyIEcgPSAwO1xuICAgICAgICAgICAgdmFyIEggPSAwO1xuICAgICAgICAgICAgdmFyIEkgPSAwO1xuICAgICAgICAgICAgdmFyIEogPSAwO1xuICAgICAgICAgICAgdmFyIEsgPSAwO1xuICAgICAgICAgICAgdmFyIEwgPSAwO1xuICAgICAgICAgICAgdmFyIE0gPSBnbG9iYWwuTWF0aC5mbG9vcjtcbiAgICAgICAgICAgIHZhciBOID0gZ2xvYmFsLk1hdGguYWJzO1xuICAgICAgICAgICAgdmFyIE8gPSBnbG9iYWwuTWF0aC5zcXJ0O1xuICAgICAgICAgICAgdmFyIFAgPSBnbG9iYWwuTWF0aC5wb3c7XG4gICAgICAgICAgICB2YXIgUSA9IGdsb2JhbC5NYXRoLmNvcztcbiAgICAgICAgICAgIHZhciBSID0gZ2xvYmFsLk1hdGguc2luO1xuICAgICAgICAgICAgdmFyIFMgPSBnbG9iYWwuTWF0aC50YW47XG4gICAgICAgICAgICB2YXIgVCA9IGdsb2JhbC5NYXRoLmFjb3M7XG4gICAgICAgICAgICB2YXIgVSA9IGdsb2JhbC5NYXRoLmFzaW47XG4gICAgICAgICAgICB2YXIgViA9IGdsb2JhbC5NYXRoLmF0YW47XG4gICAgICAgICAgICB2YXIgVyA9IGdsb2JhbC5NYXRoLmF0YW4yO1xuICAgICAgICAgICAgdmFyIFggPSBnbG9iYWwuTWF0aC5leHA7XG4gICAgICAgICAgICB2YXIgWSA9IGdsb2JhbC5NYXRoLmxvZztcbiAgICAgICAgICAgIHZhciBaID0gZ2xvYmFsLk1hdGguY2VpbDtcbiAgICAgICAgICAgIHZhciBfID0gZ2xvYmFsLk1hdGguaW11bDtcbiAgICAgICAgICAgIHZhciAkID0gZW52LmFib3J0O1xuICAgICAgICAgICAgdmFyIGFhID0gZW52LmFzc2VydDtcbiAgICAgICAgICAgIHZhciBhYiA9IGVudi5hc21QcmludEludDtcbiAgICAgICAgICAgIHZhciBhYyA9IGVudi5hc21QcmludEZsb2F0O1xuICAgICAgICAgICAgdmFyIGFkID0gZW52Lm1pbjtcbiAgICAgICAgICAgIHZhciBhZSA9IGVudi5pbnZva2VfaWk7XG4gICAgICAgICAgICB2YXIgYWYgPSBlbnYuaW52b2tlX3ZpO1xuICAgICAgICAgICAgdmFyIGFnID0gZW52Lmludm9rZV9paWlpaTtcbiAgICAgICAgICAgIHZhciBhaCA9IGVudi5pbnZva2VfdmlpaTtcbiAgICAgICAgICAgIHZhciBhaSA9IGVudi5pbnZva2VfdjtcbiAgICAgICAgICAgIHZhciBhaiA9IGVudi5pbnZva2VfaWlpO1xuICAgICAgICAgICAgdmFyIGFrID0gZW52Ll9zdHJuY21wO1xuICAgICAgICAgICAgdmFyIGFsID0gZW52Ll9sc2VlaztcbiAgICAgICAgICAgIHZhciBhbSA9IGVudi5fc3lzY29uZjtcbiAgICAgICAgICAgIHZhciBhbiA9IGVudi5fZnJlYWQ7XG4gICAgICAgICAgICB2YXIgYW8gPSBlbnYuX2ZjbG9zZTtcbiAgICAgICAgICAgIHZhciBhcCA9IGVudi5fc3RydG9rX3I7XG4gICAgICAgICAgICB2YXIgYXEgPSBlbnYuX2Fib3J0O1xuICAgICAgICAgICAgdmFyIGFyID0gZW52Ll9mcHJpbnRmO1xuICAgICAgICAgICAgdmFyIGFzID0gZW52Ll9jbG9zZTtcbiAgICAgICAgICAgIHZhciBhdCA9IGVudi5fcHJlYWQ7XG4gICAgICAgICAgICB2YXIgYXUgPSBlbnYuX2ZmbHVzaDtcbiAgICAgICAgICAgIHZhciBhdiA9IGVudi5fZm9wZW47XG4gICAgICAgICAgICB2YXIgYXcgPSBlbnYuX29wZW47XG4gICAgICAgICAgICB2YXIgYXggPSBlbnYuX3N0cnRvbDtcbiAgICAgICAgICAgIHZhciBheSA9IGVudi5fc3RydG9rO1xuICAgICAgICAgICAgdmFyIGF6ID0gZW52Ll9fX3NldEVyck5vO1xuICAgICAgICAgICAgdmFyIGFBID0gZW52Ll9fcmVhbGx5TmVnYXRpdmU7XG4gICAgICAgICAgICB2YXIgYUIgPSBlbnYuX2ZzZWVrO1xuICAgICAgICAgICAgdmFyIGFDID0gZW52Ll9zZW5kO1xuICAgICAgICAgICAgdmFyIGFEID0gZW52Ll93cml0ZTtcbiAgICAgICAgICAgIHZhciBhRSA9IGVudi5fc3RycmNocjtcbiAgICAgICAgICAgIHZhciBhRiA9IGVudi5fc2luO1xuICAgICAgICAgICAgdmFyIGFHID0gZW52Ll9wcmludGY7XG4gICAgICAgICAgICB2YXIgYUggPSBlbnYuX3N0cmNocjtcbiAgICAgICAgICAgIHZhciBhSSA9IGVudi5fcmVhZDtcbiAgICAgICAgICAgIHZhciBhSiA9IGVudi5fdGltZTtcbiAgICAgICAgICAgIHZhciBhSyA9IGVudi5fX2Zvcm1hdFN0cmluZztcbiAgICAgICAgICAgIHZhciBhTCA9IGVudi5fYXRvaTtcbiAgICAgICAgICAgIHZhciBhTSA9IGVudi5fcmVjdjtcbiAgICAgICAgICAgIHZhciBhTiA9IGVudi5fcHdyaXRlO1xuICAgICAgICAgICAgdmFyIGFPID0gZW52Ll9sbHZtX3Bvd19mNjQ7XG4gICAgICAgICAgICB2YXIgYVAgPSBlbnYuX2ZzeW5jO1xuICAgICAgICAgICAgdmFyIGFRID0gZW52Ll9fX2Vycm5vX2xvY2F0aW9uO1xuICAgICAgICAgICAgdmFyIGFSID0gZW52Ll9pc3NwYWNlO1xuICAgICAgICAgICAgdmFyIGFTID0gZW52Ll9zYnJrO1xuICAgICAgICAgICAgdmFyIGFUID0gZW52Ll9fcGFyc2VJbnQ7XG4gICAgICAgICAgICB2YXIgYVUgPSBlbnYuX2Z3cml0ZTtcbiAgICAgICAgICAgIHZhciBhViA9IGVudi5fc3RyY21wO1xuXG4gICAgICAgICAgICAvLyBFTVNDUklQVEVOX1NUQVJUX0ZVTkNTXG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGEwKGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGIgPSAwO1xuICAgICAgICAgICAgICAgIGIgPSBpO1xuICAgICAgICAgICAgICAgIGkgPSAoaSArIGEpIHwgMDtcbiAgICAgICAgICAgICAgICBpID0gKGkgKyA3KSAmIC04O1xuICAgICAgICAgICAgICAgIHJldHVybiBiIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGExKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBpIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGEyKGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgaSA9IGE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBhMyhhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKHAgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHAgPSBhO1xuICAgICAgICAgICAgICAgICAgICBxID0gYjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBhNChiKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGFba10gPSBhW2JdO1xuICAgICAgICAgICAgICAgIGFbKGsgKyAxKSB8IDBdID0gYVsoYiArIDEpIHwgMF07XG4gICAgICAgICAgICAgICAgYVsoayArIDIpIHwgMF0gPSBhWyhiICsgMikgfCAwXTtcbiAgICAgICAgICAgICAgICBhWyhrICsgMykgfCAwXSA9IGFbKGIgKyAzKSB8IDBdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYTUoYikge1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBhW2tdID0gYVtiXTtcbiAgICAgICAgICAgICAgICBhWyhrICsgMSkgfCAwXSA9IGFbKGIgKyAxKSB8IDBdO1xuICAgICAgICAgICAgICAgIGFbKGsgKyAyKSB8IDBdID0gYVsoYiArIDIpIHwgMF07XG4gICAgICAgICAgICAgICAgYVsoayArIDMpIHwgMF0gPSBhWyhiICsgMykgfCAwXTtcbiAgICAgICAgICAgICAgICBhWyhrICsgNCkgfCAwXSA9IGFbKGIgKyA0KSB8IDBdO1xuICAgICAgICAgICAgICAgIGFbKGsgKyA1KSB8IDBdID0gYVsoYiArIDUpIHwgMF07XG4gICAgICAgICAgICAgICAgYVsoayArIDYpIHwgMF0gPSBhWyhiICsgNikgfCAwXTtcbiAgICAgICAgICAgICAgICBhWyhrICsgNykgfCAwXSA9IGFbKGIgKyA3KSB8IDBdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYTYoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBDID0gYTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGE3KGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgRCA9IGE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBhOChhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIEUgPSBhO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYTkoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBGID0gYTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJhKGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgRyA9IGE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiYihhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIEggPSBhO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYmMoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBJID0gYTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJkKGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgSiA9IGE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiZShhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIEsgPSBhO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYmYoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBMID0gYTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJnKCkge31cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJoKGIpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGQgPSAwLFxuICAgICAgICAgICAgICAgICAgICBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGcgPSAwLFxuICAgICAgICAgICAgICAgICAgICBoID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwO1xuICAgICAgICAgICAgICAgIGQgPSBpO1xuICAgICAgICAgICAgICAgIGkgPSAoaSArIDEwMjQpIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGI7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFbZl0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBiID0gYXYoZiB8IDAsIDY1NzYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGcgPSBiO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggPSBnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSBoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBqIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFbZiB8IDBdIHwgMCkgIT0gNDcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9IGNbMTY2NF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSAxNjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbZSB8IDBdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBjMShjW2IgPj4gMl0gfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG4gPSBjW2IgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMyKG0gfCAwLCBuIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYVsoZSArIChsIC0gMSkpIHwgMF0gfCAwKSAhPSA0Nykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhWyhlICsgbCkgfCAwXSA9IDQ3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhWyhlICsgKGwgKyAxKSkgfCAwXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYzMoZSB8IDAsIGYgfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gYXYoZSB8IDAsIDY1NzYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPSBsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChsIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9IGNbKGIgKyA0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgPT0gMTYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggPSBnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gaDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBqIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGggPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaiA9IGg7XG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBqIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIGggPSAwO1xuICAgICAgICAgICAgICAgIGogPSBoO1xuICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgIHJldHVybiBqIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJpKGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGIgPSAwO1xuICAgICAgICAgICAgICAgIGIgPSBjJChhKSB8IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGIgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYmooYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgYiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGQgPSAwLFxuICAgICAgICAgICAgICAgICAgICBlID0gMDtcbiAgICAgICAgICAgICAgICBiID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYmkoOCkgfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoYSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjW2EgPj4gMl0gPSBiaSgoKGMxKGIgfCAwKSB8IDApICsgMSkgfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKChjW2EgPj4gMl0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGMwKGEpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZCA9IGNbYSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGUgPSBiO1xuICAgICAgICAgICAgICAgICAgICBjMihkIHwgMCwgZSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1soYSArIDQpID4+IDJdID0gY1sxNjY0XTtcbiAgICAgICAgICAgICAgICAgICAgY1sxNjY0XSA9IGE7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiaygpIHtcbiAgICAgICAgICAgICAgICB2YXIgYSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGIgPSAwO1xuICAgICAgICAgICAgICAgIGEgPSBjWzE2NjRdIHwgMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGEgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBiID0gY1soYSArIDQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYzAoY1thID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgIGMwKGEpO1xuICAgICAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1sxNjY0XSA9IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYmwoZiwgaCwgaiwgaywgbCwgbiwgbywgcCwgcSkge1xuICAgICAgICAgICAgICAgIGYgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICBoID0gaCB8IDA7XG4gICAgICAgICAgICAgICAgaiA9IGogfCAwO1xuICAgICAgICAgICAgICAgIGsgPSBrIHwgMDtcbiAgICAgICAgICAgICAgICBsID0gbCB8IDA7XG4gICAgICAgICAgICAgICAgbiA9IG4gfCAwO1xuICAgICAgICAgICAgICAgIG8gPSBvIHwgMDtcbiAgICAgICAgICAgICAgICBwID0gcCB8IDA7XG4gICAgICAgICAgICAgICAgcSA9IHEgfCAwO1xuICAgICAgICAgICAgICAgIHZhciByID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHQgPSAwLFxuICAgICAgICAgICAgICAgICAgICB1ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHcgPSAwLFxuICAgICAgICAgICAgICAgICAgICB4ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgeSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHogPSAwLFxuICAgICAgICAgICAgICAgICAgICBBID0gMCxcbiAgICAgICAgICAgICAgICAgICAgQiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEMgPSAwLFxuICAgICAgICAgICAgICAgICAgICBEID0gMCxcbiAgICAgICAgICAgICAgICAgICAgRSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBHID0gMCxcbiAgICAgICAgICAgICAgICAgICAgSCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEkgPSAwO1xuICAgICAgICAgICAgICAgIGogPSBpO1xuICAgICAgICAgICAgICAgIGkgPSAoaSArIDEwNTYpIHwgMDtcbiAgICAgICAgICAgICAgICByID0gaiB8IDA7XG4gICAgICAgICAgICAgICAgcyA9IChqICsgMTAyNCkgfCAwO1xuICAgICAgICAgICAgICAgIHQgPSAoaiArIDEwMzIpIHwgMDtcbiAgICAgICAgICAgICAgICB1ID0gKGogKyAxMDQwKSB8IDA7XG4gICAgICAgICAgICAgICAgdiA9IChqICsgMTA0OCkgfCAwO1xuICAgICAgICAgICAgICAgIHcgPSBmO1xuICAgICAgICAgICAgICAgIGYgPSBoO1xuICAgICAgICAgICAgICAgIGggPSBrO1xuICAgICAgICAgICAgICAgIGsgPSBsO1xuICAgICAgICAgICAgICAgIGwgPSBuO1xuICAgICAgICAgICAgICAgIG4gPSBvO1xuICAgICAgICAgICAgICAgIG8gPSBwO1xuICAgICAgICAgICAgICAgIHAgPSBxO1xuICAgICAgICAgICAgICAgIHEgPSAwO1xuICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgeCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHkgPSB4O1xuICAgICAgICAgICAgICAgICAgICBpID0gajtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHkgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB6ID0gYmgoZikgfCAwO1xuICAgICAgICAgICAgICAgIEEgPSB6O1xuICAgICAgICAgICAgICAgIGlmICgoeiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgeiA9IGNbbSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgeiB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICA2NTEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgKCh6ID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgMSkgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyA3KSAmIC04KSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjW3ogPj4gMl0gPSAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHopIHwgMFxuICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IHo7XG4gICAgICAgICAgICAgICAgICAgIHEgPSAxO1xuICAgICAgICAgICAgICAgICAgICBCID0gMDtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soMTA0OCArIChCIDw8IDIpKSA+PiAyXSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHogPSBjMShmIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoeiArIChjMShjWygxMDQ4ICsgKEIgPDwgMikpID4+IDJdIHwgMCkgfCAwKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAyNFxuICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IHIgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSBmO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMyKHogfCAwLCBDIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSByIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gY1soMTA0OCArIChCIDw8IDIpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYzMoQyB8IDAsIHogfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IGJoKHIgfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgQSA9IHo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh6IHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gNDY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIEIgPSAoQiArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKEQgfCAwKSA9PSA0Nikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gciB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKChxIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICB4ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgeSA9IHg7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBqO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4geSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKDIzOSA9PSAoYW4ociB8IDAsIDEsIDIzOSwgQSB8IDApIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYzQociB8IDAsIDYyNDgsIDIyKSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGM0KHIgfCAwLCA1ODg4LCAyMikgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFbKHIgKyA4MikgfCAwXSB8IDApICE9IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhWyhyICsgODIpIHwgMF0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeSA9IHg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhWyhyICsgMTUxKSB8IDBdIHwgMCkgIT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFbKHIgKyAxNTEpIHwgMF0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeSA9IHg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBxID0gYmkoOCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1txID4+IDJdID0gYVsociArIDE5OCkgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgNCkgPj4gMl0gPSBiaSgoKGNbcSA+PiAyXSB8IDApICogMTE2KSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIEIgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEIgfCAwKSA+PSAoY1txID4+IDJdIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDE2MjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFCKEEgfCAwLCA3LCAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDEgIT0gKGFuKHMgfCAwLCAxLCAxLCBBIHwgMCkgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gNjY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmID0gKChjWyhxICsgNCkgPj4gMl0gfCAwKSArICgoQiAqIDExNikgfCAwKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgxICE9IChhbih0IHwgMCwgNCwgMSwgQSB8IDApIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDczO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDgpID4+IDJdID0gY1t0ID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgxICE9IChhbih0IHwgMCwgNCwgMSwgQSB8IDApIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDc1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tmID4+IDJdID0gY1t0ID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgxICE9IChhbih0IHwgMCwgNCwgMSwgQSB8IDApIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDc3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDQpID4+IDJdID0gY1t0ID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgxICE9IChhbih1IHwgMCwgMiwgMSwgQSB8IDApIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDc5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDEyKSA+PiAyXSA9IGVbdSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDEgIT0gKGFuKHQgfCAwLCA0LCAxLCBBIHwgMCkgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgMjQpID4+IDJdID0gY1t0ID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgxICE9IChhbih0IHwgMCwgNCwgMSwgQSB8IDApIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDgzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDI4KSA+PiAyXSA9IGNbdCA+PiAyXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMSAhPSAoYW4odCB8IDAsIDQsIDEsIEEgfCAwKSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEQgPSA4NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGYgKyAzMikgPj4gMl0gPSBjW3QgPj4gMl07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDE2KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDIwKSA+PiAyXSA9IDEyNztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhQihBIHwgMCwgMiwgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgxICE9IChhbih2IHwgMCwgMSwgMSwgQSB8IDApIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDg3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYVtyIHwgMF0gPSBhW3ZdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGggfCAwKSA9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhWyhmICsgMTExKSB8IDBdID0gKChhW3IgfCAwXSA8PCAzKSArIDQpICYgMTI3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbKGYgKyAxMTEpIHwgMF0gPSBoICYgMTI3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMTggIT0gKGFuKHIgfCAwLCAxLCAxOCwgQSB8IDApIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDkyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFbKHIgKyAxMykgfCAwXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYVsociArIDE0KSB8IDBdIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEQgPSA5NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGYgKyA5MikgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJtKHcsIGFbKHIgKyAxMikgfCAwXSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGYgKyA5NikgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJuKHcsIGFbKHIgKyAxMykgfCAwXSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbKGYgKyAxMDgpIHwgMF0gPSBhWyhyICsgMTQpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDk1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChEIHwgMCkgPT0gOTUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbKGYgKyAxMDgpIHwgMF0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgOTYpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDkyKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhWyhyICsgMTYpIHwgMF0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFbKHIgKyAxNykgfCAwXSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gOTk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgMTA0KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm8odywgYVsociArIDE2KSB8IDBdIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDEwMCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJwKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhWyhyICsgMTUpIHwgMF0gfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgMTA0KSA+PiAyXSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbKGYgKyAxMDkpIHwgMF0gPSBhWyhyICsgMTcpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDk5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChEIHwgMCkgPT0gOTkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbKGYgKyAxMDkpIHwgMF0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgMTA0KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGYgKyAxMDApID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDEgIT0gKGFuKHYgfCAwLCAxLCAxLCBBIHwgMCkgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gMTAyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYVsoZiArIDExMCkgfCAwXSA9IGFbdl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFCKEEgfCAwLCA0MCwgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobCB8IDApICE9IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbKGYgKyAxMTIpIHwgMF0gPSBsICYgMjU1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbKGYgKyAxMTIpIHwgMF0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChhWyhmICsgMTEwKSB8IDBdICYgNCkgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHogPSAoZiArIDExMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhW3pdID0gKGRbel0gfCAzMikgJiAyNTU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChuIHwgMCkgPT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoYVsoZiArIDExMCkgfCAwXSAmIDYwKSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHogPSAoZiArIDExMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVt6XSA9IGRbel0gJiAtNjEgJiAyNTU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG8gfCAwKSA9PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoYVsoZiArIDExMCkgfCAwXSAmIDY0KSB8IDApICE9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHogPSAoZiArIDExMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhW3pdID0gZFt6XSAmIC02NSAmIDI1NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG8gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChhWyhmICsgMTEwKSB8IDBdICYgMjgpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjNChyIHwgMCwgNTUxMiwgNikgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFbKHIgKyAxMSkgfCAwXSB8IDApID49XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gMTIwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoYVsoZiArIDExMCkgfCAwXSAmIDMyKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IChmICsgMTEwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVt6XSA9IGRbel0gJiAtNjUgJiAyNTU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gMTIwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChEIHwgMCkgPT0gMTIwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEQgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gKGYgKyAxMTApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVt6XSA9IGRbel0gJiAtNjUgJiAyNTU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gKGYgKyAxMTApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhW3pdID0gZFt6XSAmIC05NyAmIDI1NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEUgfCAwKSA+PSA2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgMzYgKyAoRSA8PCAyKSkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnEodywgYVsociArIEUpIHwgMF0gfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGYgKyA2MCArIChFIDw8IDIpKSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicihhWyhyICsgKEUgKyA2KSkgfCAwXSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRSA9IChFICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgODgpID4+IDJdID0gYmkoY1soZiArIDgpID4+IDJdIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYW4oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgODgpID4+IDJdIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGYgKyA4KSA+PiAyXSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gMTMyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoYVsoZiArIDExMCkgfCAwXSAmIDEpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gY1soZiArIDgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQyA9IGNbKGYgKyA4OCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGID0gYmkoY1soZiArIDgpID4+IDJdIDw8IDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRyA9IEY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEggPSBGO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRiA9IHo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gKEYgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGID0gQztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSAoRiArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEkgPSBIO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSCA9IChJICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYltJID4+IDFdID0gKChhW0ZdICYgMjU1KSA8PCA4KSAmIDY1NTM1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSBjWyhmICsgODgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDg4KSA+PiAyXSA9IEc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMwKEMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIID0gKGYgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbSCA+PiAyXSA9IGNbSCA+PiAyXSA8PCAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIID0gZiB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbSCA+PiAyXSA9IGNbSCA+PiAyXSA8PCAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIID0gKGYgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbSCA+PiAyXSA9IGNbSCA+PiAyXSA8PCAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChhWyhmICsgMTEwKSB8IDBdICYgMikgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEggPSAoKGNbKGYgKyA4KSA+PiAyXSB8IDApIC8gMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gY1soZiArIDg4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGID0gSDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEggPSAoRiAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoRiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEYgPSB6O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IChGICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYltGID4+IDFdID0gKGJbRiA+PiAxXSBeIDMyNzY4KSAmIDY1NTM1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKGFbKGYgKyAxMTApIHwgMF0gJiAxNikgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJzKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDg4KSA+PiAyXSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhmICsgOCkgPj4gMl0gfCAwKSAvIDIpIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gY1tmID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tmID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWyhmICsgOCkgPj4gMl0gfCAwKSAtXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1soZiArIDQpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGYgKyA0KSA+PiAyXSA9IChjWyhmICsgOCkgPj4gMl0gfCAwKSAtIHo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHogPSAoZiArIDExMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhW3pdID0gZFt6XSAmIC0xNyAmIDI1NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IChmICsgMTEwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbel0gPSAoZFt6XSB8IDQpICYgMjU1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGsgfCAwKSAhPSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnWyhmICsgODQpID4+IDJdID0gKyhrIHwgMCkgLyAxMDAuMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gKChjWyhmICsgOCkgPj4gMl0gfCAwKSAvIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSCA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSBjWyhmICsgODgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEcgPSB6O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IChHIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChHIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRyA9IEM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDID0gKEcgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGID0gYltHID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKChGIDw8IDE2KSA+PiAxNikgfCAwKSA8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGID0gLSgoRiA8PCAxNikgPj4gMTYpICYgNjU1MzU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoRiA8PCAxNikgPj4gMTYpIHwgMCkgPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKEggPDwgMTYpID4+IDE2KSB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIID0gRjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnWyhmICsgODQpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMyNzY4LjAgLyArKCgoSCA8PCAxNikgPj4gMTYpIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSAoZiArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW0MgPj4gMl0gPSAoKGNbQyA+PiAyXSB8IDApIC8gMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW0MgPj4gMl0gPSAoKGNbQyA+PiAyXSB8IDApIC8gMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSAoZiArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW0MgPj4gMl0gPSAoKGNbQyA+PiAyXSB8IDApIC8gMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSAoZiArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW0MgPj4gMl0gPSBjW0MgPj4gMl0gPDwgMTI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgQyA9IGYgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbQyA+PiAyXSA9IGNbQyA+PiAyXSA8PCAxMjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDID0gKGYgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tDID4+IDJdID0gY1tDID4+IDJdIDw8IDEyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW0MgPj4gMl0gPSBjW0MgPj4gMl0gfCAoKGFbc10gJiAxNSkgPDwgOCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgQyA9IChmICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbQyA+PiAyXSA9IGNbQyA+PiAyXSB8ICgoKGRbc10gPj4gNCkgJiAxNSkgPDwgOCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFbKGYgKyAxMTIpIHwgMF0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChhWyhmICsgMTEwKSB8IDBdICYgNCkgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjRih3LCBmKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgocCB8IDApID09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDgpID4+IDJdID0gY1soZiArIDQpID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCID0gKEIgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEQgfCAwKSAhPSA2NilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEQgfCAwKSAhPSA3MylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChEIHwgMCkgIT0gNzUpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEQgfCAwKSAhPSA3NylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEQgfCAwKSAhPSA3OSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChEIHwgMCkgIT0gODEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEQgfCAwKSAhPSA4MylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEQgfCAwKSAhPSA4NSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChEIHwgMCkgIT0gODcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEQgfCAwKSAhPSA5MilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChEIHwgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoRCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEzMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEQgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2MlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW8oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEEgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggPSBxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHkgPSB4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIEUgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEUgfCAwKSA+PSAoQiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjMChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1socSArIDQpID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoRSAqIDExNikgfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgODgpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRSA9IChFICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYzAoY1socSArIDQpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjMChxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHggPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgeSA9IHg7XG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB5IHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIHggPSAwO1xuICAgICAgICAgICAgICAgIHkgPSB4O1xuICAgICAgICAgICAgICAgIGkgPSBqO1xuICAgICAgICAgICAgICAgIHJldHVybiB5IHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJtKGEsIGIpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBkID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGYgPSAwO1xuICAgICAgICAgICAgICAgIGQgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBiO1xuICAgICAgICAgICAgICAgIGlmICgoYSA8PCAyNCkgPj4gMjQgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBiID0gKCgoY1soZCArIDEzMDYwKSA+PiAyXSB8IDApICogMzgpIHwgMCkgPDwgMTY7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoKGIgfCAwKSAvIChfKGNbKGQgKyA0KSA+PiAyXSB8IDAsIGEgJiAyNTUpIHwgMCkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBlID0gMDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBibihhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZCA9IDA7XG4gICAgICAgICAgICAgICAgZCA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IChfKGNbKGQgKyAxMzA2MCkgPj4gMl0gPDwgMTAsIGIgJiAyNTUpIHwgMCkgPDwgNTtcbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAoKGEgfCAwKSAvICgoKGNbKGQgKyA0KSA+PiAyXSB8IDApICogMzgpIHwgMCB8IDApKSB8IDAgfCAwXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJvKGEsIGIpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICgoKChjWyhhICsgNCkgPj4gMl0gfCAwKSAqIDM4KSB8IDAgfCAwKSAvXG4gICAgICAgICAgICAgICAgICAgICAgICAoKCgoYiAmIDI1NSkgPDwgMSkgPDwgNSkgfCAwKSkgfFxuICAgICAgICAgICAgICAgICAgICAwIHxcbiAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBicChhLCBiLCBkKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgZSA9IGI7XG4gICAgICAgICAgICAgICAgaWYgKChlIDw8IDI0KSA+PiAyNCAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPSB+fihcbiAgICAgICAgICAgICAgICAgICAgICAgICgrKGQgfCAwKSAqIDM4LjAgKiA2NTUzNi4wKSAvXG4gICAgICAgICAgICAgICAgICAgICAgICArKF8oY1soYSArIDQpID4+IDJdIHwgMCwgZSAmIDI1NSkgfCAwKVxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICBnID0gZjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGcgfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPSAwO1xuICAgICAgICAgICAgICAgICAgICBnID0gZjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGcgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJxKGEsIGIpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBkID0gMDtcbiAgICAgICAgICAgICAgICBkID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICBiID0gKDMgLSAoKChhICYgMjU1KSA+PiA2KSAmIDMpKSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IChiICogMykgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSAoYSAmIDYzKSA8PCBiO1xuICAgICAgICAgICAgICAgIGIgPVxuICAgICAgICAgICAgICAgICAgICBfKFxuICAgICAgICAgICAgICAgICAgICAgICAgKCgoYiAqIDQ0MTAwKSB8IDAgfCAwKSAvIChjWyhkICsgNCkgPj4gMl0gfCAwKSkgfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgY1soZCArIDEzMDYwKSA+PiAyXSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuIChiIDw8IDEwKSB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBicihhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIHJldHVybiAoKGEgJiAyNTUpIDw8IDIyKSB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBicyhhLCBjLCBkKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGMgPSBjIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMDtcbiAgICAgICAgICAgICAgICBlID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYztcbiAgICAgICAgICAgICAgICBjID0gZDtcbiAgICAgICAgICAgICAgICBkID0gKGUgKyAoYyA8PCAxKSkgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSAoZSArIChhIDw8IDEpKSB8IDA7XG4gICAgICAgICAgICAgICAgYyA9IChjIC0gYSkgfCAwO1xuICAgICAgICAgICAgICAgIGMgPSAoKGMgfCAwKSAvIDIpIHwgMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBhID0gYztcbiAgICAgICAgICAgICAgICAgICAgYyA9IChhIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGEgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBhID0gYltlID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoZiArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYltmID4+IDFdID0gYltkID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIGQgPSAoZiAtIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYltmID4+IDFdID0gYTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYnQoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICByZXR1cm4gY1soYSArIDEzMTM2KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJ1KGEsIGIpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBkID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGYgPSAwO1xuICAgICAgICAgICAgICAgIGQgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBiO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChhIHwgMCkgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3RvcHMgd2hlbiByZWFjaGVkIGxhc3QgaW5zdHJ1bWVudFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhIHwgMCkgPj0gKGNbKGQgKyAxMzEzNikgPj4gMl0gfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gcGF0aCB0byBwYXRjaCBmaWxlXG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gY1soZCArIDEzMTQwICsgKGEgPDwgMikpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGYgPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGYgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgZSA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGYgfCAwO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBidihhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBiID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwO1xuICAgICAgICAgICAgICAgIGIgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSAxMjg7XG4gICAgICAgICAgICAgICAgZCA9IDA7XG4gICAgICAgICAgICAgICAgY1soYiArIDEzMTM2KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgZSA9IGE7XG4gICAgICAgICAgICAgICAgICAgIGEgPSAoZSAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChlIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhiICsgMjggKyAoYSA8PCAyKSkgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gKGQgKyAoYncoYiwgMCwgYSkgfCAwKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soYiArIDU0MCArIChhIDw8IDIpKSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZCArIChidyhiLCAxLCBhKSB8IDApKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGQgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYncoYSwgYiwgZCkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGcgPSAwLFxuICAgICAgICAgICAgICAgICAgICBoID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG8gPSAwLFxuICAgICAgICAgICAgICAgICAgICBwID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBzID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHUgPSAwLFxuICAgICAgICAgICAgICAgICAgICB2ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdyA9IDA7XG4gICAgICAgICAgICAgICAgZSA9IGk7XG4gICAgICAgICAgICAgICAgZiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGI7XG4gICAgICAgICAgICAgICAgYiA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IDA7XG4gICAgICAgICAgICAgICAgaWYgKChhIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBnID0gY1soZiArIDU0MCArIChiIDw8IDIpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZyA9IGNbKGYgKyAyOCArIChiIDw8IDIpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGggPSBnO1xuICAgICAgICAgICAgICAgIGlmICgoaCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgaiA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGsgPSBqO1xuICAgICAgICAgICAgICAgICAgICBpID0gZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGsgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBnID0gMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSA+PSAxMjgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soaCArIDQgKyAoZyA8PCAyKSkgPj4gMl0gfCAwKSA9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGggKyA0ICsgKGcgPDwgMikpID4+IDJdID0gYkIoZiwgYSwgYiwgZykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soaCArIDQgKyAoZyA8PCAyKSkgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWygoY1toID4+IDJdIHwgMCkgKyAoKGcgKiAyOCkgfCAwKSkgPj4gMl0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gZjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWygoY1toID4+IDJdIHwgMCkgKyAoKGcgKiAyOCkgfCAwKSkgPj4gMl0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IChhIHwgMCkgIT0gMCA/IDEgOiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW2ggPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZyAqIDI4KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW2ggPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZyAqIDI4KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1toID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGcgKiAyOCkgfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1toID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChnICogMjgpIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IC0xO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IHM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW2ggPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZyAqIDI4KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1toID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChnICogMjgpIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gKGEgfCAwKSAhPSAwID8gMSA6IC0xO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1toID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGcgKiAyOCkgfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIwKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbaCA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZyAqIDI4KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIwKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IChhIHwgMCkgIT0gMCA/IDEgOiAtMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbaCA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZyAqIDI4KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soaCArIDQgKyAoZyA8PCAyKSkgPj4gMl0gPSB2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gY1ttID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1toID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChnICogMjgpIHwgMCkpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2IHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1MTIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgodiA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyA4KSB8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW3YgPj4gMl0gPSBxKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2KSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IHY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKGYgKyAxMzEzNikgPj4gMl0gfCAwKSA8IDI1Nikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBjW20gPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBjWyhmICsgMTMxMzYpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ4NTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgodiA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgOCkgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbdiA+PiAyXSA9IHApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2KSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gdjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMzE0MCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1soZiArIDEzMTM2KSA+PiAyXSA8PCAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1toID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZyAqIDI4KSB8IDApKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gKGYgKyAxMzEzNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbdiA+PiAyXSA9IChjW3YgPj4gMl0gfCAwKSArIDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gKGQgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGEgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZiArIDU0MCkgPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGcgPDwgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZiArIDU0MCkgPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGcgPDwgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhmICsgMjgpID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChnIDw8IDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGYgKyAyOCkgPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGcgPDwgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGggKyA0ICsgKGcgPDwgMikpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChkICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gMjQ2O1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gMjQ2O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCh3IHwgMCkgPT0gMjQ2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBnID0gKGcgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGogPSBkO1xuICAgICAgICAgICAgICAgIGsgPSBqO1xuICAgICAgICAgICAgICAgIGkgPSBlO1xuICAgICAgICAgICAgICAgIHJldHVybiBrIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJ4KGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBkID0gMDtcbiAgICAgICAgICAgICAgICBiID0gYTtcbiAgICAgICAgICAgICAgICBhID0gMTI4O1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGQgPSBhO1xuICAgICAgICAgICAgICAgICAgICBhID0gKGQgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soYiArIDI4ICsgKGEgPDwgMikpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnkoYiwgMCwgYSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhiICsgNTQwICsgKGEgPDwgMikpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnkoYiwgMSwgYSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYnkoYSwgYiwgZCkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDA7XG4gICAgICAgICAgICAgICAgZSA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGQ7XG4gICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBmID0gY1soZSArIDU0MCArIChhIDw8IDIpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGNbKGUgKyAyOCArIChhIDw8IDIpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGEgPSBmO1xuICAgICAgICAgICAgICAgIGYgPSAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID49IDEyOCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhhICsgNCArIChmIDw8IDIpKSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soYSArIDQgKyAoZiA8PCAyKSkgPj4gMl0gfCAwKSAhPSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJBKGNbKGEgKyA0ICsgKGYgPDwgMikpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhhICsgNCArIChmIDw8IDIpKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZiA9IChmICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBieihhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMDtcbiAgICAgICAgICAgICAgICBkID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYmwoZCwgYiwgMCwgLTEsIC0xLCAtMSwgMCwgMCwgMCkgfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoYSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgY1soZCArIDEwNTIpID4+IDJdID0gYTtcbiAgICAgICAgICAgICAgICAgICAgY1soZCArIDEwNTYpID4+IDJdID0gLTE7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAwO1xuICAgICAgICAgICAgICAgICAgICBmID0gZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGYgfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAtMTtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiQShhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBiID0gMDtcbiAgICAgICAgICAgICAgICBiID0gYTtcbiAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYSA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChhIHwgMCkgPj0gKGNbYiA+PiAyXSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjMChcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKChjWyhiICsgNCkgPj4gMl0gfCAwKSArICgoYSAqIDExNikgfCAwKSArIDg4KSA+PiAyXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICBhID0gKGEgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGMwKGNbKGIgKyA0KSA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgIGMwKGIpO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJCKGEsIGIsIGQsIGUpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGkgPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMDtcbiAgICAgICAgICAgICAgICBmID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICBiID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZTtcbiAgICAgICAgICAgICAgICBpZiAoKGNbKGYgKyAyNCkgPj4gMl0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGcgPSAwO1xuICAgICAgICAgICAgICAgICAgICBoID0gZztcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGggfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBhID0gKGEgfCAwKSAhPSAwID8gLTIxNDc0ODM2NDggOiAwO1xuICAgICAgICAgICAgICAgIGUgPSAwO1xuICAgICAgICAgICAgICAgIEwzNjg6IHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPj4+IDAgPj1cbiAgICAgICAgICAgICAgICAgICAgICAgIChjWygoY1soZiArIDI0KSA+PiAyXSB8IDApICsgNCkgPj4gMl0gfCAwKSA+Pj4gMFxuICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGkgPVxuICAgICAgICAgICAgICAgICAgICAgICAgKChjWygoY1soZiArIDI0KSA+PiAyXSB8IDApICsgOCkgPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChlICogMjApIHwgMCkpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKChjWyhpICsgNCkgPj4gMl0gfCAwKSArIDQpID4+IDJdICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTIxNDc0ODM2NDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYSB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKChjWygoY1soaSArIDQpID4+IDJdIHwgMCkgKyA0KSA+PiAyXSB8IDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCkgJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjU1KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYiB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWygoY1soaSArIDQpID4+IDJdIHwgMCkgKyA4KSA+PiAyXSB8IDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IDI5NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDM2ODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGUgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChlIHwgMCkgPT0gKGNbKChjWyhmICsgMjQpID4+IDJdIHwgMCkgKyA0KSA+PiAyXSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlID4+PiAwID49XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWygoY1soZiArIDI0KSA+PiAyXSB8IDApICsgNCkgPj4gMl0gfCAwKSA+Pj4gMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soKGNbKGYgKyAyNCkgPj4gMl0gfCAwKSArIDgpID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChlICogMjApIHwgMCkpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soKGNbKGkgKyA0KSA+PiAyXSB8IDApICsgNCkgPj4gMl0gJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTIxNDc0ODM2NDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbKChjWyhpICsgNCkgPj4gMl0gfCAwKSArIDgpID4+IDJdIHwgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gMzA0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA9IChlICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgaWYgKChlIHwgMCkgPT0gKGNbKChjWyhmICsgMjQpID4+IDJdIHwgMCkgKyA0KSA+PiAyXSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgIGcgPSAwO1xuICAgICAgICAgICAgICAgICAgICBoID0gZztcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGggfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBqID0gYmkoOCkgfCAwO1xuICAgICAgICAgICAgICAgIGNbaiA+PiAyXSA9IGNbY1soaSArIDQpID4+IDJdID4+IDJdO1xuICAgICAgICAgICAgICAgIGNbKGogKyA0KSA+PiAyXSA9IGJpKCgoY1tqID4+IDJdIHwgMCkgKiAxMTYpIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgIGM1KGNbKGogKyA0KSA+PiAyXSB8IDAsIDAsICgoY1tqID4+IDJdIHwgMCkgKiAxMTYpIHwgMCB8IDApO1xuICAgICAgICAgICAgICAgIGUgPSAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChlID4+PiAwID49IChjW2NbKGkgKyA0KSA+PiAyXSA+PiAyXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBiQyhmLCAoKGNbKGogKyA0KSA+PiAyXSB8IDApICsgKChlICogMTE2KSB8IDApKSB8IDAsIGksIGUpO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGUgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGcgPSBqO1xuICAgICAgICAgICAgICAgIGggPSBnO1xuICAgICAgICAgICAgICAgIHJldHVybiBoIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJDKGIsIGYsIGgsIGkpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGYgfCAwO1xuICAgICAgICAgICAgICAgIGggPSBoIHwgMDtcbiAgICAgICAgICAgICAgICBpID0gaSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBrID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG0gPSAwLFxuICAgICAgICAgICAgICAgICAgICBuID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHAgPSAwLFxuICAgICAgICAgICAgICAgICAgICBxID0gMCxcbiAgICAgICAgICAgICAgICAgICAgciA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHMgPSAwLFxuICAgICAgICAgICAgICAgICAgICB0ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHYgPSAwLFxuICAgICAgICAgICAgICAgICAgICB3ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgeCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHkgPSAwLFxuICAgICAgICAgICAgICAgICAgICB6ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgQSA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgQiA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgQyA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgRCA9IDAuMDtcbiAgICAgICAgICAgICAgICBqID0gYjtcbiAgICAgICAgICAgICAgICBiID0gZjtcbiAgICAgICAgICAgICAgICBmID0gaDtcbiAgICAgICAgICAgICAgICBoID0gKChjWyhmICsgOCkgPj4gMl0gfCAwKSArICgoaSAqIDI0KSB8IDApKSB8IDA7XG4gICAgICAgICAgICAgICAgaSA9XG4gICAgICAgICAgICAgICAgICAgICgoY1soKGNbKGogKyAyNCkgPj4gMl0gfCAwKSArIDIwKSA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICgoKGNbKChjWyhoICsgNCkgPj4gMl0gfCAwKSArIDgpID4+IDJdIHwgMCkgKiAyMCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApKSB8XG4gICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgayA9ICgxMDU2ICsgKChlW2NbaCA+PiAyXSA+PiAxXSB8IDApIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgY1soYiArIDI0KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgIGRba10gfFxuICAgICAgICAgICAgICAgICAgICAoZFsoayArIDEpIHwgMF0gPDwgOCkgfFxuICAgICAgICAgICAgICAgICAgICAoZFsoayArIDIpIHwgMF0gPDwgMTYpIHxcbiAgICAgICAgICAgICAgICAgICAgKGRbKGsgKyAzKSB8IDBdIDw8IDI0KTtcbiAgICAgICAgICAgICAgICBrID0gKDEwNTYgKyAoKGVbKChjW2ggPj4gMl0gfCAwKSArIDIpID4+IDFdIHwgMCkgPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICBjWyhiICsgMjgpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgZFtrXSB8XG4gICAgICAgICAgICAgICAgICAgIChkWyhrICsgMSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgIChkWyhrICsgMikgfCAwXSA8PCAxNikgfFxuICAgICAgICAgICAgICAgICAgICAoZFsoayArIDMpIHwgMF0gPDwgMjQpO1xuICAgICAgICAgICAgICAgIGsgPVxuICAgICAgICAgICAgICAgICAgICAoMTA1NiArICgoZVsoKGNbKGggKyA4KSA+PiAyXSB8IDApICsgNCkgPj4gMV0gfCAwKSA8PCAyKSkgfFxuICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgIGNbKGIgKyAzMikgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICBkW2tdIHxcbiAgICAgICAgICAgICAgICAgICAgKGRbKGsgKyAxKSB8IDBdIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgKGRbKGsgKyAyKSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgIChkWyhrICsgMykgfCAwXSA8PCAyNCk7XG4gICAgICAgICAgICAgICAgY1soYiArIDE2KSA+PiAyXSA9IGVbKChjW2ggPj4gMl0gfCAwKSArIDQpID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICBjWyhiICsgMjApID4+IDJdID0gZVsoKGNbaCA+PiAyXSB8IDApICsgNikgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgIGFbKGIgKyAxMTApIHwgMF0gPSAxO1xuICAgICAgICAgICAgICAgIGNbKGIgKyAxMikgPj4gMl0gPSBjWygoY1tpID4+IDJdIHwgMCkgKyA0KSA+PiAyXTtcbiAgICAgICAgICAgICAgICBjWyhiICsgOCkgPj4gMl0gPSAoKChjWyhpICsgOCkgPj4gMl0gfCAwKSA+Pj4gMCkgLyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgY1soYiArIDg4KSA+PiAyXSA9IGJpKGNbKGkgKyA4KSA+PiAyXSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICBrID0gY1soYiArIDg4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgbCA9IGNbKGkgKyA0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgbSA9IGNbKGkgKyA4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgYzYoayB8IDAsIGwgfCAwLCBtKSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKChjWygoY1soaCArIDgpID4+IDJdIHwgMCkgKyAxNikgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIG0gPSAoYiArIDExMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBhW21dID0gKGRbbV0gfCAwIHwgMzYpICYgMjU1O1xuICAgICAgICAgICAgICAgICAgICBjW2IgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgKCgoY1soKGNbKGggKyAxMikgPj4gMl0gfCAwKSArIDgpID4+IDJdIHwgMCkgPj4+IDApIC9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICBjWyhiICsgNCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbYiA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICgoKChjWygoY1soaCArIDEyKSA+PiAyXSB8IDApICsgMTIpID4+IDJdIHwgMCkgPj4+IDApIC9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGdbKGIgKyA4NCkgPj4gMl0gPSAxLjA7XG4gICAgICAgICAgICAgICAgaWYgKCgoYVsoYiArIDExMCkgfCAwXSAmIDMyKSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgbiA9IGI7XG4gICAgICAgICAgICAgICAgICAgIG8gPSAobiArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgcCA9IGNbbyA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHEgPSBwIDw8IDEyO1xuICAgICAgICAgICAgICAgICAgICBjW28gPj4gMl0gPSBxO1xuICAgICAgICAgICAgICAgICAgICByID0gYjtcbiAgICAgICAgICAgICAgICAgICAgcyA9IHIgfCAwO1xuICAgICAgICAgICAgICAgICAgICB0ID0gY1tzID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgdSA9IHQgPDwgMTI7XG4gICAgICAgICAgICAgICAgICAgIGNbcyA+PiAyXSA9IHU7XG4gICAgICAgICAgICAgICAgICAgIHYgPSBiO1xuICAgICAgICAgICAgICAgICAgICB3ID0gKHYgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHggPSBjW3cgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICB5ID0geCA8PCAxMjtcbiAgICAgICAgICAgICAgICAgICAgY1t3ID4+IDJdID0geTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBtID0gMDtcbiAgICAgICAgICAgICAgICBsID0gMDtcbiAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soZiArIDEyKSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1soKGNbKGYgKyAxMikgPj4gMl0gfCAwKSArIDQpID4+IDJdIHwgMCkgPj4+IDAgPD1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gMzI2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhmICsgMTYpID4+IDJdIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHogPSAzMjY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBtID0gY1soZiArIDEyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gY1soZiArIDE2KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB6ID0gMzI2O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgaWYgKCh6IHwgMCkgPT0gMzI2KSB7XG4gICAgICAgICAgICAgICAgICAgIG0gPSBjWyhoICsgMTYpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgbCA9IGNbKGggKyAyMCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBoID0gYkQoY1sobSArIDQpID4+IDJdIHwgMCwgbCwgNTE4KSB8IDA7XG4gICAgICAgICAgICAgICAgQSA9ICtiRShoKTtcbiAgICAgICAgICAgICAgICBoID0gYkQoY1sobSArIDQpID4+IDJdIHwgMCwgbCwgNTI0KSB8IDA7XG4gICAgICAgICAgICAgICAgQiA9ICtiRShoKTtcbiAgICAgICAgICAgICAgICBoID0gYkQoY1sobSArIDQpID4+IDJdIHwgMCwgbCwgNTE5KSB8IDA7XG4gICAgICAgICAgICAgICAgQyA9ICtiRShoKTtcbiAgICAgICAgICAgICAgICBoID0gYkQoY1sobSArIDQpID4+IDJdIHwgMCwgbCwgNTIxKSB8IDA7XG4gICAgICAgICAgICAgICAgRCA9ICtiRShoKTtcbiAgICAgICAgICAgICAgICBoID0gYkQoY1sobSArIDQpID4+IDJdIHwgMCwgbCwgNTIyKSB8IDA7XG4gICAgICAgICAgICAgICAgeiA9IH5+KCgxLjAgLSArYkYoaCkpICogMjUwLjApO1xuICAgICAgICAgICAgICAgIGggPSBiRChjWyhtICsgNCkgPj4gMl0gfCAwLCBsLCA0KSB8IDA7XG4gICAgICAgICAgICAgICAgYVsoYiArIDExMSkgfCAwXSA9IH5+KCgrYkYoaCkgKyAwLjUpICogMTI3LjApICYgMjU1O1xuICAgICAgICAgICAgICAgIGNbKGIgKyA2MCkgPj4gMl0gPSBiRygyNTUpIHwgMDtcbiAgICAgICAgICAgICAgICBjWyhiICsgMzYpID4+IDJdID0gYkgoaiwgMjU1LCBjWyhiICsgMTIpID4+IDJdIHwgMCwgQSkgfCAwO1xuICAgICAgICAgICAgICAgIGNbKGIgKyA2NCkgPj4gMl0gPSBiRygyNTApIHwgMDtcbiAgICAgICAgICAgICAgICBjWyhiICsgNDApID4+IDJdID0gYkgoaiwgNSwgY1soYiArIDEyKSA+PiAyXSB8IDAsIEIpIHwgMDtcbiAgICAgICAgICAgICAgICBjWyhiICsgNjgpID4+IDJdID0gYkcoeikgfCAwO1xuICAgICAgICAgICAgICAgIGNbKGIgKyA0NCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICBiSChqLCAoMjU1IC0geikgfCAwLCBjWyhiICsgMTIpID4+IDJdIHwgMCwgQykgfCAwO1xuICAgICAgICAgICAgICAgIGNbKGIgKyA3MikgPj4gMl0gPSBiRygwKSB8IDA7XG4gICAgICAgICAgICAgICAgY1soYiArIDQ4KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgIGJIKGosICh6ICsgNSkgfCAwLCBjWyhiICsgMTIpID4+IDJdIHwgMCwgRCkgfCAwO1xuICAgICAgICAgICAgICAgIGNbKGIgKyA3NikgPj4gMl0gPSBiRygwKSB8IDA7XG4gICAgICAgICAgICAgICAgY1soYiArIDUyKSA+PiAyXSA9IGJHKDEpIHwgMDtcbiAgICAgICAgICAgICAgICBjWyhiICsgODApID4+IDJdID0gYkcoMCkgfCAwO1xuICAgICAgICAgICAgICAgIGNbKGIgKyA1NikgPj4gMl0gPSBiRygxKSB8IDA7XG4gICAgICAgICAgICAgICAgeiA9IChiICsgMTEwKSB8IDA7XG4gICAgICAgICAgICAgICAgYVt6XSA9IChkW3pdIHwgMCB8IDY0KSAmIDI1NTtcbiAgICAgICAgICAgICAgICBuID0gYjtcbiAgICAgICAgICAgICAgICBvID0gKG4gKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgcCA9IGNbbyA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgcSA9IHAgPDwgMTI7XG4gICAgICAgICAgICAgICAgY1tvID4+IDJdID0gcTtcbiAgICAgICAgICAgICAgICByID0gYjtcbiAgICAgICAgICAgICAgICBzID0gciB8IDA7XG4gICAgICAgICAgICAgICAgdCA9IGNbcyA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgdSA9IHQgPDwgMTI7XG4gICAgICAgICAgICAgICAgY1tzID4+IDJdID0gdTtcbiAgICAgICAgICAgICAgICB2ID0gYjtcbiAgICAgICAgICAgICAgICB3ID0gKHYgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgeCA9IGNbdyA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgeSA9IHggPDwgMTI7XG4gICAgICAgICAgICAgICAgY1t3ID4+IDJdID0geTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiRChhLCBiLCBkKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGI7XG4gICAgICAgICAgICAgICAgYiA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IDA7XG4gICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGcgPj4+IDAgPj0gZiA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaCA9IChhICsgKChnICogMTIpIHwgMCkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChlWyhoICsgNCkgPj4gMV0gfCAwIHwgMCkgPT0gKChiICYgNjU1MzUpIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGVbaCA+PiAxXSB8IDAgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZVsoaCArIDIpID4+IDFdIHwgMCB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZVsoaCArIDYpID4+IDFdIHwgMCB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZCArIChjWyhoICsgOCkgPj4gMl0gfCAwKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGcgPSAoZyArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGQgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYkUoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgYiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGMgPSAwLjAsXG4gICAgICAgICAgICAgICAgICAgIGQgPSAwLjA7XG4gICAgICAgICAgICAgICAgYiA9IGE7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSAhPSAtMjE0NzQ4MzY0OCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYyA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgK1AoMi4wLCArKCsoKChiIHwgMCkgLyA2NTUzNikgfCAwIHwgMCkgLyAxMjAwLjApKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMS4wZTM7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gYztcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiArZDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIGMgPSAwLjA7XG4gICAgICAgICAgICAgICAgZCA9IGM7XG4gICAgICAgICAgICAgICAgcmV0dXJuICtkO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYkYoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICByZXR1cm4gKygrKCgoYSB8IDApIC8gNjU1MzYpIHwgMCB8IDApIC8gMS4wZTMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYkcoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICByZXR1cm4gKGEgPDwgMjIpIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJIKGEsIGIsIGQsIGUpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gK2U7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLjA7XG4gICAgICAgICAgICAgICAgZCA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGI7XG4gICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgaWYgKGYgPCA2LjApIHtcbiAgICAgICAgICAgICAgICAgICAgZiA9IDYuMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKChhIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBhID0gMjU1O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBhID0gYSA8PCAyMjtcbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICB+fihcbiAgICAgICAgICAgICAgICAgICAgICAgICgoKyhhIHwgMCkgLyArKGNbKGQgKyA0KSA+PiAyXSB8IDApKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKyhjWyhkICsgMTMwNjApID4+IDJdIHwgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMGUzKSAvXG4gICAgICAgICAgICAgICAgICAgICAgICBmXG4gICAgICAgICAgICAgICAgICAgICkgfCAwXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJJKGIsIGUpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMDtcbiAgICAgICAgICAgICAgICBmID0gYjtcbiAgICAgICAgICAgICAgICBiID0gZTtcbiAgICAgICAgICAgICAgICBlID0gY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyAyMjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKGUgfCAwKSA+IDUpIHtcbiAgICAgICAgICAgICAgICAgICAgYVsoZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkpIHwgMF0gPSAwO1xuICAgICAgICAgICAgICAgICAgICBnID0gMTtcbiAgICAgICAgICAgICAgICAgICAgaCA9IGc7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBoIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAoKGFbXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApICsgNCkgPj4gMl0gfCAwKSArIDExMCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgXSAmXG4gICAgICAgICAgICAgICAgICAgICAgICA2NCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGRbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApKSB8IDBdIHwgMCB8IDApID09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGkgPSAzNjE7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApKSB8IDBdIHwgMCB8IDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IDM2MTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGkgfCAwKSA9PSAzNjEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGUgfCAwKSA8PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgMTcyNCArICgoYiAqIDIzNikgfCAwKSArIDMyKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA9IGc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGggfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyAyMjApID4+IDJdID0gZSArIDE7XG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyAyNCkgPj4gMl0gfCAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA0KSA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA2MCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgPDwgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgIDApXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIGcgPSBiSShmLCBiKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGggPSBnO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaCB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApICsgMjgpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA0KSA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA2MCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgPDwgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgICAgIGNbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApICsgMzIpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA0KSA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAzNiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgPDwgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgKGNbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApICsgMjgpID4+IDJdIHwgMCkgPFxuICAgICAgICAgICAgICAgICAgICAoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyAyNCkgPj4gMl0gfCAwKVxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICBjWyhmICsgMTcyNCArICgoYiAqIDIzNikgfCAwKSArIDMyKSA+PiAyXSA9IC0oXG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgMTcyNCArICgoYiAqIDIzNikgfCAwKSArIDMyKSA+PiAyXSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgaCA9IGc7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGggfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYkooYiwgZSkge1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMC4wLFxuICAgICAgICAgICAgICAgICAgICBqID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAuMDtcbiAgICAgICAgICAgICAgICBmID0gYjtcbiAgICAgICAgICAgICAgICBiID0gZTtcbiAgICAgICAgICAgICAgICBpID0gK2dbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApICsgNjgpID4+IDJdO1xuICAgICAgICAgICAgICAgIGlmICgoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyAyMzIpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApICsgNDgpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGkgKiArZ1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA3NikgPj4gMl07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgKChhW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA0KSA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTEwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgIF0gJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDY0KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoOCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyAyNCkgPj4gMl0gPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIzKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMykpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW2sgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkW2VdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAxKSB8IDBdIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAyKSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgMykgfCAwXSA8PCAyNCkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgNCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkWyhlICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgNSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgNikgfCAwXSA8PCAxNikgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDcpIHwgMF0gPDwgMjQpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAraFtrID4+IDNdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBqID0gfn4oaSAqIDQwOTYuMCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID4gODE5MSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaiA9IDgxOTE7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA2MCkgPj4gMl0gPSBqO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGwgPSArZ1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA3MikgPj4gMl07XG4gICAgICAgICAgICAgICAgaWYgKChjWyhmICsgMTcyNCArICgoYiAqIDIzNikgfCAwKSArIDQ4KSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGkgKiArZ1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA3NikgPj4gMl07XG4gICAgICAgICAgICAgICAgICAgIGwgPSBsICogK2dbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApICsgNzYpID4+IDJdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICgoYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA0KSA+PiAyXSB8IDApICsgMTEwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICBdICZcbiAgICAgICAgICAgICAgICAgICAgICAgIDY0KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIGUgPVxuICAgICAgICAgICAgICAgICAgICAgICAgKDggK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyAyNCkgPj4gMl0gPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjMpIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICBpID1cbiAgICAgICAgICAgICAgICAgICAgICAgIGkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgKChjW2sgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRbZV0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgMSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAyKSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAzKSB8IDBdIDw8IDI0KSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDQpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkWyhlICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyA1KSB8IDBdIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDYpIHwgMF0gPDwgMTYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDcpIHwgMF0gPDwgMjQpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICtoW2sgPj4gM10pO1xuICAgICAgICAgICAgICAgICAgICBlID1cbiAgICAgICAgICAgICAgICAgICAgICAgICg4ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApICsgMjQpID4+IDJdID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIzKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgbCA9XG4gICAgICAgICAgICAgICAgICAgICAgICBsICpcbiAgICAgICAgICAgICAgICAgICAgICAgICgoY1trID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkW2VdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDEpIHwgMF0gPDwgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgMikgfCAwXSA8PCAxNikgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgMykgfCAwXSA8PCAyNCkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyA0KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZFsoZSArIDQpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgNSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyA2KSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyA3KSB8IDBdIDw8IDI0KSksXG4gICAgICAgICAgICAgICAgICAgICAgICAraFtrID4+IDNdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaiA9IH5+KGkgKiA0MDk2LjApO1xuICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID4gODE5MSkge1xuICAgICAgICAgICAgICAgICAgICBqID0gODE5MTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZSA9IH5+KGwgKiA0MDk2LjApO1xuICAgICAgICAgICAgICAgIGlmICgoZSB8IDApID4gODE5MSkge1xuICAgICAgICAgICAgICAgICAgICBlID0gODE5MTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA2MCkgPj4gMl0gPSBqO1xuICAgICAgICAgICAgICAgIGNbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApICsgNjQpID4+IDJdID0gZTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiSyhiLCBlLCBmLCBnKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBlIHwgMDtcbiAgICAgICAgICAgICAgICBmID0gZiB8IDA7XG4gICAgICAgICAgICAgICAgZyA9IGcgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBoID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDA7XG4gICAgICAgICAgICAgICAgaCA9IGk7XG4gICAgICAgICAgICAgICAgaSA9IChpICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgIGogPSBoIHwgMDtcbiAgICAgICAgICAgICAgICBrID0gYjtcbiAgICAgICAgICAgICAgICBiID0gZTtcbiAgICAgICAgICAgICAgICBlID0gZjtcbiAgICAgICAgICAgICAgICBjW2ogPj4gMl0gPSBnO1xuICAgICAgICAgICAgICAgIGcgPSAoayArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkpIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKGRbZyB8IDBdIHwgMCB8IDApID09IDQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChjW2ogPj4gMl0gfCAwKSA+PSAyMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tqID4+IDJdID0gMjA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbCA9IGN5KGssIGUsIGopIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYkwoaywgbCwgYiwgZSwgY1tqID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgIGFbZyB8IDBdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGg7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbCA9IGN5KGssIGUsIGopIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKChjWyhrICsgOCkgPj4gMl0gJiAxKSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhnICsgMzIpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSA0MDI7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soZyArIDQ4KSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IDQwMjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJOKGssIGwsIGIsIGUsIGNbaiA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChtIHwgMCkgPT0gNDAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBiTShrLCBsLCBiLCBlLCBjW2ogPj4gMl0gfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soZyArIDIzMikgPj4gMl0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhnICsgMzIpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gNDA4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soZyArIDQ4KSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSA0MDg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiUChrLCBsLCBiLCBlLCBjW2ogPj4gMl0gfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobSB8IDApID09IDQwOCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJPKGssIGwsIGIsIGUsIGNbaiA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhnICsgMjMyKSA+PiAyXSB8IDApID09IDMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soZyArIDMyKSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSA0MTQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKGcgKyA0OCkgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IDQxNDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJSKGssIGwsIGIsIGUsIGNbaiA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChtIHwgMCkgPT0gNDE0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJRKGssIGwsIGIsIGUsIGNbaiA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhnICsgMjMyKSA+PiAyXSB8IDApID09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9IChiICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soZyArIDMyKSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSA0MjE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKGcgKyA0OCkgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IDQyMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJUKGssIGwsIGIsIGUsIGNbaiA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChtIHwgMCkgPT0gNDIxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJTKGssIGwsIGIsIGUsIGNbaiA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpID0gaDtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiTChhLCBkLCBlLCBmLCBnKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGYgfCAwO1xuICAgICAgICAgICAgICAgIGcgPSBnIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGkgPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMCxcbiAgICAgICAgICAgICAgICAgICAgayA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGwgPSAwLFxuICAgICAgICAgICAgICAgICAgICBtID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG8gPSAwO1xuICAgICAgICAgICAgICAgIGggPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBkO1xuICAgICAgICAgICAgICAgIGQgPSBlO1xuICAgICAgICAgICAgICAgIGUgPSBmO1xuICAgICAgICAgICAgICAgIGYgPSBnO1xuICAgICAgICAgICAgICAgIGcgPSAwO1xuICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZiA9IDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGkgPSBjWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDYwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaiA9IC0oKChpIHwgMCkgLyAoZiB8IDApKSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKGogfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGogPSAtMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCgoY1soaCArIDgpID4+IDJdICYgMSkgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBrID0gZjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAoayAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoayB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gNDc0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IChpICsgaikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChpIHwgMCkgPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IDQ3MjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBhO1xuICAgICAgICAgICAgICAgICAgICAgICAgYSA9IChrICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IGJbayA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBrID0gXyhpLCAoZyA8PCAxNikgPj4gMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChtICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdID0gKGNbbSA+PiAyXSB8IDApICsgaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSA9PSA0NzIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgobCB8IDApID09IDQ3NCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyAyMzIpID4+IDJdIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBrID0gY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA2NCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBtID0gLSgoKGsgfCAwKSAvIChmIHwgMCkpIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbiA9IGY7XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gKG4gLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG4gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gKGkgKyBqKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGkgfCAwKSA8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSAoayArIG0pIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoayB8IDApIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgbiA9IGE7XG4gICAgICAgICAgICAgICAgICAgICAgICBhID0gKG4gKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBnID0gYltuID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSBfKGksIChnIDw8IDE2KSA+PiAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgbyA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gKG8gKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjW28gPj4gMl0gPSAoY1tvID4+IDJdIHwgMCkgKyBuO1xuICAgICAgICAgICAgICAgICAgICAgICAgbiA9IF8oaywgKGcgPDwgMTYpID4+IDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAobyArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbbyA+PiAyXSA9IChjW28gPj4gMl0gfCAwKSArIG47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMjMyKSA+PiAyXSB8IDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgM1xuICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgayA9IGY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAoayAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IDQ1MDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSAoaSArIGopIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChpIHwgMCkgPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gYTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYSA9IChrICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gYltrID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgayA9IF8oaSwgKGcgPDwgMTYpID4+IDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gKG0gKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbbSA+PiAyXSA9IChjW20gPj4gMl0gfCAwKSArIGs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBfKGksIChnIDw8IDE2KSA+PiAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChtICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gPSAoY1ttID4+IDJdIHwgMCkgKyBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSA9PSA0NTApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyAyMzIpID4+IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gZjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmID0gKGsgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gNDU3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IChpICsgaikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoaSB8IDApIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgayA9IGE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYSA9IChrICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPSBiW2sgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBfKGksIChnIDw8IDE2KSA+PiAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAobSArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gPSAoY1ttID4+IDJdIHwgMCkgKyBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZCArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobCB8IDApID09IDQ1Nykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTcyNCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChlICogMjM2KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMzIpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBmO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZiA9IChrIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSA0NjQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gKGkgKyBqKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGkgfCAwKSA8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBhO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYSA9IChrICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZyA9IGJbayA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gKGQgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gXyhpLCAoZyA8PCAxNikgPj4gMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChtICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdID0gKGNbbSA+PiAyXSB8IDApICsgaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSA9PSA0NjQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYk0oYSwgZCwgZSwgZiwgZykge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gZyB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwO1xuICAgICAgICAgICAgICAgIGggPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBkO1xuICAgICAgICAgICAgICAgIGQgPSBlO1xuICAgICAgICAgICAgICAgIGUgPSBmO1xuICAgICAgICAgICAgICAgIGYgPSBnO1xuICAgICAgICAgICAgICAgIGcgPSAoaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkpIHwgMDtcbiAgICAgICAgICAgICAgICBpID0gY1soZyArIDYwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaiA9IGNbKGcgKyAyMjQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBrID0gajtcbiAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBjWyhoICsgMTMwNjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYlUoaCwgZSkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGNbKGcgKyA2MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbCA9IDUwMjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoayB8IDApID49IChmIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGwgPSA0OTU7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBmID0gKGYgLSBrKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBqID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSAoaiAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGogPSBhO1xuICAgICAgICAgICAgICAgICAgICAgICAgYSA9IChqICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGJbaiA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBqID0gXyhpLCAobSA8PCAxNikgPj4gMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChuICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tuID4+IDJdID0gKGNbbiA+PiAyXSB8IDApICsgajtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBrID0gY1soaCArIDEzMDYwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoYlUoaCwgZSkgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gNDkzO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaSA9IGNbKGcgKyA2MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSA9PSA1MDIpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKGwgfCAwKSA9PSA0OTMpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKGwgfCAwKSA9PSA0OTUpIHtcbiAgICAgICAgICAgICAgICAgICAgY1soZyArIDIyNCkgPj4gMl0gPSBrIC0gZjtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBmO1xuICAgICAgICAgICAgICAgICAgICAgICAgZiA9IChrIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgayA9IGE7XG4gICAgICAgICAgICAgICAgICAgICAgICBhID0gKGsgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBtID0gYltrID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBfKGksIChtIDw8IDE2KSA+PiAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gKGcgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjW2cgPj4gMl0gPSAoY1tnID4+IDJdIHwgMCkgKyBrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiTihhLCBkLCBlLCBmLCBnKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGYgfCAwO1xuICAgICAgICAgICAgICAgIGcgPSBnIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgaCA9IDA7XG4gICAgICAgICAgICAgICAgaCA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGc7XG4gICAgICAgICAgICAgICAgZyA9IGNbKGEgKyAxNzI0ICsgKChmICogMjM2KSB8IDApICsgNjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBmID0gZTtcbiAgICAgICAgICAgICAgICAgICAgZSA9IChmIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBmID0gaDtcbiAgICAgICAgICAgICAgICAgICAgaCA9IChmICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBhID0gXyhnLCBiW2YgPj4gMV0gfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGYgPSBkO1xuICAgICAgICAgICAgICAgICAgICBkID0gKGYgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbZiA+PiAyXSA9IChjW2YgPj4gMl0gfCAwKSArIGE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJPKGEsIGQsIGUsIGYsIGcpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBlIHwgMDtcbiAgICAgICAgICAgICAgICBmID0gZiB8IDA7XG4gICAgICAgICAgICAgICAgZyA9IGcgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBoID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBrID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG0gPSAwLFxuICAgICAgICAgICAgICAgICAgICBuID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbyA9IDA7XG4gICAgICAgICAgICAgICAgaCA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGY7XG4gICAgICAgICAgICAgICAgZiA9IGc7XG4gICAgICAgICAgICAgICAgZyA9IChoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSkgfCAwO1xuICAgICAgICAgICAgICAgIGkgPSBjWyhnICsgNjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBqID0gY1soZyArIDY0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgayA9IGNbKGcgKyAyMjQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBsID0gaztcbiAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoayB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBjWyhoICsgMTMwNjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYlUoaCwgZSkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGNbKGcgKyA2MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSBjWyhnICsgNjQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG0gPSA1MzA7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSA+PSAoZiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtID0gNTIyO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZiA9IChmIC0gbCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgayA9IGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gKGsgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGsgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBrID0gYTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGEgPSAoayArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSBiW2sgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgayA9IF8oaSwgKG4gPDwgMTYpID4+IDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAobyArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbbyA+PiAyXSA9IChjW28gPj4gMl0gfCAwKSArIGs7XG4gICAgICAgICAgICAgICAgICAgICAgICBrID0gXyhqLCAobiA8PCAxNikgPj4gMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG8gPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChvICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tvID4+IDJdID0gKGNbbyA+PiAyXSB8IDApICsgaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBsID0gY1soaCArIDEzMDYwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoYlUoaCwgZSkgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtID0gNTIwO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaSA9IGNbKGcgKyA2MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBqID0gY1soZyArIDY0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgobSB8IDApID09IDUyMikge1xuICAgICAgICAgICAgICAgICAgICBjWyhnICsgMjI0KSA+PiAyXSA9IGwgLSBmO1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbCA9IGY7XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gKGwgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gYTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGEgPSAobCArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSBiW2wgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgbCA9IF8oaSwgKG4gPDwgMTYpID4+IDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBnID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZyArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbZyA+PiAyXSA9IChjW2cgPj4gMl0gfCAwKSArIGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gXyhqLCAobiA8PCAxNikgPj4gMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGcgPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChnICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tnID4+IDJdID0gKGNbZyA+PiAyXSB8IDApICsgbDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgobSB8IDApID09IDUyMCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgobSB8IDApID09IDUzMCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYlAoYSwgZCwgZSwgZiwgZykge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gZyB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDA7XG4gICAgICAgICAgICAgICAgaCA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGY7XG4gICAgICAgICAgICAgICAgZiA9IGc7XG4gICAgICAgICAgICAgICAgZyA9IGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgNjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBpID0gY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA2NCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGUgPSBmO1xuICAgICAgICAgICAgICAgICAgICBmID0gKGUgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGUgPSBhO1xuICAgICAgICAgICAgICAgICAgICBhID0gKGUgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGggPSBiW2UgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBlID0gXyhnLCAoaCA8PCAxNikgPj4gMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaiA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIGQgPSAoaiArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tqID4+IDJdID0gKGNbaiA+PiAyXSB8IDApICsgZTtcbiAgICAgICAgICAgICAgICAgICAgZSA9IF8oaSwgKGggPDwgMTYpID4+IDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGggPSBkO1xuICAgICAgICAgICAgICAgICAgICBkID0gKGggKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbaCA+PiAyXSA9IChjW2ggPj4gMl0gfCAwKSArIGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJRKGEsIGQsIGUsIGYsIGcpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBlIHwgMDtcbiAgICAgICAgICAgICAgICBmID0gZiB8IDA7XG4gICAgICAgICAgICAgICAgZyA9IGcgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBoID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBrID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG0gPSAwLFxuICAgICAgICAgICAgICAgICAgICBuID0gMDtcbiAgICAgICAgICAgICAgICBoID0gYTtcbiAgICAgICAgICAgICAgICBhID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZTtcbiAgICAgICAgICAgICAgICBlID0gZjtcbiAgICAgICAgICAgICAgICBmID0gZztcbiAgICAgICAgICAgICAgICBnID0gKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApKSB8IDA7XG4gICAgICAgICAgICAgICAgaSA9IGNbKGcgKyA2MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGogPSBjWyhnICsgMjI0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgayA9IGo7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGogfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBrID0gY1soaCArIDEzMDYwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGJVKGgsIGUpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBjWyhnICsgNjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGwgPSA1NTY7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGsgfCAwKSA+PSAoZiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gNTQ5O1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZiA9IChmIC0gaykgfCAwO1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaiA9IGs7XG4gICAgICAgICAgICAgICAgICAgICAgICBrID0gKGogLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGogfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBqID0gYTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGEgPSAoaiArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBiW2ogPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaiA9IF8oaSwgKG0gPDwgMTYpID4+IDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBuID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAobiArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbbiA+PiAyXSA9IChjW24gPj4gMl0gfCAwKSArIGo7XG4gICAgICAgICAgICAgICAgICAgICAgICBqID0gXyhpLCAobSA8PCAxNikgPj4gMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChuICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tuID4+IDJdID0gKGNbbiA+PiAyXSB8IDApICsgajtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBrID0gY1soaCArIDEzMDYwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoYlUoaCwgZSkgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gNTQ3O1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaSA9IGNbKGcgKyA2MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSA9PSA1NDkpIHtcbiAgICAgICAgICAgICAgICAgICAgY1soZyArIDIyNCkgPj4gMl0gPSBrIC0gZjtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBmO1xuICAgICAgICAgICAgICAgICAgICAgICAgZiA9IChrIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgayA9IGE7XG4gICAgICAgICAgICAgICAgICAgICAgICBhID0gKGsgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBtID0gYltrID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBfKGksIChtIDw8IDE2KSA+PiAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gKGcgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjW2cgPj4gMl0gPSAoY1tnID4+IDJdIHwgMCkgKyBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgayA9IF8oaSwgKG0gPDwgMTYpID4+IDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBnID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZyArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbZyA+PiAyXSA9IChjW2cgPj4gMl0gfCAwKSArIGs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKGwgfCAwKSA9PSA1NTYpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKGwgfCAwKSA9PSA1NDcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJSKGEsIGQsIGUsIGYsIGcpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBlIHwgMDtcbiAgICAgICAgICAgICAgICBmID0gZiB8IDA7XG4gICAgICAgICAgICAgICAgZyA9IGcgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBoID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaSA9IDA7XG4gICAgICAgICAgICAgICAgaCA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGc7XG4gICAgICAgICAgICAgICAgZyA9IGNbKGEgKyAxNzI0ICsgKChmICogMjM2KSB8IDApICsgNjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBmID0gZTtcbiAgICAgICAgICAgICAgICAgICAgZSA9IChmIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBmID0gaDtcbiAgICAgICAgICAgICAgICAgICAgaCA9IChmICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBhID0gYltmID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IF8oZywgKGEgPDwgMTYpID4+IDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgICAgICBkID0gKGkgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbaSA+PiAyXSA9IChjW2kgPj4gMl0gfCAwKSArIGY7XG4gICAgICAgICAgICAgICAgICAgIGYgPSBfKGcsIChhIDw8IDE2KSA+PiAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBhID0gZDtcbiAgICAgICAgICAgICAgICAgICAgZCA9IChhICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW2EgPj4gMl0gPSAoY1thID4+IDJdIHwgMCkgKyBmO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiUyhhLCBkLCBlLCBmLCBnKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGYgfCAwO1xuICAgICAgICAgICAgICAgIGcgPSBnIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGkgPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMCxcbiAgICAgICAgICAgICAgICAgICAgayA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGwgPSAwLFxuICAgICAgICAgICAgICAgICAgICBtID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbiA9IDA7XG4gICAgICAgICAgICAgICAgaCA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGY7XG4gICAgICAgICAgICAgICAgZiA9IGc7XG4gICAgICAgICAgICAgICAgZyA9IChoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSkgfCAwO1xuICAgICAgICAgICAgICAgIGkgPSBjWyhnICsgNjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBqID0gY1soZyArIDIyNCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGsgPSBqO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChqIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgayA9IGNbKGggKyAxMzA2MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiVShoLCBlKSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gY1soZyArIDYwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gNTgyO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgPj0gKGYgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbCA9IDU3NjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGYgPSAoZiAtIGspIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGogPSBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgayA9IChqIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChqIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaiA9IGE7XG4gICAgICAgICAgICAgICAgICAgICAgICBhID0gKGogKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBtID0gYltqID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGogPSBfKGksIChtIDw8IDE2KSA+PiAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgbiA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gKG4gKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjW24gPj4gMl0gPSAoY1tuID4+IDJdIHwgMCkgKyBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChkICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGsgPSBjWyhoICsgMTMwNjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChiVShoLCBlKSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGwgPSA1NzQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpID0gY1soZyArIDYwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgobCB8IDApID09IDU4Mikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgobCB8IDApID09IDU3Nikge1xuICAgICAgICAgICAgICAgICAgICBjWyhnICsgMjI0KSA+PiAyXSA9IGsgLSBmO1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgayA9IGY7XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gKGsgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGsgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBrID0gYTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGEgPSAoayArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBiW2sgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgayA9IF8oaSwgKG0gPDwgMTYpID4+IDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBnID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZyArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbZyA+PiAyXSA9IChjW2cgPj4gMl0gfCAwKSArIGs7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gKGQgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKGwgfCAwKSA9PSA1NzQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJUKGEsIGQsIGUsIGYsIGcpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBlIHwgMDtcbiAgICAgICAgICAgICAgICBmID0gZiB8IDA7XG4gICAgICAgICAgICAgICAgZyA9IGcgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBoID0gMDtcbiAgICAgICAgICAgICAgICBoID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZTtcbiAgICAgICAgICAgICAgICBlID0gZztcbiAgICAgICAgICAgICAgICBnID0gY1soYSArIDE3MjQgKyAoKGYgKiAyMzYpIHwgMCkgKyA2MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPSBlO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGYgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGYgPSBoO1xuICAgICAgICAgICAgICAgICAgICBoID0gKGYgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGEgPSBfKGcsIGJbZiA+PiAxXSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIGQgPSAoZiArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tmID4+IDJdID0gKGNbZiA+PiAyXSB8IDApICsgYTtcbiAgICAgICAgICAgICAgICAgICAgZCA9IChkICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiVShhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMDtcbiAgICAgICAgICAgICAgICBkID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soZCArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAzMikgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGJWKGQsIGEpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZSA9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIGlmICgoY1soZCArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA0OCkgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGJXKGQsIGEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBiSihkLCBhKTtcbiAgICAgICAgICAgICAgICBlID0gMDtcbiAgICAgICAgICAgICAgICBmID0gZTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZiB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiVihhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgZCA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGI7XG4gICAgICAgICAgICAgICAgYiA9IChkICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDI0KSB8IDA7XG4gICAgICAgICAgICAgICAgY1tiID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgKGNbYiA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgKGNbKGQgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMzIpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgaWYgKChjWyhkICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDMyKSA+PiAyXSB8IDApIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soZCArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAyNCkgPj4gMl0gfCAwKSA8PVxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGQgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMjgpID4+IDJdIHwgMClcbiAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gNjAzO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgZSA9IDYwMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGUgPSA2MDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChlIHwgMCkgPT0gNjAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGQgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMzIpID4+IDJdIHwgMCkgPD1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1soZCArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAyNCkgPj4gMl0gfCAwKSA+PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWyhkICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDI4KSA+PiAyXSB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlID0gNjAzO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGUgfCAwKSA9PSA2MDMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKGQgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMjQpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhkICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDI4KSA+PiAyXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYkkoZCwgYSkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGcgPSBmO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGcgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgZiA9IDA7XG4gICAgICAgICAgICAgICAgZyA9IGY7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGcgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYlcoYSwgYikge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMDtcbiAgICAgICAgICAgICAgICBlID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICBiID1cbiAgICAgICAgICAgICAgICAgICAgKGRbXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgNCkgPj4gMl0gfCAwKSArIDEwOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAwKSA8PFxuICAgICAgICAgICAgICAgICAgICA3O1xuICAgICAgICAgICAgICAgIGlmICgoY1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAzNikgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPSAoZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA0MCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW2YgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbZiA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgIChjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDM2KSA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA0MCkgPj4gMl0gfCAwKSA+PVxuICAgICAgICAgICAgICAgICAgICAgICAgNjU1MzZcbiAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDM2KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBiID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDQwKSA+PiAyXSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGIgPSBiID4+IDE2O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGYgPSAoZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA0NCkgfCAwO1xuICAgICAgICAgICAgICAgIGNbZiA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgIChjW2YgPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgIChjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDQ4KSA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgIGdbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgNzYpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgMS4wIC1cbiAgICAgICAgICAgICAgICAgICAgKCtSKFxuICAgICAgICAgICAgICAgICAgICAgICAgKyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICArKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA0NCkgPj4gMl0gPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDUpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgKiAwLjAwNjEzNTkyMzE1MTU0MjU2NVxuICAgICAgICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgICApICtcbiAgICAgICAgICAgICAgICAgICAgICAgIDEuMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgKyhiIHwgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgMS4wICpcbiAgICAgICAgICAgICAgICAgICAgICAgIDc2MjkzOTQ1MzEyNS4wZS0xNztcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiWChiLCBkLCBlKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMDtcbiAgICAgICAgICAgICAgICBmID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZTtcbiAgICAgICAgICAgICAgICBlID0gYjtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBiID0gZDtcbiAgICAgICAgICAgICAgICAgICAgZCA9IChiIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBiID0gZjtcbiAgICAgICAgICAgICAgICAgICAgZiA9IChiICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBnID0gY1tiID4+IDJdID4+IDIxO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSA+IDEyNykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IDEyNztcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApIDwgLTEyOCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPSAtMTI4O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGIgPSBlO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGIgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFbYl0gPSBnICYgMjU1O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiWShiLCBkLCBlKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMDtcbiAgICAgICAgICAgICAgICBmID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZTtcbiAgICAgICAgICAgICAgICBlID0gYjtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBiID0gZDtcbiAgICAgICAgICAgICAgICAgICAgZCA9IChiIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBiID0gZjtcbiAgICAgICAgICAgICAgICAgICAgZiA9IChiICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBnID0gY1tiID4+IDJdID4+IDIxO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSA+IDEyNykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IDEyNztcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApIDwgLTEyOCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPSAtMTI4O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGIgPSBlO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGIgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFbYl0gPSAoMTI4IF4gKGcgJiAyNTUpKSAmIDI1NTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYlooYSwgZCwgZSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGE7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgYSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIGQgPSAoYSAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChhIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYSA9IGY7XG4gICAgICAgICAgICAgICAgICAgIGYgPSAoYSArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZyA9IGNbYSA+PiAyXSA+PiAxMztcbiAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPiAzMjc2Nykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IDMyNzY3O1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPCAtMzI3NjgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gLTMyNzY4O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGEgPSBlO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGEgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGJbYSA+PiAxXSA9IGcgJiA2NTUzNTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYl8oYSwgZCwgZSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGE7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgYSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIGQgPSAoYSAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChhIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYSA9IGY7XG4gICAgICAgICAgICAgICAgICAgIGYgPSAoYSArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZyA9IGNbYSA+PiAyXSA+PiAxMztcbiAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPiAzMjc2Nykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IDMyNzY3O1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPCAtMzI3NjgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gLTMyNzY4O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGEgPSBlO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGEgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGJbYSA+PiAxXSA9ICgzMjc2OCBeIChnICYgNjU1MzUpKSAmIDY1NTM1O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiJChhLCBkLCBlKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMDtcbiAgICAgICAgICAgICAgICBmID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZTtcbiAgICAgICAgICAgICAgICBlID0gYTtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBhID0gZDtcbiAgICAgICAgICAgICAgICAgICAgZCA9IChhIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGEgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBhID0gZjtcbiAgICAgICAgICAgICAgICAgICAgZiA9IChhICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBnID0gY1thID4+IDJdID4+IDEzO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSA+IDMyNzY3KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBnID0gMzI3Njc7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSA8IC0zMjc2OCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPSAtMzI3Njg7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYSA9IGU7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoYSArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYlthID4+IDFdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICgoKCgoKGcgJiA2NTUzNSkgPDwgMTYpID4+IDE2KSAmIDI1NSkgPDwgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKCgoZyAmIDY1NTM1KSA8PCAxNikgPj4gMTYpID4+IDgpICYgMjU1KSkgJlxuICAgICAgICAgICAgICAgICAgICAgICAgNjU1MzU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGIwKGIsIGQsIGUsIGYpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBlIHwgMDtcbiAgICAgICAgICAgICAgICBmID0gZiB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGcgPSAwLFxuICAgICAgICAgICAgICAgICAgICBoID0gMDtcbiAgICAgICAgICAgICAgICBnID0gaTtcbiAgICAgICAgICAgICAgICBpID0gKGkgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgaCA9IGcgfCAwO1xuICAgICAgICAgICAgICAgIGNbaCA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgYVsoaCArIDUpIHwgMF0gPSAxO1xuICAgICAgICAgICAgICAgIGFbKGggKyA0KSB8IDBdID0gZCAmIDI1NTtcbiAgICAgICAgICAgICAgICBhWyhoICsgNikgfCAwXSA9IGUgJiAyNTU7XG4gICAgICAgICAgICAgICAgYVsoaCArIDcpIHwgMF0gPSBmICYgMjU1O1xuICAgICAgICAgICAgICAgIGIxKGIsIGgpO1xuICAgICAgICAgICAgICAgIGkgPSBnO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGIxKGIsIGUpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMDtcbiAgICAgICAgICAgICAgICBmID0gYjtcbiAgICAgICAgICAgICAgICBiID0gZTtcbiAgICAgICAgICAgICAgICBlID0gY1soZiArIDEzMDUyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgZyA9IC0xO1xuICAgICAgICAgICAgICAgIGggPSAyMTQ3NDgzNjQ3O1xuICAgICAgICAgICAgICAgIGlmICgwID09IChiIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGNbKGYgKyAxMzA4MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBiO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBiID0gZTtcbiAgICAgICAgICAgICAgICAgICAgZSA9IChiIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGRbKGYgKyAxNzI0ICsgKChlICogMjM2KSB8IDApKSB8IDBdIHwgMCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGcgPSBlO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGYgKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMSkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhpICsgNCkgfCAwXSB8IDAgfCAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZiArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyAyKSB8IDBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGkgKyA2KSB8IDBdIHwgMCB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNzI0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChlICogMjM2KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaChmLCBlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSAhPSAtMSkge1xuICAgICAgICAgICAgICAgICAgICBjbihmLCBpLCBnKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlID0gY1soZiArIDEzMDUyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgYiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoYiAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhmICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSkgfCAwXSB8IDAgfCAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDFcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGYgKyAxNzI0ICsgKChlICogMjM2KSB8IDApKSB8IDBdIHwgMCB8IDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPSBjWyhmICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDYwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyAyMzIpID4+IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA2NCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPD1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYiB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDY0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgPCAoaCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggPSBiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSAhPSAtMSkge1xuICAgICAgICAgICAgICAgICAgICBlID0gKGYgKyAxMzA2OCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW2UgPj4gMl0gPSAoY1tlID4+IDJdIHwgMCkgKyAxO1xuICAgICAgICAgICAgICAgICAgICBhWyhmICsgMTcyNCArICgoZyAqIDIzNikgfCAwKSkgfCAwXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGNuKGYsIGksIGcpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZyA9IChmICsgMTMwNjQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tnID4+IDJdID0gKGNbZyA+PiAyXSB8IDApICsgMTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGIyKGIsIGUpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwO1xuICAgICAgICAgICAgICAgIGYgPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBlO1xuICAgICAgICAgICAgICAgIGUgPSBjWyhmICsgMTMwNTIpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoMCA9PSAoYiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgIGcgPSBjWyhmICsgMTMwODApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBnID0gYjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgTDg5MDogd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgYiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoYiAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaCA9IDcwOTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZiArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkpIHwgMF0gfCAwIHwgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAxXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhmICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDEpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZyArIDQpIHwgMF0gfCAwIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGYgKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMikgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhnICsgNikgfCAwXSB8IDAgfCAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMODkwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoaCB8IDApID09IDcwOSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAoZiArIDEwODQgKyAoKChkWyhnICsgNCkgfCAwXSB8IDApICogNDApIHwgMCkgKyAxMikgPj4gMlxuICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgYVsoZiArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkpIHwgMF0gPSAyO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGNpKGYsIGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiMyhhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBiID0gMDtcbiAgICAgICAgICAgICAgICBiID0gYTtcbiAgICAgICAgICAgICAgICBjW2IgPj4gMl0gPSAxO1xuICAgICAgICAgICAgICAgIGI0KGIpO1xuICAgICAgICAgICAgICAgIGI1KGIsIDApO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGI0KGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGIgPSAwO1xuICAgICAgICAgICAgICAgIGIgPSBhO1xuICAgICAgICAgICAgICAgIGdbKGIgKyAxNikgPj4gMl0gPSArKGNbKGIgKyAyMCkgPj4gMl0gfCAwKSAvIDEwMC4wO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGI1KGEsIGIpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBkID0gMDtcbiAgICAgICAgICAgICAgICBkID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICBpZiAoKGNbKGQgKyAxMzA4OCkgPj4gMl0gfCAwKSA+IChhIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY1soZCArIDEzMDg4KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNrKGQpO1xuICAgICAgICAgICAgICAgIGNbKGQgKyAxMzA4MCkgPj4gMl0gPSBjWyhkICsgMTMwNzYpID4+IDJdO1xuICAgICAgICAgICAgICAgIGNbMzkyXSA9IDVlNTtcbiAgICAgICAgICAgICAgICBpZiAoKGEgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY2woZCwgYSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYjYoYiwgZSwgZiwgaCkge1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGYgfCAwO1xuICAgICAgICAgICAgICAgIGggPSBoIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwLFxuICAgICAgICAgICAgICAgICAgICBvID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcCA9IDA7XG4gICAgICAgICAgICAgICAgaiA9IGk7XG4gICAgICAgICAgICAgICAgaSA9IChpICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgIGsgPSBqIHwgMDtcbiAgICAgICAgICAgICAgICBsID0gYjtcbiAgICAgICAgICAgICAgICBjW2sgPj4gMl0gPSBlO1xuICAgICAgICAgICAgICAgIGUgPSBoO1xuICAgICAgICAgICAgICAgIGlmICgoY1tsID4+IDJdIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBtID0gMDtcbiAgICAgICAgICAgICAgICAgICAgbiA9IG07XG4gICAgICAgICAgICAgICAgICAgIGkgPSBqO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGggPSAoKGYgPj4+IDApIC8gKChjWyhsICsgMTIpID4+IDJdIHwgMCkgPj4+IDApKSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGNbKGwgKyAxMzA4OCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGIgPSAoKGNbKGwgKyAxMzA4OCkgPj4gMl0gfCAwKSArIGgpIHwgMDtcbiAgICAgICAgICAgICAgICBMOTIwOiB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKGwgKyAxMzA4OCkgPj4gMl0gfCAwKSA+PSAoYiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gNzU4O1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB+figrKGNbY1sobCArIDEzMDgwKSA+PiAyXSA+PiAyXSB8IDApIC8gK2dbMjU4XSkgPj4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWyhsICsgMTMwODgpID4+IDJdIHwgMCkgPj4+IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChkWygoY1sobCArIDEzMDgwKSA+PiAyXSB8IDApICsgNSkgfCAwXSB8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDk5OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09IChlIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8gPSA3NTI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMOTIwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDY6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGwgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDQpIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMikgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSBkWygoY1sobCArIDEzMDgwKSA+PiAyXSB8IDApICsgNikgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhWygoY1sobCArIDEzMDgwKSA+PiAyXSB8IDApICsgNikgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYShsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAzOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGI3KGwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGwgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1sobCArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMyKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGRbKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA2KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGwgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDQpIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzNikgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSAwLjA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE0OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNjKGwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZChsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTM6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2IoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZFsoKGNbKGwgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDQpIHwgMF0gfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDk6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhsICsgMTMwNTYpID4+IDJdICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGwgKyAxMzA4MCkgPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRbKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA2KSB8IDBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZFsoKGNbKGwgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDYpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGwgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1sobCArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGRbKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA2KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGwgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1sobCArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGRbKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA2KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYjkobCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFbKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA3KSB8IDBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIxKGwsIDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYjIobCwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTU6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGwgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDQpIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGRbKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA2KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTA6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1szOTJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWygoY1sobCArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA3KSB8IDBdIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA2KSB8IDBdIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA4OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoZFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA0KSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjApID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWygoY1sobCArIDEzMDgwKSA+PiAyXSB8IDApICsgNikgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA3KSB8IDBdIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoZFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA0KSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gMC4wO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiOChsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGwgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1sobCArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDgpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gZFsoKGNbKGwgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDYpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiOShsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiMihsLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBwID0gKGwgKyAxMzA4MCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1twID4+IDJdID0gKGNbcCA+PiAyXSB8IDApICsgODtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICB+figrKGNbY1sobCArIDEzMDgwKSA+PiAyXSA+PiAyXSB8IDApIC8gK2dbMjU4XSkgPj4+IDAgPlxuICAgICAgICAgICAgICAgICAgICAgICAgYiA+Pj4gMFxuICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNlKGwsIGssIChiIC0gKGNbKGwgKyAxMzA4OCkgPj4gMl0gfCAwKSkgfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgayxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAofn4oKyhjW2NbKGwgKyAxMzA4MCkgPj4gMl0gPj4gMl0gfCAwKSAvICtnWzI1OF0pIC1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGwgKyAxMzA4OCkgPj4gMl0gfCAwKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgobyB8IDApID09IDc1Mikge1xuICAgICAgICAgICAgICAgICAgICBjW2wgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICBtID1cbiAgICAgICAgICAgICAgICAgICAgICAgIF8oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhsICsgMTMwODgpID4+IDJdIHwgMCkgLSBmKSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sobCArIDEyKSA+PiAyXSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBuID0gbTtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGo7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChvIHwgMCkgPT0gNzU4KSB7XG4gICAgICAgICAgICAgICAgICAgIG0gPSBfKGgsIGNbKGwgKyAxMikgPj4gMl0gfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBtO1xuICAgICAgICAgICAgICAgICAgICBpID0gajtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGI3KGIpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwO1xuICAgICAgICAgICAgICAgIGUgPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBjWyhlICsgMTMwODApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBmID0gY1soZSArIDEzMDUyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgTDk2Nzogd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgZyA9IGY7XG4gICAgICAgICAgICAgICAgICAgIGYgPSAoZyAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaCA9IDc3MjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDE3MjQgKyAoKGYgKiAyMzYpIHwgMCkpIHwgMF0gfCAwIHwgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAxXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgMTcyNCArICgoZiAqIDIzNikgfCAwKSArIDEpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoYiArIDQpIHwgMF0gfCAwIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAxNzI0ICsgKChmICogMjM2KSB8IDApICsgMikgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgNikgfCAwXSB8IDAgfCAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMOTY3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoaCB8IDApID09IDc3Mikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGFbKGUgKyAxNzI0ICsgKChmICogMjM2KSB8IDApICsgMykgfCAwXSA9IGFbKGIgKyA3KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICBjZihlLCBmKTtcbiAgICAgICAgICAgICAgICBiSihlLCBmKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiOChhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBiID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGYgPSAwO1xuICAgICAgICAgICAgICAgIGIgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBkWygoY1soYiArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGNbKGIgKyAxMzA1MikgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPSBlO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGYgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoYiArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkpIHwgMF0gfCAwIHwgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDEpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYSB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaihiLCBlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGI5KGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDA7XG4gICAgICAgICAgICAgICAgYiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGRbKChjWyhiICsgMTMwODApID4+IDJdIHwgMCkgKyA0KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gY1soYiArIDEzMDUyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoZiAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDEpIHwgMF0gfCAwIHwgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYSB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSkgfCAwXSB8IDAgfCAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZihiLCBlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiSihiLCBlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNhKGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDA7XG4gICAgICAgICAgICAgICAgYiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGNbKGIgKyAxMzA1MikgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBkWygoY1soYiArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGE7XG4gICAgICAgICAgICAgICAgICAgIGEgPSAoZiAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSkgfCAwXSB8IDAgfCAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGIgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMSkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpKGIsIGEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY2IoYSwgYikge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGQgPSAwO1xuICAgICAgICAgICAgICAgIGQgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBiO1xuICAgICAgICAgICAgICAgIGNbKGQgKyAxMDg0ICsgKChhICogNDApIHwgMCkgKyA4KSA+PiAyXSA9IDkwO1xuICAgICAgICAgICAgICAgIGNbKGQgKyAxMDg0ICsgKChhICogNDApIHwgMCkgKyAyNCkgPj4gMl0gPSAxMjc7XG4gICAgICAgICAgICAgICAgY1soZCArIDEwODQgKyAoKGEgKiA0MCkgfCAwKSArIDEyKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgY1soZCArIDEwODQgKyAoKGEgKiA0MCkgfCAwKSArIDIwKSA+PiAyXSA9IDgxOTI7XG4gICAgICAgICAgICAgICAgZ1soZCArIDEwODQgKyAoKGEgKiA0MCkgfCAwKSArIDM2KSA+PiAyXSA9IDAuMDtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjYyhiKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGcgPSAwO1xuICAgICAgICAgICAgICAgIGUgPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBjWyhlICsgMTMwNTIpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBmID0gZFsoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDQpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGcgPSBiO1xuICAgICAgICAgICAgICAgICAgICBiID0gKGcgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkpIHwgMF0gfCAwIHwgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAxXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgMTcyNCArICgoYiAqIDIzNikgfCAwKSArIDEpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWyhlICsgMTA4NCArICgoZiAqIDQwKSB8IDApICsgMTIpID4+IDJdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVsoZSArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkpIHwgMF0gPSAyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpKGUsIGIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNkKGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDA7XG4gICAgICAgICAgICAgICAgYiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGNbKGIgKyAxMzA1MikgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBkWygoY1soYiArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGE7XG4gICAgICAgICAgICAgICAgICAgIGEgPSAoZiAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDEpIHwgMF0gfCAwIHwgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZSB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSkgfCAwXSB8IDAgfCAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSkgfCAwXSB8IDAgfCAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaChiLCBhKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNlKGEsIGIsIGQpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGkgPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMDtcbiAgICAgICAgICAgICAgICBlID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICBiID0gZDtcbiAgICAgICAgICAgICAgICBpZiAoKChjWyhlICsgOCkgPj4gMl0gJiAxKSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZiA9IDE7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZiA9IDI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoYiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGQgPSBiO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGQgfCAwKSA+IChjWyhlICsgMTA2NCkgPj4gMl0gfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IGNbKGUgKyAxMDY0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgY2coZSwgZCk7XG4gICAgICAgICAgICAgICAgICAgIGcgPSBjWyhlICsgMTA2MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBoID0gY1thID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGNbKGUgKyAxMDcyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGogPSBfKGYsIGQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYVpbZyAmIDE1XShoLCBpLCBqKTtcbiAgICAgICAgICAgICAgICAgICAgaiA9IF8oY1soZSArIDEyKSA+PiAyXSB8IDAsIGQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGE7XG4gICAgICAgICAgICAgICAgICAgIGNbaSA+PiAyXSA9IChjW2kgPj4gMl0gfCAwKSArIGo7XG4gICAgICAgICAgICAgICAgICAgIGIgPSAoYiAtIGQpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY2YoYSwgYikge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDA7XG4gICAgICAgICAgICAgICAgZSA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGI7XG4gICAgICAgICAgICAgICAgYiA9XG4gICAgICAgICAgICAgICAgICAgIF8oXG4gICAgICAgICAgICAgICAgICAgICAgICBkWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDMpIHwgMF0gfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDEpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9XG4gICAgICAgICAgICAgICAgICAgIF8oXG4gICAgICAgICAgICAgICAgICAgICAgICBiLFxuICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDEpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwXG4gICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoKGNbKGUgKyA4KSA+PiAyXSAmIDEpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDIzMikgPj4gMl0gPSAzO1xuICAgICAgICAgICAgICAgICAgICBnWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDY4KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICArKGYgfCAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICArZ1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgNCkgPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDg0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICBdICpcbiAgICAgICAgICAgICAgICAgICAgICAgICtnWyhlICsgMTYpID4+IDJdICpcbiAgICAgICAgICAgICAgICAgICAgICAgIDQuNzY4MzcxNTgyMDMxMjVlLTc7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMjI4KSA+PiAyXSB8IDApID4gNjApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAyMjgpID4+IDJdIHwgMCkgPj1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA2OFxuICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA9IDgyNztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMjMyKSA+PiAyXSA9IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICBnWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDY4KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKyhmIHwgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICtnW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgNCkgPj4gMl0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgODQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgK2dbKGUgKyAxNikgPj4gMl0gKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQuNzY4MzcxNTgyMDMxMjVlLTc7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBoID0gODI3O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgaWYgKChoIHwgMCkgPT0gODI3KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAyMjgpID4+IDJdIHwgMCkgPCA1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDIzMikgPj4gMl0gPSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgZ1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA2OCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICsoZiB8IDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICArZ1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDQpID4+IDJdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDg0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICtnWyhlICsgMTYpID4+IDJdICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA5LjUzNjc0MzE2NDA2MjVlLTc7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMjI4KSA+PiAyXSB8IDApID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMjNcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMjMyKSA+PiAyXSA9IDI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA2OCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArKGYgfCAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICtnW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDQpID4+IDJdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgODQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgK2dbKGUgKyAxNikgPj4gMl0gKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA5LjUzNjc0MzE2NDA2MjVlLTc7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMjMyKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA2OCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArKGYgfCAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICtnW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDQpID4+IDJdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgODQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgK2dbKGUgKyAxNikgPj4gMl0gKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA3LjQ1MDU4MDU5NjkyMzgyOGUtOTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDcyKSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICtnWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDY4KSA+PiAyXSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDIyOCkgPj4gMl0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAoZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA2OCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdbZiA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICtnW2YgPj4gMl0gKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDEyNyAtXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE3MjQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChhICogMjM2KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIyOCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjZyhhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGYgPSAwO1xuICAgICAgICAgICAgICAgIGUgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBiO1xuICAgICAgICAgICAgICAgIGlmICgoKGNbKGUgKyA4KSA+PiAyXSAmIDEpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBmID0gYSA8PCAyO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPSBhIDw8IDM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGM1KGNbKGUgKyAxMDcyKSA+PiAyXSB8IDAsIDAsIGYgfCAwKTtcbiAgICAgICAgICAgICAgICBmID0gMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSA+PSAoY1soZSArIDEzMDUyKSA+PiAyXSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGRbKGUgKyAxNzI0ICsgKChmICogMjM2KSB8IDApKSB8IDBdIHwgMCB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJLKGUsIGNbKGUgKyAxMDcyKSA+PiAyXSB8IDAsIGYsIGEpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGYgPSAoZiArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZiA9IChlICsgMTMwODgpIHwgMDtcbiAgICAgICAgICAgICAgICBjW2YgPj4gMl0gPSAoY1tmID4+IDJdIHwgMCkgKyBhO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNoKGIsIGMpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgYyA9IGMgfCAwO1xuICAgICAgICAgICAgICAgIGFbKGIgKyAxNzI0ICsgKChjICogMjM2KSB8IDApKSB8IDBdID0gNDtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjaShiLCBkKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGYgPSAwO1xuICAgICAgICAgICAgICAgIGUgPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBkO1xuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgKChhW1xuICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhlICsgMTcyNCArICgoYiAqIDIzNikgfCAwKSArIDQpID4+IDJdIHwgMCkgKyAxMTApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgIF0gJlxuICAgICAgICAgICAgICAgICAgICAgICAgNjQpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgY1soZSArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyAyMjApID4+IDJdID0gMztcbiAgICAgICAgICAgICAgICAgICAgYVsoZSArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkpIHwgMF0gPSAzO1xuICAgICAgICAgICAgICAgICAgICBkID0gZTtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGI7XG4gICAgICAgICAgICAgICAgICAgIGJJKGQsIGYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYkooZSwgYik7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBhWyhlICsgMTcyNCArICgoYiAqIDIzNikgfCAwKSkgfCAwXSA9IDM7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjaihhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGwgPSAwLFxuICAgICAgICAgICAgICAgICAgICBtID0gMC4wO1xuICAgICAgICAgICAgICAgIGUgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBiO1xuICAgICAgICAgICAgICAgIGIgPSAoKGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMjApID4+IDJdIHwgMCkgPCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9XG4gICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAoZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoZFsoZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAxKSB8IDBdIHwgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMjApID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICBdIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDQpID4+IDJdIHwgMCkgKyAxMikgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoY1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAyMTIpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBpID0gMzI7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBqID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGkgPSAoaiAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgODAgKyAoaSA8PCAyKSkgPj4gMlxuICAgICAgICAgICAgICAgICAgICAgICAgXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSA9PSA4MTkyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gODY2O1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IDg2NjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID4gMTYzODMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gODY2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZiA9IChmIC0gODE5MikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICtnW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMSkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9PSAwLjBcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoZFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNzI0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGEgKiAyMzYpIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzIpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gLWkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gKDE3MDQgKyAoKChpID4+IDUpICYgMjU1KSA8PCAzKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbayA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkW2pdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhqICsgMSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoaiArIDIpIHwgMF0gPDwgMTYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhqICsgMykgfCAwXSA8PCAyNCkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDQpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRbKGogKyA0KSB8IDBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhqICsgNSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoaiArIDYpIHwgMF0gPDwgMTYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhqICsgNykgfCAwXSA8PCAyNCkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAraFtrID4+IDNdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gKDM3NTIgKyAoKGkgPj4gMTMpIDw8IDMpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDEpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDM2KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW2sgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZFtqXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoaiArIDEpIHwgMF0gPDwgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGogKyAyKSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoaiArIDMpIHwgMF0gPDwgMjQpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyA0KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkWyhqICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoaiArIDUpIHwgMF0gPDwgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGogKyA2KSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoaiArIDcpIHwgMF0gPDwgMjQpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgK2hbayA+PiAzXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDEyKSA+PiAyXSA9IH5+KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArZ1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAxKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyhjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDgpID4+IDJdIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDEyKSA+PiAyXSA9IH5+KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA4KSA+PiAyXSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSAvXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICtnW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDEpIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzNikgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgaWYgKChsIHwgMCkgPT0gODY2KSB7XG4gICAgICAgICAgICAgICAgICAgIGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMTIpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgOCkgPj4gMl07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG0gPVxuICAgICAgICAgICAgICAgICAgICAoKCsoXG4gICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA0KSA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwXG4gICAgICAgICAgICAgICAgICAgICkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgKyhjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDEyKSA+PiAyXSB8IDApKSAvXG4gICAgICAgICAgICAgICAgICAgICAgICAoKyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgNCkgPj4gMl0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzIpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICsoY1soZSArIDQpID4+IDJdIHwgMCkpKSAqXG4gICAgICAgICAgICAgICAgICAgIDQwOTYuMDtcbiAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIG0gPSAtMC4wIC0gbTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAyMCkgPj4gMl0gPSB+fm07XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY2soYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgYiA9IDA7XG4gICAgICAgICAgICAgICAgYiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChhIHwgMCkgPj0gMTYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNiKGIsIGEpO1xuICAgICAgICAgICAgICAgICAgICBjWyhiICsgMTA4NCArICgoYSAqIDQwKSB8IDApICsgNCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgY1soYiArIDEwNTYpID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICBjWyhiICsgMTA4NCArICgoYSAqIDQwKSB8IDApICsgMTYpID4+IDJdID0gLTE7XG4gICAgICAgICAgICAgICAgICAgIGNbKGIgKyAxMDg0ICsgKChhICogNDApIHwgMCkgKyAzMikgPj4gMl0gPSAyO1xuICAgICAgICAgICAgICAgICAgICBjWyhiICsgMTA4NCArICgoYSAqIDQwKSB8IDApKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGEgPSAoYSArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY20oYik7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY2woYSwgYikge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMDtcbiAgICAgICAgICAgICAgICBlID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICBjbShlKTtcbiAgICAgICAgICAgICAgICBMMTEyMzogd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgKyhjW2NbKGUgKyAxMzA4MCkgPj4gMl0gPj4gMl0gfCAwKSAvICtnWzI1OF0gPj1cbiAgICAgICAgICAgICAgICAgICAgICAgICsoYSB8IDApXG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChkWygoY1soZSArIDEzMDgwKSA+PiAyXSB8IDApICsgNSkgfCAwXSB8IDAgfCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbKChjWyhlICsgMTMwODApID4+IDJdIHwgMCkgKyA0KSB8IDBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gZFsoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDYpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNiKGUsIGRbKChjWyhlICsgMTMwODApID4+IDJdIHwgMCkgKyA0KSB8IDBdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbKChjWyhlICsgMTMwODApID4+IDJdIHwgMCkgKyA0KSB8IDBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSBkWygoY1soZSArIDEzMDgwKSA+PiAyXSB8IDApICsgNikgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDExOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkWygoY1soZSArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzIpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGRbKChjWyhlICsgMTMwODApID4+IDJdIHwgMCkgKyA2KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbKChjWyhlICsgMTMwODApID4+IDJdIHwgMCkgKyA0KSB8IDBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzNikgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gMC4wO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA5OToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSA5MDI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDExMjM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDk6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZSArIDEzMDU2KSA+PiAyXSAmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDQpIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSkpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDQpIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGRbKChjWyhlICsgMTMwODApID4+IDJdIHwgMCkgKyA2KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZSArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gZFsoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDYpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgODoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoZFsoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDQpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIwKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDYpIHwgMF0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZFsoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDcpIHwgMF0gfCAwKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkWygoY1soZSArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IDAuMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTU6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbKChjWyhlICsgMTMwODApID4+IDJdIHwgMCkgKyA0KSB8IDBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gZFsoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDYpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMzkyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWygoY1soZSArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChkWygoY1soZSArIDEzMDgwKSA+PiAyXSB8IDApICsgNykgfCAwXSB8IDApIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4KSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZFsoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDYpIHwgMF0gfCAwKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA1OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkWygoY1soZSArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGRbKChjWyhlICsgMTMwODApID4+IDJdIHwgMCkgKyA2KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoZFsoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDQpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSBkWygoY1soZSArIDEzMDgwKSA+PiAyXSB8IDApICsgNikgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYiA9IChlICsgMTMwODApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tiID4+IDJdID0gKGNbYiA+PiAyXSB8IDApICsgODtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgPT0gOTAyKSB7XG4gICAgICAgICAgICAgICAgICAgIGNbKGUgKyAxMzA4OCkgPj4gMl0gPSB+fihcbiAgICAgICAgICAgICAgICAgICAgICAgICsoY1tjWyhlICsgMTMwODApID4+IDJdID4+IDJdIHwgMCkgLyArZ1syNThdXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKChjWyhlICsgMTMwODApID4+IDJdIHwgMCkgIT0gKGNbKGUgKyAxMzA3NikgPj4gMl0gfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICBmID0gKGUgKyAxMzA4MCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW2YgPj4gMl0gPSAoY1tmID4+IDJdIHwgMCkgLSA4O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjWyhlICsgMTMwODgpID4+IDJdID0gYTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjbShiKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBjID0gMDtcbiAgICAgICAgICAgICAgICBjID0gYjtcbiAgICAgICAgICAgICAgICBiID0gMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSA+PSA0OCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYVsoYyArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkpIHwgMF0gPSAwO1xuICAgICAgICAgICAgICAgICAgICBiID0gKGIgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNuKGIsIGUsIGYpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGkgPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMCxcbiAgICAgICAgICAgICAgICAgICAgayA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGwgPSAwLFxuICAgICAgICAgICAgICAgICAgICBtID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG8gPSAwLFxuICAgICAgICAgICAgICAgICAgICBwID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBzID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdCA9IDA7XG4gICAgICAgICAgICAgICAgaCA9IGI7XG4gICAgICAgICAgICAgICAgYiA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGY7XG4gICAgICAgICAgICAgICAgaWYgKCgoY1soaCArIDEzMDU2KSA+PiAyXSAmICgxIDw8IGRbKGIgKyA0KSB8IDBdKSkgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPVxuICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChoICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDU0MCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkWyhiICsgNCkgfCAwXSB8IDApICogNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgNikgfCAwXSA8PCAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBmO1xuICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGggKyA1NDApID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgNikgfCAwXSA8PCAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoaiB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgIChjW2kgPj4gMl0gfCAwKSAhPSAxO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGFbKChjWyhpICsgNCkgPj4gMl0gfCAwKSArIDExMikgfCAwXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGYgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgxMDU2ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFbKChjWyhpICsgNCkgPj4gMl0gfCAwKSArIDExMikgfCAwXSA8PCAyKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDgpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkW2ZdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZiArIDEpIHwgMF0gPDwgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhmICsgMikgfCAwXSA8PCAxNikgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhmICsgMykgfCAwXSA8PCAyNCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gKDEwNTYgKyAoKGFbKGIgKyA2KSB8IDBdICYgMTI3KSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA4KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZFtmXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGYgKyAxKSB8IDBdIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZiArIDIpIHwgMF0gPDwgMTYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZiArIDMpIHwgMF0gPDwgMjQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgNCkgPj4gMl0gPSBjWyhpICsgNCkgPj4gMl07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKC0xICE9IChjWygxNjQwICsgKGRbKGIgKyA0KSB8IDBdIDw8IDIpKSA+PiAyXSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkWyhiICsgNCkgfCAwXSB8IDApICogNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBqID0gY1soMTY0MCArIChkWyhiICsgNCkgfCAwXSA8PCAyKSkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT0gKGNbKGYgKyA0ICsgKGogPDwgMikpID4+IDJdIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gaDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gY1soKGNbZiA+PiAyXSB8IDApICsgKChqICogMjgpIHwgMCkpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuID0gKGsgfCAwKSAhPSAwID8gMSA6IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbZiA+PiAyXSB8IDApICsgKChqICogMjgpIHwgMCkgKyAxMikgPj4gMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soKGNbZiA+PiAyXSB8IDApICsgKChqICogMjgpIHwgMCkgKyA4KSA+PiAyXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tmID4+IDJdIHwgMCkgKyAoKGogKiAyOCkgfCAwKSArIDQpID4+IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW2YgPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoaiAqIDI4KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IHI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbZiA+PiAyXSB8IDApICsgKChqICogMjgpIHwgMCkgKyAxNikgPj4gMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0xXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbZiA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChqICogMjgpIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNikgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IChrIHwgMCkgIT0gMCA/IDEgOiAtMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tmID4+IDJdIHwgMCkgKyAoKGogKiAyOCkgfCAwKSArIDIwKSA+PiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tmID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGogKiAyOCkgfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIwKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gKGsgfCAwKSAhPSAwID8gMSA6IC0xO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgNCArIChqIDw8IDIpKSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tmID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGogKiAyOCkgfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBjWyhmICsgNCArIChqIDw8IDIpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChoICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoZFsoYiArIDQpIHwgMF0gfCAwKSAqIDQwKSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLTFcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBjWyhoICsgMTA1MikgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI4ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoZFsoYiArIDQpIHwgMF0gfCAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGggK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkWyhiICsgNCkgfCAwXSB8IDApICogNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soaCArIDI4KSA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGggK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoZFsoYiArIDQpIHwgMF0gfCAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gZjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoYVsoKGNbKGkgKyA0KSA+PiAyXSB8IDApICsgMTEyKSB8IDBdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKDEwNTYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVsoKGNbKGkgKyA0KSA+PiAyXSB8IDApICsgMTEyKSB8IDBdIDw8IDIpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgOCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRbal0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhqICsgMSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGogKyAyKSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGogKyAzKSB8IDBdIDw8IDI0KTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGogPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgxMDU2ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoKGRbKGIgKyA2KSB8IDBdIHwgMCkgKyAoY1sxNjYyXSB8IDApKSAmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMjcpIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDgpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkW2pdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoaiArIDEpIHwgMF0gPDwgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhqICsgMikgfCAwXSA8PCAxNikgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhqICsgMykgfCAwXSA8PCAyNCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA4KSA+PiAyXSA9IH5+KFxuICAgICAgICAgICAgICAgICAgICAgICAgKCsoY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA4KSA+PiAyXSB8IDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICArZ1syNjBdKSAvXG4gICAgICAgICAgICAgICAgICAgICAgICA0NDAuMFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICBjbyhoLCBlLCBpLCBkWyhiICsgNykgfCAwXSB8IDApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBhWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSkgfCAwXSA9IDE7XG4gICAgICAgICAgICAgICAgYVsoaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyAxKSB8IDBdID0gYVsoYiArIDQpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgIGFbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMikgfCAwXSA9IGFbKGIgKyA2KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICBhWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDMpIHwgMF0gPVxuICAgICAgICAgICAgICAgICAgICBjcChcbiAgICAgICAgICAgICAgICAgICAgICAgIGFbKGIgKyA3KSB8IDBdIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICtnWygxNTc2ICsgKGRbKGIgKyA0KSB8IDBdIDw8IDIpKSA+PiAyXVxuICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICBjWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDE2KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyAyMCkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgNDQpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICBjWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDQ4KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgNCkgPj4gMl0gfCAwKSArIDk2KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICAgICBjWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDM2KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgNCkgPj4gMl0gfCAwKSArIDkyKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICAgICBjWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDQwKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA1MikgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDQpID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwMCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgIF07XG4gICAgICAgICAgICAgICAgY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA1NikgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMjEyKSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgNCkgPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICAgICBjWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDIwOCkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMjE2KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgaSA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChpIHwgMCkgPj0gMzIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgODAgKyAoaSA8PCAyKSkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICBpID0gKGkgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAoaCArIDEwODQgKyAoKChkWyhiICsgNCkgfCAwXSB8IDApICogNDApIHwgMCkgKyAxNikgPj4gMlxuICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgIC0xXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMjI4KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChoICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbKGIgKyA0KSB8IDBdIHwgMCkgKiA0MCkgfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMjI4KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICBhW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA0KSA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTExKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjaihoLCBlKTtcbiAgICAgICAgICAgICAgICBjZihoLCBlKTtcbiAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICgoYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICgoY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA0KSA+PiAyXSB8IDApICsgMTEwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICBdICZcbiAgICAgICAgICAgICAgICAgICAgICAgIDY0KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMjIwKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMjQpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyAyMjQpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgYiA9IGg7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBlO1xuICAgICAgICAgICAgICAgICAgICBiSShiLCBpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGJKKGgsIGUpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyAzMikgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICBiSihoLCBlKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNvKGEsIGIsIGQsIGUpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGkgPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMDtcbiAgICAgICAgICAgICAgICBmID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICBiID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZTtcbiAgICAgICAgICAgICAgICBlID0gY1tiID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gY1soYiArIDQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKGUgfCAwKSA9PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIGNbKGYgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgNCkgPj4gMl0gPSBnO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGggPSBjWyhmICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBpID0gMDtcbiAgICAgICAgICAgICAgICBMMTIzMjogd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChpIHwgMCkgPj0gKGUgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhnICsgMTYpID4+IDJdIHwgMCkgPD0gKGQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soZyArIDIwKSA+PiAyXSB8IDApIDwgKGQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhnICsgMjQpID4+IDJdIHwgMCkgPiAoaCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKGcgKyAyOCkgPj4gMl0gfCAwKSA+PSAoaCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSA5Nzc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxMjMyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgIGcgPSAoZyArIDExNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpID0gKGkgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IDk3Nykge1xuICAgICAgICAgICAgICAgICAgICBjWyhmICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDQpID4+IDJdID0gZztcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBqID0gMjE0NzQ4MzY0NztcbiAgICAgICAgICAgICAgICBkID0gY1soYiArIDQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gZDtcbiAgICAgICAgICAgICAgICBiID0gZDtcbiAgICAgICAgICAgICAgICBpID0gMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGkgfCAwKSA+PSAoZSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBkID0gKChjWyhnICsgMzIpID4+IDJdIHwgMCkgLSBoKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IC1kIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGQgfCAwKSA8IChqIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGogPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgYiA9IGc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZyA9IChnICsgMTE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSAoaSArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1soZiArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA0KSA+PiAyXSA9IGI7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY3AoYSwgYikge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gK2I7XG4gICAgICAgICAgICAgICAgdmFyIGQgPSAwLFxuICAgICAgICAgICAgICAgICAgICBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMCxcbiAgICAgICAgICAgICAgICAgICAgayA9IDA7XG4gICAgICAgICAgICAgICAgZCA9IGk7XG4gICAgICAgICAgICAgICAgZSA9IGE7XG4gICAgICAgICAgICAgICAgZiA9IGI7XG4gICAgICAgICAgICAgICAgaWYgKGYgPD0gMS4wKSB7XG4gICAgICAgICAgICAgICAgICAgIGcgPSB+figrKChlICYgMjU1KSB8IDApICogZik7XG4gICAgICAgICAgICAgICAgICAgIGggPSBnO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGggfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGEgPVxuICAgICAgICAgICAgICAgICAgICAgICAgKChlICYgMjU1KSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKH5+KCsoKDEyNyAtIChlICYgMjU1KSkgfCAwKSAqIChmIC0gMS4wKSkgJiAyNTUpKSAmXG4gICAgICAgICAgICAgICAgICAgICAgICAyNTU7XG4gICAgICAgICAgICAgICAgICAgIGogPSBlICYgMjU1O1xuICAgICAgICAgICAgICAgICAgICBlID0gYSAmIDI1NTtcbiAgICAgICAgICAgICAgICAgICAgYUcoXG4gICAgICAgICAgICAgICAgICAgICAgICA0Nzg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgMTYpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gaiksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDgpID4+IDJdID0gZSksXG4gICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICBnID0gYTtcbiAgICAgICAgICAgICAgICAgICAgaCA9IGc7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaCB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY3EoZCwgZSwgZiwgZykge1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGYgfCAwO1xuICAgICAgICAgICAgICAgIGcgPSBnIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBrID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG0gPSAwLFxuICAgICAgICAgICAgICAgICAgICBuID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHAgPSAwLFxuICAgICAgICAgICAgICAgICAgICBxID0gMCxcbiAgICAgICAgICAgICAgICAgICAgciA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHMgPSAwLFxuICAgICAgICAgICAgICAgICAgICB0ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdSA9IDA7XG4gICAgICAgICAgICAgICAgaCA9IGk7XG4gICAgICAgICAgICAgICAgaSA9IChpICsgNDApIHwgMDtcbiAgICAgICAgICAgICAgICBqID0gaCB8IDA7XG4gICAgICAgICAgICAgICAgayA9IChoICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgIGwgPSAoaCArIDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgbSA9IChoICsgMjQpIHwgMDtcbiAgICAgICAgICAgICAgICBuID0gKGggKyAzMikgfCAwO1xuICAgICAgICAgICAgICAgIG8gPSBkO1xuICAgICAgICAgICAgICAgIGQgPSBlO1xuICAgICAgICAgICAgICAgIGUgPSBmO1xuICAgICAgICAgICAgICAgIGYgPSBnO1xuICAgICAgICAgICAgICAgIGNbKGQgKyAxMzA5MikgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGNbKGQgKyAxMzA5NikgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGNbKGQgKyAxMzA4NCkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChjUChvLCBuIHwgMCwgMSwgNCkgfCAwKSA9PSA0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNQKG8sIGosIDQsIDEpIHwgMCkgIT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY1tqID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbaiA+PiAyXSAmIDI1NSkgPDwgMjQpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbaiA+PiAyXSAmIDY1MjgwKSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW2ogPj4gMl0gJiAxNjcxMTY4MCkgPj4gOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tqID4+IDJdID4+IDI0KSAmIDI1NSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjNChuIHwgMCwgNDc3NiwgNCkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1tqID4+IDJdIHwgMCkgPCA2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gbztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IGs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNQKGcsIHAsIDIsIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IG87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPSBsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjUChwLCBnLCAyLCAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPSBvO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwID0gbTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1AoZywgcCwgMiwgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiW2sgPj4gMV0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoYltrID4+IDFdICYgMjU1KSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChiW2sgPj4gMV0gPj4gOCkgJiAyNTUpKSAmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA2NTUzNTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYltsID4+IDFdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGJbbCA+PiAxXSAmIDI1NSkgPDwgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoYltsID4+IDFdID4+IDgpICYgMjU1KSkgJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjU1MzU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJbbSA+PiAxXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChiW20gPj4gMV0gJiAyNTUpIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGJbbSA+PiAxXSA+PiA4KSAmIDI1NSkpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDY1NTM1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGJbbSA+PiAxXSB8IDApIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSgoKGJbbSA+PiAxXSB8IDApIC8gMjU2KSB8IDApIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYlttID4+IDFdICYgMjU1XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gYlttID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbaiA+PiAyXSB8IDApID4gNikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1EobywgKChjW2ogPj4gMl0gfCAwKSAtIDYpIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiW2sgPj4gMV0gfCAwKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiW2sgPj4gMV0gfCAwKSA+IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGQgKyAxMzA4NCkgPj4gMl0gPSBiaSgxMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbY1soZCArIDEzMDg0KSA+PiAyXSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhkICsgMTMwODQpID4+IDJdIHwgMCkgKyA1KSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGQgKyAxMzA4NCkgPj4gMl0gfCAwKSArIDgpID4+IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwID0gKGQgKyAxMzA5MikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbcCA+PiAyXSA9IChjW3AgPj4gMl0gfCAwKSArIDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IGJbayA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHAgfCAwKSA9PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAociB8IDApID49XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChiW2wgPj4gMV0gfCAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzID0gMTAyMztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNyKG8sIGQsIDApIHwgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IChyICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChzIHwgMCkgPT0gMTAyMykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3MoZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHAgfCAwKSA9PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAociB8IDApID49XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChiW2wgPj4gMV0gfCAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzID0gMTAzMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNyKG8sIGQsIDEpIHwgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IChyICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChzIHwgMCkgPT0gMTAzMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3MoZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHAgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNyKG8sIGQsIDApIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3MoZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gY3QoZCwgcSwgZSwgZikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1IHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gdDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1IHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgdSA9IHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gaDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1IHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIHQgPSAwO1xuICAgICAgICAgICAgICAgIHUgPSB0O1xuICAgICAgICAgICAgICAgIGkgPSBoO1xuICAgICAgICAgICAgICAgIHJldHVybiB1IHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNyKGEsIGIsIGQpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBrID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG0gPSAwLFxuICAgICAgICAgICAgICAgICAgICBuID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbyA9IDA7XG4gICAgICAgICAgICAgICAgZSA9IGk7XG4gICAgICAgICAgICAgICAgaSA9IChpICsgMTYpIHwgMDtcbiAgICAgICAgICAgICAgICBmID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgZyA9IChlICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgIGggPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBjWyhhICsgMTMwODQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gMTA0NztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhiICsgOCkgPj4gMl0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID0gY1soYiArIDgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKGEgKyAxMzA5NikgPj4gMl0gPSBjW2IgPj4gMl07XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBqID0gMTA0NztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IDEwNDcpIHtcbiAgICAgICAgICAgICAgICAgICAgY1soYSArIDEzMDk2KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChjUChoLCBnIHwgMCwgMSwgNCkgfCAwKSA9PSA0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNQKGgsIGYsIDQsIDEpIHwgMCkgIT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY1tmID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbZiA+PiAyXSAmIDI1NSkgPDwgMjQpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbZiA+PiAyXSAmIDY1MjgwKSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW2YgPj4gMl0gJiAxNjcxMTY4MCkgPj4gOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tmID4+IDJdID4+IDI0KSAmIDI1NSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGM0KGcgfCAwLCA2MjcyLCA0KSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gLTI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IGs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGwgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gY3YoaCwgYSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IDEwNTU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG0gfCAwKSA9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gMTA1NztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSBjWyhiICsgOCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG4gPSAoY1tkID4+IDJdIHwgMCkgPCAoY1ttID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW4pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gY1soYiArIDgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sobSArIDgpID4+IDJdID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhiICsgOCkgPj4gMl0gPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8gPSAoYSArIDEzMDkyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tvID4+IDJdID0gKGNbbyA+PiAyXSB8IDApICsgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID0gbTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IDEwNTUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gLTI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IGs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGwgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoaiB8IDApID09IDEwNTcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbCB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICBrID0gLTE7XG4gICAgICAgICAgICAgICAgbCA9IGs7XG4gICAgICAgICAgICAgICAgaSA9IGU7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGwgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY3MoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgYiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGQgPSAwO1xuICAgICAgICAgICAgICAgIGIgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBjWyhiICsgMTMwODQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gYTtcbiAgICAgICAgICAgICAgICBpZiAoKGEgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChkIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYSA9IGNbKGQgKyA4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGMwKGQpO1xuICAgICAgICAgICAgICAgICAgICBkID0gYTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1soYiArIDEzMDg0KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY3QoYiwgZSwgZiwgZykge1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGYgfCAwO1xuICAgICAgICAgICAgICAgIGcgPSBnIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBrID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG0gPSAwLFxuICAgICAgICAgICAgICAgICAgICBuID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHAgPSAwLFxuICAgICAgICAgICAgICAgICAgICBxID0gMCxcbiAgICAgICAgICAgICAgICAgICAgciA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHMgPSAwLFxuICAgICAgICAgICAgICAgICAgICB0ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHYgPSAwLFxuICAgICAgICAgICAgICAgICAgICB3ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgeCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHkgPSAwLFxuICAgICAgICAgICAgICAgICAgICB6ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgQSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEIgPSAwO1xuICAgICAgICAgICAgICAgIGggPSBpO1xuICAgICAgICAgICAgICAgIGkgPSAoaSArIDE5MikgfCAwO1xuICAgICAgICAgICAgICAgIGogPSBoIHwgMDtcbiAgICAgICAgICAgICAgICBrID0gKGggKyA2NCkgfCAwO1xuICAgICAgICAgICAgICAgIGwgPSAoaCArIDEyOCkgfCAwO1xuICAgICAgICAgICAgICAgIG0gPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBlO1xuICAgICAgICAgICAgICAgIGUgPSBmO1xuICAgICAgICAgICAgICAgIGYgPSBnO1xuICAgICAgICAgICAgICAgIGcgPSAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApID49IDE2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjWyhqICsgKGcgPDwgMikpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgY1soayArIChnIDw8IDIpKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbKGwgKyAoZyA8PCAyKSkgPj4gMl0gPSBjWyhtICsgMTA1NikgPj4gMl07XG4gICAgICAgICAgICAgICAgICAgIGcgPSAoZyArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbiA9IDVlNTtcbiAgICAgICAgICAgICAgICBjdShtLCBuLCBiKTtcbiAgICAgICAgICAgICAgICBvID0gYmkoKChjWyhtICsgMTMwOTIpID4+IDJdIHwgMCkgKyAxKSA8PCAzKSB8IDA7XG4gICAgICAgICAgICAgICAgcCA9IG87XG4gICAgICAgICAgICAgICAgcSA9IG87XG4gICAgICAgICAgICAgICAgbyA9IGNbKG0gKyAxMzA4NCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIHIgPSAwO1xuICAgICAgICAgICAgICAgIHMgPSAwO1xuICAgICAgICAgICAgICAgIHQgPSAwO1xuICAgICAgICAgICAgICAgIHUgPSAwO1xuICAgICAgICAgICAgICAgIHYgPSAwO1xuICAgICAgICAgICAgICAgIGcgPSAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApID49IChjWyhtICsgMTMwOTIpID4+IDJdIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHcgPSAwO1xuICAgICAgICAgICAgICAgICAgICB4ID0gZFsobyArIDUpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHggfCAwKSA9PSA5KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKG0gKyAxMzA1NikgPj4gMl0gJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDEgPDwgKGRbKG8gKyA0KSB8IDBdIHwgMCkpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTQwICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChkWyhvICsgNikgfCAwXSB8IDApIDw8IDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHkgPSBkWyhvICsgNikgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhWyhvICsgNikgfCAwXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1soayArICgoZFsobyArIDQpIHwgMF0gfCAwKSA8PCAyKSkgPj4gMl0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoeSB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoayArICgoZFsobyArIDQpIHwgMF0gfCAwKSA8PCAyKSkgPj4gMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IHk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHkgPSBkWyhvICsgNikgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGwgKyAoKGRbKG8gKyA0KSB8IDBdIHwgMCkgPDwgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChkWyhvICsgNCkgfCAwXSB8IDApIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoeSB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHogPSAxMDk2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGwgKyAoKGRbKG8gKyA0KSB8IDBdIHwgMCkgPDwgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IHk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHogPSAxMDk2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh6IHwgMCkgPT0gMTA5Nikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHggfCAwKSA9PSAxNSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhtICsgMTMwNTYpID4+IDJdICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgxIDw8IChkWyhvICsgNCkgfCAwXSB8IDApKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobSArIDI4ICsgKChkWyhvICsgNikgfCAwXSB8IDApIDw8IDIpKSA+PiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5ID0gZFsobyArIDYpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbKG8gKyA2KSB8IDBdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGogKyAoKGRbKG8gKyA0KSB8IDBdIHwgMCkgPDwgMikpID4+IDJdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh5IHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soaiArICgoZFsobyArIDQpIHwgMF0gfCAwKSA8PCAyKSkgPj4gMl0gPSB5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgPSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHggfCAwKSA9PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh2IHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKG0gKyAxMzA1NikgPj4gMl0gJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDEgPDwgKGRbKG8gKyA0KSB8IDBdIHwgMCkpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG0gK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTQwICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChrICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChkWyhvICsgNCkgfCAwXSB8IDApIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGRbKG8gKyA2KSB8IDBdIHwgMCkgPDwgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDU0MCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoayArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZFsobyArIDQpIHwgMF0gfCAwKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChkWyhvICsgNikgfCAwXSB8IDApIDw8IDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1sobCArICgoZFsobyArIDQpIHwgMF0gfCAwKSA8PCAyKSkgPj4gMl0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG0gK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjggK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGogK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGRbKG8gKyA0KSB8IDBdIHwgMCkgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGwgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZFsobyArIDQpIHwgMF0gfCAwKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZFsobyArIDQpIHwgMF0gfCAwKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChkWyhvICsgNCkgfCAwXSB8IDApIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSAtMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgIHggPSAoKGNbbyA+PiAyXSB8IDApIC0gdCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBBID0geDtcbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh4IHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodiB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IDExMjU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCID0gXyhjWyhtICsgMTA3NikgPj4gMl0gfCAwLCBBKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IChzICsgKF8oY1sobSArIDEwODApID4+IDJdIHwgMCwgQSkgfCAwKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKHMgJiAtNjU1MzYpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCID0gKEIgKyAoKHMgPj4gMTYpICYgNjU1MzUpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPSBzICYgNjU1MzU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSAodSArIEIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IDExMjU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKHogfCAwKSA9PSAxMTI1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB6ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodiB8IDApID09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGRbKG8gKyA1KSB8IDBdIHwgMCB8IDApID09IDEwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGRbKG8gKyA0KSB8IDBdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGRbKG8gKyA3KSB8IDBdIHwgMCkgPDwgOCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGRbKG8gKyA2KSB8IDBdIHwgMCkgPDwgMTYpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGN1KG0sIG4sIGIpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgodyB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIEEgPSBwO1xuICAgICAgICAgICAgICAgICAgICAgICAgeCA9IG8gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tBID4+IDJdID0gY1t4ID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1soQSArIDQpID4+IDJdID0gY1soeCArIDQpID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1twID4+IDJdID0gdTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHAgPSAocCArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHIgPSAociArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0ID0gY1tvID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgbyA9IGNbKG8gKyA4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGcgPSAoZyArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1twID4+IDJdID0gdTtcbiAgICAgICAgICAgICAgICBhWyhwICsgNSkgfCAwXSA9IDk5O1xuICAgICAgICAgICAgICAgIHIgPSAociArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICBjcyhtKTtcbiAgICAgICAgICAgICAgICBjW2UgPj4gMl0gPSByO1xuICAgICAgICAgICAgICAgIGNbZiA+PiAyXSA9IHU7XG4gICAgICAgICAgICAgICAgaSA9IGg7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHEgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY3UoYSwgYiwgZCkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDAuMDtcbiAgICAgICAgICAgICAgICBlID0gYTtcbiAgICAgICAgICAgICAgICBmID0gKCsoYiB8IDApICogKyhjWyhlICsgNCkgPj4gMl0gfCAwKSAqIDAuMDY1NTM2KSAvICsoZCB8IDApO1xuICAgICAgICAgICAgICAgIGNbKGUgKyAxMDgwKSA+PiAyXSA9IH5+ZiAmIDY1NTM1O1xuICAgICAgICAgICAgICAgIGNbKGUgKyAxMDc2KSA+PiAyXSA9IH5+ZiA+PiAxNjtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjdihiLCBlKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBlIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGcgPSAwLFxuICAgICAgICAgICAgICAgICAgICBoID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwLFxuICAgICAgICAgICAgICAgICAgICBvID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHEgPSAwLFxuICAgICAgICAgICAgICAgICAgICByID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHQgPSAwLFxuICAgICAgICAgICAgICAgICAgICB1ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdiA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IGk7XG4gICAgICAgICAgICAgICAgaSA9IChpICsgNDApIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gZiB8IDA7XG4gICAgICAgICAgICAgICAgaCA9IChmICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgIGogPSAoZiArIDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgayA9IChmICsgMjQpIHwgMDtcbiAgICAgICAgICAgICAgICBsID0gKGYgKyAzMikgfCAwO1xuICAgICAgICAgICAgICAgIG0gPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBlO1xuICAgICAgICAgICAgICAgIEwxNDQyOiB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBlID0gY3cobSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBuID0gKGIgKyAxMzA5NikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW24gPj4gMl0gPSAoY1tuID4+IDJdIHwgMCkgKyBlO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGNQKG0sIGcsIDEsIDEpIHwgMCkgIT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbyA9IDExMzg7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGRbZ10gfCAwKSA9PSAyNDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvID0gMTE0MTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChkW2ddIHwgMCkgPT0gMjQ3KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8gPSAxMTQxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChkW2ddIHwgMCkgPT0gMjU1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjUChlLCBoLCAxLCAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBjdyhtKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZFtoXSB8IDApID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZFtoXSB8IDApID49IDE2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8gPSAxMTQ2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA9IG07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbiA9IHA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IGFbaF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN4KGUsIG4sIHEsIHIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IDExNDY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG8gfCAwKSA9PSAxMTQ2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBkW2hdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgociB8IDApID09IDQ3KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IDExNDc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE0NDI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChyIHwgMCkgPT0gODEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvID0gMTE0ODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTQ0MjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNRKG0sIHApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVtqXSA9IGFbZ10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChhW2pdICYgMTI4KSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbNjYzMl0gPSBkW2pdICYgMTU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhWzY2MjRdID0gKGRbal0gPj4gNCkgJiA3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IG07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjUChyLCBqLCAxLCAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhW2pdID0gZFtqXSAmIDEyNztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGRbNjYyNF0gfCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvID0gMTE1NjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTQ0MjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8gPSAxMTg4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxNDQyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA0OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IDExODY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE0NDI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDU6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8gPSAxMTU1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxNDQyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAyOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IDExNTc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE0NDI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDM6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjUChtLCBrLCAxLCAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVtrXSA9IGRba10gJiAxMjc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IDI1NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMMTQ2NjogZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGRbal0gfCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDk4OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVs2NjE2XSA9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDY2MDAgKyAoZFs2NjMyXSB8IDApKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGFba10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA2OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhWzY2MTZdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTQ2NjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDY1ODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWzY2MzJdIHwgMCkpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICg2NjAwICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFs2NjMyXSB8IDApKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgociB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IDExO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChyIHwgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzI2MzlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IDExNzk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxNDQyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPSA0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPSA1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPSA3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA2NDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPSA2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMjA6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzID0gMTI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDEyMToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPSAxMztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTIzOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IDE0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IDE1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAzMjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZFtrXSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IDE1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTAwOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVs2NjE2XSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDY1ODQgKyAoZFs2NjMyXSB8IDApKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGFba10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMDE6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhWzY2MTZdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNjYwMCArIChkWzY2MzJdIHwgMCkpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gYVtrXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDk5OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVs2NjE2XSA9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDY1ODQgKyAoZFs2NjMyXSB8IDApKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGFba10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChzIHwgMCkgIT0gMjU1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8gPSAxMTg0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTQ0MjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKG8gfCAwKSA9PSAxMTQxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBjdyhtKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjUShtLCBwKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKG8gfCAwKSA9PSAxMTg0KSB7XG4gICAgICAgICAgICAgICAgICAgIHQgPSBiaSgxMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW3QgPj4gMl0gPSBjWyhiICsgMTMwOTYpID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNSkgfCAwXSA9IHMgJiAyNTU7XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA0KSB8IDBdID0gYVs2NjMyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA2KSB8IDBdID0gYVtrXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA3KSB8IDBdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgY1sodCArIDgpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgdSA9IHQ7XG4gICAgICAgICAgICAgICAgICAgIHYgPSB1O1xuICAgICAgICAgICAgICAgICAgICBpID0gZjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHYgfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKG8gfCAwKSA9PSAxMTU2KSB7XG4gICAgICAgICAgICAgICAgICAgIGNQKG0sIGssIDEsIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYVtrXSA9IGRba10gJiAxMjc7XG4gICAgICAgICAgICAgICAgICAgIHQgPSBiaSgxMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW3QgPj4gMl0gPSBjWyhiICsgMTMwOTYpID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNSkgfCAwXSA9IDE7XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA0KSB8IDBdID0gYVs2NjMyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA2KSB8IDBdID0gYVtqXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA3KSB8IDBdID0gYVtrXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbKHQgKyA4KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHUgPSB0O1xuICAgICAgICAgICAgICAgICAgICB2ID0gdTtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGY7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2IHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChvIHwgMCkgPT0gMTE3OSkge1xuICAgICAgICAgICAgICAgICAgICB0ID0gYmkoMTIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1t0ID4+IDJdID0gY1soYiArIDEzMDk2KSA+PiAyXTtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDUpIHwgMF0gPSAxMTtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDQpIHwgMF0gPSBhWzY2MzJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDYpIHwgMF0gPSAyO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNykgfCAwXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbKHQgKyA4KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHUgPSB0O1xuICAgICAgICAgICAgICAgICAgICB2ID0gdTtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGY7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2IHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChvIHwgMCkgPT0gMTEzOCkge1xuICAgICAgICAgICAgICAgICAgICB1ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgdiA9IHU7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBmO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdiB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgobyB8IDApID09IDExODgpIHtcbiAgICAgICAgICAgICAgICAgICAgY1AobSwgaywgMSwgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBhW2tdID0gZFtrXSAmIDEyNztcbiAgICAgICAgICAgICAgICAgICAgdCA9IGJpKDEyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbdCA+PiAyXSA9IGNbKGIgKyAxMzA5NikgPj4gMl07XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA1KSB8IDBdID0gODtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDQpIHwgMF0gPSBhWzY2MzJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDYpIHwgMF0gPSBhW2pdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDcpIHwgMF0gPSBhW2tdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1sodCArIDgpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgdSA9IHQ7XG4gICAgICAgICAgICAgICAgICAgIHYgPSB1O1xuICAgICAgICAgICAgICAgICAgICBpID0gZjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHYgfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKG8gfCAwKSA9PSAxMTg2KSB7XG4gICAgICAgICAgICAgICAgICAgIGFbal0gPSBkW2pdICYgMTI3O1xuICAgICAgICAgICAgICAgICAgICB0ID0gYmkoMTIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1t0ID4+IDJdID0gY1soYiArIDEzMDk2KSA+PiAyXTtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDUpIHwgMF0gPSA5O1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNCkgfCAwXSA9IGFbNjYzMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNikgfCAwXSA9IGFbal0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNykgfCAwXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbKHQgKyA4KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHUgPSB0O1xuICAgICAgICAgICAgICAgICAgICB2ID0gdTtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGY7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2IHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChvIHwgMCkgPT0gMTE0Nykge1xuICAgICAgICAgICAgICAgICAgICB1ID0gLTE7XG4gICAgICAgICAgICAgICAgICAgIHYgPSB1O1xuICAgICAgICAgICAgICAgICAgICBpID0gZjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHYgfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKG8gfCAwKSA9PSAxMTQ4KSB7XG4gICAgICAgICAgICAgICAgICAgIGNQKG0sIGosIDEsIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1AobSwgaywgMSwgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjUChtLCBsLCAxLCAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHQgPSBiaSgxMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW3QgPj4gMl0gPSBjWyhiICsgMTMwOTYpID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNSkgfCAwXSA9IDEwO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNCkgfCAwXSA9IGFbbF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNikgfCAwXSA9IGFbal0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNykgfCAwXSA9IGFba10gfCAwO1xuICAgICAgICAgICAgICAgICAgICBjWyh0ICsgOCkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICB1ID0gdDtcbiAgICAgICAgICAgICAgICAgICAgdiA9IHU7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBmO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdiB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgobyB8IDApID09IDExNTUpIHtcbiAgICAgICAgICAgICAgICAgICAgY1AobSwgaywgMSwgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBhW2tdID0gZFtrXSAmIDEyNztcbiAgICAgICAgICAgICAgICAgICAgdCA9IGJpKDEyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbdCA+PiAyXSA9IGNbKGIgKyAxMzA5NikgPj4gMl07XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA1KSB8IDBdID0gMjtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDQpIHwgMF0gPSBhWzY2MzJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDYpIHwgMF0gPSBhW2pdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDcpIHwgMF0gPSBhW2tdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1sodCArIDgpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgdSA9IHQ7XG4gICAgICAgICAgICAgICAgICAgIHYgPSB1O1xuICAgICAgICAgICAgICAgICAgICBpID0gZjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHYgfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKG8gfCAwKSA9PSAxMTU3KSB7XG4gICAgICAgICAgICAgICAgICAgIGNQKG0sIGssIDEsIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYVtrXSA9IGRba10gJiAxMjc7XG4gICAgICAgICAgICAgICAgICAgIHQgPSBiaSgxMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW3QgPj4gMl0gPSBjWyhiICsgMTMwOTYpID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNSkgfCAwXSA9IDM7XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA0KSB8IDBdID0gYVs2NjMyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA2KSB8IDBdID0gYVtqXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA3KSB8IDBdID0gYVtrXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbKHQgKyA4KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHUgPSB0O1xuICAgICAgICAgICAgICAgICAgICB2ID0gdTtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGY7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2IHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjdyhiKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBjID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwO1xuICAgICAgICAgICAgICAgIGMgPSBpO1xuICAgICAgICAgICAgICAgIGkgPSAoaSArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gYyB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGI7XG4gICAgICAgICAgICAgICAgYiA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgY1AoZSwgZCwgMSwgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBiID0gKGIgKyAoYVtkXSAmIDEyNykpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCgoYVtkXSAmIDEyOCkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBiID0gYiA8PCA3O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpID0gYztcbiAgICAgICAgICAgICAgICByZXR1cm4gYiB8IDA7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGN4KGIsIGUsIGYsIGcpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gZyB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwO1xuICAgICAgICAgICAgICAgIGggPSBlO1xuICAgICAgICAgICAgICAgIGUgPSBmO1xuICAgICAgICAgICAgICAgIGYgPSBnO1xuICAgICAgICAgICAgICAgIGcgPSBiaSgoaCArIDEpIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoaCB8IDApICE9IChjUChiLCBnLCAxLCBoKSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgIGMwKGcpO1xuICAgICAgICAgICAgICAgICAgICBpID0gLTE7XG4gICAgICAgICAgICAgICAgICAgIGogPSBpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaiB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGFbKGcgKyBoKSB8IDBdID0gMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBiID0gaDtcbiAgICAgICAgICAgICAgICAgICAgaCA9IChiIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGRbKGcgKyBoKSB8IDBdIHwgMCB8IDApIDwgMzIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFbKGcgKyBoKSB8IDBdID0gNDY7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaCA9IGUgJiAyNTU7XG4gICAgICAgICAgICAgICAgaWYgKChoIHwgMCkgPT0gMSkge1xuICAgICAgICAgICAgICAgICAgICBrID0gMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChoIHwgMCkgPT0gMikge1xuICAgICAgICAgICAgICAgICAgICBrID0gMTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBjMChnKTtcbiAgICAgICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoZyB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhmICsgMTMxMDQgKyAoayA8PCAyKSkgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjMChjWyhmICsgMTMxMDQgKyAoayA8PCAyKSkgPj4gMl0gfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjWyhmICsgMTMxMDQgKyAoayA8PCAyKSkgPj4gMl0gPSBnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpID0gMDtcbiAgICAgICAgICAgICAgICBqID0gaTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaiB8IDA7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGN5KGIsIGUsIGYpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwO1xuICAgICAgICAgICAgICAgIGcgPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBlO1xuICAgICAgICAgICAgICAgIGUgPSBmO1xuICAgICAgICAgICAgICAgIGYgPSAoZyArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkpIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKGNbKChjWyhmICsgNCkgPj4gMl0gfCAwKSArIDEyKSA+PiAyXSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgaCA9IGNbKGYgKyAxNikgPj4gMl0gPj4gMTI7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIChjW2UgPj4gMl0gfCAwKSA+PVxuICAgICAgICAgICAgICAgICAgICAgICAgKCgoY1soKGNbKGYgKyA0KSA+PiAyXSB8IDApICsgOCkgPj4gMl0gPj4gMTIpIC0gaCkgfCAwKVxuICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFbZiB8IDBdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbZSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbKChjWyhmICsgNCkgPj4gMl0gfCAwKSArIDgpID4+IDJdID4+IDEyKSAtIGg7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gKGYgKyAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tpID4+IDJdID0gKGNbaSA+PiAyXSB8IDApICsgKGNbZSA+PiAyXSA8PCAxMik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAoKGNbKChjWyhmICsgNCkgPj4gMl0gfCAwKSArIDg4KSA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaCA8PCAxKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgayA9IGo7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBrIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaCA9IGFbKChjWyhmICsgNCkgPj4gMl0gfCAwKSArIDExMCkgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKChjWyhmICsgMjEyKSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgTDE1NzU6IGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKGggJiA0KSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKGggJiA2NCkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGRbZiB8IDBdIHwgMCB8IDApID09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZFtmIHwgMF0gfCAwIHwgMCkgIT0gMikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxNTc1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoaCAmIDgpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gY3ooZywgZiwgY1tlID4+IDJdIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGsgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSBjQShnLCBmLCBjW2UgPj4gMl0gfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gayB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgaiA9IGNCKGcsIGIsIGUpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgayA9IGo7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBrIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBMMTU2MTogZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoaCAmIDQpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoaCAmIDY0KSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZFtmIHwgMF0gfCAwIHwgMCkgPT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChkW2YgfCAwXSB8IDAgfCAwKSAhPSAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE1NjE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChoICYgOCkgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSBjQyhnLCBmLCBjW2UgPj4gMl0gfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gayB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IGNEKGcsIGYsIGNbZSA+PiAyXSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgayA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBrIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICBqID0gY0UoZywgYiwgZSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBrID0gajtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGsgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGN6KGEsIGQsIGUpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBlIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGcgPSAwLFxuICAgICAgICAgICAgICAgICAgICBoID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBrID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG0gPSAwLFxuICAgICAgICAgICAgICAgICAgICBuID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHAgPSAwLFxuICAgICAgICAgICAgICAgICAgICBxID0gMCxcbiAgICAgICAgICAgICAgICAgICAgciA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHMgPSAwLFxuICAgICAgICAgICAgICAgICAgICB0ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdSA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGNbKGEgKyAxNikgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGcgPSBjWyhhICsgMjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBoID0gY1soKGNbKGEgKyA0KSA+PiAyXSB8IDApICsgNCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGkgPSBjW2NbKGEgKyA0KSA+PiAyXSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaiA9IGNbKGYgKyAxMDY4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgayA9IGNbKChjWyhhICsgNCkgPj4gMl0gfCAwKSArIDg4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgbCA9IGNbKGEgKyAyMTYpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBtID0gaCA8PCAxO1xuICAgICAgICAgICAgICAgIG4gPSBpIDw8IDE7XG4gICAgICAgICAgICAgICAgbyA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChkIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcCA9IChlIHwgMCkgPD0gKGkgfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHAgPSAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICghcCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcSA9ICgoKCgoaSAtIGUpIHwgMCkgLyAoZyB8IDApKSB8IDApICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKHEgfCAwKSA+IChkIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBkO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgocSB8IDApID4gKGwgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcSA9IGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gMTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGwgPSAobCAtIHEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBkID0gKGQgLSBxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByID0gcTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAociAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgociB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHMgPSBiWyhrICsgKChlID4+IDEyKSA8PCAxKSkgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgdCA9IGJbKGsgKyAoKChlID4+IDEyKSArIDEpIDw8IDEpKSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICByID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgIGogPSAociArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJbciA+PiAxXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgocyA8PCAxNikgPj4gMTYpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChfKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgodCA8PCAxNikgPj4gMTYpIC0gKChzIDw8IDE2KSA+PiAxNikpIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgJiA0MDk1XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPj4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMikpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA2NTUzNTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAoZSArIGcpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKG8gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gY1soYSArIDIxMikgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IGNHKGYsIGEsIDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG8gPSAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGg7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB1ID0gaTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBxID0gKCgoKCh1IC0gZSkgfCAwKSAvIChnIHwgMCkpIHwgMCkgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgocSB8IDApID4gKGQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChxIHwgMCkgPiAobCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBxID0gbDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG8gPSAxO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgbCA9IChsIC0gcSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGQgPSAoZCAtIHEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBxO1xuICAgICAgICAgICAgICAgICAgICAgICAgcSA9IChwIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChwIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgcyA9IGJbKGsgKyAoKGUgPj4gMTIpIDw8IDEpKSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ID0gYlsoayArICgoKGUgPj4gMTIpICsgMSkgPDwgMSkpID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgaiA9IChwICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgYltwID4+IDFdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChzIDw8IDE2KSA+PiAxNikgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKF8oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKCh0IDw8IDE2KSA+PiAxNikgLSAoKHMgPDwgMTYpID4+IDE2KSkgfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZSAmIDQwOTVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyKSkgJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDY1NTM1O1xuICAgICAgICAgICAgICAgICAgICAgICAgZSA9IChlICsgZykgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgobyB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBjWyhhICsgMjEyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBnID0gY0coZiwgYSwgKChnIHwgMCkgPCAwKSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG8gPSAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZSB8IDApID49IChoIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAobSAtIGUpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGcgPSAoZyAqIC0xKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGUgfCAwKSA8PSAoaSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA9IChuIC0gZSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPSAoZyAqIC0xKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1soYSArIDIxNikgPj4gMl0gPSBsO1xuICAgICAgICAgICAgICAgIGNbKGEgKyAyMCkgPj4gMl0gPSBnO1xuICAgICAgICAgICAgICAgIGNbKGEgKyAxNikgPj4gMl0gPSBlO1xuICAgICAgICAgICAgICAgIHJldHVybiBjWyhmICsgMTA2OCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY0EoYSwgZCwgZSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwLFxuICAgICAgICAgICAgICAgICAgICBvID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcCA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGNbKGEgKyAxNikgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGcgPSBjWyhhICsgMjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBoID0gY1soKGNbKGEgKyA0KSA+PiAyXSB8IDApICsgNCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGkgPSAoaCAtIChjW2NbKGEgKyA0KSA+PiAyXSA+PiAyXSB8IDApKSB8IDA7XG4gICAgICAgICAgICAgICAgaiA9IGNbKGYgKyAxMDY4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgayA9IGNbKChjWyhhICsgNCkgPj4gMl0gfCAwKSArIDg4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgbCA9IGNbKGEgKyAyMTYpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBtID0gMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGQgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGUgfCAwKSA+PSAoaCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gKGUgLSBpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbiA9ICgoKCgoaCAtIGUpIHwgMCkgLyAoZyB8IDApKSB8IDApICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKG4gfCAwKSA+IChkIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSBkO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgobiB8IDApID4gKGwgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbiA9IGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBtID0gMTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGwgPSAobCAtIG4pIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBkID0gKGQgLSBuKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gbjtcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSAobyAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobyB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIG8gPSBiWyhrICsgKChlID4+IDEyKSA8PCAxKSkgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgcCA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICBqID0gKHAgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBiW3AgPj4gMV0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKG8gPDwgMTYpID4+IDE2KSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoXyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoYlsoayArICgoKGUgPj4gMTIpICsgMSkgPDwgMSkpID4+IDFdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAtXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChvIDw8IDE2KSA+PiAxNikpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZSAmIDQwOTVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyKSkgJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDY1NTM1O1xuICAgICAgICAgICAgICAgICAgICAgICAgZSA9IChlICsgZykgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgobSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBjWyhhICsgMjEyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBnID0gY0coZiwgYSwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgbSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1soYSArIDIxNikgPj4gMl0gPSBsO1xuICAgICAgICAgICAgICAgIGNbKGEgKyAyMCkgPj4gMl0gPSBnO1xuICAgICAgICAgICAgICAgIGNbKGEgKyAxNikgPj4gMl0gPSBlO1xuICAgICAgICAgICAgICAgIHJldHVybiBjWyhmICsgMTA2OCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY0IoZCwgZSwgZikge1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGYgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBnID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGkgPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMCxcbiAgICAgICAgICAgICAgICAgICAgayA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGwgPSAwLFxuICAgICAgICAgICAgICAgICAgICBtID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG8gPSAwLFxuICAgICAgICAgICAgICAgICAgICBwID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBzID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHUgPSAwLFxuICAgICAgICAgICAgICAgICAgICB2ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHggPSAwLFxuICAgICAgICAgICAgICAgICAgICB5ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgeiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEEgPSAwLFxuICAgICAgICAgICAgICAgICAgICBCID0gMDtcbiAgICAgICAgICAgICAgICBnID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZjtcbiAgICAgICAgICAgICAgICBmID0gKGcgKyAxNzI0ICsgKChlICogMjM2KSB8IDApKSB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGNbKGcgKyAxMDY4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaCA9IGNbKChjWyhmICsgNCkgPj4gMl0gfCAwKSArIDg4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaSA9IGNbKChjWyhmICsgNCkgPj4gMl0gfCAwKSArIDgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBqID0gY1soZiArIDE2KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgayA9IGNbKGYgKyAyMCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGwgPSBjW2QgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIG0gPSBjWyhmICsgMjE2KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGsgPSAtayB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgbiA9IGw7XG4gICAgICAgICAgICAgICAgICAgIGwgPSAobiAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChuIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbyA9IDEzMjI7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBuID0gbTtcbiAgICAgICAgICAgICAgICAgICAgbSA9IChuIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKG4gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtID0gY1soZiArIDIxMikgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgayA9IGNHKGcsIGYsIDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBuID0gYlsoaCArICgoaiA+PiAxMikgPDwgMSkpID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgcCA9IGU7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAocCArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYltwID4+IDFdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICgoKG4gPDwgMTYpID4+IDE2KSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChfKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGJbKGggKyAoKChqID4+IDEyKSArIDEpIDw8IDEpKSA+PiAxXSB8IDApIC1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgobiA8PCAxNikgPj4gMTYpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqICYgNDA5NVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIpKSAmXG4gICAgICAgICAgICAgICAgICAgICAgICA2NTUzNTtcbiAgICAgICAgICAgICAgICAgICAgaiA9IChqICsgaykgfCAwO1xuICAgICAgICAgICAgICAgIH0gd2hpbGUgKChqIHwgMCkgPCAoaSB8IDApKTtcbiAgICAgICAgICAgICAgICBpZiAoKG8gfCAwKSA9PSAxMzIyKSB7XG4gICAgICAgICAgICAgICAgICAgIHEgPSBtO1xuICAgICAgICAgICAgICAgICAgICByID0gZjtcbiAgICAgICAgICAgICAgICAgICAgcyA9IChyICsgMjE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbcyA+PiAyXSA9IHE7XG4gICAgICAgICAgICAgICAgICAgIHQgPSBrO1xuICAgICAgICAgICAgICAgICAgICB1ID0gZjtcbiAgICAgICAgICAgICAgICAgICAgdiA9ICh1ICsgMjApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1t2ID4+IDJdID0gdDtcbiAgICAgICAgICAgICAgICAgICAgdyA9IGo7XG4gICAgICAgICAgICAgICAgICAgIHggPSBmO1xuICAgICAgICAgICAgICAgICAgICB5ID0gKHggKyAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW3kgPj4gMl0gPSB3O1xuICAgICAgICAgICAgICAgICAgICB6ID0gZztcbiAgICAgICAgICAgICAgICAgICAgQSA9ICh6ICsgMTA2OCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBCID0gY1tBID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEIgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKGogfCAwKSA9PSAoaSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBlO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGkgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGJbaSA+PiAxXSA9IGJbKGggKyAoKGogPj4gMTIpIDw8IDEpKSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGFbZiB8IDBdID0gMDtcbiAgICAgICAgICAgICAgICBoID0gZDtcbiAgICAgICAgICAgICAgICBjW2ggPj4gMl0gPSAoY1toID4+IDJdIHwgMCkgLSAobCArIDEpO1xuICAgICAgICAgICAgICAgIHEgPSBtO1xuICAgICAgICAgICAgICAgIHIgPSBmO1xuICAgICAgICAgICAgICAgIHMgPSAociArIDIxNikgfCAwO1xuICAgICAgICAgICAgICAgIGNbcyA+PiAyXSA9IHE7XG4gICAgICAgICAgICAgICAgdCA9IGs7XG4gICAgICAgICAgICAgICAgdSA9IGY7XG4gICAgICAgICAgICAgICAgdiA9ICh1ICsgMjApIHwgMDtcbiAgICAgICAgICAgICAgICBjW3YgPj4gMl0gPSB0O1xuICAgICAgICAgICAgICAgIHcgPSBqO1xuICAgICAgICAgICAgICAgIHggPSBmO1xuICAgICAgICAgICAgICAgIHkgPSAoeCArIDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgY1t5ID4+IDJdID0gdztcbiAgICAgICAgICAgICAgICB6ID0gZztcbiAgICAgICAgICAgICAgICBBID0gKHogKyAxMDY4KSB8IDA7XG4gICAgICAgICAgICAgICAgQiA9IGNbQSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEIgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY0MoYSwgZCwgZSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwLFxuICAgICAgICAgICAgICAgICAgICBvID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHEgPSAwLFxuICAgICAgICAgICAgICAgICAgICByID0gMDtcbiAgICAgICAgICAgICAgICBmID0gYTtcbiAgICAgICAgICAgICAgICBhID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZTtcbiAgICAgICAgICAgICAgICBlID0gY1soYSArIDE2KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgZyA9IGNbKGEgKyAyMCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGggPSBjWygoY1soYSArIDQpID4+IDJdIHwgMCkgKyA0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaSA9IGNbY1soYSArIDQpID4+IDJdID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBqID0gY1soZiArIDEwNjgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBrID0gY1soKGNbKGEgKyA0KSA+PiAyXSB8IDApICsgODgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBsID0gaCA8PCAxO1xuICAgICAgICAgICAgICAgIG0gPSBpIDw8IDE7XG4gICAgICAgICAgICAgICAgaWYgKChlIHwgMCkgPD0gKGkgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICBuID0gKCgoKChpIC0gZSkgfCAwKSAvIChnIHwgMCkpIHwgMCkgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgobiB8IDApID4gKGQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbiA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gMDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZCAtIG4pIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbyA9IG47XG4gICAgICAgICAgICAgICAgICAgICAgICBuID0gKG8gLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG8gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBwID0gYlsoayArICgoZSA+PiAxMikgPDwgMSkpID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBiWyhrICsgKCgoZSA+PiAxMikgKyAxKSA8PCAxKSkgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgbyA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICBqID0gKG8gKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBiW28gPj4gMV0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKHAgPDwgMTYpID4+IDE2KSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoXyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKHEgPDwgMTYpID4+IDE2KSAtICgocCA8PCAxNikgPj4gMTYpKSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlICYgNDA5NVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIpKSAmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgNjU1MzU7XG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gKGUgKyBnKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChkIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByID0gaDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIG4gPSAoKCgoKHIgLSBlKSB8IDApIC8gKGcgfCAwKSkgfCAwKSArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChuIHwgMCkgPiAoZCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAwO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChkIC0gbikgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gbjtcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSAobyAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobyB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBiWyhrICsgKChlID4+IDEyKSA8PCAxKSkgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgcSA9IGJbKGsgKyAoKChlID4+IDEyKSArIDEpIDw8IDEpKSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgIGogPSAobyArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJbbyA+PiAxXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgocCA8PCAxNikgPj4gMTYpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChfKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgocSA8PCAxNikgPj4gMTYpIC0gKChwIDw8IDE2KSA+PiAxNikpIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgJiA0MDk1XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPj4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMikpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA2NTUzNTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAoZSArIGcpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGUgfCAwKSA+PSAoaCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gKGwgLSBlKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBnID0gKGcgKiAtMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChlIHwgMCkgPD0gKGkgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAobSAtIGUpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gKGcgKiAtMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNbKGEgKyAyMCkgPj4gMl0gPSBnO1xuICAgICAgICAgICAgICAgIGNbKGEgKyAxNikgPj4gMl0gPSBlO1xuICAgICAgICAgICAgICAgIHJldHVybiBjWyhmICsgMTA2OCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY0QoYSwgZCwgZSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwO1xuICAgICAgICAgICAgICAgIGYgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBkO1xuICAgICAgICAgICAgICAgIGQgPSBlO1xuICAgICAgICAgICAgICAgIGUgPSBjWyhhICsgMTYpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gY1soYSArIDIwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaCA9IGNbKChjWyhhICsgNCkgPj4gMl0gfCAwKSArIDQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBpID0gKGggLSAoY1tjWyhhICsgNCkgPj4gMl0gPj4gMl0gfCAwKSkgfCAwO1xuICAgICAgICAgICAgICAgIGogPSBjWyhmICsgMTA2OCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGsgPSBjWygoY1soYSArIDQpID4+IDJdIHwgMCkgKyA4OCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZSB8IDApID49IChoIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAoZSAtIGkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBsID0gKCgoKChoIC0gZSkgfCAwKSAvIChnIHwgMCkpIHwgMCkgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgobCB8IDApID4gKGQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbCA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gMDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZCAtIGwpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gKG0gLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBtID0gYlsoayArICgoZSA+PiAxMikgPDwgMSkpID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgaiA9IChuICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgYltuID4+IDFdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChtIDw8IDE2KSA+PiAxNikgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKF8oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGJbKGsgKyAoKChlID4+IDEyKSArIDEpIDw8IDEpKSA+PiAxXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgLVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgobSA8PCAxNikgPj4gMTYpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgJiA0MDk1XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPj4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMikpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA2NTUzNTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAoZSArIGcpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjWyhhICsgMTYpID4+IDJdID0gZTtcbiAgICAgICAgICAgICAgICByZXR1cm4gY1soZiArIDEwNjgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNFKGQsIGUsIGYpIHtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwLFxuICAgICAgICAgICAgICAgICAgICBvID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHEgPSAwLFxuICAgICAgICAgICAgICAgICAgICByID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHQgPSAwLFxuICAgICAgICAgICAgICAgICAgICB1ID0gMDtcbiAgICAgICAgICAgICAgICBnID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZjtcbiAgICAgICAgICAgICAgICBmID0gKGcgKyAxNzI0ICsgKChlICogMjM2KSB8IDApKSB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGNbKGcgKyAxMDY4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaCA9IGNbKChjWyhmICsgNCkgPj4gMl0gfCAwKSArIDg4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaSA9IGNbKGYgKyAxNikgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGogPSBjWyhmICsgMjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBrID0gY1soKGNbKGYgKyA0KSA+PiAyXSB8IDApICsgOCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGwgPSBjW2QgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoaiB8IDApIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICBqID0gLWogfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBtID0gKCgoKChrIC0gaSkgfCAwKSAvIChqIHwgMCkpIHwgMCkgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKChtIHwgMCkgPiAobCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgIG0gPSBsO1xuICAgICAgICAgICAgICAgICAgICBsID0gMDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBsID0gKGwgLSBtKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBtO1xuICAgICAgICAgICAgICAgICAgICBtID0gKG4gLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgobiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIG4gPSBiWyhoICsgKChpID4+IDEyKSA8PCAxKSkgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBvID0gZTtcbiAgICAgICAgICAgICAgICAgICAgZSA9IChvICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBiW28gPj4gMV0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgKCgobiA8PCAxNikgPj4gMTYpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKF8oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoYlsoaCArICgoKGkgPj4gMTIpICsgMSkgPDwgMSkpID4+IDFdIHwgMCkgLVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChuIDw8IDE2KSA+PiAxNikpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgJiA0MDk1XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMikpICZcbiAgICAgICAgICAgICAgICAgICAgICAgIDY1NTM1O1xuICAgICAgICAgICAgICAgICAgICBpID0gKGkgKyBqKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoaSB8IDApIDwgKGsgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICBwID0gaTtcbiAgICAgICAgICAgICAgICAgICAgcSA9IGY7XG4gICAgICAgICAgICAgICAgICAgIHIgPSAocSArIDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbciA+PiAyXSA9IHA7XG4gICAgICAgICAgICAgICAgICAgIHMgPSBnO1xuICAgICAgICAgICAgICAgICAgICB0ID0gKHMgKyAxMDY4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHUgPSBjW3QgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoaSB8IDApID09IChrIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgayA9IGU7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoayArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYltrID4+IDFdID0gYlsoaCArICgoaSA+PiAxMikgPDwgMSkpID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYVtmIHwgMF0gPSAwO1xuICAgICAgICAgICAgICAgIGggPSBkO1xuICAgICAgICAgICAgICAgIGNbaCA+PiAyXSA9IChjW2ggPj4gMl0gfCAwKSAtIChsICsgMSk7XG4gICAgICAgICAgICAgICAgcCA9IGk7XG4gICAgICAgICAgICAgICAgcSA9IGY7XG4gICAgICAgICAgICAgICAgciA9IChxICsgMTYpIHwgMDtcbiAgICAgICAgICAgICAgICBjW3IgPj4gMl0gPSBwO1xuICAgICAgICAgICAgICAgIHMgPSBnO1xuICAgICAgICAgICAgICAgIHQgPSAocyArIDEwNjgpIHwgMDtcbiAgICAgICAgICAgICAgICB1ID0gY1t0ID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICByZXR1cm4gdSB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjRihlLCBmKSB7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMC4wLFxuICAgICAgICAgICAgICAgICAgICBqID0gMCxcbiAgICAgICAgICAgICAgICAgICAgayA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGwgPSAwLFxuICAgICAgICAgICAgICAgICAgICBtID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG8gPSAwLFxuICAgICAgICAgICAgICAgICAgICBwID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBzID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdCA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgdSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHYgPSAwLFxuICAgICAgICAgICAgICAgICAgICB3ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgeCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHkgPSAwLFxuICAgICAgICAgICAgICAgICAgICB6ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgQSA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgQiA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgQyA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgRCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBGID0gMCxcbiAgICAgICAgICAgICAgICAgICAgRyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEggPSAwLFxuICAgICAgICAgICAgICAgICAgICBJID0gMCxcbiAgICAgICAgICAgICAgICAgICAgSiA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgSyA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgTCA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgTSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIE4gPSAwLFxuICAgICAgICAgICAgICAgICAgICBPID0gMCxcbiAgICAgICAgICAgICAgICAgICAgUCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIFEgPSAwLFxuICAgICAgICAgICAgICAgICAgICBSID0gMCxcbiAgICAgICAgICAgICAgICAgICAgUyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIFQgPSAwLFxuICAgICAgICAgICAgICAgICAgICBVID0gMCxcbiAgICAgICAgICAgICAgICAgICAgViA9IDAsXG4gICAgICAgICAgICAgICAgICAgIFcgPSAwLFxuICAgICAgICAgICAgICAgICAgICBYID0gMDtcbiAgICAgICAgICAgICAgICBnID0gZjtcbiAgICAgICAgICAgICAgICBmID0gY1soZyArIDg4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaCA9ICgxMDU2ICsgKGFbKGcgKyAxMTIpIHwgMF0gPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICBpID1cbiAgICAgICAgICAgICAgICAgICAgKCsoY1soZyArIDEyKSA+PiAyXSB8IDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICsoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZFtoXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGggKyAxKSB8IDBdIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoaCArIDIpIHwgMF0gPDwgMTYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoaCArIDMpIHwgMF0gPDwgMjQpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICApKSAvXG4gICAgICAgICAgICAgICAgICAgICgrKGNbKGcgKyAzMikgPj4gMl0gfCAwKSAqICsoY1soZSArIDQpID4+IDJdIHwgMCkpO1xuICAgICAgICAgICAgICAgIGUgPSB+figrKGNbKGcgKyA4KSA+PiAyXSB8IDApIC8gaSk7XG4gICAgICAgICAgICAgICAgaCA9IGJpKGUgPj4gMTEpIHwgMDtcbiAgICAgICAgICAgICAgICBqID0gaDtcbiAgICAgICAgICAgICAgICBrID0gaDtcbiAgICAgICAgICAgICAgICBoID0gKChlID4+IDEyKSAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICBsID0gKCgoKGNbKGcgKyA4KSA+PiAyXSB8IDApIC0gNDA5NikgfCAwKSAvIChoIHwgMCkpIHwgMDtcbiAgICAgICAgICAgICAgICBtID0gbDtcbiAgICAgICAgICAgICAgICBuID0gbDtcbiAgICAgICAgICAgICAgICBsID0gKGggLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgaCA9IGw7XG4gICAgICAgICAgICAgICAgaWYgKChsIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBsID0gaztcbiAgICAgICAgICAgICAgICAgICAgayA9IChsICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBiW2wgPj4gMV0gPSBiW2YgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBsID0gKGggLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGggPSBsO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBsID0gKGYgKyAoKG4gPj4gMTIpIDw8IDEpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmIChsID4+PiAwID4gZiA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbyA9IGJbKGwgLSAyKSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBwID0gbyAmIDY1NTM1O1xuICAgICAgICAgICAgICAgICAgICBxID0gYltsID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgciA9IGJbKGwgKyAyKSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHMgPSBiWyhsICsgNCkgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICB0ID0gKygoKG4gJiA0MDk1KSA+Pj4gMCkgPj4+IDApICogMC4wMDAyNDQxNDA2MjU7XG4gICAgICAgICAgICAgICAgICAgIGwgPSBrO1xuICAgICAgICAgICAgICAgICAgICBrID0gKGwgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGJbbCA+PiAxXSA9IH5+KFxuICAgICAgICAgICAgICAgICAgICAgICAgKygoKHEgPDwgMTYpID4+IDE2KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICh0IC8gNi4wKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKCsoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKCgocCA8PCAxNikgPj4gMTYpICogLTIpIHwgMCkgLVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoKHEgPDwgMTYpID4+IDE2KSAqIDMpIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoKHIgPDwgMTYpID4+IDE2KSAqIDYpIHwgMCkgLVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChzIDw8IDE2KSA+PiAxNikpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgrKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKCgocCA8PCAxNikgPj4gMTYpIC1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgocSA8PCAxNikgPj4gMTYpIDw8IDEpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChyIDw8IDE2KSA+PiAxNikpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdCAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKC0oKHAgPDwgMTYpID4+IDE2KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKCgoKChxIDw8IDE2KSA+PiAxNikgLVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHIgPDwgMTYpID4+IDE2KSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocyA8PCAxNikgPj4gMTYpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkpKVxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICBuID0gKG4gKyBtKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoKG4gJiA0MDk1KSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgcCA9IGJbKGYgKyAoKG4gPj4gMTIpIDw8IDEpKSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHEgPSBiWyhmICsgKCgobiA+PiAxMikgKyAxKSA8PCAxKSkgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBtID0gaztcbiAgICAgICAgICAgICAgICAgICAgayA9IChtICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBiW20gPj4gMV0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgKCgocCA8PCAxNikgPj4gMTYpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKF8oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKHEgPDwgMTYpID4+IDE2KSAtICgocCA8PCAxNikgPj4gMTYpKSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG4gJiA0MDk1XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMikpICZcbiAgICAgICAgICAgICAgICAgICAgICAgIDY1NTM1O1xuICAgICAgICAgICAgICAgICAgICB1ID0gZTtcbiAgICAgICAgICAgICAgICAgICAgdiA9IGc7XG4gICAgICAgICAgICAgICAgICAgIHcgPSAodiArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1t3ID4+IDJdID0gdTtcbiAgICAgICAgICAgICAgICAgICAgeCA9IGc7XG4gICAgICAgICAgICAgICAgICAgIHkgPSB4IHwgMDtcbiAgICAgICAgICAgICAgICAgICAgeiA9IGNbeSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIEEgPSArKHogfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgQiA9IGk7XG4gICAgICAgICAgICAgICAgICAgIEMgPSBBIC8gQjtcbiAgICAgICAgICAgICAgICAgICAgRCA9IH5+QztcbiAgICAgICAgICAgICAgICAgICAgRSA9IGc7XG4gICAgICAgICAgICAgICAgICAgIEYgPSBFIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tGID4+IDJdID0gRDtcbiAgICAgICAgICAgICAgICAgICAgRyA9IGc7XG4gICAgICAgICAgICAgICAgICAgIEggPSAoRyArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgSSA9IGNbSCA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIEogPSArKEkgfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgSyA9IGk7XG4gICAgICAgICAgICAgICAgICAgIEwgPSBKIC8gSztcbiAgICAgICAgICAgICAgICAgICAgTSA9IH5+TDtcbiAgICAgICAgICAgICAgICAgICAgTiA9IGc7XG4gICAgICAgICAgICAgICAgICAgIE8gPSAoTiArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tPID4+IDJdID0gTTtcbiAgICAgICAgICAgICAgICAgICAgUCA9IGc7XG4gICAgICAgICAgICAgICAgICAgIFEgPSAoUCArIDg4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIFIgPSBjW1EgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBTID0gUjtcbiAgICAgICAgICAgICAgICAgICAgYzAoUyk7XG4gICAgICAgICAgICAgICAgICAgIFQgPSBqO1xuICAgICAgICAgICAgICAgICAgICBVID0gZztcbiAgICAgICAgICAgICAgICAgICAgViA9IChVICsgODgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tWID4+IDJdID0gVDtcbiAgICAgICAgICAgICAgICAgICAgVyA9IGc7XG4gICAgICAgICAgICAgICAgICAgIFggPSAoVyArIDEyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbWCA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwID0gaztcbiAgICAgICAgICAgICAgICAgICAgayA9IChwICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBiW3AgPj4gMV0gPSBiWyhmICsgKChuID4+IDEyKSA8PCAxKSkgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICB1ID0gZTtcbiAgICAgICAgICAgICAgICAgICAgdiA9IGc7XG4gICAgICAgICAgICAgICAgICAgIHcgPSAodiArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1t3ID4+IDJdID0gdTtcbiAgICAgICAgICAgICAgICAgICAgeCA9IGc7XG4gICAgICAgICAgICAgICAgICAgIHkgPSB4IHwgMDtcbiAgICAgICAgICAgICAgICAgICAgeiA9IGNbeSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIEEgPSArKHogfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgQiA9IGk7XG4gICAgICAgICAgICAgICAgICAgIEMgPSBBIC8gQjtcbiAgICAgICAgICAgICAgICAgICAgRCA9IH5+QztcbiAgICAgICAgICAgICAgICAgICAgRSA9IGc7XG4gICAgICAgICAgICAgICAgICAgIEYgPSBFIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tGID4+IDJdID0gRDtcbiAgICAgICAgICAgICAgICAgICAgRyA9IGc7XG4gICAgICAgICAgICAgICAgICAgIEggPSAoRyArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgSSA9IGNbSCA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIEogPSArKEkgfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgSyA9IGk7XG4gICAgICAgICAgICAgICAgICAgIEwgPSBKIC8gSztcbiAgICAgICAgICAgICAgICAgICAgTSA9IH5+TDtcbiAgICAgICAgICAgICAgICAgICAgTiA9IGc7XG4gICAgICAgICAgICAgICAgICAgIE8gPSAoTiArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tPID4+IDJdID0gTTtcbiAgICAgICAgICAgICAgICAgICAgUCA9IGc7XG4gICAgICAgICAgICAgICAgICAgIFEgPSAoUCArIDg4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIFIgPSBjW1EgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBTID0gUjtcbiAgICAgICAgICAgICAgICAgICAgYzAoUyk7XG4gICAgICAgICAgICAgICAgICAgIFQgPSBqO1xuICAgICAgICAgICAgICAgICAgICBVID0gZztcbiAgICAgICAgICAgICAgICAgICAgViA9IChVICsgODgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tWID4+IDJdID0gVDtcbiAgICAgICAgICAgICAgICAgICAgVyA9IGc7XG4gICAgICAgICAgICAgICAgICAgIFggPSAoVyArIDEyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbWCA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjRyhhLCBiLCBlKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgbiA9IDAuMDtcbiAgICAgICAgICAgICAgICBmID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICBiID0gZTtcbiAgICAgICAgICAgICAgICBlID0gKGEgKyAyMDgpIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gY1tlID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBjW2UgPj4gMl0gPSBnICsgMTtcbiAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSA+PSA2Mykge1xuICAgICAgICAgICAgICAgICAgICBjWyhhICsgMjA4KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGcgPSBjSChjWyhhICsgMjA4KSA+PiAyXSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKGNbKGEgKyA4MCArIChnIDw8IDIpKSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IC0oY1soYSArIDgwICsgKGcgPDwgMikpID4+IDJdIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaiA9IGk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaiB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gY1soYSArIDgwICsgKGcgPDwgMikpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGogPSBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGogfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGUgPSAoZFsoKGNbKGEgKyA0KSA+PiAyXSB8IDApICsgMTA5KSB8IDBdIHwgMCkgPDwgNztcbiAgICAgICAgICAgICAgICBpZiAoKGNbKGEgKyA1MikgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGwgPSAoYSArIDU2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbbCA+PiAyXSA9IChjW2wgPj4gMl0gfCAwKSArIChjWyhhICsgNTIpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soYSArIDU2KSA+PiAyXSB8IDApID49IDY1NTM2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhhICsgNTIpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPSBfKGUsIGNbKGEgKyA1NikgPj4gMl0gfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gZSA+PiAxNjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBtID1cbiAgICAgICAgICAgICAgICAgICAgKCgrKGNbKChjWyhhICsgNCkgPj4gMl0gfCAwKSArIDEyKSA+PiAyXSB8IDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICsoY1soYSArIDEyKSA+PiAyXSB8IDApKSAvXG4gICAgICAgICAgICAgICAgICAgICAgICAoKyhjWygoY1soYSArIDQpID4+IDJdIHwgMCkgKyAzMikgPj4gMl0gfCAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKyhjWyhmICsgNCkgPj4gMl0gfCAwKSkpICpcbiAgICAgICAgICAgICAgICAgICAgNDA5Ni4wO1xuICAgICAgICAgICAgICAgIGYgPSB+fihcbiAgICAgICAgICAgICAgICAgICAgK1IoXG4gICAgICAgICAgICAgICAgICAgICAgICArKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICsoKGNbKGEgKyAyMDgpID4+IDJdIDw8IDQpIHwgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDA2MTM1OTIzMTUxNTQyNTY1XG4gICAgICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgICkgKlxuICAgICAgICAgICAgICAgICAgICArKGUgfCAwKSAqXG4gICAgICAgICAgICAgICAgICAgIDEuMFxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPSAtZiB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoMTcwNCArICgoKGYgPj4gNSkgJiAyNTUpIDw8IDMpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIG4gPVxuICAgICAgICAgICAgICAgICAgICAgICAgKChjW2sgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRbZV0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgMSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAyKSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAzKSB8IDBdIDw8IDI0KSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDQpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkWyhlICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyA1KSB8IDBdIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDYpIHwgMF0gPDwgMTYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDcpIHwgMF0gPDwgMjQpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICtoW2sgPj4gM10pO1xuICAgICAgICAgICAgICAgICAgICBlID0gKDM3NTIgKyAoKGYgPj4gMTMpIDw8IDMpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIG0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgbSAvXG4gICAgICAgICAgICAgICAgICAgICAgICAobiAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW2sgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkW2VdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAxKSB8IDBdIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAyKSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgMykgfCAwXSA8PCAyNCkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgNCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkWyhlICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgNSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgNikgfCAwXSA8PCAxNikgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDcpIHwgMF0gPDwgMjQpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAraFtrID4+IDNdKSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZSA9ICgxNzA0ICsgKCgoZiA+PiA1KSAmIDI1NSkgPDwgMykpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgbiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAoKGNbayA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZFtlXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAxKSB8IDBdIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDIpIHwgMF0gPDwgMTYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDMpIHwgMF0gPDwgMjQpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgNCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRbKGUgKyA0KSB8IDBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDUpIHwgMF0gPDwgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgNikgfCAwXSA8PCAxNikgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgNykgfCAwXSA8PCAyNCkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgK2hbayA+PiAzXSk7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoMzc1MiArICgoZiA+PiAxMykgPDwgMykpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgbSA9XG4gICAgICAgICAgICAgICAgICAgICAgICBtICpcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gKlxuICAgICAgICAgICAgICAgICAgICAgICAgKChjW2sgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRbZV0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgMSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAyKSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAzKSB8IDBdIDw8IDI0KSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDQpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkWyhlICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyA1KSB8IDBdIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDYpIHwgMF0gPDwgMTYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDcpIHwgMF0gPDwgMjQpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICtoW2sgPj4gM10pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKGNbKGEgKyA1MikgPj4gMl0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGNbKGEgKyA4MCArIChnIDw8IDIpKSA+PiAyXSA9IH5+bTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBtID0gLTAuMCAtIG07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGkgPSB+fm07XG4gICAgICAgICAgICAgICAgaiA9IGk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGogfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY0goYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgYiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGMgPSAwO1xuICAgICAgICAgICAgICAgIGIgPSBhO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgPCAxNikge1xuICAgICAgICAgICAgICAgICAgICAgICAgYyA9ICgxNSAtIGIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYiB8IDApID49IDQ4KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYyA9ICg3OSAtIGIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYyA9IChiIC0gMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIHJldHVybiBjIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNJKGEsIGIsIGQsIGUpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGFuKGIgfCAwLCBkIHwgMCwgZSB8IDAsIGNbYSA+PiAyXSB8IDApIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNKKGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBkID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZSA9IDA7XG4gICAgICAgICAgICAgICAgYiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IDA7XG4gICAgICAgICAgICAgICAgaWYgKChjWyhiICsgNCkgPj4gMl0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGQgPSBiO1xuICAgICAgICAgICAgICAgICAgICBjMChkKTtcbiAgICAgICAgICAgICAgICAgICAgZSA9IGE7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBlIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYSA9IGFvKGNbYiA+PiAyXSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gYjtcbiAgICAgICAgICAgICAgICBjMChkKTtcbiAgICAgICAgICAgICAgICBlID0gYTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZSB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjSyhhLCBiLCBkLCBlKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGNbKGQgKyA0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgZyA9IChlICsgKF8oYSwgZikgfCAwKSkgfCAwO1xuICAgICAgICAgICAgICAgIGlmIChnID4+PiAwID4gKGNbKGQgKyA4KSA+PiAyXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGEgPVxuICAgICAgICAgICAgICAgICAgICAgICAgKCgoKChjWyhkICsgOCkgPj4gMl0gfCAwKSAtIChjWyhkICsgNCkgPj4gMl0gfCAwKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApIC9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiA+Pj4gMCkpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGcgPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBjWyhkICsgNCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBfKGEsIGYpIHwgMDtcbiAgICAgICAgICAgICAgICBjNihnIHwgMCwgYiB8IDAsIGUpIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gXyhhLCBmKSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IChkICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgIGNbZiA+PiAyXSA9IChjW2YgPj4gMl0gfCAwKSArIGU7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGEgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY0woYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgYiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGQgPSAwO1xuICAgICAgICAgICAgICAgIGIgPSBhO1xuICAgICAgICAgICAgICAgIGlmICgoY1soYiArIDEyKSA+PiAyXSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZCA9IGI7XG4gICAgICAgICAgICAgICAgICAgIGMwKGQpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYzAoY1tiID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgZCA9IGI7XG4gICAgICAgICAgICAgICAgYzAoZCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjTShhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgZCA9IGJpKDEyKSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKChkIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBlID0gMDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZyA9IGJpKDgpIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGMwKGQpO1xuICAgICAgICAgICAgICAgICAgICBlID0gMDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBjW2cgPj4gMl0gPSBhO1xuICAgICAgICAgICAgICAgICAgICBjWyhnICsgNCkgPj4gMl0gPSBiO1xuICAgICAgICAgICAgICAgICAgICBjWyhkICsgOCkgPj4gMl0gPSBnO1xuICAgICAgICAgICAgICAgICAgICBjW2QgPj4gMl0gPSAyO1xuICAgICAgICAgICAgICAgICAgICBjWyhkICsgNCkgPj4gMl0gPSA0O1xuICAgICAgICAgICAgICAgICAgICBlID0gZDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjTihhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBiID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGQgPSAwO1xuICAgICAgICAgICAgICAgIGIgPSBhdihhIHwgMCwgNjU0NCkgfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoYiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgYyA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGQgPSBjO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZCB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYyA9IGNNKGIsIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZCA9IGM7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBkIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjTyhhLCBiLCBkKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwO1xuICAgICAgICAgICAgICAgIGUgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBiaSgxMikgfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoYSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZiA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGcgPSBmO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZyB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGggPSBiaSgxNikgfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoaCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgYzAoYSk7XG4gICAgICAgICAgICAgICAgICAgIGYgPSAwO1xuICAgICAgICAgICAgICAgICAgICBnID0gZjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGcgfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGNbaCA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyA0KSA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyA4KSA+PiAyXSA9IGUgKyBiO1xuICAgICAgICAgICAgICAgICAgICBjWyhoICsgMTIpID4+IDJdID0gZDtcbiAgICAgICAgICAgICAgICAgICAgY1soYSArIDgpID4+IDJdID0gaDtcbiAgICAgICAgICAgICAgICAgICAgY1thID4+IDJdID0gNDtcbiAgICAgICAgICAgICAgICAgICAgY1soYSArIDQpID4+IDJdID0gMjtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGE7XG4gICAgICAgICAgICAgICAgICAgIGcgPSBmO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZyB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY1AoYSwgYiwgZCwgZSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBlIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZiA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IGE7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGFZW2NbZiA+PiAyXSAmIDddKGNbKGYgKyA4KSA+PiAyXSB8IDAsIGIsIGQsIGUpIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNRKGEsIGIpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBjID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwO1xuICAgICAgICAgICAgICAgIGMgPSBpO1xuICAgICAgICAgICAgICAgIGkgPSAoaSArIDEwMjQpIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gYyB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGI7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGEgPj4+IDAgPD0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYiA9IGE7XG4gICAgICAgICAgICAgICAgICAgIGlmIChiID4+PiAwID4gMTAyNCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYiA9IDEwMjQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYSA9IChhIC0gYikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAoYiB8IDApICE9IChjUChlLCBkIHwgMCwgMSwgYikgfCAwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaSA9IGM7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY1IoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgYiA9IDA7XG4gICAgICAgICAgICAgICAgYiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGFXW2NbKGIgKyA0KSA+PiAyXSAmIDddKGNbKGIgKyA4KSA+PiAyXSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICBjMChiKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gYSB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjUygpIHtcbiAgICAgICAgICAgICAgICB2YXIgYSA9IDA7XG4gICAgICAgICAgICAgICAgY1sxNjc2XSA9IGJpKDUxNikgfCAwO1xuICAgICAgICAgICAgICAgIGM1KGNbMTY3Nl0gfCAwLCAwLCA1MTYpO1xuICAgICAgICAgICAgICAgIGEgPSBiaSgzNTg0KSB8IDA7XG4gICAgICAgICAgICAgICAgY1tjWzE2NzZdID4+IDJdID0gYTtcbiAgICAgICAgICAgICAgICBjNShjW2NbMTY3Nl0gPj4gMl0gfCAwLCAwLCAzNTg0KTtcbiAgICAgICAgICAgICAgICBjWzE4MDRdID0gYmkoNTE2KSB8IDA7XG4gICAgICAgICAgICAgICAgYzUoY1sxODA0XSB8IDAsIDAsIDUxNik7XG4gICAgICAgICAgICAgICAgYSA9IGJpKDM1ODQpIHwgMDtcbiAgICAgICAgICAgICAgICBjW2NbMTgwNF0gPj4gMl0gPSBhO1xuICAgICAgICAgICAgICAgIGM1KGNbY1sxODA0XSA+PiAyXSB8IDAsIDAsIDM1ODQpO1xuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY1QoYikge1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMDtcbiAgICAgICAgICAgICAgICBkID0gaTtcbiAgICAgICAgICAgICAgICBpID0gKGkgKyAxMDI0KSB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSBiO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjMShmIHwgMCkgfCAwKSA+Pj4gMCA+PSAxMDI0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBiID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBnID0gZjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGMyKGIgfCAwLCBnIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IGFFKGYgfCAwLCA0NykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbKGUgKyAoZyAtIGYpKSB8IDBdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gY1ttID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA2NDgwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGcgPSBpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDgpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW2cgPj4gMl0gPSBiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZykgfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmooZSB8IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgY1MoKSB8IDA7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFbZl0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBoID0gZjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGogPSBjVShoKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBqIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIGYgPSA2NTIwO1xuICAgICAgICAgICAgICAgIGggPSBmO1xuICAgICAgICAgICAgICAgIGogPSBjVShoKSB8IDA7XG4gICAgICAgICAgICAgICAgaSA9IGQ7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGogfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY1UoYikge1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMCxcbiAgICAgICAgICAgICAgICAgICAgayA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGwgPSAwLFxuICAgICAgICAgICAgICAgICAgICBuID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHAgPSAwLFxuICAgICAgICAgICAgICAgICAgICBxID0gMCxcbiAgICAgICAgICAgICAgICAgICAgciA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHMgPSAwLFxuICAgICAgICAgICAgICAgICAgICB0ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHYgPSAwLFxuICAgICAgICAgICAgICAgICAgICB3ID0gMDtcbiAgICAgICAgICAgICAgICBkID0gaTtcbiAgICAgICAgICAgICAgICBpID0gKGkgKyAxMDY0KSB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSAoZCArIDEwMjQpIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gYjtcbiAgICAgICAgICAgICAgICBiID0gMDtcbiAgICAgICAgICAgICAgICBoID0gMDtcbiAgICAgICAgICAgICAgICBpZiAoKGNbMTY2MF0gfCAwKSA+IDUwKSB7XG4gICAgICAgICAgICAgICAgICAgIGogPSBjW20gPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgIGogfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgNTc5MixcbiAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDEpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgNykgJiAtOCksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gMCksXG4gICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICBsID0gLTE7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBqID0gYmgoZykgfCAwO1xuICAgICAgICAgICAgICAgIG8gPSBqO1xuICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgaiA9IGNbbSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHAgPSBnO1xuICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgIGogfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgNTM5MixcbiAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLCAoaSA9IChpICsgOCkgfCAwKSwgKGNbayA+PiAyXSA9IHApLCBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICBsID0gLTE7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBMMTg4MTogd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChjXyhlIHwgMCwgMTAyNCwgbykgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBxID0gMTY0NjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGggPSAoaCArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgcCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbZiA+PiAyXSA9IGF5KGUgfCAwLCA1MDk2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1tmID4+IDJdIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhVihjW2YgPj4gMl0gfCAwLCA0ODQwKSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYVtjW2YgPj4gMl0gfCAwXSB8IDApID09IDM1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhmICsgKHAgPDwgMikpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFbY1soZiArIChwIDw8IDIpKSA+PiAyXSB8IDBdIHwgMCkgPT0gMzUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IChwIHwgMCkgPCAxMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaiA9IChwICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgcCA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgKGogPDwgMikpID4+IDJdID0gYXkoMCwgNTA5NikgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYVYoY1tmID4+IDJdIHwgMCwgNDgzMikgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhVihjW2YgPj4gMl0gfCAwLCA0ODE2KSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1MDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFWKGNbZiA+PiAyXSB8IDAsIDQ4MDApIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTUwNDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYVYoY1tmID4+IDJdIHwgMCwgNjU1MikgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTA0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhVihjW2YgPj4gMl0gfCAwLCA2NTM2KSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1MDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFWKGNbZiA+PiAyXSB8IDAsIDY1MDQpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFWKGNbZiA+PiAyXSB8IDAsIDY0MTYpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKGNbZiA+PiAyXSB8IDAsIDY0MDApIHwgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTUwOTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKGNbZiA+PiAyXSB8IDAsIDYzNDQpIHwgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVYoY1tmID4+IDJdIHwgMCwgNjI4MCkgfCAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhVihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbZiA+PiAyXSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA2MTc2XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVYoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tmID4+IDJdIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA2MTM2XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTE2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbZiA+PiAyXSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjA3MlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW2YgPj4gMl0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjAwOFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTk1MlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1ODgwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVYoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDU3ODRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhVihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZiA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTcyMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1NjE2XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApIDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTU2MjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTg4MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTYyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZiA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1N1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1NjI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhTChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1NjU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTI3XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTU2NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTg4MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYiB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1Njc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChzICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMwKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocyAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJpKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGMxKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChzICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjMihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0IHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChzICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocyAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IC0xO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHMgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSAtMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChzICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocyAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocyAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gMjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1IHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID49XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYUgoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHUgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTczO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTg4MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdCA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVYoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHUgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTI3MlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1IDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTIwOFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1IDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1MTUyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVYoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHUgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTAwOFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1IDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDk0NFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTYyNTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhVihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1ZTNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhVihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0OTkyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVYoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDkzNlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE2MjE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocyAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHMgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocyAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVYoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNWUzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVYoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDk5MlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNjExO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHMgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHMgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjApID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhVihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1MTQ0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVYoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTExMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDUxMDRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoKCgoYUwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTU3KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHYgPSAxMjc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHYgPSA2NDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodiB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE2MDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2IHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTI3XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNjA0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTg4MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodiB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0NVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ4XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTYwNDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTg4MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNjA0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChzICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSB2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYUwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHYgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1ODY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHYgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTI3XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTU4NjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTg4MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTg2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1N1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1ODY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocyAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gdjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHYgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYUwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHYgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApIDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTU3OTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2IHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4MDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTU3OTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApIDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ4XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1Nzk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTg4MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1N1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTc5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHMgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSB2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHUgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTUyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYUwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1NTU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTI3XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTU1NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTg4MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDY3MDQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNjcwNCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocyA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDUxNlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjNShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICg2NzA0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocyA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTE2XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmkoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzNTg0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNjcwNCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYzUoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICg2NzA0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDM1ODRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDY3MDQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHAgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApIDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTU0MztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYUwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocyB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTQ2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyN1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTQ2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDcyMTYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocyA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNzIxNiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChzIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmkoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDUxNlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjNShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNzIxNiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocyA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTE2XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmkoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDM1ODRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNzIxNiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocyA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjNShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDcyMTYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChzIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzU4NFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDcyMTYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocyA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHAgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTUzOTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjNyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNzcyOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNTVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhWzc5ODNdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApIDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTUzMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTg4MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPj1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHAgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTY2MF0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1sxNjYwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1UoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE2NjBdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbMTY2MF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgLVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTIzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmooXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChzICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0IHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTk2MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGkgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDcpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC04KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID4+IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBjW20gPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdCB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjAxNixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGsgPSBpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpICsgMSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpICsgNykgJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtOCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbayA+PiAyXSA9IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTE2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChxIHwgMCkgPT0gMTUxNikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBjW20gPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgPSBjW2YgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0IHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjA4OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyA4KSB8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gdyksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdyA9IGNbbSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3IHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA2MTkyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyAxKSB8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyA3KSAmIC04KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaykgfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdyA9IGNbbSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdyB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA2Mjk2LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgMSkgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyA3KSAmIC04KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW2sgPj4gMl0gPSAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTUwOTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgocSB8IDApID09IDE1MDkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdyA9IGNbbSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gY1tmID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDYzNTIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDgpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbayA+PiAyXSA9IHQpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBjW20gPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjQzMixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDEpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgNykgJiAtOCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1MDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKHEgfCAwKSA9PSAxNTA0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBxID0gMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKHEgfCAwKSA9PSAxNTIzKSB7XG4gICAgICAgICAgICAgICAgICAgIHMgPSBjW20gPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBiID0gZztcbiAgICAgICAgICAgICAgICAgICAgdiA9IGg7XG4gICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgcyB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICA1OTEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgMTYpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gYiksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDgpID4+IDJdID0gdiksXG4gICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICBsID0gLTI7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHEgfCAwKSA9PSAxNTU1KSB7XG4gICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIDU1MjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGsgPSBpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyAxNikgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjW2sgPj4gMl0gPSBnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgOCkgPj4gMl0gPSBoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGs7XG4gICAgICAgICAgICAgICAgICAgIGwgPSAtMjtcbiAgICAgICAgICAgICAgICAgICAgbiA9IGw7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgocSB8IDApID09IDE1NjIpIHtcbiAgICAgICAgICAgICAgICAgICAgYXIoXG4gICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgNTQ4MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDE2KSB8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbayA+PiAyXSA9IGcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyA4KSA+PiAyXSA9IGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgaykgfCAwXG4gICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpID0gaztcbiAgICAgICAgICAgICAgICAgICAgbCA9IC0yO1xuICAgICAgICAgICAgICAgICAgICBuID0gbDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChxIHwgMCkgPT0gMTU2NSkge1xuICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbbSA+PiAyXSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICA1NDMyLFxuICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgMTYpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gZyksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDgpID4+IDJdID0gaCksXG4gICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICBsID0gLTI7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHEgfCAwKSA9PSAxNTY3KSB7XG4gICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIDUzMjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGsgPSBpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyAxNikgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjW2sgPj4gMl0gPSBnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgOCkgPj4gMl0gPSBoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGs7XG4gICAgICAgICAgICAgICAgICAgIGwgPSAtMjtcbiAgICAgICAgICAgICAgICAgICAgbiA9IGw7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgocSB8IDApID09IDE1MzkpIHtcbiAgICAgICAgICAgICAgICAgICAgYXIoXG4gICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgNTcyOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDE2KSB8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbayA+PiAyXSA9IGcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyA4KSA+PiAyXSA9IGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgaykgfCAwXG4gICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpID0gaztcbiAgICAgICAgICAgICAgICAgICAgbCA9IC0yO1xuICAgICAgICAgICAgICAgICAgICBuID0gbDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChxIHwgMCkgPT0gMTUzMSkge1xuICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbbSA+PiAyXSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICA1ODQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgMTYpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gZyksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDgpID4+IDJdID0gaCksXG4gICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICBsID0gLTI7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHEgfCAwKSA9PSAxNTUyKSB7XG4gICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIDU1NzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGsgPSBpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyAxNikgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjW2sgPj4gMl0gPSBnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgOCkgPj4gMl0gPSBoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGs7XG4gICAgICAgICAgICAgICAgICAgIGwgPSAtMjtcbiAgICAgICAgICAgICAgICAgICAgbiA9IGw7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgocSB8IDApID09IDE1NzkpIHtcbiAgICAgICAgICAgICAgICAgICAgYXIoXG4gICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgNTIxNixcbiAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDI0KSB8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbayA+PiAyXSA9IGcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyA4KSA+PiAyXSA9IGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyAxNikgPj4gMl0gPSA4MDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgaykgfCAwXG4gICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpID0gaztcbiAgICAgICAgICAgICAgICAgICAgbCA9IC0yO1xuICAgICAgICAgICAgICAgICAgICBuID0gbDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChxIHwgMCkgPT0gMTU4Nikge1xuICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbbSA+PiAyXSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICA1MTYwLFxuICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgMTYpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gZyksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDgpID4+IDJdID0gaCksXG4gICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICBsID0gLTI7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHEgfCAwKSA9PSAxNjExKSB7XG4gICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIDQ5NTIsXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGsgPSBpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyAxNikgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjW2sgPj4gMl0gPSBnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgOCkgPj4gMl0gPSBoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGs7XG4gICAgICAgICAgICAgICAgICAgIGwgPSAtMjtcbiAgICAgICAgICAgICAgICAgICAgbiA9IGw7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgocSB8IDApID09IDE2MjEpIHtcbiAgICAgICAgICAgICAgICAgICAgYXIoXG4gICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgNDg4OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDE2KSB8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbayA+PiAyXSA9IGcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyA4KSA+PiAyXSA9IGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgaykgfCAwXG4gICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpID0gaztcbiAgICAgICAgICAgICAgICAgICAgbCA9IC0yO1xuICAgICAgICAgICAgICAgICAgICBuID0gbDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChxIHwgMCkgPT0gMTYyNSkge1xuICAgICAgICAgICAgICAgICAgICB2ID0gY1soZiArICh1IDw8IDIpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIDUyODAsXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGsgPSBpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyAyNCkgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjW2sgPj4gMl0gPSBnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgOCkgPj4gMl0gPSBoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgMTYpID4+IDJdID0gdiksXG4gICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICBsID0gLTI7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHEgfCAwKSA9PSAxNTQ2KSB7XG4gICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIDU2MjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGsgPSBpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyAxNikgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjW2sgPj4gMl0gPSBnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgOCkgPj4gMl0gPSBoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGs7XG4gICAgICAgICAgICAgICAgICAgIGwgPSAtMjtcbiAgICAgICAgICAgICAgICAgICAgbiA9IGw7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgocSB8IDApID09IDE1NDMpIHtcbiAgICAgICAgICAgICAgICAgICAgYXIoXG4gICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgNTY4MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDE2KSB8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbayA+PiAyXSA9IGcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyA4KSA+PiAyXSA9IGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgaykgfCAwXG4gICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpID0gaztcbiAgICAgICAgICAgICAgICAgICAgbCA9IC0yO1xuICAgICAgICAgICAgICAgICAgICBuID0gbDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChxIHwgMCkgPT0gMTYwNCkge1xuICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbbSA+PiAyXSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICA1MDE2LFxuICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgMTYpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gZyksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDgpID4+IDJdID0gaCksXG4gICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICBsID0gLTI7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHEgfCAwKSA9PSAxNTczKSB7XG4gICAgICAgICAgICAgICAgICAgIHYgPSBjWyhmICsgKHUgPDwgMikpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYXIoXG4gICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgNTI4MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDI0KSB8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbayA+PiAyXSA9IGcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyA4KSA+PiAyXSA9IGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyAxNikgPj4gMl0gPSB2KSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGs7XG4gICAgICAgICAgICAgICAgICAgIGwgPSAtMjtcbiAgICAgICAgICAgICAgICAgICAgbiA9IGw7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgocSB8IDApID09IDE2NDYpIHtcbiAgICAgICAgICAgICAgICAgICAgYW8obyB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgbCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNWKGQsIGUsIGYsIGcpIHtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gZyB8IDA7XG4gICAgICAgICAgICAgICAgY1sxNjcyXSA9IGQ7XG4gICAgICAgICAgICAgICAgYlszMzQ2XSA9IGU7XG4gICAgICAgICAgICAgICAgYVs2Njk0XSA9IGY7XG4gICAgICAgICAgICAgICAgYlszMzQ4XSA9IGc7XG4gICAgICAgICAgICAgICAgcmV0dXJuIDY2ODg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjVyhmLCBnLCBoKSB7XG4gICAgICAgICAgICAgICAgZiA9IGYgfCAwO1xuICAgICAgICAgICAgICAgIGcgPSBnIHwgMDtcbiAgICAgICAgICAgICAgICBoID0gaCB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBrID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwO1xuICAgICAgICAgICAgICAgIGogPSBpO1xuICAgICAgICAgICAgICAgIGsgPSBmO1xuICAgICAgICAgICAgICAgIGYgPSBoO1xuICAgICAgICAgICAgICAgIGlmICgoayB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgbCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gajtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBoID0gYmkoMTQxNjQpIHwgMDtcbiAgICAgICAgICAgICAgICBjNShoIHwgMCwgMCwgMTQxNjQpO1xuICAgICAgICAgICAgICAgIGNbKGggKyAyNCkgPj4gMl0gPSBnO1xuICAgICAgICAgICAgICAgIGcgPSAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApID49IDEyOCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChjWyg2NzA0ICsgKGcgPDwgMikpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY1soaCArIDI4ICsgKGcgPDwgMikpID4+IDJdID0gYmkoNTE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjNShjWyhoICsgMjggKyAoZyA8PCAyKSkgPj4gMl0gfCAwLCAwLCA1MTYpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tjWyhoICsgMjggKyAoZyA8PCAyKSkgPj4gMl0gPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbY1soNjcwNCArIChnIDw8IDIpKSA+PiAyXSA+PiAyXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKDcyMTYgKyAoZyA8PCAyKSkgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhoICsgNTQwICsgKGcgPDwgMikpID4+IDJdID0gYmkoNTE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjNShjWyhoICsgNTQwICsgKGcgPDwgMikpID4+IDJdIHwgMCwgMCwgNTE2KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbY1soaCArIDU0MCArIChnIDw8IDIpKSA+PiAyXSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tjWyg3MjE2ICsgKGcgPDwgMikpID4+IDJdID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGcgPSAoZyArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1soaCArIDIwKSA+PiAyXSA9IDcwO1xuICAgICAgICAgICAgICAgIGNbKGggKyAxMzA1MikgPj4gMl0gPSAzMjtcbiAgICAgICAgICAgICAgICBjWyhoICsgMTMwNTYpID4+IDJdID0gMzMyODA7XG4gICAgICAgICAgICAgICAgY1soaCArIDQpID4+IDJdID0gY1tmID4+IDJdO1xuICAgICAgICAgICAgICAgIGNbKGggKyA4KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgaWYgKCgoYlsoZiArIDQpID4+IDFdICYgMjU1KSB8IDApID09IDE2KSB7XG4gICAgICAgICAgICAgICAgICAgIGcgPSAoaCArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tnID4+IDJdID0gY1tnID4+IDJdIHwgNDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCgoYlsoZiArIDQpID4+IDFdICYgMzI3NjgpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBnID0gKGggKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbZyA+PiAyXSA9IGNbZyA+PiAyXSB8IDI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoZFsoZiArIDYpIHwgMF0gfCAwKSA9PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIGcgPSAoaCArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tnID4+IDJdID0gY1tnID4+IDJdIHwgMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZyA9IGVbKGYgKyA0KSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPT0gMzY4ODApIHtcbiAgICAgICAgICAgICAgICAgICAgY1soaCArIDEwNjApID4+IDJdID0gNDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChnIHwgMCkgPT0gMTYpIHtcbiAgICAgICAgICAgICAgICAgICAgY1soaCArIDEwNjApID4+IDJdID0gNjtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChnIHwgMCkgPT0gMzI3NzYpIHtcbiAgICAgICAgICAgICAgICAgICAgY1soaCArIDEwNjApID4+IDJdID0gMTA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoZyB8IDApID09IDgpIHtcbiAgICAgICAgICAgICAgICAgICAgY1soaCArIDEwNjApID4+IDJdID0gODtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChnIHwgMCkgPT0gMzI3ODQpIHtcbiAgICAgICAgICAgICAgICAgICAgY1soaCArIDEwNjApID4+IDJdID0gMjtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbbSA+PiAyXSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICA2MTQ0LFxuICAgICAgICAgICAgICAgICAgICAgICAgKChnID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgMSkgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyA3KSAmIC04KSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjW2cgPj4gMl0gPSAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGcpIHwgMFxuICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGc7XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyAxMDYwKSA+PiAyXSA9IDY7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNbKGggKyAxMDY0KSA+PiAyXSA9IGVbKGYgKyA4KSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgY1soaCArIDEwNjgpID4+IDJdID0gYmkoZVsoZiArIDgpID4+IDFdIDw8IDEpIHwgMDtcbiAgICAgICAgICAgICAgICBjWyhoICsgMTA3MikgPj4gMl0gPSBiaSgoZVsoZiArIDgpID4+IDFdIDw8IDEpIDw8IDIpIHwgMDtcbiAgICAgICAgICAgICAgICBjWyhoICsgMTIpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgXyhcbiAgICAgICAgICAgICAgICAgICAgICAgICgoY1soaCArIDgpID4+IDJdICYgMSkgfCAwKSAhPSAwID8gMSA6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGggKyA4KSA+PiAyXSAmIDQpIHwgMCkgIT0gMCA/IDIgOiAxXG4gICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgIGNbKGggKyAxMzA2MCkgPj4gMl0gPSAoKGNbZiA+PiAyXSB8IDApIC8gMWUzKSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKChjWyhoICsgMTMwNjApID4+IDJdIHwgMCkgPCAxKSB7XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyAxMzA2MCkgPj4gMl0gPSAxO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soaCArIDEzMDYwKSA+PiAyXSB8IDApID4gMjU1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhoICsgMTMwNjApID4+IDJdID0gMjU1O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNbKGggKyAxMzA2NCkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGNbKGggKyAxMzA2OCkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGNbKGggKyAxMzA3NikgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICBjcShrLCBoLCAoaCArIDEzMTAwKSB8IDAsIChoICsgMTMwNzIpIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoY1soaCArIDEzMDc2KSA+PiAyXSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgYzAoaCk7XG4gICAgICAgICAgICAgICAgICAgIGwgPSAwO1xuICAgICAgICAgICAgICAgICAgICBuID0gbDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGo7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1soaCArIDEwNTIpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICBjWyhoICsgMTA1NikgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGlmICgoYVs3NzI4XSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgayA9IGg7XG4gICAgICAgICAgICAgICAgICAgIGJ6KGssIDc3MjgpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYnYoaCkgfCAwO1xuICAgICAgICAgICAgICAgIGwgPSBoO1xuICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgIGkgPSBqO1xuICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNYKGEsIGIpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHJldHVybiBjVyhhLCAwLCBiKSB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjWShhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBiID0gMDtcbiAgICAgICAgICAgICAgICBiID0gYTtcbiAgICAgICAgICAgICAgICBieChiKTtcbiAgICAgICAgICAgICAgICBhID0gMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGEgfCAwKSA+PSAxMjgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soYiArIDI4ICsgKGEgPDwgMikpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYzAoY1soYiArIDI4ICsgKGEgPDwgMikpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhiICsgNTQwICsgKGEgPDwgMikpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYzAoY1soYiArIDU0MCArIChhIDw8IDIpKSA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGEgPSAoYSArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYzAoY1soYiArIDEwNzIpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgYzAoY1soYiArIDEwNjgpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgYzAoY1soYiArIDEzMDc2KSA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgIGEgPSAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhID4+PiAwID49IDgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soYiArIDEzMTA0ICsgKGEgPDwgMikpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYzAoY1soYiArIDEzMTA0ICsgKGEgPDwgMikpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYSA9IChhICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjMChiKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjWigpIHtcbiAgICAgICAgICAgICAgICB2YXIgYSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBkID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZSA9IDA7XG4gICAgICAgICAgICAgICAgYSA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChhIHwgMCkgPj0gMTI4KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKDY3MDQgKyAoYSA8PCAyKSkgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBiID0gY1tjWyg2NzA0ICsgKGEgPDwgMikpID4+IDJdID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYiB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGQgfCAwKSA+PSAxMjgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soYiArICgoZCAqIDI4KSB8IDApKSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMwKGNbKGIgKyAoKGQgKiAyOCkgfCAwKSkgPj4gMl0gfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gKGQgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMwKGIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYzAoY1soNjcwNCArIChhIDw8IDIpKSA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soNzIxNiArIChhIDw8IDIpKSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPSBjW2NbKDcyMTYgKyAoYSA8PCAyKSkgPj4gMl0gPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChlIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApID49IDEyOCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhlICsgKChkICogMjgpIHwgMCkpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYzAoY1soZSArICgoZCAqIDI4KSB8IDApKSA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZCArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYzAoZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjMChjWyg3MjE2ICsgKGEgPDwgMikpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYSA9IChhICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBiaygpO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNfKGIsIGMsIGQpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgYyA9IGMgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGkgPSAwO1xuICAgICAgICAgICAgICAgIGUgPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBjO1xuICAgICAgICAgICAgICAgIGMgPSBkO1xuICAgICAgICAgICAgICAgIGQgPSAwO1xuICAgICAgICAgICAgICAgIGYgPSAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApIDwgKGIgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9ICgoZiB8IDApICE9IDApIF4gMTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGcgPSAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICghZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChhbigoZSArIGQpIHwgMCwgMSwgMSwgYyB8IDApIHwgMCkgIT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaCA9IDE3NTI7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGFbKGUgKyBkKSB8IDBdIHwgMCkgPT0gMTApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGggPSAxNzU1O1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhWyhlICsgZCkgfCAwXSB8IDApID09IDEzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA9IDE3NTU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChoIHwgMCkgPT0gMTc1NSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaCA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBhWyhlICsgZCkgfCAwXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBkID0gKGQgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGFbKGUgKyBkKSB8IDBdID0gMDtcbiAgICAgICAgICAgICAgICBpZiAoKGQgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBlO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaSB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjJChhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBiID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwLFxuICAgICAgICAgICAgICAgICAgICBvID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHEgPSAwLFxuICAgICAgICAgICAgICAgICAgICByID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHQgPSAwLFxuICAgICAgICAgICAgICAgICAgICB1ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHcgPSAwLFxuICAgICAgICAgICAgICAgICAgICB4ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgeSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHogPSAwLFxuICAgICAgICAgICAgICAgICAgICBBID0gMCxcbiAgICAgICAgICAgICAgICAgICAgQiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEMgPSAwLFxuICAgICAgICAgICAgICAgICAgICBEID0gMCxcbiAgICAgICAgICAgICAgICAgICAgRSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBHID0gMCxcbiAgICAgICAgICAgICAgICAgICAgSCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEkgPSAwLFxuICAgICAgICAgICAgICAgICAgICBKID0gMCxcbiAgICAgICAgICAgICAgICAgICAgSyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEwgPSAwLFxuICAgICAgICAgICAgICAgICAgICBNID0gMCxcbiAgICAgICAgICAgICAgICAgICAgTiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIE8gPSAwLFxuICAgICAgICAgICAgICAgICAgICBQID0gMCxcbiAgICAgICAgICAgICAgICAgICAgUSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIFIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBTID0gMCxcbiAgICAgICAgICAgICAgICAgICAgVCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIFUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBWID0gMCxcbiAgICAgICAgICAgICAgICAgICAgVyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIFggPSAwLFxuICAgICAgICAgICAgICAgICAgICBZID0gMCxcbiAgICAgICAgICAgICAgICAgICAgWiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIF8gPSAwLFxuICAgICAgICAgICAgICAgICAgICAkID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYWEgPSAwLFxuICAgICAgICAgICAgICAgICAgICBhYiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGFjID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYWQgPSAwLFxuICAgICAgICAgICAgICAgICAgICBhZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGFmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYWcgPSAwLFxuICAgICAgICAgICAgICAgICAgICBhaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGFpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYWogPSAwLFxuICAgICAgICAgICAgICAgICAgICBhayA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGFsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYW4gPSAwLFxuICAgICAgICAgICAgICAgICAgICBhbyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGFwID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYXIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBhcyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGF0ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYXUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBhdiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGF3ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYXggPSAwLFxuICAgICAgICAgICAgICAgICAgICBheSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGF6ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYUEgPSAwLFxuICAgICAgICAgICAgICAgICAgICBhQiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGFDID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYUQgPSAwLFxuICAgICAgICAgICAgICAgICAgICBhRSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGFGID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYUcgPSAwLFxuICAgICAgICAgICAgICAgICAgICBhSCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGFJID0gMDtcbiAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhID4+PiAwIDwgMjQ1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYSA+Pj4gMCA8IDExKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9IDE2O1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID0gKGEgKyAxMSkgJiAtODtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSBiID4+PiAzO1xuICAgICAgICAgICAgICAgICAgICAgICAgZSA9IGNbMTk5Nl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZiA9IGUgPj4+IChkID4+PiAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKGYgJiAzKSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gKCgoZiAmIDEpIF4gMSkgKyBkKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA9IGcgPDwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gKDgwMjQgKyAoaCA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSAoODAyNCArICgoaCArIDIpIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA9IGNbaiA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgayA9IChoICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBjW2sgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChpIHwgMCkgPT0gKGwgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk2XSA9IGUgJiB+KDEgPDwgZyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobCA+Pj4gMCA8IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gKGwgKyAxMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjW20gPj4gMl0gfCAwKSA9PSAoaCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW2ogPj4gMl0gPSBsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IGcgPDwgMztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhoICsgNCkgPj4gMl0gPSBsIHwgMztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gKGggKyAobCB8IDQpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tqID4+IDJdID0gY1tqID4+IDJdIHwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYiA+Pj4gMCA8PSAoY1sxOTk4XSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IGI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IDIgPDwgZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gKGYgPDwgZCkgJiAoaiB8IC1qKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gKChsICYgLWwpIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSAoaiA+Pj4gMTIpICYgMTY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGogPj4+IChsID4+PiAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gKGkgPj4+IDUpICYgODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gaSA+Pj4gKGogPj4+IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSAobSA+Pj4gMikgJiA0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBtID4+PiAoaSA+Pj4gMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IChwID4+PiAxKSAmIDI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IHAgPj4+IChtID4+PiAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwID0gKHEgPj4+IDEpICYgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gKChqIHwgbCB8IGkgfCBtIHwgcCkgKyAocSA+Pj4gKHAgPj4+IDApKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSByIDw8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9ICg4MDI0ICsgKHAgPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gKDgwMjQgKyAoKHAgKyAyKSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBjW20gPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSAocCArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gY1tpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgocSB8IDApID09IChsIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5Nl0gPSBlICYgfigxIDw8IHIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGwgPj4+IDAgPCAoY1syZTNdIHwgMCkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IChsICsgMTIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1tqID4+IDJdIHwgMCkgPT0gKHAgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbaiA+PiAyXSA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdID0gbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSByIDw8IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IChsIC0gYikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHAgKyA0KSA+PiAyXSA9IGIgfCAzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAocSArIGIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgKGIgfCA0KSkgPj4gMl0gPSBtIHwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgbCkgPj4gMl0gPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBjWzE5OThdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBjWzIwMDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IGwgPj4+IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBkIDw8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAoODAyNCArIChsIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBjWzE5OTZdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA9IDEgPDwgZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoayAmIGgpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5Nl0gPSBrIHwgaDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzID0gZjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gKDgwMjQgKyAoKGwgKyAyKSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gKDgwMjQgKyAoKGwgKyAyKSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPSBjW2QgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChnID4+PiAwID49IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdCA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1t0ID4+IDJdID0gcTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socyArIDEyKSA+PiAyXSA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyA4KSA+PiAyXSA9IHM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAxMikgPj4gMl0gPSBmO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE5OThdID0gbTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzIwMDFdID0gZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gY1sxOTk3XSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IGI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBoID0gKChsICYgLWwpIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgbCA9IChoID4+PiAxMikgJiAxNjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBoID4+PiAobCA+Pj4gMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBoID0gKGsgPj4+IDUpICYgODtcbiAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBrID4+PiAoaCA+Pj4gMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBrID0gKHAgPj4+IDIpICYgNDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBwID4+PiAoayA+Pj4gMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBwID0gKHIgPj4+IDEpICYgMjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSByID4+PiAocCA+Pj4gMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICByID0gKGQgPj4+IDEpICYgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGcgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICg4Mjg4ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGggfCBsIHwgayB8IHAgfCByKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGQgPj4+IChyID4+PiAwKSkpIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICByID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSBnO1xuICAgICAgICAgICAgICAgICAgICAgICAgcCA9ICgoY1soZyArIDQpID4+IDJdICYgLTgpIC0gYikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gY1sociArIDE2KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gY1sociArIDIwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoayB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZyA9ICgoY1sodSArIDQpID4+IDJdICYgLTgpIC0gYikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBnID4+PiAwIDwgcCA+Pj4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gdTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gayA/IHUgOiBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBrID8gZyA6IHA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBjWzJlM10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHIgPj4+IDAgPCBpID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAociArIGIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHIgPj4+IDAgPj0gZSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gY1soZCArIDI0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gY1soZCArIDEyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgPT0gKGQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gKGQgKyAyMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gY1txID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgayA9IChkICsgMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBjW2sgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChsIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHYgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgPSBnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAodyArIDIwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gY1txID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gcTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAodyArIDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gY1txID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdyA9IGc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHggPj4+IDAgPCBpID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW3ggPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdiA9IHc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBjWyhkICsgOCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocSA+Pj4gMCA8IGkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gKHEgKyAxMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbZyA+PiAyXSB8IDApICE9IChkIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gKGYgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1trID4+IDJdIHwgMCkgPT0gKGQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tnID4+IDJdID0gZjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbayA+PiAyXSA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gZjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBMMjMwNDogZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZiA9IChkICsgMjgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9ICg4Mjg4ICsgKGNbZiA+PiAyXSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGQgfCAwKSA9PSAoY1tpID4+IDJdIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW2kgPj4gMl0gPSB2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodiB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5N10gPSBjWzE5OTddICYgfigxIDw8IGNbZiA+PiAyXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDIzMDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gKGUgKyAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1txID4+IDJdIHwgMCkgPT0gKGQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW3EgPj4gMl0gPSB2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGUgKyAyMCkgPj4gMl0gPSB2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwyMzA0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2ID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sodiArIDI0KSA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSBjWyhkICsgMTYpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHYgKyAxNikgPj4gMl0gPSBmO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgMjQpID4+IDJdID0gdjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZiA9IGNbKGQgKyAyMCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZiA+Pj4gMCA8IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sodiArIDIwKSA+PiAyXSA9IGY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgMjQpID4+IDJdID0gdjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocCA+Pj4gMCA8IDE2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA9IChwICsgYikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGQgKyA0KSA+PiAyXSA9IGUgfCAzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAociArIChlICsgNCkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW2YgPj4gMl0gPSBjW2YgPj4gMl0gfCAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhkICsgNCkgPj4gMl0gPSBiIHwgMztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhyICsgKGIgfCA0KSkgPj4gMl0gPSBwIHwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhyICsgKHAgKyBiKSkgPj4gMl0gPSBwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSBjWzE5OThdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgPSBjWzIwMDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGYgPj4+IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSBpIDw8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAoODAyNCArIChmIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBjWzE5OTZdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZyA9IDEgPDwgaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoayAmIGcpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5Nl0gPSBrIHwgZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5ID0gcTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gKDgwMjQgKyAoKGYgKyAyKSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gKDgwMjQgKyAoKGYgKyAyKSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBjW2kgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsID4+PiAwID49IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5ID0gbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IGk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1t6ID4+IDJdID0gZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soeSArIDEyKSA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGUgKyA4KSA+PiAyXSA9IHk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGUgKyAxMikgPj4gMl0gPSBxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE5OThdID0gcDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzIwMDFdID0gbTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAoZCArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvID0gYjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbiA9IGY7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYSA+Pj4gMCA+IDQyOTQ5NjcyMzEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gKGEgKyAxMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IGYgJiAtODtcbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBjWzE5OTddIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoayB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHIgPSAtZyB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gZiA+Pj4gODtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEEgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChnID4+PiAwID4gMTY3NzcyMTUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEEgPSAzMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAoKChpICsgMTA0ODMyMCkgfCAwKSA+Pj4gMTYpICYgODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IGkgPDwgZjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA9ICgoKGwgKyA1MjAxOTIpIHwgMCkgPj4+IDE2KSAmIDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSBsIDw8IGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSAoKChqICsgMjQ1NzYwKSB8IDApID4+PiAxNikgJiAyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCID0gKDE0IC0gKGggfCBmIHwgbCkgKyAoKGogPDwgbCkgPj4+IDE1KSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZyA+Pj4gKCgoQiArIDcpIHwgMCkgPj4+IDApKSAmIDEpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChCIDw8IDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGNbKDgyODggKyAoQSA8PCAyKSkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgTDIzNTI6IGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChBIHwgMCkgPT0gMzEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEYgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRiA9ICgyNSAtIChBID4+PiAxKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IGk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBnIDw8IEY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQiA9IGNbKHAgKyA0KSA+PiAyXSAmIC04O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IChCIC0gZykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGwgPj4+IDAgPCBtID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChCIHwgMCkgPT0gKGcgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDID0gcDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IGw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEUgPSBwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMjM1MjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHID0gcDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSCA9IGw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIID0gbTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBjWyhwICsgMjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEIgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHAgKyAxNiArICgocSA+Pj4gMzEpIDw8IDIpKSA+PiAyXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgobCB8IDApID09IDApIHwgKChsIHwgMCkgPT0gKEIgfCAwKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoQiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDID0gRztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gSDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IEc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IEg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IEI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IHEgPDwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoRSB8IDApID09IDApICYgKChDIHwgMCkgPT0gMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gMiA8PCBBO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBrICYgKGkgfCAtaSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChyIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSAoKHIgJiAtcikgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IChpID4+PiAxMikgJiAxNjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlID0gaSA+Pj4gKHIgPj4+IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSAoZSA+Pj4gNSkgJiA4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBlID4+PiAoaSA+Pj4gMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA9IChxID4+PiAyKSAmIDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IHEgPj4+IChlID4+PiAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gKHAgPj4+IDEpICYgMjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gcCA+Pj4gKHEgPj4+IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSAobSA+Pj4gMSkgJiAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEkgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDgyODggK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGkgfCByIHwgZSB8IHEgfCBwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtID4+PiAocCA+Pj4gMCkpKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBJID0gRTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoSSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBKID0gRDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBLID0gQztcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IEk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IEQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IEM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA9ICgoY1socCArIDQpID4+IDJdICYgLTgpIC0gZykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gZSA+Pj4gMCA8IG0gPj4+IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSByID8gZSA6IG07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgPSByID8gcCA6IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBjWyhwICsgMTYpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChyIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IHI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IGNbKHAgKyAyMCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHIgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBKID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEsgPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwID0gcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEsgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IGc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoSiA+Pj4gMCA+PSAoKChjWzE5OThdIHwgMCkgLSBnKSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IGc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBxID0gSztcbiAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBjWzJlM10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHEgPj4+IDAgPCBtID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHAgPSAocSArIGcpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHEgPj4+IDAgPj0gcCA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gY1soSyArIDI0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gY1soSyArIDEyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChpIHwgMCkgPT0gKEsgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gKEsgKyAyMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gY1tyID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChkIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IChLICsgMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEIgPSBjW2ogPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChCIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEwgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNID0gQjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE0gPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTiA9IHI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSAoTSArIDIwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gY1tyID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOID0gcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSAoTSArIDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gY1tyID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTiA9IHI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKE4gPj4+IDAgPCBtID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW04gPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTCA9IE07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBjWyhLICsgOCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAociA+Pj4gMCA8IG0gPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gKHIgKyAxMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbZCA+PiAyXSB8IDApICE9IChLIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gKGkgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1tqID4+IDJdIHwgMCkgPT0gKEsgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tkID4+IDJdID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbaiA+PiAyXSA9IHI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBMMjQwMjogZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IChLICsgMjgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9ICg4Mjg4ICsgKGNbaSA+PiAyXSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEsgfCAwKSA9PSAoY1ttID4+IDJdIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gPSBMO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoTCB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5N10gPSBjWzE5OTddICYgfigxIDw8IGNbaSA+PiAyXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDI0MDI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gKGUgKyAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1tyID4+IDJdIHwgMCkgPT0gKEsgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW3IgPj4gMl0gPSBMO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGUgKyAyMCkgPj4gMl0gPSBMO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEwgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwyNDAyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChMID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soTCArIDI0KSA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBjWyhLICsgMTYpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKEwgKyAxNikgPj4gMl0gPSBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhpICsgMjQpID4+IDJdID0gTDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGNbKEsgKyAyMCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA+Pj4gMCA8IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soTCArIDIwKSA+PiAyXSA9IGk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhpICsgMjQpID4+IDJdID0gTDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEogPj4+IDAgPCAxNikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlID0gKEogKyBnKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKEsgKyA0KSA+PiAyXSA9IGUgfCAzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gKHEgKyAoZSArIDQpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbaSA+PiAyXSA9IGNbaSA+PiAyXSB8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soSyArIDQpID4+IDJdID0gZyB8IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAoZyB8IDQpKSA+PiAyXSA9IEogfCAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgKEogKyBnKSkgPj4gMl0gPSBKO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gSiA+Pj4gMztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEogPj4+IDAgPCAyNTYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgPSBpIDw8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gKDgwMjQgKyAoZSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IGNbMTk5Nl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IDEgPDwgaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChyICYgaikgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5Nl0gPSByIHwgajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTyA9IG07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFAgPSAoODAyNCArICgoZSArIDIpIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9ICg4MDI0ICsgKChlICsgMikgPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IGNbaSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkID4+PiAwID49IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTyA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tQID4+IDJdID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKE8gKyAxMikgPj4gMl0gPSBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIChnICsgOCkpID4+IDJdID0gTztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAoZyArIDEyKSkgPj4gMl0gPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA9IHA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSBKID4+PiA4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGogfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChKID4+PiAwID4gMTY3NzcyMTUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9IDMxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9ICgoKGogKyAxMDQ4MzIwKSB8IDApID4+PiAxNikgJiA4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBqIDw8IHI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9ICgoKGkgKyA1MjAxOTIpIHwgMCkgPj4+IDE2KSAmIDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQiA9IGkgPDwgZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gKCgoQiArIDI0NTc2MCkgfCAwKSA+Pj4gMTYpICYgMjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDE0IC1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkIHwgciB8IGkpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoQiA8PCBpKSA+Pj4gMTUpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoSiA+Pj4gKCgobCArIDcpIHwgMCkgPj4+IDApKSAmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsIDw8IDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9ICg4Mjg4ICsgKFEgPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIChnICsgMjgpKSA+PiAyXSA9IFE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAoZyArIDIwKSkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgKGcgKyAxNikpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGNbMTk5N10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gMSA8PCBRO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChtICYgbCkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE5OTddID0gbSB8IGw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW2ogPj4gMl0gPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIChnICsgMjQpKSA+PiAyXSA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgKGcgKyAxMikpID4+IDJdID0gZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAoZyArIDgpKSA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKFEgfCAwKSA9PSAzMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUiA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSID0gKDI1IC0gKFEgPj4+IDEpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IEogPDwgUjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGNbaiA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhtICsgNCkgPj4gMl0gJiAtOCkgfCAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChKIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUyA9IChtICsgMTYgKyAoKGwgPj4+IDMxKSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IGNbUyA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGogfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVCA9IDE5MTM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBsIDw8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChUIHwgMCkgPT0gMTkxMykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFMgPj4+IDAgPCAoY1syZTNdIHwgMCkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1MgPj4gMl0gPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAoZyArIDI0KSkgPj4gMl0gPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAoZyArIDEyKSkgPj4gMl0gPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAoZyArIDgpKSA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IChtICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gY1tsID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGNbMmUzXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtID4+PiAwIDwgaSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChqID4+PiAwIDwgaSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soaiArIDEyKSA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW2wgPj4gMl0gPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIChnICsgOCkpID4+IDJdID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAoZyArIDEyKSkgPj4gMl0gPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIChnICsgMjQpKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgcSA9IChLICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChxIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8gPSBnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuID0gcTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIEsgPSBjWzE5OThdIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAobyA+Pj4gMCA8PSBLID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIFMgPSAoSyAtIG8pIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgSiA9IGNbMjAwMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoUyA+Pj4gMCA+IDE1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBSID0gSjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbMjAwMV0gPSBSICsgbztcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5OF0gPSBTO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1soUiArIChvICsgNCkpID4+IDJdID0gUyB8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhSICsgSykgPj4gMl0gPSBTO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1soSiArIDQpID4+IDJdID0gbyB8IDM7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWzE5OThdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbMjAwMV0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1soSiArIDQpID4+IDJdID0gSyB8IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICBTID0gKEogKyAoSyArIDQpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjW1MgPj4gMl0gPSBjW1MgPj4gMl0gfCAxO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIG4gPSAoSiArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBKID0gY1sxOTk5XSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKG8gPj4+IDAgPCBKID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIFMgPSAoSiAtIG8pIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1sxOTk5XSA9IFM7XG4gICAgICAgICAgICAgICAgICAgIEogPSBjWzIwMDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgSyA9IEo7XG4gICAgICAgICAgICAgICAgICAgIGNbMjAwMl0gPSBLICsgbztcbiAgICAgICAgICAgICAgICAgICAgY1soSyArIChvICsgNCkpID4+IDJdID0gUyB8IDE7XG4gICAgICAgICAgICAgICAgICAgIGNbKEogKyA0KSA+PiAyXSA9IG8gfCAzO1xuICAgICAgICAgICAgICAgICAgICBuID0gKEogKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGNbMTY2Nl0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBKID0gYW0oMzApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKChKIC0gMSkgJiBKKSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE2NjhdID0gSjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE2NjddID0gSjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE2NjldID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxNjcwXSA9IC0xO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTY3MV0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMjEwN10gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTY2Nl0gPSAoKGFKKDApIHwgMCkgJiAtMTYpIF4gMTQzMTY1NTc2ODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIEogPSAobyArIDQ4KSB8IDA7XG4gICAgICAgICAgICAgICAgUyA9IGNbMTY2OF0gfCAwO1xuICAgICAgICAgICAgICAgIEsgPSAobyArIDQ3KSB8IDA7XG4gICAgICAgICAgICAgICAgUiA9IChTICsgSykgfCAwO1xuICAgICAgICAgICAgICAgIFEgPSAtUyB8IDA7XG4gICAgICAgICAgICAgICAgUyA9IFIgJiBRO1xuICAgICAgICAgICAgICAgIGlmIChTID4+PiAwIDw9IG8gPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgbiA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgTyA9IGNbMjEwNl0gfCAwO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChPIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgUCA9IGNbMjEwNF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgTCA9IChQICsgUykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChMID4+PiAwIDw9IFAgPj4+IDApIHwgKEwgPj4+IDAgPiBPID4+PiAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG4gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIEwyNDk0OiBkbyB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoKGNbMjEwN10gJiA0KSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIE8gPSBjWzIwMDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIEwyNDk2OiBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChPIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUID0gMTk0MztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMID0gTztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUCA9IDg0MzI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVID0gUCB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNID0gY1tVID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChNID4+PiAwIDw9IEwgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWID0gKFAgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKE0gKyAoY1tWID4+IDJdIHwgMCkpIHwgMCkgPj4+IDAgPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMID4+PiAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE0gPSBjWyhQICsgOCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChNIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFQgPSAxOTQzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwyNDk2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQID0gTTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKFAgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUID0gMTk0MztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEwgPSAoUiAtIChjWzE5OTldIHwgMCkpICYgUTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEwgPj4+IDAgPj0gMjE0NzQ4MzY0Nykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVyA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gYVMoTCB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobSB8IDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChjW1UgPj4gMl0gfCAwKSArIChjW1YgPj4gMl0gfCAwKSkgfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWCA9IGUgPyBtIDogLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFkgPSBlID8gTCA6IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFogPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfID0gTDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVCA9IDE5NTI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChUIHwgMCkgPT0gMTk0Mykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPID0gYVMoMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKE8gfCAwKSA9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVyA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gTztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTCA9IGNbMTY2N10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gKEwgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKG0gJiBnKSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQgPSBTO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJCA9IChTIC0gZyArICgobSArIGcpICYgLUwpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTCA9IGNbMjEwNF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gKEwgKyAkKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICEoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCQgPj4+IDAgPiBvID4+PiAwKSAmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCQgPj4+IDAgPCAyMTQ3NDgzNjQ3KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFcgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGNbMjEwNl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGcgPj4+IDAgPD0gTCA+Pj4gMCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChnID4+PiAwID4gbSA+Pj4gMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFcgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBhUygkIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gKG0gfCAwKSA9PSAoTyB8IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBYID0gZyA/IE8gOiAtMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWSA9IGcgPyAkIDogMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWiA9IG07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8gPSAkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUID0gMTk1MjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIEwyNTE2OiBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChUIHwgMCkgPT0gMTk1Mikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gLV8gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKFggfCAwKSAhPSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWEgPSBZO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWIgPSBYO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVCA9IDE5NjM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMjQ5NDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChaIHwgMCkgIT0gLTEpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoXyA+Pj4gMCA8IDIxNDc0ODM2NDcpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoXyA+Pj4gMCA8IEogPj4+IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gY1sxNjY4XSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTyA9IChLIC0gXyArIGcpICYgLWc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKE8gPj4+IDAgPj0gMjE0NzQ4MzY0Nykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYyA9IF87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFTKE8gfCAwKSB8IDApID09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFTKG0gfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFcgPSBZO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMjUxNjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYyA9IChPICsgXykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjID0gXztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoWiB8IDApID09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXID0gWTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFhID0gYWM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYiA9IFo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUID0gMTk2MztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwyNDk0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWzIxMDddID0gY1syMTA3XSB8IDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBhZCA9IFc7XG4gICAgICAgICAgICAgICAgICAgICAgICBUID0gMTk2MDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFkID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIFQgPSAxOTYwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKFQgfCAwKSA9PSAxOTYwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoUyA+Pj4gMCA+PSAyMTQ3NDgzNjQ3KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBXID0gYVMoUyB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIFogPSBhUygwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChaIHwgMCkgIT0gLTEpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChXIHwgMCkgIT0gLTEpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFcgPj4+IDAgPCBaID4+PiAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYWMgPSAoWiAtIFcpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIFogPSBhYyA+Pj4gMCA+ICgobyArIDQwKSB8IDApID4+PiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgWSA9IFogPyBXIDogLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKFkgfCAwKSAhPSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFhID0gWiA/IGFjIDogYWQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWIgPSBZO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFQgPSAxOTYzO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKFQgfCAwKSA9PSAxOTYzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhZCA9ICgoY1syMTA0XSB8IDApICsgYWEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbMjEwNF0gPSBhZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhZCA+Pj4gMCA+IChjWzIxMDVdIHwgMCkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzIxMDVdID0gYWQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBhZCA9IGNbMjAwMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgTDI1MzY6IGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFkIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTID0gY1syZTNdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoUyB8IDApID09IDApIHwgKGFiID4+PiAwIDwgUyA+Pj4gMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMmUzXSA9IGFiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMjEwOF0gPSBhYjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMTA5XSA9IGFhO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzIxMTFdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMDA1XSA9IGNbMTY2Nl07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMjAwNF0gPSAtMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUyA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFkgPSBTIDw8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYyA9ICg4MDI0ICsgKFkgPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKDgwMjQgKyAoKFkgKyAzKSA8PCAyKSkgPj4gMl0gPSBhYztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKDgwMjQgKyAoKFkgKyAyKSA8PCAyKSkgPj4gMl0gPSBhYztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFMgPSAoUyArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoUyA+Pj4gMCA8IDMyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUyA9IChhYiArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoUyAmIDcpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWUgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWUgPSAtUyAmIDc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUyA9IChhYSAtIDQwIC0gYWUpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMDAyXSA9IGFiICsgYWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5OV0gPSBTO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYiArIChhZSArIDQpKSA+PiAyXSA9IFMgfCAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYiArIChhYSAtIDM2KSkgPj4gMl0gPSA0MDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMDAzXSA9IGNbMTY3MF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUyA9IDg0MzI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZiA9IGNbUyA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZyA9IChTICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWggPSBjW2FnID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYWIgfCAwKSA9PSAoKGFmICsgYWgpIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUID0gMTk3NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjID0gY1soUyArIDgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYWMgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFMgPSBhYztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKFQgfCAwKSA9PSAxOTc1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoY1soUyArIDEyKSA+PiAyXSAmIDgpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWMgPSBhZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICEoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWMgPj4+IDAgPj0gYWYgPj4+IDApICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYyA+Pj4gMCA8IGFiID4+PiAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW2FnID4+IDJdID0gYWggKyBhYTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYyA9IGNbMjAwMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFkgPSAoKGNbMTk5OV0gfCAwKSArIGFhKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWiA9IGFjO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFcgPSAoYWMgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoVyAmIDcpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhaSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWkgPSAtVyAmIDc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFcgPSAoWSAtIGFpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMDAyXSA9IFogKyBhaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE5OTldID0gVztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhaICsgKGFpICsgNCkpID4+IDJdID0gVyB8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soWiArIChZICsgNCkpID4+IDJdID0gNDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMDAzXSA9IGNbMTY3MF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDI1MzY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWIgPj4+IDAgPCAoY1syZTNdIHwgMCkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMmUzXSA9IGFiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFMgPSAoYWIgKyBhYSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBZID0gODQzMjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFqID0gWSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbYWogPj4gMl0gfCAwKSA9PSAoUyB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVCA9IDE5ODU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBaID0gY1soWSArIDgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoWiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWSA9IFo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChUIHwgMCkgPT0gMTk4NSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKGNbKFkgKyAxMikgPj4gMl0gJiA4KSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbYWogPj4gMl0gPSBhYjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTID0gKFkgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tTID4+IDJdID0gKGNbUyA+PiAyXSB8IDApICsgYWE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUyA9IChhYiArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChTICYgNykgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFrID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhayA9IC1TICYgNztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUyA9IChhYiArIChhYSArIDgpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoUyAmIDcpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbCA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWwgPSAtUyAmIDc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFMgPSAoYWIgKyAoYWwgKyBhYSkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBaID0gUztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXID0gKGFrICsgbykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjID0gKGFiICsgVykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBhYztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBLID0gKFMgLSAoYWIgKyBhaykgLSBvKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWIgKyAoYWsgKyA0KSkgPj4gMl0gPSBvIHwgMztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoWiB8IDApID09IChjWzIwMDJdIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEogPSAoKGNbMTk5OV0gfCAwKSArIEspIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5OV0gPSBKO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMDAyXSA9IF87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYiArIChXICsgNCkpID4+IDJdID0gSiB8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKFogfCAwKSA9PSAoY1syMDAxXSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSiA9ICgoY1sxOTk4XSB8IDApICsgSykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5OF0gPSBKO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMjAwMV0gPSBfO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGFiICsgKFcgKyA0KSkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBKIHwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYiArIChKICsgVykpID4+IDJdID0gSjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEogPSAoYWEgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBYID0gY1soYWIgKyAoSiArIGFsKSkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoWCAmIDMpIHwgMCkgPT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQgPSBYICYgLTg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgViA9IFggPj4+IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTDI1NzE6IGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFggPj4+IDAgPCAyNTYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFUgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGFsIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4KSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWEpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFiICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFIgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICg4MDI0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChWIDw8IDEpIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoVSB8IDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChSIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWzJlM10gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFUgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMikgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChaIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUSB8IDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFUgfCAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk2XSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5Nl0gJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB+KDEgPDwgVik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUSB8IDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChSIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW4gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFEgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWzJlM10gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFogfCAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuID0gbTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoVSArIDEyKSA+PiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gUTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbYW4gPj4gMl0gPSBVO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUiA9IFM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWIgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChhbCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjQpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYSkpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWIgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFhICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWwpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFAgfCAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUiB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE8gPSBhbCB8IDE2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEogK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChPICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFhKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTyB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW8gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcCA9IE87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXIgPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXAgPSBMO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXIgPSBnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYXAgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXAgPSBMO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhcCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEwgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXAgPSBMO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhciA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWzJlM10gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW8gPSBhcDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZyA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoYWwgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWEpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZyA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWzJlM10gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEwgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChSIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFIgfCAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTCA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gUDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFvID0gUDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWIgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWEgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjggK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWwpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFUgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICg4Mjg4ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQID4+IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFIgfCAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tVID4+IDJdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVID4+IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGFvO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYW8gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk3XSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE5OTddICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH4oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFAgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMjU3MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgPFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbMmUzXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPj4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBRID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNikgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFIgfCAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gYW87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjApID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSBhbztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYW8gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDI1NzE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbyA+Pj4gMCA8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbMmUzXSB8IDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYW8gKyAyNCkgPj4gMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IG07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSID0gYWwgfCAxNjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFAgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWEpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFAgfCAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFAgPj4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1syZTNdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYW8gK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNikgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IFA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChQICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSBhbztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWIgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEogK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChQIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFAgPj4+IDAgPFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWzJlM10gfCAwKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFvICsgMjApID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IFA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFAgKyAyNCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gYW87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcyA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYiArICgoJCB8IGFsKSArIGFhKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0ID0gKCQgKyBLKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFzID0gWjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdCA9IEs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBKID0gKGFzICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tKID4+IDJdID0gY1tKID4+IDJdICYgLTI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYiArIChXICsgNCkpID4+IDJdID0gYXQgfCAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWIgKyAoYXQgKyBXKSkgPj4gMl0gPSBhdDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEogPSBhdCA+Pj4gMztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhdCA+Pj4gMCA8IDI1Nikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFYgPSBKIDw8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWCA9ICg4MDI0ICsgKFYgPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQID0gY1sxOTk2XSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IDEgPDwgSjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoUCAmIG0pIHwgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE5OTZdID0gUCB8IG07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdSA9IFg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDgwMjQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKFYgKyAyKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDgwMjQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKFYgKyAyKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVSA9IGNbSiA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVSA+Pj4gMCA+PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWzJlM10gfCAwKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXUgPSBVO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF2ID0gSjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbYXYgPj4gMl0gPSBfO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGF1ICsgMTIpID4+IDJdID0gXztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYiArIChXICsgOCkpID4+IDJdID0gYXU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWIgKyAoVyArIDEyKSkgPj4gMl0gPSBYO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgViA9IGFjO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGF0ID4+PiA4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXcgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0ID4+PiAwID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2Nzc3MjE1XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXcgPSAzMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFAgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgobSArIDEwNDgzMjApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNikgJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJCA9IG0gPDwgUDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKCgkICsgNTIwMTkyKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPj4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFUgPSAkIDw8IEo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoVSArIDI0NTc2MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2KSAmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBRID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgxNCAtXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEogfCBQIHwgJCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoVSA8PCAkKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTUpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdyA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGF0ID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKFEgKyA3KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSkgJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChRIDw8IDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9ICg4Mjg4ICsgKGF3IDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYiArIChXICsgMjgpKSA+PiAyXSA9IGF3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWIgKyAoVyArIDIwKSkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWIgKyAoVyArIDE2KSkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWCA9IGNbMTk5N10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9IDEgPDwgYXc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChYICYgUSkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk3XSA9IFggfCBRO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbbSA+PiAyXSA9IFY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWIgKyAoVyArIDI0KSkgPj4gMl0gPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGFiICsgKFcgKyAxMikpID4+IDJdID0gVjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYiArIChXICsgOCkpID4+IDJdID0gVjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYXcgfCAwKSA9PSAzMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF4ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXggPSAoMjUgLSAoYXcgPj4+IDEpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBRID0gYXQgPDwgYXg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBYID0gY1ttID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKFggKyA0KSA+PiAyXSAmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGF0IHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF5ID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFggK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChRID4+PiAzMSkgPDwgMikpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gY1theSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChtIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUID0gMjA1ODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9IFEgPDwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWCA9IG07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChUIHwgMCkgPT0gMjA1OCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXkgPj4+IDAgPFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1syZTNdIHwgMCkgPj4+IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1theSA+PiAyXSA9IFY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWIgKyAoVyArIDI0KSkgPj4gMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gWDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYiArIChXICsgMTIpKSA+PiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSBWO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFiICsgKFcgKyA4KSkgPj4gMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gVjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9IChYICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGNbUSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkID0gY1syZTNdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChYID4+PiAwIDwgJCA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobSA+Pj4gMCA8ICQgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhtICsgMTIpID4+IDJdID0gVjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1EgPj4gMl0gPSBWO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGFiICsgKFcgKyA4KSkgPj4gMl0gPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGFiICsgKFcgKyAxMikpID4+IDJdID0gWDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYiArIChXICsgMjQpKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuID0gKGFiICsgKGFrIHwgOCkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBZID0gYWQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFcgPSA4NDMyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXogPSBjW1cgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGF6ID4+PiAwIDw9IFkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhQSA9IGNbKFcgKyA0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYUIgPSAoYXogKyBhQSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhQiA+Pj4gMCA+IFkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVyA9IGNbKFcgKyA4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVyA9IChheiArIChhQSAtIDM5KSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChXICYgNykgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhQyA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhQyA9IC1XICYgNztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXID0gKGF6ICsgKGFBIC0gNDcgKyBhQykpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWMgPSBXID4+PiAwIDwgKChhZCArIDE2KSB8IDApID4+PiAwID8gWSA6IFc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFcgPSAoYWMgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8gPSAoYWIgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKF8gJiA3KSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFEID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFEID0gLV8gJiA3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8gPSAoYWEgLSA0MCAtIGFEKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMjAwMl0gPSBhYiArIGFEO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE5OTldID0gXztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWIgKyAoYUQgKyA0KSkgPj4gMl0gPSBfIHwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWIgKyAoYWEgLSAzNikpID4+IDJdID0gNDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMjAwM10gPSBjWzE2NzBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYyArIDQpID4+IDJdID0gMjc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbVyA+PiAyXSA9IGNbMjEwOF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKFcgKyA0KSA+PiAyXSA9IGNbMjEwOV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKFcgKyA4KSA+PiAyXSA9IGNbMjExMF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKFcgKyAxMikgPj4gMl0gPSBjWzIxMTFdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzIxMDhdID0gYWI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMjEwOV0gPSBhYTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMTExXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMjExMF0gPSBXO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXID0gKGFjICsgMjgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tXID4+IDJdID0gNztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoYWMgKyAzMikgfCAwKSA+Pj4gMCA8IGFCID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfID0gVztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVyA9IChfICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbVyA+PiAyXSA9IDc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoXyArIDgpIHwgMCkgPj4+IDAgPCBhQiA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfID0gVztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhYyB8IDApID09IChZIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8gPSAoYWMgLSBhZCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXID0gKFkgKyAoXyArIDQpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbVyA+PiAyXSA9IGNbVyA+PiAyXSAmIC0yO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhZCArIDQpID4+IDJdID0gXyB8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKFkgKyBfKSA+PiAyXSA9IF87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFcgPSBfID4+PiAzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXyA+Pj4gMCA8IDI1Nikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSyA9IFcgPDwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFogPSAoODAyNCArIChLIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTID0gY1sxOTk2XSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gMSA8PCBXO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKFMgJiBtKSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk2XSA9IFMgfCBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhRSA9IFo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFGID0gKDgwMjQgKyAoKEsgKyAyKSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFcgPSAoODAyNCArICgoSyArIDIpIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFEgPSBjW1cgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoUSA+Pj4gMCA+PSAoY1syZTNdIHwgMCkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFFID0gUTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFGID0gVztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1thRiA+PiAyXSA9IGFkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYUUgKyAxMikgPj4gMl0gPSBhZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGFkICsgOCkgPj4gMl0gPSBhRTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGFkICsgMTIpID4+IDJdID0gWjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEsgPSBhZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IF8gPj4+IDg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhRyA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfID4+PiAwID4gMTY3NzcyMTUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYUcgPSAzMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFMgPSAoKChtICsgMTA0ODMyMCkgfCAwKSA+Pj4gMTYpICYgODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBZID0gbSA8PCBTO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjID0gKCgoWSArIDUyMDE5MikgfCAwKSA+Pj4gMTYpICYgNDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXID0gWSA8PCBhYztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBZID0gKCgoVyArIDI0NTc2MCkgfCAwKSA+Pj4gMTYpICYgMjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBRID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDE0IC1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYyB8IFMgfCBZKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKFcgPDwgWSkgPj4+IDE1KSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFHID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChfID4+PiAoKChRICsgNykgfCAwKSA+Pj4gMCkpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFEgPDwgMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gKDgyODggKyAoYUcgPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWQgKyAyOCkgPj4gMl0gPSBhRztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWQgKyAyMCkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhZCArIDE2KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFogPSBjWzE5OTddIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9IDEgPDwgYUc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKFogJiBRKSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5N10gPSBaIHwgUTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbbSA+PiAyXSA9IEs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhZCArIDI0KSA+PiAyXSA9IG07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhZCArIDEyKSA+PiAyXSA9IGFkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWQgKyA4KSA+PiAyXSA9IGFkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhRyB8IDApID09IDMxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhSCA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhSCA9ICgyNSAtIChhRyA+Pj4gMSkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBRID0gXyA8PCBhSDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWiA9IGNbbSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhaICsgNCkgPj4gMl0gJiAtOCkgfCAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChfIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYUkgPSAoWiArIDE2ICsgKChRID4+PiAzMSkgPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBjW2FJID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUID0gMjA5MztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9IFEgPDwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBaID0gbTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKFQgfCAwKSA9PSAyMDkzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYUkgPj4+IDAgPCAoY1syZTNdIHwgMCkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW2FJID4+IDJdID0gSztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhZCArIDI0KSA+PiAyXSA9IFo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWQgKyAxMikgPj4gMl0gPSBhZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhZCArIDgpID4+IDJdID0gYWQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9IChaICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfID0gY1tRID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGNbMmUzXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChaID4+PiAwIDwgbSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfID4+PiAwIDwgbSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soXyArIDEyKSA+PiAyXSA9IEs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1EgPj4gMl0gPSBLO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWQgKyA4KSA+PiAyXSA9IF87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhZCArIDEyKSA+PiAyXSA9IFo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhZCArIDI0KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgYWQgPSBjWzE5OTldIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhZCA+Pj4gMCA8PSBvID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBfID0gKGFkIC0gbykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk5XSA9IF87XG4gICAgICAgICAgICAgICAgICAgICAgICBhZCA9IGNbMjAwMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgUSA9IGFkO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1syMDAyXSA9IFEgKyBvO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1soUSArIChvICsgNCkpID4+IDJdID0gXyB8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhhZCArIDQpID4+IDJdID0gbyB8IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICBuID0gKGFkICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgY1soYVEoKSB8IDApID4+IDJdID0gMTI7XG4gICAgICAgICAgICAgICAgbiA9IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYzAoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgYiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGQgPSAwLFxuICAgICAgICAgICAgICAgICAgICBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGcgPSAwLFxuICAgICAgICAgICAgICAgICAgICBoID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBrID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG0gPSAwLFxuICAgICAgICAgICAgICAgICAgICBuID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHAgPSAwLFxuICAgICAgICAgICAgICAgICAgICBxID0gMCxcbiAgICAgICAgICAgICAgICAgICAgciA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHMgPSAwLFxuICAgICAgICAgICAgICAgICAgICB0ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHYgPSAwLFxuICAgICAgICAgICAgICAgICAgICB3ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgeCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHkgPSAwLFxuICAgICAgICAgICAgICAgICAgICB6ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgQSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBDID0gMCxcbiAgICAgICAgICAgICAgICAgICAgRCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBGID0gMCxcbiAgICAgICAgICAgICAgICAgICAgRyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEggPSAwLFxuICAgICAgICAgICAgICAgICAgICBJID0gMCxcbiAgICAgICAgICAgICAgICAgICAgSiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBMID0gMCxcbiAgICAgICAgICAgICAgICAgICAgTSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIE4gPSAwLFxuICAgICAgICAgICAgICAgICAgICBPID0gMDtcbiAgICAgICAgICAgICAgICBpZiAoKGEgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYiA9IChhIC0gOCkgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBiO1xuICAgICAgICAgICAgICAgIGUgPSBjWzJlM10gfCAwO1xuICAgICAgICAgICAgICAgIGlmIChiID4+PiAwIDwgZSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBmID0gY1soYSAtIDQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gZiAmIDM7XG4gICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPT0gMSkge1xuICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBoID0gZiAmIC04O1xuICAgICAgICAgICAgICAgIGkgPSAoYSArIChoIC0gOCkpIHwgMDtcbiAgICAgICAgICAgICAgICBqID0gaTtcbiAgICAgICAgICAgICAgICBMMjc1MzogZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKChmICYgMSkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBrID0gY1tiID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gKC04IC0gaykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgbSA9IChhICsgbCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgbiA9IG07XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gKGsgKyBoKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobSA+Pj4gMCA8IGUgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChuIHwgMCkgPT0gKGNbMjAwMV0gfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSAoYSArIChoIC0gNCkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChjW3AgPj4gMl0gJiAzKSB8IDApICE9IDMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IG47XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBvO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk4XSA9IG87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1twID4+IDJdID0gY1twID4+IDJdICYgLTI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYSArIChsICsgNCkpID4+IDJdID0gbyB8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tpID4+IDJdID0gbztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBwID0gayA+Pj4gMztcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChrID4+PiAwIDwgMjU2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgayA9IGNbKGEgKyAobCArIDgpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IGNbKGEgKyAobCArIDEyKSkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAoODAyNCArICgocCA8PCAxKSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgIT0gKHQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGsgPj4+IDAgPCBlID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soayArIDEyKSA+PiAyXSB8IDApID09IChuIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHMgfCAwKSA9PSAoayB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5Nl0gPSBjWzE5OTZdICYgfigxIDw8IHApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gbjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IG87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgocyB8IDApID09ICh0IHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSAocyArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzID4+PiAwIDwgZSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gKHMgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbdiA+PiAyXSB8IDApID09IChuIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gdjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhrICsgMTIpID4+IDJdID0gcztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW3UgPj4gMl0gPSBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBuO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBvO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdCA9IG07XG4gICAgICAgICAgICAgICAgICAgICAgICBwID0gY1soYSArIChsICsgMjQpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB2ID0gY1soYSArIChsICsgMTIpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh2IHwgMCkgPT0gKHQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gKGEgKyAobCArIDIwKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gY1t3ID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh4IHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeSA9IChhICsgKGwgKyAxNikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHogPSBjW3kgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh6IHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEEgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCID0gejtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDID0geTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEIgPSB4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQyA9IHc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgPSAoQiArIDIwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gY1t3ID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoeCB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCID0geDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDID0gdztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgPSAoQiArIDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gY1t3ID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoeCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQiA9IHg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQyA9IHc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEMgPj4+IDAgPCBlID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tDID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEEgPSBCO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gY1soYSArIChsICsgOCkpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHcgPj4+IDAgPCBlID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggPSAodyArIDEyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1t4ID4+IDJdIHwgMCkgIT0gKHQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5ID0gKHYgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1t5ID4+IDJdIHwgMCkgPT0gKHQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1t4ID4+IDJdID0gdjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbeSA+PiAyXSA9IHc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBID0gdjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChwIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBuO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBvO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdiA9IChhICsgKGwgKyAyOCkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG0gPSAoODI4OCArIChjW3YgPj4gMl0gPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHQgfCAwKSA9PSAoY1ttID4+IDJdIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdID0gQTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChBIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk3XSA9IGNbMTk5N10gJiB+KDEgPDwgY1t2ID4+IDJdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IG47XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBvO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMjc1MztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocCA+Pj4gMCA8IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gKHAgKyAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbayA+PiAyXSB8IDApID09ICh0IHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbayA+PiAyXSA9IEE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhwICsgMjApID4+IDJdID0gQTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEEgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gbjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBvO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDI3NTM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKEEgKyAyNCkgPj4gMl0gPSBwO1xuICAgICAgICAgICAgICAgICAgICAgICAgdCA9IGNbKGEgKyAobCArIDE2KSkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodCB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHQgPj4+IDAgPCAoY1syZTNdIHwgMCkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhBICsgMTYpID4+IDJdID0gdDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHQgKyAyNCkgPj4gMl0gPSBBO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBjWyhhICsgKGwgKyAyMCkpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gbjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gbztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0ID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soQSArIDIwKSA+PiAyXSA9IHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sodCArIDI0KSA+PiAyXSA9IEE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IG47XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IG87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBxID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBoO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgZCA9IHE7XG4gICAgICAgICAgICAgICAgaWYgKGQgPj4+IDAgPj0gaSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBBID0gKGEgKyAoaCAtIDQpKSB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGNbQSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKCgoZSAmIDEpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoKGUgJiAyKSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IChjWzIwMDJdIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCID0gKChjWzE5OTldIHwgMCkgKyByKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk5XSA9IEI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMDAyXSA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIDQpID4+IDJdID0gQiB8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChxIHwgMCkgIT0gKGNbMjAwMV0gfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMjAwMV0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5OF0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IChjWzIwMDFdIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCID0gKChjWzE5OThdIHwgMCkgKyByKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk4XSA9IEI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMDAxXSA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIDQpID4+IDJdID0gQiB8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZCArIEIpID4+IDJdID0gQjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBCID0gKChlICYgLTgpICsgcikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgQyA9IGUgPj4+IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICBMMjg1NjogZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlID4+PiAwIDwgMjU2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBjWyhhICsgaCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gY1soYSArIChoIHwgNCkpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9ICg4MDI0ICsgKChDIDw8IDEpIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodSB8IDApICE9IChiIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodSA+Pj4gMCA8IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKHUgKyAxMikgPj4gMl0gfCAwKSA9PSAoaiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPT0gKHUgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk2XSA9IGNbMTk5Nl0gJiB+KDEgPDwgQyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSA9PSAoYiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IChnICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZyA+Pj4gMCA8IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmID0gKGcgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjW2YgPj4gMl0gfCAwKSA9PSAoaiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEQgPSBmO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHUgKyAxMikgPj4gMl0gPSBnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW0QgPj4gMl0gPSB1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPSBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmID0gY1soYSArIChoICsgMTYpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBjWyhhICsgKGggfCA0KSkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHQgfCAwKSA9PSAoYiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IChhICsgKGggKyAxMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gY1twID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSAoYSArIChoICsgOCkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgayA9IGNbbSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoayB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEUgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEcgPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRiA9IHY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEcgPSBwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwID0gKEYgKyAyMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gY1twID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh2IHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRiA9IHY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHID0gcDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSAoRiArIDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHYgPSBjW3AgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEYgPSB2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRyA9IHA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEcgPj4+IDAgPCAoY1syZTNdIHwgMCkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW0cgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFID0gRjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwID0gY1soYSArIGgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocCA+Pj4gMCA8IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gKHAgKyAxMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1t2ID4+IDJdIHwgMCkgIT0gKGIgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gKHQgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjW20gPj4gMl0gfCAwKSA9PSAoYiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbdiA+PiAyXSA9IHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbbSA+PiAyXSA9IHA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEUgPSB0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAoYSArIChoICsgMjApKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSAoODI4OCArIChjW3QgPj4gMl0gPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgPT0gKGNbdSA+PiAyXSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1t1ID4+IDJdID0gRTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEUgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE5OTddID0gY1sxOTk3XSAmIH4oMSA8PCBjW3QgPj4gMl0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwyODU2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZiA+Pj4gMCA8IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gKGYgKyAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1tnID4+IDJdIHwgMCkgPT0gKGIgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW2cgPj4gMl0gPSBFO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGYgKyAyMCkgPj4gMl0gPSBFO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEUgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwyODU2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChFID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKEUgKyAyNCkgPj4gMl0gPSBmO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID0gY1soYSArIChoICsgOCkpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChiID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soRSArIDE2KSA+PiAyXSA9IGI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGIgKyAyNCkgPj4gMl0gPSBFO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID0gY1soYSArIChoICsgMTIpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChiID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soRSArIDIwKSA+PiAyXSA9IGI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhiICsgMjQpID4+IDJdID0gRTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgNCkgPj4gMl0gPSBCIHwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKGQgKyBCKSA+PiAyXSA9IEI7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHEgfCAwKSAhPSAoY1syMDAxXSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgSCA9IEI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjWzE5OThdID0gQjtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbQSA+PiAyXSA9IGUgJiAtMjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyA0KSA+PiAyXSA9IHIgfCAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1soZCArIHIpID4+IDJdID0gcjtcbiAgICAgICAgICAgICAgICAgICAgICAgIEggPSByO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgciA9IEggPj4+IDM7XG4gICAgICAgICAgICAgICAgaWYgKEggPj4+IDAgPCAyNTYpIHtcbiAgICAgICAgICAgICAgICAgICAgZCA9IHIgPDwgMTtcbiAgICAgICAgICAgICAgICAgICAgZSA9ICg4MDI0ICsgKGQgPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgQSA9IGNbMTk5Nl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBFID0gMSA8PCByO1xuICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChBICYgRSkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk2XSA9IEEgfCBFO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEkgPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEogPSAoODAyNCArICgoZCArIDIpIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSAoODAyNCArICgoZCArIDIpIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA9IGNbciA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGggPj4+IDAgPj0gKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEkgPSBoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBKID0gcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICBjW0ogPj4gMl0gPSBxO1xuICAgICAgICAgICAgICAgICAgICBjWyhJICsgMTIpID4+IDJdID0gcTtcbiAgICAgICAgICAgICAgICAgICAgY1socSArIDgpID4+IDJdID0gSTtcbiAgICAgICAgICAgICAgICAgICAgY1socSArIDEyKSA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZSA9IHE7XG4gICAgICAgICAgICAgICAgSSA9IEggPj4+IDg7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKEkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBLID0gMDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChIID4+PiAwID4gMTY3NzcyMTUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBLID0gMzE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBKID0gKCgoSSArIDEwNDgzMjApIHwgMCkgPj4+IDE2KSAmIDg7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gSSA8PCBKO1xuICAgICAgICAgICAgICAgICAgICAgICAgRSA9ICgoKGQgKyA1MjAxOTIpIHwgMCkgPj4+IDE2KSAmIDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBBID0gZCA8PCBFO1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9ICgoKEEgKyAyNDU3NjApIHwgMCkgPj4+IDE2KSAmIDI7XG4gICAgICAgICAgICAgICAgICAgICAgICByID0gKDE0IC0gKEUgfCBKIHwgZCkgKyAoKEEgPDwgZCkgPj4+IDE1KSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgSyA9ICgoSCA+Pj4gKCgociArIDcpIHwgMCkgPj4+IDApKSAmIDEpIHwgKHIgPDwgMSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICBJID0gKDgyODggKyAoSyA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgIGNbKHEgKyAyOCkgPj4gMl0gPSBLO1xuICAgICAgICAgICAgICAgIGNbKHEgKyAyMCkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGNbKHEgKyAxNikgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIHIgPSBjWzE5OTddIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gMSA8PCBLO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCgociAmIGQpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk3XSA9IHIgfCBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tJID4+IDJdID0gZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAyNCkgPj4gMl0gPSBJO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIDEyKSA+PiAyXSA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgOCkgPj4gMl0gPSBxO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChLIHwgMCkgPT0gMzEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBMID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgTCA9ICgyNSAtIChLID4+PiAxKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgQSA9IEggPDwgTDtcbiAgICAgICAgICAgICAgICAgICAgICAgIEogPSBjW0kgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChjWyhKICsgNCkgPj4gMl0gJiAtOCkgfCAwKSA9PSAoSCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBNID0gKEogKyAxNiArICgoQSA+Pj4gMzEpIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRSA9IGNbTSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChFIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOID0gMjI3MDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQSA9IEEgPDwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSiA9IEU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChOIHwgMCkgPT0gMjI3MCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChNID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tNID4+IDJdID0gZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIDI0KSA+PiAyXSA9IEo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAxMikgPj4gMl0gPSBxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgOCkgPj4gMl0gPSBxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBBID0gKEogKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBCID0gY1tBID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIEUgPSBjWzJlM10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEogPj4+IDAgPCBFID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChCID4+PiAwIDwgRSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKEIgKyAxMikgPj4gMl0gPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbQSA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIDgpID4+IDJdID0gQjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgMTIpID4+IDJdID0gSjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgMjQpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIHEgPSAoKGNbMjAwNF0gfCAwKSAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICBjWzIwMDRdID0gcTtcbiAgICAgICAgICAgICAgICBpZiAoKHEgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIE8gPSA4NDQwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgcSA9IGNbTyA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgocSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgTyA9IChxICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNbMjAwNF0gPSAtMTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjMShiKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBjID0gMDtcbiAgICAgICAgICAgICAgICBjID0gYjtcbiAgICAgICAgICAgICAgICB3aGlsZSAoYVtjXSB8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgYyA9IChjICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gKGMgLSBiKSB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjMihiLCBjKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGMgPSBjIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZCA9IDA7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBhWyhiICsgZCkgfCAwXSA9IGFbKGMgKyBkKSB8IDBdO1xuICAgICAgICAgICAgICAgICAgICBkID0gKGQgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoYVsoYyArIChkIC0gMSkpIHwgMF0gfCAwKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gYiB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjMyhiLCBjKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGMgPSBjIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwO1xuICAgICAgICAgICAgICAgIGQgPSAoYiArIChjMShiKSB8IDApKSB8IDA7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBhWyhkICsgZSkgfCAwXSA9IGFbKGMgKyBlKSB8IDBdO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGUgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoYVsoYyArIChlIC0gMSkpIHwgMF0gfCAwKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gYiB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjNChhLCBiLCBjKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBjID0gYyB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKChlIHwgMCkgPCAoYyB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPSBkWyhhICsgZSkgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGcgPSBkWyhiICsgZSkgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApICE9IChnIHwgMCkpXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKChmIHwgMCkgPiAoZyB8IDApID8gMSA6IC0xKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoZSArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjNShiLCBkLCBlKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IChiICsgZSkgfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoZSB8IDApID49IDIwKSB7XG4gICAgICAgICAgICAgICAgICAgIGQgPSBkICYgMjU1O1xuICAgICAgICAgICAgICAgICAgICBlID0gYiAmIDM7XG4gICAgICAgICAgICAgICAgICAgIGcgPSBkIHwgKGQgPDwgOCkgfCAoZCA8PCAxNikgfCAoZCA8PCAyNCk7XG4gICAgICAgICAgICAgICAgICAgIGggPSBmICYgfjM7XG4gICAgICAgICAgICAgICAgICAgIGlmIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gKGIgKyA0IC0gZSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKChiIHwgMCkgPCAoZSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYVtiXSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9IChiICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICgoYiB8IDApIDwgKGggfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tiID4+IDJdID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgIGIgPSAoYiArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB3aGlsZSAoKGIgfCAwKSA8IChmIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgYVtiXSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIGIgPSAoYiArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjNihiLCBkLCBlKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwO1xuICAgICAgICAgICAgICAgIGYgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKGIgJiAzKSA9PSAoZCAmIDMpKSB7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlIChiICYgMykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChlIHwgMCkgPT0gMCkgcmV0dXJuIGYgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgYVtiXSA9IGFbZF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgYiA9IChiICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChkICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZSA9IChlIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICgoZSB8IDApID49IDQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbYiA+PiAyXSA9IGNbZCA+PiAyXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGIgPSAoYiArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZCArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAoZSAtIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB3aGlsZSAoKGUgfCAwKSA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgYVtiXSA9IGFbZF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBiID0gKGIgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGQgPSAoZCArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZSA9IChlIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gZiB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjNyhiLCBjLCBkKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGMgPSBjIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoKGUgfCAwKSA8IChkIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgYVsoYiArIGUpIHwgMF0gPSBmID8gMCA6IGFbKGMgKyBlKSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGYgPyAxIDogKGFbKGMgKyBlKSB8IDBdIHwgMCkgPT0gMDtcbiAgICAgICAgICAgICAgICAgICAgZSA9IChlICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gYiB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjOChhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICByZXR1cm4gYVdbYSAmIDddKGIgfCAwKSB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjOShhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBhWFthICYgMV0oYiB8IDApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gZGEoYSwgYiwgYywgZCwgZSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgYyA9IGMgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGFZW2EgJiA3XShiIHwgMCwgYyB8IDAsIGQgfCAwLCBlIHwgMCkgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gZGIoYSwgYiwgYywgZCkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgYyA9IGMgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBhWlthICYgMTVdKGIgfCAwLCBjIHwgMCwgZCB8IDApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gZGMoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBhX1thICYgMV0oKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGRkKGEsIGIsIGMpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGMgPSBjIHwgMDtcbiAgICAgICAgICAgICAgICByZXR1cm4gYSRbYSAmIDFdKGIgfCAwLCBjIHwgMCkgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gZGUoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICAkKDApO1xuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gZGYoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICAkKDEpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gZGcoYSwgYiwgYywgZCkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgYyA9IGMgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICAkKDIpO1xuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gZGgoYSwgYiwgYykge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgYyA9IGMgfCAwO1xuICAgICAgICAgICAgICAgICQoMyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBkaSgpIHtcbiAgICAgICAgICAgICAgICAkKDQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gZGooYSwgYikge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgJCg1KTtcbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gRU1TQ1JJUFRFTl9FTkRfRlVOQ1NcblxuICAgICAgICAgICAgdmFyIGFXID0gW2RlLCBkZSwgY0wsIGRlLCBjSiwgZGUsIGRlLCBkZV07XG4gICAgICAgICAgICB2YXIgYVggPSBbZGYsIGRmXTtcbiAgICAgICAgICAgIHZhciBhWSA9IFtkZywgZGcsIGNJLCBkZywgY0ssIGRnLCBkZywgZGddO1xuICAgICAgICAgICAgdmFyIGFaID0gW1xuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGJaLFxuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGIkLFxuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGJfLFxuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGJZLFxuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGJYLFxuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGRoXG4gICAgICAgICAgICBdO1xuICAgICAgICAgICAgdmFyIGFfID0gW2RpLCBkaV07XG4gICAgICAgICAgICB2YXIgYSQgPSBbZGosIGRqXTtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgX3N0cmxlbjogYzEsXG4gICAgICAgICAgICAgICAgX3N0cmNhdDogYzMsXG4gICAgICAgICAgICAgICAgX21pZF9jcmVhdGVfb3B0aW9uczogY1YsXG4gICAgICAgICAgICAgICAgX21pZF9pc3RyZWFtX29wZW5fbWVtOiBjTyxcbiAgICAgICAgICAgICAgICBfbWlkX2lzdHJlYW1fb3Blbl9maWxlOiBjTixcbiAgICAgICAgICAgICAgICBfbWlkX3NvbmdfcmVhZF93YXZlOiBiNixcbiAgICAgICAgICAgICAgICBfbWlkX2V4aXQ6IGNaLFxuICAgICAgICAgICAgICAgIF9taWRfc29uZ19ub3RlX29uOiBiMCxcbiAgICAgICAgICAgICAgICBfc3RybmNweTogYzcsXG4gICAgICAgICAgICAgICAgX21lbXNldDogYzUsXG4gICAgICAgICAgICAgICAgX21lbWNweTogYzYsXG4gICAgICAgICAgICAgICAgX21pZF9zb25nX2dldF9taXNzaW5nX2luc3RydW1lbnQ6IGJ1LFxuICAgICAgICAgICAgICAgIF9taWRfaXN0cmVhbV9jbG9zZTogY1IsXG4gICAgICAgICAgICAgICAgX21pZF9zb25nX2ZyZWU6IGNZLFxuICAgICAgICAgICAgICAgIF9taWRfaW5pdDogY1QsXG4gICAgICAgICAgICAgICAgX21pZF9zb25nX2xvYWQ6IGNYLFxuICAgICAgICAgICAgICAgIF9taWRfc29uZ19zdGFydDogYjMsXG4gICAgICAgICAgICAgICAgX21pZF9zb25nX2dldF9udW1fbWlzc2luZ19pbnN0cnVtZW50czogYnQsXG4gICAgICAgICAgICAgICAgX21lbWNtcDogYzQsXG4gICAgICAgICAgICAgICAgX2ZyZWU6IGMwLFxuICAgICAgICAgICAgICAgIF9tYWxsb2M6IGMkLFxuICAgICAgICAgICAgICAgIF9zdHJjcHk6IGMyLFxuICAgICAgICAgICAgICAgIHJ1blBvc3RTZXRzOiBiZyxcbiAgICAgICAgICAgICAgICBzdGFja0FsbG9jOiBhMCxcbiAgICAgICAgICAgICAgICBzdGFja1NhdmU6IGExLFxuICAgICAgICAgICAgICAgIHN0YWNrUmVzdG9yZTogYTIsXG4gICAgICAgICAgICAgICAgc2V0VGhyZXc6IGEzLFxuICAgICAgICAgICAgICAgIHNldFRlbXBSZXQwOiBhNixcbiAgICAgICAgICAgICAgICBzZXRUZW1wUmV0MTogYTcsXG4gICAgICAgICAgICAgICAgc2V0VGVtcFJldDI6IGE4LFxuICAgICAgICAgICAgICAgIHNldFRlbXBSZXQzOiBhOSxcbiAgICAgICAgICAgICAgICBzZXRUZW1wUmV0NDogYmEsXG4gICAgICAgICAgICAgICAgc2V0VGVtcFJldDU6IGJiLFxuICAgICAgICAgICAgICAgIHNldFRlbXBSZXQ2OiBiYyxcbiAgICAgICAgICAgICAgICBzZXRUZW1wUmV0NzogYmQsXG4gICAgICAgICAgICAgICAgc2V0VGVtcFJldDg6IGJlLFxuICAgICAgICAgICAgICAgIHNldFRlbXBSZXQ5OiBiZixcbiAgICAgICAgICAgICAgICBkeW5DYWxsX2lpOiBjOCxcbiAgICAgICAgICAgICAgICBkeW5DYWxsX3ZpOiBjOSxcbiAgICAgICAgICAgICAgICBkeW5DYWxsX2lpaWlpOiBkYSxcbiAgICAgICAgICAgICAgICBkeW5DYWxsX3ZpaWk6IGRiLFxuICAgICAgICAgICAgICAgIGR5bkNhbGxfdjogZGMsXG4gICAgICAgICAgICAgICAgZHluQ2FsbF9paWk6IGRkXG4gICAgICAgICAgICB9O1xuICAgICAgICB9KShcbiAgICAgICAgICAgIC8vIEVNU0NSSVBURU5fRU5EX0FTTVxuXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgTWF0aDogTWF0aCxcbiAgICAgICAgICAgICAgICBJbnQ4QXJyYXk6IEludDhBcnJheSxcbiAgICAgICAgICAgICAgICBJbnQxNkFycmF5OiBJbnQxNkFycmF5LFxuICAgICAgICAgICAgICAgIEludDMyQXJyYXk6IEludDMyQXJyYXksXG4gICAgICAgICAgICAgICAgVWludDhBcnJheTogVWludDhBcnJheSxcbiAgICAgICAgICAgICAgICBVaW50MTZBcnJheTogVWludDE2QXJyYXksXG4gICAgICAgICAgICAgICAgVWludDMyQXJyYXk6IFVpbnQzMkFycmF5LFxuICAgICAgICAgICAgICAgIEZsb2F0MzJBcnJheTogRmxvYXQzMkFycmF5LFxuICAgICAgICAgICAgICAgIEZsb2F0NjRBcnJheTogRmxvYXQ2NEFycmF5XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGFib3J0OiBhYm9ydCxcbiAgICAgICAgICAgICAgICBhc3NlcnQ6IGFzc2VydCxcbiAgICAgICAgICAgICAgICBhc21QcmludEludDogYXNtUHJpbnRJbnQsXG4gICAgICAgICAgICAgICAgYXNtUHJpbnRGbG9hdDogYXNtUHJpbnRGbG9hdCxcbiAgICAgICAgICAgICAgICBtaW46IE1hdGhfbWluLFxuICAgICAgICAgICAgICAgIGludm9rZV9paTogaW52b2tlX2lpLFxuICAgICAgICAgICAgICAgIGludm9rZV92aTogaW52b2tlX3ZpLFxuICAgICAgICAgICAgICAgIGludm9rZV9paWlpaTogaW52b2tlX2lpaWlpLFxuICAgICAgICAgICAgICAgIGludm9rZV92aWlpOiBpbnZva2VfdmlpaSxcbiAgICAgICAgICAgICAgICBpbnZva2VfdjogaW52b2tlX3YsXG4gICAgICAgICAgICAgICAgaW52b2tlX2lpaTogaW52b2tlX2lpaSxcbiAgICAgICAgICAgICAgICBfc3RybmNtcDogX3N0cm5jbXAsXG4gICAgICAgICAgICAgICAgX2xzZWVrOiBfbHNlZWssXG4gICAgICAgICAgICAgICAgX3N5c2NvbmY6IF9zeXNjb25mLFxuICAgICAgICAgICAgICAgIF9mcmVhZDogX2ZyZWFkLFxuICAgICAgICAgICAgICAgIF9mY2xvc2U6IF9mY2xvc2UsXG4gICAgICAgICAgICAgICAgX3N0cnRva19yOiBfc3RydG9rX3IsXG4gICAgICAgICAgICAgICAgX2Fib3J0OiBfYWJvcnQsXG4gICAgICAgICAgICAgICAgX2ZwcmludGY6IF9mcHJpbnRmLFxuICAgICAgICAgICAgICAgIF9jbG9zZTogX2Nsb3NlLFxuICAgICAgICAgICAgICAgIF9wcmVhZDogX3ByZWFkLFxuICAgICAgICAgICAgICAgIF9mZmx1c2g6IF9mZmx1c2gsXG4gICAgICAgICAgICAgICAgX2ZvcGVuOiBfZm9wZW4sXG4gICAgICAgICAgICAgICAgX29wZW46IF9vcGVuLFxuICAgICAgICAgICAgICAgIF9zdHJ0b2w6IF9zdHJ0b2wsXG4gICAgICAgICAgICAgICAgX3N0cnRvazogX3N0cnRvayxcbiAgICAgICAgICAgICAgICBfX19zZXRFcnJObzogX19fc2V0RXJyTm8sXG4gICAgICAgICAgICAgICAgX19yZWFsbHlOZWdhdGl2ZTogX19yZWFsbHlOZWdhdGl2ZSxcbiAgICAgICAgICAgICAgICBfZnNlZWs6IF9mc2VlayxcbiAgICAgICAgICAgICAgICBfc2VuZDogX3NlbmQsXG4gICAgICAgICAgICAgICAgX3dyaXRlOiBfd3JpdGUsXG4gICAgICAgICAgICAgICAgX3N0cnJjaHI6IF9zdHJyY2hyLFxuICAgICAgICAgICAgICAgIF9zaW46IF9zaW4sXG4gICAgICAgICAgICAgICAgX3ByaW50ZjogX3ByaW50ZixcbiAgICAgICAgICAgICAgICBfc3RyY2hyOiBfc3RyY2hyLFxuICAgICAgICAgICAgICAgIF9yZWFkOiBfcmVhZCxcbiAgICAgICAgICAgICAgICBfdGltZTogX3RpbWUsXG4gICAgICAgICAgICAgICAgX19mb3JtYXRTdHJpbmc6IF9fZm9ybWF0U3RyaW5nLFxuICAgICAgICAgICAgICAgIF9hdG9pOiBfYXRvaSxcbiAgICAgICAgICAgICAgICBfcmVjdjogX3JlY3YsXG4gICAgICAgICAgICAgICAgX3B3cml0ZTogX3B3cml0ZSxcbiAgICAgICAgICAgICAgICBfbGx2bV9wb3dfZjY0OiBfbGx2bV9wb3dfZjY0LFxuICAgICAgICAgICAgICAgIF9mc3luYzogX2ZzeW5jLFxuICAgICAgICAgICAgICAgIF9fX2Vycm5vX2xvY2F0aW9uOiBfX19lcnJub19sb2NhdGlvbixcbiAgICAgICAgICAgICAgICBfaXNzcGFjZTogX2lzc3BhY2UsXG4gICAgICAgICAgICAgICAgX3Nicms6IF9zYnJrLFxuICAgICAgICAgICAgICAgIF9fcGFyc2VJbnQ6IF9fcGFyc2VJbnQsXG4gICAgICAgICAgICAgICAgX2Z3cml0ZTogX2Z3cml0ZSxcbiAgICAgICAgICAgICAgICBfc3RyY21wOiBfc3RyY21wLFxuICAgICAgICAgICAgICAgIFNUQUNLVE9QOiBTVEFDS1RPUCxcbiAgICAgICAgICAgICAgICBTVEFDS19NQVg6IFNUQUNLX01BWCxcbiAgICAgICAgICAgICAgICB0ZW1wRG91YmxlUHRyOiB0ZW1wRG91YmxlUHRyLFxuICAgICAgICAgICAgICAgIEFCT1JUOiBBQk9SVCxcbiAgICAgICAgICAgICAgICBOYU46IE5hTixcbiAgICAgICAgICAgICAgICBJbmZpbml0eTogSW5maW5pdHksXG4gICAgICAgICAgICAgICAgX3N0ZGVycjogX3N0ZGVyclxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGJ1ZmZlclxuICAgICAgICApO1xuICAgICAgICB2YXIgX3N0cmxlbiA9IChNb2R1bGVbJ19zdHJsZW4nXSA9IGFzbVsnX3N0cmxlbiddKTtcbiAgICAgICAgdmFyIF9zdHJjYXQgPSAoTW9kdWxlWydfc3RyY2F0J10gPSBhc21bJ19zdHJjYXQnXSk7XG4gICAgICAgIHZhciBfbWlkX2NyZWF0ZV9vcHRpb25zID0gKE1vZHVsZVsnX21pZF9jcmVhdGVfb3B0aW9ucyddID1cbiAgICAgICAgICAgIGFzbVsnX21pZF9jcmVhdGVfb3B0aW9ucyddKTtcbiAgICAgICAgdmFyIF9taWRfaXN0cmVhbV9vcGVuX21lbSA9IChNb2R1bGVbJ19taWRfaXN0cmVhbV9vcGVuX21lbSddID1cbiAgICAgICAgICAgIGFzbVsnX21pZF9pc3RyZWFtX29wZW5fbWVtJ10pO1xuICAgICAgICB2YXIgX21pZF9pc3RyZWFtX29wZW5fZmlsZSA9IChNb2R1bGVbJ19taWRfaXN0cmVhbV9vcGVuX2ZpbGUnXSA9XG4gICAgICAgICAgICBhc21bJ19taWRfaXN0cmVhbV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AgIHZhciBfbWlkX2luaXQgPSAoTW9kdWxlWydfbWlkX2luaXQnXSA9IGFzbVsnX21pZF9pbml0J10pO1xuICAgICAgICB2YXIgX21pZF9zb25nX2xvYWQgPSAoTW9kdWxlWydfbWlkX3NvbmdfbG9hZCddID0gYXNtWydfbWlkX3NvbmdfbG9hZCddKTtcbiAgICAgICAgdmFyIF9taWRfc29uZ19zdGFydCA9IChNb2R1bGVbJ19taWRfc29uZ19zdGFydCddID1cbiAgICAgICAgICAgIGFzbVsnX21pZF9zb25nX3N0YXJ0J10pO1xuICAgICAgICB2YXIgX21pZF9zb25nX2dldF9udW1fbWlzc2luZ19pbnN0cnVtZW50cyA9IChNb2R1bGVbXG4gICAgICAgICAgICAnX21pZF9zb25nX2dldF9udW1fbWlzc2luZ19pbnN0cnVtZW50cydcbiAgICAgICAgXSA9IGFzbVsnX21pZF9zb25nX2dldF9udW1fbWlzc2luZ19pbnN0cnVtZW50cyddKTtcbiAgICAgICAgdmFyIF9tZW1jbXAgPSAoTW9kdWxlWydfbWVtY21wJ10gPSBhc21bJ19tZW1jbXAnXSk7XG4gICAgICAgIHZhciBfZnJlZSA9IChNb2R1bGVbJ19mcmVlJ10gPSBhc21bJ19mcmVlJ10pO1xuICAgICAgICB2YXIgX21hbGxvYyA9IChNb2R1bGUuX21hbGxvYyA9IGFzbVsnX21hbGxvYyddKTtcbiAgICAgICAgdmFyIF9zdHJjcHkgPSAoTW9kdWxlWydfc3RyY3B5J10gPSBhc21bJ19zdHJjcHknXSk7XG4gICAgICAgIHZhciBydW5Qb3N0U2V0cyA9IChNb2R1bGVbJ3J1blBvc3RTZXRzJ10gPSBhc21bJ3J1blBvc3RTZXRzJ10pO1xuXG4gICAgICAgIHZhciBkeW5DYWxsX2lpID0gKE1vZHVsZVsnZHluQ2FsbF9paSddID0gYXNtWydkeW5DYWxsX2lpJ10pO1xuICAgICAgICB2YXIgZHluQ2FsbF92aSA9IChNb2R1bGVbJ2R5bkNhbGxfdmknXSA9IGF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09PVxuXG4gICAgICAgIGlmIChtZW1vcnlJbml0aWFsaXplcikge1xuICAgICAgICAgICAgZnVuY3Rpb24gYXBwbHlEYXRhKGRhdGEpIHtcbiAgICAgICAgICAgICAgICBIRUFQVTguc2V0KGRhdGEsIFNUQVRJQ19CQVNFKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGFkZFJ1bkRlcGVuZGVuY3koJ21lbW9yeSBpbml0aWFsaXplcicpO1xuICAgICAgICAgICAgQnJvd3Nlci5hc3luY0xvYWQoXG4gICAgICAgICAgICAgICAgbWVtb3J5SW5pdGlhbGl6ZXIsXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24oZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICBhcHBseURhdGEoZGF0YSk7XG4gICAgICAgICAgICAgICAgICAgIHJlbW92ZVJ1bkRlcGVuZGVuY3koJ21lbW9yeSBpbml0aWFsaXplcicpO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24oZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyAnY291bGQgbm90IGxvYWQgbWVtb3J5IGluaXRpYWxpemVyICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgbWVtb3J5SW5pdGlhbGl6ZXI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBpbml0aWFsU3RhY2tUb3A7XG4gICAgICAgIHZhciBwcmVsb2FkU3RhcnRUaW1lID0gbnVsbDtcbiAgICAgICAgdmFyIGNhbGxlZFJ1biA9IGZhbHNlO1xuICAgICAgICBkZXBlbmRlbmNpZXNGdWxmaWxsZWQgPSBmdW5jdGlvbiBydW5DYWxsZXIoKSB7XG4gICAgICAgICAgICAvLyBJZiBydW4gaGFzIG5ldmVyIGJlZW4gY2FsbGVkLCBhbmQgd2Ugc2hvdWxkIGNhbGwgcnVuIChJTlZPS0VfUlVOIGlzIHRydWUsIGFuZCBNb2R1bGUubm9Jbml0aWFsUnVuIGlzIG5vdCBmYWxzZSlcbiAgICAgICAgICAgIGlmICghY2FsbGVkUnVuICYmIHNob3VsZFJ1bk5vdykgcnVuKCk7XG4gICAgICAgICAgICBpZiAoIWNhbGxlZFJ1bikgZGVwZW5kZW5jaWVzRnVsZmlsbGVkID0gcnVuQ2FsbGVyOyAvLyB0cnkgdGhpcyBhZ2FpbiBsYXRlciwgYWZ0ZXIgbmV3IGRlcHMgYXJlIGZ1bGZpbGxlZFxuICAgICAgICB9O1xuXG4gICAgICAgIE1vZHVsZVsnY2FsbE1haW4nXSA9IE1vZHVsZS5jYWxsTWFpbiA9IGZ1bmN0aW9uIGNhbGxNYWluKGFyZ3MpIHtcbiAgICAgICAgICAgIGFzc2VydChcbiAgICAgICAgICAgICAgICBydW5EZXBlbmRlbmNpZXMgPT0gMCxcbiAgICAgICAgICAgICAgICAnY2Fubm90IGNhbGwgbWFpbiB3aGVuIGFzeW5jIGRlcGVuZGVuY2llcyByZW1haW4hIChsaXN0ZW4gb24gX19BVE1BSU5fXyknXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgYXNzZXJ0KFxuICAgICAgICAgICAgICAgIF9fQVRQUkVSVU5fXy5sZW5ndGggPT0gMCxcbiAgICAgICAgICAgICAgICAnY2Fubm90IGNhbGwgbWFpbiB3aGVuIHByZVJ1biBmdW5jdGlvbnMgcmVtYWluIHRvIGJlIGNhbGxlZCdcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBhcmdzID0gYXJncyB8fCBbXTtcbiAgICAgICAgICAgIGlmIChwcmVsb2FkU3RhcnRUaW1lICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgICAgICAgICAgICAncHJlbG9hZCB0aW1lOiAnICsgKERhdGUubm93KCkgLSBwcmVsb2FkU3RhcnRUaW1lKSArICcgbXMnXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVuc3VyZUluaXRSdW50aW1lKCk7XG4gICAgICAgICAgICB2YXIgYXJnYyA9IGFyZ3MubGVuZ3RoICsgMTtcbiAgICAgICAgICAgIGZ1bmN0aW9uIHBhZCgpIHtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDQgLSAxOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgYXJndi5wdXNoKDApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBhcmd2ID0gW1xuICAgICAgICAgICAgICAgIGFsbG9jYXRlKFxuICAgICAgICAgICAgICAgICAgICBpbnRBcnJheUZyb21TdHJpbmcoJy9iaW4vdGhpcy5wcm9ncmFtJyksXG4gICAgICAgICAgICAgICAgICAgICdpOCcsXG4gICAgICAgICAgICAgICAgICAgIEFMTE9DX05PUk1BTFxuICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgIF07XG4gICAgICAgICAgICBwYWQoKTtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXJnYyAtIDE7IGkgPSBpICsgMSkge1xuICAgICAgICAgICAgICAgIGFyZ3YucHVzaChcbiAgICAgICAgICAgICAgICAgICAgYWxsb2NhdGUoaW50QXJyYXlGcm9tU3RyaW5nKGFyZ3NbaV0pLCAnaTgnLCBBTExPQ19OT1JNQUwpXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICBwYWQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGFyZ3YucHVzaCgwKTtcbiAgICAgICAgICAgIGFyZ3YgPSBhbGxvY2F0ZShhcmd2LCAnaTMyJywgQUxMT0NfTk9STUFMKTtcbiAgICAgICAgICAgIGluaXRpYWxTdGFja1RvcCA9IFNUQUNLVE9QO1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICB2YXIgcmV0ID0gTW9kdWxlWydfbWFpbiddKGFyZ2MsIGFyZ3YsIDApO1xuICAgICAgICAgICAgICAgIC8vIGlmIHdlJ3JlIG5vdCBydW5uaW5nIGFuIGV2ZW50ZWQgbWFpbiBsb29wLCBpdCdzIHRpbWUgdG8gZXhpdFxuICAgICAgICAgICAgICAgIGlmICghTW9kdWxlWydub0V4aXRSdW50aW1lJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgZXhpdChyZXQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICBpZiAoZSBpbnN0YW5jZW9mIEV4aXRTdGF0dXMpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gZXhpdCgpIHRocm93cyB0aGlzIG9uY2UgaXQncyBkb25lIHRvIG1ha2Ugc3VyZSBleGVjdXRpb25cbiAgICAgICAgICAgICAgICAgICAgLy8gaGFzIGJlZW4gc3RvcHBlZCBjb21wbGV0ZWx5XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGUgPT0gJ1NpbXVsYXRlSW5maW5pdGVMb29wJykge1xuICAgICAgICAgICAgICAgICAgICAvLyBydW5uaW5nIGFuIGV2ZW50ZWQgbWFpbiBsb29wLCBkb24ndCBpbW1lZGlhdGVseSBleGl0XG4gICAgICAgICAgICAgICAgICAgIE1vZHVsZVsnbm9FeGl0UnVudGltZSddID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIGZ1bmN0aW9uIHJ1bihhcmdzKSB7XG4gICAgICAgICAgICBhcmdzID0gYXJncyB8fCBNb2R1bGVbJ2FyZ3VtZW50cyddO1xuICAgICAgICAgICAgaWYgKHByZWxvYWRTdGFydFRpbWUgPT09IG51bGwpIHByZWxvYWRTdGFydFRpbWUgPSBEYXRlLm5vdygpO1xuICAgICAgICAgICAgaWYgKHJ1bkRlcGVuZGVuY2llcyA+IDApIHtcbiAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgICAgICAgICAgICdydW4oKSBjYWxsZWQsIGJ1dCBkZXBlbmRlbmNpZXMgcmVtYWluLCBzbyBub3QgcnVubmluZydcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIHJldHVybiBGUztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHByZVJ1bigpO1xuICAgICAgICAgICAgaWYgKHJ1bkRlcGVuZGVuY2llcyA+IDApIHtcbiAgICAgICAgICAgICAgICAvLyBhIHByZVJ1biBhZGRlZCBhIGRlcGVuZGVuY3ksIHJ1biB3aWxsIGJlIGNhbGxlZCBsYXRlclxuICAgICAgICAgICAgICAgIHJldHVybiBGUztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGRvUnVuKCkge1xuICAgICAgICAgICAgICAgIGVuc3VyZUluaXRSdW50aW1lKCk7XG4gICAgICAgICAgICAgICAgcHJlTWFpbigpO1xuICAgICAgICAgICAgICAgIGNhbGxlZFJ1biA9IHRydWU7XG4gICAgICAgICAgICAgICAgaWYgKE1vZHVsZVsnX21haW4nXSAmJiBzaG91bGRSdW5Ob3cpIHtcbiAgICAgICAgICAgICAgICAgICAgTW9kdWxlWydjYWxsTWFpbiddKGFyZ3MpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBwb3N0UnVuKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoTW9kdWxlWydzZXRTdGF0dXMnXSkge1xuICAgICAgICAgICAgICAgIE1vZHVsZVsnc2V0U3RhdHVzJ10oJ1J1bm5pbmcuLi4nKTtcbiAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgTW9kdWxlWydzZXRTdGF0dXMnXSgnJyk7XG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIUFCT1JUKSBkb1J1bigpO1xuICAgICAgICAgICAgICAgIH0sIDEpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBkb1J1bigpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gRlM7XG4gICAgICAgIH1cblxuICAgICAgICBNb2R1bGUucnVuID0gcnVuO1xuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBJbml0aWFsaXplcyB0aGUgbGlicmFyeS5cbiAgICAgICAgICogQGZ1bmN0aW9uIGluaXRcbiAgICAgICAgICogQG1lbWJlcm9mIExpYlRpTWlkaXR5XG4gICAgICAgICAqIEBwYXJhbSB7Ym9vbGVhbn0gW3Rocm93RXJyb3IgPSB0cnVlXSBUaHJvdyBhbiBlcnJvciBpZiBmaWxlL2ZvbGRlciBjcmVhdGlvbiBmYWlsZWQuXG4gICAgICAgICAqIEBpbnN0YW5jZVxuICAgICAgICAgKi9cbiAgICAgICAgTW9kdWxlLmluaXQgPSBmdW5jdGlvbih0aHJvd0Vycm9yID0gdHJ1ZSkge1xuICAgICAgICAgICAgLy8gY3JlYXRlcyBmb2xkZXJzIGZvciBpbnN0cnVtZW50IHBhdGNoZXNcbiAgICAgICAgICAgIE1vZHVsZS5jcmVhdGVQYXRoKCcvJywgTElCVElNSURJVFlfUEFUQ0hfRElSRUNUT1JZLCB0aHJvd0Vycm9yKTtcbiAgICAgICAgICAgIE1vZHVsZS5jcmVhdGVQYXRoKFxuICAgICAgICAgICAgICAgIGAvJHtMSUJUSU1JRElUWV9QQVRDSF9ESVJFQ1RPUll9YCxcbiAgICAgICAgICAgICAgICBMSUJUSU1JRElUWV9QQVRDSF9EUlVNX0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NEZBO0FBRUE7QUFRQTtBQTBCQTtBQVlBO0FBRUE7QUFJQTtBQVNBO0FBNkJBO0FBcUJBO0FBQ0E7QUFDQTtBQUNBO0FBR0E7QUFVQTtBQUdBO0FBQ0E7QUErTUE7QUFtQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFxQkE7QUFDQTtBQWdCQTtBQWlEQTtBQVdBO0FBUUE7QUF1Q0E7QUFHQTtBQUVBO0FBT0E7QUFVQTtBQXVEQTtBQUVBO0FBb0tBO0FBRUE7QUFDQTtBQUNBO0FBT0E7QUFLQTtBQUNBO0FBS0E7QUFDQTtBQW1CQTtBQUNBO0FBQ0E7QUFvQkE7QUFxREE7QUFJQTtBQVdBO0FBSUE7QUEyRUE7QUEwREE7QUFJQTtBQUlBO0FBMkdBO0FBMjBCQTtBQUlBO0FBbStWQTtBQXVFQTtBQTRIQTtBQUlBO0FBdUJBO0FBRUE7QUE0Q0E7QUFNQTtBQUNBO0FBR0E7QUFvQkE7Ozs7OztBQW1DQTtBQUVBO0FBUUE7QUFhQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///1\n")},function(module,exports){eval("function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS9oZWxwZXJzL2RlZmluZVByb3BlcnR5LmpzPzk1MjMiXSwic291cmNlc0NvbnRlbnQiOlsiZnVuY3Rpb24gX2RlZmluZVByb3BlcnR5KG9iaiwga2V5LCB2YWx1ZSkge1xuICBpZiAoa2V5IGluIG9iaikge1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShvYmosIGtleSwge1xuICAgICAgdmFsdWU6IHZhbHVlLFxuICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZSxcbiAgICAgIHdyaXRhYmxlOiB0cnVlXG4gICAgfSk7XG4gIH0gZWxzZSB7XG4gICAgb2JqW2tleV0gPSB2YWx1ZTtcbiAgfVxuXG4gIHJldHVybiBvYmo7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gX2RlZmluZVByb3BlcnR5OyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///2\n")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(9);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS9yZWdlbmVyYXRvci9pbmRleC5qcz9hMzRhIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZShcInJlZ2VuZXJhdG9yLXJ1bnRpbWVcIik7XG4iXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///3\n")},function(module,exports){eval('function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError("Cannot call a class as a function");\n }\n}\n\nmodule.exports = _classCallCheck;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS9oZWxwZXJzL2NsYXNzQ2FsbENoZWNrLmpzPzk3MGIiXSwic291cmNlc0NvbnRlbnQiOlsiZnVuY3Rpb24gX2NsYXNzQ2FsbENoZWNrKGluc3RhbmNlLCBDb25zdHJ1Y3Rvcikge1xuICBpZiAoIShpbnN0YW5jZSBpbnN0YW5jZW9mIENvbnN0cnVjdG9yKSkge1xuICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJDYW5ub3QgY2FsbCBhIGNsYXNzIGFzIGEgZnVuY3Rpb25cIik7XG4gIH1cbn1cblxubW9kdWxlLmV4cG9ydHMgPSBfY2xhc3NDYWxsQ2hlY2s7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///4\n')},function(module,exports){eval('function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nmodule.exports = _asyncToGenerator;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taW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9uZXh0LCBfdGhyb3csIFwidGhyb3dcIiwgZXJyKTtcbiAgICAgIH1cblxuICAgICAgX25leHQodW5kZWZpbmVkKTtcbiAgICB9KTtcbiAgfTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBfYXN5bmNUb0dlbmVyYXRvcjsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///5\n')},function(module,exports){eval('function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ("value" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS9oZWxwZXJzL2NyZWF0ZUNsYXNzLmpzPzViYzMiXSwic291cmNlc0NvbnRlbnQiOlsiZnVuY3Rpb24gX2RlZmluZVByb3BlcnRpZXModGFyZ2V0LCBwcm9wcykge1xuICBmb3IgKHZhciBpID0gMDsgaSA8IHByb3BzLmxlbmd0aDsgaSsrKSB7XG4gICAgdmFyIGRlc2NyaXB0b3IgPSBwcm9wc1tpXTtcbiAgICBkZXNjcmlwdG9yLmVudW1lcmFibGUgPSBkZXNjcmlwdG9yLmVudW1lcmFibGUgfHwgZmFsc2U7XG4gICAgZGVzY3JpcHRvci5jb25maWd1cmFibGUgPSB0cnVlO1xuICAgIGlmIChcInZhbHVlXCIgaW4gZGVzY3JpcHRvcikgZGVzY3JpcHRvci53cml0YWJsZSA9IHRydWU7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHRhcmdldCwgZGVzY3JpcHRvci5rZXksIGRlc2NyaXB0b3IpO1xuICB9XG59XG5cbmZ1bmN0aW9uIF9jcmVhdGVDbGFzcyhDb25zdHJ1Y3RvciwgcHJvdG9Qcm9wcywgc3RhdGljUHJvcHMpIHtcbiAgaWYgKHByb3RvUHJvcHMpIF9kZWZpbmVQcm9wZXJ0aWVzKENvbnN0cnVjdG9yLnByb3RvdHlwZSwgcHJvdG9Qcm9wcyk7XG4gIGlmIChzdGF0aWNQcm9wcykgX2RlZmluZVByb3BlcnRpZXMoQ29uc3RydWN0b3IsIHN0YXRpY1Byb3BzKTtcbiAgcmV0dXJuIENvbnN0cnVjdG9yO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IF9jcmVhdGVDbGFzczsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///6\n')},function(module,exports){eval('function _typeof(obj) {\n if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS9oZWxwZXJzL3R5cGVvZi5qcz83MDM3Il0sInNvdXJjZXNDb250ZW50IjpbImZ1bmN0aW9uIF90eXBlb2Yob2JqKSB7XG4gIGlmICh0eXBlb2YgU3ltYm9sID09PSBcImZ1bmN0aW9uXCIgJiYgdHlwZW9mIFN5bWJvbC5pdGVyYXRvciA9PT0gXCJzeW1ib2xcIikge1xuICAgIG1vZHVsZS5leHBvcnRzID0gX3R5cGVvZiA9IGZ1bmN0aW9uIF90eXBlb2Yob2JqKSB7XG4gICAgICByZXR1cm4gdHlwZW9mIG9iajtcbiAgICB9O1xuICB9IGVsc2Uge1xuICAgIG1vZHVsZS5leHBvcnRzID0gX3R5cGVvZiA9IGZ1bmN0aW9uIF90eXBlb2Yob2JqKSB7XG4gICAgICByZXR1cm4gb2JqICYmIHR5cGVvZiBTeW1ib2wgPT09IFwiZnVuY3Rpb25cIiAmJiBvYmouY29uc3RydWN0b3IgPT09IFN5bWJvbCAmJiBvYmogIT09IFN5bWJvbC5wcm90b3R5cGUgPyBcInN5bWJvbFwiIDogdHlwZW9mIG9iajtcbiAgICB9O1xuICB9XG5cbiAgcmV0dXJuIF90eXBlb2Yob2JqKTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBfdHlwZW9mOyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///7\n')},function(module,exports,__webpack_require__){eval("var rng = __webpack_require__(10);\nvar bytesToUuid = __webpack_require__(11);\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL25vZGVfbW9kdWxlcy91dWlkL3Y0LmpzP2M2NGUiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHJuZyA9IHJlcXVpcmUoJy4vbGliL3JuZycpO1xudmFyIGJ5dGVzVG9VdWlkID0gcmVxdWlyZSgnLi9saWIvYnl0ZXNUb1V1aWQnKTtcblxuZnVuY3Rpb24gdjQob3B0aW9ucywgYnVmLCBvZmZzZXQpIHtcbiAgdmFyIGkgPSBidWYgJiYgb2Zmc2V0IHx8IDA7XG5cbiAgaWYgKHR5cGVvZihvcHRpb25zKSA9PSAnc3RyaW5nJykge1xuICAgIGJ1ZiA9IG9wdGlvbnMgPT09ICdiaW5hcnknID8gbmV3IEFycmF5KDE2KSA6IG51bGw7XG4gICAgb3B0aW9ucyA9IG51bGw7XG4gIH1cbiAgb3B0aW9ucyA9IG9wdGlvbnMgfHwge307XG5cbiAgdmFyIHJuZHMgPSBvcHRpb25zLnJhbmRvbSB8fCAob3B0aW9ucy5ybmcgfHwgcm5nKSgpO1xuXG4gIC8vIFBlciA0LjQsIHNldCBiaXRzIGZvciB2ZXJzaW9uIGFuZCBgY2xvY2tfc2VxX2hpX2FuZF9yZXNlcnZlZGBcbiAgcm5kc1s2XSA9IChybmRzWzZdICYgMHgwZikgfCAweDQwO1xuICBybmRzWzhdID0gKHJuZHNbOF0gJiAweDNmKSB8IDB4ODA7XG5cbiAgLy8gQ29weSBieXRlcyB0byBidWZmZXIsIGlmIHByb3ZpZGVkXG4gIGlmIChidWYpIHtcbiAgICBmb3IgKHZhciBpaSA9IDA7IGlpIDwgMTY7ICsraWkpIHtcbiAgICAgIGJ1ZltpICsgaWldID0gcm5kc1tpaV07XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIGJ1ZiB8fCBieXRlc1RvVXVpZChybmRzKTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSB2NDtcbiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///8\n")},function(module,exports,__webpack_require__){eval('/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n "use strict";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === "function" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || "@@iterator";\n var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";\n var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there\'s no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don\'t have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: "normal", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: "throw", arg: err };\n }\n }\n\n var GenStateSuspendedStart = "suspendedStart";\n var GenStateSuspendedYield = "suspendedYield";\n var GenStateExecuting = "executing";\n var GenStateCompleted = "completed";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don\'t natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = "GeneratorFunction";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n ["next", "throw", "return"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === "function" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === "GeneratorFunction"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = "GeneratorFunction";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, "__await")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === "throw") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === "object" &&\n hasOwn.call(value, "__await")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke("next", value, resolve, reject);\n }, function(err) {\n invoke("throw", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke("throw", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error("Generator is already running");\n }\n\n if (state === GenStateCompleted) {\n if (method === "throw") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === "next") {\n // Setting context._sent for legacy support of Babel\'s\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === "throw") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === "return") {\n context.abrupt("return", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === "normal") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === "throw") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = "throw";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === "throw") {\n // Note: ["return"] must be used for ES3 parsing compatibility.\n if (delegate.iterator["return"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = "return";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === "throw") {\n // If maybeInvokeDelegate(context) changed context.method from\n // "return" to "throw", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = "throw";\n context.arg = new TypeError(\n "The iterator does not provide a \'throw\' method");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === "throw") {\n context.method = "throw";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = "throw";\n context.arg = new TypeError("iterator result is not an object");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was "throw" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was "next", forget context.arg since it has been\n // "consumed" by the delegate iterator. If context.method was\n // "return", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== "return") {\n context.method = "next";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = "Generator";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers\' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn\'t happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return "[object Generator]";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = "normal";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: "root" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === "function") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel\'s\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = "next";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === "t" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === "throw") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = "throw";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = "next";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === "root") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle("end");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, "catchLoc");\n var hasFinally = hasOwn.call(entry, "finallyLoc");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error("try statement without catch or finally");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, "finallyLoc") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === "break" ||\n type === "continue") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = "next";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === "throw") {\n throw record.arg;\n }\n\n if (record.type === "break" ||\n record.type === "continue") {\n this.next = record.arg;\n } else if (record.type === "return") {\n this.rval = this.arg = record.arg;\n this.method = "return";\n this.next = "end";\n } else if (record.type === "normal" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n "catch": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === "throw") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error("illegal catch attempt");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === "next") {\n // Deliberately forget the last sent value so that we don\'t\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n true ? module.exports : undefined\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you\'ve misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you\'re not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function("r", "regeneratorRuntime = r")(runtime);\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL25vZGVfbW9kdWxlcy9yZWdlbmVyYXRvci1ydW50aW1lL3J1bnRpbWUuanM/OTZjZiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAoYykgMjAxNC1wcmVzZW50LCBGYWNlYm9vaywgSW5jLlxuICpcbiAqIFRoaXMgc291cmNlIGNvZGUgaXMgbGljZW5zZWQgdW5kZXIgdGhlIE1JVCBsaWNlbnNlIGZvdW5kIGluIHRoZVxuICogTElDRU5TRSBmaWxlIGluIHRoZSByb290IGRpcmVjdG9yeSBvZiB0aGlzIHNvdXJjZSB0cmVlLlxuICovXG5cbnZhciBydW50aW1lID0gKGZ1bmN0aW9uIChleHBvcnRzKSB7XG4gIFwidXNlIHN0cmljdFwiO1xuXG4gIHZhciBPcCA9IE9iamVjdC5wcm90b3R5cGU7XG4gIHZhciBoYXNPd24gPSBPcC5oYXNPd25Qcm9wZXJ0eTtcbiAgdmFyIHVuZGVmaW5lZDsgLy8gTW9yZSBjb21wcmVzc2libGUgdGhhbiB2b2lkIDAuXG4gIHZhciAkU3ltYm9sID0gdHlwZW9mIFN5bWJvbCA9PT0gXCJmdW5jdGlvblw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ICAgICAgICBpZiAoc3RhdGUgPT09IEdlblN0YXRlU3VzcGVuZGVkU3RhcnQpIHtcbiAgICAgICAgICAgIHN0YXRlID0gR2VuU3RhdGVDb21wbGV0ZWQ7XG4gICAgICAgICAgICB0aHJvdyBjb250ZXh0LmFyZztcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBjb250ZXh0LmRpc3BhdGNoRXhjZXB0aW9uKGNvbnRleHQuYXJnKTtcblxuICAgICAgICB9IGVsc2UgaWYgKGNvbnRleHQubWV0aG9kID09PSBcInJldHVyblwiKSB7XG4gICAgICAgICAgY29udGV4dC5hYnJ1cHQoXCJyZXR1cm5cIiwgY29udGV4dC5hcmcpO1xuICAgICAgICB9XG5cbiAgICAgICAgc3RhdGUgPSBHZW5TdGF0ZUV4ZWN1dGluZztcblxuICAgICAgICB2YXIgcmVjb3JkID0gdHJ5Q2F0Y2goaW5uZXJGbiwgc2VsZiwgY29udGV4dCk7XG4gICAgICAgIGlmIChyZWNvcmQudHlwZSA9PT0gXCJub3JtYWxcIikge1xuICAgICAgICAgIC8vIElmIGFuIGV4Y2VwdGlvbiBpcyB0aHJvd24gZnJvbSBpbm5lckZuLCB3ZSBsZWF2ZSBzdGF0ZSA9PT1cbiAgICAgICAgICAvLyBHZW5TdGF0ZUV4ZWN1dGluZyBhbmQgbG9vcCBiYWNrIGZvciBhbm90aGVyIGludm9jYXRpb24uXG4gICAgICAgICAgc3RhdGUgPSBjb250ZXh0LmRvbmVcbiAgICAgICAgICAgID8gR2VuU3RhdGVDb21wbGV0ZWRcbiAgICAgICAgICAgIDogR2VuU3RhdGVTdXNwZW5kZWRZaWVsZDtcblxuICAgICAgICAgIGlmIChyZWNvcmQuYXJnID09PSBDb250aW51ZVNlbnRpbmVsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdmFsdWU6IHJlY29yZC5hcmcsXG4gICAgICAgICAgICBkb25lO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XIgaXRlcmF0b3JNZXRob2QgPSBpdGVyYWJsZVtpdGVyYXRvclN5bWJvbF07XG4gICAgICBpZiAoaXRlcmF0b3JNZXRob2QpIHtcbiAgICAgICAgcmV0dXJuIGl0ZXJhdG9yTWV0aG9kLmNhbGwoaXRlcmFibGUpO1xuICAgICAgfVxuXG4gICAgICBpZiAodHlwZW9mIGl0ZXJhYmxlLm5leHQgPT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICByZXR1cm4gaXRlcmFibGU7XG4gICAgICB9XG5cbiAgICAgIGlmICghaXNOYU4oaXRlcmFibGUubGVuZ3RoKSkge1xuICAgICAgICB2YXIgaSA9IC0xLCBuZXh0ID0gZnVuY3Rpb24gbmV4dCgpIHtcbiAgICAgICAgICB3aGlsZSAoKytpIDwgaXRlcmFibGUubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAoaGFzT3duLmNhbGwoaXRlcmFibGUsIGkpKSB7XG4gICAgICAgICAgICAgIG5leHQudmFsdWUgPSBpdGVyYWJsZVtpXTtcbiAgICAgICAgICAgICAgbmV4dC5kb25lID0gZmFsc2U7XG4gICAgICAgICAgICAgIHJldHVybiBuZXh0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIG5leHQudmFsdWUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgbmV4dC5kb25lID0gdHJ1ZTtcblxuICAgICAgICAgIHJldHVybiBuZXh0O1xuICAgICAgICB9O1xuXG4gICAgICAgIHJldHVybiBuZXh0Lm5leHQgPSBuZXh0O1xuICAgICAgfVxuICAgIH1cblxuICAgIC8vIFJldHVybiBhbiBpdGVyYXRvciB3aXRoIG5vIHZhbHVlcy5cbiAgICByZXR1cm4geyBuZXh0OiBkb25lUmVzdWx0IH07XG4gIH1cbiAgZXhwb3J0cy52YWx1ZXMgPSB2YWx1ZXM7XG5cbiAgZnVuY3Rpb24gZG9uZVJlc3VsdCgpIHtcbiAgICByZXR1cm4geyB2YWx1ZTogdW5kZ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7XG4gICAgICAgICAgICBpZiAodGhpcy5wcmV2IDwgZW50cnkuY2F0Y2hMb2MpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGhhbmRsZShlbnRyeS5jYXRjaExvYywgdHJ1ZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICB9IGVsc2UgaWYgKGhhc0ZpbmFsbHkpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnByZXYgPCBlbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoYW5kbGUoZW50cnkuZmluYWxseUxvYyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwidHJ5IHN0YXRlbWVudCB3aXRob3V0IGNhdGNoIG9yIGZpbmFsbHlcIik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcblxuICAgIGFicnVwdDogZnVuY3Rpb24odHlwZSwgYXJnKSB7XG4gICAgICBmb3IgKHZhciBpID0gdGhpcy50cnlFbnRyaWVzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBlbnRyeSA9IHRoaXMudHJ5RW50cmllc1tpXTtcbiAgICAgICAgaWYgKGVudHJ5LnRyeUxvYyA8PSB0aGlzLnByZXYgJiZcbiAgICAgICAgICAgIGhhc093bi5jYWxsKGVudHJ5LCBcImZpbmFsbHlMb2NcIikgJiZcbiAgICAgICAgICAgIHRoaXMucHJldiA8IGVudHJ5LmZpbmFsbHlMb2MpIHtcbiAgICAgICAgICB2YXIgZmluYWxseUVudHJ5ID0gZW50cnk7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKGZpbmFsbHlFbnRyeSAmJlxuICAgICAgICAgICh0eXBlID09PSBcImJyZWFrXCIgfHxcbiAgICAgICAgICAgdHlwZSA9PT0gXCJjb250aW51ZVwiKSAmJlxuICAgICAgICAgIGZpbmFsbHlFbnRyeS50cnlMb2MgPD0gYXJnICYmXG4gICAgICAgICAgYXJnIDw9IGZpbmFsbHlFbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgIC8vIElnbm9yZSB0aGUgZmluYWxseSBlbnRyeSBpZiBjb250cm9sIGlzIG5vdCBqdW1waW5nIHRvIGFcbiAgICAgICAgLy8gbG9jYXRpb24gb3V0c2lkZSB0aGUgdHJ5L2NhdGNoIGJsb2NrLlxuICAgICAgICBmaW5hbGx5RW50cnkgPSBudWxsO1xuICAgICAgfVxuXG4gICAgICB2YXIgcmVjb3JkID0gZmluYWxseUVudHJ5ID8gZmluYWxseUVudHJ5LmNvbXBsZXRpb24gOiB7fTtcbiAgICAgIHJlY29yZC50eXBlID0gdHlwZTtcbiAgICAgIHJlY29yZC5hcmcgPSBhcmc7XG5cbiAgICAgIGlmIChmaW5hbGx5RW50cnkpIHtcbiAgICAgICAgdGhpcy5tZXRob2QgPSBcIm5leHRcIjtcbiAgICAgICAgdGhpcy5uZXh0ID0gZmluYWxseUVudHJ5LmZpbmFsbHlMb2M7XG4gICAgICAgIHJldHVybiBDb250aW51ZVNlbnRpbmVsO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gdGhpcy5jb21wbGV0ZShyZWNvcmQpO1xuICAgIH0sXG5cbiAgICBjb21wbGV0ZTogZnVuY3Rpb24ocmVjb3JkLCBhZnRlckxvYykge1xuICAgICAgaWYgKHJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgICAgdGhyb3cgcmVjb3JkLmFyZztcbiAgICAgIH1cblxuICAgICAgaWYgKHJlY29yZC50eXBlID09PSBcImJyZWFrXCIgfHxcbiAgICAgICAgICByZWNvcmQudHlwZSA9PT0gXCJjb250aW51ZVwiKSB7XG4gICAgICAgIHRoaXMubmV4dCA9IHJlY29yZC5hcmc7XG4gICAgICB9IGVsc2UgaWYgKHJlY29yZC50eXBlID09PSBcInJldHVyblwiKSB7XG4gICAgICAgIHRoaXMucnZhbCA9IHRoaXMuYXJnID0gcmVjb3JkLmFyZztcbiAgICAgICAgdGhpcy5tZXRob2QgPSBcInJldHVyblwiO1xuICAgICAgICB0aGlzLm5leHQgPSBcImVuZFwiO1xuICAgICAgfSBlbHNlIGlmIChyZWNvcmQudHlwZSA9PT0gXCJub3JtYWxcIiAmJiBhZnRlckxvYykge1xuICAgICAgICB0aGlzLm5leHQgPSBhZnRlckxvYztcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIENvbnRpbnVlU2VudGluZWw7XG4gICAgfSxcblxuICAgIGZpbmlzaDogZnVuY3Rpb24oZmluYWxseUxvYykge1xuICAgICAgZm9yICh2YXIgaSA9IHRoaXMudHJ5RW50cmllcy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICB2YXIgZW50cnkgPSB0aGlzLnRyeUVudHJpZXNbaV07XG4gICAgICAgIGlmIChlbnRyeS5maW5hbGx5TG9jID09PSBmaW5hbGx5TG9jKSB7XG4gICAgICAgICAgdGhpcy5jb21wbGV0ZShlbnRyeS5jb21wbGV0aW9uLCBlbnRyeS5hZnRlckxvYyk7XG4gICAgICAgICAgcmVzZXRUcnlFbnRyeShlbnRyeSk7XG4gICAgICAgICAgcmV0dXJuIENvbnRpbnVlU2VudGluZWw7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuXG4gICAgXCJjYXRjaFwiOiBmdW5jdGlvbih0cnlMb2MpIHtcbiAgICAgIGZvciAodmFyIGkgPSB0aGlzLnRyeUVudHJpZXMubGVuZ3RoIC0gMTsgaSA+PSAwOyAtLWkpIHtcbiAgICAgICAgdmFyIGVudHJ5ID0gdGhpcy50cnlFbnRyaWVzW2ldO1xuICAgICAgICBpZiAoZW50cnkudHJ5TG9jID09PSB0cnlMb2MpIHtcbiAgICAgICAgICB2YXIgcmVjb3JkID0gZW50cnkuY29tcGxldGlvbjtcbiAgICAgICAgICBpZiAocmVjb3JkLnR5cGUgPT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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///9\n')},function(module,exports){eval("// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93ZWItbWlkaS1wbGF5ZXIvLi9ub2RlX21vZHVsZXMvdXVpZC9saWIvcm5nLWJyb3dzZXIuanM/ZTFmNCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBVbmlxdWUgSUQgY3JlYXRpb24gcmVxdWlyZXMgYSBoaWdoIHF1YWxpdHkgcmFuZG9tICMgZ2VuZXJhdG9yLiAgSW4gdGhlXG4vLyBicm93c2VyIHRoaXMgaXMgYSBsaXR0bGUgY29tcGxpY2F0ZWQgZHVlIHRvIHVua25vd24gcXVhbGl0eSBvZiBNYXRoLnJhbmRvbSgpXG4vLyBhbmQgaW5jb25zaXN0ZW50IHN1cHBvcnQgZm9yIHRoZSBgY3J5cHRvYCBBUEkuICBXZSBkbyB0aGUgYmVzdCB3ZSBjYW4gdmlhXG4vLyBmZWF0dXJlLWRldGVjdGlvblxuXG4vLyBnZXRSYW5kb21WYWx1ZXMgbmVlZHMgdG8gYmUgaW52b2tlZCBpbiBhIGNvbnRleHQgd2hlcmUgXCJ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AgbW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBtYXRoUk5HKCkge1xuICAgIGZvciAodmFyIGkgPSAwLCByOyBpIDwgMTY7IGkrKykge1xuICAgICAgaWYgKChpICYgMHgwMykgPT09IDApIHIgPSBNYXRoLnJhbmRvbSgpICogMHgxMDAwMDAwMDA7XG4gICAgICBybmRzW2ldID0gciA+Pj4gKChpICYgMHgwMykgPDwgMykgJiAweGZmO1xuICAgIH1cblxuICAgIHJldHVybiBybmRzO1xuICB9O1xufVxuIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///10\n")},function(module,exports){eval("/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.ex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bYnVmW2krK11dLCAnLScsXG4gICAgYnRoW2J1ZltpKytdXSwgYnRoW2J1ZltpKytdXSxcbiAgICBidGhbYnVmW2krK11dLCBidGhbYnVmW2krK11dLFxuICAgIGJ0aFtidWZbaSsrXV0sIGJ0aFtidWZbaSsrXV1cbiAgXSkuam9pbignJyk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gYnl0ZXNUb1V1aWQ7XG4iXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///11\n")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(global) {/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n\n\nvar base64 = __webpack_require__(14)\nvar ieee754 = __webpack_require__(15)\nvar isArray = __webpack_require__(16)\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(13)))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjoz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IDB4ODApIHtcbiAgICAgICAgICAgIGNvZGVQb2ludCA9IGZpcnN0Qnl0ZVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgc2Vjb25kQnl0ZSA9IGJ1ZltpICsgMV1cbiAgICAgICAgICBpZiAoKHNlY29uZEJ5dGUgJiAweEMwKSA9PT0gMHg4MCkge1xuICAgICAgICAgICAgdGVtcENvZGVQb2ludCA9IChmaXJzdEJ5dGUgJiAweDFGKSA8PCAweDYgfCAoc2Vjb25kQnl0ZSAmIDB4M0YpXG4gICAgICAgICAgICBpZiAodGVtcENvZGVQb2ludCA+IDB4N0YpIHtcbiAgICAgICAgICAgICAgY29kZVBvaW50ID0gdGVtcENvZGVQb2ludFxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgc2Vjb25kQnl0ZSA9IGJ1ZltpICsgMV1cbiAgICAgICAgICB0aGlyZEJ5dGUgPSBidWZbaSArIDJdXG4gICAgICAgICAgaWYgKChzZWNvbmRCeXRlICYgMHhDMCkgPT09IDB4ODAgJiYgKHRoaXJkQnl0ZSAmIDB4QzApID09PSAweDgwKSB7XG4gICAgICAgICAgICB0ZW1wQ29kZVBvaW50ID0gKGZpcnN0Qnl0ZSAmIDB4RikgPDwgMHhDIHwgKHNlY29uZEJ5dGUgJiAweDNGKSA8PCAweDYgfCAodGhpcmRCeXRlICYgMHgzRilcbiAgICAgICAgICAgIGlmICh0ZW1wQ29kZVBvaW50ID4gMHg3RkYgJiYgKHRlbXBDb2RlUG9pbnQgPCAweEQ4MDAgfHwgdGVtcENvZGVQb2ludCA+IDB4REZGRikpIHtcbiAgICAgICAgICAgICAgY29kZVBvaW50ID0gdGVtcENvZGVQb2ludFxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlIDQ6XG4gICAgICAgIC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FDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///12\n")},function(module,exports){eval('var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function("return this")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === "object") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it\'s\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJ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nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93ZWItbWlkaS1wbGF5ZXIvLi9ub2RlX21vZHVsZXMvYmFzZTY0LWpzL2luZGV4LmpzPzFmYjUiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnXG5cbmV4cG9ydHMuYnl0ZUxlbmd0aCA9IGJ5dGVMZW5ndGhcbmV4cG9ydHMudG9CeXRlQXJyYXkgPSB0b0J5dGVBcnJheVxuZXhwb3J0cy5mcm9tQnl0ZUFycmF5ID0gZnJvbUJ5dGVBcnJheVxuXG52YXIgbG9va3VwID0gW11cbnZhciByZXZMb29rdXAgPSBbXVxudmFyIEFyciA9IHR5cGVvZiBVaW50OEFycmF5ICE9PSAndW5kZWZpbmVkJyA/IFVpbnQ4QXJyYXkgOiBBcnJheVxuXG52YXIgY29kZSA9ICdBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvJ1xuZm9yICh2YXIgaSA9IDAsIGxlbiA9IGNvZGUubGVuZ3RoOyBpIDwgbGVuOyArK2kpIHtcbiAgbG9va3VwW2ldID0gY29kZVtpXVxuICByZXZMb29rdXBbY29kZS5jaGFyQ29kZUF0KGkpXSA9IGlcbn1cblxuLy8gU3VwcG9ydCBkZWNvZGluZyBVUkwtc2FmZSBiYXNlNjQgc3RyaW5ncywgYXMgTm9kZS5qcyBkb2VzLlxuLy8gU2VlOiBodHRwczovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9CYXNlNjQjVVJMX2FwcGxpY2F0aW9uc1xucmV2TG9va3VwWyctJy5jaGFyQ29kZUF0KDApXSA9IDYyXG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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///14\n")},function(module,exports){eval("exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93ZWItbWlkaS1wbGF5ZXIvLi9ub2RlX21vZHVsZXMvaWVlZTc1NC9pbmRleC5qcz85MTUyIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydHMucmVhZCA9IGZ1bmN0aW9uIChidWZmZXIsIG9mZnNldCwgaXNMRSwgbUxlbiwgbkJ5dGVzKSB7XG4gIHZhciBlLCBtXG4gIHZhciBlTGVuID0gKG5CeXRlcyAqIDgpIC0gbUxlbiAtIDFcbiAgdmFyIGVNYXggPSAoMSA8PCBlTGVuKSAtIDFcbiAgdmFyIGVCaWFzID0gZU1heCA+PiAxXG4gIHZhciBuQml0cyA9IC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iIifQ==\n//# sourceURL=webpack-internal:///15\n")},function(module,exports){eval("var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93ZWItbWlkaS1wbGF5ZXIvLi9ub2RlX21vZHVsZXMvaXNhcnJheS9pbmRleC5qcz9lM2RiIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB0b1N0cmluZyA9IHt9LnRvU3RyaW5nO1xuXG5tb2R1bGUuZXhwb3J0cyA9IEFycmF5LmlzQXJyYXkgfHwgZnVuY3Rpb24gKGFycikge1xuICByZXR1cm4gdG9TdHJpbmcuY2FsbChhcnIpID09ICdbb2JqZWN0IEFycmF5XSc7XG59O1xuIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///16\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = function() {\n throw new Error(\n 'ws does not work in the browser. Browser clients must use the native ' +\n 'WebSocket object'\n );\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93ZWItbWlkaS1wbGF5ZXIvLi9ub2RlX21vZHVsZXMvd3MvYnJvd3Nlci5qcz83ZjczIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbigpIHtcbiAgdGhyb3cgbmV3IEVycm9yKFxuICAgICd3cyBkb2VzIG5vdCB3b3JrIGluIHRoZSBicm93c2VyLiBCcm93c2VyIGNsaWVudHMgbXVzdCB1c2UgdGhlIG5hdGl2ZSAnICtcbiAgICAgICdXZWJTb2NrZXQgb2JqZWN0J1xuICApO1xufTtcbiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///17\n")},function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n\n// EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js\nvar regenerator = __webpack_require__(3);\nvar regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);\n\n// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js\nvar asyncToGenerator = __webpack_require__(5);\nvar asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);\n\n// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/classCallCheck.js\nvar classCallCheck = __webpack_require__(4);\nvar classCallCheck_default = /*#__PURE__*/__webpack_require__.n(classCallCheck);\n\n// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/createClass.js\nvar createClass = __webpack_require__(6);\nvar createClass_default = /*#__PURE__*/__webpack_require__.n(createClass);\n\n// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js\nvar defineProperty = __webpack_require__(2);\nvar defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);\n\n// EXTERNAL MODULE: ./node_modules/uuid/v4.js\nvar v4 = __webpack_require__(8);\nvar v4_default = /*#__PURE__*/__webpack_require__.n(v4);\n\n// EXTERNAL MODULE: ./src/constants.js\nvar constants = __webpack_require__(0);\n\n// CONCATENATED MODULE: ./src/events.js\nvar MIDI_INIT = 'MIDI_INIT';\nvar MIDI_ERROR = 'MIDI_ERROR';\nvar MIDI_STATUS = 'MIDI_STATUS';\nvar MIDI_PRELOAD = 'MIDI_PRELOAD';\nvar MIDI_LOAD_FILE = 'MIDI_LOAD_FILE';\nvar MIDI_LOAD_PATCH = 'MIDI_LOAD_PATCH';\nvar MIDI_PLAY = 'MIDI_PLAY';\nvar MIDI_PAUSE = 'MIDI_PAUSE';\nvar MIDI_RESUME = 'MIDI_RESUME';\nvar MIDI_STOP = 'MIDI_STOP';\nvar MIDI_END = 'MIDI_END';\n// EXTERNAL MODULE: ./src/LibTiMidity.js\nvar LibTiMidity = __webpack_require__(1);\n\n// CONCATENATED MODULE: ./src/EventHandler.js\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n\n\nvar EventHandler_EventHandler =\n/*#__PURE__*/\nfunction () {\n /**\n * @class EventHandler\n * @param {object} [configuration]\n * @param {string} [configuration.playerId = undefined] The ID of the Midi Player that sends events.\n * @param {function} [configuration.eventLogger = undefined] The function that receives event payloads.\n * @param {boolean} [configuration.logging = false] Turns ON or OFF logging to the console.\n * @return {object} An `EventHandler` instance.\n */\n function EventHandler(_ref) {\n var _this = this;\n\n var _ref$eventLogger = _ref.eventLogger,\n eventLogger = _ref$eventLogger === void 0 ? undefined : _ref$eventLogger,\n _ref$logging = _ref.logging,\n logging = _ref$logging === void 0 ? false : _ref$logging,\n _ref$playerId = _ref.playerId,\n playerId = _ref$playerId === void 0 ? undefined : _ref$playerId;\n\n classCallCheck_default()(this, EventHandler);\n\n defineProperty_default()(this, \"emitEvent\", function (payload) {\n var payloadWithId = _objectSpread({}, payload, {\n playerId: _this.playerId\n });\n\n if (_this.eventLogger) {\n _this.eventLogger(payloadWithId);\n } else if (_this.logging) {\n if (payloadWithId.event === MIDI_ERROR) {\n console.error(payloadWithId);\n } else {\n console.log(payloadWithId);\n }\n }\n });\n\n this.playerId = playerId;\n this.logging = logging;\n this.eventLogger = eventLogger;\n }\n /**\n * Emits an event that indicates that the MIDI player is initialized.\n * @function\n * @param {undefined}\n */\n\n\n createClass_default()(EventHandler, [{\n key: \"emitInit\",\n value: function emitInit() {\n this.emitEvent({\n event: MIDI_INIT,\n message: 'MIDI player initialized.'\n });\n }\n /**\n * Send payloads to the event logger.\n * @function\n * @param {object} payload\n * @param {string} [payload.event] The name of the event.\n * @param {string} [payload.message] A message that described the event.\n */\n\n }]);\n\n return EventHandler;\n}();\n\n\n// CONCATENATED MODULE: ./src/MidiPlayer.js\n\n\n\n\n\n\nfunction MidiPlayer_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction MidiPlayer_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { MidiPlayer_ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { MidiPlayer_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n\n\n\n\n\nvar isFirstInstance = true;\n\nvar MidiPlayer_MidiPlayer =\n/*#__PURE__*/\nfunction () {\n /**\n * @class MidiPlayer\n * @param {object} [configuration]\n * @param {function} [configuration.eventLogger = undefined] The function that receives event payloads.\n * @param {boolean} [configuration.logging = false] Turns ON or OFF logging to the console.\n * @param {string} [configuration.patchUrl = https://cdn.jsdelivr.net/npm/midi-instrument-patches@latest/] The public path where MIDI instrument patches can be found.\n * @param {object} [configuration.audioContext = undefined] An instance of the Web Audio API AudioContext interface.\n * @property {string} playerId ID of this instance of Midi Player.\n * @property {object} context The AudioContext instance.\n * @property {function} eventLogger The function that is called to emit events.\n * @property {boolean} logging Whether console logging is ON or OFF.\n * @property {arrayBuffer} midiFileArray A typed array that represents the content of the MIDI.\n * @property {*} midiFileBuffer The buffer with the MIDI data.\n * @property {string} patchUrl The URL used to load MIDI instrument patches.\n * @property {object} source The source that plays the audio signal.\n * @property {number} startTime The time when MIDI playback started.\n * @property {number} stream The MIDI stream.\n * @property {*} waveBuffer The buffer with the MIDI data converted to WAV.\n * @property {boolean} isFirstInstance Whether this is the first instance of the Midi Player or not.\n *\n * @return {object} A `MidiPlayer` instance.\n * @example\n * import MidiPlayer from 'web-midi-player';\n *\n * const eventLogger = (payload) => {\n * console.log('Received event:', payload.event)\n * }\n *\n * const midiPlayer = new MidiPlayer({ eventLogger, logging: true });\n */\n function MidiPlayer() {\n var _this = this;\n\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$eventLogger = _ref.eventLogger,\n eventLogger = _ref$eventLogger === void 0 ? undefined : _ref$eventLogger,\n _ref$logging = _ref.logging,\n logging = _ref$logging === void 0 ? false : _ref$logging,\n _ref$patchUrl = _ref.patchUrl,\n patchUrl = _ref$patchUrl === void 0 ? constants[\"j\" /* MIDI_DEFAULT_PATCH_URL */] : _ref$patchUrl,\n audioContext = _ref.audioContext;\n\n classCallCheck_default()(this, MidiPlayer);\n\n defineProperty_default()(this, \"initPlayback\", function () {\n LibTiMidity[\"a\" /* default */].call('mid_song_start', 'void', ['number'], [_this.song]);\n\n _this.connectSource();\n\n _this.waveBuffer = LibTiMidity[\"a\" /* default */]._malloc(constants[\"h\" /* MIDI_AUDIO_BUFFER_SIZE */] * 2);\n\n var gainNode = _this.context.createGain();\n\n gainNode.gain.value = 1;\n _this.startTime = _this.context.currentTime;\n\n _this.emitEvent({\n event: MIDI_PLAY,\n time: 0\n });\n });\n\n defineProperty_default()(this, \"connectSource\", function () {\n // Warning! This feature has been marked as deprecated: https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createScriptProcessor\n // See issue: https://github.com/yvesgurcan/web-midi-player/issues/29\n _this.source = _this.context.createScriptProcessor(constants[\"h\" /* MIDI_AUDIO_BUFFER_SIZE */], 0, 1); // event handler for next buffer full of audio data\n\n _this.source.onaudioprocess = function (event) {\n return _this.handleOutput(event);\n }; // connects the source to the context's destination (the speakers)\n\n\n _this.source.connect(_this.context.destination);\n });\n\n defineProperty_default()(this, \"disconnectSource\", function () {\n _this.source.disconnect();\n\n _this.source = null;\n });\n\n defineProperty_default()(this, \"emitEvent\", function (payload) {\n var payloadWithId = MidiPlayer_objectSpread({}, payload, {\n playerId: _this.playerId\n });\n\n if (_this.eventLogger) {\n _this.eventLogger(payloadWithId);\n } else if (_this.logging) {\n if (payloadWithId.event === MIDI_ERROR) {\n console.error(payloadWithId);\n } else {\n console.log(payloadWithId);\n }\n }\n });\n\n try {\n var playerId = v4_default()();\n this.playerId = playerId;\n this.eventHandler = new EventHandler_EventHandler({\n eventLogger: eventLogger,\n logging: logging,\n playerId: playerId\n });\n } catch (error) {\n console.error('Fatal error. Could not initialize event handler.');\n return;\n }\n\n try {\n this.eventLogger = eventLogger;\n this.logging = logging;\n this.patchUrl = patchUrl;\n this.startTime = 0;\n\n if (audioContext) {\n this.context = audioContext;\n }\n\n LibTiMidity[\"a\" /* default */].init(isFirstInstance);\n this.isFirstInstance = isFirstInstance;\n\n if (isFirstInstance) {\n isFirstInstance = false;\n }\n\n this.eventHandler.emitInit();\n } catch (error) {\n this.emitEvent({\n event: MIDI_ERROR,\n message: 'Could not initialize AudioContext.',\n error: error\n });\n }\n }\n\n createClass_default()(MidiPlayer, [{\n key: \"play\",\n\n /**\n * Starts playback of MIDI input.\n *\n * Please note that you can not use `input.arrayBuffer` and `input.url` concurrently.\n * @param {object} input\n * @param {arrayBuffer} [input.arrayBuffer] An array buffer containing MIDI data to play.\n * @param {string} [input.url] The URL where the MIDI file to play is located.\n * @param {string} [input.name] A human-friendly name for the song.\n * @param {object} [input.audioContext] An instance of the Web Audio API AudioContext interface.\n * @return {boolean} Whether playback was successfully initiated or not.\n * @example\n * const name1 = 'My MIDI file from URL';\n * const url = 'media/file.midi';\n * midiPlayer.play({ url, name: name1 });\n *\n * const name2 = 'My MIDI file from ArrayBuffer';\n * const arrayBuffer = new ArrayBuffer();\n * midiPlayer.play({ arrayBuffer, name: name2 });\n */\n value: function () {\n var _play = asyncToGenerator_default()(\n /*#__PURE__*/\n regenerator_default.a.mark(function _callee() {\n var _ref2,\n arrayBuffer,\n url,\n name,\n audioContext,\n data,\n response,\n _args = arguments;\n\n return regenerator_default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _ref2 = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, arrayBuffer = _ref2.arrayBuffer, url = _ref2.url, name = _ref2.name, audioContext = _ref2.audioContext;\n this.stop();\n\n if (!(!arrayBuffer && !url)) {\n _context.next = 5;\n break;\n }\n\n this.emitEvent({\n event: MIDI_ERROR,\n message: \"Unknown source. URL or array buffer can't be both undefined to start playback.\"\n });\n return _context.abrupt(\"return\", false);\n\n case 5:\n if (!(arrayBuffer && url)) {\n _context.next = 8;\n break;\n }\n\n this.emitEvent({\n event: MIDI_ERROR,\n message: 'Ambiguous source. MIDI data must originate either from a URL or an array buffer to start playback. Not both.'\n });\n return _context.abrupt(\"return\", false);\n\n case 8:\n this.emitEvent({\n event: MIDI_LOAD_FILE,\n message: \"Loading\".concat(MidiPlayer.formatMidiName(name), \"...\")\n });\n data = arrayBuffer;\n\n if (!url) {\n _context.next = 27;\n break;\n }\n\n _context.prev = 11;\n _context.next = 14;\n return fetch(url);\n\n case 14:\n response = _context.sent;\n\n if (!(response.status !== 200)) {\n _context.next = 18;\n break;\n }\n\n this.emitEvent({\n event: MIDI_ERROR,\n message: \"Could not retrieve MIDI\".concat(MidiPlayer.formatMidiName(name), \" (status code: \").concat(response.status, \").\")\n });\n return _context.abrupt(\"return\", false);\n\n case 18:\n _context.next = 20;\n return response.arrayBuffer();\n\n case 20:\n data = _context.sent;\n _context.next = 27;\n break;\n\n case 23:\n _context.prev = 23;\n _context.t0 = _context[\"catch\"](11);\n this.emitEvent({\n event: MIDI_ERROR,\n message: \"Could not retrieve MIDI\".concat(MidiPlayer.formatMidiName(name), \".\"),\n error: _context.t0\n });\n return _context.abrupt(\"return\", false);\n\n case 27:\n this.context = audioContext || new AudioContext();\n this.loadSong({\n arrayBuffer: data\n });\n return _context.abrupt(\"return\", true);\n\n case 30:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this, [[11, 23]]);\n }));\n\n function play() {\n return _play.apply(this, arguments);\n }\n\n return play;\n }()\n }, {\n key: \"loadSong\",\n value: function () {\n var _loadSong = asyncToGenerator_default()(\n /*#__PURE__*/\n regenerator_default.a.mark(function _callee2(_ref3) {\n var arrayBuffer, options, missingPatchCount, i, missingPatch;\n return regenerator_default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n arrayBuffer = _ref3.arrayBuffer;\n this.midiFileArray = new Int8Array(arrayBuffer);\n this.midiFileBuffer = LibTiMidity[\"a\" /* default */]._malloc(this.midiFileArray.length);\n LibTiMidity[\"a\" /* default */].writeArrayToMemory(this.midiFileArray, this.midiFileBuffer);\n LibTiMidity[\"a\" /* default */].call('mid_init', 'number', [], []);\n this.stream = LibTiMidity[\"a\" /* default */].call('mid_istream_open_mem', 'number', ['number', 'number', 'number'], [this.midiFileBuffer, this.midiFileArray.length, false]);\n options = LibTiMidity[\"a\" /* default */].call('mid_create_options', 'number', ['number', 'number', 'number', 'number'], [this.context.sampleRate, constants[\"i\" /* MIDI_AUDIO_S16LSB */], 1, constants[\"h\" /* MIDI_AUDIO_BUFFER_SIZE */] * 2]);\n this.song = LibTiMidity[\"a\" /* default */].call('mid_song_load', 'number', ['number', 'number'], [this.stream, options]);\n LibTiMidity[\"a\" /* default */].call('mid_istream_close', 'number', ['number'], [this.stream]);\n missingPatchCount = LibTiMidity[\"a\" /* default */].call('mid_song_get_num_missing_instruments', 'number', ['number'], [this.song]);\n\n if (!(missingPatchCount > 0)) {\n _context2.next = 27;\n break;\n }\n\n this.emitEvent({\n event: MIDI_LOAD_PATCH,\n message: \"Loading \".concat(missingPatchCount, \" MIDI instrument patches...\")\n });\n i = 0;\n\n case 13:\n if (!(i < missingPatchCount)) {\n _context2.next = 27;\n break;\n }\n\n missingPatch = LibTiMidity[\"a\" /* default */].call('mid_song_get_missing_instrument', 'string', ['number', 'number'], [this.song, i]);\n _context2.prev = 15;\n _context2.next = 18;\n return LibTiMidity[\"a\" /* default */].loadPatchFromUrl(this.patchUrl, missingPatch);\n\n case 18:\n _context2.next = 24;\n break;\n\n case 20:\n _context2.prev = 20;\n _context2.t0 = _context2[\"catch\"](15);\n this.emitEvent({\n event: MIDI_ERROR,\n message: \"Could not retrieve instrument patch '\".concat(missingPatch, \"'.\"),\n error: _context2.t0\n });\n return _context2.abrupt(\"return\");\n\n case 24:\n i++;\n _context2.next = 13;\n break;\n\n case 27:\n // we need to reload the MIDI once the instrument patches have been loaded\n this.stream = LibTiMidity[\"a\" /* default */].call('mid_istream_open_mem', 'number', ['number', 'number', 'number'], [this.midiFileBuffer, this.midiFileArray.length, false]);\n this.song = LibTiMidity[\"a\" /* default */].call('mid_song_load', 'number', ['number', 'number'], [this.stream, options]);\n LibTiMidity[\"a\" /* default */].call('mid_istream_close', 'number', ['number'], [this.stream]);\n this.initPlayback();\n\n case 31:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this, [[15, 20]]);\n }));\n\n function loadSong(_x) {\n return _loadSong.apply(this, arguments);\n }\n\n return loadSong;\n }()\n }, {\n key: \"handleOutput\",\n value: function handleOutput(_ref4) {\n var outputBuffer = _ref4.outputBuffer;\n\n try {\n var time = this.context.currentTime - this.startTime;\n this.emitEvent({\n event: MIDI_PLAY,\n time: time\n }); // collect new wave data from LibTiMidity into waveBuffer\n\n var readWaveBytes = LibTiMidity[\"a\" /* default */].call('mid_song_read_wave', 'number', ['number', 'number', 'number', 'number'], [this.song, this.waveBuffer, constants[\"h\" /* MIDI_AUDIO_BUFFER_SIZE */] * 2, false]);\n\n if (readWaveBytes === 0) {\n this.stop();\n this.emitEvent({\n event: MIDI_END,\n time: time\n });\n return;\n } // loop through the samples\n\n\n for (var i = 0; i < constants[\"h\" /* MIDI_AUDIO_BUFFER_SIZE */]; i++) {\n if (i < readWaveBytes) {\n // converts PCM data from sint16 in C to number in JavaScript (range: -1.0 .. +1.0)\n outputBuffer.getChannelData(0)[i] = LibTiMidity[\"a\" /* default */].getValue(this.waveBuffer + 2 * i, 'i16') / constants[\"g\" /* MAX_I16 */];\n } else {\n // fill end of buffer with zeroes, may happen at the end of a piece\n outputBuffer.getChannelData(0)[i] = 0;\n }\n }\n } catch (error) {\n this.emitEvent({\n event: MIDI_ERROR,\n message: 'Could not process audio.',\n error: error\n });\n }\n }\n /**\n * Pauses playback of MIDI input.\n * @param {undefined}\n * @return {boolean} Whether playback was successfully paused or not.\n * @example\n * midiPlayer.pause();\n */\n\n }, {\n key: \"pause\",\n value: function pause() {\n try {\n this.context.suspend();\n var time = this.context.currentTime - this.startTime;\n this.emitEvent({\n event: MIDI_PAUSE,\n time: time\n });\n return true;\n } catch (error) {\n this.emitEvent({\n event: MIDI_ERROR,\n message: 'Could not pause playback.',\n error: error\n });\n return false;\n }\n }\n /**\n * Resumes playback of MIDI input.\n * @param {undefined}\n * @return {boolean} Whether playback was successfully ressumed or not.\n * @example\n * midiPlayer.resume();\n */\n\n }, {\n key: \"resume\",\n value: function resume() {\n try {\n this.context.resume();\n var time = this.context.currentTime - this.startTime;\n this.emitEvent({\n event: MIDI_RESUME,\n time: time\n });\n return true;\n } catch (error) {\n this.emitEvent({\n event: MIDI_ERROR,\n message: 'Could not resume playback.',\n error: error\n });\n return false;\n }\n }\n /**\n * Stops playback of MIDI input.\n * @param {undefined}\n * @return {boolean} Whether playback was successfully stopped or not.\n * @example\n * midiPlayer.stop();\n */\n\n }, {\n key: \"stop\",\n value: function stop() {\n try {\n if (this.source) {\n this.disconnectSource(); // free libtimitdiy ressources\n\n LibTiMidity[\"a\" /* default */]._free(this.waveBuffer);\n\n LibTiMidity[\"a\" /* default */]._free(this.midiFileBuffer);\n\n LibTiMidity[\"a\" /* default */].call('mid_song_free', 'void', ['number'], [this.song]);\n LibTiMidity[\"a\" /* default */].call('mid_exit', 'void', [], []);\n this.song = 0;\n }\n\n this.startTime = 0;\n this.emitEvent({\n event: MIDI_STOP,\n time: 0\n });\n return true;\n } catch (error) {\n this.emitEvent({\n event: MIDI_ERROR,\n message: 'Could not stop playback.',\n error: error\n });\n return false;\n }\n } // terminate playback\n\n }], [{\n key: \"formatMidiName\",\n value: function formatMidiName(name) {\n return name ? \" '\".concat(name, \"'\") : '';\n }\n }]);\n\n return MidiPlayer;\n}();\n\n\n// CONCATENATED MODULE: ./src/index.js\n\n/* harmony default export */ var src = __webpack_exports__[\"default\"] = (MidiPlayer_MidiPlayer);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93ZWItbWlkaS1wbGF5ZXIvLi9zcmMvZXZlbnRzLmpzPzE1NjYiLCJ3ZWJwYWNrOi8vd2ViLW1pZGktcGxheWVyLy4vc3JjL0V2ZW50SGFuZGxlci5qcz9mN2QwIiwid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL3NyYy9NaWRpUGxheWVyLmpzP2YyYzUiLCJ3ZWJwYWNrOi8vd2ViLW1pZGktcGxhe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50SGFuZGxlcih7XG4gICAgICAgICAgICAgICAgZXZlbnRMb2dnZXIsXG4gICAgICAgICAgICAgICAgbG9nZ2luZyxcbiAgICAgICAgICAgICAgICBwbGF5ZXJJZFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICBjb25zb2xlLmVycm9yKCdGYXRhbCBlcnJvci4gQ291bGQgbm90IGluaXRpYWxpemUgZXZlbnQgaGFuZGxlci4nKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICB0aGlzLmV2ZW50TG9nZ2VyID0gZXZlbnRMb2dnZXI7XG4gICAgICAgICAgICB0aGlzLmxvZ2dpbmcgPSBsb2dnaW5nO1xuICAgICAgICAgICAgdGhpcy5wYXRjaFVybCA9IHBhdGNoVXJsO1xuICAgICAgICAgICAgdGhpcy5zdGFydFRpbWUgPSAwO1xuXG4gICAgICAgICAgICBpZiAoYXVkaW9Db250ZXh0KSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jb250ZXh0ID0gYXVkaW9Db250ZXh0O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBMaWJUaU1pZGl0eS5pbml0KGlzRmlyc3RJbnN0YW5jZSk7XG5cbiAgICAgICAgICAgIHRoaXMuaXNGaXJzdEluc3RhbmNlID0gaXNGaXJzdEluc3RhbmNlO1xuICAgICAgICAgICAgaWYgKGlzRmlyc3RJbnN0YW5jZSkge1xuICAgICAgICAgICAgICAgIGlzRmlyc3RJbnN0YW5jZSA9IGZhbHNlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0aGlzLmV2ZW50SGFuZGxlci5lbWl0SW5pdCgpO1xuICAgICAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgdGhpcy5lbWl0RXZlbnQoe1xuICAgICAgICAgICAgICAgIGV2ZW50OiBNSURJX0VSUk9SLFxuICAgICAgICA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ICAqIEBleGFtcGxlXG4gICAgICogY29uc3QgbmFtZTEgPSAnTXkgTUlESSBmaWxlIGZyb20gVVJMJztcbiAgICAgKiBjb25zdCB1cmwgPSAnbWVkaWEvZmlsZS5taWRpJztcbiAgICAgKiBtaWRpUGxheWVyLnBsYXkoeyB1cmwsIG5hbWU6IG5hbWUxIH0pO1xuICAgICAqXG4gICAgICogY29uc3QgbmFtZTIgPSAnTXkgTUlESSBmaWxlIGZyb20gQXJyYXlCdWZmZXInO1xuICAgICAqIGNvbnN0IGFycmF5QnVmZmVyID0gbmV3IEFycmF5QnVmZmVyKCk7XG4gICAgICogbWlkaVBsYXllci5wbGF5KHsgYXJyYXlCdWZmZXIsIG5hbWU6IG5hbWUyIH0pO1xuICAgICAqL1xuICAgIGFzeW5jIHBsYXkoeyBhcnJheUJ1ZmZlciwgdXJsLCBuYW1lLCBhdWRpb0NvbnRleHQgfSA9IHt9KSB7XG4gICAgICAgIHRoaXMuc3RvcCgpO1xuXG4gICAgICAgIGlmICghYXJyYXlCdWZmZXIgJiYgIXVybCkge1xuICAgICAgICAgICAgdGhpcy5lbWl0RXZlbnQoe1xuICAgICAgICAgICAgICAgIGV2ZW50OiBNSURJX0VSUk9SLFxuICAgICAgICAgICAgICAgIG1lc3NhZ2U6XG4gICAgICAgICAgICAgICAgICAgIFwiVW5rbm93biBzb3VyY2UuIFVSTCBvciBhcnJheSBidWZmZXIgY2FuJ3QgYmUgYm90aCB1bmRlZmluZWQgdG8gc3RhcnQgcGxheWJhY2suXCJcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGFycmF5QnVmZmVyICYmIHVybCkge1xuICAgICAgICAgICAgdGhpcy5lbWl0RXZlbnQoe1xuICAgICAgICAgICAgICAgIGV2ZW50OiBNSURJX0VSUk9SLFxuICAgICAgICAgICAgICAgIG1lc3NhZ2U6XG4gICAgICAgICAgICAgICAgICAgICdBbWJpZ3VvdXMgc291cmNlLiBNSURJIGRhdGEgbXVzdCBvcmlnaW5hdGUgZWl0aGVyIGZyb20gYSBVUkwgb3IgYW4gYXJyYXkgYnVmZmVyIHRvIHN0YXJ0IHBsYXliYWNrLiBOb3QgYm90aC4nXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuZW1pdEV2ZW50KHtcbiAgICAgICAgICAgIGV2ZW50OiBNSURJX0xPQURfRklMRSxcbiAgICAgICAgICAgIG1lc3NhZ2U6IGBMb2FkaW5nJHtNaWRpUGxheWVyLmZvcm1hdE1pZGlOYW1lKG5hbWUpfS4uLmBcbiAgICAgICAgfSk7XG5cbiAgICAgICAgbGV0IGRhdGEgPSBhcnJheUJ1ZmZlcjtcblxuICAgICAgICBpZiAodXJsKSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHJlc3BvbnNlID0gYXdhaXQgZmV0Y2godXJsKTtcbiAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2Uuc3RhdHVzICE9PSAyMDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5lbWl0RXZlbnQoe1xuICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQ6IE1JRElfRVJST1IsXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOiBgQ291bGQgbm90IHJldHJpZXZlIE1JREkke01pZGlQbGF5ZXIuZm9ybWF0TWlkaU5hbWUoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZVxuICAgICAgICAgICAgICAgICAgICAgICAgKX0gKHN0YXR1cyBjb2RlOiAke3Jlc3BvbnNlLnN0YXR1c30pLmBcbiAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGRhdGEgPSBhd2FpdCByZXNwb25zZS5hcnJheUJ1ZmZlcigpO1xuICAgICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmVtaXRFdmVudCh7XG4gICAgICAgICAgICAgICAgICAgIGV2ZW50OiBNSURJX0VSUk9SLFxuICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOiBgQ291bGQgbm90IHJldHJpZXZlIE1JREkke01pZGlQbGF5ZXIuZm9ybWF0TWlkaU5hbWUoXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lXG4gICAgICAgICAgICAgICAgICAgICl9LmAsXG4gICAgICAgICAgICAgICAgICAgIGVycm9yXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5jb250ZXh0ID0gYXVkaW9Db250ZXh0IHx8IG5ldyBBdWRpb0NvbnRleHQoKTtcbiAgICAgICAgdGhpcy5sb2FkU29uZyh7IGFycmF5QnVmZmVyOiBkYXRhIH0pO1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9XG5cbiAgICBhc3luYyBsb2FkU29uZyh7IGFycmF5QnVmZmVyIH0pIHtcbiAgICAgICAgdGhpcy5taWRpRmlsZUFycmF5ID0gbmV3IEludDhBcnJheShhcnJheUJ1ZmZlcik7XG4gICAgICAgIHRoaXMubWlkaUZpbGVCdWZmZXIgPSBMaWJUaU1pZGl0eS5fbWFsbG9jKHRoaXMubWlkaUZpbGVBcnJheS5sZW5ndGgpO1xuICAgICAgICBMaWJUaU1pZGl0eS53cml0ZUFycmF5VG9NZW1vcnkodGhpcy5taWRpRmlsZUFycmF5LCB0aGlzLm1pZGlGaWxlQnVmZmVyKTtcbiAgICAgICAgTGliVGlNaWRpdHkuY2FsbCgnbWlkX2luaXQnLCAnbnVtYmVyJywgW10sIFtdKTtcblxuICAgICAgICB0aGlzLnN0cmVhbSA9IExpYlRpTWlkaXR5LmNhbGwoXG4gICAgICAgICAgICAnbWlkX2lzdHJlYW1fb3Blbl9tZW0nLFxuICAgICAgICAgICAgJ251bWJlcicsXG4gICAgICAgICAgICBbJ251bWJlcicsICdudW1iZXInLCAnbnVtYmVyJ10sXG4gICAgICAgICAgICBbdGhpcy5taWRpRmlsZUJ1ZmZlciwgdGhpcy5taWRpRmlsZUFycmF5Lmxlbmd0aCwgZmFsc2VdXG4gICAgICAgICk7XG5cbiAgICAgICAgY29uc3Qgb3B0aW9ucyA9IExpYlRpTWlkaXR5LmNhbGwoXG4gICAgICAgICAgICAnbWlkX2NyZWF0ZV9vcHRpb25zJyxcbiAgICAgICAgICAgICdudW1iZXInLFxuICAgICAgICAgICAgWydudW1iZXInLCAnbnVtYmVyJywgJ251bWJlcicsICdudW1iZXInXSxcbiAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICB0aGlzLmNvbnRleHQuc2FtcGxlUmF0ZSxcbiAgICAgICAgICAgICAgICBNSURJX0FVRElPX1MxNkxTQixcbiAgICAgICAgICAgICAgICAxLFxuICAgICAgICAgICAgICAgIE1JRElfQVVESU9fQlVGRkVSX1NJWkUgKiAyXG4gICAgICAgICAgICBdXG4gICAgICAgICk7XG5cbiAgICAgICAgdGhpcy5zb25nID0gTGliVGlNaWRpdHkuY2FsbChcbiAgICAgICAgICAgICdtaWRfc29uZ19sb2FkJyxcbiAgICAgICAgICAgICdudW1iZXInLFxuICAgICAgICAgICAgWydudW1iZXInLCAnbnVtYmVyJ10sXG4gICAgICAgICAgICBbdGhpcy5zdHJlYW0sIG9wdGlvbnNdXG4gICAgICAgICk7XG5cbiAgICAgICAgTGliVGlNaWRpdHkuY2FsbChcbiAgICAgICAgICAgICdtaWRfaXN0cmVhbV9jbG9zZScsXG4gICAgICAgICAgICAnbnVtYmVyJyxcbiAgICAgICAgICAgIFsnbnVtYmVyJ10sXG4gICAgICAgICAgICBbdGhpcy5zdHJlYW1dXG4gICAgICAgICk7XG5cbiAgICAgICAgY29uc3QgbWlzc2luZ1BhdGNoQ291bnQgPSBMaWJUaU1pZGl0eS5jYWxsKFxuICAgICAgICAgICAgJ21pZF9zb25nX2dldF9udW1fbWlzc2luZ19pbnN0cnVtZW50cycsXG4gICAgICAgICAgICAnbnVtYmVyJyxcbiAgICAgICAgICAgIFsnbnVtYmVyJ10sXG4gICAgICAgICAgICBbdGhpcy5zb25nXVxuICAgICAgICApO1xuXG4gICAgICAgIGlmIChtaXNzaW5nUGF0Y2hDb3VudCA+IDApIHtcbiAgICAgICAgICAgIHRoaXMuZW1pdEV2ZW50KHtcbiAgICAgICAgICAgICAgICBldmVudDogTUlESV9MT0FEX1BBVENILFxuICAgICAgICAgICAgICAgIG1lc3NhZ2U6IGBMb2FkaW5nICR7bWlzc2luZ1BhdGNoQ291bnR9IE1JREkgaW5zdHJ1bWVudCBwYXRjaGVzLi4uYFxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWlzc2luZ1BhdGNoQ291bnQ7IGkrKykge1xuICAgICAgICAgICAgICAgIGNvbnN0IG1pc3NpbmdQYXRjaCA9IExpYlRpTWlkaXR5LmNhbGwoXG4gICAgICAgICAgICAgICAgICAgICdtaWRfc29uZ19nZXRfbWlzc2luZ19pbnN0cnVtZW50JyxcbiAgICAgICAgICAgICAgICAgICAgJ3N0cmluZycsXG4gICAgICAgICAgICAgICAgICAgIFsnbnVtYmVyJywgJ251bWJlciddLFxuICAgICAgICAgICAgICAgICAgICBbdGhpcy5zb25nLCBpXVxuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBhd2FpdCBMaWJUaU1pZGl0eS5sb2FkUGF0Y2hGcm9tVXJsKFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXRjaFVybCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1pc3NpbmdQYXRjaFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZW1pdEV2ZW50KHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50OiBNSURJX0VSUk9SLFxuICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogYENvdWxkIG5vdCByZXRyaWV2ZSBpbnN0cnVtZW50IHBhdGNoICcke21pc3NpbmdQYXRjaH0nLmAsXG4gICAgICAgICAgICAgICAgICAgICAgICBlcnJvclxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHdlIG5lZWQgdG8gcmVsb2FkIHRoZSBNSURJIG9uY2UgdGhlIGluc3RydW1lbnQgcGF0Y2hlcyBoYXZlIGJlZW4gbG9hZGVkXG4gICAgICAgIHRoaXMuc3RyZWFtID0gTGliVGlNaWRpdHkuY2FsbChcbiAgICAgICAgICAgICdtaWRfaXN0cmVhbV9vcGVuX21lbScsXG4gICAgICAgICAgICAnbnVtYmVyJyxcbiAgICAgICAgICAgIFsnbnVtYmVyJywgJ251bWJlcicsICdudW1iZXInXSxcbiAgICAgICAgICAgIFt0aGlzLm1pZGlGaWxlQnVmZmVyLCB0aGlzLm1pZGlGaWxlQXJyYXkubGVuZ3RoLCBmYWxzZV1cbiAgICAgICAgKTtcblxuICAgICAgICB0aGlzLnNvbmcgPSBMaWJUaU1pZGl0eS5jYWxsKFxuICAgICAgICAgICAgJ21pZF9zb25nX2xvYWQnLFxuICAgICAgICAgICAgJ251bWJlcicsXG4gICAgICAgICAgICBbJ251bWJlcicsICdudW1iZXInXSxcbiAgICAgICAgICAgIFt0aGlzLnN0cmVhbSwgb3B0aW9uc11cbiAgICAgICAgKTtcblxuICAgICAgICBMaWJUaU1pZGl0eS5jYW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AgICAgIGNvbnN0IHJlYWRXYXZlQnl0ZXMgPSBMaWJUaU1pZGl0eS5jYWxsKFxuICAgICAgICAgICAgICAgICdtaWRfc29uZ19yZWFkX3dhdmUnLFxuICAgICAgICAgICAgICAgICdudW1iZXInLFxuICAgICAgICAgICAgICAgIFsnbnVtYmVyJywgJ251bWJlcicsICdudW1iZXInLCAnbnVtYmVyJ10sXG4gICAgICAgICAgICAgICAgW3RoaXMuc29uZywgdGhpcy53YXZlQnVmZmVyLCBNSURJX0FVRElPX0JVRkZFUl9TSVpFICogMiwgZmFsc2VdXG4gICAgICAgICAgICApO1xuXG4gICAgICAgICAgICBpZiAocmVhZFdhdmVCeXRlcyA9PT0gMCkge1xuICAgICAgICAgICAgICAgIHRoaXMuc3RvcCgpO1xuICAgICAgICAgICAgICAgIHRoaXMuZW1pdEV2ZW50KHtcbiAgICAgICAgICAgICAgICAgICAgZXZlbnQ6IE1JRElfRU5ELFxuICAgICAgICAgICAgICAgICAgICB0aW1lXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBsb29wIHRocm91Z2ggdGhlIHNhbXBsZXNcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgTUlESV9BVURJT19CVUZGRVJfU0laRTsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKGkgPCByZWFkV2F2ZUJ5dGVzKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbnZlcnRzIFBDTSBkYXRhIGZyb20gc2ludDE2IGluIEMgdG8gbnVtYmVyIGluIEphdmFTY3JpcHQgKHJhbmdlOiAtMS4wIC4uICsxLjApXG4gICAgICAgICAgICAgICAgICAgIG91dHB1dEJ1ZmZlci5nZXRDaGFubmVsRGF0YSgwKVtpXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICBMaWJUaU1pZGl0eS5nZXRWYWx1ZSh0aGlzLndhdmVCdWZmZXIgKyAyICogaSwgJ2kxNicpIC9cbiAgICAgICAgICAgICAgICAgICAgICAgIE1BWF9JMTY7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gZmlsbCBlbmQgb2YgYnVmZmVyIHdpdGggemVyb2VzLCBtYXkgaGFwcGVuIGF0IHRoZSBlbmQgb2YgYSBwaWVjZVxuICAgICAgICAgICAgICAgICAgICBvdXRwdXRCdWZmZXIuZ2V0Q2hhbm5lbERhdGEoMClbaV0gPSAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICAgIHRoaXMuZW1pdEV2ZW50KHtcbiAgICAgICAgICAgICAgICBldmVudDogTUlESV9FUlJPUixcbiAgICAgICAgICAgICAgICBtZXNzYWdlOiAnQ291bGQgbm90IHByb2Nlc3MgYXVkaW8uJyxcbiAgICAgICAgICAgICAgICBlcnJvclxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBQYXVzZXMgcGxheWJhY2sgb2YgTUlESSBpbnB1dC5cbiAgICAgKiBAcGFyYW0ge3VuZGVmaW5lZH1cbiAgICAgKiBAcmV0dXJuIHtib29sZWFufSBXaGV0aGVyIHBsYXliYWNrIHdhcyBzdWNjZXNzZnVsbHkgcGF1c2VkIG9yIG5vdC5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIG1pZGlQbGF5ZXIucGF1c2UoKTtcbiAgICAgKi9cbiAgICBwYXVzZSgpIHtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHRoaXMuY29udGV4dC5zdXNwZW5kKCk7XG4gICAgICAgICAgICBjb25zdCB0aW1lID0gdGhpcy5jb250ZXh0LmN1cnJlbnRUaW1lIC0gdGhpcy5zdGFydFRpbWU7XG4gICAgICAgICAgICB0aGlzLmVtaXRFdmVudCh7XG4gICAgICAgICAgICAgICAgZXZlbnQ6IE1JRElfUEFVU0UsXG4gICAgICAgICAgICAgICAgdGltZVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICAgIHRoaXMuZW1pdEV2ZW50KHtcbiAgICAgICAgICAgICAgICBldmVudDogTUlESV9FUlJPUixcbiAgICAgICAgICAgICAgICBtZXNzYWdlOiAnQ291bGQgbm90IHBhdXNlIHBsYXliYWNrLicsXG4gICAgICAgICAgICAgICAgZXJyb3JcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBSZXN1bWVzIHBsYXliYWNrIG9mIE1JREkgaW5wdXQuXG4gICAgICogQHBhcmFtIHt1bmRlZmluZWR9XG4gICAgICogQHJldHVybiB7Ym9vbGVhbn0gV2hldGhlciBwbGF5YmFjayB3YXMgc3VjY2Vzc2Z1bGx5IHJlc3N1bWVkIG9yIG5vdC5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIG1pZGlQbGF5ZXIucmVzdW1lKCk7XG4gICAgICovXG4gICAgcmVzdW1lKCkge1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgdGhpcy5jb250ZXh0LnJlc3VtZSgpO1xuICAgICAgICAgICAgY29uc3QgdGltZSA9IHRoaXMuY29udGV4dC5jdXJyZW50VGltZSAtIHRoaXMuc3RhcnRUaW1lO1xuICAgICAgICAgICAgdGhpcy5lbWl0RXZlbnQoe1xuICAgICAgICAgICAgICAgIGV2ZW50OiBNSURJX1JFU1VNRSxcbiAgICAgICAgICAgICAgICB0aW1lXG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICB0aGlzLmVtaXRFdmVudCh7XG4gICAgICAgICAgICAgICAgZXZlbnQ6IE1JRElfRVJST1IsXG4gICAgICAgICAgICAgICAgbWVzc2FnZTogJ0NvdWxkIG5vdCByZXN1bWUgcGxheWJhY2suJyxcbiAgICAgICAgICAgICAgICBlcnJvclxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFN0b3BzIHBsYXliYWNrIG9mIE1JREkgaW5wdXQuXG4gICAgICogQHBhcmFtIHt1bmRlZmluZWR9XG4gICAgICogQHJldHVybiB7Ym9vbGVhbn0gV2hldGhlciBwbGF5YmFjayB3YXMgc3VjY2Vzc2Z1bGx5IHN0b3BwZWQgb3Igbm90LlxuICAgICAqIEBleGFtcGxlXG4gICAgICogbWlkaVBsYXllci5zdG9wKCk7XG4gICAgICovXG4gICAgc3RvcCgpIHtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIGlmICh0aGlzLnNvdXJjZSkge1xuICAgICAgICAgICAgICAgIHRoaXMuZGlzY29ubmVjdFNvdXJjZSgpO1xuXG4gICAgICAgICAgICAgICAgLy8gZnJlZSBsaWJ0aW1pdGRpeSByZXNzb3VyY2VzXG4gICAgICAgICAgICAgICAgTGliVGlNaWRpdHkuX2ZyZWUodGhpcy53YXZlQnVmZmVyKTtcbiAgICAgICAgICAgICAgICBMaWJUaU1pZGl0eS5fZnJlZSh0aGlzLm1pZGlGaWxlQnVmZmVyKTtcblxuICAgICAgICAgICAgICAgIExpYlRpTWlkaXR5LmNhbGwoXG4gICAgICAgICAgICAgICAgICAgICdtaWRfc29uZ19mcmVlJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ZvaWQnLFxuICAgICAgICAgICAgICAgICAgICBbJ251bWJlciddLFxuICAgICAgICAgICAgICAgICAgICBbdGhpcy5zb25nXVxuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICBMaWJUaU1pZGl0eS5jYWxsKCdtaWRfZXhpdCcsICd2b2lkJywgW10sIFtdKTtcblxuICAgICAgICAgICAgICAgIHRoaXMuc29uZyA9IDA7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRoaXMuc3RhcnRUaW1lID0gMDtcblxuICAgICAgICAgICAgdGhpcy5lbWl0RXZlbnQoe1xuICAgICAgICAgICAgICAgIGV2ZW50OiBNSURJX1NUT1AsXG4gICAgICAgICAgICAgICAgdGltZTogMFxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgdGhpcy5lbWl0RXZlbnQoe1xuICAgICAgICAgICAgICAgIGV2ZW50OiBNSURJX0VSUk9SLFxuICAgICAgICAgICAgICAgIG1lc3NhZ2U6ICdDb3VsZCBub3Qgc3RvcCBwbGF5YmFjay4nLFxuICAgICAgICAgICAgICAgIGVycm9yXG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gdGVybWluYXRlIHBsYXliYWNrXG4gICAgZGlzY29ubmVjdFNvdXJjZSA9ICgpID0+IHtcbiAgICAgICAgdGhpcy5zb3VyY2UuZGlzY29ubmVjdCgpO1xuICAgICAgICB0aGlzLnNvdXJjZSA9IG51bGw7XG4gICAgfTtcblxuICAgIC8qKlxuICAgICAqIFNlbmQgY3VzdG9tIHBheWxvYWRzIHRvIHRoZSBldmVudCBsb2dnZXIuXG4gICAgICogQGZ1bmN0aW9uXG4gICAgICogQHBhcmFtIHtvYmplY3R9IHBheWxvYWRcbiAgICAgKiBAcGFyYW0ge3N0cmluZ30gW3BheWxvYWQuZXZlbnRdIFRoZSBuYW1lIG9mIHRoZSBldmVudC5cbiAgICAgKiBAcGFyYW0ge3N0cmluZ30gW3BheWxvYWQubWVzc2FnZV0gQSBtZXNzYWdlIHRoYXQgZGVzY3JpYmVkI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FBQUE7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUZBO0FBQ0E7QUFLQTtBQUNBO0FBTUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUdBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBSEE7QUFLQTtBQUNBO0FBRUE7Ozs7Ozs7Ozs7QUFPQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBSEE7QUFNQTtBQUNBO0FBQ0E7QUFFQTs7Ozs7Ozs7OztBQU9BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRkE7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFIQTtBQU1BO0FBQ0E7QUFDQTtBQUVBOzs7Ozs7Ozs7O0FBT0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFPQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBRkE7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFIQTtBQU1BO0FBQ0E7QUFDQTtBQUNBOzs7QUExV0E7QUFDQTtBQUNBOzs7Ozs7OztBQ3hHQTtBQUVBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///18\n")}])})); \ No newline at end of file +!function(g,I){"object"==typeof exports&&"object"==typeof module?module.exports=I():"function"==typeof define&&define.amd?define([],I):"object"==typeof exports?exports["web-midi-player"]=I():g["web-midi-player"]=I()}(window,(function(){return function(g){var I={};function A(C){if(I[C])return I[C].exports;var i=I[C]={i:C,l:!1,exports:{}};return g[C].call(i.exports,i,i.exports,A),i.l=!0,i.exports}return A.m=g,A.c=I,A.d=function(g,I,C){A.o(g,I)||Object.defineProperty(g,I,{enumerable:!0,get:C})},A.r=function(g){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(g,"__esModule",{value:!0})},A.t=function(g,I){if(1&I&&(g=A(g)),8&I)return g;if(4&I&&"object"==typeof g&&g&&g.__esModule)return g;var C=Object.create(null);if(A.r(C),Object.defineProperty(C,"default",{enumerable:!0,value:g}),2&I&&"string"!=typeof g)for(var i in g)A.d(C,i,function(I){return g[I]}.bind(null,i));return C},A.n=function(g){var I=g&&g.__esModule?function(){return g.default}:function(){return g};return A.d(I,"a",I),I},A.o=function(g,I){return Object.prototype.hasOwnProperty.call(g,I)},A.p="",A(A.s=18)}([function(module,__webpack_exports__,__webpack_require__){"use strict";eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"g\", function() { return MAX_I16; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"h\", function() { return MIDI_AUDIO_BUFFER_SIZE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"i\", function() { return MIDI_AUDIO_S16LSB; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"j\", function() { return MIDI_DEFAULT_PATCH_URL; });\n/* unused harmony export MIDI_PLAYER_MESSAGE_PREFIX */\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"e\", function() { return LIBTIMIDITY_PATCH_DIRECTORY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"f\", function() { return LIBTIMIDITY_PATCH_DRUM_DIRECTORY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return LIBTIMIDITY_CONFIG_FILE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return LIBTIMIDITY_ERROR_CODES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return LIBTIMIDITY_ERROR_MESSAGES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return LIBTIMIDITY_CONFIG_DATA; });\nvar MAX_I16 = Math.pow(2, 15);\nvar MIDI_AUDIO_BUFFER_SIZE = 8192;\nvar MIDI_AUDIO_S16LSB = 0x8010;\nvar MIDI_DEFAULT_PATCH_URL = 'https://cdn.jsdelivr.net/npm/midi-instrument-patches@latest/';\nvar MIDI_PLAYER_MESSAGE_PREFIX = 'Midi player:';\nvar LIBTIMIDITY_PATCH_DIRECTORY = 'pat';\nvar LIBTIMIDITY_PATCH_DRUM_DIRECTORY = 'MT32Drums';\nvar LIBTIMIDITY_CONFIG_FILE = 'timidity.cfg';\nvar LIBTIMIDITY_ERROR_CODES = {\n EPERM: 1,\n ENOENT: 2,\n ESRCH: 3,\n EINTR: 4,\n EIO: 5,\n ENXIO: 6,\n E2BIG: 7,\n ENOEXEC: 8,\n EBADF: 9,\n ECHILD: 10,\n EAGAIN: 11,\n EWOULDBLOCK: 11,\n ENOMEM: 12,\n EACCES: 13,\n EFAULT: 14,\n ENOTBLK: 15,\n EBUSY: 16,\n EEXIST: 17,\n EXDEV: 18,\n ENODEV: 19,\n ENOTDIR: 20,\n EISDIR: 21,\n EINVAL: 22,\n ENFILE: 23,\n EMFILE: 24,\n ENOTTY: 25,\n ETXTBSY: 26,\n EFBIG: 27,\n ENOSPC: 28,\n ESPIPE: 29,\n EROFS: 30,\n EMLINK: 31,\n EPIPE: 32,\n EDOM: 33,\n ERANGE: 34,\n ENOMSG: 42,\n EIDRM: 43,\n ECHRNG: 44,\n EL2NSYNC: 45,\n EL3HLT: 46,\n EL3RST: 47,\n ELNRNG: 48,\n EUNATCH: 49,\n ENOCSI: 50,\n EL2HLT: 51,\n EDEADLK: 35,\n ENOLCK: 37,\n EBADE: 52,\n EBADR: 53,\n EXFULL: 54,\n ENOANO: 55,\n EBADRQC: 56,\n EBADSLT: 57,\n EDEADLOCK: 35,\n EBFONT: 59,\n ENOSTR: 60,\n ENODATA: 61,\n ETIME: 62,\n ENOSR: 63,\n ENONET: 64,\n ENOPKG: 65,\n EREMOTE: 66,\n ENOLINK: 67,\n EADV: 68,\n ESRMNT: 69,\n ECOMM: 70,\n EPROTO: 71,\n EMULTIHOP: 72,\n EDOTDOT: 73,\n EBADMSG: 74,\n ENOTUNIQ: 76,\n EBADFD: 77,\n EREMCHG: 78,\n ELIBACC: 79,\n ELIBBAD: 80,\n ELIBSCN: 81,\n ELIBMAX: 82,\n ELIBEXEC: 83,\n ENOSYS: 38,\n ENOTEMPTY: 39,\n ENAMETOOLONG: 36,\n ELOOP: 40,\n EOPNOTSUPP: 95,\n EPFNOSUPPORT: 96,\n ECONNRESET: 104,\n ENOBUFS: 105,\n EAFNOSUPPORT: 97,\n EPROTOTYPE: 91,\n ENOTSOCK: 88,\n ENOPROTOOPT: 92,\n ESHUTDOWN: 108,\n ECONNREFUSED: 111,\n EADDRINUSE: 98,\n ECONNABORTED: 103,\n ENETUNREACH: 101,\n ENETDOWN: 100,\n ETIMEDOUT: 110,\n EHOSTDOWN: 112,\n EHOSTUNREACH: 113,\n EINPROGRESS: 115,\n EALREADY: 114,\n EDESTADDRREQ: 89,\n EMSGSIZE: 90,\n EPROTONOSUPPORT: 93,\n ESOCKTNOSUPPORT: 94,\n EADDRNOTAVAIL: 99,\n ENETRESET: 102,\n EISCONN: 106,\n ENOTCONN: 107,\n ETOOMANYREFS: 109,\n EUSERS: 87,\n EDQUOT: 122,\n ESTALE: 116,\n ENOTSUP: 95,\n ENOMEDIUM: 123,\n EILSEQ: 84,\n EOVERFLOW: 75,\n ECANCELED: 125,\n ENOTRECOVERABLE: 131,\n EOWNERDEAD: 130,\n ESTRPIPE: 86\n};\nvar LIBTIMIDITY_ERROR_MESSAGES = {\n 0: 'Success',\n 1: 'Not super-user',\n 2: 'No such file or directory',\n 3: 'No such process',\n 4: 'Interrupted system call',\n 5: 'I/O error',\n 6: 'No such device or address',\n 7: 'Arg list too long',\n 8: 'Exec format error',\n 9: 'Bad file number',\n 10: 'No children',\n 11: 'No more processes',\n 12: 'Not enough core',\n 13: 'Permission denied',\n 14: 'Bad address',\n 15: 'Block device required',\n 16: 'Mount device busy',\n 17: 'File exists',\n 18: 'Cross-device link',\n 19: 'No such device',\n 20: 'Not a directory',\n 21: 'Is a directory',\n 22: 'Invalid argument',\n 23: 'Too many open files in system',\n 24: 'Too many open files',\n 25: 'Not a typewriter',\n 26: 'Text file busy',\n 27: 'File too large',\n 28: 'No space left on device',\n 29: 'Illegal seek',\n 30: 'Read only file system',\n 31: 'Too many links',\n 32: 'Broken pipe',\n 33: 'Math arg out of domain of func',\n 34: 'Math result not representable',\n 35: 'File locking deadlock error',\n 36: 'File or path name too long',\n 37: 'No record locks available',\n 38: 'Function not implemented',\n 39: 'Directory not empty',\n 40: 'Too many symbolic links',\n 42: 'No message of desired type',\n 43: 'Identifier removed',\n 44: 'Channel number out of range',\n 45: 'Level 2 not synchronized',\n 46: 'Level 3 halted',\n 47: 'Level 3 reset',\n 48: 'Link number out of range',\n 49: 'Protocol driver not attached',\n 50: 'No CSI structure available',\n 51: 'Level 2 halted',\n 52: 'Invalid exchange',\n 53: 'Invalid request descriptor',\n 54: 'Exchange full',\n 55: 'No anode',\n 56: 'Invalid request code',\n 57: 'Invalid slot',\n 59: 'Bad font file fmt',\n 60: 'Device not a stream',\n 61: 'No data (for no delay io)',\n 62: 'Timer expired',\n 63: 'Out of streams resources',\n 64: 'Machine is not on the network',\n 65: 'Package not installed',\n 66: 'The object is remote',\n 67: 'The link has been severed',\n 68: 'Advertise error',\n 69: 'Srmount error',\n 70: 'Communication error on send',\n 71: 'Protocol error',\n 72: 'Multihop attempted',\n 73: 'Cross mount point (not really error)',\n 74: 'Trying to read unreadable message',\n 75: 'Value too large for defined data type',\n 76: 'Given log. name not unique',\n 77: 'f.d. invalid for this operation',\n 78: 'Remote address changed',\n 79: 'Can access a needed shared lib',\n 80: 'Accessing a corrupted shared lib',\n 81: '.lib section in a.out corrupted',\n 82: 'Attempting to link in too many libs',\n 83: 'Attempting to exec a shared library',\n 84: 'Illegal byte sequence',\n 86: 'Streams pipe error',\n 87: 'Too many users',\n 88: 'Socket operation on non-socket',\n 89: 'Destination address required',\n 90: 'Message too long',\n 91: 'Protocol wrong type for socket',\n 92: 'Protocol not available',\n 93: 'Unknown protocol',\n 94: 'Socket type not supported',\n 95: 'Not supported',\n 96: 'Protocol family not supported',\n 97: 'Address family not supported by protocol family',\n 98: 'Address already in use',\n 99: 'Address not available',\n 100: 'Network interface is not configured',\n 101: 'Network is unreachable',\n 102: 'Connection reset by network',\n 103: 'Connection aborted',\n 104: 'Connection reset by peer',\n 105: 'No buffer space available',\n 106: 'Socket is already connected',\n 107: 'Socket is not connected',\n 108: \"Can't send after socket shutdown\",\n 109: 'Too many references',\n 110: 'Connection timed out',\n 111: 'Connection refused',\n 112: 'Host is down',\n 113: 'Host is unreachable',\n 114: 'Socket already connected',\n 115: 'Connection already in progress',\n 116: 'Stale file handle',\n 122: 'Quota exceeded',\n 123: 'No medium (in tape drive)',\n 125: 'Operation canceled',\n 130: 'Previous owner died',\n 131: 'State not recoverable'\n}; // prettier-ignore\n\nvar LIBTIMIDITY_CONFIG_DATA = [100, 105, 114, 32, 46, 47, 112, 97, 116, 10, 10, 100, 114, 117, 109, 115, 101, 116, 32, 48, 10, 10, 32, 51, 53, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 48, 46, 112, 97, 116, 10, 32, 51, 54, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 46, 112, 97, 116, 10, 32, 51, 55, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 46, 112, 97, 116, 10, 32, 51, 56, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 46, 112, 97, 116, 10, 32, 51, 57, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 52, 46, 112, 97, 116, 10, 32, 52, 48, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 53, 46, 112, 97, 116, 10, 32, 52, 49, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 54, 46, 112, 97, 116, 10, 32, 52, 50, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 55, 46, 112, 97, 116, 10, 32, 52, 51, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 56, 46, 112, 97, 116, 10, 32, 52, 52, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 57, 46, 112, 97, 116, 10, 32, 52, 53, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 48, 46, 112, 97, 116, 10, 32, 52, 54, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 49, 46, 112, 97, 116, 10, 32, 52, 55, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 50, 46, 112, 97, 116, 10, 32, 52, 56, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 51, 46, 112, 97, 116, 10, 32, 52, 57, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 52, 46, 112, 97, 116, 10, 32, 53, 48, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 53, 46, 112, 97, 116, 10, 32, 53, 49, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 54, 46, 112, 97, 116, 10, 32, 53, 50, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 55, 46, 112, 97, 116, 10, 32, 53, 51, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 56, 46, 112, 97, 116, 10, 32, 53, 52, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 49, 57, 46, 112, 97, 116, 10, 32, 53, 53, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 48, 46, 112, 97, 116, 10, 32, 53, 54, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 49, 46, 112, 97, 116, 10, 32, 53, 55, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 50, 46, 112, 97, 116, 10, 32, 53, 56, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 51, 46, 112, 97, 116, 10, 32, 53, 57, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 52, 46, 112, 97, 116, 10, 32, 54, 48, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 53, 46, 112, 97, 116, 10, 32, 54, 49, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 54, 46, 112, 97, 116, 10, 32, 54, 50, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 55, 46, 112, 97, 116, 10, 32, 54, 51, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 56, 46, 112, 97, 116, 10, 32, 54, 52, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 50, 57, 46, 112, 97, 116, 10, 32, 54, 53, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 48, 46, 112, 97, 116, 10, 32, 54, 54, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 49, 46, 112, 97, 116, 10, 32, 54, 55, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 50, 46, 112, 97, 116, 10, 32, 54, 56, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 51, 46, 112, 97, 116, 10, 32, 54, 57, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 52, 46, 112, 97, 116, 10, 32, 55, 48, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 53, 46, 112, 97, 116, 10, 32, 55, 49, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 54, 46, 112, 97, 116, 10, 32, 55, 50, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 55, 46, 112, 97, 116, 10, 32, 55, 51, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 56, 46, 112, 97, 116, 10, 32, 55, 52, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 51, 57, 46, 112, 97, 116, 10, 32, 55, 53, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 52, 48, 46, 112, 97, 116, 10, 32, 55, 54, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 52, 49, 46, 112, 97, 116, 10, 32, 55, 55, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 52, 50, 46, 112, 97, 116, 10, 32, 55, 56, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 52, 51, 46, 112, 97, 116, 10, 32, 55, 57, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 52, 52, 46, 112, 97, 116, 10, 32, 56, 48, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 52, 53, 46, 112, 97, 116, 10, 32, 56, 49, 9, 32, 77, 84, 51, 50, 68, 114, 117, 109, 115, 47, 109, 116, 51, 50, 100, 114, 117, 109, 45, 52, 54, 46, 112, 97, 116, 10, 10, 98, 97, 110, 107, 32, 48, 10, 10, 32, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 50, 55, 46, 112, 97, 116, 10, 32, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 50, 54, 46, 112, 97, 116, 10, 32, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 50, 53, 46, 112, 97, 116, 10, 32, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 50, 52, 46, 112, 97, 116, 10, 32, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 50, 51, 46, 112, 97, 116, 10, 32, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 50, 50, 46, 112, 97, 116, 10, 32, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 50, 49, 46, 112, 97, 116, 10, 32, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 50, 48, 46, 112, 97, 116, 10, 32, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 57, 46, 112, 97, 116, 10, 32, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 56, 46, 112, 97, 116, 10, 32, 49, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 55, 46, 112, 97, 116, 10, 32, 49, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 54, 46, 112, 97, 116, 10, 32, 49, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 53, 46, 112, 97, 116, 10, 32, 49, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 52, 46, 112, 97, 116, 10, 32, 49, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 51, 46, 112, 97, 116, 10, 32, 49, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 50, 46, 112, 97, 116, 10, 32, 49, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 49, 46, 112, 97, 116, 10, 32, 49, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 48, 46, 112, 97, 116, 10, 32, 49, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 57, 46, 112, 97, 116, 10, 32, 49, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 56, 46, 112, 97, 116, 10, 32, 50, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 55, 46, 112, 97, 116, 10, 32, 50, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 54, 46, 112, 97, 116, 10, 32, 50, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 53, 46, 112, 97, 116, 10, 32, 50, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 52, 46, 112, 97, 116, 10, 32, 50, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 51, 46, 112, 97, 116, 10, 32, 50, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 50, 46, 112, 97, 116, 10, 32, 50, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 49, 46, 112, 97, 116, 10, 32, 50, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 48, 46, 112, 97, 116, 10, 32, 50, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 57, 46, 112, 97, 116, 10, 32, 50, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 56, 46, 112, 97, 116, 10, 32, 51, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 55, 46, 112, 97, 116, 10, 32, 51, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 54, 46, 112, 97, 116, 10, 32, 51, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 53, 46, 112, 97, 116, 10, 32, 51, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 52, 46, 112, 97, 116, 10, 32, 51, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 51, 46, 112, 97, 116, 10, 32, 51, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 50, 46, 112, 97, 116, 10, 32, 51, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 49, 46, 112, 97, 116, 10, 32, 51, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 48, 46, 112, 97, 116, 10, 32, 51, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 57, 46, 112, 97, 116, 10, 32, 51, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 56, 46, 112, 97, 116, 10, 32, 52, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 55, 46, 112, 97, 116, 10, 32, 52, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 54, 46, 112, 97, 116, 10, 32, 52, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 53, 46, 112, 97, 116, 10, 32, 52, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 52, 46, 112, 97, 116, 10, 32, 52, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 51, 46, 112, 97, 116, 10, 32, 52, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 50, 46, 112, 97, 116, 10, 32, 52, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 49, 46, 112, 97, 116, 10, 32, 52, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 48, 46, 112, 97, 116, 10, 32, 52, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 57, 46, 112, 97, 116, 10, 32, 52, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 56, 46, 112, 97, 116, 10, 32, 53, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 55, 46, 112, 97, 116, 10, 32, 53, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 54, 46, 112, 97, 116, 10, 32, 53, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 53, 46, 112, 97, 116, 10, 32, 53, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 52, 46, 112, 97, 116, 10, 32, 53, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 51, 46, 112, 97, 116, 10, 32, 53, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 50, 46, 112, 97, 116, 10, 32, 53, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 49, 46, 112, 97, 116, 10, 32, 53, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 48, 46, 112, 97, 116, 10, 32, 53, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 57, 46, 112, 97, 116, 10, 32, 53, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 56, 46, 112, 97, 116, 10, 32, 54, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 55, 46, 112, 97, 116, 10, 32, 54, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 54, 46, 112, 97, 116, 10, 32, 54, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 53, 46, 112, 97, 116, 10, 32, 54, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 52, 46, 112, 97, 116, 10, 32, 54, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 51, 46, 112, 97, 116, 10, 32, 54, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 50, 46, 112, 97, 116, 10, 32, 54, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 49, 46, 112, 97, 116, 10, 32, 54, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 48, 46, 112, 97, 116, 10, 32, 54, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 57, 46, 112, 97, 116, 10, 32, 54, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 56, 46, 112, 97, 116, 10, 32, 55, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 55, 46, 112, 97, 116, 10, 32, 55, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 54, 46, 112, 97, 116, 10, 32, 55, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 53, 46, 112, 97, 116, 10, 32, 55, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 52, 46, 112, 97, 116, 10, 32, 55, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 51, 46, 112, 97, 116, 10, 32, 55, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 50, 46, 112, 97, 116, 10, 32, 55, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 49, 46, 112, 97, 116, 10, 32, 55, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 48, 46, 112, 97, 116, 10, 32, 55, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 57, 46, 112, 97, 116, 10, 32, 55, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 56, 46, 112, 97, 116, 10, 32, 56, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 55, 46, 112, 97, 116, 10, 32, 56, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 54, 46, 112, 97, 116, 10, 32, 56, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 53, 46, 112, 97, 116, 10, 32, 56, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 52, 46, 112, 97, 116, 10, 32, 56, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 51, 46, 112, 97, 116, 10, 32, 56, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 50, 46, 112, 97, 116, 10, 32, 56, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 49, 46, 112, 97, 116, 10, 32, 56, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 48, 46, 112, 97, 116, 10, 32, 56, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 57, 46, 112, 97, 116, 10, 32, 56, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 56, 46, 112, 97, 116, 10, 32, 57, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 55, 46, 112, 97, 116, 10, 32, 57, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 54, 46, 112, 97, 116, 10, 32, 57, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 53, 46, 112, 97, 116, 10, 32, 57, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 52, 46, 112, 97, 116, 10, 32, 57, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 51, 46, 112, 97, 116, 10, 32, 57, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 50, 46, 112, 97, 116, 10, 32, 57, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 49, 46, 112, 97, 116, 10, 32, 57, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 48, 46, 112, 97, 116, 10, 32, 57, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 57, 46, 112, 97, 116, 10, 32, 57, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 56, 46, 112, 97, 116, 10, 32, 49, 48, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 55, 46, 112, 97, 116, 10, 32, 49, 48, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 54, 46, 112, 97, 116, 10, 32, 49, 48, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 53, 46, 112, 97, 116, 10, 32, 49, 48, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 52, 46, 112, 97, 116, 10, 32, 49, 48, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 51, 46, 112, 97, 116, 10, 32, 49, 48, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 50, 46, 112, 97, 116, 10, 32, 49, 48, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 49, 46, 112, 97, 116, 10, 32, 49, 48, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 48, 46, 112, 97, 116, 10, 32, 49, 48, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 57, 46, 112, 97, 116, 10, 32, 49, 48, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 56, 46, 112, 97, 116, 10, 32, 49, 49, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 55, 46, 112, 97, 116, 10, 32, 49, 49, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 54, 46, 112, 97, 116, 10, 32, 49, 49, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 53, 46, 112, 97, 116, 10, 32, 49, 49, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 52, 46, 112, 97, 116, 10, 32, 49, 49, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 51, 46, 112, 97, 116, 10, 32, 49, 49, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 50, 46, 112, 97, 116, 10, 32, 49, 49, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 49, 46, 112, 97, 116, 10, 32, 49, 49, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 48, 46, 112, 97, 116, 10, 32, 49, 49, 56, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 57, 46, 112, 97, 116, 10, 32, 49, 49, 57, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 56, 46, 112, 97, 116, 10, 32, 49, 50, 48, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 55, 46, 112, 97, 116, 10, 32, 49, 50, 49, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 54, 46, 112, 97, 116, 10, 32, 49, 50, 50, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 53, 46, 112, 97, 116, 10, 32, 49, 50, 51, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 52, 46, 112, 97, 116, 10, 32, 49, 50, 52, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 51, 46, 112, 97, 116, 10, 32, 49, 50, 53, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 50, 46, 112, 97, 116, 10, 32, 49, 50, 54, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 49, 46, 112, 97, 116, 10, 32, 49, 50, 55, 9, 32, 97, 114, 97, 99, 104, 110, 111, 45, 48, 46, 112, 97, 116, 10];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL3NyYy9jb25zdGFudHMuanM/NWZiMCJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY29uc3QgTUFYX0kxNiA9IDIgKiogMTU7XG5cbmV4cG9ydCBjb25zdCBNSURJX0FVRElPX0JVRkZFUl9TSVpFID0gODE5MjtcblxuZXhwb3J0IGNvbnN0IE1JRElfQVVESU9fUzE2TFNCID0gMHg4MDEwO1xuXG5leHBvcnQgY29uc3QgTUlESV9ERUZBVUxUX1BBVENIX1VSTCA9XG4gICAgJ2h0dHBzOi8vY2RuLmpzZGVsaXZyLm5ldC9ucG0vbWlkaS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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUF2SEE7QUFDQTtBQTBIQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///0\n")},function(module,__webpack_exports__,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(0);\n// https://github.com/kripken/emscripten/wiki/\nvar INT_TYPES={i1:0,i8:0,i16:0,i32:0,i64:0};var FLOAT_TYPES={\"float\":0,\"double\":0};/** @class */var LibTiMidity=/**\n * Library to allow the handling of MIDI files.\n * @param {undefined}\n * @return {object} The module of an instance of LibTiMidity.\n */function LibTiMidity(){_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4___default()(this,LibTiMidity);var Runtime={stackSave:function stackSave(){return STACKTOP;},stackRestore:function stackRestore(stackTop){STACKTOP=stackTop;},isNumberType:function isNumberType(type){return type in INT_TYPES||type in FLOAT_TYPES;},isPointerType:function isPointerType(type){return type[type.length-1]=='*';},isStructType:function isStructType(type){if(isPointerType(type))return false;if(isArrayType(type))return true;if(/?/.test(type))return true;// { i32, i8 } etc. - anonymous struct types\n// See comment in isStructPointerType()\nreturn type[0]=='%';},getNativeTypeSize:function getNativeTypeSize(type){switch(type){case'i1':case'i8':return 1;case'i16':return 2;case'i32':return 4;case'i64':return 8;case'float':return 4;case'double':return 8;default:{if(type[type.length-1]==='*'){return Runtime.QUANTUM_SIZE;// A pointer\n}else if(type[0]==='i'){var bits=parseInt(type.substr(1));assert(bits%8===0);return bits/8;}}}},getNativeFieldSize:function getNativeFieldSize(type){return Math.max(Runtime.getNativeTypeSize(type),Runtime.QUANTUM_SIZE);},dedup:function dedup(items,ident){var seen={};if(ident){return items.filter(function(item){if(seen[item[ident]])return false;seen[item[ident]]=true;return true;});}else{return items.filter(function(item){if(seen[item])return false;seen[item]=true;return true;});}},set:function set(){var args=_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_3___default()(arguments[0])==='object'?arguments[0]:arguments;var ret={};for(var i=0;i=0){diffs.push(curr-prev);}prev=curr;return curr;});type.flatSize=Runtime.alignMemory(type.flatSize,type.alignSize);if(diffs.length==0){type.flatFactor=type.flatSize;}else if(Runtime.dedup(diffs).length==1){type.flatFactor=diffs[0];}type.needsFlattening=type.flatFactor!=1;return type.flatIndexes;},generateStructInfo:function generateStructInfo(struct,typeName,offset){var type,alignment;if(typeName){offset=offset||0;type=(typeof Types==='undefined'?Runtime.typeInfo:Types.types)[typeName];if(!type)return null;if(type.fields.length!=struct.length){console.warn('Number of named fields must match the type for '+typeName+': possibly duplicate struct names. Cannot return structInfo');return null;}alignment=type.flatIndexes;}else{var type={fields:struct.map(function(item){return item[0];})};alignment=Runtime.calculateStructAlignment(type);}var ret={__size__:type.flatSize};if(typeName){struct.forEach(function(item,i){if(typeof item==='string'){ret[item]=alignment[i]+offset;}else{// embedded struct\nvar key;for(var k in item){key=k;}ret[key]=Runtime.generateStructInfo(item[key],type.fields[i],alignment[i]);}});}else{struct.forEach(function(item,i){ret[item[1]]=alignment[i];});}return ret;},dynCall:function dynCall(sig,ptr,args){if(args&&args.length){if(!args.splice)args=Array.prototype.slice.call(args);args.splice(0,0,ptr);return Module['dynCall_'+sig].apply(null,args);}else{return Module['dynCall_'+sig].call(null,ptr);}},functionPointers:[],warnOnce:function warnOnce(text){if(!Runtime.warnOnce.shown)Runtime.warnOnce.shown={};if(!Runtime.warnOnce.shown[text]){Runtime.warnOnce.shown[text]=1;console.warn(text);}},funcWrappers:{},UTF8Processor:function UTF8Processor(){var buffer=[];var needed=0;this.processCChar=function(code){code=code&0xff;if(buffer.length==0){if((code&0x80)==0x00){// 0xxxxxxx\nreturn String.fromCharCode(code);}buffer.push(code);if((code&0xe0)==0xc0){// 110xxxxx\nneeded=1;}else if((code&0xf0)==0xe0){// 1110xxxx\nneeded=2;}else{// 11110xxx\nneeded=3;}return'';}if(needed){buffer.push(code);needed--;if(needed>0)return'';}var c1=buffer[0];var c2=buffer[1];var c3=buffer[2];var c4=buffer[3];var ret;if(buffer.length==2){ret=String.fromCharCode((c1&0x1f)<<6|c2&0x3f);}else if(buffer.length==3){ret=String.fromCharCode((c1&0x0f)<<12|(c2&0x3f)<<6|c3&0x3f);}else{// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\nvar codePoint=(c1&0x07)<<18|(c2&0x3f)<<12|(c3&0x3f)<<6|c4&0x3f;ret=String.fromCharCode(Math.floor((codePoint-0x10000)/0x400)+0xd800,(codePoint-0x10000)%0x400+0xdc00);}buffer.length=0;return ret;};this.processJSString=function(string){string=unescape(encodeURIComponent(string));var ret=[];for(var i=0;i=TOTAL_MEMORY)enlargeMemory();return ret;},alignMemory:function alignMemory(size,quantum){var ret=size=Math.ceil(size/(quantum?quantum:8))*(quantum?quantum:8);return ret;},makeBigInt:function makeBigInt(low,high,unsigned){var ret=unsigned?+(low>>>0)+ +(high>>>0)*+4294967296:+(low>>>0)+ +(high|0)*+4294967296;return ret;},GLOBAL_BASE:8,QUANTUM_SIZE:4};var Module={};this.Module=Module;Module.arguments=arguments;if(!Module['arguments']){Module['arguments']=[];}Module.read=function(url){var xhr=new XMLHttpRequest();xhr.open('GET',url,false);xhr.send(null);return xhr.responseText;};Module.print=function(message){console.log(message);};Module.preRun=[];Module.postRun=[];var ABORT=false;// whether we are quitting the application. no code should run after this. set in exit() and abort()\nvar tempI64;function ExitStatus(status){this.name='ExitStatus';this.message='Program terminated with exit('+status+')';this.status=status;}ExitStatus.prototype=new Error();ExitStatus.prototype.constructor=ExitStatus;/**\n * Exits the script.\n * @function exit\n * @memberof LibTiMidity\n * @instance\n * @param {string} status The message to display.\n */function exit(status){ABORT=true;STACKTOP=initialStackTop;// exit the runtime\nexitRuntime();throw new ExitStatus(status);}Module.exit=exit;/**\n * Throws an error that aborts the execution of the script.\n * @function abort\n * @memberof LibTiMidity\n * @instance\n * @param {string} text The message to display.\n */function abort(text){ABORT=true;throw new Error(text).stack;}Module.abort=abort;/**\n * Aborts the execution of the script if assertion fails.\n * @function assert\n * @memberof LibTiMidity\n * @instance\n * @param {boolean} condition The assertion to test.\n * @param {string} text The message to display if the assertion fails.\n */function assert(condition,text){if(!condition){abort(text);}}Module.assert=assert;/**\n * A wrapper to call functions.\n * @function call\n * @memberof LibTiMidity\n * @instance\n * @param {string} ident The name of the function to call.\n * @param {string} returnType The return type of the function, one of the JS types 'number', 'string' or 'array' (use 'number' for any C pointer, and 'array' for JavaScript arrays and typed arrays; note that arrays are 8-bit).\n * @param {array} argTypes An array of the types of arguments for the function (if there are no arguments, this can be ommitted). Types are as in returnType, except that 'array' is not possible (there is no way for us to know the length of the array)\n * @param {array} args An array of the arguments to the function, as native JS values (as in returnType). Note that string arguments will be stored on the stack (the JS string will become a C string on the stack).\n * @return Native JS value (as in returnType)\n */Module.call=function call(ident,returnType,argTypes,args){var func=Module['_'+ident];if(!func){abort(\"Unknown function: \\\"\".concat(ident,\"\\\".\"));}var stack=0;function toC(value,type){if(type=='string'){if(value===null||value===undefined||value===0)return 0;// null string\nvalue=intArrayFromString(value);type='array';}if(type=='array'){if(!stack)stack=Runtime.stackSave();var ret=Runtime.stackAlloc(value.length);writeArrayToMemory(value,ret);return ret;}return value;}function fromC(value,type){if(type=='string'){return Pointer_stringify(value);}assert(type!='array');return value;}var i=0;var cArgs=args?args.map(function(arg){return toC(arg,argTypes[i++]);}):[];var ret=fromC(func.apply(null,cArgs),returnType);if(stack)Runtime.stackRestore(stack);return ret;};/**\n * Dynamically sets a value in memory at runtime. Only does *aligned* writes. This is a lower-level operation.\n * @function setValue\n * @memberof LibTiMidity\n * @instance\n * @param ptr Pointer.\n * @param value\n * @param {string} type LLVM type ('i8', , 'i16', 'i32', 'i64', 'float', 'double')\n */function setValue(ptr,value,type){type=type||'i8';if(type.charAt(type.length-1)==='*')type='i32';// pointers are 32-bit\nswitch(type){case'i1':HEAP8[ptr]=value;break;case'i8':HEAP8[ptr]=value;break;case'i16':HEAP16[ptr>>1]=value;break;case'i32':HEAP32[ptr>>2]=value;break;case'i64':tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=+1?tempDouble>+0?(Math_min(+Math_floor(tempDouble/+4294967296),+4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/+4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case'float':HEAPF32[ptr>>2]=value;break;case'double':HEAPF64[ptr>>3]=value;break;default:abort('invalid type for setValue: '+type);}}Module.setValue=setValue;/**\n * Dynamically gets a value in memory at runtime. Only does *aligned* reads. This is a lower-level operation.\n * @function getValue\n * @memberof LibTiMidity\n * @instance\n * @param ptr Pointer.\n * @param {string} type LLVM type ('i8', , 'i16', 'i32', 'i64', 'float', 'double')\n */function getValue(ptr,type){type=type||'i8';if(type.charAt(type.length-1)==='*')type='i32';// pointers are 32-bit\nswitch(type){case'i1':return HEAP8[ptr];case'i8':return HEAP8[ptr];case'i16':return HEAP16[ptr>>1];case'i32':return HEAP32[ptr>>2];case'i64':return HEAP32[ptr>>2];case'float':return HEAPF32[ptr>>2];case'double':return HEAPF64[ptr>>3];default:abort('invalid type for getValue: '+type);}return null;}Module['getValue']=getValue;var ALLOC_NORMAL=0;// Tries to use _malloc()\nvar ALLOC_STACK=1;// Lives for the duration of the current function call\nvar ALLOC_STATIC=2;// Cannot be freed\nvar ALLOC_DYNAMIC=3;// Cannot be freed except through sbrk\nvar ALLOC_NONE=4;// Do not allocate\nModule['ALLOC_NORMAL']=ALLOC_NORMAL;Module['ALLOC_STACK']=ALLOC_STACK;Module['ALLOC_STATIC']=ALLOC_STATIC;Module['ALLOC_DYNAMIC']=ALLOC_DYNAMIC;Module['ALLOC_NONE']=ALLOC_NONE;/**\n * This is for internal use. Optimized for multiple syntaxes to save space in generated code. You should allocate memory using _malloc(), initialize it with setValue(), and so forth.\n * @function allocate\n * @memberof LibTiMidity\n * @instance\n * @param slab An array of data or a number. If a number, then the size of the block to allocate in *bytes* (note that this is sometimes confusing: the next parameter does not affect this).\n * @param types Either an array of types, one for each byte (or 0 if no type at that position), or a single type which is used for the entire block. This only matters if there is initial data. If slab is a number, then this does not matter at all and is ignored.\n * @param allocator How to allocate memory, see ALLOC_*\n */function allocate(slab,types,allocator,ptr){var zeroinit,size;if(typeof slab==='number'){zeroinit=true;size=slab;}else{zeroinit=false;size=slab.length;}var singleType=typeof types==='string'?types:null;var ret;if(allocator==ALLOC_NONE){ret=ptr;}else{ret=[_malloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][allocator===undefined?ALLOC_STATIC:allocator](Math.max(size,singleType?1:types.length));}if(zeroinit){var ptr=ret,stop;assert((ret&3)==0);stop=ret+(size&~3);for(;ptr>2]=0;}stop=ret+size;while(ptr=128)hasUtf=true;else if(t==0&&!length)break;i++;if(length&&i==length)break;}if(!length)length=i;var ret='';if(!hasUtf){var MAX_CHUNK=1024;// split up into chunks, because .apply on a huge string can overflow the stack\nvar curr;while(length>0){curr=String.fromCharCode.apply(String,HEAPU8.subarray(ptr,ptr+Math.min(length,MAX_CHUNK)));ret=ret?ret+curr:curr;ptr+=MAX_CHUNK;length-=MAX_CHUNK;}return ret;}var utf8=new Runtime.UTF8Processor();for(i=0;i>1];if(codeUnit==0)return str;++i;// fromCharCode constructs a character from a UTF-16 code unit, so we can pass the UTF16 string right through.\nstr+=String.fromCharCode(codeUnit);}}Module['UTF16ToString']=UTF16ToString;/**\n * Copies a JavaScript string to the emscripten HEAP. The copy is null-terminated and encoded in UTF16LE form. The copy will require at most (str.length*2+1)*2 bytes of space in the HEAP.\n * @function stringToUTF16\n * @memberof LibTiMidity\n * @instance\n * @param {string} str JavaScript string.\n * @param outPtr HEAP address (pointer).\n */function stringToUTF16(str,outPtr){for(var i=0;i>1]=codeUnit;}// Null-terminate the pointer to the HEAP.\nHEAP16[outPtr+str.length*2>>1]=0;}Module['stringToUTF16']=stringToUTF16;/**\n * @function UTF32ToString\n * @memberof LibTiMidity\n * @instance\n * @param ptr Pointer to a null-terminated UTF32LE-encoded string in the emscripten HEAP.\n * @return\n */function UTF32ToString(ptr){var i=0;var str='';while(1){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)return str;++i;// Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing.\nif(utf32>=0x10000){var ch=utf32-0x10000;str+=String.fromCharCode(0xd800|ch>>10,0xdc00|ch&0x3ff);}else{str+=String.fromCharCode(utf32);}}}Module['UTF32ToString']=UTF32ToString;/**\n * Copies a JavaScript string to the emscripten HEAP. The copy is null-terminated and encoded in UTF32LE form. The copy will require at most (str.length+1)*4 bytes of space in the HEAP.\n * @function stringToUTF32\n * @memberof LibTiMidity\n * @instance\n * @param {string} str JavaScript string.\n * @param outPtr HEAP address (pointer).\n */function stringToUTF32(str,outPtr){var iChar=0;for(var iCodeUnit=0;iCodeUnit=0xd800&&codeUnit<=0xdfff){var trailSurrogate=str.charCodeAt(++iCodeUnit);codeUnit=0x10000+((codeUnit&0x3ff)<<10)|trailSurrogate&0x3ff;}HEAP32[outPtr+iChar*4>>2]=codeUnit;++iChar;}// Null-terminate the pointer to the HEAP.\nHEAP32[outPtr+iChar*4>>2]=0;}Module['stringToUTF32']=stringToUTF32;// Memory management\nvar PAGE_SIZE=4096;function alignMemoryPage(x){return x+4095&-4096;}var HEAP;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;var STATIC_BASE=0,STATICTOP=0;var STACK_BASE=0,STACKTOP=0,STACK_MAX=0;// stack area\nvar DYNAMIC_BASE=0,DYNAMICTOP=0;// dynamic area handled by sbrk\nfunction enlargeMemory(){abort('Cannot enlarge memory arrays in asm.js. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value '+TOTAL_MEMORY+', or (2) set Module.TOTAL_MEMORY before the program runs.');}Module['TOTAL_STACK']||5242880;var TOTAL_MEMORY=Module['TOTAL_MEMORY']||67108864;Module['FAST_MEMORY']||2097152;// Initialize the runtime's memory\n// check for full engine support (use string 'subarray' to avoid closure compiler confusion)\nassert(typeof Int32Array!=='undefined'&&typeof Float64Array!=='undefined'&&!!new Int32Array(1)['subarray']&&!!new Int32Array(1)['set'],'Cannot fallback to non-typed array case: Code is too specialized');var buffer=new ArrayBuffer(TOTAL_MEMORY);HEAP8=new Int8Array(buffer);HEAP16=new Int16Array(buffer);HEAP32=new Int32Array(buffer);HEAPU8=new Uint8Array(buffer);HEAPU16=new Uint16Array(buffer);HEAPU32=new Uint32Array(buffer);HEAPF32=new Float32Array(buffer);HEAPF64=new Float64Array(buffer);// Endianness check (note: assumes compiler arch was little-endian)\nHEAP32[0]=255;assert(HEAPU8[0]===255&&HEAPU8[3]===0,'Typed arrays 2 must be run on a little-endian system');Module['HEAP']=HEAP;Module['HEAP8']=HEAP8;Module['HEAP16']=HEAP16;Module['HEAP32']=HEAP32;Module['HEAPU8']=HEAPU8;Module['HEAPU16']=HEAPU16;Module['HEAPU32']=HEAPU32;Module['HEAPF32']=HEAPF32;Module['HEAPF64']=HEAPF64;/**\n * @function callRuntimeCallbacks\n * @memberof LibTiMidity\n * @instance\n * @param callbacks\n */function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=='function'){callback();continue;}var func=callback.func;if(typeof func==='number'){if(callback.arg===undefined){Runtime.dynCall('v',func);}else{Runtime.dynCall('vi',func,[callback.arg]);}}else{func(callback.arg===undefined?null:callback.arg);}}}var __ATPRERUN__=[];// functions called before the runtime is initialized\nvar __ATINIT__=[];// functions called during startup\nvar __ATMAIN__=[];// functions called when main() is to be run\nvar __ATEXIT__=[];// functions called during shutdown\nvar __ATPOSTRUN__=[];// functions called after the runtime has exited\nvar runtimeInitialized=false;function preRun(){// compatibility - merge in anything from Module['preRun'] at this time\nif(Module['preRun']){if(typeof Module['preRun']=='function')Module['preRun']=[Module['preRun']];while(Module['preRun'].length){addOnPreRun(Module['preRun'].shift());}}callRuntimeCallbacks(__ATPRERUN__);}function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__);}function preMain(){callRuntimeCallbacks(__ATMAIN__);}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__);}function postRun(){// compatibility - merge in anything from Module['postRun'] at this time\nif(Module['postRun']){if(typeof Module['postRun']=='function')Module['postRun']=[Module['postRun']];while(Module['postRun'].length){addOnPostRun(Module['postRun'].shift());}}callRuntimeCallbacks(__ATPOSTRUN__);}/**\n * @function addOnPreRun\n * @memberof LibTiMidity\n * @instance\n * @param cb Callback.\n */function addOnPreRun(cb){__ATPRERUN__.unshift(cb);}Module['addOnPreRun']=Module.addOnPreRun=addOnPreRun;/**\n * @function addOnInit\n * @memberof LibTiMidity\n * @instance\n * @param cb Callback.\n */function addOnInit(cb){__ATINIT__.unshift(cb);}Module['addOnInit']=addOnInit;/**\n * @function addOnPreMain\n * @memberof LibTiMidity\n * @instance\n * @param cb Callback.\n */function addOnPreMain(cb){__ATMAIN__.unshift(cb);}Module['addOnPreMain']=addOnPreMain;/**\n * @function addOnExit\n * @memberof LibTiMidity\n * @instance\n * @param cb Callback.\n */function addOnExit(cb){__ATEXIT__.unshift(cb);}Module['addOnExit']=addOnExit;/**\n * @function addOnPostRun\n * @memberof LibTiMidity\n * @instance\n * @param cb Callback.\n */function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb);}Module['addOnPostRun']=addOnPostRun;/**\n * @function intArrayFromString\n * @memberof LibTiMidity\n * @instance\n * @param stringy\n * @param dontAddNull\n * @param length\n */ // Tools\n// This processes a JS string into a C-line array of numbers, 0-terminated.\n// For LLVM-originating strings, see parser.js:parseLLVMString function\nfunction intArrayFromString(stringy,dontAddNull,length/* optional */){var ret=new Runtime.UTF8Processor().processJSString(stringy);if(length){ret.length=length;}if(!dontAddNull){ret.push(0);}return ret;}Module['intArrayFromString']=intArrayFromString;/**\n * @function intArrayToString\n * @memberof LibTiMidity\n * @instance\n * @param array\n */function intArrayToString(array){var ret=[];for(var i=0;i0xff){chr&=0xff;}ret.push(String.fromCharCode(chr));}return ret.join('');}Module['intArrayToString']=intArrayToString;/**\n * @function writeStringToMemory\n * @memberof LibTiMidity\n * @instance\n * @param string\n * @param buffer\n * @param dontAddNull\n */ // Write a Javascript array to somewhere in the heap\nfunction writeStringToMemory(string,buffer,dontAddNull){var array=intArrayFromString(string,dontAddNull);var i=0;while(i=0){return value;}return bits<=32?2*Math.abs(1<=half&&(bits<=32||value>half)){// for huge values, we can hit the precision limit and always get true here. so don't do that\n// but, in general there is no perfect solution here. With 64-bit ints, we get rounding and errors\n// TODO: In i64 mode 1, resign the two parts separately and safely\nvalue=-2*half+value;// Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts\n}return value;}if(!Math['imul'])Math['imul']=function(a,b){var ah=a>>>16;var al=a&0xffff;var bh=b>>>16;var bl=b&0xffff;return al*bl+(ah*bl+al*bh<<16)|0;};Math.imul=Math['imul'];var Math_abs=Math.abs;var Math_sin=Math.sin;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_pow=Math.pow;var Math_min=Math.min;// A counter of dependencies for calling run(). If we need to\n// do asynchronous work before running, increment this and\n// decrement it. Incrementing must happen in a place like\n// PRE_RUN_ADDITIONS (used by emcc to add file preloading).\n// Note that you can add dependencies in preRun, even though\n// it happens right before run - run will be postponed until\n// the dependencies are met.\nvar runDependencies=0;var runDependencyTracking={};var runDependencyWatcher=null;var dependenciesFulfilled=null;// overridden to take different actions when all run dependencies are fulfilled\nfunction addRunDependency(id){runDependencies++;if(Module['monitorRunDependencies']){Module['monitorRunDependencies'](runDependencies);}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;}else{console.warn('warning: run dependency added without ID');}}Module['addRunDependency']=addRunDependency;function removeRunDependency(id){runDependencies--;if(Module['monitorRunDependencies']){Module['monitorRunDependencies'](runDependencies);}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id];}else{console.warn('warning: run dependency removed without ID');}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null;}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback();// can add another dependenciesFulfilled\n}}}Module['removeRunDependency']=removeRunDependency;Module['preloadedImages']={};// maps url to image data\nModule['preloadedAudios']={};// maps url to audio data\nvar memoryInitializer=null;// === Body ===\nSTATIC_BASE=8;STATICTOP=STATIC_BASE+8448;/* global initializers */__ATINIT__.push({func:function func(){runPostSets();}});var _stderr;var _stderr=_stderr=allocate([0,0,0,0,0,0,0,0],'i8',ALLOC_STATIC);/* memory initializer */ // prettier-ignore\nallocate([0,0,0,0,0,0,144,63,75,191,53,65,90,136,144,63,241,46,189,130,62,21,145,63,249,198,51,115,211,166,145,63,194,109,221,10,65,61,146,63,61,194,157,150,176,216,146,63,232,234,78,195,76,121,147,63,204,6,121,169,65,31,148,63,172,119,109,217,188,202,148,63,136,88,201,103,237,123,149,63,154,143,98,250,3,51,150,63,89,8,163,213,50,240,150,63,69,192,85,234,173,179,151,63,98,112,233,227,170,125,152,63,242,189,44,55,97,78,153,63,189,253,135,49,10,38,154,63,84,184,184,8,225,4,155,63,232,64,19,235,34,235,155,63,101,213,78,16,15,217,156,63,82,228,224,202,230,206,157,63,110,60,236,153,237,204,158,63,149,18,201,59,105,211,159,63,39,122,149,224,80,113,160,63,129,244,116,208,112,253,160,63,39,24,58,230,58,142,161,63,74,29,119,226,214,35,162,63,50,84,131,216,109,190,162,63,137,39,194,57,42,94,163,63,195,57,74,225,55,3,164,63,225,208,239,31,196,173,164,63,141,222,181,200,253,93,165,63,62,15,169,61,21,20,166,63,223,103,40,125,60,208,166,63,155,23,159,47,167,146,167,63,148,66,179,181,138,91,168,63,80,170,237,54,30,43,169,63,237,57,222,176,154,1,170,63,104,158,193,6,59,223,170,63,182,54,172,17,60,196,171,63,248,203,62,177,220,176,172,63,49,168,233,220,93,165,173,63,115,200,194,181,2,162,174,63,108,16,244,152,16,167,175,63,78,71,99,153,103,90,176,63,213,5,40,73,196,229,176,63,17,38,228,158,196,117,177,63,185,204,197,35,144,10,178,63,128,43,232,177,79,164,178,63,152,204,138,127,45,67,179,63,121,115,168,42,85,231,179,63,129,193,240,196,243,144,180,63,19,232,39,224,55,64,181,63,242,205,239,154,81,245,181,63,121,42,254,173,114,176,182,63,62,55,195,121,206,113,183,63,150,183,132,20,154,57,184,63,124,53,241,88,12,8,185,63,40,116,47,245,93,221,185,63,234,58,110,122,201,185,186,63,0,190,248,108,139,157,187,63,185,15,212,84,226,136,188,63,119,41,234,206,14,124,189,63,90,67,199,158,83,119,190,63,113,89,238,192,245,122,191,63,90,243,228,62,158,67,192,63,134,4,159,190,56,206,192,63,250,182,112,109,112,93,193,63,134,74,113,157,108,241,193,63,158,146,207,239,85,138,194,63,241,160,249,95,86,40,195,63,53,128,35,79,153,203,195,63,8,41,48,144,75,116,196,63,52,246,255,115,155,34,197,63,60,249,39,214,184,214,197,63,231,172,21,42,213,144,198,63,103,161,162,136,35,81,199,63,64,220,27,190,216,23,200,63,253,197,192,88,43,229,200,63,169,160,189,183,83,185,201,63,151,163,165,26,140,148,202,63,112,252,112,177,16,119,203,63,132,25,3,173,31,97,204,63,196,198,61,80,249,82,205,63,129,205,165,1,224,76,206,63,12,239,157,93,24,79,207,63,179,157,158,164,244,44,208,63,24,248,226,2,206,182,208,63,221,27,97,34,62,69,209,63,241,38,102,30,108,216,209,63,184,223,131,95,128,112,210,63,143,212,168,166,164,13,211,63,246,6,151,24,4,176,211,63,25,72,188,73,203,87,212,63,38,135,111,74,40,5,213,63,234,109,150,179,74,184,213,63,94,196,182,179,99,113,214,63,191,49,119,28,166,48,215,63,64,16,147,112,70,246,215,63,245,39,69,242,122,194,216,63,68,70,45,178,123,149,217,63,234,200,180,158,130,111,218,63,100,86,246,147,203,80,219,63,204,33,45,108,148,57,220,63,17,61,176,16,29,42,221,63,59,163,126,139,167,34,222,63,13,204,96,25,120,35,223,63,161,97,82,158,106,22,224,63,42,244,60,232,131,159,224,63,162,211,120,142,45,45,225,63,38,84,213,117,142,191,225,63,187,17,150,206,206,86,226,63,84,154,123,31,24,243,226,63,218,31,42,81,149,148,227,63,89,83,241,185,114,59,228,63,111,165,248,41,222,231,228,63,145,67,211,247,6,154,229,63,32,70,127,13,30,82,230,63,216,160,211,245,85,16,231,63,137,133,96,234,226,212,231,63,76,8,198,225,250,159,232,63,27,245,132,158,213,113,233,63,9,232,77,190,172,74,234,63,44,220,210,201,187,42,235,63,254,136,31,69,64,18,236,63,11,11,125,192,121,1,237,63,244,122,229,233,169,248,237,63,130,61,12,159,20,248,238,63,0,0,0,0,0,0,240,63,0,0,128,63,0,0,0,0,0,0,220,67,0,0,0,0,168,25,0,0,0,0,0,0,240,31,0,0,214,33,0,0,217,35,0,0,251,37,0,0,61,40,0,0,161,42,0,0,42,45,0,0,218,47,0,0,178,50,0,0,182,53,0,0,232,56,0,0,74,60,0,0,224,63,0,0,172,67,0,0,178,71,0,0,245,75,0,0,122,80,0,0,67,85,0,0,85,90,0,0,180,95,0,0,101,101,0,0,108,107,0,0,207,113,0,0,148,120,0,0,191,127,0,0,88,135,0,0,100,143,0,0,235,151,0,0,243,160,0,0,134,170,0,0,169,180,0,0,103,191,0,0,201,202,0,0,216,214,0,0,158,227,0,0,39,241,0,0,126,255,0,0,176,14,1,0,200,30,1,0,214,47,1,0,231,65,1,0,11,85,1,0,83,105,1,0,207,126,1,0,146,149,1,0,176,173,1,0,61,199,1,0,79,226,1,0,253,254,1,0,95,29,2,0,144,61,2,0,171,95,2,0,206,131,2,0,22,170,2,0,165,210,2,0,158,253,2,0,36,43,3,0,96,91,3,0,122,142,3,0,158,196,3,0,250,253,3,0,191,58,4,0,33,123,4,0,87,191,4,0,156,7,5,0,44,84,5,0,74,165,5,0,59,251,5,0,73,86,6,0,192,182,6,0,244,28,7,0,59,137,7,0,243,251,7,0,125,117,8,0,66,246,8,0,174,126,9,0,55,15,10,0,88,168,10,0,149,74,11,0,119,246,11,0,145,172,12,0,128,109,13,0,232,57,14,0,119,18,15,0,230,247,15,0,251,234,16,0,131,236,17,0,92,253,18,0,110,30,20,0,177,80,21,0,42,149,22,0,238,236,23,0,35,89,25,0,0,219,26,0,207,115,28,0,237,36,30,0,205,239,31,0,245,213,33,0,6,217,35,0,184,250,37,0,220,60,40,0,98,161,42,0,83,42,45,0,219,217,47,0,70,178,50,0,0,182,53,0,158,231,56,0,218,73,60,0,153,223,63,0,234,171,67,0,12,178,71,0,112,245,75,0,185,121,80,0,196,66,85,0,167,84,90,0,183,179,95,0,139,100,101,0,0,108,107,0,60,207,113,0,181,147,120,0,50,191,127,0,212,87,135,0,25,100,143,0,223,234,151,0,114,243,160,0,135,133,170,0,78,169,180,0,110,103,191,0,32,161,7,0,0,0,0,0,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,240,63,113,93,245,158,236,0,240,63,84,18,150,75,217,1,240,63,207,232,226,5,198,2,240,63,21,171,220,205,178,3,240,63,102,35,132,163,159,4,240,63,10,28,218,134,140,5,240,63,88,95,223,119,121,6,240,63,177,183,148,118,102,7,240,63,131,239,250,130,83,8,240,63,70,209,18,157,64,9,240,63,127,39,221,196,45,10,240,63,191,188,90,250,26,11,240,63,160,91,140,61,8,12,240,63,204,206,114,142,245,12,240,63,245,224,14,237,226,13,240,63,218,92,97,89,208,14,240,63,71,13,107,211,189,15,240,63,17,189,44,91,171,16,240,63,28,55,167,240,152,17,240,63,85,70,219,147,134,18,240,63,181,181,201,68,116,19,240,63,66,80,115,3,98,20,240,63,14,225,216,207,79,21,240,63,53,51,251,169,61,22,240,63,224,17,219,145,43,23,240,63,68,72,121,135,25,24,240,63,159,161,214,138,7,25,240,63,63,233,243,155,245,25,240,63,122,234,209,186,227,26,240,63,180,112,113,231,209,27,240,63,93,71,211,33,192,28,240,63,238,57,248,105,174,29,240,63,239,19,225,191,156,30,240,63,242,160,142,35,139,31,240,63,148,172,1,149,121,32,240,63,129,2,59,20,104,33,240,63,109,110,59,161,86,34,240,63,26,188,3,60,69,35,240,63,85,183,148,228,51,36,240,63,247,43,239,154,34,37,240,63,228,229,19,95,17,38,240,63,14,177,3,49,0,39,240,63,112,89,191,16,239,39,240,63,19,171,71,254,221,40,240,63,10,114,157,249,204,41,240,63,117,122,193,2,188,42,240,63,128,144,180,25,171,43,240,63,97,128,119,62,154,44,240,63,92,22,11,113,137,45,240,63,191,30,112,177,120,46,240,63,230,101,167,255,103,47,240,63,54,184,177,91,87,48,240,63,34,226,143,197,70,49,240,63,39,176,66,61,54,50,240,63,209,238,202,194,37,51,240,63,180,106,41,86,21,52,240,63,113,240,94,247,4,53,240,63,183,76,108,166,244,53,240,63,63,76,82,99,228,54,240,63,204,187,17,46,212,55,240,63,49,104,171,6,196,56,240,63,73,30,32,237,179,57,240,63,254,170,112,225,163,58,240,63,67,219,157,227,147,59,240,63,24,124,168,243,131,60,240,63,138,90,145,17,116,61,240,63,177,67,89,61,100,62,240,63,176,4,1,119,84,63,240,63,182,106,137,190,68,64,240,63,0,67,243,19,53,65,240,63,212,90,63,119,37,66,240,63,133,127,110,232,21,67,240,63,114,126,129,103,6,68,240,63,7,37,121,244,246,68,240,63,185,64,86,143,231,69,240,63,12,159,25,56,216,70,240,63,141,13,196,238,200,71,240,63,216,89,86,179,185,72,240,63,146,81,209,133,170,73,240,63,109,194,53,102,155,74,240,63,40,122,132,84,140,75,240,63,140,70,190,80,125,76,240,63,110,245,227,90,110,77,240,63,177,84,246,114,95,78,240,63,66,50,246,152,80,79,240,63,26,92,228,204,65,80,240,63,63,160,193,14,51,81,240,63,194,204,142,94,36,82,240,63,192,175,76,188,21,83,240,63,98,23,252,39,7,84,240,63,220,209,157,161,248,84,240,63,112,173,50,41,234,85,240,63,107,120,187,190,219,86,240,63,37,1,57,98,205,87,240,63,2,22,172,19,191,88,240,63,116,133,21,211,176,89,240,63,247,29,118,160,162,90,240,63,18,174,206,123,148,91,240,63,91,4,32,101,134,92,240,63,113,239,106,92,120,93,240,63,1,62,176,97,106,94,240,63,194,190,240,116,92,95,240,63,122,64,45,150,78,96,240,63,247,145,102,197,64,97,240,63,22,130,157,2,51,98,240,63,191,223,210,77,37,99,240,63,229,121,7,167,23,100,240,63,137,31,60,14,10,101,240,63,181,159,113,131,252,101,240,63,130,201,168,6,239,102,240,63,20,108,226,151,225,103,240,63,154,86,31,55,212,104,240,63,79,88,96,228,198,105,240,63,124,64,166,159,185,106,240,63,115,222,241,104,172,107,240,63,149,1,68,64,159,108,240,63,77,121,157,37,146,109,240,63,18,21,255,24,133,110,240,63,104,164,105,26,120,111,240,63,222,246,221,41,107,112,240,63,16,220,92,71,94,113,240,63,165,35,231,114,81,114,240,63,81,157,125,172,68,115,240,63,211,24,33,244,55,116,240,63,246,101,210,73,43,117,240,63,147,84,146,173,30,118,240,63,140,180,97,31,18,119,240,63,209,85,65,159,5,120,240,63,93,8,50,45,249,120,240,63,57,156,52,201,236,121,240,63,118,225,73,115,224,122,240,63,54,168,114,43,212,123,240,63,163,192,175,241,199,124,240,63,246,250,1,198,187,125,240,63,113,39,106,168,175,126,240,63,101,22,233,152,163,127,240,63,44,152,127,151,151,128,240,63,48,125,46,164,139,129,240,63,226,149,246,190,127,130,240,63,197,178,216,231,115,131,240,63,98,164,213,30,104,132,240,63,82,59,238,99,92,133,240,63,58,72,35,183,80,134,240,63,200,155,117,24,69,135,240,63,185,6,230,135,57,136,240,63,214,89,117,5,46,137,240,63,242,101,36,145,34,138,240,63,237,251,243,42,23,139,240,63,180,236,228,210,11,140,240,63,63,9,248,136,0,141,240,63,147,34,46,77,245,141,240,63,192,9,136,31,234,142,240,63,226,143,6,0,223,143,240,63,35,134,170,238,211,144,240,63,184,189,116,235,200,145,240,63,224,7,102,246,189,146,240,63,233,53,127,15,179,147,240,63,44,25,193,54,168,148,240,63,13,131,44,108,157,149,240,63,0,69,194,175,146,150,240,63,127,48,131,1,136,151,240,63,22,23,112,97,125,152,240,63,89,202,137,207,114,153,240,63,234,27,209,75,104,154,240,63,119,221,70,214,93,155,240,63,185,224,235,110,83,156,240,63,119,247,192,21,73,157,240,63,131,243,198,202,62,158,240,63,187,166,254,141,52,159,240,63,9,227,104,95,42,160,240,63,99,122,6,63,32,161,240,63,205,62,216,44,22,162,240,63,85,2,223,40,12,163,240,63,21,151,27,51,2,164,240,63,53,207,142,75,248,164,240,63,233,124,57,114,238,165,240,63,110,114,28,167,228,166,240,63,17,130,56,234,218,167,240,63,40,126,142,59,209,168,240,63,25,57,31,155,199,169,240,63,83,133,235,8,190,170,240,63,81,53,244,132,180,171,240,63,156,27,58,15,171,172,240,63,200,10,190,167,161,173,240,63,118,213,128,78,152,174,240,63,82,78,131,3,143,175,240,63,22,72,198,198,133,176,240,63,134,149,74,152,124,177,240,63,116,9,17,120,115,178,240,63,188,118,26,102,106,179,240,63,73,176,103,98,97,180,240,63,15,137,249,108,88,181,240,63,18,212,208,133,79,182,240,63,95,100,238,172,70,183,240,63,17,13,83,226,61,184,240,63,78,161,255,37,53,185,240,63,72,244,244,119,44,186,240,63,63,217,51,216,35,187,240,63,125,35,189,70,27,188,240,63,91,166,145,195,18,189,240,63,59,53,178,78,10,190,240,63,142,163,31,232,1,191,240,63,206,196,218,143,249,191,240,63,133,108,228,69,241,192,240,63,71,110,61,10,233,193,240,63,180,157,230,220,224,194,240,63,122,206,224,189,216,195,240,63,80,212,44,173,208,196,240,63,253,130,203,170,200,197,240,63,83,174,189,182,192,198,240,63,46,42,4,209,184,199,240,63,121,202,159,249,176,200,240,63,42,99,145,48,169,201,240,63,67,200,217,117,161,202,240,63,212,205,121,201,153,203,240,63,247,71,114,43,146,204,240,63,212,10,196,155,138,205,240,63,158,234,111,26,131,206,240,63,148,187,118,167,123,207,240,63,3,82,217,66,116,208,240,63,68,130,152,236,108,209,240,63,186,32,181,164,101,210,240,63,214,1,48,107,94,211,240,63,22,250,9,64,87,212,240,63,2,222,67,35,80,213,240,63,50,130,222,20,73,214,240,63,69,187,218,20,66,215,240,63,236,93,57,35,59,216,240,63,223,62,251,63,52,217,240,63,230,50,33,107,45,218,240,63,213,14,172,164,38,219,240,63,137,167,156,236,31,220,240,63,240,209,243,66,25,221,240,63,0,99,178,167,18,222,240,63,191,47,217,26,12,223,240,63,61,13,105,156,5,224,240,63,150,208,98,44,255,224,240,63,245,78,199,202,248,225,240,63,141,93,151,119,242,226,240,63,162,209,211,50,236,227,240,63,129,128,125,252,229,228,240,63,133,63,149,212,223,229,240,63,21,228,27,187,217,230,240,63,163,67,18,176,211,231,240,63,176,51,121,179,205,232,240,63,198,137,81,197,199,233,240,63,127,27,156,229,193,234,240,63,126,190,89,20,188,235,240,63,116,72,139,81,182,236,240,63,31,143,49,157,176,237,240,63,72,104,77,247,170,238,240,63,197,169,223,95,165,239,240,63,119,41,233,214,159,240,240,63,79,189,106,92,154,241,240,63,69,59,101,240,148,242,240,63,0,0,0,0,0,0,240,63,99,121,217,146,143,243,240,63,192,214,199,195,154,245,241,63,21,183,49,10,254,6,243,63,139,114,141,249,162,40,244,63,94,236,240,8,129,91,245,63,205,59,127,102,158,160,246,63,176,207,104,215,16,249,247,63,60,110,61,165,254,101,249,63,173,211,90,153,159,232,250,63,41,193,78,7,62,130,252,63,67,19,16,231,55,52,254,63,0,0,0,0,0,0,0,64,99,121,217,146,143,243,0,64,192,214,199,195,154,245,1,64,21,183,49,10,254,6,3,64,139,114,141,249,162,40,4,64,94,236,240,8,129,91,5,64,205,59,127,102,158,160,6,64,176,207,104,215,16,249,7,64,61,110,61,165,254,101,9,64,173,211,90,153,159,232,10,64,41,193,78,7,62,130,12,64,68,19,16,231,55,52,14,64,0,0,0,0,0,0,16,64,99,121,217,146,143,243,16,64,191,214,199,195,154,245,17,64,21,183,49,10,254,6,19,64,139,114,141,249,162,40,20,64,93,236,240,8,129,91,21,64,205,59,127,102,158,160,22,64,177,207,104,215,16,249,23,64,60,110,61,165,254,101,25,64,173,211,90,153,159,232,26,64,42,193,78,7,62,130,28,64,67,19,16,231,55,52,30,64,0,0,0,0,0,0,32,64,99,121,217,146,143,243,32,64,191,214,199,195,154,245,33,64,21,183,49,10,254,6,35,64,139,114,141,249,162,40,36,64,93,236,240,8,129,91,37,64,205,59,127,102,158,160,38,64,177,207,104,215,16,249,39,64,60,110,61,165,254,101,41,64,173,211,90,153,159,232,42,64,42,193,78,7,62,130,44,64,67,19,16,231,55,52,46,64,0,0,0,0,0,0,48,64,98,121,217,146,143,243,48,64,193,214,199,195,154,245,49,64,21,183,49,10,254,6,51,64,138,114,141,249,162,40,52,64,95,236,240,8,129,91,53,64,205,59,127,102,158,160,54,64,175,207,104,215,16,249,55,64,62,110,61,165,254,101,57,64,173,211,90,153,159,232,58,64,40,193,78,7,62,130,60,64,69,19,16,231,55,52,62,64,0,0,0,0,0,0,64,64,98,121,217,146,143,243,64,64,193,214,199,195,154,245,65,64,21,183,49,10,254,6,67,64,138,114,141,249,162,40,68,64,95,236,240,8,129,91,69,64,205,59,127,102,158,160,70,64,175,207,104,215,16,249,71,64,62,110,61,165,254,101,73,64,173,211,90,153,159,232,74,64,40,193,78,7,62,130,76,64,69,19,16,231,55,52,78,64,0,0,0,0,0,0,80,64,98,121,217,146,143,243,80,64,193,214,199,195,154,245,81,64,21,183,49,10,254,6,83,64,138,114,141,249,162,40,84,64,95,236,240,8,129,91,85,64,205,59,127,102,158,160,86,64,175,207,104,215,16,249,87,64,62,110,61,165,254,101,89,64,173,211,90,153,159,232,90,64,40,193,78,7,62,130,92,64,69,19,16,231,55,52,94,64,0,0,0,0,0,0,96,64,98,121,217,146,143,243,96,64,193,214,199,195,154,245,97,64,21,183,49,10,254,6,99,64,138,114,141,249,162,40,100,64,95,236,240,8,129,91,101,64,205,59,127,102,158,160,102,64,175,207,104,215,16,249,103,64,62,110,61,165,254,101,105,64,173,211,90,153,159,232,106,64,40,193,78,7,62,130,108,64,69,19,16,231,55,52,110,64,0,0,0,0,0,0,112,64,101,121,217,146,143,243,112,64,190,214,199,195,154,245,113,64,21,183,49,10,254,6,115,64,141,114,141,249,162,40,116,64,92,236,240,8,129,91,117,64,205,59,127,102,158,160,118,64,179,207,104,215,16,249,119,64,58,110,61,165,254,101,121,64,173,211,90,153,159,232,122,64,45,193,78,7,62,130,124,64,64,19,16,231,55,52,126,64,0,0,0,0,0,0,128,64,101,121,217,146,143,243,128,64,190,214,199,195,154,245,129,64,21,183,49,10,254,6,131,64,141,114,141,249,162,40,132,64,92,236,240,8,129,91,133,64,205,59,127,102,158,160,134,64,179,207,104,215,16,249,135,64,58,110,61,165,254,101,137,64,173,211,90,153,159,232,138,64,45,193,78,7,62,130,140,64,64,19,16,231,55,52,142,64,0,0,0,0,0,0,144,64,101,121,217,146,143,243,144,64,190,214,199,195,154,245,145,64,21,183,49,10,254,6,147,64,141,114,141,249,162,40,148,64,92,236,240,8,129,91,149,64,205,59,127,102,158,160,150,64,179,207,104,215,16,249,151,64,77,84,104,100,0,0,0,0,86,101,108,111,99,105,116,121,32,37,100,32,37,100,10,0,70,84,80,112,114,111,120,121,0,0,0,0,0,0,0,0,72,84,84,80,112,114,111,120,121,0,0,0,0,0,0,0,99,111,109,109,0,0,0,0,35,101,120,116,101,110,115,105,111,110,0,0,0,0,0,0,78,117,109,32,77,105,115,115,105,110,103,32,112,97,116,99,104,101,115,58,32,37,100,10,0,0,0,0,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,115,116,114,105,112,32,109,117,115,116,32,98,101,32,101,110,118,44,32,108,111,111,112,44,32,111,114,32,116,97,105,108,10,0,0,116,97,105,108,0,0,0,0,115,116,114,105,112,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,107,101,101,112,32,109,117,115,116,32,98,101,32,101,110,118,32,111,114,32,108,111,111,112,10,0,0,108,111,111,112,0,0,0,0,101,110,118,0,0,0,0,0,107,101,101,112,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,112,97,110,110,105,110,103,32,109,117,115,116,32,98,101,32,108,101,102,116,44,32,114,105,103,104,116,44,32,99,101,110,116,101,114,44,32,111,114,32,98,101,116,119,101,101,110,32,45,49,48,48,32,97,110,100,32,49,48,48,10,0,0,0,0,0,0,32,9,160,0,0,0,0,0,114,105,103,104,116,0,0,0,108,101,102,116,0,0,0,0,77,105,115,115,105,110,103,32,112,97,116,99,104,58,32,37,115,10,0,0,0,0,0,0,99,101,110,116,101,114,0,0,112,97,110,0,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,110,111,116,101,32,109,117,115,116,32,98,101,32,98,101,116,119,101,101,110,32,48,32,97,110,100,32,49,50,55,10,0,0,0,0,110,111,116,101,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,97,109,112,108,105,102,105,99,97,116,105,111,110,32,109,117,115,116,32,98,101,32,98,101,116,119,101,101,110,32,48,32,97,110,100,32,37,100,10,0,0,0,0,97,109,112,0,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,98,97,100,32,112,97,116,99,104,32,111,112,116,105,111,110,32,37,115,10,0,0,0,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,77,117,115,116,32,115,112,101,99,105,102,121,32,116,111,110,101,32,98,97,110,107,32,111,114,32,100,114,117,109,32,115,101,116,32,98,101,102,111,114,101,32,97,115,115,105,103,110,109,101,110,116,10,0,0,0,0,0,0,67,111,110,102,105,103,117,114,97,116,105,111,110,32,102,105,108,101,32,37,115,32,110,111,116,32,102,111,117,110,100,10,0,0,0,0,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,80,114,111,103,114,97,109,32,109,117,115,116,32,98,101,32,98,101,116,119,101,101,110,32,48,32,97,110,100,32,49,50,55,10,0,37,115,58,32,108,105,110,101,32,37,100,58,32,115,121,110,116,97,120,32,101,114,114,111,114,10,0,0,0,0,0,0,63,63,63,63,63,63,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,84,111,110,101,32,98,97,110,107,32,109,117,115,116,32,98,101,32,98,101,116,119,101,101,110,32,48,32,97,110,100,32,49,50,55,10,0,0,0,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,78,111,32,98,97,110,107,32,110,117,109,98,101,114,32,103,105,118,101,110,10,0,0,0,0,0,0,98,97,110,107,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,68,114,117,109,32,115,101,116,32,109,117,115,116,32,98,101,32,98,101,116,119,101,101,110,32,48,32,97,110,100,32,49,50,55,10,0,0,0,0,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,78,111,32,100,114,117,109,32,115,101,116,32,110,117,109,98,101,114,32,103,105,118,101,110,10,0,0,100,114,117,109,115,101,116,0,37,115,58,32,108,105,110,101,32,37,100,58,32,77,117,115,116,32,115,112,101,99,105,102,121,32,101,120,97,99,116,108,121,32,111,110,101,32,112,97,116,99,104,32,110,97,109,101,10,0,0,0,0,0,0,0,100,101,102,97,117,108,116,0,80,114,111,98,97,98,108,101,32,115,111,117,114,99,101,32,108,111,111,112,32,105,110,32,99,111,110,102,105,103,117,114,97,116,105,111,110,32,102,105,108,101,115,10,0,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,78,111,32,102,105,108,101,32,110,97,109,101,32,103,105,118,101,110,10,0,0,0,0,0,0,0,0,115,111,117,114,99,101,0,0,71,70,49,80,65,84,67,72,49,48,48,0,73,68,35,48,48,48,48,48,50,0,0,0,37,115,58,32,108,105,110,101,32,37,100,58,32,78,111,32,100,105,114,101,99,116,111,114,121,32,103,105,118,101,110,10,0,0,0,0,0,0,0,0,100,105,114,0,0,0,0,0,70,73,88,77,69,58,32,73,109,112,108,101,109,101,110,116,32,34,109,97,112,34,32,105,110,32,84,105,77,105,100,105,116,121,32,99,111,110,102,105,103,46,10,0,0,0,0,0,109,97,112,0,0,0,0,0,70,73,88,77,69,58,32,73,109,112,108,101,109,101,110,116,32,34,112,114,111,103,98,97,115,101,34,32,105,110,32,84,105,77,105,100,105,116,121,32,99,111,110,102,105,103,46,10,0,0,0,0,0,0,0,0,112,114,111,103,98,97,115,101,0,0,0,0,0,0,0,0,70,73,88,77,69,58,32,73,109,112,108,109,101,109,101,110,116,32,34,37,115,34,32,105,110,32,84,105,77,105,100,105,116,121,32,99,111,110,102,105,103,46,10,0,0,0,0,0,102,111,110,116,0,0,0,0,85,110,115,117,112,112,111,114,116,101,100,32,97,117,100,105,111,32,102,111,114,109,97,116,10,0,0,0,0,0,0,0,115,111,117,110,100,102,111,110,116,0,0,0,0,0,0,0,70,73,88,77,69,58,32,73,109,112,108,101,109,101,110,116,32,34,97,108,116,97,115,115,105,103,110,34,32,105,110,32,84,105,77,105,100,105,116,121,32,99,111,110,102,105,103,46,10,0,0,0,0,0,0,0,71,70,49,80,65,84,67,72,49,49,48,0,73,68,35,48,48,48,48,48,50,0,0,0,77,84,114,107,0,0,0,0,97,108,116,97,115,115,105,103,110,0,0,0,0,0,0,0,70,73,88,77,69,58,32,73,109,112,108,101,109,101,110,116,32,34,117,110,100,101,102,34,32,105,110,32,84,105,77,105,100,105,116,121,32,99,111,110,102,105,103,46,10,0,0,0,117,110,100,101,102,0,0,0,70,73,88,77,69,58,32,73,109,112,108,101,109,101,110,116,32,34,37,115,34,32,105,110,32,84,105,77,105,100,105,116,121,32,99,111,110,102,105,103,46,10,0,0,0,0,0,0,99,111,112,121,98,97,110,107,0,0,0,0,0,0,0,0,99,111,112,121,100,114,117,109,115,101,116,0,0,0,0,0,70,73,88,77,69,58,32,73,109,112,108,101,109,101,110,116,32,34,116,105,109,101,111,117,116,34,32,105,110,32,84,105,77,105,100,105,116,121,32,99,111,110,102,105,103,46,10,0,97,100,100,32,116,111,32,112,97,116,104,108,105,115,116,58,32,37,115,10,0,0,0,0,116,105,109,101,111,117,116,0,46,0,0,0,0,0,0,0,116,105,109,105,100,105,116,121,46,99,102,103,0,0,0,0,111,112,116,0,0,0,0,0,114,98,0,0,0,0,0,0,109,97,105,108,97,100,100,114,0,0,0,0,0,0,0,0,46,112,97,116,0,0,0,0,114,98,0,0,0,0,0,0],\"i8\",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=Runtime.alignMemory(allocate(12,'i8',ALLOC_STATIC),8);assert(tempDoublePtr%8==0);var ___errno_state=0;function ___setErrNo(value){// For convenient setting and returning of errno.\nHEAP32[___errno_state>>2]=value;return value;}var PATH={splitPath:function splitPath(filename){var splitPathRe=/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;return splitPathRe.exec(filename).slice(1);},normalizeArray:function normalizeArray(parts,allowAboveRoot){// if the path tries to go above the root, `up` ends up > 0\nvar up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}// if the path is allowed to go above the root, restore leading ..s\nif(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;},normalize:function normalize(path){var isAbsolute=path.charAt(0)==='/',trailingSlash=path.substr(-1)==='/';// Normalize the path\npath=PATH.normalizeArray(path.split('/').filter(function(p){return!!p;}),!isAbsolute).join('/');if(!path&&!isAbsolute){path='.';}if(path&&trailingSlash){path+='/';}return(isAbsolute?'/':'')+path;},dirname:function dirname(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){// No dirname whatsoever\nreturn'.';}if(dir){// It has a dirname, strip trailing slash\ndir=dir.substr(0,dir.length-1);}return root+dir;},basename:function basename(path,ext){// EMSCRIPTEN return '/'' for '/', not an empty string\nif(path==='/')return'/';var f=PATH.splitPath(path)[2];if(ext&&f.substr(-1*ext.length)===ext){f=f.substr(0,f.length-ext.length);}return f;},extname:function extname(path){return PATH.splitPath(path)[3];},join:function join(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.filter(function(p,index){if(typeof p!=='string'){throw new TypeError('Arguments to path.join must be strings');}return p;}).join('/'));},resolve:function resolve(){var resolvedPath='',resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();// Skip empty and invalid entries\nif(typeof path!=='string'){throw new TypeError('Arguments to path.resolve must be strings');}else if(!path){continue;}resolvedPath=path+'/'+resolvedPath;resolvedAbsolute=path.charAt(0)==='/';}// At this point the path should be resolved to a full absolute path, but\n// handle relative paths to be safe (might happen when process.cwd() fails)\nresolvedPath=PATH.normalizeArray(resolvedPath.split('/').filter(function(p){return!!p;}),!resolvedAbsolute).join('/');return(resolvedAbsolute?'/':'')+resolvedPath||'.';},relative:function relative(from,to){from=PATH.resolve(from).substr(1);to=PATH.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=='')break;}if(start>end)return[];return arr.slice(start,end-start+1);}var fromParts=trim(from.split('/'));var toParts=trim(to.split('/'));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;icontents.length){contents.push(0);}}},lookup:function lookup(parent,name){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENOENT);},mknod:function mknod(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev);},rename:function rename(old_node,new_dir,new_name){// if we're overwriting a directory at new_name, make sure it's empty.\nif(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name);}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENOTEMPTY);}}}// do the internal rewiring\ndelete old_node.parent.contents[old_node.name];old_node.name=new_name;new_dir.contents[new_name]=old_node;},unlink:function unlink(parent,name){delete parent.contents[name];},rmdir:function rmdir(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENOTEMPTY);}delete parent.contents[name];},readdir:function readdir(node){var entries=['.','..'];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue;}entries.push(key);}return entries;},symlink:function symlink(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node;},readlink:function readlink(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}return node.link;}},stream_ops:{read:function read(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(size>8&&contents.subarray){// non-trivial, and typed array\nbuffer.set(contents.subarray(position,position+size),offset);}else{for(var i=0;icontents.length){contents.push(0);}},mmap:function mmap(stream,buffer,offset,length,position,prot,flags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENODEV);}var ptr;var allocated;var contents=stream.node.contents;// Only make a new copy when MAP_PRIVATE is specified.\nif(!(flags&2)&&(contents.buffer===buffer||contents.buffer===buffer.buffer)){// We can't emulate MAP_SHARED when the file is not backed by the buffer\n// we're mapping to (e.g. the HEAP buffer).\nallocated=false;ptr=contents.byteOffset;}else{// Try to avoid unnecessary slices.\nif(position>0||position+lengthe2.timestamp){create[key]=e;total++;}}var remove={};for(var key in dst.files){if(!dst.files.hasOwnProperty(key))continue;var e=dst.files[key];var e2=src.files[key];if(!e2){remove[key]=e;total++;}}if(!total){// early out\nreturn callback(null);}var completed=0;var done=function done(err){if(err)return callback(err);if(++completed>=total){return callback(null);}};// create a single transaction to handle and IDB reads / writes we'll need to do\nvar db=src.type==='remote'?src.db:dst.db;var transaction=db.transaction([IDBFS.DB_STORE_NAME],'readwrite');transaction.onerror=function(){callback(this.error);};var store=transaction.objectStore(IDBFS.DB_STORE_NAME);for(var path in create){if(!create.hasOwnProperty(path))continue;var entry=create[path];if(dst.type==='local'){// save file to local\ntry{if(FS.isDir(entry.mode)){FS.mkdir(path,entry.mode);}else if(FS.isFile(entry.mode)){var stream=FS.open(path,'w+',438);FS.write(stream,entry.contents,0,entry.contents.length,0,true/* canOwn */);FS.close(stream);}done(null);}catch(e){return done(e);}}else{// save file to IDB\nvar req=store.put(entry,path);req.onsuccess=function(){done(null);};req.onerror=function(){done(this.error);};}}for(var path in remove){if(!remove.hasOwnProperty(path))continue;var entry=remove[path];if(dst.type==='local'){// delete file from local\ntry{if(FS.isDir(entry.mode)){// TODO recursive delete?\nFS.rmdir(path);}else if(FS.isFile(entry.mode)){FS.unlink(path);}done(null);}catch(e){return done(e);}}else{// delete file from IDB\nvar req=store[\"delete\"](path);req.onsuccess=function(){done(null);};req.onerror=function(){done(this.error);};}}},getLocalSet:function getLocalSet(mount,callback){var files={};var isRealDir=function isRealDir(p){return p!=='.'&&p!=='..';};var toAbsolute=function toAbsolute(root){return function(p){return PATH.join(root,p);};};var check=FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));while(check.length){var path=check.pop();var stat,node;try{var lookup=FS.lookupPath(path);node=lookup.node;stat=FS.stat(path);}catch(e){return callback(e);}if(FS.isDir(stat.mode)){check.push.apply(check,FS.readdir(path).filter(isRealDir).map(toAbsolute(path)));files[path]={mode:stat.mode,timestamp:stat.mtime};}else if(FS.isFile(stat.mode)){files[path]={contents:node.contents,mode:stat.mode,timestamp:stat.mtime};}else{return callback(new Error('node type not supported'));}}return callback(null,{type:'local',files:files});},getDB:function getDB(name,callback){// look it up in the cache\nvar db=IDBFS.dbs[name];if(db){return callback(null,db);}var req;try{req=IDBFS.indexedDB().open(name,IDBFS.DB_VERSION);}catch(e){return onerror(e);}req.onupgradeneeded=function(){db=req.result;db.createObjectStore(IDBFS.DB_STORE_NAME);};req.onsuccess=function(){db=req.result;// add to the cache\nIDBFS.dbs[name]=db;callback(null,db);};req.onerror=function(){callback(this.error);};},getRemoteSet:function getRemoteSet(mount,callback){var files={};IDBFS.getDB(mount.mountpoint,function(err,db){if(err)return callback(err);var transaction=db.transaction([IDBFS.DB_STORE_NAME],'readonly');transaction.onerror=function(){callback(this.error);};var store=transaction.objectStore(IDBFS.DB_STORE_NAME);store.openCursor().onsuccess=function(event){var cursor=event.target.result;if(!cursor){return callback(null,{type:'remote',db:db,files:files});}files[cursor.key]=cursor.value;cursor[\"continue\"]();};});}};var NODEFS={mount:function mount(){},createNode:function createNode(parent,name,mode,dev){if(!FS.isDir(mode)&&!FS.isFile(mode)&&!FS.isLink(mode)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}var node=FS.createNode(parent,name,mode);node.node_ops=NODEFS.node_ops;node.stream_ops=NODEFS.stream_ops;return node;},getMode:function getMode(path){var stat;try{stat=fs.lstatSync(path);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}return stat.mode;},realPath:function realPath(node){var parts=[];while(node.parent!==node){parts.push(node.name);node=node.parent;}parts.push(node.mount.opts.root);parts.reverse();return PATH.join.apply(null,parts);},node_ops:{getattr:function getattr(node){var path=NODEFS.realPath(node);var stat;try{stat=fs.lstatSync(path);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}return{dev:stat.dev,ino:stat.ino,mode:stat.mode,nlink:stat.nlink,uid:stat.uid,gid:stat.gid,rdev:stat.rdev,size:stat.size,atime:stat.atime,mtime:stat.mtime,ctime:stat.ctime,blksize:stat.blksize,blocks:stat.blocks};},setattr:function setattr(node,attr){var path=NODEFS.realPath(node);try{if(attr.mode!==undefined){fs.chmodSync(path,attr.mode);// update the common node structure mode as well\nnode.mode=attr.mode;}if(attr.timestamp!==undefined){var date=new Date(attr.timestamp);fs.utimesSync(path,date,date);}if(attr.size!==undefined){fs.truncateSync(path,attr.size);}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}},lookup:function lookup(parent,name){var path=PATH.join(NODEFS.realPath(parent),name);var mode=NODEFS.getMode(path);return NODEFS.createNode(parent,name,mode);},mknod:function mknod(parent,name,mode,dev){var node=NODEFS.createNode(parent,name,mode,dev);// create the backing node for this in the fs root as well\nvar path=NODEFS.realPath(node);try{if(FS.isDir(node.mode)){fs.mkdirSync(path,node.mode);}else{fs.writeFileSync(path,'',{mode:node.mode});}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}return node;},rename:function rename(oldNode,newDir,newName){var oldPath=NODEFS.realPath(oldNode);var newPath=PATH.join(NODEFS.realPath(newDir),newName);try{fs.renameSync(oldPath,newPath);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}},unlink:function unlink(parent,name){var path=PATH.join(NODEFS.realPath(parent),name);try{fs.unlinkSync(path);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}},rmdir:function rmdir(parent,name){var path=PATH.join(NODEFS.realPath(parent),name);try{fs.rmdirSync(path);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}},readdir:function readdir(node){var path=NODEFS.realPath(node);try{return fs.readdirSync(path);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}},symlink:function symlink(parent,newName,oldPath){var newPath=PATH.join(NODEFS.realPath(parent),newName);try{fs.symlinkSync(oldPath,newPath);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}},readlink:function readlink(node){var path=NODEFS.realPath(node);try{return fs.readlinkSync(path);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}}},stream_ops:{open:function open(stream){var path=NODEFS.realPath(stream.node);try{if(FS.isFile(stream.node.mode)){stream.nfd=fs.openSync(path,stream.flags);}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}},close:function close(stream){try{if(FS.isFile(stream.node.mode)){fs.closeSync(stream.nfd);}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}},read:function read(stream,buffer,offset,length,position){// FIXME this is terrible.\nvar nbuffer=new Buffer(length);var res;try{res=fs.readSync(stream.nfd,nbuffer,0,length,position);}catch(e){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"][e.code]);}if(res>0){for(var i=0;i8){// max recursive lookup of 8\nthrow new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ELOOP);}// split the path\nvar parts=PATH.normalizeArray(path.split('/').filter(function(p){return!!p;}),false);// start at the root\nvar current=FS.root;var current_path='/';for(var i=0;i40){// limit max consecutive symlinks to 40 (SYMLOOP_MAX).\nthrow new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ELOOP);}}}}return{path:current_path,node:current};},getPath:function getPath(node){var path;while(true){if(FS.isRoot(node)){return path?PATH.join(node.mount.mountpoint,path):node.mount.mountpoint;}path=path?PATH.join(node.name,path):node.name;node=node.parent;}},hashName:function hashName(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length;},hashAddNode:function hashAddNode(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node;},hashRemoveNode:function hashRemoveNode(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next;}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break;}current=current.name_next;}}},lookupNode:function lookupNode(parent,name){var err=FS.mayLookup(parent);if(err){throw new FS.ErrnoError(err,name);}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node;}}// if we failed to find it in the cache, call into the VFS\nreturn FS.lookup(parent,name);},createNode:function createNode(parent,name,mode,rdev){var node={id:FS.nextInode++,name:name,mode:mode,node_ops:{},stream_ops:{},rdev:rdev,parent:null,mount:null};if(!parent){parent=node;// root node sets parent to itself\n}node.parent=parent;node.mount=parent.mount;// compatibility\nvar readMode=292|73;var writeMode=146;// NOTE we must use Object.defineProperties instead of individual calls to\n// Object.defineProperty in order to make closure compiler happy\nObject.defineProperties(node,{read:{get:function get(){return(node.mode&readMode)===readMode;},set:function set(val){val?node.mode|=readMode:node.mode&=~readMode;}},write:{get:function get(){return(node.mode&writeMode)===writeMode;},set:function set(val){val?node.mode|=writeMode:node.mode&=~writeMode;}},isFolder:{get:function get(){return FS.isDir(node.mode);}},isDevice:{get:function get(){return FS.isChrdev(node.mode);}}});FS.hashAddNode(node);return node;},destroyNode:function destroyNode(node){FS.hashRemoveNode(node);},isRoot:function isRoot(node){return node===node.parent;},isMountpoint:function isMountpoint(node){return node.mounted;},isFile:function isFile(mode){return(mode&61440)===32768;},isDir:function isDir(mode){return(mode&61440)===16384;},isLink:function isLink(mode){return(mode&61440)===40960;},isChrdev:function isChrdev(mode){return(mode&61440)===8192;},isBlkdev:function isBlkdev(mode){return(mode&61440)===24576;},isFIFO:function isFIFO(mode){return(mode&61440)===4096;},isSocket:function isSocket(mode){return(mode&49152)===49152;},flagModes:{r:0,rs:1052672,'r+':2,w:577,wx:705,xw:705,'w+':578,'wx+':706,'xw+':706,a:1089,ax:1217,xa:1217,'a+':1090,'ax+':1218,'xa+':1218},modeStringToFlags:function modeStringToFlags(str){var flags=FS.flagModes[str];if(typeof flags==='undefined'){throw new Error('Unknown file open mode: '+str);}return flags;},flagsToPermissionString:function flagsToPermissionString(flag){var accmode=flag&2097155;var perms=['r','w','rw'][accmode];if(flag&512){perms+='w';}return perms;},nodePermissions:function nodePermissions(node,perms){if(FS.ignorePermissions){return 0;}// return 0 if any user, group or owner bits are set.\nif(perms.indexOf('r')!==-1&&!(node.mode&292)){return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EACCES;}else if(perms.indexOf('w')!==-1&&!(node.mode&146)){return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EACCES;}else if(perms.indexOf('x')!==-1&&!(node.mode&73)){return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EACCES;}return 0;},mayLookup:function mayLookup(dir){return FS.nodePermissions(dir,'x');},mayCreate:function mayCreate(dir,name){try{FS.lookupNode(dir,name);return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EEXIST;}catch(e){}return FS.nodePermissions(dir,'wx');},mayDelete:function mayDelete(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name);}catch(e){return e.errno;}var err=FS.nodePermissions(dir,'wx');if(err){return err;}if(isdir){if(!FS.isDir(node.mode)){return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENOTDIR;}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBUSY;}}else{if(FS.isDir(node.mode)){return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EISDIR;}}return 0;},mayOpen:function mayOpen(node,flags){if(!node){return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENOENT;}if(FS.isLink(node.mode)){return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ELOOP;}else if(FS.isDir(node.mode)){if((flags&2097155)!==0||// opening for write\nflags&512){return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EISDIR;}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags));},MAX_OPEN_FDS:4096,nextfd:function nextfd(fd_start,fd_end){fd_start=fd_start||1;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd;}}throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EMFILE);},getStream:function getStream(fd){return FS.streams[fd];},createStream:function createStream(stream,fd_start,fd_end){var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;// compatibility\nObject.defineProperties(stream,{object:{get:function get(){return stream.node;},set:function set(val){stream.node=val;}},isRead:{get:function get(){return(stream.flags&2097155)!==1;}},isWrite:{get:function get(){return(stream.flags&2097155)!==0;}},isAppend:{get:function get(){return stream.flags&1024;}}});FS.streams[fd]=stream;return stream;},closeStream:function closeStream(fd){FS.streams[fd]=null;},chrdev_stream_ops:{open:function open(stream){var device=FS.getDevice(stream.node.rdev);// override node's stream ops with the device's\nstream.stream_ops=device.stream_ops;// forward the open call\nif(stream.stream_ops.open){stream.stream_ops.open(stream);}},llseek:function llseek(){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ESPIPE);}},major:function major(dev){return dev>>8;},minor:function minor(dev){return dev&0xff;},makedev:function makedev(ma,mi){return ma<<8|mi;},registerDevice:function registerDevice(dev,ops){FS.devices[dev]={stream_ops:ops};},getDevice:function getDevice(dev){return FS.devices[dev];},syncfs:function syncfs(populate,callback){if(typeof populate==='function'){callback=populate;populate=false;}var completed=0;var total=FS.mounts.length;var done=function done(err){if(err){return callback(err);}if(++completed>=total){callback(null);}};// sync all mounts\nfor(var i=0;i3&&arguments[3]!==undefined?arguments[3]:true;var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var error=FS.mayCreate(parent,name);if(error){if(throwError){throw new FS.ErrnoError(error,path);}return;}if(!parent.node_ops.mknod){if(throwError){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM,path);}return;}return parent.node_ops.mknod(parent,name,mode,dev);},create:function create(path,mode){var throwError=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0,throwError);},mkdir:function mkdir(path,mode){var throwError=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0,throwError);},mkdev:function mkdev(path,mode,dev){if(typeof dev==='undefined'){dev=mode;mode=438;}mode|=8192;return FS.mknod(path,mode,dev);},symlink:function symlink(oldpath,newpath){var lookup=FS.lookupPath(newpath,{parent:true});var parent=lookup.node;var newname=PATH.basename(newpath);var err=FS.mayCreate(parent,newname);if(err){throw new FS.ErrnoError(err);}if(!parent.node_ops.symlink){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM);}return parent.node_ops.symlink(parent,newname,oldpath);},rename:function rename(old_path,new_path){var old_dirname=PATH.dirname(old_path);var new_dirname=PATH.dirname(new_path);var old_name=PATH.basename(old_path);var new_name=PATH.basename(new_path);// parents must exist\nvar lookup,old_dir,new_dir;try{lookup=FS.lookupPath(old_path,{parent:true});old_dir=lookup.node;lookup=FS.lookupPath(new_path,{parent:true});new_dir=lookup.node;}catch(e){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBUSY);}// need to be part of the same mount\nif(old_dir.mount!==new_dir.mount){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EXDEV);}// source must exist\nvar old_node=FS.lookupNode(old_dir,old_name);// old path should not be an ancestor of the new path\nvar relative=PATH.relative(old_path,new_dirname);if(relative.charAt(0)!=='.'){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}// new path should not be an ancestor of the old path\nrelative=PATH.relative(new_path,old_dirname);if(relative.charAt(0)!=='.'){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENOTEMPTY);}// see if the new path already exists\nvar new_node;try{new_node=FS.lookupNode(new_dir,new_name);}catch(e){}// not fatal\n// early out if nothing needs to change\nif(old_node===new_node){return;}// we'll need to delete the old entry\nvar isdir=FS.isDir(old_node.mode);var err=FS.mayDelete(old_dir,old_name,isdir);if(err){throw new FS.ErrnoError(err);}// need delete permissions if we'll be overwriting.\n// need create permissions if new doesn't already exist.\nerr=new_node?FS.mayDelete(new_dir,new_name,isdir):FS.mayCreate(new_dir,new_name);if(err){throw new FS.ErrnoError(err);}if(!old_dir.node_ops.rename){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM);}if(FS.isMountpoint(old_node)||new_node&&FS.isMountpoint(new_node)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBUSY);}// if we are going to change the parent, check write permissions\nif(new_dir!==old_dir){err=FS.nodePermissions(old_dir,'w');if(err){throw new FS.ErrnoError(err);}}// remove the node from the lookup hash\nFS.hashRemoveNode(old_node);// do the underlying fs rename\ntry{old_dir.node_ops.rename(old_node,new_dir,new_name);}catch(e){throw e;}finally{// add the node back to the hash (in case node_ops.rename\n// changed its name)\nFS.hashAddNode(old_node);}},rmdir:function rmdir(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var err=FS.mayDelete(parent,name,true);if(err){throw new FS.ErrnoError(err);}if(!parent.node_ops.rmdir){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM);}if(FS.isMountpoint(node)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBUSY);}parent.node_ops.rmdir(parent,name);FS.destroyNode(node);},readdir:function readdir(path){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node.node_ops.readdir){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENOTDIR);}return node.node_ops.readdir(node);},unlink:function unlink(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var err=FS.mayDelete(parent,name,false);if(err){// POSIX says unlink should set EPERM, not EISDIR\nif(err===_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EISDIR)err=_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM;throw new FS.ErrnoError(err);}if(!parent.node_ops.unlink){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM);}if(FS.isMountpoint(node)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBUSY);}parent.node_ops.unlink(parent,name);FS.destroyNode(node);},readlink:function readlink(path){var lookup=FS.lookupPath(path,{follow:false});var link=lookup.node;if(!link.node_ops.readlink){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}return link.node_ops.readlink(link);},stat:function stat(path,dontFollow){var lookup=FS.lookupPath(path,{follow:!dontFollow});var node=lookup.node;if(!node.node_ops.getattr){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM);}return node.node_ops.getattr(node);},lstat:function lstat(path){return FS.stat(path,true);},chmod:function chmod(path,mode,dontFollow){var node;if(typeof path==='string'){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node;}else{node=path;}if(!node.node_ops.setattr){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM);}node.node_ops.setattr(node,{mode:mode&4095|node.mode&~4095,timestamp:Date.now()});},lchmod:function lchmod(path,mode){FS.chmod(path,mode,true);},fchmod:function fchmod(fd,mode){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBADF);}FS.chmod(stream.node,mode);},chown:function chown(path,uid,gid,dontFollow){var node;if(typeof path==='string'){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node;}else{node=path;}if(!node.node_ops.setattr){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM);}node.node_ops.setattr(node,{timestamp:Date.now()// we ignore the uid / gid for now\n});},lchown:function lchown(path,uid,gid){FS.chown(path,uid,gid,true);},fchown:function fchown(fd,uid,gid){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBADF);}FS.chown(stream.node,uid,gid);},truncate:function truncate(path,len){if(len<0){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}var node;if(typeof path==='string'){var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;}else{node=path;}if(!node.node_ops.setattr){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EPERM);}if(FS.isDir(node.mode)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EISDIR);}if(!FS.isFile(node.mode)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}var err=FS.nodePermissions(node,'w');if(err){throw new FS.ErrnoError(err);}node.node_ops.setattr(node,{size:len,timestamp:Date.now()});},ftruncate:function ftruncate(fd,len){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBADF);}if((stream.flags&2097155)===0){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}FS.truncate(stream.node,len);},utime:function utime(path,atime,mtime){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;node.node_ops.setattr(node,{timestamp:Math.max(atime,mtime)});},open:function open(path,flags,mode,fd_start,fd_end){path=PATH.normalize(path);flags=typeof flags==='string'?FS.modeStringToFlags(flags):flags;mode=typeof mode==='undefined'?438:mode;if(flags&64){mode=mode&4095|32768;}else{mode=0;}var node;try{var lookup=FS.lookupPath(path,{follow:!(flags&131072)});node=lookup.node;}catch(e){}// ignore\n// perhaps we need to create the node\nif(flags&64){if(node){// if O_CREAT and O_EXCL are set, error out if the node already exists\nif(flags&128){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EEXIST);}}else{// node doesn't exist, try to create it\nnode=FS.mknod(path,mode,0);}}if(!node){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENOENT);}// can't truncate a device\nif(FS.isChrdev(node.mode)){flags&=~512;}// check permissions\nvar err=FS.mayOpen(node,flags);if(err){throw new FS.ErrnoError(err);}// do truncation if necessary\nif(flags&512){FS.truncate(node,0);}// we've already handled these, don't pass down to the underlying vfs\nflags&=~(128|512);// register the stream with the filesystem\nvar stream=FS.createStream({node:node,path:FS.getPath(node),// we want the absolute path to the node\nflags:flags,seekable:true,position:0,stream_ops:node.stream_ops,// used by the file family libc calls (fopen, fwrite, ferror, etc.)\nungotten:[],error:false},fd_start,fd_end);// call the new stream's open function\nif(stream.stream_ops.open){stream.stream_ops.open(stream);}if(Module['logReadFiles']&&!(flags&1)){if(!FS.readFiles)FS.readFiles={};if(!(path in FS.readFiles)){FS.readFiles[path]=1;console.warn('read file: '+path);}}return stream;},close:function close(stream){try{if(stream.stream_ops.close){stream.stream_ops.close(stream);}}catch(e){throw e;}finally{FS.closeStream(stream.fd);}},llseek:function llseek(stream,offset,whence){if(!stream.seekable||!stream.stream_ops.llseek){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ESPIPE);}return stream.stream_ops.llseek(stream,offset,whence);},read:function read(stream,buffer,offset,length,position){if(length<0||position<0){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}if((stream.flags&2097155)===1){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBADF);}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EISDIR);}if(!stream.stream_ops.read){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}var seeking=true;if(typeof position==='undefined'){position=stream.position;seeking=false;}else if(!stream.seekable){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ESPIPE);}var bytesRead=stream.stream_ops.read(stream,buffer,offset,length,position);if(!seeking)stream.position+=bytesRead;return bytesRead;},write:function write(stream,buffer,offset,length,position,canOwn){if(length<0||position<0){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}if((stream.flags&2097155)===0){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBADF);}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EISDIR);}if(!stream.stream_ops.write){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}var seeking=true;if(typeof position==='undefined'){position=stream.position;seeking=false;}else if(!stream.seekable){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ESPIPE);}if(stream.flags&1024){// seek to the end before writing in append mode\nFS.llseek(stream,0,2);}var bytesWritten=stream.stream_ops.write(stream,buffer,offset,length,position,canOwn);if(!seeking)stream.position+=bytesWritten;return bytesWritten;},allocate:function allocate(stream,offset,length){if(offset<0||length<=0){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);}if((stream.flags&2097155)===0){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EBADF);}if(!FS.isFile(stream.node.mode)&&!FS.isDir(node.mode)){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENODEV);}if(!stream.stream_ops.allocate){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EOPNOTSUPP);}stream.stream_ops.allocate(stream,offset,length);},mmap:function mmap(stream,buffer,offset,length,position,prot,flags){// TODO if PROT is PROT_WRITE, make sure we have write access\nif((stream.flags&2097155)===1){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EACCES);}if(!stream.stream_ops.mmap){throw new FS.errnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENODEV);}return stream.stream_ops.mmap(stream,buffer,offset,length,position,prot,flags);},ioctl:function ioctl(stream,cmd,arg){if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ENOTTY);}return stream.stream_ops.ioctl(stream,cmd,arg);},readFile:function readFile(path,opts){opts=opts||{};opts.flags=opts.flags||'r';opts.encoding=opts.encoding||'binary';var ret;var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==='utf8'){ret='';var utf8=new Runtime.UTF8Processor();for(var i=0;i>2]=stdin.fd;assert(stdin.fd===1,'invalid handle for stdin ('+stdin.fd+')');var stdout=FS.open('/dev/stdout','w');HEAP32[_stdout>>2]=stdout.fd;assert(stdout.fd===2,'invalid handle for stdout ('+stdout.fd+')');var stderr=FS.open('/dev/stderr','w');HEAP32[_stderr>>2]=stderr.fd;assert(stderr.fd===3,'invalid handle for stderr ('+stderr.fd+')');},staticInit:function staticInit(){FS.nameTable=new Array(4096);FS.root=FS.createNode(null,'/',16384|511,0);FS.mount(MEMFS,{},'/');FS.createDefaultDirectories();FS.createDefaultDevices();},init:function init(input,output,error){assert(!FS.init.initialized,'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)');FS.init.initialized=true;// Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here\nModule['stdin']=input||Module['stdin'];Module['stdout']=output||Module['stdout'];Module['stderr']=error||Module['stderr'];FS.createStandardStreams();},quit:function quit(){FS.init.initialized=false;for(var i=0;i2&&arguments[2]!==undefined?arguments[2]:true;var parts=path.split('/').reverse();while(parts.length){var part=parts.pop();if(!part){continue;}var current=PATH.join(parent,part);try{FS.mkdir(current,undefined,throwError);}catch(error){// console.error(error)\n}parent=current;}},/**\n * Creates a file.\n * @function createFile\n * @memberof LibTiMidity\n * @instance\n * @param {string} parent The parent folder.\n * @param {string} name The path to create.\n * @param {boolean} canRead\n * @param {boolean} canWrite\n */createFile:function createFile(parent,name,canRead,canWrite){var path=PATH.join(typeof parent==='string'?parent:FS.getPath(parent),name);var mode=FS.getMode(canRead,canWrite);return FS.create(path,mode);},/**\n * Creates a data file and writes data to it.\n * @function createDataFile\n * @memberof LibTiMidity\n * @instance\n * @param {string} parent\n * @param {string} name\n * @param {array} data\n * @param {boolean} canRead\n * @param {boolean} canWrite\n * @param {boolean} [canOwn]\n * @param {boolean} [throwError = true] If file creation failed, throw an error.\n */createDataFile:function createDataFile(parent,name,data,canRead,canWrite,canOwn){var throwError=arguments.length>6&&arguments[6]!==undefined?arguments[6]:true;var path=name?PATH.join(typeof parent==='string'?parent:FS.getPath(parent),name):parent;var mode=FS.getMode(canRead,canWrite);if(throwError){FS.create(path,mode);}else{try{FS.create(path,mode);}catch(error){return;}}if(data){if(typeof data==='string'){var arr=new Array(data.length);for(var i=0,len=data.length;i=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){// normal array\nfor(var i=0;i>2];path=Pointer_stringify(path);try{var stream=FS.open(path,oflag,mode);return stream.fd;}catch(e){FS.handleFSError(e);return-1;}}function _fopen(filename,mode){// FILE *fopen(const char *restrict filename, const char *restrict mode);\n// http://pubs.opengroup.org/onlinepubs/000095399/functions/fopen.html\nvar flags;mode=Pointer_stringify(mode);if(mode[0]=='r'){if(mode.indexOf('+')!=-1){flags=2;}else{flags=0;}}else if(mode[0]=='w'){if(mode.indexOf('+')!=-1){flags=2;}else{flags=1;}flags|=64;flags|=512;}else if(mode[0]=='a'){if(mode.indexOf('+')!=-1){flags=2;}else{flags=1;}flags|=64;flags|=1024;}else{___setErrNo(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);return 0;}var ret=_open(filename,flags,allocate([0x1ff,0,0,0],'i32',ALLOC_STACK));// All creation permissions.\nreturn ret==-1?0:ret;}Module['_strlen']=_strlen;Module['_strcpy']=_strcpy;Module['_strcat']=_strcat;var SOCKFS={mount:function mount(){return FS.createNode(null,'/',16384|511,0);},createSocket:function createSocket(family,type,protocol){var streaming=type==1;if(protocol){assert(streaming==(protocol==6));// if SOCK_STREAM, must be tcp\n}// create our internal socket structure\nvar sock={family:family,type:type,protocol:protocol,server:null,peers:{},pending:[],recv_queue:[],sock_ops:SOCKFS.websocket_sock_ops};// create the filesystem node to store the socket structure\nvar name=SOCKFS.nextname();var node=FS.createNode(SOCKFS.root,name,49152,0);node.sock=sock;// and the wrapping stream that enables library functions such\n// as read and write to indirectly interact with the socket\nvar stream=FS.createStream({path:name,node:node,flags:FS.modeStringToFlags('r+'),seekable:false,stream_ops:SOCKFS.stream_ops});// map the new stream to the socket structure (sockets have a 1:1\n// relationship with a stream)\nsock.stream=stream;return sock;},getSocket:function getSocket(fd){var stream=FS.getStream(fd);if(!stream||!FS.isSocket(stream.node.mode)){return null;}return stream.node.sock;},stream_ops:{poll:function poll(stream){var sock=stream.node.sock;return sock.sock_ops.poll(sock);},ioctl:function ioctl(stream,request,varargs){var sock=stream.node.sock;return sock.sock_ops.ioctl(sock,request,varargs);},read:function read(stream,buffer,offset,length){var sock=stream.node.sock;var msg=sock.sock_ops.recvmsg(sock,length);if(!msg){// socket is closed\nreturn 0;}buffer.set(msg.buffer,offset);return msg.buffer.length;},write:function write(stream,buffer,offset,length){var sock=stream.node.sock;return sock.sock_ops.sendmsg(sock,buffer,offset,length);},close:function close(stream){var sock=stream.node.sock;sock.sock_ops.close(sock);}},nextname:function nextname(){if(!SOCKFS.nextname.current){SOCKFS.nextname.current=0;}return'socket['+SOCKFS.nextname.current++ +']';},websocket_sock_ops:{createPeer:function createPeer(sock,addr,port){var ws;if(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_3___default()(addr)==='object'){ws=addr;addr=null;port=null;}if(ws){// for sockets that've already connected (e.g. we're the server)\n// we can inspect the _socket property for the address\nif(ws._socket){addr=ws._socket.remoteAddress;port=ws._socket.remotePort;}// if we're just now initializing a connection to the remote,\n// inspect the url property\nelse{var result=/ws[s]?:\\/\\/([^:]+):(\\d+)/.exec(ws.url);if(!result){throw new Error('WebSocket URL must be in the format ws(s)://address:port');}addr=result[1];port=parseInt(result[2],10);}}else{// create the actual websocket object and connect\ntry{var url='ws://'+addr+':'+port;// the node ws library API is slightly different than the browser's\nvar opts=['binary'];ws=new WebSocket(url,opts);ws.binaryType='arraybuffer';}catch(e){throw new FS.ErrnoError(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EHOSTUNREACH);}}var peer={addr:addr,port:port,socket:ws,dgram_send_queue:[]};SOCKFS.websocket_sock_ops.addPeer(sock,peer);SOCKFS.websocket_sock_ops.handlePeerEvents(sock,peer);// if this is a bound dgram socket, send the port number first to allow\n// us to override the ephemeral port reported to us by remotePort on the\n// remote end.\nif(sock.type===2&&typeof sock.sport!=='undefined'){peer.dgram_send_queue.push(new Uint8Array([255,255,255,255,'p'.charCodeAt(0),'o'.charCodeAt(0),'r'.charCodeAt(0),'t'.charCodeAt(0),(sock.sport&0xff00)>>8,sock.sport&0xff]));}return peer;},getPeer:function getPeer(sock,addr,port){return sock.peers[addr+':'+port];},addPeer:function addPeer(sock,peer){sock.peers[peer.addr+':'+peer.port]=peer;},removePeer:function removePeer(sock,peer){delete sock.peers[peer.addr+':'+peer.port];},handlePeerEvents:function handlePeerEvents(sock,peer){var first=true;var handleOpen=function handleOpen(){try{var queued=peer.dgram_send_queue.shift();while(queued){peer.socket.send(queued);queued=peer.dgram_send_queue.shift();}}catch(e){// not much we can do here in the way of proper error handling as we've already\n// lied and said this data was sent. shut it down.\npeer.socket.close();}};var handleMessage=function handleMessage(data){assert(typeof data!=='string'&&data.byteLength!==undefined);// must receive an ArrayBuffer\ndata=new Uint8Array(data);// make a typed array view on the array buffer\n// if this is the port message, override the peer's port with it\nvar wasfirst=first;first=false;if(wasfirst&&data.length===10&&data[0]===255&&data[1]===255&&data[2]===255&&data[3]===255&&data[4]==='p'.charCodeAt(0)&&data[5]==='o'.charCodeAt(0)&&data[6]==='r'.charCodeAt(0)&&data[7]==='t'.charCodeAt(0)){// update the peer's port and it's key in the peer map\nvar newport=data[8]<<8|data[9];SOCKFS.websocket_sock_ops.removePeer(sock,peer);peer.port=newport;SOCKFS.websocket_sock_ops.addPeer(sock,peer);return;}sock.recv_queue.push({addr:peer.addr,port:peer.port,data:data});};peer.socket.onopen=handleOpen;peer.socket.onmessage=function(event){handleMessage(event.data);};},poll:function poll(sock){if(sock.type===1&&sock.server){// listen sockets should only say they're available for reading\n// if there are pending clients.\nreturn sock.pending.length?64|1:0;}var mask=0;var dest=sock.type===1// we only care about the socket state for connection-based sockets\n?SOCKFS.websocket_sock_ops.getPeer(sock,sock.daddr,sock.dport):null;if(sock.recv_queue.length||!dest||// connection-less sockets are always ready to read\ndest&&dest.socket.readyState===dest.socket.CLOSING||dest&&dest.socket.readyState===dest.socket.CLOSED){// let recv return 0 once closed\nmask|=64|1;}if(!dest||// connection-less sockets are always ready to write\ndest&&dest.socket.readyState===dest.socket.OPEN){mask|=4;}if(dest&&dest.socket.readyState===dest.socket.CLOSING||dest&&dest.socket.readyState===dest.socket.CLOSED){mask|=16;}return mask;},ioctl:function ioctl(sock,request,arg){switch(request){case 21531:var bytes=0;if(sock.recv_queue.length){bytes=sock.recv_queue[0].data.length;}HEAP32[arg>>2]=bytes;return 0;default:return _constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL;}},close:function close(sock){// if we've spawned a listen server, close it\nif(sock.server){try{sock.server.close();}catch(e){}sock.server=null;}// close any peer connections\nvar peers=Object.keys(sock.peers);for(var i=0;i>3];}else if(type=='i64'){ret=[HEAP32[varargs+argIndex>>2],HEAP32[varargs+(argIndex+8)>>2]];argIndex+=8;// each 32-bit chunk is in a 64-bit block\n}else{type='i32';// varargs are always i32, i64, or double\nret=HEAP32[varargs+argIndex>>2];}argIndex+=Math.max(Runtime.getNativeFieldSize(type),Runtime.getAlignSize(type,null,true));return ret;}var ret=[];var curr,next,currArg;while(1){var startTextIndex=textIndex;curr=HEAP8[textIndex];if(curr===0)break;next=HEAP8[textIndex+1|0];if(curr==37){// Handle flags.\nvar flagAlwaysSigned=false;var flagLeftAlign=false;var flagAlternative=false;var flagZeroPad=false;var flagPadSign=false;flagsLoop:while(1){switch(next){case 43:flagAlwaysSigned=true;break;case 45:flagLeftAlign=true;break;case 35:flagAlternative=true;break;case 48:if(flagZeroPad){break flagsLoop;}else{flagZeroPad=true;break;}case 32:flagPadSign=true;break;default:break flagsLoop;}textIndex++;next=HEAP8[textIndex+1|0];}// Handle width.\nvar width=0;if(next==42){width=getNextArg('i32');textIndex++;next=HEAP8[textIndex+1|0];}else{while(next>=48&&next<=57){width=width*10+(next-48);textIndex++;next=HEAP8[textIndex+1|0];}}// Handle precision.\nvar precisionSet=false;if(next==46){var precision=0;precisionSet=true;textIndex++;next=HEAP8[textIndex+1|0];if(next==42){precision=getNextArg('i32');textIndex++;}else{while(1){var precisionChr=HEAP8[textIndex+1|0];if(precisionChr<48||precisionChr>57)break;precision=precision*10+(precisionChr-48);textIndex++;}}next=HEAP8[textIndex+1|0];}else{var precision=6;// Standard default.\n}// Handle integer sizes. WARNING: These assume a 32-bit architecture!\nvar argSize;switch(String.fromCharCode(next)){case'h':var nextNext=HEAP8[textIndex+2|0];if(nextNext==104){textIndex++;argSize=1;// char (actually i32 in varargs)\n}else{argSize=2;// short (actually i32 in varargs)\n}break;case'l':var nextNext=HEAP8[textIndex+2|0];if(nextNext==108){textIndex++;argSize=8;// long long\n}else{argSize=4;// long\n}break;case'L':// long long\ncase'q':// int64_t\ncase'j':// intmax_t\nargSize=8;break;case'z':// size_t\ncase't':// ptrdiff_t\ncase'I':// signed ptrdiff_t or unsigned size_t\nargSize=4;break;default:argSize=null;}if(argSize)textIndex++;next=HEAP8[textIndex+1|0];// Handle type specifier.\nswitch(String.fromCharCode(next)){case'd':case'i':case'u':case'o':case'x':case'X':case'p':{// Integer.\nvar signed=next==100||next==105;argSize=argSize||4;var currArg=getNextArg('i'+argSize*8);var origArg=currArg;var argText;// Flatten i64-1 [low, high] into a (slightly rounded) double\nif(argSize==8){currArg=Runtime.makeBigInt(currArg[0],currArg[1],next==117);}// Truncate to requested size.\nif(argSize<=4){var limit=Math.pow(256,argSize)-1;currArg=(signed?reSign:unSign)(currArg&limit,argSize*8);}// Format the number.\nvar currAbsArg=Math.abs(currArg);var prefix='';if(next==100||next==105){if(argSize==8&&i64Math)argText=i64Math.stringify(origArg[0],origArg[1],null);else argText=reSign(currArg,8*argSize,1).toString(10);}else if(next==117){if(argSize==8&&i64Math)argText=i64Math.stringify(origArg[0],origArg[1],true);else argText=unSign(currArg,8*argSize,1).toString(10);currArg=Math.abs(currArg);}else if(next==111){argText=(flagAlternative?'0':'')+currAbsArg.toString(8);}else if(next==120||next==88){prefix=flagAlternative&&currArg!=0?'0x':'';if(argSize==8&&i64Math){if(origArg[1]){argText=(origArg[1]>>>0).toString(16);var lower=(origArg[0]>>>0).toString(16);while(lower.length<8){lower='0'+lower;}argText+=lower;}else{argText=(origArg[0]>>>0).toString(16);}}else if(currArg<0){// Represent negative numbers in hex as 2's complement.\ncurrArg=-currArg;argText=(currAbsArg-1).toString(16);var buffer=[];for(var i=0;i=0){if(flagAlwaysSigned){prefix='+'+prefix;}else if(flagPadSign){prefix=' '+prefix;}}// Move sign to prefix so we zero-pad after the sign\nif(argText.charAt(0)=='-'){prefix='-'+prefix;argText=argText.substr(1);}// Add padding.\nwhile(prefix.length+argText.lengthexponent&&exponent>=-4){next=(next==103?'f':'F').charCodeAt(0);precision-=exponent+1;}else{next=(next==103?'e':'E').charCodeAt(0);precision--;}effectivePrecision=Math.min(precision,20);}if(next==101||next==69){argText=currArg.toExponential(effectivePrecision);// Make sure the exponent has at least 2 digits.\nif(/[eE][-+]\\d$/.test(argText)){argText=argText.slice(0,-1)+'0'+argText.slice(-1);}}else if(next==102||next==70){argText=currArg.toFixed(effectivePrecision);if(currArg===0&&__reallyNegative(currArg)){argText='-'+argText;}}var parts=argText.split('e');if(isGeneral&&!flagAlternative){// Discard trailing zeros and periods.\nwhile(parts[0].length>1&&parts[0].indexOf('.')!=-1&&(parts[0].slice(-1)=='0'||parts[0].slice(-1)=='.')){parts[0]=parts[0].slice(0,-1);}}else{// Make sure we have a period in alternative mode.\nif(flagAlternative&&argText.indexOf('.')==-1)parts[0]+='.';// Zero pad until required precision.\nwhile(precision>effectivePrecision++){parts[0]+='0';}}argText=parts[0]+(parts.length>1?'e'+parts[1]:'');// Capitalize 'E' if needed.\nif(next==69)argText=argText.toUpperCase();// Add sign.\nif(currArg>=0){if(flagAlwaysSigned){argText='+'+argText;}else if(flagPadSign){argText=' '+argText;}}}// Add padding.\nwhile(argText.length0){ret.push(32);}if(!flagLeftAlign)ret.push(getNextArg('i8'));break;}case'n':{// Write the length written so far to the next parameter.\nvar ptr=getNextArg('i32*');HEAP32[ptr>>2]=ret.length;break;}case'%':{// Literal percent sign.\nret.push(curr);break;}default:{// Unknown specifiers remain untouched.\nfor(var i=startTextIndex;i0){HEAP8[ptr++|0]=streamObj.ungotten.pop();bytesToRead--;bytesRead++;}var err=_read(stream,ptr,bytesToRead);if(err==-1){if(streamObj)streamObj.error=true;return 0;}bytesRead+=err;if(bytesRead>2];return _fprintf(stdout,format,varargs);}Module['_memset']=_memset;var _llvm_memset_p0i8_i32=_memset;Module['_memcpy']=_memcpy;var _llvm_memcpy_p0i8_p0i8_i32=_memcpy;var _llvm_pow_f64=Math_pow;var _sin=Math_sin;function _strrchr(ptr,chr){var ptr2=ptr+_strlen(ptr);do{if(HEAP8[ptr2]==chr)return ptr2;ptr2--;}while(ptr2>=ptr);return 0;}var ___strtok_state=0;function _strtok_r(s,delim,lasts){var skip_leading_delim=1;var spanp;var c,sc;var tok;if(s==0&&(s=getValue(lasts,'i8*'))==0){return 0;}cont:while(1){c=getValue(s++,'i8');for(spanp=delim;(sc=getValue(spanp++,'i8'))!=0;){if(c==sc){if(skip_leading_delim){continue cont;}else{setValue(lasts,s,'i8*');setValue(s-1,0,'i8');return s-1;}}}break;}if(c==0){setValue(lasts,0,'i8*');return 0;}tok=s-1;for(;;){c=getValue(s++,'i8');spanp=delim;do{if((sc=getValue(spanp++,'i8'))==c){if(c==0){s=0;}else{setValue(s-1,0,'i8');}setValue(lasts,s,'i8*');return tok;}}while(sc!=0);}abort('strtok_r error!');}function _strtok(s,delim){return _strtok_r(s,delim,___strtok_state);}function _strncmp(px,py,n){var i=0;while(iy?1:-1;}}return 0;}function _strcmp(px,py){return _strncmp(px,py,TOTAL_MEMORY);}Module['_strncpy']=_strncpy;function _isspace(chr){return chr==32||chr>=9&&chr<=13;}function __parseInt(str,endptr,base,min,max,bits,unsign){// Skip space.\nwhile(_isspace(HEAP8[str])){str++;}// Check for a plus/minus sign.\nvar multiplier=1;if(HEAP8[str]==45){multiplier=-1;str++;}else if(HEAP8[str]==43){str++;}// Find base.\nvar finalBase=base;if(!finalBase){if(HEAP8[str]==48){if(HEAP8[str+1|0]==120||HEAP8[str+1|0]==88){finalBase=16;str+=2;}else{finalBase=8;str++;}}}else if(finalBase==16){if(HEAP8[str]==48){if(HEAP8[str+1|0]==120||HEAP8[str+1|0]==88){str+=2;}}}if(!finalBase)finalBase=10;// Get digits.\nvar chr;var ret=0;while((chr=HEAP8[str])!=0){var digit=parseInt(String.fromCharCode(chr),finalBase);if(isNaN(digit)){break;}else{ret=ret*finalBase+digit;str++;}}// Apply sign.\nret*=multiplier;// Set end pointer.\nif(endptr){HEAP32[endptr>>2]=str;}// Unsign if needed.\nif(unsign){if(Math.abs(ret)>max){ret=max;___setErrNo(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ERANGE);}else{ret=unSign(ret,bits);}}// Validate range.\nif(ret>max||retmax?max:min;___setErrNo(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].ERANGE);}if(bits==64){return(asm['setTempRet0']((tempDouble=ret,+Math_abs(tempDouble)>=+1?tempDouble>+0?(Math_min(+Math_floor(tempDouble/+4294967296),+4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/+4294967296)>>>0:0)),ret>>>0)|0;}return ret;}function _strtol(str,endptr,base){return __parseInt(str,endptr,base,-2147483648,2147483647,32);// LONG_MIN, LONG_MAX.\n}function _atoi(ptr){return _strtol(ptr,null,10);}function _strchr(ptr,chr){ptr--;do{ptr++;var val=HEAP8[ptr];if(val==chr)return ptr;}while(val);return 0;}function _abort(){Module['abort']();}function ___errno_location(){return ___errno_state;}function _sbrk(bytes){// Implement a Linux-like 'memory area' for our 'process'.\n// Changes the size of the memory area by |bytes|; returns the\n// address of the previous top ('break') of the memory area\n// We control the \"dynamic\" memory - DYNAMIC_BASE to DYNAMICTOP\nvar self=_sbrk;if(!self.called){DYNAMICTOP=alignMemoryPage(DYNAMICTOP);// make sure we start out aligned\nself.called=true;assert(Runtime.dynamicAlloc);self.alloc=Runtime.dynamicAlloc;Runtime.dynamicAlloc=function(){abort('cannot dynamically allocate, sbrk now has control');};}var ret=DYNAMICTOP;if(bytes!=0)self.alloc(bytes);return ret;// Previous break location.\n}function _sysconf(name){// long sysconf(int name);\n// http://pubs.opengroup.org/onlinepubs/009695399/functions/sysconf.html\nswitch(name){case 30:return PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 79:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1000;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return 1;}___setErrNo(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_ERROR_CODES */ \"c\"].EINVAL);return-1;}function _time(ptr){var ret=Math.floor(Date.now()/1000);if(ptr){HEAP32[ptr>>2]=ret;}return ret;}var Browser={mainLoop:{scheduler:null,shouldPause:false,paused:false,queue:[],pause:function pause(){Browser.mainLoop.shouldPause=true;},resume:function resume(){if(Browser.mainLoop.paused){Browser.mainLoop.paused=false;Browser.mainLoop.scheduler();}Browser.mainLoop.shouldPause=false;},updateStatus:function updateStatus(){if(Module['setStatus']){var message=Module['statusMessage']||'Please wait...';var remaining=Browser.mainLoop.remainingBlockers;var expected=Browser.mainLoop.expectedBlockers;if(remaining){if(remaining=6){var curr=leftchar>>leftbits-6&0x3f;leftbits-=6;ret+=BASE[curr];}}if(leftbits==2){ret+=BASE[(leftchar&3)<<4];ret+=PAD+PAD;}else if(leftbits==4){ret+=BASE[(leftchar&0xf)<<2];ret+=PAD;}return ret;}audio.src='data:audio/x-'+name.substr(-3)+';base64,'+encode64(byteArray);finish(audio);// we don't wait for confirmation this worked - but it's worth trying\n};audio.src=url;// workaround for chrome bug 124926 - we do not always get oncanplaythrough or onerror\nBrowser.safeSetTimeout(function(){finish(audio);// try to use it even though it is not necessarily ready to play\n},10000);}else{return fail();}};Module['preloadPlugins'].push(audioPlugin);// Canvas event setup\nvar canvas=Module['canvas'];canvas.requestPointerLock=canvas['requestPointerLock']||canvas['mozRequestPointerLock']||canvas['webkitRequestPointerLock'];canvas.exitPointerLock=document['exitPointerLock']||document['mozExitPointerLock']||document['webkitExitPointerLock']||function(){};// no-op if function does not exist\ncanvas.exitPointerLock=canvas.exitPointerLock.bind(document);function pointerLockChange(){Browser.pointerLock=document['pointerLockElement']===canvas||document['mozPointerLockElement']===canvas||document['webkitPointerLockElement']===canvas;}document.addEventListener('pointerlockchange',pointerLockChange,false);document.addEventListener('mozpointerlockchange',pointerLockChange,false);document.addEventListener('webkitpointerlockchange',pointerLockChange,false);if(Module['elementPointerLock']){canvas.addEventListener('click',function(ev){if(!Browser.pointerLock&&canvas.requestPointerLock){canvas.requestPointerLock();ev.preventDefault();}},false);}},createContext:function createContext(canvas,useWebGL,setInModule){var ctx;try{if(useWebGL){ctx=canvas.getContext('experimental-webgl',{alpha:false});}else{ctx=canvas.getContext('2d');}if(!ctx)throw':(';}catch(e){console.error('Could not create canvas - '+e);return null;}if(useWebGL){// Set the background of the WebGL canvas to black\ncanvas.style.backgroundColor='black';// Warn on context loss\ncanvas.addEventListener('webglcontextlost',function(event){alert('WebGL context lost. You will need to reload the page.');},false);}if(setInModule){Module.ctx=ctx;Module.useWebGL=useWebGL;Browser.moduleContextCreatedCallbacks.forEach(function(callback){callback();});Browser.init();}return ctx;},destroyContext:function destroyContext(canvas,useWebGL,setInModule){},fullScreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullScreen:function requestFullScreen(lockPointer,resizeCanvas){Browser.lockPointer=lockPointer;Browser.resizeCanvas=resizeCanvas;if(typeof Browser.lockPointer==='undefined')Browser.lockPointer=true;if(typeof Browser.resizeCanvas==='undefined')Browser.resizeCanvas=false;var canvas=Module['canvas'];function fullScreenChange(){Browser.isFullScreen=false;if((document['webkitFullScreenElement']||document['webkitFullscreenElement']||document['mozFullScreenElement']||document['mozFullscreenElement']||document['fullScreenElement']||document['fullscreenElement'])===canvas){canvas.cancelFullScreen=document['cancelFullScreen']||document['mozCancelFullScreen']||document['webkitCancelFullScreen'];canvas.cancelFullScreen=canvas.cancelFullScreen.bind(document);if(Browser.lockPointer)canvas.requestPointerLock();Browser.isFullScreen=true;if(Browser.resizeCanvas)Browser.setFullScreenCanvasSize();}else if(Browser.resizeCanvas){Browser.setWindowedCanvasSize();}if(Module['onFullScreen'])Module['onFullScreen'](Browser.isFullScreen);}if(!Browser.fullScreenHandlersInstalled){Browser.fullScreenHandlersInstalled=true;document.addEventListener('fullscreenchange',fullScreenChange,false);document.addEventListener('mozfullscreenchange',fullScreenChange,false);document.addEventListener('webkitfullscreenchange',fullScreenChange,false);}canvas.requestFullScreen=canvas['requestFullScreen']||canvas['mozRequestFullScreen']||(canvas['webkitRequestFullScreen']?function(){canvas['webkitRequestFullScreen'](Element['ALLOW_KEYBOARD_INPUT']);}:null);canvas.requestFullScreen();},requestAnimationFrame:function requestAnimationFrame(func){if(!window.requestAnimationFrame){window.requestAnimationFrame=window['requestAnimationFrame']||window['mozRequestAnimationFrame']||window['webkitRequestAnimationFrame']||window['msRequestAnimationFrame']||window['oRequestAnimationFrame']||window['setTimeout'];}window.requestAnimationFrame(func);},safeCallback:function safeCallback(func){return function(){if(!ABORT)return func.apply(null,arguments);};},safeRequestAnimationFrame:function safeRequestAnimationFrame(func){return Browser.requestAnimationFrame(function(){if(!ABORT)func();});},safeSetTimeout:function safeSetTimeout(func,timeout){return setTimeout(function(){if(!ABORT)func();},timeout);},safeSetInterval:function safeSetInterval(func,timeout){return setInterval(function(){if(!ABORT)func();},timeout);},getMimetype:function getMimetype(name){return{jpg:'image/jpeg',jpeg:'image/jpeg',png:'image/png',bmp:'image/bmp',ogg:'audio/ogg',wav:'audio/wav',mp3:'audio/mpeg'}[name.substr(name.lastIndexOf('.')+1)];},getUserMedia:function getUserMedia(func){if(!window.getUserMedia){window.getUserMedia=navigator['getUserMedia']||navigator['mozGetUserMedia'];}window.getUserMedia(func);},getMovementX:function getMovementX(event){return event['movementX']||event['mozMovementX']||event['webkitMovementX']||0;},getMovementY:function getMovementY(event){return event['movementY']||event['mozMovementY']||event['webkitMovementY']||0;},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,calculateMouseEvent:function calculateMouseEvent(event){// event should be mousemove, mousedown or mouseup\nif(Browser.pointerLock){// When the pointer is locked, calculate the coordinates\n// based on the movement of the mouse.\n// Workaround for Firefox bug 764498\nif(event.type!='mousemove'&&'mozMovementX'in event){Browser.mouseMovementX=Browser.mouseMovementY=0;}else{Browser.mouseMovementX=Browser.getMovementX(event);Browser.mouseMovementY=Browser.getMovementY(event);}// check if SDL is available\nif(typeof SDL!='undefined'){Browser.mouseX=SDL.mouseX+Browser.mouseMovementX;Browser.mouseY=SDL.mouseY+Browser.mouseMovementY;}else{// just add the mouse delta to the current absolut mouse position\n// FIXME: ideally this should be clamped against the canvas size and zero\nBrowser.mouseX+=Browser.mouseMovementX;Browser.mouseY+=Browser.mouseMovementY;}}else{// Otherwise, calculate the movement based on the changes\n// in the coordinates.\nvar rect=Module['canvas'].getBoundingClientRect();var x,y;if(event.type=='touchstart'||event.type=='touchend'||event.type=='touchmove'){var t=event.touches.item(0);if(t){x=t.pageX-(window.scrollX+rect.left);y=t.pageY-(window.scrollY+rect.top);}else{return;}}else{x=event.pageX-(window.scrollX+rect.left);y=event.pageY-(window.scrollY+rect.top);}// the canvas might be CSS-scaled compared to its backbuffer;\n// SDL-using content will want mouse coordinates in terms\n// of backbuffer units.\nvar cw=Module['canvas'].width;var ch=Module['canvas'].height;x=x*(cw/rect.width);y=y*(ch/rect.height);Browser.mouseMovementX=x-Browser.mouseX;Browser.mouseMovementY=y-Browser.mouseY;Browser.mouseX=x;Browser.mouseY=y;}},xhrLoad:function xhrLoad(url,onload,onerror){var xhr=new XMLHttpRequest();xhr.open('GET',url,true);xhr.responseType='arraybuffer';xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){// file URLs can return 0\nonload(xhr.response);}else{onerror();}};xhr.onerror=onerror;xhr.send(null);},asyncLoad:function asyncLoad(url,onload,onerror,noRunDep){Browser.xhrLoad(url,function(arrayBuffer){assert(arrayBuffer,'Loading data file \"'+url+'\" failed (no arrayBuffer).');onload(new Uint8Array(arrayBuffer));if(!noRunDep)removeRunDependency('al '+url);},function(){if(onerror){onerror();}else{throw'Loading data file \"'+url+'\" failed.';}});if(!noRunDep)addRunDependency('al '+url);},resizeListeners:[],updateResizeListeners:function updateResizeListeners(){var canvas=Module['canvas'];Browser.resizeListeners.forEach(function(listener){listener(canvas.width,canvas.height);});},setCanvasSize:function setCanvasSize(width,height,noUpdates){var canvas=Module['canvas'];canvas.width=width;canvas.height=height;if(!noUpdates)Browser.updateResizeListeners();},windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function setFullScreenCanvasSize(){var canvas=Module['canvas'];this.windowedWidth=canvas.width;this.windowedHeight=canvas.height;canvas.width=screen.width;canvas.height=screen.height;// check if SDL is available\nif(typeof SDL!='undefined'){var flags=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];flags=flags|0x00800000;// set SDL_FULLSCREEN flag\nHEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=flags;}Browser.updateResizeListeners();},setWindowedCanvasSize:function setWindowedCanvasSize(){var canvas=Module['canvas'];canvas.width=this.windowedWidth;canvas.height=this.windowedHeight;// check if SDL is available\nif(typeof SDL!='undefined'){var flags=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];flags=flags&~0x00800000;// clear SDL_FULLSCREEN flag\nHEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=flags;}Browser.updateResizeListeners();}};FS.staticInit();__ATINIT__.unshift({func:function func(){if(!Module['noFSInit']&&!FS.init.initialized)FS.init();}});__ATMAIN__.push({func:function func(){FS.ignorePermissions=false;}});__ATEXIT__.push({func:function func(){FS.quit();}});Module['FS_createFolder']=FS.createFolder;Module.createPath=FS.createPath;Module.createDataFile=FS.createDataFile;Module.loadPatchFromUrl=FS.loadPatchFromUrl;Module['FS_createPreloadedFile']=FS.createPreloadedFile;Module['FS_createLazyFile']=FS.createLazyFile;Module['FS_createLink']=FS.createLink;Module['FS_createDevice']=FS.createDevice;___errno_state=Runtime.staticAlloc(4);HEAP32[___errno_state>>2]=0;__ATINIT__.unshift({func:function func(){TTY.init();}});__ATEXIT__.push({func:function func(){TTY.shutdown();}});TTY.utf8=new Runtime.UTF8Processor();__ATINIT__.push({func:function func(){SOCKFS.root=FS.mount(SOCKFS,{},null);}});___strtok_state=Runtime.staticAlloc(4);Module['requestFullScreen']=function(lockPointer,resizeCanvas){Browser.requestFullScreen(lockPointer,resizeCanvas);};Module['requestAnimationFrame']=function(func){Browser.requestAnimationFrame(func);};Module['setCanvasSize']=function(width,height,noUpdates){Browser.setCanvasSize(width,height,noUpdates);};Module['pauseMainLoop']=function(){Browser.mainLoop.pause();};Module['resumeMainLoop']=function(){Browser.mainLoop.resume();};Module['getUserMedia']=function(){Browser.getUserMedia();};STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP);STACK_MAX=STACK_BASE+5242880;DYNAMIC_BASE=DYNAMICTOP=Runtime.alignMemory(STACK_MAX);assert(DYNAMIC_BASE>2]|0)|0;if((l|0)!=0){m=e|0;n=c[b>>2]|0;c2(m|0,n|0)|0;if((a[e+(l-1)|0]|0)!=47){a[e+l|0]=47;a[e+(l+1)|0]=0;}}c3(e|0,f|0)|0;l=av(e|0,6576)|0;g=l;if((l|0)!=0){break;}b=c[b+4>>2]|0;}if((k|0)==16){break;}h=g;j=h;i=d;return j|0;}}while(0);h=0;j=h;i=d;return j|0;}}while(0);h=0;j=h;i=d;return j|0;}function bi(a){a=a|0;var b=0;b=c$(a)|0;return b|0;}function bj(a){a=a|0;var b=0,d=0,e=0;b=a;a=bi(8)|0;if((a|0)==0){return;}c[a>>2]=bi((c1(b|0)|0)+1|0)|0;if((c[a>>2]|0)==0){c0(a);return;}else{d=c[a>>2]|0;e=b;c2(d|0,e|0)|0;c[a+4>>2]=c[1664];c[1664]=a;return;}}function bk(){var a=0,b=0;a=c[1664]|0;while(1){if((a|0)==0){break;}b=c[a+4>>2]|0;c0(c[a>>2]|0);c0(a);a=b;}c[1664]=0;return;}function bl(f,h,j,k,l,n,o,p,q){f=f|0;h=h|0;j=j|0;k=k|0;l=l|0;n=n|0;o=o|0;p=p|0;q=q|0;var r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;j=i;i=i+1056|0;r=j|0;s=j+1024|0;t=j+1032|0;u=j+1040|0;v=j+1048|0;w=f;f=h;h=k;k=l;l=n;n=o;o=p;p=q;q=0;if((f|0)==0){x=0;y=x;i=j;return y|0;}z=bh(f)|0;A=z;if((z|0)==0){z=c[m>>2]|0;ar(z|0,6512,(z=i,i=i+1|0,i=i+7&-8,c[z>>2]=0,z)|0)|0;i=z;q=1;B=0;while(1){if((c[1048+(B<<2)>>2]|0)==0){break;}z=c1(f|0)|0;if((z+(c1(c[1048+(B<<2)>>2]|0)|0)|0)>>>0<1024){z=r|0;C=f;c2(z|0,C|0)|0;C=r|0;z=c[1048+(B<<2)>>2]|0;c3(C|0,z|0)|0;z=bh(r|0)|0;A=z;if((z|0)!=0){D=46;break;}}B=B+1|0;}if((D|0)==46){q=0;f=r|0;}}if((q|0)!=0){x=0;y=x;i=j;return y|0;}do{if(239==(an(r|0,1,239,A|0)|0)){if((c4(r|0,6248,22)|0)!=0){if((c4(r|0,5888,22)|0)!=0){break;}}do{if((a[r+82|0]|0)!=1){if((a[r+82|0]|0)==0){break;}x=0;y=x;i=j;return y|0;}}while(0);do{if((a[r+151|0]|0)!=1){if((a[r+151|0]|0)==0){break;}x=0;y=x;i=j;return y|0;}}while(0);q=bi(8)|0;c[q>>2]=a[r+198|0]|0;c[q+4>>2]=bi((c[q>>2]|0)*116|0)|0;B=0;while(1){if((B|0)>=(c[q>>2]|0)){D=162;break;}aB(A|0,7,1)|0;if(1!=(an(s|0,1,1,A|0)|0)){D=66;break;}f=(c[q+4>>2]|0)+(B*116|0)|0;if(1!=(an(t|0,4,1,A|0)|0)){D=73;break;}c[f+8>>2]=c[t>>2];if(1!=(an(t|0,4,1,A|0)|0)){D=75;break;}c[f>>2]=c[t>>2];if(1!=(an(t|0,4,1,A|0)|0)){D=77;break;}c[f+4>>2]=c[t>>2];if(1!=(an(u|0,2,1,A|0)|0)){D=79;break;}c[f+12>>2]=e[u>>1]|0;if(1!=(an(t|0,4,1,A|0)|0)){D=81;break;}c[f+24>>2]=c[t>>2];if(1!=(an(t|0,4,1,A|0)|0)){D=83;break;}c[f+28>>2]=c[t>>2];if(1!=(an(t|0,4,1,A|0)|0)){D=85;break;}c[f+32>>2]=c[t>>2];c[f+16>>2]=0;c[f+20>>2]=127;aB(A|0,2,1)|0;if(1!=(an(v|0,1,1,A|0)|0)){D=87;break;}a[r|0]=a[v]|0;if((h|0)==-1){a[f+111|0]=(a[r|0]<<3)+4&127;}else{a[f+111|0]=h&127;}if(18!=(an(r|0,1,18,A|0)|0)){D=92;break;}do{if((a[r+13|0]|0)!=0){if((a[r+14|0]|0)==0){D=95;break;}c[f+92>>2]=bm(w,a[r+12|0]|0)|0;c[f+96>>2]=bn(w,a[r+13|0]|0)|0;a[f+108|0]=a[r+14|0]|0;}else{D=95;}}while(0);if((D|0)==95){D=0;a[f+108|0]=0;c[f+96>>2]=0;c[f+92>>2]=0;}do{if((a[r+16|0]|0)!=0){if((a[r+17|0]|0)==0){D=99;break;}c[f+104>>2]=bo(w,a[r+16|0]|0)|0;c[f+100>>2]=bp(w,a[r+15|0]|0,c[f+104>>2]|0)|0;a[f+109|0]=a[r+17|0]|0;}else{D=99;}}while(0);if((D|0)==99){D=0;a[f+109|0]=0;c[f+104>>2]=0;c[f+100>>2]=0;}if(1!=(an(v|0,1,1,A|0)|0)){D=102;break;}a[f+110|0]=a[v]|0;aB(A|0,40,1)|0;if((l|0)!=-1){a[f+112|0]=l&255;}else{a[f+112|0]=0;}if((a[f+110|0]&4|0)!=0){z=f+110|0;a[z]=(d[z]|32)&255;}do{if((n|0)==1){if((a[f+110|0]&60|0)==0){break;}z=f+110|0;a[z]=d[z]&-61&255;}}while(0);if((o|0)==1){(a[f+110|0]&64|0)!=0;z=f+110|0;a[z]=d[z]&-65&255;}else{if((o|0)!=0){if((a[f+110|0]&28|0)!=0){do{if((c4(r|0,5512,6)|0)!=0){if((a[r+11|0]|0)>=100){D=120;break;}if((a[f+110|0]&32|0)==0){z=f+110|0;a[z]=d[z]&-65&255;}}else{D=120;}}while(0);if((D|0)==120){D=0;z=f+110|0;a[z]=d[z]&-65&255;}}else{z=f+110|0;a[z]=d[z]&-97&255;}}}E=0;while(1){if((E|0)>=6){break;}c[f+36+(E<<2)>>2]=bq(w,a[r+E|0]|0)|0;c[f+60+(E<<2)>>2]=br(a[r+(E+6)|0]|0)|0;E=E+1|0;}c[f+88>>2]=bi(c[f+8>>2]|0)|0;if(1!=(an(c[f+88>>2]|0,c[f+8>>2]|0,1,A|0)|0)){D=132;break;}if((a[f+110|0]&1|0)==0){z=c[f+8>>2]|0;C=c[f+88>>2]|0;F=bi(c[f+8>>2]<<1)|0;G=F;H=F;while(1){F=z;z=F-1|0;if((F|0)==0){break;}F=C;C=F+1|0;I=H;H=I+2|0;b[I>>1]=(a[F]&255)<<8&65535;}C=c[f+88>>2]|0;c[f+88>>2]=G;c0(C);H=f+8|0;c[H>>2]=c[H>>2]<<1;H=f|0;c[H>>2]=c[H>>2]<<1;H=f+4|0;c[H>>2]=c[H>>2]<<1;}if((a[f+110|0]&2|0)!=0){H=(c[f+8>>2]|0)/2|0;z=c[f+88>>2]|0;while(1){F=H;H=F-1|0;if((F|0)==0){break;}F=z;z=F+2|0;b[F>>1]=(b[F>>1]^32768)&65535;}}if((a[f+110|0]&16|0)!=0){bs(c[f+88>>2]|0,0,(c[f+8>>2]|0)/2|0);z=c[f>>2]|0;c[f>>2]=(c[f+8>>2]|0)-(c[f+4>>2]|0);c[f+4>>2]=(c[f+8>>2]|0)-z;z=f+110|0;a[z]=d[z]&-17&255;z=f+110|0;a[z]=(d[z]|4)&255;}if((k|0)!=-1){g[f+84>>2]=+(k|0)/100.0;}else{z=(c[f+8>>2]|0)/2|0;H=0;C=c[f+88>>2]|0;while(1){G=z;z=G-1|0;if((G|0)==0){break;}G=C;C=G+2|0;F=b[G>>1]|0;if((F<<16>>16|0)<0){F=-(F<<16>>16)&65535;}if((F<<16>>16|0)>(H<<16>>16|0)){H=F;}}g[f+84>>2]=32768.0/+(H<<16>>16|0);}C=f+8|0;c[C>>2]=(c[C>>2]|0)/2|0;C=f|0;c[C>>2]=(c[C>>2]|0)/2|0;C=f+4|0;c[C>>2]=(c[C>>2]|0)/2|0;C=f+8|0;c[C>>2]=c[C>>2]<<12;C=f|0;c[C>>2]=c[C>>2]<<12;C=f+4|0;c[C>>2]=c[C>>2]<<12;C=f|0;c[C>>2]=c[C>>2]|(a[s]&15)<<8;C=f+4|0;c[C>>2]=c[C>>2]|(d[s]>>4&15)<<8;do{if((a[f+112|0]|0)!=0){if((a[f+110|0]&4|0)!=0){break;}cF(w,f);}}while(0);if((p|0)==1){c[f+8>>2]=c[f+4>>2];}B=B+1|0;}if((D|0)!=66)if((D|0)!=73)if((D|0)!=75)if((D|0)!=77)if((D|0)!=79)if((D|0)!=81)if((D|0)!=83)if((D|0)!=85)if((D|0)!=87)if((D|0)!=92)if((D|0)!=102)if((D|0)!=132)if((D|0)==162){ao(A|0)|0;x=q;y=x;i=j;return y|0;}E=0;while(1){if((E|0)>=(B|0)){break;}c0(c[(c[q+4>>2]|0)+(E*116|0)+88>>2]|0);E=E+1|0;}c0(c[q+4>>2]|0);c0(q);x=0;y=x;i=j;return y|0;}}while(0);x=0;y=x;i=j;return y|0;}function bm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=a;a=b;if(a<<24>>24!=0){b=((c[d+13060>>2]|0)*38|0)<<16;e=(b|0)/(_(c[d+4>>2]|0,a&255)|0)|0;f=e;return f|0;}else{e=0;f=e;return f|0;}return 0;}function bn(a,b){a=a|0;b=b|0;var d=0;d=a;a=(_(c[d+13060>>2]<<10,b&255)|0)<<5;return(a|0)/((c[d+4>>2]|0)*38|0|0)|0|0;}function bo(a,b){a=a|0;b=b|0;return((c[a+4>>2]|0)*38|0|0)/((b&255)<<1<<5|0)|0|0;}function bp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=b;if(e<<24>>24!=0){f=~~(+(d|0)*38.0*65536.0/+(_(c[a+4>>2]|0,e&255)|0));g=f;return g|0;}else{f=0;g=f;return g|0;}return 0;}function bq(a,b){a=a|0;b=b|0;var d=0;d=a;a=b;b=3-((a&255)>>6&3)|0;b=b*3|0;b=(a&63)<>2]|0)|0,c[d+13060>>2]|0)|0;return b<<10|0;}function br(a){a=a|0;return(a&255)<<22|0;}function bs(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,f=0;e=a;a=c;c=d;d=e+(c<<1)|0;e=e+(a<<1)|0;c=c-a|0;c=(c|0)/2|0;while(1){a=c;c=a-1|0;if((a|0)==0){break;}a=b[e>>1]|0;f=e;e=f+2|0;b[f>>1]=b[d>>1]|0;f=d;d=f-2|0;b[f>>1]=a;}return;}function bt(a){a=a|0;return c[a+13136>>2]|0;}function bu(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=a;a=b;do{if((a|0)>=0){// stops when reached last instrument\nif((a|0)>=(c[d+13136>>2]|0)){break;}// path to patch file\ne=c[d+13140+(a<<2)>>2]|0;f=e;return f|0;}}while(0);e=0;f=e;return f|0;}function bv(a){a=a|0;var b=0,d=0,e=0;b=a;a=128;d=0;c[b+13136>>2]=0;while(1){e=a;a=e-1|0;if((e|0)==0){break;}if((c[b+28+(a<<2)>>2]|0)!=0){d=d+(bw(b,0,a)|0)|0;}if((c[b+540+(a<<2)>>2]|0)!=0){d=d+(bw(b,1,a)|0)|0;}}return d|0;}function bw(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;e=i;f=a;a=b;b=d;d=0;if((a|0)!=0){g=c[f+540+(b<<2)>>2]|0;}else{g=c[f+28+(b<<2)>>2]|0;}h=g;if((h|0)==0){j=0;k=j;i=e;return k|0;}g=0;while(1){if((g|0)>=128){break;}do{if((c[h+4+(g<<2)>>2]|0)==-1){c[h+4+(g<<2)>>2]=bB(f,a,b,g)|0;if((c[h+4+(g<<2)>>2]|0)!=0){break;}if((c[(c[h>>2]|0)+(g*28|0)>>2]|0)!=0){l=f;n=c[(c[h>>2]|0)+(g*28|0)>>2]|0;o=(a|0)!=0?1:0;p=c[(c[h>>2]|0)+(g*28|0)+12>>2]|0;q=c[(c[h>>2]|0)+(g*28|0)+8>>2]|0;if((c[(c[h>>2]|0)+(g*28|0)+4>>2]|0)!=-1){r=c[(c[h>>2]|0)+(g*28|0)+4>>2]|0;}else{if((a|0)!=0){s=g;}else{s=-1;}r=s;}if((c[(c[h>>2]|0)+(g*28|0)+16>>2]|0)!=-1){t=c[(c[h>>2]|0)+(g*28|0)+16>>2]|0;}else{t=(a|0)!=0?1:-1;}if((c[(c[h>>2]|0)+(g*28|0)+20>>2]|0)!=-1){u=c[(c[h>>2]|0)+(g*28|0)+20>>2]|0;}else{u=(a|0)!=0?1:-1;}v=bl(l,n,o,p,q,r,t,u,c[(c[h>>2]|0)+(g*28|0)+24>>2]|0)|0;c[h+4+(g<<2)>>2]=v;if((v|0)==0){v=c[m>>2]|0;q=c[(c[h>>2]|0)+(g*28|0)>>2]|0;ar(v|0,5120,(v=i,i=i+8|0,c[v>>2]=q,v)|0)|0;i=v;if((c[f+13136>>2]|0)<256){q=c[m>>2]|0;p=c[f+13136>>2]|0;ar(q|0,4856,(v=i,i=i+8|0,c[v>>2]=p,v)|0)|0;i=v;c[f+13140+(c[f+13136>>2]<<2)>>2]=c[(c[h>>2]|0)+(g*28|0)>>2];v=f+13136|0;c[v>>2]=(c[v>>2]|0)+1;}d=d+1|0;}}else{if((b|0)!=0){if((a|0)!=0){if((c[(c[f+540>>2]|0)+4+(g<<2)>>2]|0)==0){c[(c[f+540>>2]|0)+4+(g<<2)>>2]=-1;}}else{if((c[(c[f+28>>2]|0)+4+(g<<2)>>2]|0)==0){c[(c[f+28>>2]|0)+4+(g<<2)>>2]=-1;}}}c[h+4+(g<<2)>>2]=0;d=d+1|0;}w=246;}else{w=246;}}while(0);if((w|0)==246){w=0;}g=g+1|0;}j=d;k=j;i=e;return k|0;}function bx(a){a=a|0;var b=0,d=0;b=a;a=128;while(1){d=a;a=d-1|0;if((d|0)==0){break;}if((c[b+28+(a<<2)>>2]|0)!=0){by(b,0,a);}if((c[b+540+(a<<2)>>2]|0)!=0){by(b,1,a);}}return;}function by(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=a;a=d;if((b|0)!=0){f=c[e+540+(a<<2)>>2]|0;}else{f=c[e+28+(a<<2)>>2]|0;}a=f;f=0;while(1){if((f|0)>=128){break;}if((c[a+4+(f<<2)>>2]|0)!=0){if((c[a+4+(f<<2)>>2]|0)!=-1){bA(c[a+4+(f<<2)>>2]|0);}c[a+4+(f<<2)>>2]=0;}f=f+1|0;}return;}function bz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=a;a=bl(d,b,0,-1,-1,-1,0,0,0)|0;if((a|0)!=0){c[d+1052>>2]=a;c[d+1056>>2]=-1;e=0;f=e;return f|0;}else{e=-1;f=e;return f|0;}return 0;}function bA(a){a=a|0;var b=0;b=a;if((b|0)==0){return;}a=0;while(1){if((a|0)>=(c[b>>2]|0)){break;}c0(c[(c[b+4>>2]|0)+(a*116|0)+88>>2]|0);a=a+1|0;}c0(c[b+4>>2]|0);c0(b);return;}function bB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=a;a=b;b=d;d=e;if((c[f+24>>2]|0)==0){g=0;h=g;return h|0;}a=(a|0)!=0?-2147483648:0;e=0;L368:while(1){if(e>>>0>=(c[(c[f+24>>2]|0)+4>>2]|0)>>>0){break;}i=(c[(c[f+24>>2]|0)+8>>2]|0)+(e*20|0)|0;do{if((c[(c[i+4>>2]|0)+4>>2]&-2147483648|0)==(a|0)){if(((c[(c[i+4>>2]|0)+4>>2]|0)>>>8&255|0)!=(b|0)){break;}if((c[(c[i+4>>2]|0)+8>>2]|0)==(d|0)){j=295;break L368;}}}while(0);e=e+1|0;}do{if((e|0)==(c[(c[f+24>>2]|0)+4>>2]|0)){if((b|0)!=0){break;}e=0;while(1){if(e>>>0>=(c[(c[f+24>>2]|0)+4>>2]|0)>>>0){break;}i=(c[(c[f+24>>2]|0)+8>>2]|0)+(e*20|0)|0;if((c[(c[i+4>>2]|0)+4>>2]&-2147483648|0)==(a|0)){if((c[(c[i+4>>2]|0)+8>>2]|0)==(d|0)){j=304;break;}}e=e+1|0;}}}while(0);if((e|0)==(c[(c[f+24>>2]|0)+4>>2]|0)){g=0;h=g;return h|0;}j=bi(8)|0;c[j>>2]=c[c[i+4>>2]>>2];c[j+4>>2]=bi((c[j>>2]|0)*116|0)|0;c5(c[j+4>>2]|0,0,(c[j>>2]|0)*116|0|0);e=0;while(1){if(e>>>0>=(c[c[i+4>>2]>>2]|0)>>>0){break;}bC(f,(c[j+4>>2]|0)+(e*116|0)|0,i,e);e=e+1|0;}g=j;h=g;return h|0;}function bC(b,f,h,i){b=b|0;f=f|0;h=h|0;i=i|0;var j=0,k=0,l=0,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>>>0<=0){z=326;break;}if((c[f+16>>2]|0)==0){z=326;break;}m=c[f+12>>2]|0;l=c[f+16>>2]|0;}else{z=326;}}while(0);if((z|0)==326){m=c[h+16>>2]|0;l=c[h+20>>2]|0;}h=bD(c[m+4>>2]|0,l,518)|0;A=+bE(h);h=bD(c[m+4>>2]|0,l,524)|0;B=+bE(h);h=bD(c[m+4>>2]|0,l,519)|0;C=+bE(h);h=bD(c[m+4>>2]|0,l,521)|0;D=+bE(h);h=bD(c[m+4>>2]|0,l,522)|0;z=~~((1.0-+bF(h))*250.0);h=bD(c[m+4>>2]|0,l,4)|0;a[b+111|0]=~~((+bF(h)+0.5)*127.0)&255;c[b+60>>2]=bG(255)|0;c[b+36>>2]=bH(j,255,c[b+12>>2]|0,A)|0;c[b+64>>2]=bG(250)|0;c[b+40>>2]=bH(j,5,c[b+12>>2]|0,B)|0;c[b+68>>2]=bG(z)|0;c[b+44>>2]=bH(j,255-z|0,c[b+12>>2]|0,C)|0;c[b+72>>2]=bG(0)|0;c[b+48>>2]=bH(j,z+5|0,c[b+12>>2]|0,D)|0;c[b+76>>2]=bG(0)|0;c[b+52>>2]=bG(1)|0;c[b+80>>2]=bG(0)|0;c[b+56>>2]=bG(1)|0;z=b+110|0;a[z]=(d[z]|0|64)&255;n=b;o=n+8|0;p=c[o>>2]|0;q=p<<12;c[o>>2]=q;r=b;s=r|0;t=c[s>>2]|0;u=t<<12;c[s>>2]=u;v=b;w=v+4|0;x=c[w>>2]|0;y=x<<12;c[w>>2]=y;return;}function bD(a,b,d){a=a|0;b=b|0;d=d|0;var f=0,g=0,h=0;f=a;a=b;b=d;d=0;g=0;while(1){if(g>>>0>=f>>>0){break;}h=a+(g*12|0)|0;if((e[h+4>>1]|0|0)==(b&65535|0)){do{if((e[h>>1]|0|0)==0){if((e[h+2>>1]|0|0)!=0){break;}if((e[h+6>>1]|0|0)!=0){break;}d=d+(c[h+8>>2]|0)|0;}}while(0);}g=g+1|0;}return d|0;}function bE(a){a=a|0;var b=0,c=0.0,d=0.0;b=a;do{if((b|0)!=-2147483648){if((b|0)==0){break;}c=+P(2.0,+(+((b|0)/65536|0|0)/1200.0))*1.0e3;d=c;return+d;}}while(0);c=0.0;d=c;return+d;}function bF(a){a=a|0;return+(+((a|0)/65536|0|0)/1.0e3);}function bG(a){a=a|0;return a<<22|0;}function bH(a,b,d,e){a=a|0;b=b|0;d=d|0;e=+e;var f=0.0;d=a;a=b;f=e;if(f<6.0){f=6.0;}if((a|0)==0){a=255;}a=a<<22;return~~(+(a|0)/+(c[d+4>>2]|0)*+(c[d+13060>>2]|0)*1.0e3/f)|0;}function bI(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0;f=b;b=e;e=c[f+1724+(b*236|0)+220>>2]|0;if((e|0)>5){a[f+1724+(b*236|0)|0]=0;g=1;h=g;return h|0;}if((a[(c[f+1724+(b*236|0)+4>>2]|0)+110|0]&64|0)!=0){if((d[f+1724+(b*236|0)|0]|0|0)==1){i=361;}else{if((d[f+1724+(b*236|0)|0]|0|0)==2){i=361;}}do{if((i|0)==361){if((e|0)<=2){break;}c[f+1724+(b*236|0)+32>>2]=0;g=0;h=g;return h|0;}}while(0);}c[f+1724+(b*236|0)+220>>2]=e+1;if((c[f+1724+(b*236|0)+24>>2]|0)==(c[(c[f+1724+(b*236|0)+4>>2]|0)+60+(e<<2)>>2]|0)){g=bI(f,b)|0;h=g;return h|0;}c[f+1724+(b*236|0)+28>>2]=c[(c[f+1724+(b*236|0)+4>>2]|0)+60+(e<<2)>>2];c[f+1724+(b*236|0)+32>>2]=c[(c[f+1724+(b*236|0)+4>>2]|0)+36+(e<<2)>>2];if((c[f+1724+(b*236|0)+28>>2]|0)<(c[f+1724+(b*236|0)+24>>2]|0)){c[f+1724+(b*236|0)+32>>2]=-(c[f+1724+(b*236|0)+32>>2]|0);}g=0;h=g;return h|0;}function bJ(b,e){b=b|0;e=e|0;var f=0,i=0.0,j=0,l=0.0;f=b;b=e;i=+g[f+1724+(b*236|0)+68>>2];if((c[f+1724+(b*236|0)+232>>2]|0)!=0){if((c[f+1724+(b*236|0)+48>>2]|0)!=0){i=i*+g[f+1724+(b*236|0)+76>>2];}if((a[(c[f+1724+(b*236|0)+4>>2]|0)+110|0]&64|0)!=0){e=8+(c[f+1724+(b*236|0)+24>>2]>>23<<3)|0;i=i*(c[k>>2]=d[e]|d[e+1|0]<<8|d[e+2|0]<<16|d[e+3|0]<<24,c[k+4>>2]=d[e+4|0]|d[e+5|0]<<8|d[e+6|0]<<16|d[e+7|0]<<24,+h[k>>3]);}j=~~(i*4096.0);if((j|0)>8191){j=8191;}c[f+1724+(b*236|0)+60>>2]=j;return;}l=+g[f+1724+(b*236|0)+72>>2];if((c[f+1724+(b*236|0)+48>>2]|0)!=0){i=i*+g[f+1724+(b*236|0)+76>>2];l=l*+g[f+1724+(b*236|0)+76>>2];}if((a[(c[f+1724+(b*236|0)+4>>2]|0)+110|0]&64|0)!=0){e=8+(c[f+1724+(b*236|0)+24>>2]>>23<<3)|0;i=i*(c[k>>2]=d[e]|d[e+1|0]<<8|d[e+2|0]<<16|d[e+3|0]<<24,c[k+4>>2]=d[e+4|0]|d[e+5|0]<<8|d[e+6|0]<<16|d[e+7|0]<<24,+h[k>>3]);e=8+(c[f+1724+(b*236|0)+24>>2]>>23<<3)|0;l=l*(c[k>>2]=d[e]|d[e+1|0]<<8|d[e+2|0]<<16|d[e+3|0]<<24,c[k+4>>2]=d[e+4|0]|d[e+5|0]<<8|d[e+6|0]<<16|d[e+7|0]<<24,+h[k>>3]);}j=~~(i*4096.0);if((j|0)>8191){j=8191;}e=~~(l*4096.0);if((e|0)>8191){e=8191;}c[f+1724+(b*236|0)+60>>2]=j;c[f+1724+(b*236|0)+64>>2]=e;return;}function bK(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0;h=i;i=i+8|0;j=h|0;k=b;b=e;e=f;c[j>>2]=g;g=k+1724+(e*236|0)|0;if((d[g|0]|0|0)==4){if((c[j>>2]|0)>=20){c[j>>2]=20;}l=cy(k,e,j)|0;bL(k,l,b,e,c[j>>2]|0);a[g|0]=0;i=h;return;}l=cy(k,e,j)|0;if((c[k+8>>2]&1|0)!=0){do{if((c[g+32>>2]|0)!=0){m=402;}else{if((c[g+48>>2]|0)!=0){m=402;break;}bN(k,l,b,e,c[j>>2]|0);}}while(0);if((m|0)==402){bM(k,l,b,e,c[j>>2]|0);}}else{if((c[g+232>>2]|0)==0){do{if((c[g+32>>2]|0)!=0){m=408;}else{if((c[g+48>>2]|0)!=0){m=408;break;}bP(k,l,b,e,c[j>>2]|0);}}while(0);if((m|0)==408){bO(k,l,b,e,c[j>>2]|0);}}else{if((c[g+232>>2]|0)==3){do{if((c[g+32>>2]|0)!=0){m=414;}else{if((c[g+48>>2]|0)!=0){m=414;break;}bR(k,l,b,e,c[j>>2]|0);}}while(0);if((m|0)==414){bQ(k,l,b,e,c[j>>2]|0);}}else{if((c[g+232>>2]|0)==2){b=b+4|0;}do{if((c[g+32>>2]|0)!=0){m=421;}else{if((c[g+48>>2]|0)!=0){m=421;break;}bT(k,l,b,e,c[j>>2]|0);}}while(0);if((m|0)==421){bS(k,l,b,e,c[j>>2]|0);}}}}i=h;return;}function bL(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;h=a;a=d;d=e;e=f;f=g;g=0;if((f|0)==0){f=1;}i=c[h+1724+(e*236|0)+60>>2]|0;j=-((i|0)/(f|0)|0)|0;if((j|0)==0){j=-1;}if((c[h+8>>2]&1|0)!=0){while(1){k=f;f=k-1|0;if((k|0)==0){l=474;break;}i=i+j|0;if((i|0)<0){l=472;break;}k=a;a=k+2|0;g=b[k>>1]|0;k=_(i,g<<16>>16)|0;m=d;d=m+4|0;c[m>>2]=(c[m>>2]|0)+k;}if((l|0)==472){return;}else if((l|0)==474){return;}}if((c[h+1724+(e*236|0)+232>>2]|0)==0){k=c[h+1724+(e*236|0)+64>>2]|0;m=-((k|0)/(f|0)|0)|0;while(1){n=f;f=n-1|0;if((n|0)==0){break;}i=i+j|0;if((i|0)<0){i=0;}k=k+m|0;if((k|0)<0){k=0;}n=a;a=n+2|0;g=b[n>>1]|0;n=_(i,g<<16>>16)|0;o=d;d=o+4|0;c[o>>2]=(c[o>>2]|0)+n;n=_(k,g<<16>>16)|0;o=d;d=o+4|0;c[o>>2]=(c[o>>2]|0)+n;}}else{do{if((c[h+1724+(e*236|0)+232>>2]|0)==3){while(1){k=f;f=k-1|0;if((k|0)==0){l=450;break;}i=i+j|0;if((i|0)<0){break;}k=a;a=k+2|0;g=b[k>>1]|0;k=_(i,g<<16>>16)|0;m=d;d=m+4|0;c[m>>2]=(c[m>>2]|0)+k;k=_(i,g<<16>>16)|0;m=d;d=m+4|0;c[m>>2]=(c[m>>2]|0)+k;}if((l|0)==450){break;}return;}else{do{if((c[h+1724+(e*236|0)+232>>2]|0)==1){while(1){k=f;f=k-1|0;if((k|0)==0){l=457;break;}i=i+j|0;if((i|0)<0){break;}k=a;a=k+2|0;g=b[k>>1]|0;k=_(i,g<<16>>16)|0;m=d;d=m+4|0;c[m>>2]=(c[m>>2]|0)+k;d=d+4|0;}if((l|0)==457){break;}return;}else{do{if((c[h+1724+(e*236|0)+232>>2]|0)==2){while(1){k=f;f=k-1|0;if((k|0)==0){l=464;break;}i=i+j|0;if((i|0)<0){break;}k=a;a=k+2|0;g=b[k>>1]|0;d=d+4|0;k=_(i,g<<16>>16)|0;m=d;d=m+4|0;c[m>>2]=(c[m>>2]|0)+k;}if((l|0)==464){break;}return;}}while(0);}}while(0);}}while(0);}return;}function bM(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0;h=a;a=d;d=e;e=f;f=g;g=h+1724+(e*236|0)|0;i=c[g+60>>2]|0;j=c[g+224>>2]|0;k=j;do{if((j|0)==0){k=c[h+13060>>2]|0;if((bU(h,e)|0)==0){i=c[g+60>>2]|0;break;}return;}}while(0);while(1){if((f|0)==0){l=502;break;}if((k|0)>=(f|0)){l=495;break;}f=f-k|0;while(1){j=k;k=j-1|0;if((j|0)==0){break;}j=a;a=j+2|0;m=b[j>>1]|0;j=_(i,m<<16>>16)|0;n=d;d=n+4|0;c[n>>2]=(c[n>>2]|0)+j;}k=c[h+13060>>2]|0;if((bU(h,e)|0)!=0){l=493;break;}i=c[g+60>>2]|0;}if((l|0)==502){return;}else if((l|0)==493){return;}else if((l|0)==495){c[g+224>>2]=k-f;while(1){k=f;f=k-1|0;if((k|0)==0){break;}k=a;a=k+2|0;m=b[k>>1]|0;k=_(i,m<<16>>16)|0;g=d;d=g+4|0;c[g>>2]=(c[g>>2]|0)+k;}return;}}function bN(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;h=d;d=e;e=g;g=c[a+1724+(f*236|0)+60>>2]|0;while(1){f=e;e=f-1|0;if((f|0)==0){break;}f=h;h=f+2|0;a=_(g,b[f>>1]|0)|0;f=d;d=f+4|0;c[f>>2]=(c[f>>2]|0)+a;}return;}function bO(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;h=a;a=d;d=e;e=f;f=g;g=h+1724+(e*236|0)|0;i=c[g+60>>2]|0;j=c[g+64>>2]|0;k=c[g+224>>2]|0;l=k;do{if((k|0)==0){l=c[h+13060>>2]|0;if((bU(h,e)|0)==0){i=c[g+60>>2]|0;j=c[g+64>>2]|0;break;}return;}}while(0);while(1){if((f|0)==0){m=530;break;}if((l|0)>=(f|0)){m=522;break;}f=f-l|0;while(1){k=l;l=k-1|0;if((k|0)==0){break;}k=a;a=k+2|0;n=b[k>>1]|0;k=_(i,n<<16>>16)|0;o=d;d=o+4|0;c[o>>2]=(c[o>>2]|0)+k;k=_(j,n<<16>>16)|0;o=d;d=o+4|0;c[o>>2]=(c[o>>2]|0)+k;}l=c[h+13060>>2]|0;if((bU(h,e)|0)!=0){m=520;break;}i=c[g+60>>2]|0;j=c[g+64>>2]|0;}if((m|0)==522){c[g+224>>2]=l-f;while(1){l=f;f=l-1|0;if((l|0)==0){break;}l=a;a=l+2|0;n=b[l>>1]|0;l=_(i,n<<16>>16)|0;g=d;d=g+4|0;c[g>>2]=(c[g>>2]|0)+l;l=_(j,n<<16>>16)|0;g=d;d=g+4|0;c[g>>2]=(c[g>>2]|0)+l;}return;}else if((m|0)==520){return;}else if((m|0)==530){return;}}function bP(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;h=a;a=d;d=e;e=f;f=g;g=c[h+1724+(e*236|0)+60>>2]|0;i=c[h+1724+(e*236|0)+64>>2]|0;while(1){e=f;f=e-1|0;if((e|0)==0){break;}e=a;a=e+2|0;h=b[e>>1]|0;e=_(g,h<<16>>16)|0;j=d;d=j+4|0;c[j>>2]=(c[j>>2]|0)+e;e=_(i,h<<16>>16)|0;h=d;d=h+4|0;c[h>>2]=(c[h>>2]|0)+e;}return;}function bQ(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0;h=a;a=d;d=e;e=f;f=g;g=h+1724+(e*236|0)|0;i=c[g+60>>2]|0;j=c[g+224>>2]|0;k=j;do{if((j|0)==0){k=c[h+13060>>2]|0;if((bU(h,e)|0)==0){i=c[g+60>>2]|0;break;}return;}}while(0);while(1){if((f|0)==0){l=556;break;}if((k|0)>=(f|0)){l=549;break;}f=f-k|0;while(1){j=k;k=j-1|0;if((j|0)==0){break;}j=a;a=j+2|0;m=b[j>>1]|0;j=_(i,m<<16>>16)|0;n=d;d=n+4|0;c[n>>2]=(c[n>>2]|0)+j;j=_(i,m<<16>>16)|0;n=d;d=n+4|0;c[n>>2]=(c[n>>2]|0)+j;}k=c[h+13060>>2]|0;if((bU(h,e)|0)!=0){l=547;break;}i=c[g+60>>2]|0;}if((l|0)==549){c[g+224>>2]=k-f;while(1){k=f;f=k-1|0;if((k|0)==0){break;}k=a;a=k+2|0;m=b[k>>1]|0;k=_(i,m<<16>>16)|0;g=d;d=g+4|0;c[g>>2]=(c[g>>2]|0)+k;k=_(i,m<<16>>16)|0;g=d;d=g+4|0;c[g>>2]=(c[g>>2]|0)+k;}return;}else if((l|0)==556){return;}else if((l|0)==547){return;}}function bR(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;h=d;d=e;e=g;g=c[a+1724+(f*236|0)+60>>2]|0;while(1){f=e;e=f-1|0;if((f|0)==0){break;}f=h;h=f+2|0;a=b[f>>1]|0;f=_(g,a<<16>>16)|0;i=d;d=i+4|0;c[i>>2]=(c[i>>2]|0)+f;f=_(g,a<<16>>16)|0;a=d;d=a+4|0;c[a>>2]=(c[a>>2]|0)+f;}return;}function bS(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0;h=a;a=d;d=e;e=f;f=g;g=h+1724+(e*236|0)|0;i=c[g+60>>2]|0;j=c[g+224>>2]|0;k=j;do{if((j|0)==0){k=c[h+13060>>2]|0;if((bU(h,e)|0)==0){i=c[g+60>>2]|0;break;}return;}}while(0);while(1){if((f|0)==0){l=582;break;}if((k|0)>=(f|0)){l=576;break;}f=f-k|0;while(1){j=k;k=j-1|0;if((j|0)==0){break;}j=a;a=j+2|0;m=b[j>>1]|0;j=_(i,m<<16>>16)|0;n=d;d=n+4|0;c[n>>2]=(c[n>>2]|0)+j;d=d+4|0;}k=c[h+13060>>2]|0;if((bU(h,e)|0)!=0){l=574;break;}i=c[g+60>>2]|0;}if((l|0)==582){return;}else if((l|0)==576){c[g+224>>2]=k-f;while(1){k=f;f=k-1|0;if((k|0)==0){break;}k=a;a=k+2|0;m=b[k>>1]|0;k=_(i,m<<16>>16)|0;g=d;d=g+4|0;c[g>>2]=(c[g>>2]|0)+k;d=d+4|0;}return;}else if((l|0)==574){return;}}function bT(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;h=d;d=e;e=g;g=c[a+1724+(f*236|0)+60>>2]|0;while(1){f=e;e=f-1|0;if((f|0)==0){break;}f=h;h=f+2|0;a=_(g,b[f>>1]|0)|0;f=d;d=f+4|0;c[f>>2]=(c[f>>2]|0)+a;d=d+4|0;}return;}function bU(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=a;a=b;do{if((c[d+1724+(a*236|0)+32>>2]|0)!=0){if((bV(d,a)|0)==0){break;}e=1;f=e;return f|0;}}while(0);if((c[d+1724+(a*236|0)+48>>2]|0)!=0){bW(d,a);}bJ(d,a);e=0;f=e;return f|0;}function bV(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=a;a=b;b=d+1724+(a*236|0)+24|0;c[b>>2]=(c[b>>2]|0)+(c[d+1724+(a*236|0)+32>>2]|0);if((c[d+1724+(a*236|0)+32>>2]|0)<0){if((c[d+1724+(a*236|0)+24>>2]|0)<=(c[d+1724+(a*236|0)+28>>2]|0)){e=603;}else{e=601;}}else{e=601;}do{if((e|0)==601){if((c[d+1724+(a*236|0)+32>>2]|0)<=0){break;}if((c[d+1724+(a*236|0)+24>>2]|0)>=(c[d+1724+(a*236|0)+28>>2]|0)){e=603;}}}while(0);do{if((e|0)==603){c[d+1724+(a*236|0)+24>>2]=c[d+1724+(a*236|0)+28>>2];if((bI(d,a)|0)==0){break;}f=1;g=f;return g|0;}}while(0);f=0;g=f;return g|0;}function bW(a,b){a=a|0;b=b|0;var e=0,f=0;e=a;a=b;b=(d[(c[e+1724+(a*236|0)+4>>2]|0)+108|0]|0)<<7;if((c[e+1724+(a*236|0)+36>>2]|0)!=0){f=e+1724+(a*236|0)+40|0;c[f>>2]=(c[f>>2]|0)+(c[e+1724+(a*236|0)+36>>2]|0);if((c[e+1724+(a*236|0)+40>>2]|0)>=65536){c[e+1724+(a*236|0)+36>>2]=0;}else{b=_(b,c[e+1724+(a*236|0)+40>>2]|0)|0;b=b>>16;}}f=e+1724+(a*236|0)+44|0;c[f>>2]=(c[f>>2]|0)+(c[e+1724+(a*236|0)+48>>2]|0);g[e+1724+(a*236|0)+76>>2]=1.0-(+R(+(+(c[e+1724+(a*236|0)+44>>2]>>5|0)*0.006135923151542565))+1.0)*+(b|0)*1.0*762939453125.0e-17;return;}function bX(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=d;d=e;e=b;while(1){b=d;d=b-1|0;if((b|0)==0){break;}b=f;f=b+4|0;g=c[b>>2]>>21;if((g|0)>127){g=127;}else{if((g|0)<-128){g=-128;}}b=e;e=b+1|0;a[b]=g&255;}return;}function bY(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=d;d=e;e=b;while(1){b=d;d=b-1|0;if((b|0)==0){break;}b=f;f=b+4|0;g=c[b>>2]>>21;if((g|0)>127){g=127;}else{if((g|0)<-128){g=-128;}}b=e;e=b+1|0;a[b]=(128^g&255)&255;}return;}function bZ(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0;f=d;d=e;e=a;while(1){a=d;d=a-1|0;if((a|0)==0){break;}a=f;f=a+4|0;g=c[a>>2]>>13;if((g|0)>32767){g=32767;}else{if((g|0)<-32768){g=-32768;}}a=e;e=a+2|0;b[a>>1]=g&65535;}return;}function b_(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0;f=d;d=e;e=a;while(1){a=d;d=a-1|0;if((a|0)==0){break;}a=f;f=a+4|0;g=c[a>>2]>>13;if((g|0)>32767){g=32767;}else{if((g|0)<-32768){g=-32768;}}a=e;e=a+2|0;b[a>>1]=(32768^g&65535)&65535;}return;}function b$(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0;f=d;d=e;e=a;while(1){a=d;d=a-1|0;if((a|0)==0){break;}a=f;f=a+4|0;g=c[a>>2]>>13;if((g|0)>32767){g=32767;}else{if((g|0)<-32768){g=-32768;}}a=e;e=a+2|0;b[a>>1]=(((g&65535)<<16>>16&255)<<8|(g&65535)<<16>>16>>8&255)&65535;}return;}function b0(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=i;i=i+8|0;h=g|0;c[h>>2]=0;a[h+5|0]=1;a[h+4|0]=d&255;a[h+6|0]=e&255;a[h+7|0]=f&255;b1(b,h);i=g;return;}function b1(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0;f=b;b=e;e=c[f+13052>>2]|0;g=-1;h=2147483647;if(0==(b|0)){i=c[f+13080>>2]|0;}else{i=b;}while(1){b=e;e=b-1|0;if((b|0)==0){break;}if((d[f+1724+(e*236|0)|0]|0|0)==0){g=e;}else{do{if((d[f+1724+(e*236|0)+1|0]|0|0)==(d[i+4|0]|0|0)){if((d[f+1724+(e*236|0)+2|0]|0|0)!=(d[i+6|0]|0|0)){if((c[f+1084+((d[f+1724+(e*236|0)+1|0]|0)*40|0)+28>>2]|0)==0){break;}}ch(f,e);}}while(0);}}if((g|0)!=-1){cn(f,i,g);return;}e=c[f+13052>>2]|0;while(1){b=e;e=b-1|0;if((b|0)==0){break;}do{if((d[f+1724+(e*236|0)|0]|0|0)!=1){if((d[f+1724+(e*236|0)|0]|0|0)==4){break;}b=c[f+1724+(e*236|0)+60>>2]|0;do{if((c[f+1724+(e*236|0)+232>>2]|0)==0){if((c[f+1724+(e*236|0)+64>>2]|0)<=(b|0)){break;}b=c[f+1724+(e*236|0)+64>>2]|0;}}while(0);if((b|0)<(h|0)){h=b;g=e;}}}while(0);}if((g|0)!=-1){e=f+13068|0;c[e>>2]=(c[e>>2]|0)+1;a[f+1724+(g*236|0)|0]=0;cn(f,i,g);return;}else{g=f+13064|0;c[g>>2]=(c[g>>2]|0)+1;return;}}function b2(b,e){b=b|0;e=e|0;var f=0,g=0,h=0;f=b;b=e;e=c[f+13052>>2]|0;if(0==(b|0)){g=c[f+13080>>2]|0;}else{g=b;}L890:while(1){b=e;e=b-1|0;if((b|0)==0){h=709;break;}do{if((d[f+1724+(e*236|0)|0]|0|0)==1){if((d[f+1724+(e*236|0)+1|0]|0|0)!=(d[g+4|0]|0|0)){break;}if((d[f+1724+(e*236|0)+2|0]|0|0)==(d[g+6|0]|0|0)){break L890;}}}while(0);}if((h|0)==709){return;}if((c[f+1084+((d[g+4|0]|0)*40|0)+12>>2]|0)!=0){a[f+1724+(e*236|0)|0]=2;}else{ci(f,e);}return;}function b3(a){a=a|0;var b=0;b=a;c[b>>2]=1;b4(b);b5(b,0);return;}function b4(a){a=a|0;var b=0;b=a;g[b+16>>2]=+(c[b+20>>2]|0)/100.0;return;}function b5(a,b){a=a|0;b=b|0;var d=0;d=a;a=b;if((c[d+13088>>2]|0)>(a|0)){c[d+13088>>2]=0;}ck(d);c[d+13080>>2]=c[d+13076>>2];c[392]=5e5;if((a|0)==0){return;}cl(d,a);return;}function b6(b,e,f,h){b=b|0;e=e|0;f=f|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0;j=i;i=i+8|0;k=j|0;l=b;c[k>>2]=e;e=h;if((c[l>>2]|0)==0){m=0;n=m;i=j;return n|0;}h=(f>>>0)/((c[l+12>>2]|0)>>>0)|0;f=c[l+13088>>2]|0;b=(c[l+13088>>2]|0)+h|0;L920:while(1){if((c[l+13088>>2]|0)>=(b|0)){o=758;break;}while(1){if(~~(+(c[c[l+13080>>2]>>2]|0)/+g[258])>>>0>(c[l+13088>>2]|0)>>>0){break;}switch(d[(c[l+13080>>2]|0)+5|0]|0){case 99:{if(0==(e|0)){o=752;break L920;}break;}case 6:{c[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)+12>>2]=d[(c[l+13080>>2]|0)+6|0]|0;if((a[(c[l+13080>>2]|0)+6|0]|0)==0){ca(l);}break;}case 3:{b7(l);break;}case 11:{c[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)+32>>2]=d[(c[l+13080>>2]|0)+6|0]|0;g[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)+36>>2]=0.0;break;}case 14:{cc(l);break;}case 12:{cd(l);break;}case 13:{cb(l,d[(c[l+13080>>2]|0)+4|0]|0);break;}case 9:{if((c[l+13056>>2]&1<>2]|0)+4|0]|0)!=0){c[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)>>2]=d[(c[l+13080>>2]|0)+6|0]|0;}else{c[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)+4>>2]=d[(c[l+13080>>2]|0)+6|0]|0;}break;}case 5:{c[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)+16>>2]=d[(c[l+13080>>2]|0)+6|0]|0;break;}case 7:{c[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)+24>>2]=d[(c[l+13080>>2]|0)+6|0]|0;b9(l);break;}case 1:{if((a[(c[l+13080>>2]|0)+7|0]|0)!=0){b1(l,0);}else{b2(l,0);}break;}case 15:{c[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)>>2]=d[(c[l+13080>>2]|0)+6|0]|0;break;}case 10:{c[392]=(d[(c[l+13080>>2]|0)+4|0]|0)+(d[(c[l+13080>>2]|0)+7|0]<<8)+(d[(c[l+13080>>2]|0)+6|0]<<16);break;}case 8:{c[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)+20>>2]=(d[(c[l+13080>>2]|0)+6|0]|0)+(d[(c[l+13080>>2]|0)+7|0]<<7);g[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)+36>>2]=0.0;b8(l);break;}case 4:{c[l+1084+((d[(c[l+13080>>2]|0)+4|0]|0)*40|0)+8>>2]=d[(c[l+13080>>2]|0)+6|0]|0;b9(l);break;}case 2:{b2(l,0);break;}default:{}}p=l+13080|0;c[p>>2]=(c[p>>2]|0)+8;}if(~~(+(c[c[l+13080>>2]>>2]|0)/+g[258])>>>0>b>>>0){ce(l,k,b-(c[l+13088>>2]|0)|0);}else{ce(l,k,~~(+(c[c[l+13080>>2]>>2]|0)/+g[258])-(c[l+13088>>2]|0)|0);}}if((o|0)==752){c[l>>2]=0;m=_((c[l+13088>>2]|0)-f|0,c[l+12>>2]|0)|0;n=m;i=j;return n|0;}else if((o|0)==758){m=_(h,c[l+12>>2]|0)|0;n=m;i=j;return n|0;}return 0;}function b7(b){b=b|0;var e=0,f=0,g=0,h=0;e=b;b=c[e+13080>>2]|0;f=c[e+13052>>2]|0;L967:while(1){g=f;f=g-1|0;if((g|0)==0){h=772;break;}do{if((d[e+1724+(f*236|0)|0]|0|0)==1){if((d[e+1724+(f*236|0)+1|0]|0|0)!=(d[b+4|0]|0|0)){break;}if((d[e+1724+(f*236|0)+2|0]|0|0)==(d[b+6|0]|0|0)){break L967;}}}while(0);}if((h|0)==772){return;}a[e+1724+(f*236|0)+3|0]=a[b+7|0]|0;cf(e,f);bJ(e,f);return;}function b8(a){a=a|0;var b=0,e=0,f=0;b=a;a=d[(c[b+13080>>2]|0)+4|0]|0;e=c[b+13052>>2]|0;while(1){f=e;e=f-1|0;if((f|0)==0){break;}do{if((d[b+1724+(e*236|0)|0]|0|0)!=0){if((d[b+1724+(e*236|0)+1|0]|0|0)!=(a|0)){break;}cj(b,e);}}while(0);}return;}function b9(a){a=a|0;var b=0,e=0,f=0;b=a;a=d[(c[b+13080>>2]|0)+4|0]|0;e=c[b+13052>>2]|0;while(1){f=e;e=f-1|0;if((f|0)==0){break;}do{if((d[b+1724+(e*236|0)+1|0]|0|0)==(a|0)){if((d[b+1724+(e*236|0)|0]|0|0)!=1){if((d[b+1724+(e*236|0)|0]|0|0)!=2){break;}}cf(b,e);bJ(b,e);}}while(0);}return;}function ca(a){a=a|0;var b=0,e=0,f=0;b=a;a=c[b+13052>>2]|0;e=d[(c[b+13080>>2]|0)+4|0]|0;while(1){f=a;a=f-1|0;if((f|0)==0){break;}do{if((d[b+1724+(a*236|0)|0]|0|0)==2){if((d[b+1724+(a*236|0)+1|0]|0|0)!=(e|0)){break;}ci(b,a);}}while(0);}return;}function cb(a,b){a=a|0;b=b|0;var d=0;d=a;a=b;c[d+1084+(a*40|0)+8>>2]=90;c[d+1084+(a*40|0)+24>>2]=127;c[d+1084+(a*40|0)+12>>2]=0;c[d+1084+(a*40|0)+20>>2]=8192;g[d+1084+(a*40|0)+36>>2]=0.0;return;}function cc(b){b=b|0;var e=0,f=0,g=0;e=b;b=c[e+13052>>2]|0;f=d[(c[e+13080>>2]|0)+4|0]|0;while(1){g=b;b=g-1|0;if((g|0)==0){break;}do{if((d[e+1724+(b*236|0)|0]|0|0)==1){if((d[e+1724+(b*236|0)+1|0]|0|0)!=(f|0)){break;}if((c[e+1084+(f*40|0)+12>>2]|0)!=0){a[e+1724+(b*236|0)|0]=2;}else{ci(e,b);}}}while(0);}return;}function cd(a){a=a|0;var b=0,e=0,f=0;b=a;a=c[b+13052>>2]|0;e=d[(c[b+13080>>2]|0)+4|0]|0;while(1){f=a;a=f-1|0;if((f|0)==0){break;}do{if((d[b+1724+(a*236|0)+1|0]|0|0)==(e|0)){if((d[b+1724+(a*236|0)|0]|0|0)==0){break;}if((d[b+1724+(a*236|0)|0]|0|0)==4){break;}ch(b,a);}}while(0);}return;}function ce(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=a;a=b;b=d;if((c[e+8>>2]&1|0)!=0){f=1;}else{f=2;}while(1){if((b|0)==0){break;}d=b;if((d|0)>(c[e+1064>>2]|0)){d=c[e+1064>>2]|0;}cg(e,d);g=c[e+1060>>2]|0;h=c[a>>2]|0;i=c[e+1072>>2]|0;j=_(f,d)|0;aZ[g&15](h,i,j);j=_(c[e+12>>2]|0,d)|0;i=a;c[i>>2]=(c[i>>2]|0)+j;b=b-d|0;}return;}function cf(a,b){a=a|0;b=b|0;var e=0,f=0,h=0;e=a;a=b;b=_(d[e+1724+(a*236|0)+3|0]|0,c[e+1084+((d[e+1724+(a*236|0)+1|0]|0)*40|0)+8>>2]|0)|0;f=_(b,c[e+1084+((d[e+1724+(a*236|0)+1|0]|0)*40|0)+24>>2]|0)|0;if((c[e+8>>2]&1|0)!=0){c[e+1724+(a*236|0)+232>>2]=3;g[e+1724+(a*236|0)+68>>2]=+(f|0)*+g[(c[e+1724+(a*236|0)+4>>2]|0)+84>>2]*+g[e+16>>2]*4.76837158203125e-7;return;}do{if((c[e+1724+(a*236|0)+228>>2]|0)>60){if((c[e+1724+(a*236|0)+228>>2]|0)>=68){h=827;break;}c[e+1724+(a*236|0)+232>>2]=3;g[e+1724+(a*236|0)+68>>2]=+(f|0)*+g[(c[e+1724+(a*236|0)+4>>2]|0)+84>>2]*+g[e+16>>2]*4.76837158203125e-7;}else{h=827;}}while(0);if((h|0)==827){if((c[e+1724+(a*236|0)+228>>2]|0)<5){c[e+1724+(a*236|0)+232>>2]=1;g[e+1724+(a*236|0)+68>>2]=+(f|0)*+g[(c[e+1724+(a*236|0)+4>>2]|0)+84>>2]*+g[e+16>>2]*9.5367431640625e-7;}else{if((c[e+1724+(a*236|0)+228>>2]|0)>123){c[e+1724+(a*236|0)+232>>2]=2;g[e+1724+(a*236|0)+68>>2]=+(f|0)*+g[(c[e+1724+(a*236|0)+4>>2]|0)+84>>2]*+g[e+16>>2]*9.5367431640625e-7;}else{c[e+1724+(a*236|0)+232>>2]=0;g[e+1724+(a*236|0)+68>>2]=+(f|0)*+g[(c[e+1724+(a*236|0)+4>>2]|0)+84>>2]*+g[e+16>>2]*7.450580596923828e-9;g[e+1724+(a*236|0)+72>>2]=+g[e+1724+(a*236|0)+68>>2]*+(c[e+1724+(a*236|0)+228>>2]|0);f=e+1724+(a*236|0)+68|0;g[f>>2]=+g[f>>2]*+(127-(c[e+1724+(a*236|0)+228>>2]|0)|0);}}}return;}function cg(a,b){a=a|0;b=b|0;var e=0,f=0;e=a;a=b;if((c[e+8>>2]&1|0)!=0){f=a<<2;}else{f=a<<3;}c5(c[e+1072>>2]|0,0,f|0);f=0;while(1){if((f|0)>=(c[e+13052>>2]|0)){break;}if((d[e+1724+(f*236|0)|0]|0|0)!=0){bK(e,c[e+1072>>2]|0,f,a);}f=f+1|0;}f=e+13088|0;c[f>>2]=(c[f>>2]|0)+a;return;}function ch(b,c){b=b|0;c=c|0;a[b+1724+(c*236|0)|0]=4;return;}function ci(b,d){b=b|0;d=d|0;var e=0,f=0;e=b;b=d;if((a[(c[e+1724+(b*236|0)+4>>2]|0)+110|0]&64|0)!=0){c[e+1724+(b*236|0)+220>>2]=3;a[e+1724+(b*236|0)|0]=3;d=e;f=b;bI(d,f)|0;bJ(e,b);return;}else{a[e+1724+(b*236|0)|0]=3;return;}}function cj(a,b){a=a|0;b=b|0;var e=0,f=0,i=0,j=0,l=0,m=0.0;e=a;a=b;b=(c[e+1724+(a*236|0)+20>>2]|0)<0|0;f=c[e+1084+((d[e+1724+(a*236|0)+1|0]|0)*40|0)+20>>2]|0;if((c[(c[e+1724+(a*236|0)+4>>2]|0)+12>>2]|0)==0){return;}if((c[e+1724+(a*236|0)+212>>2]|0)!=0){i=32;while(1){j=i;i=j-1|0;if((j|0)==0){break;}c[e+1724+(a*236|0)+80+(i<<2)>>2]=0;}}do{if((f|0)==8192){l=866;}else{if((f|0)<0){l=866;break;}if((f|0)>16383){l=866;break;}f=f-8192|0;if(+g[e+1084+((d[e+1724+(a*236|0)+1|0]|0)*40|0)+36>>2]==0.0){i=_(f,c[e+1084+((d[e+1724+(a*236|0)+1|0]|0)*40|0)+32>>2]|0)|0;if((f|0)<0){i=-i|0;}j=1704+((i>>5&255)<<3)|0;m=(c[k>>2]=d[j]|d[j+1|0]<<8|d[j+2|0]<<16|d[j+3|0]<<24,c[k+4>>2]=d[j+4|0]|d[j+5|0]<<8|d[j+6|0]<<16|d[j+7|0]<<24,+h[k>>3]);j=3752+(i>>13<<3)|0;g[e+1084+((d[e+1724+(a*236|0)+1|0]|0)*40|0)+36>>2]=m*(c[k>>2]=d[j]|d[j+1|0]<<8|d[j+2|0]<<16|d[j+3|0]<<24,c[k+4>>2]=d[j+4|0]|d[j+5|0]<<8|d[j+6|0]<<16|d[j+7|0]<<24,+h[k>>3]);}if((f|0)>0){c[e+1724+(a*236|0)+12>>2]=~~(+g[e+1084+((d[e+1724+(a*236|0)+1|0]|0)*40|0)+36>>2]*+(c[e+1724+(a*236|0)+8>>2]|0));}else{c[e+1724+(a*236|0)+12>>2]=~~(+(c[e+1724+(a*236|0)+8>>2]|0)/+g[e+1084+((d[e+1724+(a*236|0)+1|0]|0)*40|0)+36>>2]);}}}while(0);if((l|0)==866){c[e+1724+(a*236|0)+12>>2]=c[e+1724+(a*236|0)+8>>2];}m=+(c[(c[e+1724+(a*236|0)+4>>2]|0)+12>>2]|0)*+(c[e+1724+(a*236|0)+12>>2]|0)/(+(c[(c[e+1724+(a*236|0)+4>>2]|0)+32>>2]|0)*+(c[e+4>>2]|0))*4096.0;if((b|0)!=0){m=-0.0-m;}c[e+1724+(a*236|0)+20>>2]=~~m;return;}function ck(a){a=a|0;var b=0;b=a;a=0;while(1){if((a|0)>=16){break;}cb(b,a);c[b+1084+(a*40|0)+4>>2]=c[b+1056>>2];c[b+1084+(a*40|0)+16>>2]=-1;c[b+1084+(a*40|0)+32>>2]=2;c[b+1084+(a*40|0)>>2]=0;a=a+1|0;}cm(b);return;}function cl(a,b){a=a|0;b=b|0;var e=0,f=0;e=a;a=b;cm(e);L1123:while(1){if(+(c[c[e+13080>>2]>>2]|0)/+g[258]>=+(a|0)){break;}switch(d[(c[e+13080>>2]|0)+5|0]|0|0){case 7:{c[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)+24>>2]=d[(c[e+13080>>2]|0)+6|0]|0;break;}case 13:{cb(e,d[(c[e+13080>>2]|0)+4|0]|0);break;}case 4:{c[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)+8>>2]=d[(c[e+13080>>2]|0)+6|0]|0;break;}case 11:{c[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)+32>>2]=d[(c[e+13080>>2]|0)+6|0]|0;g[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)+36>>2]=0.0;break;}case 99:{f=902;break L1123;break;}case 9:{if((c[e+13056>>2]&1<<(d[(c[e+13080>>2]|0)+4|0]|0)|0)!=0){c[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)>>2]=d[(c[e+13080>>2]|0)+6|0]|0;}else{c[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)+4>>2]=d[(c[e+13080>>2]|0)+6|0]|0;}break;}case 8:{c[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)+20>>2]=(d[(c[e+13080>>2]|0)+6|0]|0)+((d[(c[e+13080>>2]|0)+7|0]|0)<<7);g[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)+36>>2]=0.0;break;}case 15:{c[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)>>2]=d[(c[e+13080>>2]|0)+6|0]|0;break;}case 10:{c[392]=(d[(c[e+13080>>2]|0)+4|0]|0)+((d[(c[e+13080>>2]|0)+7|0]|0)<<8)+((d[(c[e+13080>>2]|0)+6|0]|0)<<16);break;}case 5:{c[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)+16>>2]=d[(c[e+13080>>2]|0)+6|0]|0;break;}case 6:{c[e+1084+((d[(c[e+13080>>2]|0)+4|0]|0)*40|0)+12>>2]=d[(c[e+13080>>2]|0)+6|0]|0;break;}default:{}}b=e+13080|0;c[b>>2]=(c[b>>2]|0)+8;}if((f|0)==902){c[e+13088>>2]=~~(+(c[c[e+13080>>2]>>2]|0)/+g[258]);return;}if((c[e+13080>>2]|0)!=(c[e+13076>>2]|0)){f=e+13080|0;c[f>>2]=(c[f>>2]|0)-8;}c[e+13088>>2]=a;return;}function cm(b){b=b|0;var c=0;c=b;b=0;while(1){if((b|0)>=48){break;}a[c+1724+(b*236|0)|0]=0;b=b+1|0;}return;}function cn(b,e,f){b=b|0;e=e|0;f=f|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=b;b=e;e=f;if((c[h+13056>>2]&1<>2]<<2)>>2]|0)+4+(d[b+6|0]<<2)>>2]|0;i=f;do{if((f|0)==0){j=c[(c[h+540>>2]|0)+4+(d[b+6|0]<<2)>>2]|0;i=j;if((j|0)!=0){break;}return;}}while(0);(c[i>>2]|0)!=1;if((a[(c[i+4>>2]|0)+112|0]|0)!=0){f=1056+(a[(c[i+4>>2]|0)+112|0]<<2)|0;c[h+1724+(e*236|0)+8>>2]=d[f]|d[f+1|0]<<8|d[f+2|0]<<16|d[f+3|0]<<24;}else{f=1056+((a[b+6|0]&127)<<2)|0;c[h+1724+(e*236|0)+8>>2]=d[f]|d[f+1|0]<<8|d[f+2|0]<<16|d[f+3|0]<<24;}c[h+1724+(e*236|0)+4>>2]=c[i+4>>2];}else{if(-1!=(c[1640+(d[b+4|0]<<2)>>2]|0)){f=c[h+28+(c[h+1084+((d[b+4|0]|0)*40|0)>>2]<<2)>>2]|0;j=c[1640+(d[b+4|0]<<2)>>2]|0;if(0==(c[f+4+(j<<2)>>2]|0)){k=0;l=h;m=c[(c[f>>2]|0)+(j*28|0)>>2]|0;n=(k|0)!=0?1:0;o=c[(c[f>>2]|0)+(j*28|0)+12>>2]|0;p=c[(c[f>>2]|0)+(j*28|0)+8>>2]|0;if((c[(c[f>>2]|0)+(j*28|0)+4>>2]|0)!=-1){q=c[(c[f>>2]|0)+(j*28|0)+4>>2]|0;}else{if((k|0)!=0){r=j;}else{r=-1;}q=r;}if((c[(c[f>>2]|0)+(j*28|0)+16>>2]|0)!=-1){s=c[(c[f>>2]|0)+(j*28|0)+16>>2]|0;}else{s=(k|0)!=0?1:-1;}if((c[(c[f>>2]|0)+(j*28|0)+20>>2]|0)!=-1){t=c[(c[f>>2]|0)+(j*28|0)+20>>2]|0;}else{t=(k|0)!=0?1:-1;}c[f+4+(j<<2)>>2]=bl(l,m,n,o,p,q,s,t,c[(c[f>>2]|0)+(j*28|0)+24>>2]|0)|0;}i=c[f+4+(j<<2)>>2]|0;}else{if((c[h+1084+((d[b+4|0]|0)*40|0)+4>>2]|0)==-1){i=c[h+1052>>2]|0;}else{j=c[(c[h+28+(c[h+1084+((d[b+4|0]|0)*40|0)>>2]<<2)>>2]|0)+4+(c[h+1084+((d[b+4|0]|0)*40|0)+4>>2]<<2)>>2]|0;i=j;do{if((j|0)==0){f=c[(c[h+28>>2]|0)+4+(c[h+1084+((d[b+4|0]|0)*40|0)+4>>2]<<2)>>2]|0;i=f;if((f|0)!=0){break;}return;}}while(0);}}if((a[(c[i+4>>2]|0)+112|0]|0)!=0){j=1056+(a[(c[i+4>>2]|0)+112|0]<<2)|0;c[h+1724+(e*236|0)+8>>2]=d[j]|d[j+1|0]<<8|d[j+2|0]<<16|d[j+3|0]<<24;}else{j=1056+(((d[b+6|0]|0)+(c[1662]|0)&127)<<2)|0;c[h+1724+(e*236|0)+8>>2]=d[j]|d[j+1|0]<<8|d[j+2|0]<<16|d[j+3|0]<<24;}c[h+1724+(e*236|0)+8>>2]=~~(+(c[h+1724+(e*236|0)+8>>2]|0)*+g[260]/440.0);co(h,e,i,d[b+7|0]|0);}a[h+1724+(e*236|0)|0]=1;a[h+1724+(e*236|0)+1|0]=a[b+4|0]|0;a[h+1724+(e*236|0)+2|0]=a[b+6|0]|0;a[h+1724+(e*236|0)+3|0]=cp(a[b+7|0]|0,+g[1576+(d[b+4|0]<<2)>>2])|0;c[h+1724+(e*236|0)+16>>2]=0;c[h+1724+(e*236|0)+20>>2]=0;c[h+1724+(e*236|0)+44>>2]=0;c[h+1724+(e*236|0)+48>>2]=c[(c[h+1724+(e*236|0)+4>>2]|0)+96>>2];c[h+1724+(e*236|0)+36>>2]=c[(c[h+1724+(e*236|0)+4>>2]|0)+92>>2];c[h+1724+(e*236|0)+40>>2]=0;c[h+1724+(e*236|0)+52>>2]=c[(c[h+1724+(e*236|0)+4>>2]|0)+100>>2];c[h+1724+(e*236|0)+56>>2]=0;c[h+1724+(e*236|0)+212>>2]=c[(c[h+1724+(e*236|0)+4>>2]|0)+104>>2];c[h+1724+(e*236|0)+208>>2]=0;c[h+1724+(e*236|0)+216>>2]=0;i=0;while(1){if((i|0)>=32){break;}c[h+1724+(e*236|0)+80+(i<<2)>>2]=0;i=i+1|0;}if((c[h+1084+((d[b+4|0]|0)*40|0)+16>>2]|0)!=-1){c[h+1724+(e*236|0)+228>>2]=c[h+1084+((d[b+4|0]|0)*40|0)+16>>2];}else{c[h+1724+(e*236|0)+228>>2]=a[(c[h+1724+(e*236|0)+4>>2]|0)+111|0]|0;}cj(h,e);cf(h,e);if((a[(c[h+1724+(e*236|0)+4>>2]|0)+110|0]&64|0)!=0){c[h+1724+(e*236|0)+220>>2]=0;c[h+1724+(e*236|0)+24>>2]=0;c[h+1724+(e*236|0)+224>>2]=0;b=h;i=e;bI(b,i)|0;bJ(h,e);return;}else{c[h+1724+(e*236|0)+32>>2]=0;bJ(h,e);return;}}function co(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=a;a=b;b=d;d=e;e=c[b>>2]|0;g=c[b+4>>2]|0;if((e|0)==1){c[f+1724+(a*236|0)+4>>2]=g;return;}h=c[f+1724+(a*236|0)+8>>2]|0;i=0;L1232:while(1){if((i|0)>=(e|0)){break;}do{if((c[g+16>>2]|0)<=(d|0)){if((c[g+20>>2]|0)<(d|0)){break;}if((c[g+24>>2]|0)>(h|0)){break;}if((c[g+28>>2]|0)>=(h|0)){j=977;break L1232;}}}while(0);g=g+116|0;i=i+1|0;}if((j|0)==977){c[f+1724+(a*236|0)+4>>2]=g;return;}j=2147483647;d=c[b+4>>2]|0;g=d;b=d;i=0;while(1){if((i|0)>=(e|0)){break;}d=(c[g+32>>2]|0)-h|0;if((d|0)<0){d=-d|0;}if((d|0)<(j|0)){j=d;b=g;}g=g+116|0;i=i+1|0;}c[f+1724+(a*236|0)+4>>2]=b;return;}function cp(a,b){a=a|0;b=+b;var d=0,e=0,f=0.0,g=0,h=0,j=0,k=0;d=i;e=a;f=b;if(f<=1.0){g=~~(+(e&255|0)*f);h=g;i=d;return h|0;}else{a=(e&255)+(~~(+(127-(e&255)|0)*(f-1.0))&255)&255;j=e&255;e=a&255;aG(4784,(k=i,i=i+16|0,c[k>>2]=j,c[k+8>>2]=e,k)|0)|0;i=k;g=a;h=g;i=d;return h|0;}return 0;}function cq(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;h=i;i=i+40|0;j=h|0;k=h+8|0;l=h+16|0;m=h+24|0;n=h+32|0;o=d;d=e;e=f;f=g;c[d+13092>>2]=0;c[d+13096>>2]=0;c[d+13084>>2]=0;do{if((cP(o,n|0,1,4)|0)==4){if((cP(o,j,4,1)|0)!=1){break;}c[j>>2]=(c[j>>2]&255)<<24|(c[j>>2]&65280)<<8|(c[j>>2]&16711680)>>8|c[j>>2]>>24&255;do{if((c4(n|0,4776,4)|0)==0){if((c[j>>2]|0)<6){break;}g=o;p=k;cP(g,p,2,1)|0;p=o;g=l;cP(p,g,2,1)|0;g=o;p=m;cP(g,p,2,1)|0;b[k>>1]=((b[k>>1]&255)<<8|b[k>>1]>>8&255)&65535;b[l>>1]=((b[l>>1]&255)<<8|b[l>>1]>>8&255)&65535;b[m>>1]=((b[m>>1]&255)<<8|b[m>>1]>>8&255)&65535;if((b[m>>1]|0)<0){q=_(-((b[m>>1]|0)/256|0)|0,b[m>>1]&255)|0;}else{q=b[m>>1]|0;}if((c[j>>2]|0)>6){cQ(o,(c[j>>2]|0)-6|0);}do{if((b[k>>1]|0)>=0){if((b[k>>1]|0)>2){break;}c[d+13084>>2]=bi(12)|0;c[c[d+13084>>2]>>2]=0;a[(c[d+13084>>2]|0)+5|0]=0;c[(c[d+13084>>2]|0)+8>>2]=0;p=d+13092|0;c[p>>2]=(c[p>>2]|0)+1;p=b[k>>1]|0;do{if((p|0)==1){r=0;while(1){if((r|0)>=(b[l>>1]|0)){s=1023;break;}if((cr(o,d,0)|0)!=0){break;}r=r+1|0;}if((s|0)==1023){break;}cs(d);t=0;u=t;i=h;return u|0;}else if((p|0)==2){r=0;while(1){if((r|0)>=(b[l>>1]|0)){s=1030;break;}if((cr(o,d,1)|0)!=0){break;}r=r+1|0;}if((s|0)==1030){break;}cs(d);t=0;u=t;i=h;return u|0;}else if((p|0)==0){if((cr(o,d,0)|0)==0){break;}cs(d);t=0;u=t;i=h;return u|0;}}while(0);t=ct(d,q,e,f)|0;u=t;i=h;return u|0;}}while(0);t=0;u=t;i=h;return u|0;}}while(0);t=0;u=t;i=h;return u|0;}}while(0);t=0;u=t;i=h;return u|0;}function cr(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;e=i;i=i+16|0;f=e|0;g=e+8|0;h=a;a=b;b=c[a+13084>>2]|0;do{if((d|0)!=0){if((b|0)==0){j=1047;break;}while(1){if((c[b+8>>2]|0)==0){break;}b=c[b+8>>2]|0;}c[a+13096>>2]=c[b>>2];}else{j=1047;}}while(0);if((j|0)==1047){c[a+13096>>2]=0;}do{if((cP(h,g|0,1,4)|0)==4){if((cP(h,f,4,1)|0)!=1){break;}c[f>>2]=(c[f>>2]&255)<<24|(c[f>>2]&65280)<<8|(c[f>>2]&16711680)>>8|c[f>>2]>>24&255;if((c4(g|0,6272,4)|0)!=0){k=-2;l=k;i=e;return l|0;}while(1){d=cv(h,a)|0;m=d;if((d|0)==0){j=1055;break;}if((m|0)==-1){j=1057;break;}d=c[b+8>>2]|0;while(1){if((d|0)!=0){n=(c[d>>2]|0)<(c[m>>2]|0);}else{n=0;}if(!n){break;}b=d;d=c[b+8>>2]|0;}c[m+8>>2]=d;c[b+8>>2]=m;o=a+13092|0;c[o>>2]=(c[o>>2]|0)+1;b=m;}if((j|0)==1055){k=-2;l=k;i=e;return l|0;}else if((j|0)==1057){k=0;l=k;i=e;return l|0;}}}while(0);k=-1;l=k;i=e;return l|0;}function cs(a){a=a|0;var b=0,d=0;b=a;a=c[b+13084>>2]|0;d=a;if((a|0)==0){return;}while(1){if((d|0)==0){break;}a=c[d+8>>2]|0;c0(d);d=a;}c[b+13084>>2]=0;return;}function ct(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;h=i;i=i+192|0;j=h|0;k=h+64|0;l=h+128|0;m=b;b=e;e=f;f=g;g=0;while(1){if((g|0)>=16){break;}c[j+(g<<2)>>2]=0;c[k+(g<<2)>>2]=0;c[l+(g<<2)>>2]=c[m+1056>>2];g=g+1|0;}n=5e5;cu(m,n,b);o=bi((c[m+13092>>2]|0)+1<<3)|0;p=o;q=o;o=c[m+13084>>2]|0;r=0;s=0;t=0;u=0;v=0;g=0;while(1){if((g|0)>=(c[m+13092>>2]|0)){break;}w=0;x=d[o+5|0]|0;do{if((x|0)==9){if((c[m+13056>>2]&1<<(d[o+4|0]|0)|0)!=0){if((c[m+540+((d[o+6|0]|0)<<2)>>2]|0)!=0){y=d[o+6|0]|0;}else{a[o+6|0]=0;y=0;}if((c[k+((d[o+4|0]|0)<<2)>>2]|0)!=(y|0)){c[k+((d[o+4|0]|0)<<2)>>2]=y;}else{w=1;}}else{y=d[o+6|0]|0;do{if((c[l+((d[o+4|0]|0)<<2)>>2]|0)!=-1){if((c[l+((d[o+4|0]|0)<<2)>>2]|0)==(y|0)){z=1096;break;}c[l+((d[o+4|0]|0)<<2)>>2]=y;}else{z=1096;}}while(0);if((z|0)==1096){z=0;w=1;}}}else if((x|0)==15){if((c[m+13056>>2]&1<<(d[o+4|0]|0)|0)!=0){w=1;break;}if((c[m+28+((d[o+6|0]|0)<<2)>>2]|0)!=0){y=d[o+6|0]|0;}else{a[o+6|0]=0;y=0;}if((c[j+((d[o+4|0]|0)<<2)>>2]|0)!=(y|0)){c[j+((d[o+4|0]|0)<<2)>>2]=y;}else{w=1;}}else if((x|0)==1){if((v|0)!=0){v=1;}if((c[m+13056>>2]&1<<(d[o+4|0]|0)|0)!=0){if((c[(c[m+540+(c[k+((d[o+4|0]|0)<<2)>>2]<<2)>>2]|0)+4+((d[o+6|0]|0)<<2)>>2]|0)==0){c[(c[m+540+(c[k+((d[o+4|0]|0)<<2)>>2]<<2)>>2]|0)+4+((d[o+6|0]|0)<<2)>>2]=-1;}}else{if((c[l+((d[o+4|0]|0)<<2)>>2]|0)==-1){break;}if((c[(c[m+28+(c[j+((d[o+4|0]|0)<<2)>>2]<<2)>>2]|0)+4+(c[l+((d[o+4|0]|0)<<2)>>2]<<2)>>2]|0)==0){c[(c[m+28+(c[j+((d[o+4|0]|0)<<2)>>2]<<2)>>2]|0)+4+(c[l+((d[o+4|0]|0)<<2)>>2]<<2)>>2]=-1;}}}}while(0);x=(c[o>>2]|0)-t|0;A=x;do{if((x|0)!=0){if((v|0)!=0){z=1125;break;}B=_(c[m+1076>>2]|0,A)|0;s=s+(_(c[m+1080>>2]|0,A)|0)|0;if((s&-65536|0)!=0){B=B+(s>>16&65535)|0;s=s&65535;}u=u+B|0;}else{z=1125;}}while(0);if((z|0)==1125){z=0;if((v|0)==1){v=0;}}if((d[o+5|0]|0|0)==10){n=(d[o+4|0]|0)+((d[o+7|0]|0)<<8)+((d[o+6|0]|0)<<16)|0;cu(m,n,b);}if((w|0)==0){A=p;x=o|0;c[A>>2]=c[x>>2];c[A+4>>2]=c[x+4>>2];c[p>>2]=u;p=p+8|0;r=r+1|0;}t=c[o>>2]|0;o=c[o+8>>2]|0;g=g+1|0;}c[p>>2]=u;a[p+5|0]=99;r=r+1|0;cs(m);c[e>>2]=r;c[f>>2]=u;i=h;return q|0;}function cu(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0;e=a;f=+(b|0)*+(c[e+4>>2]|0)*0.065536/+(d|0);c[e+1080>>2]=~~f&65535;c[e+1076>>2]=~~f>>16;return;}function cv(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;f=i;i=i+40|0;g=f|0;h=f+8|0;j=f+16|0;k=f+24|0;l=f+32|0;m=b;b=e;L1442:while(1){e=cw(m)|0;n=b+13096|0;c[n>>2]=(c[n>>2]|0)+e;if((cP(m,g,1,1)|0)!=1){o=1138;break;}do{if((d[g]|0)==240){o=1141;}else{if((d[g]|0)==247){o=1141;break;}if((d[g]|0)==255){e=m;cP(e,h,1,1)|0;p=cw(m)|0;do{if((d[h]|0)>0){if((d[h]|0)>=16){o=1146;break;}e=m;n=p;q=a[h]|0;r=b;cx(e,n,q,r)|0;}else{o=1146;}}while(0);if((o|0)==1146){o=0;r=d[h]|0;if((r|0)==47){o=1147;break L1442;}else if((r|0)==81){o=1148;break L1442;}cQ(m,p);}}else{a[j]=a[g]|0;if((a[j]&128|0)!=0){a[6632]=d[j]&15;a[6624]=d[j]>>4&7;r=m;cP(r,j,1,1)|0;a[j]=d[j]&127;}switch(d[6624]|0){case 1:{o=1156;break L1442;break;}case 6:{o=1188;break L1442;break;}case 4:{o=1186;break L1442;break;}case 5:{break;}case 0:{o=1155;break L1442;break;}case 2:{o=1157;break L1442;break;}case 3:{cP(m,k,1,1)|0;a[k]=d[k]&127;s=255;L1466:do{switch(d[j]|0){case 98:{a[6616]=1;a[6600+(d[6632]|0)|0]=a[k]|0;break;}case 6:{if((a[6616]|0)!=0){break L1466;}r=d[6584+(d[6632]|0)|0]<<8|d[6600+(d[6632]|0)|0];if((r|0)==0){s=11;}else if((r|0)==32639){o=1179;break L1442;}break;}case 7:{s=4;break;}case 10:{s=5;break;}case 11:{s=7;break;}case 64:{s=6;break;}case 120:{s=12;break;}case 121:{s=13;break;}case 123:{s=14;break;}case 0:{s=15;break;}case 32:{if((d[k]|0)==0){s=15;}break;}case 100:{a[6616]=0;a[6584+(d[6632]|0)|0]=a[k]|0;break;}case 101:{a[6616]=0;a[6600+(d[6632]|0)|0]=a[k]|0;break;}case 99:{a[6616]=1;a[6584+(d[6632]|0)|0]=a[k]|0;break;}default:{}}}while(0);if((s|0)!=255){o=1184;break L1442;}break;}default:{}}}}}while(0);if((o|0)==1141){o=0;p=cw(m)|0;cQ(m,p);}}if((o|0)==1184){t=bi(12)|0;c[t>>2]=c[b+13096>>2];a[t+5|0]=s&255;a[t+4|0]=a[6632]|0;a[t+6|0]=a[k]|0;a[t+7|0]=0;c[t+8>>2]=0;u=t;v=u;i=f;return v|0;}else if((o|0)==1156){cP(m,k,1,1)|0;a[k]=d[k]&127;t=bi(12)|0;c[t>>2]=c[b+13096>>2];a[t+5|0]=1;a[t+4|0]=a[6632]|0;a[t+6|0]=a[j]|0;a[t+7|0]=a[k]|0;c[t+8>>2]=0;u=t;v=u;i=f;return v|0;}else if((o|0)==1179){t=bi(12)|0;c[t>>2]=c[b+13096>>2];a[t+5|0]=11;a[t+4|0]=a[6632]|0;a[t+6|0]=2;a[t+7|0]=0;c[t+8>>2]=0;u=t;v=u;i=f;return v|0;}else if((o|0)==1138){u=0;v=u;i=f;return v|0;}else if((o|0)==1188){cP(m,k,1,1)|0;a[k]=d[k]&127;t=bi(12)|0;c[t>>2]=c[b+13096>>2];a[t+5|0]=8;a[t+4|0]=a[6632]|0;a[t+6|0]=a[j]|0;a[t+7|0]=a[k]|0;c[t+8>>2]=0;u=t;v=u;i=f;return v|0;}else if((o|0)==1186){a[j]=d[j]&127;t=bi(12)|0;c[t>>2]=c[b+13096>>2];a[t+5|0]=9;a[t+4|0]=a[6632]|0;a[t+6|0]=a[j]|0;a[t+7|0]=0;c[t+8>>2]=0;u=t;v=u;i=f;return v|0;}else if((o|0)==1147){u=-1;v=u;i=f;return v|0;}else if((o|0)==1148){cP(m,j,1,1)|0;cP(m,k,1,1)|0;cP(m,l,1,1)|0;t=bi(12)|0;c[t>>2]=c[b+13096>>2];a[t+5|0]=10;a[t+4|0]=a[l]|0;a[t+6|0]=a[j]|0;a[t+7|0]=a[k]|0;c[t+8>>2]=0;u=t;v=u;i=f;return v|0;}else if((o|0)==1155){cP(m,k,1,1)|0;a[k]=d[k]&127;t=bi(12)|0;c[t>>2]=c[b+13096>>2];a[t+5|0]=2;a[t+4|0]=a[6632]|0;a[t+6|0]=a[j]|0;a[t+7|0]=a[k]|0;c[t+8>>2]=0;u=t;v=u;i=f;return v|0;}else if((o|0)==1157){cP(m,k,1,1)|0;a[k]=d[k]&127;t=bi(12)|0;c[t>>2]=c[b+13096>>2];a[t+5|0]=3;a[t+4|0]=a[6632]|0;a[t+6|0]=a[j]|0;a[t+7|0]=a[k]|0;c[t+8>>2]=0;u=t;v=u;i=f;return v|0;}return 0;}function cw(b){b=b|0;var c=0,d=0,e=0;c=i;i=i+8|0;d=c|0;e=b;b=0;while(1){cP(e,d,1,1)|0;b=b+(a[d]&127)|0;if((a[d]&128|0)==0){break;}b=b<<7;}i=c;return b|0;}function cx(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;h=e;e=f;f=g;g=bi(h+1|0)|0;if((h|0)!=(cP(b,g,1,h)|0)){c0(g);i=-1;j=i;return j|0;}a[g+h|0]=0;while(1){b=h;h=b-1|0;if((b|0)==0){break;}if((d[g+h|0]|0|0)<32){a[g+h|0]=46;}}h=e&255;if((h|0)==1){k=0;}else if((h|0)==2){k=1;}else{c0(g);g=0;}if((g|0)!=0){if((c[f+13104+(k<<2)>>2]|0)!=0){c0(c[f+13104+(k<<2)>>2]|0);}c[f+13104+(k<<2)>>2]=g;}i=0;j=i;return j|0;}function cy(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;g=b;b=e;e=f;f=g+1724+(b*236|0)|0;if((c[(c[f+4>>2]|0)+12>>2]|0)==0){h=c[f+16>>2]>>12;if((c[e>>2]|0)>=((c[(c[f+4>>2]|0)+8>>2]>>12)-h|0)){a[f|0]=0;c[e>>2]=(c[(c[f+4>>2]|0)+8>>2]>>12)-h;}else{i=f+16|0;c[i>>2]=(c[i>>2]|0)+(c[e>>2]<<12);}j=(c[(c[f+4>>2]|0)+88>>2]|0)+(h<<1)|0;k=j;return k|0;}h=a[(c[f+4>>2]|0)+110|0]|0;if((c[f+212>>2]|0)!=0){L1575:do{if((h&4|0)!=0){do{if((h&64|0)==0){if((d[f|0]|0|0)==1){break;}if((d[f|0]|0|0)!=2){break L1575;}}}while(0);if((h&8|0)!=0){j=cz(g,f,c[e>>2]|0)|0;k=j;return k|0;}else{j=cA(g,f,c[e>>2]|0)|0;k=j;return k|0;}}}while(0);j=cB(g,b,e)|0;k=j;return k|0;}else{L1561:do{if((h&4|0)!=0){do{if((h&64|0)==0){if((d[f|0]|0|0)==1){break;}if((d[f|0]|0|0)!=2){break L1561;}}}while(0);if((h&8|0)!=0){j=cC(g,f,c[e>>2]|0)|0;k=j;return k|0;}else{j=cD(g,f,c[e>>2]|0)|0;k=j;return k|0;}}}while(0);j=cE(g,b,e)|0;k=j;return k|0;}return 0;}function cz(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;f=a;a=d;d=e;e=c[a+16>>2]|0;g=c[a+20>>2]|0;h=c[(c[a+4>>2]|0)+4>>2]|0;i=c[c[a+4>>2]>>2]|0;j=c[f+1068>>2]|0;k=c[(c[a+4>>2]|0)+88>>2]|0;l=c[a+216>>2]|0;m=h<<1;n=i<<1;o=0;while(1){if((d|0)!=0){p=(e|0)<=(i|0);}else{p=0;}if(!p){break;}q=((i-e|0)/(g|0)|0)+1|0;if((q|0)>(d|0)){q=d;}if((q|0)>(l|0)){q=l;o=1;}else{l=l-q|0;}d=d-q|0;while(1){r=q;q=r-1|0;if((r|0)==0){break;}s=b[k+(e>>12<<1)>>1]|0;t=b[k+((e>>12)+1<<1)>>1]|0;r=j;j=r+2|0;b[r>>1]=(s<<16>>16)+((_((t<<16>>16)-(s<<16>>16)|0,e&4095)|0)>>>12)&65535;e=e+g|0;}if((o|0)!=0){l=c[a+212>>2]|0;g=cG(f,a,0)|0;o=0;}}while(1){if((d|0)==0){break;}if((g|0)>0){u=h;}else{u=i;}q=((u-e|0)/(g|0)|0)+1|0;if((q|0)>(d|0)){q=d;}if((q|0)>(l|0)){q=l;o=1;}else{l=l-q|0;}d=d-q|0;while(1){p=q;q=p-1|0;if((p|0)==0){break;}s=b[k+(e>>12<<1)>>1]|0;t=b[k+((e>>12)+1<<1)>>1]|0;p=j;j=p+2|0;b[p>>1]=(s<<16>>16)+((_((t<<16>>16)-(s<<16>>16)|0,e&4095)|0)>>>12)&65535;e=e+g|0;}if((o|0)!=0){l=c[a+212>>2]|0;g=cG(f,a,(g|0)<0|0)|0;o=0;}if((e|0)>=(h|0)){e=m-e|0;g=g*-1|0;}else{if((e|0)<=(i|0)){e=n-e|0;g=g*-1|0;}}}c[a+216>>2]=l;c[a+20>>2]=g;c[a+16>>2]=e;return c[f+1068>>2]|0;}function cA(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;f=a;a=d;d=e;e=c[a+16>>2]|0;g=c[a+20>>2]|0;h=c[(c[a+4>>2]|0)+4>>2]|0;i=h-(c[c[a+4>>2]>>2]|0)|0;j=c[f+1068>>2]|0;k=c[(c[a+4>>2]|0)+88>>2]|0;l=c[a+216>>2]|0;m=0;while(1){if((d|0)==0){break;}if((e|0)>=(h|0)){e=e-i|0;}n=((h-e|0)/(g|0)|0)+1|0;if((n|0)>(d|0)){n=d;}if((n|0)>(l|0)){n=l;m=1;}else{l=l-n|0;}d=d-n|0;while(1){o=n;n=o-1|0;if((o|0)==0){break;}o=b[k+(e>>12<<1)>>1]|0;p=j;j=p+2|0;b[p>>1]=(o<<16>>16)+((_((b[k+((e>>12)+1<<1)>>1]|0)-(o<<16>>16)|0,e&4095)|0)>>>12)&65535;e=e+g|0;}if((m|0)!=0){l=c[a+212>>2]|0;g=cG(f,a,0)|0;m=0;}}c[a+216>>2]=l;c[a+20>>2]=g;c[a+16>>2]=e;return c[f+1068>>2]|0;}function cB(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;g=d;d=f;f=g+1724+(e*236|0)|0;e=c[g+1068>>2]|0;h=c[(c[f+4>>2]|0)+88>>2]|0;i=c[(c[f+4>>2]|0)+8>>2]|0;j=c[f+16>>2]|0;k=c[f+20>>2]|0;l=c[d>>2]|0;m=c[f+216>>2]|0;if((k|0)<0){k=-k|0;}do{n=l;l=n-1|0;if((n|0)==0){o=1322;break;}n=m;m=n-1|0;if((n|0)==0){m=c[f+212>>2]|0;k=cG(g,f,0)|0;}n=b[h+(j>>12<<1)>>1]|0;p=e;e=p+2|0;b[p>>1]=(n<<16>>16)+((_((b[h+((j>>12)+1<<1)>>1]|0)-(n<<16>>16)|0,j&4095)|0)>>>12)&65535;j=j+k|0;}while((j|0)<(i|0));if((o|0)==1322){q=m;r=f;s=r+216|0;c[s>>2]=q;t=k;u=f;v=u+20|0;c[v>>2]=t;w=j;x=f;y=x+16|0;c[y>>2]=w;z=g;A=z+1068|0;B=c[A>>2]|0;return B|0;}if((j|0)==(i|0)){i=e;e=i+2|0;b[i>>1]=b[h+(j>>12<<1)>>1]|0;}a[f|0]=0;h=d;c[h>>2]=(c[h>>2]|0)-(l+1);q=m;r=f;s=r+216|0;c[s>>2]=q;t=k;u=f;v=u+20|0;c[v>>2]=t;w=j;x=f;y=x+16|0;c[y>>2]=w;z=g;A=z+1068|0;B=c[A>>2]|0;return B|0;}function cC(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;f=a;a=d;d=e;e=c[a+16>>2]|0;g=c[a+20>>2]|0;h=c[(c[a+4>>2]|0)+4>>2]|0;i=c[c[a+4>>2]>>2]|0;j=c[f+1068>>2]|0;k=c[(c[a+4>>2]|0)+88>>2]|0;l=h<<1;m=i<<1;if((e|0)<=(i|0)){n=((i-e|0)/(g|0)|0)+1|0;if((n|0)>(d|0)){n=d;d=0;}else{d=d-n|0;}while(1){o=n;n=o-1|0;if((o|0)==0){break;}p=b[k+(e>>12<<1)>>1]|0;q=b[k+((e>>12)+1<<1)>>1]|0;o=j;j=o+2|0;b[o>>1]=(p<<16>>16)+((_((q<<16>>16)-(p<<16>>16)|0,e&4095)|0)>>>12)&65535;e=e+g|0;}}while(1){if((d|0)==0){break;}if((g|0)>0){r=h;}else{r=i;}n=((r-e|0)/(g|0)|0)+1|0;if((n|0)>(d|0)){n=d;d=0;}else{d=d-n|0;}while(1){o=n;n=o-1|0;if((o|0)==0){break;}p=b[k+(e>>12<<1)>>1]|0;q=b[k+((e>>12)+1<<1)>>1]|0;o=j;j=o+2|0;b[o>>1]=(p<<16>>16)+((_((q<<16>>16)-(p<<16>>16)|0,e&4095)|0)>>>12)&65535;e=e+g|0;}if((e|0)>=(h|0)){e=l-e|0;g=g*-1|0;}else{if((e|0)<=(i|0)){e=m-e|0;g=g*-1|0;}}}c[a+20>>2]=g;c[a+16>>2]=e;return c[f+1068>>2]|0;}function cD(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;f=a;a=d;d=e;e=c[a+16>>2]|0;g=c[a+20>>2]|0;h=c[(c[a+4>>2]|0)+4>>2]|0;i=h-(c[c[a+4>>2]>>2]|0)|0;j=c[f+1068>>2]|0;k=c[(c[a+4>>2]|0)+88>>2]|0;while(1){if((d|0)==0){break;}if((e|0)>=(h|0)){e=e-i|0;}l=((h-e|0)/(g|0)|0)+1|0;if((l|0)>(d|0)){l=d;d=0;}else{d=d-l|0;}while(1){m=l;l=m-1|0;if((m|0)==0){break;}m=b[k+(e>>12<<1)>>1]|0;n=j;j=n+2|0;b[n>>1]=(m<<16>>16)+((_((b[k+((e>>12)+1<<1)>>1]|0)-(m<<16>>16)|0,e&4095)|0)>>>12)&65535;e=e+g|0;}}c[a+16>>2]=e;return c[f+1068>>2]|0;}function cE(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;g=d;d=f;f=g+1724+(e*236|0)|0;e=c[g+1068>>2]|0;h=c[(c[f+4>>2]|0)+88>>2]|0;i=c[f+16>>2]|0;j=c[f+20>>2]|0;k=c[(c[f+4>>2]|0)+8>>2]|0;l=c[d>>2]|0;if((j|0)<0){j=-j|0;}m=((k-i|0)/(j|0)|0)+1|0;if((m|0)>(l|0)){m=l;l=0;}else{l=l-m|0;}while(1){n=m;m=n-1|0;if((n|0)==0){break;}n=b[h+(i>>12<<1)>>1]|0;o=e;e=o+2|0;b[o>>1]=(n<<16>>16)+((_((b[h+((i>>12)+1<<1)>>1]|0)-(n<<16>>16)|0,i&4095)|0)>>>12)&65535;i=i+j|0;}if((i|0)<(k|0)){p=i;q=f;r=q+16|0;c[r>>2]=p;s=g;t=s+1068|0;u=c[t>>2]|0;return u|0;}if((i|0)==(k|0)){k=e;e=k+2|0;b[k>>1]=b[h+(i>>12<<1)>>1]|0;}a[f|0]=0;h=d;c[h>>2]=(c[h>>2]|0)-(l+1);p=i;q=f;r=q+16|0;c[r>>2]=p;s=g;t=s+1068|0;u=c[t>>2]|0;return u|0;}function cF(e,f){e=e|0;f=f|0;var g=0,h=0,i=0.0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0.0,C=0.0,D=0,E=0,F=0,G=0,H=0,I=0,J=0.0,K=0.0,L=0.0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0;g=f;f=c[g+88>>2]|0;h=1056+(a[g+112|0]<<2)|0;i=+(c[g+12>>2]|0)*+(d[h]|d[h+1|0]<<8|d[h+2|0]<<16|d[h+3|0]<<24|0)/(+(c[g+32>>2]|0)*+(c[e+4>>2]|0));e=~~(+(c[g+8>>2]|0)/i);h=bi(e>>11)|0;j=h;k=h;h=(e>>12)-1|0;l=((c[g+8>>2]|0)-4096|0)/(h|0)|0;m=l;n=l;l=h-1|0;h=l;if((l|0)!=0){l=k;k=l+2|0;b[l>>1]=b[f>>1]|0;}while(1){l=h-1|0;h=l;if((l|0)==0){break;}l=f+(n>>12<<1)|0;if(l>>>0>f>>>0){o=b[l-2>>1]|0;}else{o=0;}p=o&65535;q=b[l>>1]|0;r=b[l+2>>1]|0;s=b[l+4>>1]|0;t=+((n&4095)>>>0>>>0)*0.000244140625;l=k;k=l+2|0;b[l>>1]=~~(+(q<<16>>16|0)+t/6.0*(+(((p<<16>>16)*-2|0)-((q<<16>>16)*3|0)+((r<<16>>16)*6|0)-(s<<16>>16)|0)+t*(+(((p<<16>>16)-(q<<16>>16<<1)+(r<<16>>16)|0)*3|0|0)+t*+((-(p<<16>>16)|0)+(((q<<16>>16)-(r<<16>>16)|0)*3|0)+(s<<16>>16)|0))));n=n+m|0;}if((n&4095|0)!=0){p=b[f+(n>>12<<1)>>1]|0;q=b[f+((n>>12)+1<<1)>>1]|0;m=k;k=m+2|0;b[m>>1]=(p<<16>>16)+((_((q<<16>>16)-(p<<16>>16)|0,n&4095)|0)>>>12)&65535;u=e;v=g;w=v+8|0;c[w>>2]=u;x=g;y=x|0;z=c[y>>2]|0;A=+(z|0);B=i;C=A/B;D=~~C;E=g;F=E|0;c[F>>2]=D;G=g;H=G+4|0;I=c[H>>2]|0;J=+(I|0);K=i;L=J/K;M=~~L;N=g;O=N+4|0;c[O>>2]=M;P=g;Q=P+88|0;R=c[Q>>2]|0;S=R;c0(S);T=j;U=g;V=U+88|0;c[V>>2]=T;W=g;X=W+12|0;c[X>>2]=0;return;}else{p=k;k=p+2|0;b[p>>1]=b[f+(n>>12<<1)>>1]|0;u=e;v=g;w=v+8|0;c[w>>2]=u;x=g;y=x|0;z=c[y>>2]|0;A=+(z|0);B=i;C=A/B;D=~~C;E=g;F=E|0;c[F>>2]=D;G=g;H=G+4|0;I=c[H>>2]|0;J=+(I|0);K=i;L=J/K;M=~~L;N=g;O=N+4|0;c[O>>2]=M;P=g;Q=P+88|0;R=c[Q>>2]|0;S=R;c0(S);T=j;U=g;V=U+88|0;c[V>>2]=T;W=g;X=W+12|0;c[X>>2]=0;return;}}function cG(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,i=0,j=0,l=0,m=0.0,n=0.0;f=a;a=b;b=e;e=a+208|0;g=c[e>>2]|0;c[e>>2]=g+1;if((g|0)>=63){c[a+208>>2]=0;}g=cH(c[a+208>>2]|0)|0;if((c[a+80+(g<<2)>>2]|0)!=0){if((b|0)!=0){i=-(c[a+80+(g<<2)>>2]|0)|0;j=i;return j|0;}else{i=c[a+80+(g<<2)>>2]|0;j=i;return j|0;}}e=(d[(c[a+4>>2]|0)+109|0]|0)<<7;if((c[a+52>>2]|0)!=0){l=a+56|0;c[l>>2]=(c[l>>2]|0)+(c[a+52>>2]|0);if((c[a+56>>2]|0)>=65536){c[a+52>>2]=0;}else{e=_(e,c[a+56>>2]|0)|0;e=e>>16;}}m=+(c[(c[a+4>>2]|0)+12>>2]|0)*+(c[a+12>>2]|0)/(+(c[(c[a+4>>2]|0)+32>>2]|0)*+(c[f+4>>2]|0))*4096.0;f=~~(+R(+(+(c[a+208>>2]<<4|0)*0.006135923151542565))*+(e|0)*1.0);if((f|0)<0){f=-f|0;e=1704+((f>>5&255)<<3)|0;n=(c[k>>2]=d[e]|d[e+1|0]<<8|d[e+2|0]<<16|d[e+3|0]<<24,c[k+4>>2]=d[e+4|0]|d[e+5|0]<<8|d[e+6|0]<<16|d[e+7|0]<<24,+h[k>>3]);e=3752+(f>>13<<3)|0;m=m/(n*(c[k>>2]=d[e]|d[e+1|0]<<8|d[e+2|0]<<16|d[e+3|0]<<24,c[k+4>>2]=d[e+4|0]|d[e+5|0]<<8|d[e+6|0]<<16|d[e+7|0]<<24,+h[k>>3]));}else{e=1704+((f>>5&255)<<3)|0;n=(c[k>>2]=d[e]|d[e+1|0]<<8|d[e+2|0]<<16|d[e+3|0]<<24,c[k+4>>2]=d[e+4|0]|d[e+5|0]<<8|d[e+6|0]<<16|d[e+7|0]<<24,+h[k>>3]);e=3752+(f>>13<<3)|0;m=m*n*(c[k>>2]=d[e]|d[e+1|0]<<8|d[e+2|0]<<16|d[e+3|0]<<24,c[k+4>>2]=d[e+4|0]|d[e+5|0]<<8|d[e+6|0]<<16|d[e+7|0]<<24,+h[k>>3]);}if((c[a+52>>2]|0)==0){c[a+80+(g<<2)>>2]=~~m;}if((b|0)!=0){m=-0.0-m;}i=~~m;j=i;return j|0;}function cH(a){a=a|0;var b=0,c=0;b=a;do{if((b|0)<16){c=15-b|0;}else{if((b|0)>=48){c=79-b|0;break;}else{c=b-16|0;break;}}}while(0);return c|0;}function cI(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;return an(b|0,d|0,e|0,c[a>>2]|0)|0;}function cJ(a){a=a|0;var b=0,d=0,e=0;b=a;a=0;if((c[b+4>>2]|0)==0){d=b;c0(d);e=a;return e|0;}a=ao(c[b>>2]|0)|0;d=b;c0(d);e=a;return e|0;}function cK(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=d;d=a;a=e;e=c[d+4>>2]|0;g=e+(_(a,f)|0)|0;if(g>>>0>(c[d+8>>2]|0)>>>0){a=(((c[d+8>>2]|0)-(c[d+4>>2]|0)|0)>>>0)/(f>>>0)|0;}g=b;b=c[d+4>>2]|0;e=_(a,f)|0;c6(g|0,b|0,e)|0;e=_(a,f)|0;f=d+4|0;c[f>>2]=(c[f>>2]|0)+e;return a|0;}function cL(a){a=a|0;var b=0,d=0;b=a;if((c[b+12>>2]|0)==0){d=b;c0(d);return 0;}c0(c[b>>2]|0);d=b;c0(d);return 0;}function cM(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=bi(12)|0;if((d|0)==0){e=0;f=e;return f|0;}g=bi(8)|0;if((g|0)==0){c0(d);e=0;f=e;return f|0;}else{c[g>>2]=a;c[g+4>>2]=b;c[d+8>>2]=g;c[d>>2]=2;c[d+4>>2]=4;e=d;f=e;return f|0;}return 0;}function cN(a){a=a|0;var b=0,c=0,d=0;b=av(a|0,6544)|0;if((b|0)==0){c=0;d=c;return d|0;}else{c=cM(b,1)|0;d=c;return d|0;}return 0;}function cO(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=a;a=bi(12)|0;if((a|0)==0){f=0;g=f;return g|0;}h=bi(16)|0;if((h|0)==0){c0(a);f=0;g=f;return g|0;}else{c[h>>2]=e;c[h+4>>2]=e;c[h+8>>2]=e+b;c[h+12>>2]=d;c[a+8>>2]=h;c[a>>2]=4;c[a+4>>2]=2;f=a;g=f;return g|0;}return 0;}function cP(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=a;return aY[c[f>>2]&7](c[f+8>>2]|0,b,d,e)|0;}function cQ(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=i;i=i+1024|0;d=c|0;e=a;a=b;while(1){if(a>>>0<=0){break;}b=a;if(b>>>0>1024){b=1024;}a=a-b|0;(b|0)!=(cP(e,d|0,1,b)|0);}i=c;return;}function cR(a){a=a|0;var b=0;b=a;a=aW[c[b+4>>2]&7](c[b+8>>2]|0)|0;c0(b);return a|0;}function cS(){var a=0;c[1676]=bi(516)|0;c5(c[1676]|0,0,516);a=bi(3584)|0;c[c[1676]>>2]=a;c5(c[c[1676]>>2]|0,0,3584);c[1804]=bi(516)|0;c5(c[1804]|0,0,516);a=bi(3584)|0;c[c[1804]>>2]=a;c5(c[c[1804]>>2]|0,0,3584);return 0;}function cT(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;i=i+1024|0;e=d|0;f=b;do{if((f|0)!=0){if((c1(f|0)|0)>>>0>=1024){break;}b=e|0;g=f;c2(b|0,g|0)|0;g=aE(f|0,47)|0;if((g|0)!=0){a[e+(g-f)|0]=0;g=c[m>>2]|0;b=e|0;ar(g|0,6480,(g=i,i=i+8|0,c[g>>2]=b,g)|0)|0;i=g;bj(e|0);}}}while(0);cS()|0;do{if((f|0)!=0){if((a[f]|0)==0){break;}h=f;j=cU(h)|0;i=d;return j|0;}}while(0);f=6520;h=f;j=cU(h)|0;i=d;return j|0;}function cU(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;d=i;i=i+1064|0;e=d|0;f=d+1024|0;g=b;b=0;h=0;if((c[1660]|0)>50){j=c[m>>2]|0;ar(j|0,5792,(k=i,i=i+1|0,i=i+7&-8,c[k>>2]=0,k)|0)|0;i=k;l=-1;n=l;i=d;return n|0;}j=bh(g)|0;o=j;if((j|0)==0){j=c[m>>2]|0;p=g;ar(j|0,5392,(k=i,i=i+8|0,c[k>>2]=p,k)|0)|0;i=k;l=-1;n=l;i=d;return n|0;}L1881:while(1){if((c_(e|0,1024,o)|0)==0){q=1646;break;}h=h+1|0;p=0;c[f>>2]=ay(e|0,5096)|0;if((c[f>>2]|0)==0){continue;}do{if((aV(c[f>>2]|0,4840)|0)==0){p=-1;}else{if((a[c[f>>2]|0]|0)==35){continue L1881;}else{break;}}}while(0);while(1){do{if((c[f+(p<<2)>>2]|0)!=0){if((a[c[f+(p<<2)>>2]|0]|0)==35){r=0;break;}r=(p|0)<10;}else{r=0;}}while(0);if(!r){break;}j=p+1|0;p=j;c[f+(j<<2)>>2]=ay(0,5096)|0;}do{if((aV(c[f>>2]|0,4832)|0)!=0){if((aV(c[f>>2]|0,4816)|0)==0){q=1504;break;}if((aV(c[f>>2]|0,4800)|0)==0){q=1504;break;}if((aV(c[f>>2]|0,6552)|0)==0){q=1504;break;}if((aV(c[f>>2]|0,6536)|0)==0){q=1504;break;}if((aV(c[f>>2]|0,6504)|0)!=0){do{if((aV(c[f>>2]|0,6416)|0)!=0){if((aV(c[f>>2]|0,6400)|0)==0){q=1509;break;}if((aV(c[f>>2]|0,6344)|0)!=0){if((aV(c[f>>2]|0,6280)|0)!=0){do{if((aV(c[f>>2]|0,6176)|0)!=0){if((aV(c[f>>2]|0,6136)|0)==0){q=1516;break;}if((aV(c[f>>2]|0,6072)|0)!=0){if((aV(c[f>>2]|0,6008)|0)!=0){if((aV(c[f>>2]|0,5952)|0)!=0){if((aV(c[f>>2]|0,5880)|0)!=0){if((aV(c[f>>2]|0,5784)|0)!=0){if((aV(c[f>>2]|0,5720)|0)!=0){if((aV(c[f>>2]|0,5616)|0)!=0){if((p|0)<2){q=1562;break L1881;}if((a[c[f>>2]|0]|0)<48){q=1562;break L1881;}if((a[c[f>>2]|0]|0)>57){q=1562;break L1881;}s=aL(c[f>>2]|0)|0;if((s|0)<0){q=1565;break L1881;}if((s|0)>127){q=1565;break L1881;}if((b|0)==0){q=1567;break L1881;}if((c[(c[b>>2]|0)+(s*28|0)>>2]|0)!=0){c0(c[(c[b>>2]|0)+(s*28|0)>>2]|0);}j=bi((c1(c[f+4>>2]|0)|0)+1|0)|0;c[(c[b>>2]|0)+(s*28|0)>>2]=j;t=c[f+4>>2]|0;c2(j|0,t|0)|0;c[(c[b>>2]|0)+(s*28|0)+24>>2]=-1;c[(c[b>>2]|0)+(s*28|0)+20>>2]=-1;c[(c[b>>2]|0)+(s*28|0)+16>>2]=-1;c[(c[b>>2]|0)+(s*28|0)+12>>2]=-1;c[(c[b>>2]|0)+(s*28|0)+8>>2]=-1;c[(c[b>>2]|0)+(s*28|0)+4>>2]=-1;u=2;while(1){if((u|0)>=(p|0)){break;}t=aH(c[f+(u<<2)>>2]|0,61)|0;j=t;if((t|0)==0){q=1573;break L1881;}t=j;j=t+1|0;a[t]=0;if((aV(c[f+(u<<2)>>2]|0,5272)|0)!=0){if((aV(c[f+(u<<2)>>2]|0,5208)|0)!=0){if((aV(c[f+(u<<2)>>2]|0,5152)|0)!=0){if((aV(c[f+(u<<2)>>2]|0,5008)|0)!=0){if((aV(c[f+(u<<2)>>2]|0,4944)|0)!=0){q=1625;break L1881;}if((aV(j|0,5e3)|0)!=0){if((aV(j|0,4992)|0)!=0){if((aV(j|0,4936)|0)!=0){q=1621;break L1881;}c[(c[b>>2]|0)+(s*28|0)+24>>2]=1;}else{c[(c[b>>2]|0)+(s*28|0)+16>>2]=1;}}else{c[(c[b>>2]|0)+(s*28|0)+20>>2]=1;}}else{if((aV(j|0,5e3)|0)!=0){if((aV(j|0,4992)|0)!=0){q=1611;break L1881;}c[(c[b>>2]|0)+(s*28|0)+16>>2]=0;}else{c[(c[b>>2]|0)+(s*28|0)+20>>2]=0;}}}else{if((aV(j|0,5144)|0)!=0){if((aV(j|0,5112)|0)!=0){if((aV(j|0,5104)|0)!=0){v=(((aL(j|0)|0)+100|0)*100|0|0)/157|0;}else{v=127;}}else{v=0;}}else{v=64;}if((v|0)<0){q=1604;break L1881;}if((v|0)>127){q=1604;break L1881;}do{if((v|0)==0){if((a[j]|0)==45){break;}if((a[j]|0)<48){q=1604;break L1881;}if((a[j]|0)>57){q=1604;break L1881;}}}while(0);c[(c[b>>2]|0)+(s*28|0)+12>>2]=v;}}else{v=aL(j|0)|0;if((v|0)<0){q=1586;break L1881;}if((v|0)>127){q=1586;break L1881;}if((a[j]|0)<48){q=1586;break L1881;}if((a[j]|0)>57){q=1586;break L1881;}c[(c[b>>2]|0)+(s*28|0)+4>>2]=v;}}else{v=aL(j|0)|0;if((v|0)<0){q=1579;break L1881;}if((v|0)>800){q=1579;break L1881;}if((a[j]|0)<48){q=1579;break L1881;}if((a[j]|0)>57){q=1579;break L1881;}c[(c[b>>2]|0)+(s*28|0)+8>>2]=v;}u=u+1|0;}}else{if((p|0)<2){q=1552;break L1881;}s=aL(c[f+4>>2]|0)|0;if((s|0)<0){q=1555;break L1881;}if((s|0)>127){q=1555;break L1881;}if((c[6704+(s<<2)>>2]|0)==0){c[6704+(s<<2)>>2]=bi(516)|0;c5(c[6704+(s<<2)>>2]|0,0,516);t=bi(3584)|0;c[c[6704+(s<<2)>>2]>>2]=t;c5(c[c[6704+(s<<2)>>2]>>2]|0,0,3584);}b=c[6704+(s<<2)>>2]|0;}}else{if((p|0)<2){q=1543;break L1881;}s=aL(c[f+4>>2]|0)|0;if((s|0)<0){q=1546;break L1881;}if((s|0)>127){q=1546;break L1881;}if((c[7216+(s<<2)>>2]|0)==0){c[7216+(s<<2)>>2]=bi(516)|0;c5(c[7216+(s<<2)>>2]|0,0,516);t=bi(3584)|0;c[c[7216+(s<<2)>>2]>>2]=t;c5(c[c[7216+(s<<2)>>2]>>2]|0,0,3584);}b=c[7216+(s<<2)>>2]|0;}}else{if((p|0)!=2){q=1539;break L1881;}t=c[f+4>>2]|0;c7(7728,t|0,255)|0;a[7983]=0;}}else{if((p|0)<2){q=1531;break L1881;}s=1;while(1){if((s|0)>=(p|0)){break;}c[1660]=(c[1660]|0)+1;cU(c[f+(s<<2)>>2]|0)|0;c[1660]=(c[1660]|0)-1;s=s+1|0;}}}else{if((p|0)<2){q=1523;break L1881;}s=1;while(1){if((s|0)>=(p|0)){break;}bj(c[f+(s<<2)>>2]|0);s=s+1|0;}}}else{t=c[m>>2]|0;ar(t|0,5960,(k=i,i=i+1|0,i=i+7&-8,c[k>>2]=0,k)|0)|0;i=k;}}else{t=c[m>>2]|0;ar(t|0,6016,(k=i,i=i+1|0,i=i+7&-8,c[k>>2]=0,k)|0)|0;i=k;}}else{q=1516;}}while(0);if((q|0)==1516){q=0;t=c[m>>2]|0;w=c[f>>2]|0;ar(t|0,6088,(k=i,i=i+8|0,c[k>>2]=w,k)|0)|0;i=k;}}else{w=c[m>>2]|0;ar(w|0,6192,(k=i,i=i+1|0,i=i+7&-8,c[k>>2]=0,k)|0)|0;i=k;}}else{w=c[m>>2]|0;ar(w|0,6296,(k=i,i=i+1|0,i=i+7&-8,c[k>>2]=0,k)|0)|0;i=k;}}else{q=1509;}}while(0);if((q|0)==1509){q=0;w=c[m>>2]|0;t=c[f>>2]|0;ar(w|0,6352,(k=i,i=i+8|0,c[k>>2]=t,k)|0)|0;i=k;}}else{t=c[m>>2]|0;ar(t|0,6432,(k=i,i=i+1|0,i=i+7&-8,c[k>>2]=0,k)|0)|0;i=k;}}else{q=1504;}}while(0);if((q|0)==1504){q=0;}}if((q|0)==1523){s=c[m>>2]|0;b=g;v=h;ar(s|0,5912,(k=i,i=i+16|0,c[k>>2]=b,c[k+8>>2]=v,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1555){ar(c[m>>2]|0,5520,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1562){ar(c[m>>2]|0,5480,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1565){ar(c[m>>2]|0,5432,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1567){ar(c[m>>2]|0,5320,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1539){ar(c[m>>2]|0,5728,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1531){ar(c[m>>2]|0,5840,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1552){ar(c[m>>2]|0,5576,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1579){ar(c[m>>2]|0,5216,(k=i,i=i+24|0,c[k>>2]=g,c[k+8>>2]=h,c[k+16>>2]=800,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1586){ar(c[m>>2]|0,5160,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1611){ar(c[m>>2]|0,4952,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1621){ar(c[m>>2]|0,4888,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1625){v=c[f+(u<<2)>>2]|0;ar(c[m>>2]|0,5280,(k=i,i=i+24|0,c[k>>2]=g,c[k+8>>2]=h,c[k+16>>2]=v,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1546){ar(c[m>>2]|0,5624,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1543){ar(c[m>>2]|0,5680,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1604){ar(c[m>>2]|0,5016,(k=i,i=i+16|0,c[k>>2]=g,c[k+8>>2]=h,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1573){v=c[f+(u<<2)>>2]|0;ar(c[m>>2]|0,5280,(k=i,i=i+24|0,c[k>>2]=g,c[k+8>>2]=h,c[k+16>>2]=v,k)|0)|0;i=k;l=-2;n=l;i=d;return n|0;}else if((q|0)==1646){ao(o|0)|0;l=0;n=l;i=d;return n|0;}return 0;}function cV(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;c[1672]=d;b[3346]=e;a[6694]=f;b[3348]=g;return 6688;}function cW(f,g,h){f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,n=0;j=i;k=f;f=h;if((k|0)==0){l=0;n=l;i=j;return n|0;}h=bi(14164)|0;c5(h|0,0,14164);c[h+24>>2]=g;g=0;while(1){if((g|0)>=128){break;}if((c[6704+(g<<2)>>2]|0)!=0){c[h+28+(g<<2)>>2]=bi(516)|0;c5(c[h+28+(g<<2)>>2]|0,0,516);c[c[h+28+(g<<2)>>2]>>2]=c[c[6704+(g<<2)>>2]>>2];}if((c[7216+(g<<2)>>2]|0)!=0){c[h+540+(g<<2)>>2]=bi(516)|0;c5(c[h+540+(g<<2)>>2]|0,0,516);c[c[h+540+(g<<2)>>2]>>2]=c[c[7216+(g<<2)>>2]>>2];}g=g+1|0;}c[h+20>>2]=70;c[h+13052>>2]=32;c[h+13056>>2]=33280;c[h+4>>2]=c[f>>2];c[h+8>>2]=0;if((b[f+4>>1]&255|0)==16){g=h+8|0;c[g>>2]=c[g>>2]|4;}if((b[f+4>>1]&32768|0)!=0){g=h+8|0;c[g>>2]=c[g>>2]|2;}if((d[f+6|0]|0)==1){g=h+8|0;c[g>>2]=c[g>>2]|1;}g=e[f+4>>1]|0;if((g|0)==36880){c[h+1060>>2]=4;}else if((g|0)==16){c[h+1060>>2]=6;}else if((g|0)==32776){c[h+1060>>2]=10;}else if((g|0)==8){c[h+1060>>2]=8;}else if((g|0)==32784){c[h+1060>>2]=2;}else{ar(c[m>>2]|0,6144,(g=i,i=i+1|0,i=i+7&-8,c[g>>2]=0,g)|0)|0;i=g;c[h+1060>>2]=6;}c[h+1064>>2]=e[f+8>>1]|0;c[h+1068>>2]=bi(e[f+8>>1]<<1)|0;c[h+1072>>2]=bi(e[f+8>>1]<<1<<2)|0;c[h+12>>2]=_((c[h+8>>2]&1|0)!=0?1:2,(c[h+8>>2]&4|0)!=0?2:1)|0;c[h+13060>>2]=(c[f>>2]|0)/1e3|0;if((c[h+13060>>2]|0)<1){c[h+13060>>2]=1;}else{if((c[h+13060>>2]|0)>255){c[h+13060>>2]=255;}}c[h+13064>>2]=0;c[h+13068>>2]=0;c[h+13076>>2]=cq(k,h,h+13100|0,h+13072|0)|0;if((c[h+13076>>2]|0)==0){c0(h);l=0;n=l;i=j;return n|0;}c[h+1052>>2]=0;c[h+1056>>2]=0;if((a[7728]|0)!=0){k=h;bz(k,7728)|0;}bv(h)|0;l=h;n=l;i=j;return n|0;}function cX(a,b){a=a|0;b=b|0;return cW(a,0,b)|0;}function cY(a){a=a|0;var b=0;b=a;bx(b);a=0;while(1){if((a|0)>=128){break;}if((c[b+28+(a<<2)>>2]|0)!=0){c0(c[b+28+(a<<2)>>2]|0);}if((c[b+540+(a<<2)>>2]|0)!=0){c0(c[b+540+(a<<2)>>2]|0);}a=a+1|0;}c0(c[b+1072>>2]|0);c0(c[b+1068>>2]|0);c0(c[b+13076>>2]|0);a=0;while(1){if(a>>>0>=8){break;}if((c[b+13104+(a<<2)>>2]|0)!=0){c0(c[b+13104+(a<<2)>>2]|0);}a=a+1|0;}c0(b);return;}function cZ(){var a=0,b=0,d=0,e=0;a=0;while(1){if((a|0)>=128){break;}if((c[6704+(a<<2)>>2]|0)!=0){b=c[c[6704+(a<<2)>>2]>>2]|0;if((b|0)!=0){d=0;while(1){if((d|0)>=128){break;}if((c[b+(d*28|0)>>2]|0)!=0){c0(c[b+(d*28|0)>>2]|0);}d=d+1|0;}c0(b);}c0(c[6704+(a<<2)>>2]|0);}if((c[7216+(a<<2)>>2]|0)!=0){e=c[c[7216+(a<<2)>>2]>>2]|0;if((e|0)!=0){d=0;while(1){if((d|0)>=128){break;}if((c[e+(d*28|0)>>2]|0)!=0){c0(c[e+(d*28|0)>>2]|0);}d=d+1|0;}c0(e);}c0(c[7216+(a<<2)>>2]|0);}a=a+1|0;}bk();return;}function c_(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=b;b=c;c=d;d=0;f=0;while(1){if((d|0)<(b|0)){g=(f|0)!=0^1;}else{g=0;}if(!g){break;}if((an(e+d|0,1,1,c|0)|0)!=1){h=1752;break;}if((a[e+d|0]|0)==10){h=1755;}else{if((a[e+d|0]|0)==13){h=1755;}}if((h|0)==1755){h=0;a[e+d|0]=0;f=1;}d=d+1|0;}a[e+d|0]=0;if((d|0)!=0){i=e;return i|0;}else{i=0;return i|0;}return 0;}function c$(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ab=0,ac=0,ad=0,ae=0,af=0,ag=0,ah=0,ai=0,aj=0,ak=0,al=0,an=0,ao=0,ap=0,ar=0,as=0,at=0,au=0,av=0,aw=0,ax=0,ay=0,az=0,aA=0,aB=0,aC=0,aD=0,aE=0,aF=0,aG=0,aH=0,aI=0;do{if(a>>>0<245){if(a>>>0<11){b=16;}else{b=a+11&-8;}d=b>>>3;e=c[1996]|0;f=e>>>(d>>>0);if((f&3|0)!=0){g=(f&1^1)+d|0;h=g<<1;i=8024+(h<<2)|0;j=8024+(h+2<<2)|0;h=c[j>>2]|0;k=h+8|0;l=c[k>>2]|0;do{if((i|0)==(l|0)){c[1996]=e&~(1<>>0<(c[2e3]|0)>>>0){aq();return 0;}m=l+12|0;if((c[m>>2]|0)==(h|0)){c[m>>2]=i;c[j>>2]=l;break;}else{aq();return 0;}}}while(0);l=g<<3;c[h+4>>2]=l|3;j=h+(l|4)|0;c[j>>2]=c[j>>2]|1;n=k;return n|0;}if(b>>>0<=(c[1998]|0)>>>0){o=b;break;}if((f|0)!=0){j=2<>>12&16;i=j>>>(l>>>0);j=i>>>5&8;m=i>>>(j>>>0);i=m>>>2&4;p=m>>>(i>>>0);m=p>>>1&2;q=p>>>(m>>>0);p=q>>>1&1;r=(j|l|i|m|p)+(q>>>(p>>>0))|0;p=r<<1;q=8024+(p<<2)|0;m=8024+(p+2<<2)|0;p=c[m>>2]|0;i=p+8|0;l=c[i>>2]|0;do{if((q|0)==(l|0)){c[1996]=e&~(1<>>0<(c[2e3]|0)>>>0){aq();return 0;}j=l+12|0;if((c[j>>2]|0)==(p|0)){c[j>>2]=q;c[m>>2]=l;break;}else{aq();return 0;}}}while(0);l=r<<3;m=l-b|0;c[p+4>>2]=b|3;q=p;e=q+b|0;c[q+(b|4)>>2]=m|1;c[q+l>>2]=m;l=c[1998]|0;if((l|0)!=0){q=c[2001]|0;d=l>>>3;l=d<<1;f=8024+(l<<2)|0;k=c[1996]|0;h=1<>2]|0;if(g>>>0>=(c[2e3]|0)>>>0){s=g;t=d;break;}aq();return 0;}}while(0);c[t>>2]=q;c[s+12>>2]=q;c[q+8>>2]=s;c[q+12>>2]=f;}c[1998]=m;c[2001]=e;n=i;return n|0;}l=c[1997]|0;if((l|0)==0){o=b;break;}h=(l&-l)-1|0;l=h>>>12&16;k=h>>>(l>>>0);h=k>>>5&8;p=k>>>(h>>>0);k=p>>>2&4;r=p>>>(k>>>0);p=r>>>1&2;d=r>>>(p>>>0);r=d>>>1&1;g=c[8288+((h|l|k|p|r)+(d>>>(r>>>0))<<2)>>2]|0;r=g;d=g;p=(c[g+4>>2]&-8)-b|0;while(1){g=c[r+16>>2]|0;if((g|0)==0){k=c[r+20>>2]|0;if((k|0)==0){break;}else{u=k;}}else{u=g;}g=(c[u+4>>2]&-8)-b|0;k=g>>>0

>>0;r=u;d=k?u:d;p=k?g:p;}r=d;i=c[2e3]|0;if(r>>>0>>0){aq();return 0;}e=r+b|0;m=e;if(r>>>0>=e>>>0){aq();return 0;}e=c[d+24>>2]|0;f=c[d+12>>2]|0;do{if((f|0)==(d|0)){q=d+20|0;g=c[q>>2]|0;if((g|0)==0){k=d+16|0;l=c[k>>2]|0;if((l|0)==0){v=0;break;}else{w=l;x=k;}}else{w=g;x=q;}while(1){q=w+20|0;g=c[q>>2]|0;if((g|0)!=0){w=g;x=q;continue;}q=w+16|0;g=c[q>>2]|0;if((g|0)==0){break;}else{w=g;x=q;}}if(x>>>0>>0){aq();return 0;}else{c[x>>2]=0;v=w;break;}}else{q=c[d+8>>2]|0;if(q>>>0>>0){aq();return 0;}g=q+12|0;if((c[g>>2]|0)!=(d|0)){aq();return 0;}k=f+8|0;if((c[k>>2]|0)==(d|0)){c[g>>2]=f;c[k>>2]=q;v=f;break;}else{aq();return 0;}}}while(0);L2304:do{if((e|0)!=0){f=d+28|0;i=8288+(c[f>>2]<<2)|0;do{if((d|0)==(c[i>>2]|0)){c[i>>2]=v;if((v|0)!=0){break;}c[1997]=c[1997]&~(1<>2]);break L2304;}else{if(e>>>0<(c[2e3]|0)>>>0){aq();return 0;}q=e+16|0;if((c[q>>2]|0)==(d|0)){c[q>>2]=v;}else{c[e+20>>2]=v;}if((v|0)==0){break L2304;}}}while(0);if(v>>>0<(c[2e3]|0)>>>0){aq();return 0;}c[v+24>>2]=e;f=c[d+16>>2]|0;do{if((f|0)!=0){if(f>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[v+16>>2]=f;c[f+24>>2]=v;break;}}}while(0);f=c[d+20>>2]|0;if((f|0)==0){break;}if(f>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[v+20>>2]=f;c[f+24>>2]=v;break;}}}while(0);if(p>>>0<16){e=p+b|0;c[d+4>>2]=e|3;f=r+(e+4)|0;c[f>>2]=c[f>>2]|1;}else{c[d+4>>2]=b|3;c[r+(b|4)>>2]=p|1;c[r+(p+b)>>2]=p;f=c[1998]|0;if((f|0)!=0){e=c[2001]|0;i=f>>>3;f=i<<1;q=8024+(f<<2)|0;k=c[1996]|0;g=1<>2]|0;if(l>>>0>=(c[2e3]|0)>>>0){y=l;z=i;break;}aq();return 0;}}while(0);c[z>>2]=e;c[y+12>>2]=e;c[e+8>>2]=y;c[e+12>>2]=q;}c[1998]=p;c[2001]=m;}f=d+8|0;if((f|0)==0){o=b;break;}else{n=f;}return n|0;}else{if(a>>>0>4294967231){o=-1;break;}f=a+11|0;g=f&-8;k=c[1997]|0;if((k|0)==0){o=g;break;}r=-g|0;i=f>>>8;do{if((i|0)==0){A=0;}else{if(g>>>0>16777215){A=31;break;}f=(i+1048320|0)>>>16&8;l=i<>>16&4;j=l<>>16&2;B=14-(h|f|l)+(j<>>15)|0;A=g>>>((B+7|0)>>>0)&1|B<<1;}}while(0);i=c[8288+(A<<2)>>2]|0;L2352:do{if((i|0)==0){C=0;D=r;E=0;}else{if((A|0)==31){F=0;}else{F=25-(A>>>1)|0;}d=0;m=r;p=i;q=g<>2]&-8;l=B-g|0;if(l>>>0>>0){if((B|0)==(g|0)){C=p;D=l;E=p;break L2352;}else{G=p;H=l;}}else{G=d;H=m;}l=c[p+20>>2]|0;B=c[p+16+(q>>>31<<2)>>2]|0;j=(l|0)==0|(l|0)==(B|0)?e:l;if((B|0)==0){C=G;D=H;E=j;break;}else{d=G;m=H;p=B;q=q<<1;e=j;}}}}while(0);if((E|0)==0&(C|0)==0){i=2<>>12&16;e=i>>>(r>>>0);i=e>>>5&8;q=e>>>(i>>>0);e=q>>>2&4;p=q>>>(e>>>0);q=p>>>1&2;m=p>>>(q>>>0);p=m>>>1&1;I=c[8288+((i|r|e|q|p)+(m>>>(p>>>0))<<2)>>2]|0;}else{I=E;}if((I|0)==0){J=D;K=C;}else{p=I;m=D;q=C;while(1){e=(c[p+4>>2]&-8)-g|0;r=e>>>0>>0;i=r?e:m;e=r?p:q;r=c[p+16>>2]|0;if((r|0)!=0){p=r;m=i;q=e;continue;}r=c[p+20>>2]|0;if((r|0)==0){J=i;K=e;break;}else{p=r;m=i;q=e;}}}if((K|0)==0){o=g;break;}if(J>>>0>=((c[1998]|0)-g|0)>>>0){o=g;break;}q=K;m=c[2e3]|0;if(q>>>0>>0){aq();return 0;}p=q+g|0;k=p;if(q>>>0>=p>>>0){aq();return 0;}e=c[K+24>>2]|0;i=c[K+12>>2]|0;do{if((i|0)==(K|0)){r=K+20|0;d=c[r>>2]|0;if((d|0)==0){j=K+16|0;B=c[j>>2]|0;if((B|0)==0){L=0;break;}else{M=B;N=j;}}else{M=d;N=r;}while(1){r=M+20|0;d=c[r>>2]|0;if((d|0)!=0){M=d;N=r;continue;}r=M+16|0;d=c[r>>2]|0;if((d|0)==0){break;}else{M=d;N=r;}}if(N>>>0>>0){aq();return 0;}else{c[N>>2]=0;L=M;break;}}else{r=c[K+8>>2]|0;if(r>>>0>>0){aq();return 0;}d=r+12|0;if((c[d>>2]|0)!=(K|0)){aq();return 0;}j=i+8|0;if((c[j>>2]|0)==(K|0)){c[d>>2]=i;c[j>>2]=r;L=i;break;}else{aq();return 0;}}}while(0);L2402:do{if((e|0)!=0){i=K+28|0;m=8288+(c[i>>2]<<2)|0;do{if((K|0)==(c[m>>2]|0)){c[m>>2]=L;if((L|0)!=0){break;}c[1997]=c[1997]&~(1<>2]);break L2402;}else{if(e>>>0<(c[2e3]|0)>>>0){aq();return 0;}r=e+16|0;if((c[r>>2]|0)==(K|0)){c[r>>2]=L;}else{c[e+20>>2]=L;}if((L|0)==0){break L2402;}}}while(0);if(L>>>0<(c[2e3]|0)>>>0){aq();return 0;}c[L+24>>2]=e;i=c[K+16>>2]|0;do{if((i|0)!=0){if(i>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[L+16>>2]=i;c[i+24>>2]=L;break;}}}while(0);i=c[K+20>>2]|0;if((i|0)==0){break;}if(i>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[L+20>>2]=i;c[i+24>>2]=L;break;}}}while(0);do{if(J>>>0<16){e=J+g|0;c[K+4>>2]=e|3;i=q+(e+4)|0;c[i>>2]=c[i>>2]|1;}else{c[K+4>>2]=g|3;c[q+(g|4)>>2]=J|1;c[q+(J+g)>>2]=J;i=J>>>3;if(J>>>0<256){e=i<<1;m=8024+(e<<2)|0;r=c[1996]|0;j=1<>2]|0;if(d>>>0>=(c[2e3]|0)>>>0){O=d;P=i;break;}aq();return 0;}}while(0);c[P>>2]=k;c[O+12>>2]=k;c[q+(g+8)>>2]=O;c[q+(g+12)>>2]=m;break;}e=p;j=J>>>8;do{if((j|0)==0){Q=0;}else{if(J>>>0>16777215){Q=31;break;}r=(j+1048320|0)>>>16&8;i=j<>>16&4;B=i<>>16&2;l=14-(d|r|i)+(B<>>15)|0;Q=J>>>((l+7|0)>>>0)&1|l<<1;}}while(0);j=8288+(Q<<2)|0;c[q+(g+28)>>2]=Q;c[q+(g+20)>>2]=0;c[q+(g+16)>>2]=0;m=c[1997]|0;l=1<>2]=e;c[q+(g+24)>>2]=j;c[q+(g+12)>>2]=e;c[q+(g+8)>>2]=e;break;}if((Q|0)==31){R=0;}else{R=25-(Q>>>1)|0;}l=J<>2]|0;while(1){if((c[m+4>>2]&-8|0)==(J|0)){break;}S=m+16+(l>>>31<<2)|0;j=c[S>>2]|0;if((j|0)==0){T=1913;break;}else{l=l<<1;m=j;}}if((T|0)==1913){if(S>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[S>>2]=e;c[q+(g+24)>>2]=m;c[q+(g+12)>>2]=e;c[q+(g+8)>>2]=e;break;}}l=m+8|0;j=c[l>>2]|0;i=c[2e3]|0;if(m>>>0>>0){aq();return 0;}if(j>>>0>>0){aq();return 0;}else{c[j+12>>2]=e;c[l>>2]=e;c[q+(g+8)>>2]=j;c[q+(g+12)>>2]=m;c[q+(g+24)>>2]=0;break;}}}while(0);q=K+8|0;if((q|0)==0){o=g;break;}else{n=q;}return n|0;}}while(0);K=c[1998]|0;if(o>>>0<=K>>>0){S=K-o|0;J=c[2001]|0;if(S>>>0>15){R=J;c[2001]=R+o;c[1998]=S;c[R+(o+4)>>2]=S|1;c[R+K>>2]=S;c[J+4>>2]=o|3;}else{c[1998]=0;c[2001]=0;c[J+4>>2]=K|3;S=J+(K+4)|0;c[S>>2]=c[S>>2]|1;}n=J+8|0;return n|0;}J=c[1999]|0;if(o>>>0>>0){S=J-o|0;c[1999]=S;J=c[2002]|0;K=J;c[2002]=K+o;c[K+(o+4)>>2]=S|1;c[J+4>>2]=o|3;n=J+8|0;return n|0;}do{if((c[1666]|0)==0){J=am(30)|0;if((J-1&J|0)==0){c[1668]=J;c[1667]=J;c[1669]=-1;c[1670]=-1;c[1671]=0;c[2107]=0;c[1666]=(aJ(0)|0)&-16^1431655768;break;}else{aq();return 0;}}}while(0);J=o+48|0;S=c[1668]|0;K=o+47|0;R=S+K|0;Q=-S|0;S=R&Q;if(S>>>0<=o>>>0){n=0;return n|0;}O=c[2106]|0;do{if((O|0)!=0){P=c[2104]|0;L=P+S|0;if(L>>>0<=P>>>0|L>>>0>O>>>0){n=0;}else{break;}return n|0;}}while(0);L2494:do{if((c[2107]&4|0)==0){O=c[2002]|0;L2496:do{if((O|0)==0){T=1943;}else{L=O;P=8432;while(1){U=P|0;M=c[U>>2]|0;if(M>>>0<=L>>>0){V=P+4|0;if((M+(c[V>>2]|0)|0)>>>0>L>>>0){break;}}M=c[P+8>>2]|0;if((M|0)==0){T=1943;break L2496;}else{P=M;}}if((P|0)==0){T=1943;break;}L=R-(c[1999]|0)&Q;if(L>>>0>=2147483647){W=0;break;}m=aS(L|0)|0;e=(m|0)==((c[U>>2]|0)+(c[V>>2]|0)|0);X=e?m:-1;Y=e?L:0;Z=m;_=L;T=1952;}}while(0);do{if((T|0)==1943){O=aS(0)|0;if((O|0)==-1){W=0;break;}g=O;L=c[1667]|0;m=L-1|0;if((m&g|0)==0){$=S;}else{$=S-g+(m+g&-L)|0;}L=c[2104]|0;g=L+$|0;if(!($>>>0>o>>>0&$>>>0<2147483647)){W=0;break;}m=c[2106]|0;if((m|0)!=0){if(g>>>0<=L>>>0|g>>>0>m>>>0){W=0;break;}}m=aS($|0)|0;g=(m|0)==(O|0);X=g?O:-1;Y=g?$:0;Z=m;_=$;T=1952;}}while(0);L2516:do{if((T|0)==1952){m=-_|0;if((X|0)!=-1){aa=Y;ab=X;T=1963;break L2494;}do{if((Z|0)!=-1&_>>>0<2147483647&_>>>0>>0){g=c[1668]|0;O=K-_+g&-g;if(O>>>0>=2147483647){ac=_;break;}if((aS(O|0)|0)==-1){aS(m|0)|0;W=Y;break L2516;}else{ac=O+_|0;break;}}else{ac=_;}}while(0);if((Z|0)==-1){W=Y;}else{aa=ac;ab=Z;T=1963;break L2494;}}}while(0);c[2107]=c[2107]|4;ad=W;T=1960;}else{ad=0;T=1960;}}while(0);do{if((T|0)==1960){if(S>>>0>=2147483647){break;}W=aS(S|0)|0;Z=aS(0)|0;if(!((Z|0)!=-1&(W|0)!=-1&W>>>0>>0)){break;}ac=Z-W|0;Z=ac>>>0>(o+40|0)>>>0;Y=Z?W:-1;if((Y|0)!=-1){aa=Z?ac:ad;ab=Y;T=1963;}}}while(0);do{if((T|0)==1963){ad=(c[2104]|0)+aa|0;c[2104]=ad;if(ad>>>0>(c[2105]|0)>>>0){c[2105]=ad;}ad=c[2002]|0;L2536:do{if((ad|0)==0){S=c[2e3]|0;if((S|0)==0|ab>>>0>>0){c[2e3]=ab;}c[2108]=ab;c[2109]=aa;c[2111]=0;c[2005]=c[1666];c[2004]=-1;S=0;do{Y=S<<1;ac=8024+(Y<<2)|0;c[8024+(Y+3<<2)>>2]=ac;c[8024+(Y+2<<2)>>2]=ac;S=S+1|0;}while(S>>>0<32);S=ab+8|0;if((S&7|0)==0){ae=0;}else{ae=-S&7;}S=aa-40-ae|0;c[2002]=ab+ae;c[1999]=S;c[ab+(ae+4)>>2]=S|1;c[ab+(aa-36)>>2]=40;c[2003]=c[1670];}else{S=8432;while(1){af=c[S>>2]|0;ag=S+4|0;ah=c[ag>>2]|0;if((ab|0)==(af+ah|0)){T=1975;break;}ac=c[S+8>>2]|0;if((ac|0)==0){break;}else{S=ac;}}do{if((T|0)==1975){if((c[S+12>>2]&8|0)!=0){break;}ac=ad;if(!(ac>>>0>=af>>>0&ac>>>0>>0)){break;}c[ag>>2]=ah+aa;ac=c[2002]|0;Y=(c[1999]|0)+aa|0;Z=ac;W=ac+8|0;if((W&7|0)==0){ai=0;}else{ai=-W&7;}W=Y-ai|0;c[2002]=Z+ai;c[1999]=W;c[Z+(ai+4)>>2]=W|1;c[Z+(Y+4)>>2]=40;c[2003]=c[1670];break L2536;}}while(0);if(ab>>>0<(c[2e3]|0)>>>0){c[2e3]=ab;}S=ab+aa|0;Y=8432;while(1){aj=Y|0;if((c[aj>>2]|0)==(S|0)){T=1985;break;}Z=c[Y+8>>2]|0;if((Z|0)==0){break;}else{Y=Z;}}do{if((T|0)==1985){if((c[Y+12>>2]&8|0)!=0){break;}c[aj>>2]=ab;S=Y+4|0;c[S>>2]=(c[S>>2]|0)+aa;S=ab+8|0;if((S&7|0)==0){ak=0;}else{ak=-S&7;}S=ab+(aa+8)|0;if((S&7|0)==0){al=0;}else{al=-S&7;}S=ab+(al+aa)|0;Z=S;W=ak+o|0;ac=ab+W|0;_=ac;K=S-(ab+ak)-o|0;c[ab+(ak+4)>>2]=o|3;do{if((Z|0)==(c[2002]|0)){J=(c[1999]|0)+K|0;c[1999]=J;c[2002]=_;c[ab+(W+4)>>2]=J|1;}else{if((Z|0)==(c[2001]|0)){J=(c[1998]|0)+K|0;c[1998]=J;c[2001]=_;c[ab+(W+4)>>2]=J|1;c[ab+(J+W)>>2]=J;break;}J=aa+4|0;X=c[ab+(J+al)>>2]|0;if((X&3|0)==1){$=X&-8;V=X>>>3;L2571:do{if(X>>>0<256){U=c[ab+((al|8)+aa)>>2]|0;Q=c[ab+(aa+12+al)>>2]|0;R=8024+(V<<1<<2)|0;do{if((U|0)!=(R|0)){if(U>>>0<(c[2e3]|0)>>>0){aq();return 0;}if((c[U+12>>2]|0)==(Z|0)){break;}aq();return 0;}}while(0);if((Q|0)==(U|0)){c[1996]=c[1996]&~(1<>>0<(c[2e3]|0)>>>0){aq();return 0;}m=Q+8|0;if((c[m>>2]|0)==(Z|0)){an=m;break;}aq();return 0;}}while(0);c[U+12>>2]=Q;c[an>>2]=U;}else{R=S;m=c[ab+((al|24)+aa)>>2]|0;P=c[ab+(aa+12+al)>>2]|0;do{if((P|0)==(R|0)){O=al|16;g=ab+(J+O)|0;L=c[g>>2]|0;if((L|0)==0){e=ab+(O+aa)|0;O=c[e>>2]|0;if((O|0)==0){ao=0;break;}else{ap=O;ar=e;}}else{ap=L;ar=g;}while(1){g=ap+20|0;L=c[g>>2]|0;if((L|0)!=0){ap=L;ar=g;continue;}g=ap+16|0;L=c[g>>2]|0;if((L|0)==0){break;}else{ap=L;ar=g;}}if(ar>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[ar>>2]=0;ao=ap;break;}}else{g=c[ab+((al|8)+aa)>>2]|0;if(g>>>0<(c[2e3]|0)>>>0){aq();return 0;}L=g+12|0;if((c[L>>2]|0)!=(R|0)){aq();return 0;}e=P+8|0;if((c[e>>2]|0)==(R|0)){c[L>>2]=P;c[e>>2]=g;ao=P;break;}else{aq();return 0;}}}while(0);if((m|0)==0){break;}P=ab+(aa+28+al)|0;U=8288+(c[P>>2]<<2)|0;do{if((R|0)==(c[U>>2]|0)){c[U>>2]=ao;if((ao|0)!=0){break;}c[1997]=c[1997]&~(1<>2]);break L2571;}else{if(m>>>0<(c[2e3]|0)>>>0){aq();return 0;}Q=m+16|0;if((c[Q>>2]|0)==(R|0)){c[Q>>2]=ao;}else{c[m+20>>2]=ao;}if((ao|0)==0){break L2571;}}}while(0);if(ao>>>0<(c[2e3]|0)>>>0){aq();return 0;}c[ao+24>>2]=m;R=al|16;P=c[ab+(R+aa)>>2]|0;do{if((P|0)!=0){if(P>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[ao+16>>2]=P;c[P+24>>2]=ao;break;}}}while(0);P=c[ab+(J+R)>>2]|0;if((P|0)==0){break;}if(P>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[ao+20>>2]=P;c[P+24>>2]=ao;break;}}}while(0);as=ab+(($|al)+aa)|0;at=$+K|0;}else{as=Z;at=K;}J=as+4|0;c[J>>2]=c[J>>2]&-2;c[ab+(W+4)>>2]=at|1;c[ab+(at+W)>>2]=at;J=at>>>3;if(at>>>0<256){V=J<<1;X=8024+(V<<2)|0;P=c[1996]|0;m=1<>2]|0;if(U>>>0>=(c[2e3]|0)>>>0){au=U;av=J;break;}aq();return 0;}}while(0);c[av>>2]=_;c[au+12>>2]=_;c[ab+(W+8)>>2]=au;c[ab+(W+12)>>2]=X;break;}V=ac;m=at>>>8;do{if((m|0)==0){aw=0;}else{if(at>>>0>16777215){aw=31;break;}P=(m+1048320|0)>>>16&8;$=m<>>16&4;U=$<>>16&2;Q=14-(J|P|$)+(U<<$>>>15)|0;aw=at>>>((Q+7|0)>>>0)&1|Q<<1;}}while(0);m=8288+(aw<<2)|0;c[ab+(W+28)>>2]=aw;c[ab+(W+20)>>2]=0;c[ab+(W+16)>>2]=0;X=c[1997]|0;Q=1<>2]=V;c[ab+(W+24)>>2]=m;c[ab+(W+12)>>2]=V;c[ab+(W+8)>>2]=V;break;}if((aw|0)==31){ax=0;}else{ax=25-(aw>>>1)|0;}Q=at<>2]|0;while(1){if((c[X+4>>2]&-8|0)==(at|0)){break;}ay=X+16+(Q>>>31<<2)|0;m=c[ay>>2]|0;if((m|0)==0){T=2058;break;}else{Q=Q<<1;X=m;}}if((T|0)==2058){if(ay>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[ay>>2]=V;c[ab+(W+24)>>2]=X;c[ab+(W+12)>>2]=V;c[ab+(W+8)>>2]=V;break;}}Q=X+8|0;m=c[Q>>2]|0;$=c[2e3]|0;if(X>>>0<$>>>0){aq();return 0;}if(m>>>0<$>>>0){aq();return 0;}else{c[m+12>>2]=V;c[Q>>2]=V;c[ab+(W+8)>>2]=m;c[ab+(W+12)>>2]=X;c[ab+(W+24)>>2]=0;break;}}}while(0);n=ab+(ak|8)|0;return n|0;}}while(0);Y=ad;W=8432;while(1){az=c[W>>2]|0;if(az>>>0<=Y>>>0){aA=c[W+4>>2]|0;aB=az+aA|0;if(aB>>>0>Y>>>0){break;}}W=c[W+8>>2]|0;}W=az+(aA-39)|0;if((W&7|0)==0){aC=0;}else{aC=-W&7;}W=az+(aA-47+aC)|0;ac=W>>>0<(ad+16|0)>>>0?Y:W;W=ac+8|0;_=ab+8|0;if((_&7|0)==0){aD=0;}else{aD=-_&7;}_=aa-40-aD|0;c[2002]=ab+aD;c[1999]=_;c[ab+(aD+4)>>2]=_|1;c[ab+(aa-36)>>2]=40;c[2003]=c[1670];c[ac+4>>2]=27;c[W>>2]=c[2108];c[W+4>>2]=c[2109];c[W+8>>2]=c[2110];c[W+12>>2]=c[2111];c[2108]=ab;c[2109]=aa;c[2111]=0;c[2110]=W;W=ac+28|0;c[W>>2]=7;if((ac+32|0)>>>0>>0){_=W;while(1){W=_+4|0;c[W>>2]=7;if((_+8|0)>>>0>>0){_=W;}else{break;}}}if((ac|0)==(Y|0)){break;}_=ac-ad|0;W=Y+(_+4)|0;c[W>>2]=c[W>>2]&-2;c[ad+4>>2]=_|1;c[Y+_>>2]=_;W=_>>>3;if(_>>>0<256){K=W<<1;Z=8024+(K<<2)|0;S=c[1996]|0;m=1<>2]|0;if(Q>>>0>=(c[2e3]|0)>>>0){aE=Q;aF=W;break;}aq();return 0;}}while(0);c[aF>>2]=ad;c[aE+12>>2]=ad;c[ad+8>>2]=aE;c[ad+12>>2]=Z;break;}K=ad;m=_>>>8;do{if((m|0)==0){aG=0;}else{if(_>>>0>16777215){aG=31;break;}S=(m+1048320|0)>>>16&8;Y=m<>>16&4;W=Y<>>16&2;Q=14-(ac|S|Y)+(W<>>15)|0;aG=_>>>((Q+7|0)>>>0)&1|Q<<1;}}while(0);m=8288+(aG<<2)|0;c[ad+28>>2]=aG;c[ad+20>>2]=0;c[ad+16>>2]=0;Z=c[1997]|0;Q=1<>2]=K;c[ad+24>>2]=m;c[ad+12>>2]=ad;c[ad+8>>2]=ad;break;}if((aG|0)==31){aH=0;}else{aH=25-(aG>>>1)|0;}Q=_<>2]|0;while(1){if((c[Z+4>>2]&-8|0)==(_|0)){break;}aI=Z+16+(Q>>>31<<2)|0;m=c[aI>>2]|0;if((m|0)==0){T=2093;break;}else{Q=Q<<1;Z=m;}}if((T|0)==2093){if(aI>>>0<(c[2e3]|0)>>>0){aq();return 0;}else{c[aI>>2]=K;c[ad+24>>2]=Z;c[ad+12>>2]=ad;c[ad+8>>2]=ad;break;}}Q=Z+8|0;_=c[Q>>2]|0;m=c[2e3]|0;if(Z>>>0>>0){aq();return 0;}if(_>>>0>>0){aq();return 0;}else{c[_+12>>2]=K;c[Q>>2]=K;c[ad+8>>2]=_;c[ad+12>>2]=Z;c[ad+24>>2]=0;break;}}}while(0);ad=c[1999]|0;if(ad>>>0<=o>>>0){break;}_=ad-o|0;c[1999]=_;ad=c[2002]|0;Q=ad;c[2002]=Q+o;c[Q+(o+4)>>2]=_|1;c[ad+4>>2]=o|3;n=ad+8|0;return n|0;}}while(0);c[(aQ()|0)>>2]=12;n=0;return n|0;}function c0(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;if((a|0)==0){return;}b=a-8|0;d=b;e=c[2e3]|0;if(b>>>0>>0){aq();}f=c[a-4>>2]|0;g=f&3;if((g|0)==1){aq();}h=f&-8;i=a+(h-8)|0;j=i;L2753:do{if((f&1|0)==0){k=c[b>>2]|0;if((g|0)==0){return;}l=-8-k|0;m=a+l|0;n=m;o=k+h|0;if(m>>>0>>0){aq();}if((n|0)==(c[2001]|0)){p=a+(h-4)|0;if((c[p>>2]&3|0)!=3){q=n;r=o;break;}c[1998]=o;c[p>>2]=c[p>>2]&-2;c[a+(l+4)>>2]=o|1;c[i>>2]=o;return;}p=k>>>3;if(k>>>0<256){k=c[a+(l+8)>>2]|0;s=c[a+(l+12)>>2]|0;t=8024+(p<<1<<2)|0;do{if((k|0)!=(t|0)){if(k>>>0>>0){aq();}if((c[k+12>>2]|0)==(n|0)){break;}aq();}}while(0);if((s|0)==(k|0)){c[1996]=c[1996]&~(1<>>0>>0){aq();}v=s+8|0;if((c[v>>2]|0)==(n|0)){u=v;break;}aq();}}while(0);c[k+12>>2]=s;c[u>>2]=k;q=n;r=o;break;}t=m;p=c[a+(l+24)>>2]|0;v=c[a+(l+12)>>2]|0;do{if((v|0)==(t|0)){w=a+(l+20)|0;x=c[w>>2]|0;if((x|0)==0){y=a+(l+16)|0;z=c[y>>2]|0;if((z|0)==0){A=0;break;}else{B=z;C=y;}}else{B=x;C=w;}while(1){w=B+20|0;x=c[w>>2]|0;if((x|0)!=0){B=x;C=w;continue;}w=B+16|0;x=c[w>>2]|0;if((x|0)==0){break;}else{B=x;C=w;}}if(C>>>0>>0){aq();}else{c[C>>2]=0;A=B;break;}}else{w=c[a+(l+8)>>2]|0;if(w>>>0>>0){aq();}x=w+12|0;if((c[x>>2]|0)!=(t|0)){aq();}y=v+8|0;if((c[y>>2]|0)==(t|0)){c[x>>2]=v;c[y>>2]=w;A=v;break;}else{aq();}}}while(0);if((p|0)==0){q=n;r=o;break;}v=a+(l+28)|0;m=8288+(c[v>>2]<<2)|0;do{if((t|0)==(c[m>>2]|0)){c[m>>2]=A;if((A|0)!=0){break;}c[1997]=c[1997]&~(1<>2]);q=n;r=o;break L2753;}else{if(p>>>0<(c[2e3]|0)>>>0){aq();}k=p+16|0;if((c[k>>2]|0)==(t|0)){c[k>>2]=A;}else{c[p+20>>2]=A;}if((A|0)==0){q=n;r=o;break L2753;}}}while(0);if(A>>>0<(c[2e3]|0)>>>0){aq();}c[A+24>>2]=p;t=c[a+(l+16)>>2]|0;do{if((t|0)!=0){if(t>>>0<(c[2e3]|0)>>>0){aq();}else{c[A+16>>2]=t;c[t+24>>2]=A;break;}}}while(0);t=c[a+(l+20)>>2]|0;if((t|0)==0){q=n;r=o;break;}if(t>>>0<(c[2e3]|0)>>>0){aq();}else{c[A+20>>2]=t;c[t+24>>2]=A;q=n;r=o;break;}}else{q=d;r=h;}}while(0);d=q;if(d>>>0>=i>>>0){aq();}A=a+(h-4)|0;e=c[A>>2]|0;if((e&1|0)==0){aq();}do{if((e&2|0)==0){if((j|0)==(c[2002]|0)){B=(c[1999]|0)+r|0;c[1999]=B;c[2002]=q;c[q+4>>2]=B|1;if((q|0)!=(c[2001]|0)){return;}c[2001]=0;c[1998]=0;return;}if((j|0)==(c[2001]|0)){B=(c[1998]|0)+r|0;c[1998]=B;c[2001]=q;c[q+4>>2]=B|1;c[d+B>>2]=B;return;}B=(e&-8)+r|0;C=e>>>3;L2856:do{if(e>>>0<256){u=c[a+h>>2]|0;g=c[a+(h|4)>>2]|0;b=8024+(C<<1<<2)|0;do{if((u|0)!=(b|0)){if(u>>>0<(c[2e3]|0)>>>0){aq();}if((c[u+12>>2]|0)==(j|0)){break;}aq();}}while(0);if((g|0)==(u|0)){c[1996]=c[1996]&~(1<>>0<(c[2e3]|0)>>>0){aq();}f=g+8|0;if((c[f>>2]|0)==(j|0)){D=f;break;}aq();}}while(0);c[u+12>>2]=g;c[D>>2]=u;}else{b=i;f=c[a+(h+16)>>2]|0;t=c[a+(h|4)>>2]|0;do{if((t|0)==(b|0)){p=a+(h+12)|0;v=c[p>>2]|0;if((v|0)==0){m=a+(h+8)|0;k=c[m>>2]|0;if((k|0)==0){E=0;break;}else{F=k;G=m;}}else{F=v;G=p;}while(1){p=F+20|0;v=c[p>>2]|0;if((v|0)!=0){F=v;G=p;continue;}p=F+16|0;v=c[p>>2]|0;if((v|0)==0){break;}else{F=v;G=p;}}if(G>>>0<(c[2e3]|0)>>>0){aq();}else{c[G>>2]=0;E=F;break;}}else{p=c[a+h>>2]|0;if(p>>>0<(c[2e3]|0)>>>0){aq();}v=p+12|0;if((c[v>>2]|0)!=(b|0)){aq();}m=t+8|0;if((c[m>>2]|0)==(b|0)){c[v>>2]=t;c[m>>2]=p;E=t;break;}else{aq();}}}while(0);if((f|0)==0){break;}t=a+(h+20)|0;u=8288+(c[t>>2]<<2)|0;do{if((b|0)==(c[u>>2]|0)){c[u>>2]=E;if((E|0)!=0){break;}c[1997]=c[1997]&~(1<>2]);break L2856;}else{if(f>>>0<(c[2e3]|0)>>>0){aq();}g=f+16|0;if((c[g>>2]|0)==(b|0)){c[g>>2]=E;}else{c[f+20>>2]=E;}if((E|0)==0){break L2856;}}}while(0);if(E>>>0<(c[2e3]|0)>>>0){aq();}c[E+24>>2]=f;b=c[a+(h+8)>>2]|0;do{if((b|0)!=0){if(b>>>0<(c[2e3]|0)>>>0){aq();}else{c[E+16>>2]=b;c[b+24>>2]=E;break;}}}while(0);b=c[a+(h+12)>>2]|0;if((b|0)==0){break;}if(b>>>0<(c[2e3]|0)>>>0){aq();}else{c[E+20>>2]=b;c[b+24>>2]=E;break;}}}while(0);c[q+4>>2]=B|1;c[d+B>>2]=B;if((q|0)!=(c[2001]|0)){H=B;break;}c[1998]=B;return;}else{c[A>>2]=e&-2;c[q+4>>2]=r|1;c[d+r>>2]=r;H=r;}}while(0);r=H>>>3;if(H>>>0<256){d=r<<1;e=8024+(d<<2)|0;A=c[1996]|0;E=1<>2]|0;if(h>>>0>=(c[2e3]|0)>>>0){I=h;J=r;break;}aq();}}while(0);c[J>>2]=q;c[I+12>>2]=q;c[q+8>>2]=I;c[q+12>>2]=e;return;}e=q;I=H>>>8;do{if((I|0)==0){K=0;}else{if(H>>>0>16777215){K=31;break;}J=(I+1048320|0)>>>16&8;d=I<>>16&4;A=d<>>16&2;r=14-(E|J|d)+(A<>>15)|0;K=H>>>((r+7|0)>>>0)&1|r<<1;}}while(0);I=8288+(K<<2)|0;c[q+28>>2]=K;c[q+20>>2]=0;c[q+16>>2]=0;r=c[1997]|0;d=1<>2]=e;c[q+24>>2]=I;c[q+12>>2]=q;c[q+8>>2]=q;}else{if((K|0)==31){L=0;}else{L=25-(K>>>1)|0;}A=H<>2]|0;while(1){if((c[J+4>>2]&-8|0)==(H|0)){break;}M=J+16+(A>>>31<<2)|0;E=c[M>>2]|0;if((E|0)==0){N=2270;break;}else{A=A<<1;J=E;}}if((N|0)==2270){if(M>>>0<(c[2e3]|0)>>>0){aq();}else{c[M>>2]=e;c[q+24>>2]=J;c[q+12>>2]=q;c[q+8>>2]=q;break;}}A=J+8|0;B=c[A>>2]|0;E=c[2e3]|0;if(J>>>0>>0){aq();}if(B>>>0>>0){aq();}else{c[B+12>>2]=e;c[A>>2]=e;c[q+8>>2]=B;c[q+12>>2]=J;c[q+24>>2]=0;break;}}}while(0);q=(c[2004]|0)-1|0;c[2004]=q;if((q|0)==0){O=8440;}else{return;}while(1){q=c[O>>2]|0;if((q|0)==0){break;}else{O=q+8|0;}}c[2004]=-1;return;}function c1(b){b=b|0;var c=0;c=b;while(a[c]|0){c=c+1|0;}return c-b|0;}function c2(b,c){b=b|0;c=c|0;var d=0;do{a[b+d|0]=a[c+d|0];d=d+1|0;}while(a[c+(d-1)|0]|0);return b|0;}function c3(b,c){b=b|0;c=c|0;var d=0,e=0;d=b+(c1(b)|0)|0;do{a[d+e|0]=a[c+e|0];e=e+1|0;}while(a[c+(e-1)|0]|0);return b|0;}function c4(a,b,c){a=a|0;b=b|0;c=c|0;var e=0,f=0,g=0;while((e|0)<(c|0)){f=d[a+e|0]|0;g=d[b+e|0]|0;if((f|0)!=(g|0))return((f|0)>(g|0)?1:-1)|0;e=e+1|0;}return 0;}function c5(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;f=b+e|0;if((e|0)>=20){d=d&255;e=b&3;g=d|d<<8|d<<16|d<<24;h=f&~3;if(e){e=b+4-e|0;while((b|0)<(e|0)){a[b]=d;b=b+1|0;}}while((b|0)<(h|0)){c[b>>2]=g;b=b+4|0;}}while((b|0)<(f|0)){a[b]=d;b=b+1|0;}}function c6(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;f=b|0;if((b&3)==(d&3)){while(b&3){if((e|0)==0)return f|0;a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0;}while((e|0)>=4){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;e=e-4|0;}}while((e|0)>0){a[b]=a[d]|0;b=b+1|0;d=d+1|0;e=e-1|0;}return f|0;}function c7(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0;while((e|0)<(d|0)){a[b+e|0]=f?0:a[c+e|0]|0;f=f?1:(a[c+e|0]|0)==0;e=e+1|0;}return b|0;}function c8(a,b){a=a|0;b=b|0;return aW[a&7](b|0)|0;}function c9(a,b){a=a|0;b=b|0;aX[a&1](b|0);}function da(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return aY[a&7](b|0,c|0,d|0,e|0)|0;}function db(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;aZ[a&15](b|0,c|0,d|0);}function dc(a){a=a|0;a_[a&1]();}function dd(a,b,c){a=a|0;b=b|0;c=c|0;return a$[a&1](b|0,c|0)|0;}function de(a){a=a|0;$(0);return 0;}function df(a){a=a|0;$(1);}function dg(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;$(2);return 0;}function dh(a,b,c){a=a|0;b=b|0;c=c|0;$(3);}function di(){$(4);}function dj(a,b){a=a|0;b=b|0;$(5);return 0;}// EMSCRIPTEN_END_FUNCS\nvar aW=[de,de,cL,de,cJ,de,de,de];var aX=[df,df];var aY=[dg,dg,cI,dg,cK,dg,dg,dg];var aZ=[dh,dh,bZ,dh,b$,dh,b_,dh,bY,dh,bX,dh,dh,dh,dh,dh];var a_=[di,di];var a$=[dj,dj];return{_strlen:c1,_strcat:c3,_mid_create_options:cV,_mid_istream_open_mem:cO,_mid_istream_open_file:cN,_mid_song_read_wave:b6,_mid_exit:cZ,_mid_song_note_on:b0,_strncpy:c7,_memset:c5,_memcpy:c6,_mid_song_get_missing_instrument:bu,_mid_istream_close:cR,_mid_song_free:cY,_mid_init:cT,_mid_song_load:cX,_mid_song_start:b3,_mid_song_get_num_missing_instruments:bt,_memcmp:c4,_free:c0,_malloc:c$,_strcpy:c2,runPostSets:bg,stackAlloc:a0,stackSave:a1,stackRestore:a2,setThrew:a3,setTempRet0:a6,setTempRet1:a7,setTempRet2:a8,setTempRet3:a9,setTempRet4:ba,setTempRet5:bb,setTempRet6:bc,setTempRet7:bd,setTempRet8:be,setTempRet9:bf,dynCall_ii:c8,dynCall_vi:c9,dynCall_iiiii:da,dynCall_viii:db,dynCall_v:dc,dynCall_iii:dd};}(// EMSCRIPTEN_END_ASM\n{Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array},{abort:abort,assert:assert,asmPrintInt:asmPrintInt,asmPrintFloat:asmPrintFloat,min:Math_min,invoke_ii:invoke_ii,invoke_vi:invoke_vi,invoke_iiiii:invoke_iiiii,invoke_viii:invoke_viii,invoke_v:invoke_v,invoke_iii:invoke_iii,_strncmp:_strncmp,_lseek:_lseek,_sysconf:_sysconf,_fread:_fread,_fclose:_fclose,_strtok_r:_strtok_r,_abort:_abort,_fprintf:_fprintf,_close:_close,_pread:_pread,_fflush:_fflush,_fopen:_fopen,_open:_open,_strtol:_strtol,_strtok:_strtok,___setErrNo:___setErrNo,__reallyNegative:__reallyNegative,_fseek:_fseek,_send:_send,_write:_write,_strrchr:_strrchr,_sin:_sin,_printf:_printf,_strchr:_strchr,_read:_read,_time:_time,__formatString:__formatString,_atoi:_atoi,_recv:_recv,_pwrite:_pwrite,_llvm_pow_f64:_llvm_pow_f64,_fsync:_fsync,___errno_location:___errno_location,_isspace:_isspace,_sbrk:_sbrk,__parseInt:__parseInt,_fwrite:_fwrite,_strcmp:_strcmp,STACKTOP:STACKTOP,STACK_MAX:STACK_MAX,tempDoublePtr:tempDoublePtr,ABORT:ABORT,NaN:NaN,Infinity:Infinity,_stderr:_stderr},buffer);var _strlen=Module['_strlen']=asm['_strlen'];var _strcat=Module['_strcat']=asm['_strcat'];var _mid_create_options=Module['_mid_create_options']=asm['_mid_create_options'];var _mid_istream_open_mem=Module['_mid_istream_open_mem']=asm['_mid_istream_open_mem'];var _mid_istream_open_file=Module['_mid_istream_open_file']=asm['_mid_istream_open_file'];var _mid_song_read_wave=Module['_mid_song_read_wave']=asm['_mid_song_read_wave'];var _mid_exit=Module['_mid_exit']=asm['_mid_exit'];var _mid_song_note_on=Module['_mid_song_note_on']=asm['_mid_song_note_on'];var _strncpy=Module['_strncpy']=asm['_strncpy'];var _memset=Module['_memset']=asm['_memset'];var _memcpy=Module['_memcpy']=asm['_memcpy'];var _mid_song_get_missing_instrument=Module['_mid_song_get_missing_instrument']=asm['_mid_song_get_missing_instrument'];var _mid_istream_close=Module['_mid_istream_close']=asm['_mid_istream_close'];var _mid_song_free=Module['_mid_song_free']=asm['_mid_song_free'];var _mid_init=Module['_mid_init']=asm['_mid_init'];var _mid_song_load=Module['_mid_song_load']=asm['_mid_song_load'];var _mid_song_start=Module['_mid_song_start']=asm['_mid_song_start'];var _mid_song_get_num_missing_instruments=Module['_mid_song_get_num_missing_instruments']=asm['_mid_song_get_num_missing_instruments'];var _memcmp=Module['_memcmp']=asm['_memcmp'];var _free=Module['_free']=asm['_free'];var _malloc=Module._malloc=asm['_malloc'];var _strcpy=Module['_strcpy']=asm['_strcpy'];var runPostSets=Module['runPostSets']=asm['runPostSets'];var dynCall_ii=Module['dynCall_ii']=asm['dynCall_ii'];var dynCall_vi=Module['dynCall_vi']=asm['dynCall_vi'];var dynCall_iiiii=Module['dynCall_iiiii']=asm['dynCall_iiiii'];var dynCall_viii=Module['dynCall_viii']=asm['dynCall_viii'];var dynCall_v=Module['dynCall_v']=asm['dynCall_v'];var dynCall_iii=Module['dynCall_iii']=asm['dynCall_iii'];Runtime.stackAlloc=function(size){return asm['stackAlloc'](size);};Runtime.stackSave=function(){return asm['stackSave']();};Runtime.stackRestore=function(top){asm['stackRestore'](top);};// Warning: printing of i64 values may be slightly rounded! No deep i64 math used, so precise i64 code not included\nvar i64Math=null;// === Auto-generated postamble setup entry stuff ===\nif(memoryInitializer){var applyData=function applyData(data){HEAPU8.set(data,STATIC_BASE);};addRunDependency('memory initializer');Browser.asyncLoad(memoryInitializer,function(data){applyData(data);removeRunDependency('memory initializer');},function(data){throw'could not load memory initializer '+memoryInitializer;});}var initialStackTop;var preloadStartTime=null;var calledRun=false;dependenciesFulfilled=function runCaller(){// If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)\nif(!calledRun&&shouldRunNow)run();if(!calledRun)dependenciesFulfilled=runCaller;// try this again later, after new deps are fulfilled\n};Module['callMain']=Module.callMain=function callMain(args){assert(runDependencies==0,'cannot call main when async dependencies remain! (listen on __ATMAIN__)');assert(__ATPRERUN__.length==0,'cannot call main when preRun functions remain to be called');args=args||[];if(preloadStartTime!==null){console.warn('preload time: '+(Date.now()-preloadStartTime)+' ms');}ensureInitRuntime();var argc=args.length+1;function pad(){for(var i=0;i<4-1;i++){argv.push(0);}}var argv=[allocate(intArrayFromString('/bin/this.program'),'i8',ALLOC_NORMAL)];pad();for(var i=0;i0){console.warn('run() called, but dependencies remain, so not running');return FS;}preRun();if(runDependencies>0){// a preRun added a dependency, run will be called later\nreturn FS;}function doRun(){ensureInitRuntime();preMain();calledRun=true;if(Module['_main']&&shouldRunNow){Module['callMain'](args);}postRun();}if(Module['setStatus']){Module['setStatus']('Running...');setTimeout(function(){setTimeout(function(){Module['setStatus']('');},1);if(!ABORT)doRun();},1);}else{doRun();}return FS;}Module.run=run;/**\n * Initializes the library.\n * @function init\n * @memberof LibTiMidity\n * @param {boolean} [throwError = true] Throw an error if file/folder creation failed.\n * @instance\n */Module.init=function(){var throwError=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;// creates folders for instrument patches\nModule.createPath('/',_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_PATCH_DIRECTORY */ \"e\"],throwError);Module.createPath(\"/\".concat(_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_PATCH_DIRECTORY */ \"e\"]),_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_PATCH_DRUM_DIRECTORY */ \"f\"],throwError);// creates config file\nModule.createDataFile('/',_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_CONFIG_FILE */ \"b\"],_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIBTIMIDITY_CONFIG_DATA */ \"a\"],true,true,undefined,throwError);};// shouldRunNow refers to calling main(), not run().\nvar shouldRunNow=true;if(Module['noInitialRun']){shouldRunNow=false;}Module.FS=run();this.Module=Module;};var libtimidity=new LibTiMidity();/* harmony default export */ __webpack_exports__[\"a\"] = (libtimidity.Module);\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(12).Buffer))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL3NyYy9MaWJUaU1pZGl0eS5qcz9jYjIwIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7XG4gICAgTElCVElNSURJVFlfUEFUQ0hfRElSRUNUT1JZLFxuICAgIExJQlRJTUlESVRZX1BBVENIX0RSVU1fRElSRUNUT1JZLFxuICAgIExJQlRJTUlESVRZX0NPTkZJR19GSUxFLFxuICAgIExJQlRJTUlESVRZX0NPTkZJR19EQVRBLFxuICAgIExJQlRJTUlESVRZX0VSUk9SX0NPREVTIGFzIEVSUk5PX0NPREVTLFxuICAgIExJQlRJTUlESVRZX0VSUk9SX01FU1NBR0VTIGFzIEVSUk5PX01FU1NBR0VTXG59IGZyb20gJy4vY29uc3RhbnRzJztcblxuLy8gaHR0cHM6Ly9naXRodWIuY29tL2tyaXBrZW4vZW1zY3JpcHRlbi93aWtpL1xuXG5jb25zdCBJTlRfVFlQRVMgPSB7IGkxOiAwLCBpODogMCwgaTE2OiAwLCBpMzI6IDAsIGk2NDogMCB9O1xuY29uc3QgRkxPQVRfVFlQRVMgPSB7IGZsb2F0OiAwLCBkb3VibGU6IDAgfTtcblxuLyoqIEBjbGFzcyAqL1xuY2xhc3MgTGliVGlNaWRpdHkge1xuICAgIC8qKlxuICAgICAqIExpYnJhcnkgdG8gYWxsb3cgdGhlIGhhbmRsaW5nIG9mIE1JREkgZmlsZXMuXG4gICAgICogQHBhcmFtIHt1bmRlZmluZWR9XG4gICAgICogQHJldHVybiB7b2JqZWN0fSBUaGUgbW9kdWxlIG9mIGFuIGluc3RhbmNlIG9mIExpYlRpTWlkaXR5LlxuICAgICAqL1xuICAgIGNvbnN0cnVjdG9yKCkge1xuICAgICAgICBjb25zdCBSdW50aW1lID0ge1xuICAgICAgICAgICAgc3RhY2tTYXZlOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gU1RBQ0tUT1A7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc3RhY2tSZXN0b3JlOiBmdW5jdGlvbihzdGFja1RvcCkge1xuICAgICAgICAgICAgICAgIFNUQUNLVE9QID0gc3RhY2tUb3A7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaXNOdW1iZXJUeXBlOiBmdW5jdGlvbih0eXBlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHR5cGUgaW4gSU5UX1RZUEVTIHx8IHR5cGUgaW4gRkxPQVRfVFlQRVM7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaXNQb2ludGVyVHlwZTogZnVuY3Rpb24gaXNQb2ludGVyVHlwZSh0eXBlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHR5cGVbdHlwZS5sZW5ndGggLSAxXSA9PSAnKic7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaXNTdHJ1Y3RUeXBlOiBmdW5jdGlvbiBpc1N0cnVjdFR5cGUodHlwZSkge1xuICAgICAgICAgICAgICAgIGlmIChpc1BvaW50ZXJUeXBlKHR5cGUpKSByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgaWYgKGlzQXJyYXlUeXBlKHR5cGUpKSByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICBpZiAoLzw/eyA/W159XSogP30+Py8udGVzdCh0eXBlKSkgcmV0dXJuIHRydWU7IC8vIHsgaTMyLCBpOCB9IGV0Yy4gLSBhbm9ueW1vdXMgc3RydWN0IHR5cGVzXG4gICAgICAgICAgICAgICAgLy8gU2VlIGNvbW1lbnQgaW4gaXNTdHJ1Y3RQb2ludGVyVHlwZSgpXG4gICAgICAgICAgICAgICAgcmV0dXJuIHR5cGVbMF0gPT0gJyUnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdldE5hdGl2ZVR5cGVTaXplOiBmdW5jdGlvbih0eXBlKSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh0eXBlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2kxJzpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnaTgnOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDE7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2kxNic6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMjtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnaTMyJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiA0O1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdpNjQnOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDg7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2Zsb2F0JzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiA0O1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdkb3VibGUnOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDg7XG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlW3R5cGUubGVuZ3RoIC0gMV0gPT09ICcqJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBSdW50aW1lLlFVQU5UVU1fU0laRTsgLy8gQSBwb2ludGVyXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVbMF0gPT09ICdpJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBiaXRzID0gcGFyc2VJbnQodHlwZS5zdWJzdHIoMSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFzc2VydChiaXRzICUgOCA9PT0gMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJpdHMgLyA4O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdldE5hdGl2ZUZpZWxkU2l6ZTogZnVuY3Rpb24odHlwZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBNYXRoLm1heChcbiAgICAgICAgICAgICAgICAgICAgUnVudGltZS5nZXROYXRpdmVUeXBlU2l6ZSh0eXBlKSxcbiAgICAgICAgICAgICAgICAgICAgUnVudGltZS5RVUFOVFVNX1NJWkVcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGRlZHVwOiBmdW5jdGlvbiBkZWR1cChpdGVtcywgaWRlbnQpIHtcbiAgICAgICAgICAgICAgICB2YXIgc2VlbiA9IHt9O1xuICAgICAgICAgICAgICAgIGlmIChpZGVudCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXRlbXMuZmlsdGVyKGZ1bmN0aW9uKGl0ZW0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZWVuW2l0ZW1baWRlbnRdXSkgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VlbltpdGVtW2lkZW50XV0gPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpdGVtcy5maWx0ZXIoZnVuY3Rpb24oaXRlbSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlZW5baXRlbV0pIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlZW5baXRlbV0gPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzZXQ6IGZ1bmN0aW9uIHNldCgpIHtcbiAgICAgICAgICAgICAgICB2YXIgYXJncyA9XG4gICAgICAgICAgICAgICAgICAgIHR5cGVvZiBhcmd1bWVudHNbMF0gPT09ICdvYmplY3QnID8gYXJndW1lbnRzWzBdIDogYXJndW1lbnRzO1xuICAgICAgICAgICAgICAgIHZhciByZXQgPSB7fTtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGFyZ3MubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0W2FyZ3NbaV1dID0gMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBnZXRBbGlnblNpemU6IGZ1bmN0aW9uKHR5cGUsIHNpemUsIHZhcmFyZykge1xuICAgICAgICAgICAgICAgIC8vIHdlIGFsaWduIGk2NHMgYW5kIGRvdWJsZXMgb24gNjQtYml0IGJvdW5kYXJpZXMsIHVubGlrZSB4ODZcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PSAnaTY0JyB8fCB0eXBlID09ICdkb3VibGUnIHx8IHZhcmFyZykgcmV0dXJuIDg7XG4gICAgICAgICAgICAgICAgaWYgKCF0eXBlKSByZXR1cm4gTWF0aC5taW4oc2l6ZSwgOCk7IC8vIGFsaWduIHN0cnVjdHVyZXMgaW50ZXJuYWxseSB0byA2NCBiaXRzXG4gICAgICAgICAgICAgICAgcmV0dXJuIE1hdGgubWluKFxuICAgICAgICAgICAgICAgICAgICBzaXplIHx8ICh0eXBlID8gUnVudGltZS5nZXROYXRpdmVGaWVsZFNpemUodHlwZSkgOiAwKSxcbiAgICAgICAgICAgICAgICAgICAgUnVudGltZS5RVUFOVFVNX1NJWkVcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNhbGN1bGF0ZVN0cnVjdEFsaWdubWVudDogZnVuY3Rpb24gY2FsY3VsYXRlU3RydWN0QWxpZ25tZW50KHR5cGUpIHtcbiAgICAgICAgICAgICAgICB0eXBlLmZsYXRTaXplID0gMDtcbiAgICAgICAgICAgICAgICB0eXBlLmFsaWduU2l6ZSA9IDA7XG4gICAgICAgICAgICAgICAgdmFyIGRpZmZzID0gW107XG4gICAgICAgICAgICAgICAgdmFyIHByZXYgPSAtMTtcbiAgICAgICAgICAgICAgICB0eXBlLmZsYXRJbmRleGVzID0gdHlwZS5maWVsZHMubWFwKGZ1bmN0aW9uKGZpZWxkKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBzaXplLCBhbGlnblNpemU7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIFJ1bnRpbWUuaXNOdW1iZXJUeXBlKGZpZWxkKSB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgUnVudGltZS5pc1BvaW50ZXJUeXBlKGZpZWxkKVxuICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNpemUgPSBSdW50aW1lLmdldE5hdGl2ZVR5cGVTaXplKGZpZWxkKTsgLy8gcGFjayBjaGFyOyBjaGFyOyBpbiBzdHJ1Y3RzLCBhbHNvIGNoYXJbWF1zLlxuICAgICAgICAgICAgICAgICAgICAgICAgYWxpZ25TaXplID0gUnVudGltZS5nZXRBbGlnblNpemUoZmllbGQsIHNpemUpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKFJ1bnRpbWUuaXNTdHJ1Y3RUeXBlKGZpZWxkKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpZWxkWzFdID09PSAnMCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGlzIFswIHggc29tZXRoaW5nXS4gV2hlbiBpbnNpZGUgYW5vdGhlciBzdHJ1Y3R1cmUgbGlrZSBoZXJlLCBpdCBtdXN0IGJlIGF0IHRoZSBlbmQsIGFuZCBpdCBhZGRzIG5vIHNpemVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGhhcHBlbnMgaW4gamF2YS1uYm9keSBmb3IgZXhhbXBsZS4uLiBhc3NlcnQoaW5kZXggPT09IHR5cGUuZmllbGRzLmxlbmd0aCwgJ3plcm8tbGVuZ3RoIGluIHRoZSBtaWRkbGUhJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFR5cGVzLnR5cGVzW2ZpZWxkXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGlnblNpemUgPSBSdW50aW1lLmdldEFsaWduU2l6ZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUeXBlcy50eXBlc1tmaWVsZF0uYWxpZ25TaXplXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxpZ25TaXplID0gdHlwZS5hbGlnblNpemUgfHwgUVVBTlRVTV9TSVpFO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSA9IFR5cGVzLnR5cGVzW2ZpZWxkXS5mbGF0U2l6ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGlnblNpemUgPSBSdW50aW1lLmdldEFsaWduU2l6ZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVHlwZXMudHlwZXNbZmllbGRdLmFsaWduU2l6ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZmllbGRbMF0gPT0gJ2InKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBiTiwgbGFyZ2UgbnVtYmVyIGZpZWxkLCBsaWtlIGEgW04geCBpOF1cbiAgICAgICAgICAgICAgICAgICAgICAgIHNpemUgPSBmaWVsZC5zdWJzdHIoMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgYWxpZ25TaXplID0gMTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93ICdVbmNsZWFyIHR5cGUgaW4gc3RydWN0OiAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWVsZCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJywgaW4gJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZS5uYW1lXyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJyA6OiAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkdW1wKFR5cGVzLnR5cGVzW3R5cGUubmFtZV9dKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZS5wYWNrZWQpIGFsaWduU2l6ZSA9IDE7XG4gICAgICAgICAgICAgICAgICAgIHR5cGUuYWxpZ25TaXplID0gTWF0aC5tYXgodHlwZS5hbGlnblNpemUsIGFsaWduU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjdXJyID0gUnVudGltZS5hbGlnbk1lbW9yeSh0eXBlLmZsYXRTaXplLCBhbGlnblNpemUpOyAvLyBpZiBuZWNlc3NhcnksIHBsYWNlIHRoaXMgb24gYWxpZ25lZCBtZW1vcnlcbiAgICAgICAgICAgICAgICAgICAgdHlwZS5mbGF0U2l6ZSA9IGN1cnIgKyBzaXplO1xuICAgICAgICAgICAgICAgICAgICBpZiAocHJldiA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkaWZmcy5wdXNoKGN1cnIgLSBwcmV2KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBwcmV2ID0gY3VycjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGN1cnI7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgdHlwZS5mbGF0U2l6ZSA9IFJ1bnRpbWUuYWxpZ25NZW1vcnkoXG4gICAgICAgICAgICAgICAgICAgIHR5cGUuZmxhdFNpemUsXG4gICAgICAgICAgICAgICAgICAgIHR5cGUuYWxpZ25TaXplXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICBpZiAoZGlmZnMubGVuZ3RoID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZS5mbGF0RmFjdG9yID0gdHlwZS5mbGF0U2l6ZTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKFJ1bnRpbWUuZGVkdXAoZGlmZnMpLmxlbmd0aCA9PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHR5cGUuZmxhdEZhY3RvciA9IGRpZmZzWzBdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0eXBlLm5lZWRzRmxhdHRlbmluZyA9IHR5cGUuZmxhdEZhY3RvciAhPSAxO1xuICAgICAgICAgICAgICAgIHJldHVybiB0eXBlLmZsYXRJbmRleGVzO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdlbmVyYXRlU3RydWN0SW5mbzogZnVuY3Rpb24oc3RydWN0LCB0eXBlTmFtZSwgb2Zmc2V0KSB7XG4gICAgICAgICAgICAgICAgdmFyIHR5cGUsIGFsaWdubWVudDtcbiAgICAgICAgICAgICAgICBpZiAodHlwZU5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gb2Zmc2V0IHx8IDA7XG4gICAgICAgICAgICAgICAgICAgIHR5cGUgPSAodHlwZW9mIFR5cGVzID09PSAndW5kZWZpbmVkJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBSdW50aW1lLnR5cGVJbmZvXG4gICAgICAgICAgICAgICAgICAgICAgICA6IFR5cGVzLnR5cGVzKVt0eXBlTmFtZV07XG4gICAgICAgICAgICAgICAgICAgIGlmICghdHlwZSkgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlLmZpZWxkcy5sZW5ndGggIT0gc3RydWN0Lmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdOdW1iZXIgb2YgbmFtZWQgZmllbGRzIG11c3QgbWF0Y2ggdGhlIHR5cGUgZm9yICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlTmFtZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICc6IHBvc3NpYmx5IGR1cGxpY2F0ZSBzdHJ1Y3QgbmFtZXMuIENhbm5vdCByZXR1cm4gc3RydWN0SW5mbydcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBhbGlnbm1lbnQgPSB0eXBlLmZsYXRJbmRleGVzO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0eXBlID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgZmllbGRzOiBzdHJ1Y3QubWFwKGZ1bmN0aW9uKGl0ZW0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXRlbVswXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIGFsaWdubWVudCA9IFJ1bnRpbWUuY2FsY3VsYXRlU3RydWN0QWxpZ25tZW50KHR5cGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgcmV0ID0ge1xuICAgICAgICAgICAgICAgICAgICBfX3NpemVfXzogdHlwZS5mbGF0U2l6ZVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVOYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIHN0cnVjdC5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0sIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgaXRlbSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXRbaXRlbV0gPSBhbGlnbm1lbnRbaV0gKyBvZmZzZXQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGVtYmVkZGVkIHN0cnVjdFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBrZXk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgayBpbiBpdGVtKSBrZXkgPSBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldFtrZXldID0gUnVudGltZS5nZW5lcmF0ZVN0cnVjdEluZm8oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1ba2V5XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZS5maWVsZHNbaV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsaWdubWVudFtpXVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHN0cnVjdC5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0sIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldFtpdGVtWzFdXSA9IGFsaWdubWVudFtpXTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZHluQ2FsbDogZnVuY3Rpb24oc2lnLCBwdHIsIGFyZ3MpIHtcbiAgICAgICAgICAgICAgICBpZiAoYXJncyAmJiBhcmdzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWFyZ3Muc3BsaWNlKSBhcmdzID0gQXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoYXJncyk7XG4gICAgICAgICAgICAgICAgICAgIGFyZ3Muc3BsaWNlKDAsIDAsIHB0cik7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBNb2R1bGVbJ2R5bkNhbGxfJyArIHNpZ10uYXBwbHkobnVsbCwgYXJncyk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE1vZHVsZVsnZHluQ2FsbF8nICsgc2lnXS5jYWxsKG51bGwsIHB0cik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGZ1bmN0aW9uUG9pbnRlcnM6IFtdLFxuICAgICAgICAgICAgd2Fybk9uY2U6IGZ1bmN0aW9uKHRleHQpIHtcbiAgICAgICAgICAgICAgICBpZiAoIVJ1bnRpbWUud2Fybk9uY2Uuc2hvd24pIFJ1bnRpbWUud2Fybk9uY2Uuc2hvd24gPSB7fTtcbiAgICAgICAgICAgICAgICBpZiAoIVJ1bnRpbWUud2Fybk9uY2Uuc2hvd25bdGV4dF0pIHtcbiAgICAgICAgICAgICAgICAgICAgUnVudGltZS53YXJuT25jZS5zaG93blt0ZXh0XSA9IDE7XG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2Fybih0ZXh0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZnVuY1dyYXBwZXJzOiB7fSxcbiAgICAgICAgICAgIFVURjhQcm9jZXNzb3I6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHZhciBidWZmZXIgPSBbXTtcbiAgICAgICAgICAgICAgICB2YXIgbmVlZGVkID0gMDtcbiAgICAgICAgICAgICAgICB0aGlzLnByb2Nlc3NDQ2hhciA9IGZ1bmN0aW9uKGNvZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgY29kZSA9IGNvZGUgJiAweGZmO1xuICAgICAgICAgICAgICAgICAgICBpZiAoYnVmZmVyLmxlbmd0aCA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNvZGUgJiAweDgwKSA9PSAweDAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gMHh4eHh4eHhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gU3RyaW5nLmZyb21DaGFyQ29kZShjb2RlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlci5wdXNoKGNvZGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjb2RlICYgMHhlMCkgPT0gMHhjMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDExMHh4eHh4XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmVlZGVkID0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKGNvZGUgJiAweGYwKSA9PSAweGUwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gMTExMHh4eHhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWVkZWQgPSAyO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAxMTExMHh4eFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRlZCA9IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJyc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKG5lZWRlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLnB1c2goY29kZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZWVkZWQtLTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZWVkZWQgPiAwKSByZXR1cm4gJyc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdmFyIGMxID0gYnVmZmVyWzBdO1xuICAgICAgICAgICAgICAgICAgICB2YXIgYzIgPSBidWZmZXJbMV07XG4gICAgICAgICAgICAgICAgICAgIHZhciBjMyA9IGJ1ZmZlclsyXTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGM0ID0gYnVmZmVyWzNdO1xuICAgICAgICAgICAgICAgICAgICB2YXIgcmV0O1xuICAgICAgICAgICAgICAgICAgICBpZiAoYnVmZmVyLmxlbmd0aCA9PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXQgPSBTdHJpbmcuZnJvbUNoYXJDb2RlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoYzEgJiAweDFmKSA8PCA2KSB8IChjMiAmIDB4M2YpXG4gICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGJ1ZmZlci5sZW5ndGggPT0gMykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0ID0gU3RyaW5nLmZyb21DaGFyQ29kZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGMxICYgMHgwZikgPDwgMTIpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjMiAmIDB4M2YpIDw8IDYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGMzICYgMHgzZilcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBodHRwOi8vbWF0aGlhc2J5bmVucy5iZS9ub3Rlcy9qYXZhc2NyaXB0LWVuY29kaW5nI3N1cnJvZ2F0ZS1mb3JtdWxhZVxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvZGVQb2ludCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjMSAmIDB4MDcpIDw8IDE4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjMiAmIDB4M2YpIDw8IDEyKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjMyAmIDB4M2YpIDw8IDYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYzQgJiAweDNmKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldCA9IFN0cmluZy5mcm9tQ2hhckNvZGUoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgTWF0aC5mbG9vcigoY29kZVBvaW50IC0gMHgxMDAwMCkgLyAweDQwMCkgKyAweGQ4MDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjb2RlUG9pbnQgLSAweDEwMDAwKSAlIDB4NDAwKSArIDB4ZGMwMFxuICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBidWZmZXIubGVuZ3RoID0gMDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHRoaXMucHJvY2Vzc0pTU3RyaW5nID0gZnVuY3Rpb24oc3RyaW5nKSB7XG4gICAgICAgICAgICAgICAgICAgIHN0cmluZyA9IHVuZXNjYXBlKGVuY29kZVVSSUNvbXBvbmVudChzdHJpbmcpKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJldCA9IFtdO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0cmluZy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0LnB1c2goc3RyaW5nLmNoYXJDb2RlQXQoaSkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzdGFja0FsbG9jOiBmdW5jdGlvbihzaXplKSB7XG4gICAgICAgICAgICAgICAgdmFyIHJldCA9IFNUQUNLVE9QO1xuICAgICAgICAgICAgICAgIFNUQUNLVE9QID0gKFNUQUNLVE9QICsgc2l6ZSkgfCAwO1xuICAgICAgICAgICAgICAgIFNUQUNLVE9QID0gKFNUQUNLVE9QICsgNykgJiAtODtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHN0YXRpY0FsbG9jOiBmdW5jdGlvbihzaXplKSB7XG4gICAgICAgICAgICAgICAgdmFyIHJldCA9IFNUQVRJQ1RPUDtcbiAgICAgICAgICAgICAgICBTVEFUSUNUT1AgPSAoU1RBVElDVE9QICsgc2l6ZSkgfCAwO1xuICAgICAgICAgICAgICAgIFNUQVRJQ1RPUCA9IChTVEFUSUNUT1AgKyA3KSAmIC04O1xuICAgICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZHluYW1pY0FsbG9jOiBmdW5jdGlvbihzaXplKSB7XG4gICAgICAgICAgICAgICAgdmFyIHJldCA9IERZTkFNSUNUT1A7XG4gICAgICAgICAgICAgICAgRFlOQU1JQ1RPUCA9IChEWU5BTUlDVE9QICsgc2l6ZSkgfCAwO1xuICAgICAgICAgICAgICAgIERZTkFNSUNUT1AgPSAoRFlOQU1JQ1RPUCArIDcpICYgLTg7XG4gICAgICAgICAgICAgICAgaWYgKERZTkFNSUNUT1AgPj0gVE9UQUxfTUVNT1JZKSBlbmxhcmdlTWVtb3J5KCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBhbGlnbk1lbW9yeTogZnVuY3Rpb24oc2l6ZSwgcXVhbnR1bSkge1xuICAgICAgICAgICAgICAgIHZhciByZXQgPSAoc2l6ZSA9XG4gICAgICAgICAgICAgICAgICAgIE1hdGguY2VpbChzaXplIC8gKHF1YW50dW0gPyBxdWFudHVtIDogOCkpICpcbiAgICAgICAgICAgICAgICAgICAgKHF1YW50dW0gPyBxdWFudHVtIDogOCkpO1xuICAgICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbWFrZUJpZ0ludDogZnVuY3Rpb24obG93LCBoaWdoLCB1bnNpZ25lZCkge1xuICAgICAgICAgICAgICAgIHZhciByZXQgPSB1bnNpZ25lZFxuICAgICAgICAgICAgICAgICAgICA/ICsobG93ID4+PiAwKSArICsoaGlnaCA+Pj4gMCkgKiArNDI5NDk2NzI5NlxuICAgICAgICAgICAgICAgICAgICA6ICsobG93ID4+PiAwKSArICsoaGlnaCB8IDApICogKzQyOTQ5NjcyOTY7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBHTE9CQUxfQkFTRTogOCxcbiAgICAgICAgICAgIFFVQU5UVU1fU0laRTogNFxuICAgICAgICB9O1xuXG4gICAgICAgIHZhciBNb2R1bGUgPSB7fTtcbiAgICAgICAgdGhpcy5Nb2R1bGUgPSBNb2R1bGU7XG5cbiAgICAgICAgTW9kdWxlLmFyZ3VtZW50cyA9IGFyZ3VtZW50cztcblxuICAgICAgICBpZiAoIU1vZHVsZVsnYXJndW1lbnRzJ10pIHtcbiAgICAgICAgICAgIE1vZHVsZVsnYXJndW1lbnRzJ10gPSBbXTtcbiAgICAgICAgfVxuXG4gICAgICAgIE1vZHVsZS5yZWFkID0gZnVuY3Rpb24odXJsKSB7XG4gICAgICAgICAgICB2YXIgeGhyID0gbmV3IFhNTEh0dHBSZXF1ZXN0KCk7XG4gICAgICAgICAgICB4aHIub3BlbignR0VUJywgdXJsLCBmYWxzZSk7XG4gICAgICAgICAgICB4aHIuc2VuZChudWxsKTtcbiAgICAgICAgICAgIHJldHVybiB4aHIucmVzcG9uc2VUZXh0O1xuICAgICAgICB9O1xuXG4gICAgICAgIE1vZHVsZS5wcmludCA9IGZ1bmN0aW9uKG1lc3NhZ2UpIHtcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKG1lc3NhZ2UpO1xuICAgICAgICB9O1xuXG4gICAgICAgIE1vZHVsZS5wcmVSdW4gPSBbXTtcbiAgICAgICAgTW9kdWxlLnBvc3RSdW4gPSBbXTtcblxuICAgICAgICB2YXIgQUJPUlQgPSBmYWxzZTsgLy8gd2hldGhlciB3ZSB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cyB0byB0aGUgZnVuY3Rpb24sIGFzIG5hdGl2ZSBKUyB2YWx1ZXMgKGFzIGluIHJldHVyblR5cGUpLiBOb3RlIHRoYXQgc3RyaW5nIGFyZ3VtZW50cyB3aWxsIGJlIHN0b3JlZCBvbiB0aGUgc3RhY2sgKHRoZSBKUyBzdHJpbmcgd2lsbCBiZWNvbWUgYSBDIHN0cmluZyBvbiB0aGUgc3RhY2spLlxuICAgICAgICAgKiBAcmV0dXJuIE5hdGl2ZSBKUyB2YWx1ZSAoYXMgaW4gcmV0dXJuVHlwZSlcbiAgICAgICAgICovXG5cbiAgICAgICAgTW9kdWxlLmNhbGwgPSBmdW5jdGlvbiBjYWxsKGlkZW50LCByZXR1cm5UeXBlLCBhcmdUeXBlcywgYXJncykge1xuICAgICAgICAgICAgY29uc3QgZnVuYyA9IE1vZHVsZVsnXycgKyBpZGVudF07XG4gICAgICAgICAgICBpZiAoIWZ1bmMpIHtcbiAgICAgICAgICAgICAgICBhYm9ydChgVW5rbm93biBmdW5jdGlvbjogXCIke2lkZW50fVwiLmApO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgc3RhY2sgPSAwO1xuICAgICAgICAgICAgZnVuY3Rpb24gdG9DKHZhbHVlLCB0eXBlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGUgPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlID09PSBudWxsIHx8IHZhbHVlID09PSB1bmRlZmluZWQgfHwgdmFsdWUgPT09IDApXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDsgLy8gbnVsbCBzdHJpbmdcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBpbnRBcnJheUZyb21TdHJpbmcodmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICB0eXBlID0gJ2FycmF5JztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHR5cGUgPT0gJ2FycmF5Jykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXN0YWNrKSBzdGFjayA9IFJ1bnRpbWUuc3RhY2tTYXZlKCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciByZXQgPSBSdW50aW1lLnN0YWNrQWxsb2ModmFsdWUubGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVBcnJheVRvTWVtb3J5KHZhbHVlLCByZXQpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGZyb21DKHZhbHVlLCB0eXBlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGUgPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBvaW50ZXJfc3RyaW5naWZ5KHZhbHVlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYXNzZXJ0KHR5cGUgIT0gJ2FycmF5Jyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgaSA9IDA7XG4gICAgICAgICAgICB2YXIgY0FyZ3MgPSBhcmdzXG4gICAgICAgICAgICAgICAgPyBhcmdzLm1hcChmdW5jdGlvbihhcmcpIHtcbiAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdG9DKGFyZywgYXJnVHlwZXNbaSsrXSk7XG4gICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIDogW107XG4gICAgICAgICAgICB2YXIgcmV0ID0gZnJvbUMoZnVuYy5hcHBseShudWxsLCBjQXJncyksIHJldHVyblR5cGUpO1xuICAgICAgICAgICAgaWYgKHN0YWNrKSBSdW50aW1lLnN0YWNrUmVzdG9yZShzdGFjayk7XG4gICAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICB9O1xuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBEeW5hbWljYWxseSBzZXRzIGEgdmFsdWUgaW4gbWVtb3J5IGF0IHJ1bnRpbWUuIE9ubHkgZG9lcyAqYWxpZ25lZCogd3JpdGVzLiBUaGlzIGlzIGEgbG93ZXItbGV2ZWwgb3BlcmF0aW9uLlxuICAgICAgICAgKiBAZnVuY3Rpb24gc2V0VmFsdWVcbiAgICAgICAgICogQG1lbWJlcm9mIExpYlRpTWlkaXR5XG4gICAgICAgICAqIEBpbnN0YW5jZVxuICAgICAgICAgKiBAcGFyYW0gcHRyIFBvaW50ZXIuXG4gICAgICAgICAqIEBwYXJhbSB2YWx1ZVxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gdHlwZSBMTFZNIHR5cGUgKCdpOCcsICwgJ2kxNicsICdpMzInLCAnaTY0JywgJ2Zsb2F0JywgJ2RvdWJsZScpXG4gICAgICAgICAqL1xuICAgICAgICBmdW5jdGlvbiBzZXRWYWx1ZShwdHIsIHZhbHVlLCB0eXBlKSB7XG4gICAgICAgICAgICB0eXBlID0gdHlwZSB8fCAnaTgnO1xuICAgICAgICAgICAgaWYgKHR5cGUuY2hhckF0KHR5cGUubGVuZ3RoIC0gMSkgPT09ICcqJykgdHlwZSA9ICdpMzInOyAvLyBwb2ludGVycyBhcmUgMzItYml0XG4gICAgICAgICAgICBzd2l0Y2ggKHR5cGUpIHtcbiAgICAgICAgICAgICAgICBjYXNlICdpMSc6XG4gICAgICAgICAgICAgICAgICAgIEhFQVA4W3B0cl0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAnaTgnOlxuICAgICAgICAgICAgICAgICAgICBIRUFQOFtwdHJdID0gdmFsdWU7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2kxNic6XG4gICAgICAgICAgICAgICAgICAgIEhFQVAxNltwdHIgPj4gMV0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAnaTMyJzpcbiAgICAgICAgICAgICAgICAgICAgSEVBUDMyW3B0ciA+PiAyXSA9IHZhbHVlO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdpNjQnOlxuICAgICAgICAgICAgICAgICAgICAodGVtcEk2NCA9IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID4+PiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgKCh0ZW1wRG91YmxlID0gdmFsdWUpLFxuICAgICAgICAgICAgICAgICAgICAgICAgK01hdGhfYWJzKHRlbXBEb3VibGUpID49ICsxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0ZW1wRG91YmxlID4gKzBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAoTWF0aF9taW4oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICtNYXRoX2Zsb29yKHRlbXBEb3VibGUgLyArNDI5NDk2NzI5NiksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICs0Mjk0OTY3Mjk1XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB+fitNYXRoX2NlaWwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0ZW1wRG91YmxlIC0gKyh+fnRlbXBEb3VibGUgPj4+IDApKSAvXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArNDI5NDk2NzI5NlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgPj4+IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IDApXG4gICAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgKEhFQVAzMltwdHIgPj4gMl0gPSB0ZW1wSTY0WzBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChIRUFQMzJbKHB0ciArIDQpID4+IDJdID0gdGVtcEk2NFsxXSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2Zsb2F0JzpcbiAgICAgICAgICAgICAgICAgICAgSEVBUEYzMltwdHIgPj4gMl0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAnZG91YmxlJzpcbiAgICAgICAgICAgICAgICAgICAgSEVBUEY2NFtwdHIgPj4gM10gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgYWJvcnQoJ2ludmFsaWQgdHlwZSBmb3Igc2V0VmFsdWU6ICcgKyB0eXBlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBNb2R1bGUuc2V0VmFsdWUgPSBzZXRWYWx1ZTtcblxuICAgICAgICAvKipcbiAgICAgICAgICogRHluYW1pY2FsbHkgZ2V0cyBhIHZhbHVlIGluIG1lbW9yeSBhdCBydW50aW1lLiBPbmx5IGRvZXMgKmFsaWduZWQqIHJlYWRzLiBUaGlzIGlzIGEgbG93ZXItbGV2ZWwgb3BlcmF0aW9uLlxuICAgICAgICAgKiBAZnVuY3Rpb24gZ2V0VmFsdWVcbiAgICAgICAgICogQG1lbWJlcm9mIExpYlRpTWlkaXR5XG4gICAgICAgICAqIEBpbnN0YW5jZVxuICAgICAgICAgKiBAcGFyYW0gcHRyIFBvaW50ZXIuXG4gICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSB0eXBlIExMVk0gdHlwZSAoJ2k4JywgLCAnaTE2JywgJ2kzMicsICdpNjQnLCAnZmxvYXQnLCAnZG91YmxlJylcbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uIGdldFZhbHVlKHB0ciwgdHlwZSkge1xuICAgICAgICAgICAgdHlwZSA9IHR5cGUgfHwgJ2k4JztcbiAgICAgICAgICAgIGlmICh0eXBlLmNoYXJBdCh0eXBlLmxlbmd0aCAtIDEpID09PSAnKicpIHR5cGUgPSAnaTMyJzsgLy8gcG9pbnRlcnMgYXJlIDMyLWJpdFxuICAgICAgICAgICAgc3dpdGNoICh0eXBlKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnaTEnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gSEVBUDhbcHRyXTtcbiAgICAgICAgICAgICAgICBjYXNlICdpOCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBIRUFQOFtwdHJdO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2kxNic6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBIRUFQMTZbcHRyID4+IDFdO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2kzMic6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBIRUFQMzJbcHRyID4+IDJdO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2k2NCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBIRUFQMzJbcHRyID4+IDJdO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2Zsb2F0JzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEhFQVBGMzJbcHRyID4+IDJdO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2RvdWJsZSc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBIRUFQRjY0W3B0ciA+PiAzXTtcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICBhYm9ydCgnaW52YWxpZCB0eXBlIGZvciBnZXRWYWx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J251bWJlcicpIHtcbiAgICAgICAgICAgICAgICB6ZXJvaW5pdCA9IHRydWU7XG4gICAgICAgICAgICAgICAgc2l6ZSA9IHNsYWI7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHplcm9pbml0ID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgc2l6ZSA9IHNsYWIubGVuZ3RoO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHNpbmdsZVR5cGUgPSB0eXBlb2YgdHlwZXMgPT09ICdzdHJpbmcnID8gdHlwZXMgOiBudWxsO1xuICAgICAgICAgICAgdmFyIHJldDtcbiAgICAgICAgICAgIGlmIChhbGxvY2F0b3IgPT0gQUxMT0NfTk9ORSkge1xuICAgICAgICAgICAgICAgIHJldCA9IHB0cjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0ID0gW1xuICAgICAgICAgICAgICAgICAgICBfbWFsbG9jLFxuICAgICAgICAgICAgICAgICAgICBSdW50aW1lLnN0YWNrQWxsb2MsXG4gICAgICAgICAgICAgICAgICAgIFJ1bnRpbWUuc3RhdGljQWxsb2MsXG4gICAgICAgICAgICAgICAgICAgIFJ1bnRpbWUuZHluYW1pY0FsbG9jXG4gICAgICAgICAgICAgICAgXVthbGxvY2F0b3IgPT09IHVuZGVmaW5lZCA/IEFMTE9DX1NUQVRJQyA6IGFsbG9jYXRvcl0oXG4gICAgICAgICAgICAgICAgICAgIE1hdGgubWF4KHNpemUsIHNpbmdsZVR5cGUgPyAxIDogdHlwZXMubGVuZ3RoKVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoemVyb2luaXQpIHtcbiAgICAgICAgICAgICAgICB2YXIgcHRyID0gcmV0LFxuICAgICAgICAgICAgICAgICAgICBzdG9wO1xuICAgICAgICAgICAgICAgIGFzc2VydCgocmV0ICYgMykgPT0gMCk7XG4gICAgICAgICAgICAgICAgc3RvcCA9IHJldCArIChzaXplICYgfjMpO1xuICAgICAgICAgICAgICAgIGZvciAoOyBwdHIgPCBzdG9wOyBwdHIgKz0gNCkge1xuICAgICAgICAgICAgICAgICAgICBIRUFQMzJbcHRyID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc3RvcCA9IHJldCArIHNpemU7XG4gICAgICAgICAgICAgICAgd2hpbGUgKHB0ciA8IHN0b3ApIHtcbiAgICAgICAgICAgICAgICAgICAgSEVBUDhbcHRyKysgfCAwXSA9IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoc2luZ2xlVHlwZSA9PT0gJ2k4Jykge1xuICAgICAgICAgICAgICAgIGlmIChzbGFiLnN1YmFycmF5IHx8IHNsYWIuc2xpY2UpIHtcbiAgICAgICAgICAgICAgICAgICAgSEVBUFU4LnNldChzbGFiLCByZXQpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIEhFQVBVOC5zZXQobmV3IFVpbnQ4QXJyYXkoc2xhYiksIHJldCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgaSA9IDAsXG4gICAgICAgICAgICAgICAgdHlwZSxcbiAgICAgICAgICAgICAgICB0eXBlU2l6ZSxcbiAgICAgICAgICAgICAgICBwcmV2aW91c1R5cGU7XG4gICAgICAgICAgICB3aGlsZSAoaSA8IHNpemUpIHtcbiAgICAgICAgICAgICAgICB2YXIgY3VyciA9IHNsYWJbaV07XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBjdXJyID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgICAgIGN1cnIgPSBSdW50aW1lLmdldEZ1bmN0aW9uSW5kZXgoY3Vycik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHR5cGUgPSBzaW5nbGVUeXBlIHx8IHR5cGVzW2ldO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGkrKztcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09ICdpNjQnKSB0eXBlID0gJ2kzMic7IC8vIHNwZWNpYWwgY2FzZTogd2UgaGF2ZSBvbmUgaTMyIGhlcmUsIGFuZCBvbmUgaTMyIGxhdGVyXG4gICAgICAgICAgICAgICAgc2V0VmFsdWUocmV0ICsgaSwgY3VyciwgdHlwZSk7XG4gICAgICAgICAgICAgICAgLy8gbm8gbmVlZCB0byBsb29rIHVwIHNpemUgdW5sZXNzIHR5cGUgY2hhbmdlcywgc28gY2FjaGUgaXRcbiAgICAgICAgICAgICAgICBpZiAocHJldmlvdXNUeXBlICE9PSB0eXBlKSB7XG4gICAgICAgICAgICAgICAgICAgIHR5cGVTaXplID0gUnVudGltZS5nZXROYXRpdmVUeXBlU2l6ZSh0eXBlKTtcbiAgICAgICAgICAgICAgICAgICAgcHJldmlvdXNUeXBlID0gdHlwZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaSArPSB0eXBlU2l6ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgIH1cblxuICAgICAgICBNb2R1bGVbJ2FsbG9jYXRlJ10gPSBhbGxvY2F0ZTtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQGZ1bmN0aW9uIFBvaW50ZXJfc3RyaW5naWZ5XG4gICAgICAgICAqIEBtZW1iZXJvZiBMaWJUaU1pZGl0eVxuICAgICAgICAgKiBAaW5zdGFuY2VcbiAgICAgICAgICogQHBhcmFtIHB0ciBQb2ludGVyLlxuICAgICAgICAgKiBAcGFyYW0geyp9IFtsZW5ndGhdXG4gICAgICAgICAqL1xuXG4gICAgICAgIGZ1bmN0aW9uIFBvaW50ZXJfc3RyaW5naWZ5KHB0ciwgbGVuZ3RoKSB7XG4gICAgICAgICAgICAvLyBUT0RPOiB1c2UgVGV4dERlY29kZXJcbiAgICAgICAgICAgIC8vIEZpbmQgdGhlIGxlbmd0aCwgYW5kIGNoZWNrIGZvciBVVEYgd2hpbGUgZG9pbmcgc29cbiAgICAgICAgICAgIHZhciBoYXNVdGYgPSBmYWxzZTtcbiAgICAgICAgICAgIHZhciB0O1xuICAgICAgICAgICAgdmFyIGkgPSAwO1xuICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICB0ID0gSEVBUFU4WyhwdHIgKyBpKSB8IDBdO1xuICAgICAgICAgICAgICAgIGlmICh0ID49IDEyOCkgaGFzVXRmID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBlbHNlIGlmICh0ID09IDAgJiYgIWxlbmd0aCkgYnJlYWs7XG4gICAgICAgICAgICAgICAgaSsrO1xuICAgICAgICAgICAgICAgIGlmIChsZW5ndGggJiYgaSA9PSBsZW5ndGgpIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFsZW5ndGgpIGxlbmd0aCA9IGk7XG4gICAgICAgICAgICB2YXIgcmV0ID0gJyc7XG4gICAgICAgICAgICBpZiAoIWhhc1V0Zikge1xuICAgICAgICAgICAgICAgIHZhciBNQVhfQ0hVTksgPSAxMDI0OyAvLyBzcGxpdCB1cCBpbnRvIGNodW5rcywgYmVjYXVzZSAuYXBwbHkgb24gYSBodWdlIHN0cmluZyBjYW4gb3ZlcmZsb3cgdGhlIHN0YWNrXG4gICAgICAgICAgICAgICAgdmFyIGN1cnI7XG4gICAgICAgICAgICAgICAgd2hpbGUgKGxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgY3VyciA9IFN0cmluZy5mcm9tQ2hhckNvZGUuYXBwbHkoXG4gICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcsXG4gICAgICAgICAgICAgICAgICAgICAgICBIRUFQVTguc3ViYXJyYXkocHRyLCBwdHIgKyBNYXRoLm1pbihsZW5ndGgsIE1BWF9DSFVOSykpXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIHJldCA9IHJldCA/IHJldCArIGN1cnIgOiBjdXJyO1xuICAgICAgICAgICAgICAgICAgICBwdHIgKz0gTUFYX0NIVU5LO1xuICAgICAgICAgICAgICAgICAgICBsZW5ndGggLT0gTUFYX0NIVU5LO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHV0ZjggPSBuZXcgUnVudGltZS5VVEY4UHJvY2Vzc29yKCk7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICB0ID0gSEVBUFU4WyhwdHIgKyBpKSB8IDBdO1xuICAgICAgICAgICAgICAgIHJldCArPSB1dGY4LnByb2Nlc3NDQ2hhcih0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgIH1cblxuICAgICAgICBNb2R1bGVbJ1BvaW50ZXJfc3RyaW5naWZ5J10gPSBQb2ludGVyX3N0cmluZ2lmeTtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQGZ1bmN0aW9uIFVURjE2VG9TdHJpbmdcbiAgICAgICAgICogQG1lbWJlcm9mIExpYlRpTWlkaXR5XG4gICAgICAgICAqIEBpbnN0YW5jZVxuICAgICAgICAgKiBAcGFyYW0gcHRyIFBvaW50ZXIgdG8gYSBudWxsLXRlcm1pbmF0ZWQgVVRGMTZMRS1lbmNvZGVkIHN0cmluZyBpbiB0aGUgZW1zY3JpcHRlbiBIRUFQLlxuICAgICAgICAgKi9cblxuICAgICAgICBmdW5jdGlvbiBVVE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dXJuXG4gICAgICAgICAqL1xuXG4gICAgICAgIGZ1bmN0aW9uIFVURjMyVG9TdHJpbmcocHRyKSB7XG4gICAgICAgICAgICB2YXIgaSA9IDA7XG4gICAgICAgICAgICB2YXIgc3RyID0gJyc7XG4gICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgIHZhciB1dGYzMiA9IEhFQVAzMlsocHRyICsgaSAqIDQpID4+IDJdO1xuICAgICAgICAgICAgICAgIGlmICh1dGYzMiA9PSAwKSByZXR1cm4gc3RyO1xuICAgICAgICAgICAgICAgICsraTtcbiAgICAgICAgICAgICAgICAvLyBHb3RjaGE6IGZyb21DaGFyQ29kZSBjb25zdHJ1Y3RzIGEgY2hhcmFjdGVyIGZyb20gYSBVVEYtMTYgZW5jb2RlZCBjb2RlIChwYWlyKSwgbm90IGZyb20gYSBVbmljb2RlIGNvZGUgcG9pbnQhIFNvIGVuY29kZSB0aGUgY29kZSBwb2ludCB0byBVVEYtMTYgZm9yIGNvbnN0cnVjdGluZy5cbiAgICAgICAgICAgICAgICBpZiAodXRmMzIgPj0gMHgxMDAwMCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgY2ggPSB1dGYzMiAtIDB4MTAwMDA7XG4gICAgICAgICAgICAgICAgICAgIHN0ciArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKFxuICAgICAgICAgICAgICAgICAgICAgICAgMHhkODAwIHwgKGNoID4+IDEwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIDB4ZGMwMCB8IChjaCAmIDB4M2ZmKVxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHN0ciArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKHV0ZjMyKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBNb2R1bGVbJ1VURjMyVG9TdHJpbmcnXSA9IFVURjMyVG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aXQpOyAvLyBwb3NzaWJseSBhIGxlYWQgc3Vycm9nYXRlXG4gICAgICAgICAgICAgICAgaWYgKGNvZGVVbml0ID49IDB4ZDgwMCAmJiBjb2RlVW5pdCA8PSAweGRmZmYpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRyYWlsU3Vycm9nYXRlID0gc3RyLmNoYXJDb2RlQXQoKytpQ29kZVVuaXQpO1xuICAgICAgICAgICAgICAgICAgICBjb2RlVW5pdCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAoMHgxMDAwMCArICgoY29kZVVuaXQgJiAweDNmZikgPDwgMTApKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAodHJhaWxTdXJyb2dhdGUgJiAweDNmZik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIEhFQVAzMlsob3V0UHRyICsgaUNoYXIgKiA0KSA+PiAyXSA9IGNvZGVVbml0O1xuICAgICAgICAgICAgICAgICsraUNoYXI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBOdWxsLXRlcm1pbmF0ZSB0aGUgcG9pbnRlciB0byB0aGUgSEVBUC5cbiAgICAgICAgICAgIEhFQVAzMlsob3V0UHRyICsgaUNoYXIgKiA0KSA+PiAyXSA9IDA7XG4gICAgICAgIH1cblxuICAgICAgICBNb2R1bGVbJ3N0cmluZ1RvVVRGMzInXSA9IHN0cmluZ1RvVVRGMzI7XG5cbiAgICAgICAgLy8gTWVtb3J5IG1hbmFnZW1lbnRcbiAgICAgICAgdmFyIFBBR0VfU0laRSA9IDQwOTY7XG5cbiAgICAgICAgZnVuY3Rpb24gYWxpZ25NZW1vcnlQYWdlKHgpIHtcbiAgICAgICAgICAgIHJldHVybiAoeCArIDQwOTUpICYgLTQwOTY7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgSEVBUDtcbiAgICAgICAgdmFyIEhFQVA4LCBIRUFQVTgsIEhFQVAxNiwgSEVBUFUxNiwgSEVBUDMyLCBIRUFQVTMyLC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TtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNhbGxiYWNrID09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2soKTtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBmdW5jID0gY2FsbGJhY2suZnVuYztcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGZ1bmMgPT09ICdudW1iZXInKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjYWxsYmFjay5hcmcgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgUnVudGltZS5keW5DYWxsKCd2JywgZnVuYyk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBSdW50aW1lLmR5bkNhbGwoJ3ZpJywgZnVuYywgW2NhbGxiYWNrLmFyZ10pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZnVuYyhjYWxsYmFjay5hcmcgPT09IHVuZGVmaW5lZCA/IG51bGwgOiBjYWxsYmFjay5hcmcpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBfX0FUUFJFUlVOX18gPSBbXTsgLy8gZnVuY3Rpb25zIGNhbGxlZCBiZWZvcmUgdGhlIHJ1bnRpbWUgaXMgaW5pdGlhbGl6ZWRcbiAgICAgICAgdmFyIF9fQVRJTklUX18gPSBbXTsgLy8gZnVuY3Rpb25zIGNhbGxlZCBkdXJpbmcgc3RhcnR1cFxuICAgICAgICB2YXIgX19BVE1BSU5fXyA9IFtdOyAvLyBmdW5jdGlvbnMgY2FsbGVkIHdoZW4gbWFpbigpIGlzIHRvIGJlIHJ1blxuICAgICAgICB2YXIgX19BVEVYSVRfXyA9IFtdO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uIHByZU1haW4oKSB7XG4gICAgICAgICAgICBjYWxsUnVudGltZUNhbGxiYWNrcyhfX0FUTUFJTl9fKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGV4aXRSdW50aW1lKCkge1xuICAgICAgICAgICAgY2FsbFJ1bnRpbWVDYWxsYmFja3MoX19BVEVYSVRfXyk7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBwb3N0UnVuKCkge1xuICAgICAgICAgICAgLy8gY29tcGF0aWJpbGl0eSAtIG1lcmdlIGluIGFueXRoaW5nIGZyb20gTW9kdWxlWydwb3N0UnVuJ10gYXQgdGhpcyB0aW1lXG4gICAgICAgICAgICBpZiAoTW9kdWxlWydwb3N0UnVuJ10pIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIE1vZHVsZVsncG9zdFJ1biddID09ICdmdW5jdGlvbicpXG4gICAgICAgICAgICAgICAgICAgIE1vZHVsZVsncG9zdFJ1biddID0gW01vZHVsZVsncG9zdFJ1biddXTtcbiAgICAgICAgICAgICAgICB3aGlsZSAoTW9kdWxlWydwb3N0UnVuJ10ubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGFkZE9uUG9zdFJ1bihNb2R1bGVbJ3Bvc3RSdW4nXS5zaGlmdCgpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYWxsUnVudGltZUNhbGxiYWNrcyhfX0FUUE9TVFJVTl9fKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAZnVuY3Rpb24gYWRkT25QcmVSdW5cbiAgICAgICAgICogQG1lbWJlcm9mIExpYlRpTWlkaXR5XG4gICAgICAgICAqIEBpbnN0YW5jZVxuICAgICAgICAgKiBAcGFyYW0gY2IgQ2FsbGJhY2suXG4gICAgICAgICAqL1xuXG4gICAgICAgIGZ1bmN0aW9uIGFkZE9uUHJlUnVuKGNiKSB7XG4gICAgICAgICAgICBfX0FUUFJFUlVOX18udW5zaGlmdChjYik7XG4gICAgICAgIH1cblxuICAgICAgICBNb2R1bGVbJ2FkZE9uUHJlUnVuJ10gPSBNb2R1bGUuYWRkT25QcmVSdW4gPSBhZGRPblByZVJ1bjtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQGZ1bmN0aW9uIGFkZE9uSW5pdFxuICAgICAgICAgKiBAbWVtYmVyb2YgTGliVGlNaWRpdHlcbiAgICAgICAgICogQGluc3RhbmNlXG4gICAgICAgICAqIEBwYXJhbSBjYiBDYWxsYmFjay5cbiAgICAgICAgICovXG5cbiAgICAgICAgZnVuY3Rpb24gYWRkT25Jbml0KGNiKSB7XG4gICAgICAgICAgICBfX0FUSU5JVF9fLnVuc2hpZnQoY2IpO1xuICAgICAgICB9XG5cbiAgICAgICAgTW9kdWxlWydhZGRPbkluaXQnXSA9IGFkZE9uSW5pdDtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQGZ1bmN0aW9uIGFkZE9uUHJlTWFpblxuICAgICAgICAgKiBAbWVtYmVyb2YgTGliVGlNaWRpdHlcbiAgICAgICAgICogQGluc3RhbmNlXG4gICAgICAgICAqIEBwYXJhbSBjYiBDYWxsYmFjay5cbiAgICAgICAgICovXG5cbiAgICAgICAgZnVuY3Rpb24gYWRkT25QcmVNYWluKGNiKSB7XG4gICAgICAgICAgICBfX0FUTUFJTl9fLnVuc2hpZnQoY2IpO1xuICAgICAgICB9XG5cbiAgICAgICAgTW9kdWxlWydhZGRPblByZU1haW4nXSA9IGFkZE9uUHJlTWFpbjtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQGZ1bmN0aW9uIGFkZE9uRXhpdFxuICAgICAgICAgKiBAbWVtYmVyb2YgTGliVGlNaWRpdHlcbiAgICAgICAgICogQGluc3RhbmNlXG4gICAgICAgICAqIEBwYXJhbSBjYiBDYWxsYmFjay5cbiAgICAgICAgICovXG5cbiAgICAgICAgZnVuY3Rpb24gYWRkT25FeGl0KGNiKSB7XG4gICAgICAgICAgICBfX0FURVhJVF9fLnVuc2hpZnQoY2IpO1xuICAgICAgICB9XG5cbiAgICAgICAgTW9kdWxlWydhZGRPbkV4aXQnXSA9IGFkZE9uRXhpdDtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQGZ1bmN0aW9uIGFkZE9uUG9zdFJ1blxuICAgICAgICAgKiBAbWVtYmVyb2YgTGliVGlNaWRpdHlcbiAgICAgICAgICogQGluc3RhbmNlXG4gICAgICAgICAqIEBwYXJhbSBjYiBDYWxsYmFjay5cbiAgICAgICAgICovXG5cbiAgICAgICAgZnVuY3Rpb24gYWRkT25Qb3N0UnVuKGNiKSB7XG4gICAgICAgICAgICBfX0FUUE9TVFJVTl9fLnVuc2hpZnQoY2IpO1xuICAgICAgICB9XG5cbiAgICAgICAgTW9kdWxlWydhZGRPblBvc3RSdW4nXSA9IGFkZE9uUG9zdFJ1bjtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQGZ1bmN0aW9uIGludEFycmF5RnJvbVN0cmluZ1xuICAgICAgICAgKiBAbWVtYmVyb2YgTGliVGlNaWRpdHlcbiAgICAgICAgICogQGluc3RhbmNlXG4gICAgICAgICAqIEBwYXJhbSBzdHJpbmd5XG4gICAgICAgICAqIEBwYXJhbSBkb250QWRkTnVsbFxuICAgICAgICAgKiBAcGFyYW0gbGVuZ3RoXG4gICAgICAgICAqL1xuXG4gICAgICAgIC8vIFRvb2xzXG4gICAgICAgIC8vIFRoaXMgcHJvY2Vzc2VzIGEgSlMgc3RyaW5nIGludG8gYSBDLWxpbmUgYXJyYXkgb2YgbnVtYmVycywgMC10ZXJtaW5hdGVkLlxuICAgICAgICAvLyBGb3IgTExWTS1vcmlnaW5hdGluZyBzdHJpbmdzLCBzZWUgcGFyc2VyLmpzOnBhcnNlTExWTVN0cmluZyBmdW5jdGlvblxuICAgICAgICBmdW5jdGlvbiBpbnRBcnJheUZyb21TdHJpbmcoXG4gICAgICAgICAgICBzdHJpbmd5LFxuICAgICAgICAgICAgZG9udEFkZE51bGwsXG4gICAgICAgICAgICBsZW5ndGggLyogb3B0aW9uYWwgKi9cbiAgICAgICAgKSB7XG4gICAgICAgICAgICB2YXIgcmV0ID0gbmV3IFJ1bnRpbWUuVVRGOFByb2Nlc3NvcigpLnByb2Nlc3NKU1N0cmluZyhzdHJpbmd5KTtcbiAgICAgICAgICAgIGlmIChsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICByZXQubGVuZ3RoID0gbGVuZ3RoO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFkb250QWRkTnVsbCkge1xuICAgICAgICAgICAgICAgIHJldC5wdXNoKDApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgICAgfVxuXG4gICAgICAgIE1vZHVsZVsnaW50QXJyYXlGcm9tU3RyaW5nJ10gPSBpbnRBcnJheUZyb21TdHJpbmc7XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBmdW5jdGlvbiBpbnRBcnJheVRvU3RyaW5nXG4gICAgICAgICAqIEBtZW1iZXJvZiBMaWJUaU1pZGl0eVxuICAgICAgICAgKiBAaW5zdGFuY2VcbiAgICAgICAgICogQHBhcmFtIGFycmF5XG4gICAgICAgICAqL1xuXG4gICAgICAgIGZ1bmN0aW9uIGludEFycmF5VG9TdHJpbmcoYXJyYXkpIHtcbiAgICAgICAgICAgIHZhciByZXQgPSBbXTtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXJyYXkubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgY2hyID0gYXJyYXlbaV07XG4gICAgICAgICAgICAgICAgaWYgKGNociA+IDB4ZmYpIHtcbiAgICAgICAgICAgICAgICAgICAgY2hyICY9IDB4ZmY7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldC5wdXNoKFN0cmluZy5mcm9tQ2hhckNvZGUoY2hyKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmV0LmpvaW4oJycpO1xuICAgICAgICB9XG5cbiAgICAgICAgTW9kdWxlWydpbnRBcnJheVRvU3RyaW5nJ10gPSBpbnRBcnJheVRvU3RyaW5nO1xuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAZnVuY3Rpb24gd3JpdGVTdHJpbmdUb01lbW9yeVxuICAgICAgICAgKiBAbWVtYmVyb2YgTGliVGlNaWRpdHlcbiAgICAgICAgICogQGluc3RhbmNlXG4gICAgICAgICAqIEBwYXJhbSBzdHJpbmdcbiAgICAgICAgICogQHBhcmFtIGJ1ZmZlclxuICAgICAgICAgKiBAcGFyYW0gZG9udEFkZE51bGxcbiAgICAgICAgICovXG5cbiAgICAgICAgLy8gV3JpdGUgYSBKYXZhc2NyaXB0IGFycmF5IHRvIHNvbWV3aGVyZSBpbiB0aGUgaGVhcFxuICAgICAgICBmdW5jdGlvbiB3cml0ZVN0cmluZ1RvTWVtb3J5KHN0cmluZywgYnVmZmVyLCBkb250QWRkTnVsbCkge1xuICAgICAgICAgICAgdmFyIGFycmF5ID0gaW50QXJyYXlGcm9tU3RyaW5nKHN0cmluZywgZG9udEFkZE51bGwpO1xuICAgICAgICAgICAgdmFyIGkgPSAwO1xuICAgICAgICAgICAgd2hpbGUgKGkgPCBhcnJheS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB2YXIgY2hyID0gYXJyYXlbaV07XG4gICAgICAgICAgICAgICAgSEVBUDhbKGJ1ZmZlciArIGkpIHwgMF0gPSBjaHI7XG4gICAgICAgICAgICAgICAgaSA9IGkgKyAxO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgTW9kdWxlWyd3cml0ZVN0cmluZ1RvTWVtb3J5J10gPSB3cml0ZVN0cmluZ1RvTWVtb3J5O1xuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAZnVuY3Rpb24gd3JpdGVBcnJheVRvTWVtb3J5XG4gICAgICAgICAqIEBtZW1iZXJvZiBMaWJUaU1pZGl0eVxuICAgICAgICAgKiBAaW5zdGFuY2VcbiAgICAgICAgICogQHBhcmFtIGFycmF5XG4gICAgICAgICAqIEBwYXJhbSBidWZmZXJcbiAgICAgICAgICovXG5cbiAgICAgICAgZnVuY3Rpb24gd3JpdGVBcnJheVRvTWVtb3J5KGFycmF5LCBidWZmZXIpIHtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXJyYXkubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBIRUFQOFsoYnVmZmVyICsgaSkgfCAwXSA9IGFycmF5W2ldO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgTW9kdWxlWyd3cml0ZUFycmF5VG9NZW1vcnknXSA9IHdyaXRlQXJyYXlUb01lbW9yeTtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQGZ1bmN0aW9uIHdyaXRlQXNjaWlUb01lbW9yeVxuICAgICAgICAgKiBAbWVtYmVyb2YgTGliVGlNaWRpdHlcbiAgICAgICAgICogQGluc3RhbmNlXG4gICAgICAgICAqIEBwYXJhbSBzdHJcbiAgICAgICAgICogQHBhcmFtIGJ1ZmZlclxuICAgICAgICAgKiBAcGFyYW0gZG9udEFkZE51bGxcbiAgICAgICAgICovXG5cbiAgICAgICAgZnVuY3Rpb24gd3JpdGVBc2NpaVRvTWVtb3J5KHN0ciwgYnVmZmVyLCBkb250QWRkTnVsbCkge1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzdHIubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBIRUFQOFsoYnVmZmVyICsgaSkgfCAwXSA9IHN0ci5jaGFyQ29kZUF0KGkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFkb250QWRkTnVsbCkgSEVBUDhbKGJ1ZmZlciArIHN0ci5sZW5ndGgpIHwgMF0gPSAwO1xuICAgICAgICB9XG5cbiAgICAgICAgTW9kdWxlWyd3cml0ZUFzY2lpVG9NZW1vcnknXSA9IHdyaXRlQXNjaWlUb01lbW9yeTtcblxuICAgICAgICBmdW5jdGlvbiB1blNpZ24odmFsdWUsIGJpdHMsIGlnbm9yZSwgc2lnKSB7XG4gICAgICAgICAgICBpZiAodmFsdWUgPj0gMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBiaXRzIDw9IDMyXG4gICAgICAgICAgICAgICAgPyAyICogTWF0aC5hYnMoMSA8PCAoYml0cyAtIDEpKSArIHZhbHVlIC8vIE5lZWQgc29tZSB0cmlja2VyeSwgc2luY2UgaWYgYml0cyA9PSAzMiwgd2UgYXJlIHJpZ2h0IGF0IHRoZSBsaW1pdCBvZiB0aGUgYml0cyBKUyB1c2VzIGluIGJpdHNoaWZ0c1xuICAgICAgICAgICAgICAgIDogTWF0aC5wb3coMiwgYml0cykgKyB2YWx1ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlU2lnbih2YWx1ZSwgYml0cykge1xuICAgICAgICAgICAgaWYgKHZhbHVlIDw9IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgaGFsZiA9XG4gICAgICAgICAgICAgICAgYml0cyA8PSAzMlxuICAgICAgICAgICAgICAgICAgICA/IE1hdGguYWJzKDEgPDwgKGJpdHMgLSAxKSkgLy8gYWJzIGlzIG5lZWRlZCBpZiBiaXRzID09IDMyXG4gICAgICAgICAgICAgICAgICAgIDogTWF0aC5wb3coMiwgYml0cyAtIDEpO1xuICAgICAgICAgICAgaWYgKHZhbHVlID49IGhhbGYgJiYgKGJpdHMgPD0gMzIgfHwgdmFsdWUgPiBoYWxmKSkge1xuICAgICAgICAgICAgICAgIC8vIGZvciBodWdlIHZhbHVlcywgd2UgY2FuIGhpdCB0aGUgcHJlY2lzaW9uIGxpbWl0IGFuZCBhbHdheXMgZ2V0IHRydWUgaGVyZS4gc28gZG9uJ3QgZG8gdGhhdFxuICAgICAgICAgICAgICAgIC8vIGJ1dCwgaW4gZ2VuZXJhbCB0aGVyZSBpcyBubyBwZXJmZWN0IHNvbHV0aW9uIGhlcmUuIFdpdGggNjQtYml0IGludHMsIHdlIGdldCByb3VuZGluZyBhbmQgZXJyb3JzXG4gICAgICAgICAgICAgICAgLy8gVE9ETzogSW4gaTY0IG1vZGUgMSwgcmVzaWduIHRoZSB0d28gcGFydHMgc2VwYXJhdGVseSBhbmQgc2FmZWx5XG4gICAgICAgICAgICAgICAgdmFsdWUgPSAtMiAqIGhhbGYgKyB2YWx1ZTsgLy8gQ2Fubm90IGJpdHNoaWZ0IGhhbGYsIGFzIGl0IG1heSBiZSBhdCB0aGUgbGltaXQgb2YgdGhlIGJpdHMgSlMgdXNlcyBpbiBiaXRzaGlmdHNcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghTWF0aFsnaW11bCddKVxuICAgICAgICAgICAgTWF0aFsnaW11bCddID0gZnVuY3Rpb24oYSwgYikge1xuICAgICAgICAgICAgICAgIHZhciBhaCA9IGEgPj4+IDE2O1xuICAgICAgICAgICAgICAgIHZhciBhbCA9IGEgJiAweGZmZmY7XG4gICAgICAgICAgICAgICAgdmFyIGJoID0gYiA+Pj4gMTY7XG4gICAgICAgICAgICAgICAgdmFyIGJsID0gYiAmIDB4ZmZmZjtcbiAgICAgICAgICAgICAgICByZXR1cm4gKGFsICogYmwgKyAoKGFoICogYmwgKyBhbCAqIGJoKSA8PCAxNikpIHwgMDtcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgTWF0aC5pbXVsID0gTWF0aFsnaW11bCddO1xuXG4gICAgICAgIHZhciBNYXRoX2FicyA9IE1hdGguYWJzO1xuICAgICAgICB2YXIgTWF0aF9zaW4gPSBNYXRoLnNpbjtcbiAgICAgIC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WxmaWxsZWRcbiAgICAgICAgZnVuY3Rpb24gYWRkUnVuRGVwZW5kZW5jeShpZCkge1xuICAgICAgICAgICAgcnVuRGVwZW5kZW5jaWVzKys7XG4gICAgICAgICAgICBpZiAoTW9kdWxlWydtb25pdG9yUnVuRGVwZW5kZW5jaWVzJ10pIHtcbiAgICAgICAgICAgICAgICBNb2R1bGVbJ21vbml0b3JSdW5EZXBlbmRlbmNpZXMnXShydW5EZXBlbmRlbmNpZXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGlkKSB7XG4gICAgICAgICAgICAgICAgYXNzZXJ0KCFydW5EZXBlbmRlbmN5VHJhY2tpbmdbaWRdKTtcbiAgICAgICAgICAgICAgICBydW5EZXBlbmRlbmN5VHJhY2tpbmdbaWRdID0gMTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29uc29sZS53YXJuKCd3YXJuaW5nOiBydW4gZGVwZW5kZW5jeSBhZGRlZCB3aXRob3V0IElEJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgTW9kdWxlWydhZGRSdW5EZXBlbmRlbmN5J10gPSBhZGRSdW5EZXBlbmRlbmN5O1xuICAgICAgICBmdW5jdGlvbiByZW1vdmVSdW5EZXBlbmRlbmN5KGlkKSB7XG4gICAgICAgICAgICBydW5EZXBlbmRlbmNpZXMtLTtcbiAgICAgICAgICAgIGlmIChNb2R1bGVbJ21vbml0b3JSdW5EZXBlbmRlbmNpZXMnXSkge1xuICAgICAgICAgICAgICAgIE1vZHVsZVsnbW9uaXRvclJ1bkRlcGVuZGVuY2llcyddKHJ1bkRlcGVuZGVuY2llcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaWQpIHtcbiAgICAgICAgICAgICAgICBhc3NlcnQocnVuRGVwZW5kZW5jeVRyYWNraW5nW2lkXSk7XG4gICAgICAgICAgICAgICAgZGVsZXRlIHJ1bkRlcGVuZGVuY3lUcmFja2luZ1tpZF07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbnNvbGUud2Fybignd2FybmluZzogcnVuIGRlcGVuZGVuY3kgcmVtb3ZlZCB3aXRob3V0IElEJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAocnVuRGVwZW5kZW5jaWVzID09IDApIHtcbiAgICAgICAgICAgICAgICBpZiAocnVuRGVwZW5kZW5jeVdhdGNoZXIgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbChydW5EZXBlbmRlbmN5V2F0Y2hlcik7XG4gICAgICAgICAgICAgICAgICAgIHJ1bkRlcGVuZGVuY3lXYXRjaGVyID0gbnVsbDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGRlcGVuZGVuY2llc0Z1bGZpbGxlZCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgY2FsbGJhY2sgPSBkZXBlbmRlbmNpZXNGdWxmaWxsZWQ7XG4gICAgICAgICAgICAgICAgICAgIGRlcGVuZGVuY2llc0Z1bGZpbGxlZCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKCk7IC8vIGNhbiBhZGQgYW5vdGhlciBkZXBlbmRlbmNpZXNGdWxmaWxsZWRcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgTW9kdWxlWydyZW1vdmVSdW5EZXBlbmRlbmN5J10gPSByZW1vdmVSdW5EZXBlbmRlbmN5O1xuICAgICAgICBNb2R1bGVbJ3ByZWxvYWRlZEltYWdlcyddID0ge307IC8vIG1hcHMgdXJsIHRvIGltYWdlIGRhdGFcbiAgICAgICAgTW9kdWxlWydwcmVsb2FkZWRBdWRpb3MnXSA9IHt9OyAvLyBtYXBzIHVybCB0byBhdWRpbyBkYXRhXG4gICAgICAgIHZhciBtZW1vcnlJbml0aWFsaXplciA9IG51bGw7XG4g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GltZS5HTE9CQUxfQkFTRSlcbiAgICAgICAgdmFyIHRlbXBEb3VibGVQdHIgPSBSdW50aW1lLmFsaWduTWVtb3J5KFxuICAgICAgICAgICAgYWxsb2NhdGUoMTIsICdpOCcsIEFMTE9DX1NUQVRJQyksXG4gICAgICAgICAgICA4XG4gICAgICAgICk7XG4gICAgICAgIGFzc2VydCh0ZW1wRG91YmxlUHRyICUgOCA9PSAwKTtcblxuICAgICAgICB2YXIgX19fZXJybm9fc3RhdGUgPSAwO1xuICAgICAgICBmdW5jdGlvbiBfX19zZXRFcnJObyh2YWx1ZSkge1xuICAgICAgICAgICAgLy8gRm9yIGNvbnZlbmllbnQgc2V0dGluZyBhbmQgcmV0dXJuaW5nIG9mIGVycm5vLlxuICAgICAgICAgICAgSEVBUDMyW19fX2Vycm5vX3N0YXRlID4+IDJdID0gdmFsdWU7XG4gICAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBQQVRIID0ge1xuICAgICAgICAgICAgc3BsaXRQYXRoOiBmdW5jdGlvbihmaWxlbmFtZSkge1xuICAgICAgICAgICAgICAgIHZhciBzcGxpdFBhdGhSZSA9IC9eKFxcLz98KShbXFxzXFxTXSo/KSgoPzpcXC57MSwyfXxbXlxcL10rP3wpKFxcLlteLlxcL10qfCkpKD86W1xcL10qKSQvO1xuICAgICAgICAgICAgICAgIHJldHVybiBzcGxpdFBhdGhSZS5leGVjKGZpbGVuYW1lKS5zbGljZSgxKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBub3JtYWxpemVBcnJheTogZnVuY3Rpb24ocGFydHMsIGFsbG93QWJvdmVSb290KSB7XG4gICAgICAgICAgICAgICAgLy8gaWYgdGhlIHBhdGggdHJpZXMgdG8gZ28gYWJvdmUgdGhlIHJvb3QsIGB1cGAgZW5kcyB1cCA+IDBcbiAgICAgICAgICAgICAgICB2YXIgdXAgPSAwO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSBwYXJ0cy5sZW5ndGggLSAxOyBpID49IDA7IGktLSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbGFzdCA9IHBhcnRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAobGFzdCA9PT0gJy4nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJ0cy5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobGFzdCA9PT0gJy4uJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFydHMuc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdXArKztcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh1cCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFydHMuc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdXAtLTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBpZiB0aGUgcGF0aCBpcyBhbGxvd2VkIHRvIGdvIGFib3ZlIHRoZSByb290LCByZXN0b3JlIGxlYWRpbmcgLi5zXG4gICAgICAgICAgICAgICAgaWYgKGFsbG93QWJvdmVSb290KSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAoOyB1cC0tOyB1cCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFydHMudW5zaGlmdCgnLi4nKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcGFydHM7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbm9ybWFsaXplOiBmdW5jdGlvbihwYXRoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGlzQWJzb2x1dGUgPSBwYXRoLmNoYXJBdCgwKSA9PT0gJy8nLFxuICAgICAgICAgICAgICAgICAgICB0cmFpbGluZ1NsYXNoID0gcGF0aC5zdWJzdHIoLTEpID09PSAnLyc7XG4gICAgICAgICAgICAgICAgLy8gTm9ybWFsaXplIHRoZSBwYXRoXG4gICAgICAgICAgICAgICAgcGF0aCA9IFBBVEgubm9ybWFsaXplQXJyYXkoXG4gICAgICAgICAgICAgICAgICAgIHBhdGguc3BsaXQoJy8nKS5maWx0ZXIoZnVuY3Rpb24ocCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICEhcDtcbiAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICAgICFpc0Fic29sdXRlXG4gICAgICAgICAgICAgICAgKS5qb2luKCcvJyk7XG4gICAgICAgICAgICAgICAgaWYgKCFwYXRoICYmICFpc0Fic29sdXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIHBhdGggPSAnLic7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChwYXRoICYmIHRyYWlsaW5nU2xhc2gpIHtcbiAgICAgICAgICAgICAgICAgICAgcGF0aCArPSAnLyc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiAoaXNBYnNvbHV0ZSA/ICcvJyA6ICcnKSArIHBhdGg7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZGlybmFtZTogZnVuY3Rpb24ocGF0aCkge1xuICAgICAgICAgICAgICAgIHZhciByZXN1bHQgPSBQQVRILnNwbGl0UGF0aChwYXRoKSxcbiAgICAgICAgICAgICAgICAgICAgcm9vdCA9IHJlc3VsdFswXSxcbiAgICAgICAgICAgICAgICAgICAgZGlyID0gcmVzdWx0WzFdO1xuICAgICAgICAgICAgICAgIGlmICghcm9vdCAmJiAhZGlyKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIE5vIGRpcm5hbWUgd2hhdHNvZXZlclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJy4nO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoZGlyKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIEl0IGhhcyBhIGRpcm5hbWUsIHN0cmlwIHRyYWlsaW5nIHNsYXNoXG4gICAgICAgICAgICAgICAgICAgIGRpciA9IGRpci5zdWJzdHIoMCwgZGlyLmxlbmd0aCAtIDEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcm9vdCArIGRpcjtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBiYXNlbmFtZTogZnVuY3Rpb24ocGF0aCwgZXh0KSB7XG4gICAgICAgICAgICAgICAgLy8gRU1TQ1JJUFRFTiByZXR1cm4gJy8nJyBmb3IgJy8nLCBub3QgYW4gZW1wdHkgc3RyaW5nXG4gICAgICAgICAgICAgICAgaWYgKHBhdGggPT09ICcvJykgcmV0dXJuICcvJztcbiAgICAgICAgICAgICAgICB2YXIgZiA9IFBBVEguc3BsaXRQYXRoKHBhdGgpWzJdO1xuICAgICAgICAgICAgICAgIGlmIChleHQgJiYgZi5zdWJzdHIoLTEgKiBleHQubGVuZ3RoKSA9PT0gZXh0KSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPSBmLnN1YnN0cigwLCBmLmxlbmd0aCAtIGV4dC5sZW5ndGgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gZjtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBleHRuYW1lOiBmdW5jdGlvbihwYXRoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFBBVEguc3BsaXRQYXRoKHBhdGgpWzNdO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGpvaW46IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHZhciBwYXRocyA9IEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKGFyZ3VtZW50cywgMCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFBBVEgubm9ybWFsaXplKFxuICAgICAgICAgICAgICAgICAgICBwYXRoc1xuICAgICAgICAgICAgICAgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbihwLCBpbmRleCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcCAhPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdBcmd1bWVudHMgdG8gcGF0aC5qb2luIG11c3QgYmUgc3RyaW5ncydcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgLmpvaW4oJy8nKVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcmVzb2x2ZTogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgdmFyIHJlc29sdmVkUGF0aCA9ICcnLFxuICAgICAgICAgICAgICAgICAgICByZXNvbHZlZEFic29sdXRlID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgZm9yIChcbiAgICAgICAgICAgICAgICAgICAgdmFyIGkgPSBhcmd1bWVudHMubGVuZ3RoIC0gMTtcbiAgICAgICAgICAgICAgICAgICAgaSA+PSAtMSAmJiAhcmVzb2x2ZWRBYnNvbHV0ZTtcbiAgICAgICAgICAgICAgICAgICAgaS0tXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXRoID0gaSA+PSAwID8gYXJndW1lbnRzW2ldIDogRlMuY3dkKCk7XG4gICAgICAgICAgICAgICAgICAgIC8vIFNraXAgZW1wdHkgYW5kIGludmFsaWQgZW50cmllc1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHBhdGggIT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdBcmd1bWVudHMgdG8gcGF0aC5yZXNvbHZlIG11c3QgYmUgc3RyaW5ncydcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIXBhdGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJlc29sdmVkUGF0aCA9IHBhdGggKyAnLycgKyByZXNvbHZlZFBhdGg7XG4gICAgICAgICAgICAgICAgICAgIHJlc29sdmVkQWJzb2x1dGUgPSBwYXRoLmNoYXJBdCgwKSA9PT0gJy8nO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBBdCB0aGlzIHBvaW50IHRoZSBwYXRoIHNob3VsZCBiZSByZXNvbHZlZCB0byBhIGZ1bGwgYWJzb2x1dGUgcGF0aCwgYnV0XG4gICAgICAgICAgICAgICAgLy8gaGFuZGxlIHJlbGF0aXZlIHBhdGhzIHRvIGJlIHNhZmUgKG1pZ2h0IGhhcHBlbiB3aGVuIHByb2Nlc3MuY3dkKCkgZmFpbHMpXG4gICAgICAgICAgICAgICAgcmVzb2x2ZWRQYXRoID0gUEFUSC5ub3JtYWxpemVBcnJheShcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZWRQYXRoLnNwbGl0KCcvJykuZmlsdGVyKGZ1bmN0aW9uKHApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAhIXA7XG4gICAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgICAhcmVzb2x2ZWRBYnNvbHV0ZVxuICAgICAgICAgICAgICAgICkuam9pbignLycpO1xuICAgICAgICAgICAgICAgIHJldHVybiAocmVzb2x2ZWRBYnNvbHV0ZSA/ICcvJyA6ICcnKSArIHJlc29sdmVkUGF0aCB8fCAnLic7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcmVsYXRpdmU6IGZ1bmN0aW9uKGZyb20sIHRvKSB7XG4gICAgICAgICAgICAgICAgZnJvbSA9IFBBVEgucmVzb2x2ZShmcm9tKS5zdWJzdHIoMSk7XG4gICAgICAgICAgICAgICAgdG8gPSBQQVRILnJlc29sdmUodG8pLnN1YnN0cigxKTtcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiB0cmltKGFycikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgc3RhcnQgPSAwO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKDsgc3RhcnQgPCBhcnIubGVuZ3RoOyBzdGFydCsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXJyW3N0YXJ0XSAhPT0gJycpIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHZhciBlbmQgPSBhcnIubGVuZ3RoIC0gMTtcbiAgICAgICAgICAgICAgICAgICAgZm9yICg7IGVuZCA+PSAwOyBlbmQtLSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFycltlbmRdICE9PSAnJykgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXJ0ID4gZW5kKSByZXR1cm4gW107XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnIuc2xpY2Uoc3RhcnQsIGVuZCAtIHN0YXJ0ICsgMSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBmcm9tUGFydHMgPSB0cmltKGZyb20uc3BsaXQoJy8nKSk7XG4gICAgICAgICAgICAgICAgdmFyIHRvUGFydHMgPSB0cmltKHRvLnNwbGl0KCcvJykpO1xuICAgICAgICAgICAgICAgIHZhciBsZW5ndGggPSBNYXRoLm1pbihmcm9tUGFydHMubGVuZ3RoLCB0b1BhcnRzLmxlbmd0aCk7XG4gICAgICAgICAgICAgICAgdmFyIHNhbWVQYXJ0c0xlbmd0aCA9IGxlbmd0aDtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChmcm9tUGFydHNbaV0gIT09IHRvUGFydHNbaV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNhbWVQYXJ0c0xlbmd0aCA9IGk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgb3V0cHV0UGFydHMgPSBbXTtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gc2FtZVBhcnRzTGVuZ3RoOyBpIDwgZnJvbVBhcnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dFBhcnRzLnB1c2goJy4uJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG91dHB1dFBhcnRzID0gb3V0cHV0UGFydHMuY29uY2F0KFxuICAgICAgICAgICAgICAgICAgICB0b1BhcnRzLnNsaWNlKHNhbWVQYXJ0c0xlbmd0aClcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIHJldHVybiBvdXRwdXRQYXJ0cy5qb2luKCcvJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIHZhciBUVFkgPSB7XG4gICAgICAgICAgICB0dHlzOiBbXSxcbiAgICAgICAgICAgIGluaXQ6IGZ1bmN0aW9uKCkge30sXG4gICAgICAgICAgICBzaHV0ZG93bjogZnVuY3Rpb24oKSB7fSxcbiAgICAgICAgICAgIHJlZ2lzdGVyOiBmdW5jdGlvbihkZXYsIG9wcykge1xuICAgICAgICAgICAgICAgIFRUWS50dHlzW2Rldl0gPSB7IGlucHV0OiBbXSwgb3V0cHV0OiBbXSwgb3BzOiBvcHMgfTtcbiAgICAgICAgICAgICAgICBGUy5yZWdpc3RlckRldmljZShkZXYsIFRUWS5zdHJlYW1fb3BzKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzdHJlYW1fb3BzOiB7XG4gICAgICAgICAgICAgICAgb3BlbjogZnVuY3Rpb24oc3RyZWFtKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0dHkgPSBUVFkudHR5c1tzdHJlYW0ubm9kZS5yZGV2XTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0dHkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOT0RFVik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgc3RyZWFtLnR0eSA9IHR0eTtcbiAgICAgICAgICAgICAgICAgICAgc3RyZWFtLnNlZWthYmxlID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBjbG9zZTogZnVuY3Rpb24oc3RyZWFtKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGZsdXNoIGFueSBwZW5kaW5nIGxpbmUgZGF0YVxuICAgICAgICAgICAgICAgICAgICBpZiAoc3RyZWFtLnR0eS5vdXRwdXQubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW0udHR5Lm9wcy5wdXRfY2hhcihzdHJlYW0udHR5LCAxMCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHJlYWQ6IGZ1bmN0aW9uKFxuICAgICAgICAgICAgICAgICAgICBzdHJlYW0sXG4gICAgICAgICAgICAgICAgICAgIGJ1ZmZlcixcbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0LFxuICAgICAgICAgICAgICAgICAgICBsZW5ndGgsXG4gICAgICAgICAgICAgICAgICAgIHBvcyAvKiBpZ25vcmVkICovXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghc3RyZWFtLnR0eSB8fCAhc3RyZWFtLnR0eS5vcHMuZ2V0X2NoYXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOWElPKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB2YXIgYnl0ZXNSZWFkID0gMDtcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gc3RyZWFtLnR0eS5vcHMuZ2V0X2NoYXIoc3RyZWFtLnR0eSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUlPKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQgPT09IHVuZGVmaW5lZCAmJiBieXRlc1JlYWQgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FQUdBSU4pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCA9PT0gbnVsbCB8fCByZXN1bHQgPT09IHVuZGVmaW5lZCkgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICBieXRlc1JlYWQrKztcbiAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlcltvZmZzZXQgKyBpXSA9IHJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoYnl0ZXNSZWFkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW0ubm9kZS50aW1lc3RhbXAgPSBEYXRlLm5vdygpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBieXRlc1JlYWQ7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB3cml0ZTogZnVuY3Rpb24oc3RyZWFtLCBidWZmZXIsIG9mZnNldCwgbGVuZ3RoLCBwb3MpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzdHJlYW0udHR5IHx8ICFzdHJlYW0udHR5Lm9wcy5wdXRfY2hhcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRU5YSU8pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtLnR0eS5vcHMucHV0X2NoYXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbS50dHksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlcltvZmZzZXQgKyBpXVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUlPKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAobGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW0ubm9kZS50aW1lc3RhbXAgPSBEYXRlLm5vdygpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBkZWZhdWx0X3R0eV9vcHM6IHtcbiAgICAgICAgICAgICAgICBnZXRfY2hhcjogZnVuY3Rpb24odHR5KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghdHR5LmlucHV0Lmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlc3VsdCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZW9mIHdpbmRvdyAhPSAndW5kZWZpbmVkJyAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVvZiB3aW5kb3cucHJvbXB0ID09ICdmdW5jdGlvbidcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEJyb3dzZXIuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gd2luZG93LnByb21wdCgnSW5wdXQ6ICcpOyAvLyByZXR1cm5zIG51bGwgb24gY2FuY2VsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ1xcbic7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgcmVhZGxpbmUgPT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIENvbW1hbmQgbGluZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSByZWFkbGluZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdcXG4nO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghcmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB0dHkuaW5wdXQgPSBpbnRBcnJheUZyb21TdHJpbmcocmVzdWx0LCB0cnVlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHR5LmlucHV0LnNoaWZ0KCk7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBwdXRfY2hhcjogZnVuY3Rpb24odHR5LCB2YWwpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHZhbCA9PT0gbnVsbCB8fCB2YWwgPT09IDEwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyh0dHkub3V0cHV0LmpvaW4oJycpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHR0eS5vdXRwdXQgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHR0eS5vdXRwdXQucHVzaChUVFkudXRmOC5wcm9jZXNzQ0NoYXIodmFsKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZGVmYXVsdF90dHkxX29wczoge1xuICAgICAgICAgICAgICAgIHB1dF9jaGFyOiBmdW5jdGlvbih0dHksIHZhbCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodmFsID09PSBudWxsIHx8IHZhbCA9PT0gMTApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2Fybih0dHkub3V0cHV0LmpvaW4oJycpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHR0eS5vdXRwdXQgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHR0eS5vdXRwdXQucHVzaChUVFkudXRmOC5wcm9jZXNzQ0NoYXIodmFsKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIHZhciBNRU1GUyA9IHtcbiAgICAgICAgICAgIENPTlRFTlRfT1dOSU5HOiAxLFxuICAgICAgICAgICAgQ09OVEVOVF9GTEVYSUJMRTogMixcbiAgICAgICAgICAgIENPTlRFTlRfRklYRUQ6IDMsXG4gICAgICAgICAgICBtb3VudDogZnVuY3Rpb24obW91bnQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gTUVNRlMuY3JlYXRlTm9kZShudWxsLCAnLycsIDE2Mzg0IHwgMG83NzcsIDApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNyZWF0ZU5vZGU6IGZ1bmN0aW9uKHBhcmVudCwgbmFtZSwgbW9kZSwgZGV2KSB7XG4gICAgICAgICAgICAgICAgaWYgKEZTLmlzQmxrZGV2KG1vZGUpIHx8IEZTLmlzRklGTyhtb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBubyBzdXBwb3J0ZWRcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRVBFUk0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgbm9kZSA9IEZTLmNyZWF0ZU5vZGUocGFyZW50LCBuYW1lLCBtb2RlLCBkZXYpO1xuICAgICAgICAgICAgICAgIGlmIChGUy5pc0Rpcihub2RlLm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUubm9kZV9vcHMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBnZXRhdHRyOiBNRU1GUy5ub2RlX29wcy5nZXRhdHRyLFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0YXR0cjogTUVNRlMubm9kZV9vcHMuc2V0YXR0cixcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvb2t1cDogTUVNRlMubm9kZV9vcHMubG9va3VwLFxuICAgICAgICAgICAgICAgICAgICAgICAgbWtub2Q6IE1FTUZTLm5vZGVfb3BzLm1rbm9kLFxuICAgICAgICAgICAgICAgICAgICAgICAgbWtub2Q6IE1FTUZTLm5vZGVfb3BzLm1rbm9kLFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVuYW1lOiBNRU1GUy5ub2RlX29wcy5yZW5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICB1bmxpbms6IE1FTUZTLm5vZGVfb3BzLnVubGluayxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJtZGlyOiBNRU1GUy5ub2RlX29wcy5ybWRpcixcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlYWRkaXI6IE1FTUZTLm5vZGVfb3BzLnJlYWRkaXIsXG4gICAgICAgICAgICAgICAgICAgICAgICBzeW1saW5rOiBNRU1GUy5ub2RlX29wcy5zeW1saW5rXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIG5vZGUuc3RyZWFtX29wcyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxsc2VlazogTUVNRlMuc3RyZWFtX29wcy5sbHNlZWtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5jb250ZW50cyA9IHt9O1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoRlMuaXNGaWxlKG5vZGUubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5ub2RlX29wcyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGdldGF0dHI6IE1FTUZTLm5vZGVfb3BzLmdldGF0dHIsXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRhdHRyOiBNRU1GUy5ub2RlX29wcy5zZXRhdHRyXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIG5vZGUuc3RyZWFtX29wcyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxsc2VlazogTUVNRlMuc3RyZWFtX29wcy5sbHNlZWssXG4gICAgICAgICAgICAgICAgICAgICAgICByZWFkOiBNRU1GUy5zdHJlYW1fb3BzLnJlYWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZTogTUVNRlMuc3RyZWFtX29wcy53cml0ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFsbG9jYXRlOiBNRU1GUy5zdHJlYW1fb3BzLmFsbG9jYXRlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbW1hcDogTUVNRlMuc3RyZWFtX29wcy5tbWFwXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIG5vZGUuY29udGVudHMgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5jb250ZW50TW9kZSA9IE1FTUZTLkNPTlRFTlRfRkxFWElCTEU7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChGUy5pc0xpbmsobm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICBub2RlLm5vZGVfb3BzID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgZ2V0YXR0cjogTUVNRlMubm9kZV9vcHMuZ2V0YXR0cixcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldGF0dHI6IE1FTUZTLm5vZGVfb3BzLnNldGF0dHIsXG4gICAgICAgICAgICAgICAgICAgICAgICByZWFkbGluazogTUVNRlMubm9kZV9vcHMucmVhZGxpbmtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5zdHJlYW1fb3BzID0ge307XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChGUy5pc0NocmRldihub2RlLm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUubm9kZV9vcHMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBnZXRhdHRyOiBNRU1GUy5ub2RlX29wcy5nZXRhdHRyLFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0YXR0cjogTUVNRlMubm9kZV9vcHMuc2V0YXR0clxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICBub2RlLnN0cmVhbV9vcHMgPSBGUy5jaHJkZXZfc3RyZWFtX29wcztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbm9kZS50aW1lc3RhbXAgPSBEYXRlLm5vdygpO1xuICAgICAgICAgICAgICAgIC8vIGFkZCB0aGUgbmV3IG5vZGUgdG8gdGhlIHBhcmVudFxuICAgICAgICAgICAgICAgIGlmIChwYXJlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyZW50LmNvbnRlbnRzW25hbWVdID0gbm9kZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5vZGU7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZW5zdXJlRmxleGlibGU6IGZ1bmN0aW9uKG5vZGUpIHtcbiAgICAgICAgICAgICAgICBpZiAobm9kZS5jb250ZW50TW9kZSAhPT0gTUVNRlMuQ09OVEVOVF9GTEVYSUJMRSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgY29udGVudHMgPSBub2RlLmNvbnRlbnRzO1xuICAgICAgICAgICAgICAgICAgICBub2RlLmNvbnRlbnRzID0gQXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoY29udGVudHMpO1xuICAgICAgICAgICAgICAgICAgICBub2RlLmNvbnRlbnRNb2RlID0gTUVNRlMuQ09OVEVOVF9GTEVYSUJMRTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbm9kZV9vcHM6IHtcbiAgICAgICAgICAgICAgICBnZXRhdHRyOiBmdW5jdGlvbihub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBhdHRyID0ge307XG4gICAgICAgICAgICAgICAgICAgIC8vIGRldmljZSBudW1iZXJzIHJldXNlIGlub2RlIG51bWJlcnMuXG4gICAgICAgICAgICAgICAgICAgIGF0dHIuZGV2ID0gRlMuaXNDaHJkZXYobm9kZS5tb2RlKSA/IG5vZGUuaWQgOiAxO1xuICAgICAgICAgICAgICAgICAgICBhdHRyLmlubyA9IG5vZGUuaWQ7XG4gICAgICAgICAgICAgICAgICAgIGF0dHIubW9kZSA9IG5vZGUubW9kZTtcbiAgICAgICAgICAgICAgICAgICAgYXR0ci5ubGluayA9IDE7XG4gICAgICAgICAgICAgICAgICAgIGF0dHIudWlkID0gMDtcbiAgICAgICAgICAgICAgICAgICAgYXR0ci5naWQgPSAwO1xuICAgICAgICAgICAgICAgICAgICBhdHRyLnJkZXYgPSBub2RlLnJkZXY7XG4gICAgICAgICAgICAgICAgICAgIGlmIChGUy5pc0Rpcihub2RlLm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhdHRyLnNpemUgPSA0MDk2O1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKEZTLmlzRmlsZShub2RlLm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhdHRyLnNpemUgPSBub2RlLmNvbnRlbnRzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChGUy5pc0xpbmsobm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYXR0ci5zaXplID0gbm9kZS5saW5rLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGF0dHIuc2l6ZSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYXR0ci5hdGltZSA9IG5ldyBEYXRlKG5vZGUudGltZXN0YW1wKTtcbiAgICAgICAgICAgICAgICAgICAgYXR0ci5tdGltZSA9IG5ldyBEYXRlKG5vZGUudGltZXN0YW1wKTtcbiAgICAgICAgICAgICAgICAgICAgYXR0ci5jdGltZSA9IG5ldyBEYXRlKG5vZGUudGltZXN0YW1wKTtcbiAgICAgICAgICAgICAgICAgICAgLy8gTk9URTogSW4gb3VyIGltcGxlbWVudGF0aW9uLCBzdF9ibG9ja3MgPSBNYXRoLmNlaWwoc3Rfc2l6ZS9zdF9ibGtzaXplKSxcbiAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgYnV0IHRoaXMgaXMgbm90IHJlcXVpcmVkIGJ5IHRoZSBzdGFuZGFyZC5cbiAgICAgICAgICAgICAgICAgICAgYXR0ci5ibGtzaXplID0gNDA5NjtcbiAgICAgICAgICAgICAgICAgICAgYXR0ci5ibG9ja3MgPSBNYXRoLmNlaWwoYXR0ci5zaXplIC8gYXR0ci5ibGtzaXplKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF0dHI7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBzZXRhdHRyOiBmdW5jdGlvbihub2RlLCBhdHRyKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhdHRyLm1vZGUgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5tb2RlID0gYXR0ci5tb2RlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChhdHRyLnRpbWVzdGFtcCAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLnRpbWVzdGFtcCA9IGF0dHIudGltZXN0YW1wO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChhdHRyLnNpemUgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgTUVNRlMuZW5zdXJlRmxleGlibGUobm9kZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29udGVudHMgPSBub2RlLmNvbnRlbnRzO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGF0dHIuc2l6ZSA8IGNvbnRlbnRzLmxlbmd0aClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50cy5sZW5ndGggPSBhdHRyLnNpemU7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGF0dHIuc2l6ZSA+IGNvbnRlbnRzLmxlbmd0aClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudHMucHVzaCgwKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgbG9va3VwOiBmdW5jdGlvbihwYXJlbnQsIG5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRU5PRU5UKTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIG1rbm9kOiBmdW5jdGlvbihwYXJlbnQsIG5hbWUsIG1vZGUsIGRldikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gTUVNRlMuY3JlYXRlTm9kZShwYXJlbnQsIG5hbWUsIG1vZGUsIGRldik7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICByZW5hbWU6IGZ1bmN0aW9uKG9sZF9ub2RlLCBuZXdfZGlyLCBuZXdfbmFtZSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBpZiB3ZSdyZSBvdmVyd3JpdGluZyBhIGRpcmVjdG9yeSBhdCBuZXdfbmFtZSwgbWFrZSBzdXJlIGl0J3MgZW1wdHkuXG4gICAgICAgICAgICAgICAgICAgIGlmIChGUy5pc0RpcihvbGRfbm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG5ld19ub2RlO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfbm9kZSA9IEZTLmxvb2t1cE5vZGUobmV3X2RpciwgbmV3X25hbWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXdfbm9kZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgaW4gbmV3X25vZGUuY29udGVudHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRU5PVEVNUFRZKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgLy8gZG8gdGhlIGludGVybmFsIHJld2lyaW5nXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBvbGRfbm9kZS5wYXJlbnQuY29udGVudHNbb2xkX25vZGUubmFtZV07XG4gICAgICAgICAgICAgICAgICAgIG9sZF9ub2RlLm5hbWUgPSBuZXdfbmFtZTtcbiAgICAgICAgICAgICAgICAgICAgbmV3X2Rpci5jb250ZW50c1tuZXdfbmFtZV0gPSBvbGRfbm9kZTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHVubGluazogZnVuY3Rpb24ocGFyZW50LCBuYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBwYXJlbnQuY29udGVudHNbbmFtZV07XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBybWRpcjogZnVuY3Rpb24ocGFyZW50LCBuYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBub2RlID0gRlMubG9va3VwTm9kZShwYXJlbnQsIG5hbWUpO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpIGluIG5vZGUuY29udGVudHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOT1RFTVBUWSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHBhcmVudC5jb250ZW50c1tuYW1lXTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHJlYWRkaXI6IGZ1bmN0aW9uKG5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGVudHJpZXMgPSBbJy4nLCAnLi4nXTtcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIga2V5IGluIG5vZGUuY29udGVudHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbm9kZS5jb250ZW50cy5oYXNPd25Qcm9wZXJ0eShrZXkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbnRyaWVzLnB1c2goa2V5KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZW50cmllcztcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHN5bWxpbms6IGZ1bmN0aW9uKHBhcmVudCwgbmV3bmFtZSwgb2xkcGF0aCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbm9kZSA9IE1FTUZTLmNyZWF0ZU5vZGUoXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnQsXG4gICAgICAgICAgICAgICAgICAgICAgICBuZXduYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgMG83NzcgfCA0MDk2MCxcbiAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5saW5rID0gb2xkcGF0aDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5vZGU7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICByZWFkbGluazogZnVuY3Rpb24obm9kZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIUZTLmlzTGluayhub2RlLm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSU5WQUwpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBub2RlLmxpbms7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHN0cmVhbV9vcHM6IHtcbiAgICAgICAgICAgICAgICByZWFkOiBmdW5jdGlvbihzdHJlYW0sIGJ1ZmZlciwgb2Zmc2V0LCBsZW5ndGgsIHBvc2l0aW9uKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjb250ZW50cyA9IHN0cmVhbS5ub2RlLmNvbnRlbnRzO1xuICAgICAgICAgICAgICAgICAgICBpZiAocG9zaXRpb24gPj0gY29udGVudHMubGVuZ3RoKSByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNpemUgPSBNYXRoLm1pbihjb250ZW50cy5sZW5ndGggLSBwb3NpdGlvbiwgbGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgYXNzZXJ0KHNpemUgPj0gMCk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzaXplID4gOCAmJiBjb250ZW50cy5zdWJhcnJheSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm9uLXRyaXZpYWwsIGFuZCB0eXBlZCBhcnJheVxuICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLnNldChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50cy5zdWJhcnJheShwb3NpdGlvbiwgcG9zaXRpb24gKyBzaXplKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXRcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpemU7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlcltvZmZzZXQgKyBpXSA9IGNvbnRlbnRzW3Bvc2l0aW9uICsgaV07XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNpemU7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB3cml0ZTogZnVuY3Rpb24oXG4gICAgICAgICAgICAgICAgICAgIHN0cmVhbSxcbiAgICAgICAgICAgICAgICAgICAgYnVmZmVyLFxuICAgICAgICAgICAgICAgICAgICBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgIGxlbmd0aCxcbiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24sXG4gICAgICAgICAgICAgICAgICAgIGNhbk93blxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbm9kZSA9IHN0cmVhbS5ub2RlO1xuICAgICAgICAgICAgICAgICAgICBub2RlLnRpbWVzdGFtcCA9IERhdGUubm93KCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjb250ZW50cyA9IG5vZGUuY29udGVudHM7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudHMubGVuZ3RoID09PSAwICYmXG4gICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9PT0gMCAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLnN1YmFycmF5XG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8ganVzdCByZXBsYWNlIGl0IHdpdGggdGhlIG5ldyBkYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICBhc3NlcnQoYnVmZmVyLmxlbmd0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FuT3duICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLmJ1ZmZlciA9PT0gSEVBUDguYnVmZmVyICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID09PSAwXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLmNvbnRlbnRzID0gYnVmZmVyOyAvLyB0aGlzIGlzIGEgc3ViYXJyYXkgb2YgdGhlIGhlYXAsIGFuZCB3ZSBjYW4gb3duIGl0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5jb250ZW50TW9kZSA9IE1FTUZTLkNPTlRFTlRfT1dOSU5HO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLmNvbnRlbnRzID0gbmV3IFVpbnQ4QXJyYXkoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlci5zdWJhcnJheShvZmZzZXQsIG9mZnNldCArIGxlbmd0aClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUuY29udGVudE1vZGUgPSBNRU1GUy5DT05URU5UX0ZJWEVEO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBNRU1GUy5lbnN1cmVGbGV4aWJsZShub2RlKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRlbnRzID0gbm9kZS5jb250ZW50cztcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGNvbnRlbnRzLmxlbmd0aCA8IHBvc2l0aW9uKSBjb250ZW50cy5wdXNoKDApO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50c1twb3NpdGlvbiArIGldID0gYnVmZmVyW29mZnNldCArIGldO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBsZW5ndGg7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBsbHNlZWs6IGZ1bmN0aW9uKHN0cmVhbSwgb2Zmc2V0LCB3aGVuY2UpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBvc2l0aW9uID0gb2Zmc2V0O1xuICAgICAgICAgICAgICAgICAgICBpZiAod2hlbmNlID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBTRUVLX0NVUi5cbiAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uICs9IHN0cmVhbS5wb3NpdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3aGVuY2UgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNFRUtfRU5ELlxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEZTLmlzRmlsZShzdHJlYW0ubm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uICs9IHN0cmVhbS5ub2RlLmNvbnRlbnRzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAocG9zaXRpb24gPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSU5WQUwpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHN0cmVhbS51bmdvdHRlbiA9IFtdO1xuICAgICAgICAgICAgICAgICAgICBzdHJlYW0ucG9zaXRpb24gPSBwb3NpdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBvc2l0aW9uO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgYWxsb2NhdGU6IGZ1bmN0aW9uKHN0cmVhbSwgb2Zmc2V0LCBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgTUVNRlMuZW5zdXJlRmxleGlibGUoc3RyZWFtLm5vZGUpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgY29udGVudHMgPSBzdHJlYW0ubm9kZS5jb250ZW50cztcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxpbWl0ID0gb2Zmc2V0ICsgbGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAobGltaXQgPiBjb250ZW50cy5sZW5ndGgpIGNvbnRlbnRzLnB1c2goMCk7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBtbWFwOiBmdW5jdGlvbihcbiAgICAgICAgICAgICAgICAgICAgc3RyZWFtLFxuICAgICAgICAgICAgICAgICAgICBidWZmZXIsXG4gICAgICAgICAgICAgICAgICAgIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbixcbiAgICAgICAgICAgICAgICAgICAgcHJvdCxcbiAgICAgICAgICAgICAgICAgICAgZmxhZ3NcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFGUy5pc0ZpbGUoc3RyZWFtLm5vZGUubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOT0RFVik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdmFyIHB0cjtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGFsbG9jYXRlZDtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRlbnRzID0gc3RyZWFtLm5vZGUuY29udGVudHM7XG4gICAgICAgICAgICAgICAgICAgIC8vIE9ubHkgbWFrZSBhIG5ldyBjb3B5IHdoZW4gTUFQX1BSSVZBVEUgaXMgc3BlY2lmaWVkLlxuICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAhKGZsYWdzICYgMikgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIChjb250ZW50cy5idWZmZXIgPT09IGJ1ZmZlciB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnRzLmJ1ZmZlciA9PT0gYnVmZmVyLmJ1ZmZlcilcbiAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBjYW4ndCBlbXVsYXRlIE1BUF9TSEFSRUQgd2hlbiB0aGUgZmlsZSBpcyBub3QgYmFja2VkIGJ5IHRoZSBidWZmZXJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlJ3JlIG1hcHBpbmcgdG8gKGUuZy4gdGhlIEhFQVAgYnVmZmVyKS5cbiAgICAgICAgICAgICAgICAgICAgICAgIGFsbG9jYXRlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgcHRyID0gY29udGVudHMuYnl0ZU9mZnNldDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRyeSB0byBhdm9pZCB1bm5lY2Vzc2FyeSBzbGljZXMuXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPiAwIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gKyBsZW5ndGggPCBjb250ZW50cy5sZW5ndGhcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb250ZW50cy5zdWJhcnJheSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50cyA9IGNvbnRlbnRzLnN1YmFycmF5KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiArIGxlbmd0aFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnRzID0gQXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50cyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gKyBsZW5ndGhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBhbGxvY2F0ZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgcHRyID0gX21hbGxvYyhsZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFwdHIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FTk9NRU0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLnNldChjb250ZW50cywgcHRyKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4geyBwdHI6IHB0ciwgYWxsb2NhdGVkOiBhbGxvY2F0ZWQgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIHZhciBJREJGUyA9IHtcbiAgICAgICAgICAgIGRiczoge30sXG4gICAgICAgICAgICBpbmRleGVkREI6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5pbmRleGVkREIgfHxcbiAgICAgICAgICAgICAgICAgICAgd2luZG93Lm1vekluZGV4ZWREQiB8fFxuICAgICAgICAgICAgICAgICAgICB3aW5kb3cud2Via2l0SW5kZXhlZERCIHx8XG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5tc0luZGV4ZWREQlxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgREJfVkVSU0lPTjogMjAsXG4gICAgICAgICAgICBEQl9TVE9SRV9OQU1FOiAnRklMRV9EQVRBJyxcbiAgICAgICAgICAgIG1vdW50OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gTUVNRlMubW91bnQuYXBwbHkobnVsbCwgYXJndW1lbnRzKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzeW5jZnM6IGZ1bmN0aW9uKG1vdW50LCBwb3B1bGF0ZSwgY2FsbGJhY2spIHtcbiAgICAgICAgICAgICAgICBJREJGUy5nZXRMb2NhbFNldChtb3VudCwgZnVuY3Rpb24oZXJyLCBsb2NhbCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoZXJyKSByZXR1cm4gY2FsbGJhY2soZXJyKTtcbiAgICAgICAgICAgICAgICAgICAgSURCRlMuZ2V0UmVtb3RlU2V0KG1vdW50LCBmdW5jdGlvbihlcnIsIHJlbW90ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVycikgcmV0dXJuIGNhbGxiYWNrKGVycik7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3JjID0gcG9wdWxhdGUgPyByZW1vdGUgOiBsb2NhbDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkc3QgPSBwb3B1bGF0ZSA/IGxvY2FsIDogcmVtb3RlO1xuICAgICAgICAgICAgICAgICAgICAgICAgSURCRlMucmVjb25jaWxlKHNyYywgZHN0LCBjYWxsYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHJlY29uY2lsZTogZnVuY3Rpb24oc3JjLCBkc3QsIGNhbGxiYWNrKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRvdGFsID0gMDtcbiAgICAgICAgICAgICAgICB2YXIgY3JlYXRlID0ge307XG4gICAgICAgICAgICAgICAgZm9yICh2YXIga2V5IGluIHNyYy5maWxlcykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXNyYy5maWxlcy5oYXNPd25Qcm9wZXJ0eShrZXkpKSBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGUgPSBzcmMuZmlsZXNba2V5XTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGUyID0gZHN0LmZpbGVzW2tleV07XG4gICAgICAgICAgICAgICAgICAgIGlmICghZTIgfHwgZS50aW1lc3RhbXAgPiBlMi50aW1lc3RhbXApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNyZWF0ZVtrZXldID0gZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvdGFsKys7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIHJlbW92ZSA9IHt9O1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGtleSBpbiBkc3QuZmlsZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFkc3QuZmlsZXMuaGFzT3duUHJvcGVydHkoa2V5KSkgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgIHZhciBlID0gZHN0LmZpbGVzW2tleV07XG4gICAgICAgICAgICAgICAgICAgIHZhciBlMiA9IHNyYy5maWxlc1trZXldO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWUyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVba2V5XSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICB0b3RhbCsrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghdG90YWwpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gZWFybHkgb3V0XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhudWxsKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIGNvbXBsZXRlZCA9IDA7XG4gICAgICAgICAgICAgICAgdmFyIGRvbmUgPSBmdW5jdGlvbihlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycikgcmV0dXJuIGNhbGxiYWNrKGVycik7XG4gICAgICAgICAgICAgICAgICAgIGlmICgrK2NvbXBsZXRlZCA+PSB0b3RhbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKG51bGwpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAvLyBjcmVhdGUgYSBzaW5nbGUgdHJhbnNhY3Rpb24gdG8gaGFuZGxlIGFuZCBJREIgcmVhZHMgLyB3cml0ZXMgd2UnbGwgbmVlZCB0byBkb1xuICAgICAgICAgICAgICAgIHZhciBkYiA9IHNyYy50eXBlID09PSAncmVtb3RlJyA/IHNyYy5kYiA6IGRzdC5kYjtcbiAgICAgICAgICAgICAgICB2YXIgdHJhbnNhY3Rpb24gPSBkYi50cmFuc2FjdGlvbihcbiAgICAgICAgICAgICAgICAgICAgW0lEQkZTLkRCX1NUT1JFX05BTUVdLFxuICAgICAgICAgICAgICAgICAgICAncmVhZHdyaXRlJ1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgdHJhbnNhY3Rpb24ub25lcnJvciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayh0aGlzLmVycm9yKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHZhciBzdG9yZSA9IHRyYW5zYWN0aW9uLm9iamVjdFN0b3JlKElEQkZTLkRCX1NUT1JFX05BTUUpO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIHBhdGggaW4gY3JlYXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghY3JlYXRlLmhhc093blByb3BlcnR5KHBhdGgpKSBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGVudHJ5ID0gY3JlYXRlW3BhdGhdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZHN0LnR5cGUgPT09ICdsb2NhbCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNhdmUgZmlsZSB0byBsb2NhbFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoRlMuaXNEaXIoZW50cnkubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlMubWtkaXIocGF0aCwgZW50cnkubW9kZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChGUy5pc0ZpbGUoZW50cnkubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN0cmVhbSA9IEZTLm9wZW4ocGF0aCwgJ3crJywgMG82NjYpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUy53cml0ZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudHJ5LmNvbnRlbnRzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudHJ5LmNvbnRlbnRzLmxlbmd0aCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnVlIC8qIGNhbk93biAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUy5jbG9zZShzdHJlYW0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb25lKG51bGwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkb25lKGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2F2ZSBmaWxlIHRvIElEQlxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcSA9IHN0b3JlLnB1dChlbnRyeSwgcGF0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXEub25zdWNjZXNzID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9uZShudWxsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICByZXEub25lcnJvciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvbmUodGhpcy5lcnJvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGZvciAodmFyIHBhdGggaW4gcmVtb3ZlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcmVtb3ZlLmhhc093blByb3BlcnR5KHBhdGgpKSBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGVudHJ5ID0gcmVtb3ZlW3BhdGhdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZHN0LnR5cGUgPT09ICdsb2NhbCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRlbGV0ZSBmaWxlIGZyb20gbG9jYWxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEZTLmlzRGlyKGVudHJ5Lm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPRE8gcmVjdXJzaXZlIGRlbGV0ZT9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlMucm1kaXIocGF0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChGUy5pc0ZpbGUoZW50cnkubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlMudW5saW5rKHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb25lKG51bGwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkb25lKGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZGVsZXRlIGZpbGUgZnJvbSBJREJcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXEgPSBzdG9yZS5kZWxldGUocGF0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXEub25zdWNjZXNzID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9uZShudWxsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICByZXEub25lcnJvciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvbmUodGhpcy5lcnJvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdldExvY2FsU2V0OiBmdW5jdGlvbihtb3VudCwgY2FsbGJhY2spIHtcbiAgICAgICAgICAgICAgICB2YXIgZmlsZXMgPSB7fTtcbiAgICAgICAgICAgICAgICB2YXIgaXNSZWFsRGlyID0gZnVuY3Rpb24ocCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcCAhPT0gJy4nICYmIHAgIT09ICcuLic7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB2YXIgdG9BYnNvbHV0ZSA9IGZ1bmN0aW9uKHJvb3QpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBQQVRILmpvaW4ocm9vdCwgcCk7XG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB2YXIgY2hlY2sgPSBGUy5yZWFkZGlyKG1vdW50Lm1vdW50cG9pbnQpXG4gICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoaXNSZWFsRGlyKVxuICAgICAgICAgICAgICAgICAgICAubWFwKHRvQWJzb2x1dGUobW91bnQubW91bnRwb2ludCkpO1xuICAgICAgICAgICAgICAgIHdoaWxlIChjaGVjay5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBhdGggPSBjaGVjay5wb3AoKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHN0YXQsIG5vZGU7XG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgbG9va3VwID0gRlMubG9va3VwUGF0aChwYXRoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUgPSBsb29rdXAubm9kZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXQgPSBGUy5zdGF0KHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2FsbGJhY2soZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKEZTLmlzRGlyKHN0YXQubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrLnB1c2guYXBwbHkoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hlY2ssXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRlMucmVhZGRpcihwYXRoKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZmlsdGVyKGlzUmVhbERpcilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm1hcCh0b0Fic29sdXRlKHBhdGgpKVxuICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVzW3BhdGhdID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGU6IHN0YXQubW9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lc3RhbXA6IHN0YXQubXRpbWVcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoRlMuaXNGaWxlKHN0YXQubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVzW3BhdGhdID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnRzOiBub2RlLmNvbnRlbnRzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGU6IHN0YXQubW9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lc3RhbXA6IHN0YXQubXRpbWVcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2FsbGJhY2sobmV3IEVycm9yKCdub2RlIHR5cGUgbm90IHN1cHBvcnRlZCcpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gY2FsbGJhY2sobnVsbCwgeyB0eXBlOiAnbG9jYWwnLCBmaWxlczogZmlsZXMgfSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZ2V0REI6IGZ1bmN0aW9uKG5hbWUsIGNhbGxiYWNrKSB7XG4gICAgICAgICAgICAgICAgLy8gbG9vayBpdCB1cCBpbiB0aGUgY2FjaGVcbiAgICAgICAgICAgICAgICB2YXIgZGIgPSBJREJGUy5kYnNbbmFtZV07XG4gICAgICAgICAgICAgICAgaWYgKGRiKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhudWxsLCBkYik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciByZXE7XG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgcmVxID0gSURCRlMuaW5kZXhlZERCKCkub3BlbihuYW1lLCBJREJGUy5EQl9WRVJTSU9OKTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBvbmVycm9yKGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXEub251cGdyYWRlbmVlZGVkID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIGRiID0gcmVxLnJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgZGIuY3JlYXRlT2JqZWN0U3RvcmUoSURCRlMuREJfU1RPUkVfTkFNRSk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICByZXEub25zdWNjZXNzID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIGRiID0gcmVxLnJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgLy8gYWRkIHRvIHRoZSBjYWNoZVxuICAgICAgICAgICAgICAgICAgICBJREJGUy5kYnNbbmFtZV0gPSBkYjtcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2sobnVsbCwgZGIpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgcmVxLm9uZXJyb3IgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2sodGhpcy5lcnJvcik7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBnZXRSZW1vdGVTZXQ6IGZ1bmN0aW9uKG1vdW50LCBjYWxsYmFjaykge1xuICAgICAgICAgICAgICAgIHZhciBmaWxlcyA9IHt9O1xuICAgICAgICAgICAgICAgIElEQkZTLmdldERCKG1vdW50Lm1vdW50cG9pbnQsIGZ1bmN0aW9uKGVyciwgZGIpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycikgcmV0dXJuIGNhbGxiYWNrKGVycik7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0cmFuc2FjdGlvbiA9IGRiLnRyYW5zYWN0aW9uKFxuICAgICAgICAgICAgICAgICAgICAgICAgW0lEQkZTLkRCX1NUT1JFX05BTUVdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlYWRvbmx5J1xuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICB0cmFuc2FjdGlvbi5vbmVycm9yID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayh0aGlzLmVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHN0b3JlID0gdHJhbnNhY3Rpb24ub2JqZWN0U3RvcmUoSURCRlMuREJfU1RPUkVfTkFNRSk7XG4gICAgICAgICAgICAgICAgICAgIHN0b3JlLm9wZW5DdXJzb3IoKS5vbnN1Y2Nlc3MgPSBmdW5jdGlvbihldmVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnNvciA9IGV2ZW50LnRhcmdldC5yZXN1bHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWN1cnNvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhudWxsLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdyZW1vdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYjogZGIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVzOiBmaWxlc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZmlsZXNbY3Vyc29yLmtleV0gPSBjdXJzb3IudmFsdWU7XG4gICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3IuY29udGludWUoKTtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgdmFyIE5PREVGUyA9IHtcbiAgICAgICAgICAgIG1vdW50OiBmdW5jdGlvbigpIHt9LFxuICAgICAgICAgICAgY3JlYXRlTm9kZTogZnVuY3Rpb24ocGFyZW50LCBuYW1lLCBtb2RlLCBkZXYpIHtcbiAgICAgICAgICAgICAgICBpZiAoIUZTLmlzRGlyKG1vZGUpICYmICFGUy5pc0ZpbGUobW9kZSkgJiYgIUZTLmlzTGluayhtb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSU5WQUwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgbm9kZSA9IEZTLmNyZWF0ZU5vZGUocGFyZW50LCBuYW1lLCBtb2RlKTtcbiAgICAgICAgICAgICAgICBub2RlLm5vZGVfb3BzID0gTk9ERUZTLm5vZGVfb3BzO1xuICAgICAgICAgICAgICAgIG5vZGUuc3RyZWFtX29wcyA9IE5PREVGUy5zdHJlYW1fb3BzO1xuICAgICAgICAgICAgICAgIHJldHVybiBub2RlO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdldE1vZGU6IGZ1bmN0aW9uKHBhdGgpIHtcbiAgICAgICAgICAgICAgICB2YXIgc3RhdDtcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBzdGF0ID0gZnMubHN0YXRTeW5jKHBhdGgpO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFlLmNvZGUpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTW2UuY29kZV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gc3RhdC5tb2RlO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHJlYWxQYXRoOiBmdW5jdGlvbihub2RlKSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhcnRzID0gW107XG4gICAgICAgICAgICAgICAgd2hpbGUgKG5vZGUucGFyZW50ICE9PSBub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgIHBhcnRzLnB1c2gobm9kZS5uYW1lKTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZSA9IG5vZGUucGFyZW50O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBwYXJ0cy5wdXNoKG5vZGUubW91bnQub3B0cy5yb290KTtcbiAgICAgICAgICAgICAgICBwYXJ0cy5yZXZlcnNlKCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFBBVEguam9pbi5hcHBseShudWxsLCBwYXJ0cyk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbm9kZV9vcHM6IHtcbiAgICAgICAgICAgICAgICBnZXRhdHRyOiBmdW5jdGlvbihub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXRoID0gTk9ERUZTLnJlYWxQYXRoKG5vZGUpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgc3RhdDtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXQgPSBmcy5sc3RhdFN5bmMocGF0aCk7XG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZS5jb2RlKSB0aHJvdyBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVNbZS5jb2RlXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRldjogc3RhdC5kZXYsXG4gICAgICAgICAgICAgICAgICAgICAgICBpbm86IHN0YXQuaW5vLFxuICAgICAgICAgICAgICAgICAgICAgICAgbW9kZTogc3RhdC5tb2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbmxpbms6IHN0YXQubmxpbmssXG4gICAgICAgICAgICAgICAgICAgICAgICB1aWQ6IHN0YXQudWlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgZ2lkOiBzdGF0LmdpZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJkZXY6IHN0YXQucmRldixcbiAgICAgICAgICAgICAgICAgICAgICAgIHNpemU6IHN0YXQuc2l6ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGF0aW1lOiBzdGF0LmF0aW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgbXRpbWU6IHN0YXQubXRpbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBjdGltZTogc3RhdC5jdGltZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJsa3NpemU6IHN0YXQuYmxrc2l6ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJsb2Nrczogc3RhdC5ibG9ja3NcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHNldGF0dHI6IGZ1bmN0aW9uKG5vZGUsIGF0dHIpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBhdGggPSBOT0RFRlMucmVhbFBhdGgobm9kZSk7XG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXR0ci5tb2RlICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcy5jaG1vZFN5bmMocGF0aCwgYXR0ci5tb2RlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB1cGRhdGUgdGhlIGNvbW1vbiBub2RlIHN0cnVjdHVyZSBtb2RlIGFzIHdlbGxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLm1vZGUgPSBhdHRyLm1vZGU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXR0ci50aW1lc3RhbXAgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkYXRlID0gbmV3IERhdGUoYXR0ci50aW1lc3RhbXApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZzLnV0aW1lc1N5bmMocGF0aCwgZGF0ZSwgZGF0ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXR0ci5zaXplICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcy50cnVuY2F0ZVN5bmMocGF0aCwgYXR0ci5zaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlLmNvZGUpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFU1tlLmNvZGVdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgbG9va3VwOiBmdW5jdGlvbihwYXJlbnQsIG5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBhdGggPSBQQVRILmpvaW4oTk9ERUZTLnJlYWxQYXRoKHBhcmVudCksIG5hbWUpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgbW9kZSA9IE5PREVGUy5nZXRNb2RlKHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gTk9ERUZTLmNyZWF0ZU5vZGUocGFyZW50LCBuYW1lLCBtb2RlKTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIG1rbm9kOiBmdW5jdGlvbihwYXJlbnQsIG5hbWUsIG1vZGUsIGRldikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbm9kZSA9IE5PREVGUy5jcmVhdGVOb2RlKHBhcmVudCwgbmFtZSwgbW9kZSwgZGV2KTtcbiAgICAgICAgICAgICAgICAgICAgLy8gY3JlYXRlIHRoZSBiYWNraW5nIG5vZGUgZm9yIHRoaXMgaW4gdGhlIGZzIHJvb3QgYXMgd2VsbFxuICAgICAgICAgICAgICAgICAgICB2YXIgcGF0aCA9IE5PREVGUy5yZWFsUGF0aChub2RlKTtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGUy5pc0Rpcihub2RlLm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnMubWtkaXJTeW5jKHBhdGgsIG5vZGUubW9kZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZzLndyaXRlRmlsZVN5bmMocGF0aCwgJycsIHsgbW9kZTogbm9kZS5tb2RlIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWUuY29kZSkgdGhyb3cgZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTW2UuY29kZV0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBub2RlO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgcmVuYW1lOiBmdW5jdGlvbihvbGROb2RlLCBuZXdEaXIsIG5ld05hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG9sZFBhdGggPSBOT0RFRlMucmVhbFBhdGgob2xkTm9kZSk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBuZXdQYXRoID0gUEFUSC5qb2luKE5PREVGUy5yZWFsUGF0aChuZXdEaXIpLCBuZXdOYW1lKTtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZzLnJlbmFtZVN5bmMob2xkUGF0aCwgbmV3UGF0aCk7XG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZS5jb2RlKSB0aHJvdyBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVNbZS5jb2RlXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHVubGluazogZnVuY3Rpb24ocGFyZW50LCBuYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXRoID0gUEFUSC5qb2luKE5PREVGUy5yZWFsUGF0aChwYXJlbnQpLCBuYW1lKTtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZzLnVubGlua1N5bmMocGF0aCk7XG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZS5jb2RlKSB0aHJvdyBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVNbZS5jb2RlXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHJtZGlyOiBmdW5jdGlvbihwYXJlbnQsIG5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBhdGggPSBQQVRILmpvaW4oTk9ERUZTLnJlYWxQYXRoKHBhcmVudCksIG5hbWUpO1xuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZnMucm1kaXJTeW5jKHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWUuY29kZSkgdGhyb3cgZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTW2UuY29kZV0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICByZWFkZGlyOiBmdW5jdGlvbihub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXRoID0gTk9ERUZTLnJlYWxQYXRoKG5vZGUpO1xuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZzLnJlYWRkaXJTeW5jKHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWUuY29kZSkgdGhyb3cgZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTW2UuY29kZV0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBzeW1saW5rOiBmdW5jdGlvbihwYXJlbnQsIG5ld05hbWUsIG9sZFBhdGgpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG5ld1BhdGggPSBQQVRILmpvaW4oTk9ERUZTLnJlYWxQYXRoKHBhcmVudCksIG5ld05hbWUpO1xuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZnMuc3ltbGlua1N5bmMob2xkUGF0aCwgbmV3UGF0aCk7XG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZS5jb2RlKSB0aHJvdyBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVNbZS5jb2RlXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHJlYWRsaW5rOiBmdW5jdGlvbihub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXRoID0gTk9ERUZTLnJlYWxQYXRoKG5vZGUpO1xuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZzLnJlYWRsaW5rU3luYyhwYXRoKTtcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlLmNvZGUpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFU1tlLmNvZGVdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzdHJlYW1fb3BzOiB7XG4gICAgICAgICAgICAgICAgb3BlbjogZnVuY3Rpb24oc3RyZWFtKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXRoID0gTk9ERUZTLnJlYWxQYXRoKHN0cmVhbS5ub2RlKTtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGUy5pc0ZpbGUoc3RyZWFtLm5vZGUubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW0ubmZkID0gZnMub3BlblN5bmMocGF0aCwgc3RyZWFtLmZsYWdzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlLmNvZGUpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFU1tlLmNvZGVdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgY2xvc2U6IGZ1bmN0aW9uKHN0cmVhbSkge1xuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEZTLmlzRmlsZShzdHJlYW0ubm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZzLmNsb3NlU3luYyhzdHJlYW0ubmZkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlLmNvZGUpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFU1tlLmNvZGVdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgcmVhZDogZnVuY3Rpb24oc3RyZWFtLCBidWZmZXIsIG9mZnNldCwgbGVuZ3RoLCBwb3NpdGlvbikge1xuICAgICAgICAgICAgICAgICAgICAvLyBGSVhNRSB0aGlzIGlzIHRlcnJpYmxlLlxuICAgICAgICAgICAgICAgICAgICB2YXIgbmJ1ZmZlciA9IG5ldyBCdWZmZXIobGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlcztcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcyA9IGZzLnJlYWRTeW5jKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbS5uZmQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmJ1ZmZlcixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVNbZS5jb2RlXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcmVzOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWZmZXJbb2Zmc2V0ICsgaV0gPSBuYnVmZmVyW2ldO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXM7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB3cml0ZTogZnVuY3Rpb24oc3RyZWFtLCBidWZmZXIsIG9mZnNldCwgbGVuZ3RoLCBwb3NpdGlvbikge1xuICAgICAgICAgICAgICAgICAgICAvLyBGSVhNRSB0aGlzIGlzIHRlcnJpYmxlLlxuICAgICAgICAgICAgICAgICAgICB2YXIgbmJ1ZmZlciA9IG5ldyBCdWZmZXIoXG4gICAgICAgICAgICAgICAgICAgICAgICBidWZmZXIuc3ViYXJyYXkob2Zmc2V0LCBvZmZzZXQgKyBsZW5ndGgpXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIHZhciByZXM7XG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXMgPSBmcy53cml0ZVN5bmMoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtLm5mZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYnVmZmVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uXG4gICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFU1tlLmNvZGVdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgbGxzZWVrOiBmdW5jdGlvbihzdHJlYW0sIG9mZnNldCwgd2hlbmNlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwb3NpdGlvbiA9IG9mZnNldDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHdoZW5jZSA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gU0VFS19DVVIuXG4gICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiArPSBzdHJlYW0ucG9zaXRpb247XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAod2hlbmNlID09PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBTRUVLX0VORC5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGUy5pc0ZpbGUoc3RyZWFtLm5vZGUubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3RhdCA9IGZzLmZzdGF0U3luYyhzdHJlYW0ubmZkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gKz0gc3RhdC5zaXplO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVNbZS5jb2RlXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChwb3NpdGlvbiA8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlZBTCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgc3RyZWFtLnBvc2l0aW9uID0gcG9zaXRpb247XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwb3NpdGlvbjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIHZhciBfc3RkaW4gPSBhbGxvY2F0ZSgxLCAnaTMyKicsIEFMTE9DX1NUQVRJQyk7XG4gICAgICAgIHZhciBfc3Rkb3V0ID0gYWxsb2NhdGUoMSwgJ2kzMionLCBBTExPQ19TVEFUSUMpO1xuICAgICAgICB2YXIgX3N0ZGVyciA9IGFsbG9jYXRlKDEsICdpMzIqJywgQUxMT0NfU1RBVElDKTtcbiAgICAgICAgZnVuY3Rpb24gX2ZmbHVzaChzdHJlYW0pIHtcbiAgICAgICAgICAgIC8vIGludCBmZmx1c2goRklMRSAqc3RyZWFtKTtcbiAgICAgICAgICAgIC8vIGh0dHA6Ly9wdWJzLm9wZW5ncm91cC5vcmcvb25saW5lcHVicy8wMDAwOTUzOTkvZnVuY3Rpb25zL2ZmbHVzaC5odG1sXG4gICAgICAgICAgICAvLyB3ZSBkb24ndCBjdXJyZW50bHkgcGVyZm9ybSBhbnkgdXNlci1zcGFjZSBidWZmZXJpbmcgb2YgZGF0YVxuICAgICAgICB9XG4gICAgICAgIHZhciBGUyA9IHtcbiAgICAgICAgICAgIHJvb3Q6IG51bGwsXG4gICAgICAgICAgICBtb3VudHM6IFtdLFxuICAgICAgICAgICAgZGV2aWNlczogW251bGxdLFxuICAgICAgICAgICAgc3RyZWFtczogW251bGxdLFxuICAgICAgICAgICAgbmV4dElub2RlOiAxLFxuICAgICAgICAgICAgbmFtZVRhYmxlOiBudWxsLFxuICAgICAgICAgICAgY3VycmVudFBhdGg6ICcvJyxcbiAgICAgICAgICAgIGluaXRpYWxpemVkOiBmYWxzZSxcbiAgICAgICAgICAgIGlnbm9yZVBlcm1pc3Npb25zOiB0cnVlLFxuICAgICAgICAgICAgLy8gZXJyb3IgaW5zdGFuY2VcbiAgICAgICAgICAgIEVycm5vRXJyb3I6IGZ1bmN0aW9uIEVycm5vRXJyb3IoZXJyb3JOdW1iZXIsIGRldGFpbHMpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmVycm9yTnVtYmVyID0gZXJyb3JOdW1iZXI7XG4gICAgICAgICAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gRVJSTk9fQ09ERVMpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKEVSUk5PX0NPREVTW2tleV0gPT09IGVycm9yTnVtYmVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyByZW1vdmUgdGhlIHByZWZpeCAnRSdcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY29kZSA9IGtleS5zdWJzdHJpbmcoMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLm1lc3NhZ2UgPSBFUlJOT19NRVNTQUdFU1tlcnJvck51bWJlcl07XG4gICAgICAgICAgICAgICAgdGhpcy5kZXRhaWxzID0gZGV0YWlscyB8fCAnJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBoYW5kbGVGU0Vycm9yOiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCEoZSBpbnN0YW5jZW9mIEZTLkVycm5vRXJyb3IpKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBlICsgJyA6ICcgKyBuZXcgRXJyb3IoKS5zdGFjaztcbiAgICAgICAgICAgICAgICByZXR1cm4gX19fc2V0RXJyTm8oZS5lcnJubyk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbG9va3VwUGF0aDogZnVuY3Rpb24ocGF0aCwgb3B0cykge1xuICAgICAgICAgICAgICAgIHBhdGggPSBQQVRILnJlc29sdmUoRlMuY3dkKCksIHBhdGgpO1xuICAgICAgICAgICAgICAgIG9wdHMgPSBvcHRzIHx8IHsgcmVjdXJzZV9jb3VudDogMCB9O1xuICAgICAgICAgICAgICAgIGlmIChvcHRzLnJlY3Vyc2VfY291bnQgPiA4KSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIG1heCByZWN1cnNpdmUgbG9va3VwIG9mIDhcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUxPT1ApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBzcGxpdCB0aGUgcGF0aFxuICAgICAgICAgICAgICAgIHZhciBwYXJ0cyA9IFBBVEgubm9ybWFsaXplQXJyYXkoXG4gICAgICAgICAgICAgICAgICAgIHBhdGguc3BsaXQoJy8nKS5maWx0ZXIoZnVuY3Rpb24ocCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICEhcDtcbiAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICAgIGZhbHNlXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAvLyBzdGFydCBhdCB0aGUgcm9vdFxuICAgICAgICAgICAgICAgIHZhciBjdXJyZW50ID0gRlMucm9vdDtcbiAgICAgICAgICAgICAgICB2YXIgY3VycmVudF9wYXRoID0gJy8nO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcGFydHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGlzbGFzdCA9IGkgPT09IHBhcnRzLmxlbmd0aCAtIDE7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc2xhc3QgJiYgb3B0cy5wYXJlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN0b3AgcmVzb2x2aW5nXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjdXJyZW50ID0gRlMubG9va3VwTm9kZShjdXJyZW50LCBwYXJ0c1tpXSk7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfcGF0aCA9IFBBVEguam9pbihjdXJyZW50X3BhdGgsIHBhcnRzW2ldKTtcbiAgICAgICAgICAgICAgICAgICAgLy8ganVtcCB0byB0aGUgbW91bnQncyByb290IG5vZGUgaWYgdGhpcyBpcyBhIG1vdW50cG9pbnRcbiAgICAgICAgICAgICAgICAgICAgaWYgKEZTLmlzTW91bnRwb2ludChjdXJyZW50KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudCA9IGN1cnJlbnQubW91bnQucm9vdDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBmb2xsb3cgc3ltbGlua3NcbiAgICAgICAgICAgICAgICAgICAgLy8gYnkgZGVmYXVsdCwgbG9va3VwUGF0aCB3aWxsIG5vdCBmb2xsb3cgYSBzeW1saW5rIGlmIGl0IGlzIHRoZSBmaW5hbCBwYXRoIGNvbXBvbmVudC5cbiAgICAgICAgICAgICAgICAgICAgLy8gc2V0dGluZyBvcHRzLmZvbGxvdyA9IHRydWUgd2lsbCBvdmVycmlkZSB0aGlzIGJlaGF2aW9yLlxuICAgICAgICAgICAgICAgICAgICBpZiAoIWlzbGFzdCB8fCBvcHRzLmZvbGxvdykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvdW50ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChGUy5pc0xpbmsoY3VycmVudC5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5rID0gRlMucmVhZGxpbmsoY3VycmVudF9wYXRoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50X3BhdGggPSBQQVRILnJlc29sdmUoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBBVEguZGlybmFtZShjdXJyZW50X3BhdGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5rXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbG9va3VwID0gRlMubG9va3VwUGF0aChjdXJyZW50X3BhdGgsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjdXJzZV9jb3VudDogb3B0cy5yZWN1cnNlX2NvdW50XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudCA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb3VudCsrID4gNDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbGltaXQgbWF4IGNvbnNlY3V0aXZlIHN5bWxpbmtzIHRvIDQwIChTWU1MT09QX01BWCkuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVMT09QKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHsgcGF0aDogY3VycmVudF9wYXRoLCBub2RlOiBjdXJyZW50IH07XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZ2V0UGF0aDogZnVuY3Rpb24obm9kZSkge1xuICAgICAgICAgICAgICAgIHZhciBwYXRoO1xuICAgICAgICAgICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChGUy5pc1Jvb3Qobm9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwYXRoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBQQVRILmpvaW4obm9kZS5tb3VudC5tb3VudHBvaW50LCBwYXRoKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbm9kZS5tb3VudC5tb3VudHBvaW50O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHBhdGggPSBwYXRoID8gUEFUSC5qb2luKG5vZGUubmFtZSwgcGF0aCkgOiBub2RlLm5hbWU7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUgPSBub2RlLnBhcmVudDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaGFzaE5hbWU6IGZ1bmN0aW9uKHBhcmVudGlkLCBuYW1lKSB7XG4gICAgICAgICAgICAgICAgdmFyIGhhc2ggPSAwO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbmFtZS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBoYXNoID0gKChoYXNoIDw8IDUpIC0gaGFzaCArIG5hbWUuY2hhckNvZGVBdChpKSkgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gKChwYXJlbnRpZCArIGhhc2gpID4+PiAwKSAlIEZTLm5hbWVUYWJsZS5sZW5ndGg7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaGFzaEFkZE5vZGU6IGZ1bmN0aW9uKG5vZGUpIHtcbiAgICAgICAgICAgICAgICB2YXIgaGFzaCA9IEZTLmhhc2hOYW1lKG5vZGUucGFyZW50LmlkLCBub2RlLm5hbWUpO1xuICAgICAgICAgICAgICAgIG5vZGUubmFtZV9uZXh0ID0gRlMubmFtZVRhYmxlW2hhc2hdO1xuICAgICAgICAgICAgICAgIEZTLm5hbWVUYWJsZVtoYXNoXSA9IG5vZGU7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaGFzaFJlbW92ZU5vZGU6IGZ1bmN0aW9uKG5vZGUpIHtcbiAgICAgICAgICAgICAgICB2YXIgaGFzaCA9IEZTLmhhc2hOYW1lKG5vZGUucGFyZW50LmlkLCBub2RlLm5hbWUpO1xuICAgICAgICAgICAgICAgIGlmIChGUy5uYW1lVGFibGVbaGFzaF0gPT09IG5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgRlMubmFtZVRhYmxlW2hhc2hdID0gbm9kZS5uYW1lX25leHQ7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnJlbnQgPSBGUy5uYW1lVGFibGVbaGFzaF07XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlIChjdXJyZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudC5uYW1lX25leHQgPT09IG5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50Lm5hbWVfbmV4dCA9IG5vZGUubmFtZV9uZXh0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudCA9IGN1cnJlbnQubmFtZV9uZXh0O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxvb2t1cE5vZGU6IGZ1bmN0aW9uKHBhcmVudCwgbmFtZSkge1xuICAgICAgICAgICAgICAgIHZhciBlcnIgPSBGUy5tYXlMb29rdXAocGFyZW50KTtcbiAgICAgICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKGVyciwgbmFtZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBoYXNoID0gRlMuaGFzaE5hbWUocGFyZW50LmlkLCBuYW1lKTtcbiAgICAgICAgICAgICAgICBmb3IgKFxuICAgICAgICAgICAgICAgICAgICB2YXIgbm9kZSA9IEZTLm5hbWVUYWJsZVtoYXNoXTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZSA9IG5vZGUubmFtZV9uZXh0XG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBub2RlTmFtZSA9IG5vZGUubmFtZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG5vZGUucGFyZW50LmlkID09PSBwYXJlbnQuaWQgJiYgbm9kZU5hbWUgPT09IG5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBub2RlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGlmIHdlIGZhaWxlZCB0byBmaW5kIGl0IGluIHRoZSBjYWNoZSwgY2FsbCBpbnRvIHRoZSBWRlNcbiAgICAgICAgICAgICAgICByZXR1cm4gRlMubG9va3VwKHBhcmVudCwgbmFtZSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY3JlYXRlTm9kZTogZnVuY3Rpb24ocGFyZW50LCBuYW1lLCBtb2RlLCByZGV2KSB7XG4gICAgICAgICAgICAgICAgdmFyIG5vZGUgPSB7XG4gICAgICAgICAgICAgICAgICAgIGlkOiBGUy5uZXh0SW5vZGUrKyxcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogbmFtZSxcbiAgICAgICAgICAgICAgICAgICAgbW9kZTogbW9kZSxcbiAgICAgICAgICAgICAgICAgICAgbm9kZV9vcHM6IHt9LFxuICAgICAgICAgICAgICAgICAgICBzdHJlYW1fb3BzOiB7fSxcbiAgICAgICAgICAgICAgICAgICAgcmRldjogcmRldixcbiAgICAgICAgICAgICAgICAgICAgcGFyZW50OiBudWxsLFxuICAgICAgICAgICAgICAgICAgICBtb3VudDogbnVsbFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgaWYgKCFwYXJlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyZW50ID0gbm9kZTsgLy8gcm9vdCBub2RlIHNldHMgcGFyZW50IHRvIGl0c2VsZlxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBub2RlLnBhcmVudCA9IHBhcmVudDtcbiAgICAgICAgICAgICAgICBub2RlLm1vdW50ID0gcGFyZW50Lm1vdW50O1xuICAgICAgICAgICAgICAgIC8vIGNvbXBhdGliaWxpdHlcbiAgICAgICAgICAgICAgICB2YXIgcmVhZE1vZGUgPSAyOTIgfCA3MztcbiAgICAgICAgICAgICAgICB2YXIgd3JpdGVNb2RlID0gMTQ2O1xuICAgICAgICAgICAgICAgIC8vIE5PVEUgd2UgbXVzdCB1c2UgT2JqZWN0LmRlZmluZVByb3BlcnRpZXMgaW5zdGVhZCBvZiBpbmRpdmlkdWFsIGNhbGxzIHRvXG4gICAgICAgICAgICAgICAgLy8gT2JqZWN0LmRlZmluZVByb3BlcnR5IGluIG9yZGVyIHRvIG1ha2UgY2xvc3VyZSBjb21waWxlciBoYXBweVxuICAgICAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0aWVzKG5vZGUsIHtcbiAgICAgICAgICAgICAgICAgICAgcmVhZDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgZ2V0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKG5vZGUubW9kZSAmIHJlYWRNb2RlKSA9PT0gcmVhZE1vZGU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0OiBmdW5jdGlvbih2YWwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAobm9kZS5tb2RlIHw9IHJlYWRNb2RlKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChub2RlLm1vZGUgJj0gfnJlYWRNb2RlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgd3JpdGU6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGdldDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChub2RlLm1vZGUgJiB3cml0ZU1vZGUpID09PSB3cml0ZU1vZGU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0OiBmdW5jdGlvbih2YWwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAobm9kZS5tb2RlIHw9IHdyaXRlTW9kZSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAobm9kZS5tb2RlICY9IH53cml0ZU1vZGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBpc0ZvbGRlcjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgZ2V0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gRlMuaXNEaXIobm9kZS5tb2RlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgaXNEZXZpY2U6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGdldDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEZTLmlzQ2hyZGV2KG5vZGUubW9kZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBGUy5oYXNoQWRkTm9kZShub2RlKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBkZXN0cm95Tm9kZTogZnVuY3Rpb24obm9kZSkge1xuICAgICAgICAgICAgICAgIEZTLmhhc2hSZW1vdmVOb2RlKG5vZGUpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGlzUm9vdDogZnVuY3Rpb24obm9kZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBub2RlID09PSBub2RlLnBhcmVudDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBpc01vdW50cG9pbnQ6IGZ1bmN0aW9uKG5vZGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZS5tb3VudGVkO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGlzRmlsZTogZnVuY3Rpb24obW9kZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAobW9kZSAmIDYxNDQwKSA9PT0gMzI3Njg7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaXNEaXI6IGZ1bmN0aW9uKG1vZGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKG1vZGUgJiA2MTQ0MCkgPT09IDE2Mzg0O1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGlzTGluazogZnVuY3Rpb24obW9kZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAobW9kZSAmIDYxNDQwKSA9PT0gNDA5NjA7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaXNDaHJkZXY6IGZ1bmN0aW9uKG1vZGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKG1vZGUgJiA2MTQ0MCkgPT09IDgxOTI7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaXNCbGtkZXY6IGZ1bmN0aW9uKG1vZGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKG1vZGUgJiA2MTQ0MCkgPT09IDI0NTc2O1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGlzRklGTzogZnVuY3Rpb24obW9kZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAobW9kZSAmIDYxNDQwKSA9PT0gNDA5NjtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBpc1NvY2tldDogZnVuY3Rpb24obW9kZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAobW9kZSAmIDQ5MTUyKSA9PT0gNDkxNTI7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZmxhZ01vZGVzOiB7XG4gICAgICAgICAgICAgICAgcjogMCxcbiAgICAgICAgICAgICAgICByczogMTA1MjY3MixcbiAgICAgICAgICAgICAgICAncisnOiAyLFxuICAgICAgICAgICAgICAgIHc6IDU3NyxcbiAgICAgICAgICAgICAgICB3eDogNzA1LFxuICAgICAgICAgICAgICAgIHh3OiA3MDUsXG4gICAgICAgICAgICAgICAgJ3crJzogNTc4LFxuICAgICAgICAgICAgICAgICd3eCsnOiA3MDYsXG4gICAgICAgICAgICAgICAgJ3h3Kyc6IDcwNixcbiAgICAgICAgICAgICAgICBhOiAxMDg5LFxuICAgICAgICAgICAgICAgIGF4OiAxMjE3LFxuICAgICAgICAgICAgICAgIHhhOiAxMjE3LFxuICAgICAgICAgICAgICAgICdhKyc6IDEwOTAsXG4gICAgICAgICAgICAgICAgJ2F4Kyc6IDEyMTgsXG4gICAgICAgICAgICAgICAgJ3hhKyc6IDEyMThcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBtb2RlU3RyaW5nVG9GbGFnczogZnVuY3Rpb24oc3RyKSB7XG4gICAgICAgICAgICAgICAgdmFyIGZsYWdzID0gRlMuZmxhZ01vZGVzW3N0cl07XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBmbGFncyA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdVbmtub3duIGZpbGUgb3BlbiBtb2RlOiAnICsgc3RyKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZsYWdzO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGZsYWdzVG9QZXJtaXNzaW9uU3RyaW5nOiBmdW5jdGlvbihmbGFnKSB7XG4gICAgICAgICAgICAgICAgdmFyIGFjY21vZGUgPSBmbGFnICYgMjA5NzE1NTtcbiAgICAgICAgICAgICAgICB2YXIgcGVybXMgPSBbJ3InLCAndycsICdydyddW2FjY21vZGVdO1xuICAgICAgICAgICAgICAgIGlmIChmbGFnICYgNTEyKSB7XG4gICAgICAgICAgICAgICAgICAgIHBlcm1zICs9ICd3JztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBlcm1zO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG5vZGVQZXJtaXNzaW9uczogZnVuY3Rpb24obm9kZSwgcGVybXMpIHtcbiAgICAgICAgICAgICAgICBpZiAoRlMuaWdub3JlUGVybWlzc2lvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIHJldHVybiAwIGlmIGFueSB1c2VyLCBncm91cCBvciBvd25lciBiaXRzIGFyZSBzZXQuXG4gICAgICAgICAgICAgICAgaWYgKHBlcm1zLmluZGV4T2YoJ3InKSAhPT0gLTEgJiYgIShub2RlLm1vZGUgJiAyOTIpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBFUlJOT19DT0RFUy5FQUNDRVM7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwZXJtcy5pbmRleE9mKCd3JykgIT09IC0xICYmICEobm9kZS5tb2RlICYgMTQ2KSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gRVJSTk9fQ09ERVMuRUFDQ0VTO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocGVybXMuaW5kZXhPZigneCcpICE9PSAtMSAmJiAhKG5vZGUubW9kZSAmIDczKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gRVJSTk9fQ09ERVMuRUFDQ0VTO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBtYXlMb29rdXA6IGZ1bmN0aW9uKGRpcikge1xuICAgICAgICAgICAgICAgIHJldHVybiBGUy5ub2RlUGVybWlzc2lvbnMoZGlyLCAneCcpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG1heUNyZWF0ZTogZnVuY3Rpb24oZGlyLCBuYW1lKSB7XG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgRlMubG9va3VwTm9kZShkaXIsIG5hbWUpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gRVJSTk9fQ09ERVMuRUVYSVNUO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XG4gICAgICAgICAgICAgICAgcmV0dXJuIEZTLm5vZGVQZXJtaXNzaW9ucyhkaXIsICd3eCcpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG1heURlbGV0ZTogZnVuY3Rpb24oZGlyLCBuYW1lLCBpc2Rpcikge1xuICAgICAgICAgICAgICAgIHZhciBub2RlO1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUgPSBGUy5sb29rdXBOb2RlKGRpciwgbmFtZSk7XG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZS5lcnJubztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIGVyciA9IEZTLm5vZGVQZXJtaXNzaW9ucyhkaXIsICd3eCcpO1xuICAgICAgICAgICAgICAgIGlmIChlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVycjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzZGlyKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghRlMuaXNEaXIobm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk5PX0NPREVTLkVOT1RESVI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKEZTLmlzUm9vdChub2RlKSB8fCBGUy5nZXRQYXRoKG5vZGUpID09PSBGUy5jd2QoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk5PX0NPREVTLkVCVVNZO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKEZTLmlzRGlyKG5vZGUubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBFUlJOT19DT0RFUy5FSVNESVI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbWF5T3BlbjogZnVuY3Rpb24obm9kZSwgZmxhZ3MpIHtcbiAgICAgICAgICAgICAgICBpZiAoIW5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk5PX0NPREVTLkVOT0VOVDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKEZTLmlzTGluayhub2RlLm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBFUlJOT19DT0RFUy5FTE9PUDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKEZTLmlzRGlyKG5vZGUubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgKGZsYWdzICYgMjA5NzE1NSkgIT09IDAgfHwgLy8gb3BlbmluZyBmb3Igd3JpdGVcbiAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdzICYgNTEyXG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk5PX0NPREVTLkVJU0RJUjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gRlMubm9kZVBlcm1pc3Npb25zKFxuICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICBGUy5mbGFnc1RvUGVybWlzc2lvblN0cmluZyhmbGFncylcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIE1BWF9PUEVOX0ZEUzogNDA5NixcbiAgICAgICAgICAgIG5leHRmZDogZnVuY3Rpb24oZmRfc3RhcnQsIGZkX2VuZCkge1xuICAgICAgICAgICAgICAgIGZkX3N0YXJ0ID0gZmRfc3RhcnQgfHwgMTtcbiAgICAgICAgICAgICAgICBmZF9lbmQgPSBmZF9lbmQgfHwgRlMuTUFYX09QRU5fRkRTO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGZkID0gZmRfc3RhcnQ7IGZkIDw9IGZkX2VuZDsgZmQrKykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIUZTLnN0cmVhbXNbZmRdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRU1GSUxFKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBnZXRTdHJlYW06IGZ1bmN0aW9uKGZkKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEZTLnN0cmVhbXNbZmRdO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNyZWF0ZVN0cmVhbTogZnVuY3Rpb24oc3RyZWFtLCBmZF9zdGFydCwgZmRfZW5kKSB7XG4gICAgICAgICAgICAgICAgdmFyIGZkID0gRlMubmV4dGZkKGZkX3N0YXJ0LCBmZF9lbmQpO1xuICAgICAgICAgICAgICAgIHN0cmVhbS5mZCA9IGZkO1xuICAgICAgICAgICAgICAgIC8vIGNvbXBhdGliaWxpdHlcbiAgICAgICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydGllcyhzdHJlYW0sIHtcbiAgICAgICAgICAgICAgICAgICAgb2JqZWN0OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBnZXQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdHJlYW0ubm9kZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXQ6IGZ1bmN0aW9uKHZhbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbS5ub2RlID0gdmFsO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBpc1JlYWQ6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGdldDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChzdHJlYW0uZmxhZ3MgJiAyMDk3MTU1KSAhPT0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgaXNXcml0ZToge1xuICAgICAgICAgICAgICAgICAgICAgICAgZ2V0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKHN0cmVhbS5mbGFncyAmIDIwOTcxNTUpICE9PSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBpc0FwcGVuZDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgZ2V0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3RyZWFtLmZsYWdzICYgMTAyNDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIEZTLnN0cmVhbXNbZmRdID0gc3RyZWFtO1xuICAgICAgICAgICAgICAgIHJldHVybiBzdHJlYW07XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY2xvc2VTdHJlYW06IGZ1bmN0aW9uKGZkKSB7XG4gICAgICAgICAgICAgICAgRlMuc3RyZWFtc1tmZF0gPSBudWxsO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNocmRldl9zdHJlYW1fb3BzOiB7XG4gICAgICAgICAgICAgICAgb3BlbjogZnVuY3Rpb24oc3RyZWFtKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBkZXZpY2UgPSBGUy5nZXREZXZpY2Uoc3RyZWFtLm5vZGUucmRldik7XG4gICAgICAgICAgICAgICAgICAgIC8vIG92ZXJyaWRlIG5vZGUncyBzdHJlYW0gb3BzIHdpdGggdGhlIGRldmljZSdzXG4gICAgICAgICAgICAgICAgICAgIHN0cmVhbS5zdHJlYW1fb3BzID0gZGV2aWNlLnN0cmVhbV9vcHM7XG4gICAgICAgICAgICAgICAgICAgIC8vIGZvcndhcmQgdGhlIG9wZW4gY2FsbFxuICAgICAgICAgICAgICAgICAgICBpZiAoc3RyZWFtLnN0cmVhbV9vcHMub3Blbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtLnN0cmVhbV9vcHMub3BlbihzdHJlYW0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBsbHNlZWs6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FU1BJUEUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBtYWpvcjogZnVuY3Rpb24oZGV2KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGRldiA+PiA4O1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG1pbm9yOiBmdW5jdGlvbihkZXYpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZGV2ICYgMHhmZjtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBtYWtlZGV2OiBmdW5jdGlvbihtYSwgbWkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKG1hIDw8IDgpIHwgbWk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcmVnaXN0ZXJEZXZpY2U6IGZ1bmN0aW9uKGRldiwgb3BzKSB7XG4gICAgICAgICAgICAgICAgRlMuZGV2aWNlc1tkZXZdID0geyBzdHJlYW1fb3BzOiBvcHMgfTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBnZXREZXZpY2U6IGZ1bmN0aW9uKGRldikge1xuICAgICAgICAgICAgICAgIHJldHVybiBGUy5kZXZpY2VzW2Rldl07XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc3luY2ZzOiBmdW5jdGlvbihwb3B1bGF0ZSwgY2FsbGJhY2spIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHBvcHVsYXRlID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrID0gcG9wdWxhdGU7XG4gICAgICAgICAgICAgICAgICAgIHBvcHVsYXRlID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBjb21wbGV0ZWQgPSAwO1xuICAgICAgICAgICAgICAgIHZhciB0b3RhbCA9IEZTLm1vdW50cy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgdmFyIGRvbmUgPSBmdW5jdGlvbihlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGVycik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCsrY29tcGxldGVkID49IHRvdGFsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayhudWxsKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgLy8gc3luYyBhbGwgbW91bnRzXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBGUy5tb3VudHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG1vdW50ID0gRlMubW91bnRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIW1vdW50LnR5cGUuc3luY2ZzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkb25lKG51bGwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbW91bnQudHlwZS5zeW5jZnMobW91bnQsIHBvcHVsYXRlLCBkb25lKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbW91bnQ6IGZ1bmN0aW9uKHR5cGUsIG9wdHMsIG1vdW50cG9pbnQpIHtcbiAgICAgICAgICAgICAgICB2YXIgbG9va3VwO1xuICAgICAgICAgICAgICAgIGlmIChtb3VudHBvaW50KSB7XG4gICAgICAgICAgICAgICAgICAgIGxvb2t1cCA9IEZTLmxvb2t1cFBhdGgobW91bnRwb2ludCwgeyBmb2xsb3c6IGZhbHNlIH0pO1xuICAgICAgICAgICAgICAgICAgICBtb3VudHBvaW50ID0gbG9va3VwLnBhdGg7IC8vIHVzZSB0aGUgYWJzb2x1dGUgcGF0aFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgbW91bnQgPSB7XG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IHR5cGUsXG4gICAgICAgICAgICAgICAgICAgIG9wdHM6IG9wdHMsXG4gICAgICAgICAgICAgICAgICAgIG1vdW50cG9pbnQ6IG1vdW50cG9pbnQsXG4gICAgICAgICAgICAgICAgICAgIHJvb3Q6IG51bGxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIC8vIGNyZWF0ZSBhIHJvb3Qgbm9kZSBmb3IgdGhlIGZzXG4gICAgICAgICAgICAgICAgdmFyIHJvb3QgPSB0eXBlLm1vdW50KG1vdW50KTtcbiAgICAgICAgICAgICAgICByb290Lm1vdW50ID0gbW91bnQ7XG4gICAgICAgICAgICAgICAgbW91bnQucm9vdCA9IHJvb3Q7XG4gICAgICAgICAgICAgICAgLy8gYXNzaWduIHRoZSBtb3VudCBpbmZvIHRvIHRoZSBtb3VudHBvaW50J3Mgbm9kZVxuICAgICAgICAgICAgICAgIGlmIChsb29rdXApIHtcbiAgICAgICAgICAgICAgICAgICAgbG9va3VwLm5vZGUubW91bnQgPSBtb3VudDtcbiAgICAgICAgICAgICAgICAgICAgbG9va3VwLm5vZGUubW91bnRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbXBhdGliaWxpdHkgdXBkYXRlIEZTLnJvb3QgaWYgd2UgbW91bnQgdG8gL1xuICAgICAgICAgICAgICAgICAgICBpZiAobW91bnRwb2ludCA9PT0gJy8nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBGUy5yb290ID0gbW91bnQucm9vdDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBhZGQgdG8gb3VyIGNhY2hlZCBsaXN0IG9mIG1vdW50c1xuICAgICAgICAgICAgICAgIEZTLm1vdW50cy5wdXNoKG1vdW50KTtcbiAgICAgICAgICAgICAgICByZXR1cm4gcm9vdDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsb29rdXA6IGZ1bmN0aW9uKHBhcmVudCwgbmFtZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBwYXJlbnQubm9kZV9vcHMubG9va3VwKHBhcmVudCwgbmFtZSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbWtub2Q6IGZ1bmN0aW9uKHBhdGgsIG1vZGUsIGRldiwgdGhyb3dFcnJvciA9IHRydWUpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBsb29rdXAgPSBGUy5sb29rdXBQYXRoKHBhdGgsIHsgcGFyZW50OiB0cnVlIH0pO1xuICAgICAgICAgICAgICAgIGNvbnN0IHBhcmVudCA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgIGNvbnN0IG5hbWUgPSBQQVRILmJhc2VuYW1lKHBhdGgpO1xuICAgICAgICAgICAgICAgIGNvbnN0IGVycm9yID0gRlMubWF5Q3JlYXRlKHBhcmVudCwgbmFtZSk7XG4gICAgICAgICAgICAgICAgaWYgKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aHJvd0Vycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihlcnJvciwgcGF0aCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIXBhcmVudC5ub2RlX29wcy5ta25vZCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhyb3dFcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRVBFUk0sIHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcmVudC5ub2RlX29wcy5ta25vZChwYXJlbnQsIG5hbWUsIG1vZGUsIGRldik7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY3JlYXRlOiBmdW5jdGlvbihwYXRoLCBtb2RlLCB0aHJvd0Vycm9yID0gdHJ1ZSkge1xuICAgICAgICAgICAgICAgIG1vZGUgPSBtb2RlICE9PSB1bmRlZmluZWQgPyBtb2RlIDogMG82NjY7XG4gICAgICAgICAgICAgICAgbW9kZSAmPSA0MDk1O1xuICAgICAgICAgICAgICAgIG1vZGUgfD0gMzI3Njg7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEZTLm1rbm9kKHBhdGgsIG1vZGUsIDAsIHRocm93RXJyb3IpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG1rZGlyOiBmdW5jdGlvbihwYXRoLCBtb2RlLCB0aHJvd0Vycm9yID0gdHJ1ZSkge1xuICAgICAgICAgICAgICAgIG1vZGUgPSBtb2RlICE9PSB1bmRlZmluZWQgPyBtb2RlIDogMG83Nzc7XG4gICAgICAgICAgICAgICAgbW9kZSAmPSA1MTEgfCA1MTI7XG4gICAgICAgICAgICAgICAgbW9kZSB8PSAxNjM4NDtcbiAgICAgICAgICAgICAgICByZXR1cm4gRlMubWtub2QocGF0aCwgbW9kZSwgMCwgdGhyb3dFcnJvcik7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbWtkZXY6IGZ1bmN0aW9uKHBhdGgsIG1vZGUsIGRldikge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZGV2ID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICBkZXYgPSBtb2RlO1xuICAgICAgICAgICAgICAgICAgICBtb2RlID0gMG82NjY7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG1vZGUgfD0gODE5MjtcbiAgICAgICAgICAgICAgICByZXR1cm4gRlMubWtub2QocGF0aCwgbW9kZSwgZGV2KTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzeW1saW5rOiBmdW5jdGlvbihvbGRwYXRoLCBuZXdwYXRoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGxvb2t1cCA9IEZTLmxvb2t1cFBhdGgobmV3cGF0aCwgeyBwYXJlbnQ6IHRydWUgfSk7XG4gICAgICAgICAgICAgICAgdmFyIHBhcmVudCA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgIHZhciBuZXduYW1lID0gUEFUSC5iYXNlbmFtZShuZXdwYXRoKTtcbiAgICAgICAgICAgICAgICB2YXIgZXJyID0gRlMubWF5Q3JlYXRlKHBhcmVudCwgbmV3bmFtZSk7XG4gICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihlcnIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIXBhcmVudC5ub2RlX29wcy5zeW1saW5rKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVQRVJNKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcmVudC5ub2RlX29wcy5zeW1saW5rKHBhcmVudCwgbmV3bmFtZSwgb2xkcGF0aCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcmVuYW1lOiBmdW5jdGlvbihvbGRfcGF0aCwgbmV3X3BhdGgpIHtcbiAgICAgICAgICAgICAgICB2YXIgb2xkX2Rpcm5hbWUgPSBQQVRILmRpcm5hbWUob2xkX3BhdGgpO1xuICAgICAgICAgICAgICAgIHZhciBuZXdfZGlybmFtZSA9IFBBVEguZGlybmFtZShuZXdfcGF0aCk7XG4gICAgICAgICAgICAgICAgdmFyIG9sZF9uYW1lID0gUEFUSC5iYXNlbmFtZShvbGRfcGF0aCk7XG4gICAgICAgICAgICAgICAgdmFyIG5ld19uYW1lID0gUEFUSC5iYXNlbmFtZShuZXdfcGF0aCk7XG4gICAgICAgICAgICAgICAgLy8gcGFyZW50cyBtdXN0IGV4aXN0XG4gICAgICAgICAgICAgICAgdmFyIGxvb2t1cCwgb2xkX2RpciwgbmV3X2RpcjtcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBsb29rdXAgPSBGUy5sb29rdXBQYXRoKG9sZF9wYXRoLCB7IHBhcmVudDogdHJ1ZSB9KTtcbiAgICAgICAgICAgICAgICAgICAgb2xkX2RpciA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgICAgICBsb29rdXAgPSBGUy5sb29rdXBQYXRoKG5ld19wYXRoLCB7IHBhcmVudDogdHJ1ZSB9KTtcbiAgICAgICAgICAgICAgICAgICAgbmV3X2RpciA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUJVU1kpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBuZWVkIHRvIGJlIHBhcnQgb2YgdGhlIHNhbWUgbW91bnRcbiAgICAgICAgICAgICAgICBpZiAob2xkX2Rpci5tb3VudCAhPT0gbmV3X2Rpci5tb3VudCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FWERFVik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIHNvdXJjZSBtdXN0IGV4aXN0XG4gICAgICAgICAgICAgICAgdmFyIG9sZF9ub2RlID0gRlMubG9va3VwTm9kZShvbGRfZGlyLCBvbGRfbmFtZSk7XG4gICAgICAgICAgICAgICAgLy8gb2xkIHBhdGggc2hvdWxkIG5vdCBiZSBhbiBhbmNlc3RvciBvZiB0aGUgbmV3IHBhdGhcbiAgICAgICAgICAgICAgICB2YXIgcmVsYXRpdmUgPSBQQVRILnJlbGF0aXZlKG9sZF9wYXRoLCBuZXdfZGlybmFtZSk7XG4gICAgICAgICAgICAgICAgaWYgKHJlbGF0aXZlLmNoYXJBdCgwKSAhPT0gJy4nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlZBTCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIG5ldyBwYXRoIHNob3VsZCBub3QgYmUgYW4gYW5jZXN0b3Igb2YgdGhlIG9sZCBwYXRoXG4gICAgICAgICAgICAgICAgcmVsYXRpdmUgPSBQQVRILnJlbGF0aXZlKG5ld19wYXRoLCBvbGRfZGlybmFtZSk7XG4gICAgICAgICAgICAgICAgaWYgKHJlbGF0aXZlLmNoYXJBdCgwKSAhPT0gJy4nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOT1RFTVBUWSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIHNlZSBpZiB0aGUgbmV3IHBhdGggYWxyZWFkeSBleGlzdHNcbiAgICAgICAgICAgICAgICB2YXIgbmV3X25vZGU7XG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgbmV3X25vZGUgPSBGUy5sb29rdXBOb2RlKG5ld19kaXIsIG5ld19uYW1lKTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIG5vdCBmYXRhbFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBlYXJseSBvdXQgaWYgbm90aGluZyBuZWVkcyB0byBjaGFuZ2VcbiAgICAgICAgICAgICAgICBpZiAob2xkX25vZGUgPT09IG5ld19ub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gd2UnbGwgbmVlZCB0byBkZWxldGUgdGhlIG9sZCBlbnRyeVxuICAgICAgICAgICAgICAgIHZhciBpc2RpciA9IEZTLmlzRGlyKG9sZF9ub2RlLm1vZGUpO1xuICAgICAgICAgICAgICAgIHZhciBlcnIgPSBGUy5tYXlEZWxldGUob2xkX2Rpciwgb2xkX25hbWUsIGlzZGlyKTtcbiAgICAgICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKGVycik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIG5lZWQgZGVsZXRlIHBlcm1pc3Npb25zIGlmIHdlJ2xsIGJlIG92ZXJ3cml0aW5nLlxuICAgICAgICAgICAgICAgIC8vIG5lZWQgY3JlYXRlIHBlcm1pc3Npb25zIGlmIG5ldyBkb2Vzbid0IGFscmVhZHkgZXhpc3QuXG4gICAgICAgICAgICAgICAgZXJyID0gbmV3X25vZGVcbiAgICAgICAgICAgICAgICAgICAgPyBGUy5tYXlEZWxldGUobmV3X2RpciwgbmV3X25hbWUsIGlzZGlyKVxuICAgICAgICAgICAgICAgICAgICA6IEZTLm1heUNyZWF0ZShuZXdfZGlyLCBuZXdfbmFtZSk7XG4gICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihlcnIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIW9sZF9kaXIubm9kZV9vcHMucmVuYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVQRVJNKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICBGUy5pc01vdW50cG9pbnQob2xkX25vZGUpIHx8XG4gICAgICAgICAgICAgICAgICAgIChuZXdfbm9kZSAmJiBGUy5pc01vdW50cG9pbnQobmV3X25vZGUpKVxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FQlVTWSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGlmIHdlIGFyZSBnb2luZyB0byBjaGFuZ2UgdGhlIHBhcmVudCwgY2hlY2sgd3JpdGUgcGVybWlzc2lvbnNcbiAgICAgICAgICAgICAgICBpZiAobmV3X2RpciAhPT0gb2xkX2Rpcikge1xuICAgICAgICAgICAgICAgICAgICBlcnIgPSBGUy5ub2RlUGVybWlzc2lvbnMob2xkX2RpciwgJ3cnKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoZXJyKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyByZW1vdmUgdGhlIG5vZGUgZnJvbSB0aGUgbG9va3VwIGhhc2hcbiAgICAgICAgICAgICAgICBGUy5oYXNoUmVtb3ZlTm9kZShvbGRfbm9kZSk7XG4gICAgICAgICAgICAgICAgLy8gZG8gdGhlIHVuZGVybHlpbmcgZnMgcmVuYW1lXG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgb2xkX2Rpci5ub2RlX29wcy5yZW5hbWUob2xkX25vZGUsIG5ld19kaXIsIG5ld19uYW1lKTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IGU7XG4gICAgICAgICAgICAgICAgfSBmaW5hbGx5IHtcbiAgICAgICAgICAgICAgICAgICAgLy8gYWRkIHRoZSBub2RlIGJhY2sgdG8gdGhlIGhhc2ggKGluIGNhc2Ugbm9kZV9vcHMucmVuYW1lXG4gICAgICAgICAgICAgICAgICAgIC8vIGNoYW5nZWQgaXRzIG5hbWUpXG4gICAgICAgICAgICAgICAgICAgIEZTLmhhc2hBZGROb2RlKG9sZF9ub2RlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcm1kaXI6IGZ1bmN0aW9uKHBhdGgpIHtcbiAgICAgICAgICAgICAgICB2YXIgbG9va3VwID0gRlMubG9va3VwUGF0aChwYXRoLCB7IHBhcmVudDogdHJ1ZSB9KTtcbiAgICAgICAgICAgICAgICB2YXIgcGFyZW50ID0gbG9va3VwLm5vZGU7XG4gICAgICAgICAgICAgICAgdmFyIG5hbWUgPSBQQVRILmJhc2VuYW1lKHBhdGgpO1xuICAgICAgICAgICAgICAgIHZhciBub2RlID0gRlMubG9va3VwTm9kZShwYXJlbnQsIG5hbWUpO1xuICAgICAgICAgICAgICAgIHZhciBlcnIgPSBGUy5tYXlEZWxldGUocGFyZW50LCBuYW1lLCB0cnVlKTtcbiAgICAgICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKGVycik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghcGFyZW50Lm5vZGVfb3BzLnJtZGlyKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVQRVJNKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKEZTLmlzTW91bnRwb2ludChub2RlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FQlVTWSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHBhcmVudC5ub2RlX29wcy5ybWRpcihwYXJlbnQsIG5hbWUpO1xuICAgICAgICAgICAgICAgIEZTLmRlc3Ryb3lOb2RlKG5vZGUpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHJlYWRkaXI6IGZ1bmN0aW9uKHBhdGgpIHtcbiAgICAgICAgICAgICAgICB2YXIgbG9va3VwID0gRlMubG9va3VwUGF0aChwYXRoLCB7IGZvbGxvdzogdHJ1ZSB9KTtcbiAgICAgICAgICAgICAgICB2YXIgbm9kZSA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgIGlmICghbm9kZS5ub2RlX29wcy5yZWFkZGlyKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOT1RESVIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZS5ub2RlX29wcy5yZWFkZGlyKG5vZGUpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHVubGluazogZnVuY3Rpb24ocGF0aCkge1xuICAgICAgICAgICAgICAgIHZhciBsb29rdXAgPSBGUy5sb29rdXBQYXRoKHBhdGgsIHsgcGFyZW50OiB0cnVlIH0pO1xuICAgICAgICAgICAgICAgIHZhciBwYXJlbnQgPSBsb29rdXAubm9kZTtcbiAgICAgICAgICAgICAgICB2YXIgbmFtZSA9IFBBVEguYmFzZW5hbWUocGF0aCk7XG4gICAgICAgICAgICAgICAgdmFyIG5vZGUgPSBGUy5sb29rdXBOb2RlKHBhcmVudCwgbmFtZSk7XG4gICAgICAgICAgICAgICAgdmFyIGVyciA9IEZTLm1heURlbGV0ZShwYXJlbnQsIG5hbWUsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIFBPU0lYIHNheXMgdW5saW5rIHNob3VsZCBzZXQgRVBFUk0sIG5vdCBFSVNESVJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVyciA9PT0gRVJSTk9fQ09ERVMuRUlTRElSKSBlcnIgPSBFUlJOT19DT0RFUy5FUEVSTTtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoZXJyKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFwYXJlbnQubm9kZV9vcHMudW5saW5rKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVQRVJNKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKEZTLmlzTW91bnRwb2ludChub2RlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FQlVTWSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHBhcmVudC5ub2RlX29wcy51bmxpbmsocGFyZW50LCBuYW1lKTtcbiAgICAgICAgICAgICAgICBGUy5kZXN0cm95Tm9kZShub2RlKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICByZWFkbGluazogZnVuY3Rpb24ocGF0aCkge1xuICAgICAgICAgICAgICAgIHZhciBsb29rdXAgPSBGUy5sb29rdXBQYXRoKHBhdGgsIHsgZm9sbG93OiBmYWxzZSB9KTtcbiAgICAgICAgICAgICAgICB2YXIgbGluayA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgIGlmICghbGluay5ub2RlX29wcy5yZWFkbGluaykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSU5WQUwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gbGluay5ub2RlX29wcy5yZWFkbGluayhsaW5rKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzdGF0OiBmdW5jdGlvbihwYXRoLCBkb250Rm9sbG93KSB7XG4gICAgICAgICAgICAgICAgdmFyIGxvb2t1cCA9IEZTLmxvb2t1cFBhdGgocGF0aCwgeyBmb2xsb3c6ICFkb250Rm9sbG93IH0pO1xuICAgICAgICAgICAgICAgIHZhciBub2RlID0gbG9va3VwLm5vZGU7XG4gICAgICAgICAgICAgICAgaWYgKCFub2RlLm5vZGVfb3BzLmdldGF0dHIpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRVBFUk0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZS5ub2RlX29wcy5nZXRhdHRyKG5vZGUpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxzdGF0OiBmdW5jdGlvbihwYXRoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEZTLnN0YXQocGF0aCwgdHJ1ZSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY2htb2Q6IGZ1bmN0aW9uKHBhdGgsIG1vZGUsIGRvbnRGb2xsb3cpIHtcbiAgICAgICAgICAgICAgICB2YXIgbm9kZTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHBhdGggPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBsb29rdXAgPSBGUy5sb29rdXBQYXRoKHBhdGgsIHsgZm9sbG93OiAhZG9udEZvbGxvdyB9KTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZSA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUgPSBwYXRoO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIW5vZGUubm9kZV9vcHMuc2V0YXR0cikge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FUEVSTSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5vZGUubm9kZV9vcHMuc2V0YXR0cihub2RlLCB7XG4gICAgICAgICAgICAgICAgICAgIG1vZGU6IChtb2RlICYgNDA5NSkgfCAobm9kZS5tb2RlICYgfjQwOTUpLFxuICAgICAgICAgICAgICAgICAgICB0aW1lc3RhbXA6IERhdGUubm93KClcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsY2htb2Q6IGZ1bmN0aW9uKHBhdGgsIG1vZGUpIHtcbiAgICAgICAgICAgICAgICBGUy5jaG1vZChwYXRoLCBtb2RlLCB0cnVlKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBmY2htb2Q6IGZ1bmN0aW9uKGZkLCBtb2RlKSB7XG4gICAgICAgICAgICAgICAgdmFyIHN0cmVhbSA9IEZTLmdldFN0cmVhbShmZCk7XG4gICAgICAgICAgICAgICAgaWYgKCFzdHJlYW0pIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUJBREYpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBGUy5jaG1vZChzdHJlYW0ubm9kZSwgbW9kZSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY2hvd246IGZ1bmN0aW9uKHBhdGgsIHVpZCwgZ2lkLCBkb250Rm9sbG93KSB7XG4gICAgICAgICAgICAgICAgdmFyIG5vZGU7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwYXRoID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbG9va3VwID0gRlMubG9va3VwUGF0aChwYXRoLCB7IGZvbGxvdzogIWRvbnRGb2xsb3cgfSk7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUgPSBsb29rdXAubm9kZTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBub2RlID0gcGF0aDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFub2RlLm5vZGVfb3BzLnNldGF0dHIpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRVBFUk0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBub2RlLm5vZGVfb3BzLnNldGF0dHIobm9kZSwge1xuICAgICAgICAgICAgICAgICAgICB0aW1lc3RhbXA6IERhdGUubm93KClcbiAgICAgICAgICAgICAgICAgICAgLy8gd2UgaWdub3JlIHRoZSB1aWQgLyBnaWQgZm9yIG5vd1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxjaG93bjogZnVuY3Rpb24ocGF0aCwgdWlkLCBnaWQpIHtcbiAgICAgICAgICAgICAgICBGUy5jaG93bihwYXRoLCB1aWQsIGdpZCwgdHJ1ZSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZmNob3duOiBmdW5jdGlvbihmZCwgdWlkLCBnaWQpIHtcbiAgICAgICAgICAgICAgICB2YXIgc3RyZWFtID0gRlMuZ2V0U3RyZWFtKGZkKTtcbiAgICAgICAgICAgICAgICBpZiAoIXN0cmVhbSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FQkFERik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIEZTLmNob3duKHN0cmVhbS5ub2RlLCB1aWQsIGdpZCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgdHJ1bmNhdGU6IGZ1bmN0aW9uKHBhdGgsIGxlbikge1xuICAgICAgICAgICAgICAgIGlmIChsZW4gPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlZBTCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBub2RlO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcGF0aCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxvb2t1cCA9IEZTLmxvb2t1cFBhdGgocGF0aCwgeyBmb2xsb3c6IHRydWUgfSk7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUgPSBsb29rdXAubm9kZTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBub2RlID0gcGF0aDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFub2RlLm5vZGVfb3BzLnNldGF0dHIpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRVBFUk0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoRlMuaXNEaXIobm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSVNESVIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIUZTLmlzRmlsZShub2RlLm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlZBTCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBlcnIgPSBGUy5ub2RlUGVybWlzc2lvbnMobm9kZSwgJ3cnKTtcbiAgICAgICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKGVycik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5vZGUubm9kZV9vcHMuc2V0YXR0cihub2RlLCB7XG4gICAgICAgICAgICAgICAgICAgIHNpemU6IGxlbixcbiAgICAgICAgICAgICAgICAgICAgdGltZXN0YW1wOiBEYXRlLm5vdygpXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZnRydW5jYXRlOiBmdW5jdGlvbihmZCwgbGVuKSB7XG4gICAgICAgICAgICAgICAgdmFyIHN0cmVhbSA9IEZTLmdldFN0cmVhbShmZCk7XG4gICAgICAgICAgICAgICAgaWYgKCFzdHJlYW0pIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUJBREYpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKHN0cmVhbS5mbGFncyAmIDIwOTcxNTUpID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlZBTCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIEZTLnRydW5jYXRlKHN0cmVhbS5ub2RlLCBsZW4pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHV0aW1lOiBmdW5jdGlvbihwYXRoLCBhdGltZSwgbXRpbWUpIHtcbiAgICAgICAgICAgICAgICB2YXIgbG9va3VwID0gRlMubG9va3VwUGF0aChwYXRoLCB7IGZvbGxvdzogdHJ1ZSB9KTtcbiAgICAgICAgICAgICAgICB2YXIgbm9kZSA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgIG5vZGUubm9kZV9vcHMuc2V0YXR0cihub2RlLCB7XG4gICAgICAgICAgICAgICAgICAgIHRpbWVzdGFtcDogTWF0aC5tYXgoYXRpbWUsIG10aW1lKVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG9wZW46IGZ1bmN0aW9uKHBhdGgsIGZsYWdzLCBtb2RlLCBmZF9zdGFydCwgZmRfZW5kKSB7XG4gICAgICAgICAgICAgICAgcGF0aCA9IFBBVEgubm9ybWFsaXplKHBhdGgpO1xuICAgICAgICAgICAgICAgIGZsYWdzID1cbiAgICAgICAgICAgICAgICAgICAgdHlwZW9mIGZsYWdzID09PSAnc3RyaW5nJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBGUy5tb2RlU3RyaW5nVG9GbGFncyhmbGFncylcbiAgICAgICAgICAgICAgICAgICAgICAgIDogZmxhZ3M7XG4gICAgICAgICAgICAgICAgbW9kZSA9IHR5cGVvZiBtb2RlID09PSAndW5kZWZpbmVkJyA/IDBvNjY2IDogbW9kZTtcbiAgICAgICAgICAgICAgICBpZiAoZmxhZ3MgJiA2NCkge1xuICAgICAgICAgICAgICAgICAgICBtb2RlID0gKG1vZGUgJiA0MDk1KSB8IDMyNzY4O1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG1vZGUgPSAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgbm9kZTtcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbG9va3VwID0gRlMubG9va3VwUGF0aChwYXRoLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb2xsb3c6ICEoZmxhZ3MgJiAxMzEwNzIpXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBub2RlID0gbG9va3VwLm5vZGU7XG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBpZ25vcmVcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gcGVyaGFwcyB3ZSBuZWVkIHRvIGNyZWF0ZSB0aGUgbm9kZVxuICAgICAgICAgICAgICAgIGlmIChmbGFncyAmIDY0KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiBPX0NSRUFUIGFuZCBPX0VYQ0wgYXJlIHNldCwgZXJyb3Igb3V0IGlmIHRoZSBub2RlIGFscmVhZHkgZXhpc3RzXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmxhZ3MgJiAxMjgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FRVhJU1QpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm9kZSBkb2Vzbid0IGV4aXN0LCB0cnkgdG8gY3JlYXRlIGl0XG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlID0gRlMubWtub2QocGF0aCwgbW9kZSwgMCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOT0VOVCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGNhbid0IHRydW5jYXRlIGEgZGV2aWNlXG4gICAgICAgICAgICAgICAgaWYgKEZTLmlzQ2hyZGV2KG5vZGUubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgZmxhZ3MgJj0gfjUxMjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gY2hlY2sgcGVybWlzc2lvbnNcbiAgICAgICAgICAgICAgICB2YXIgZXJyID0gRlMubWF5T3Blbihub2RlLCBmbGFncyk7XG4gICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihlcnIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBkbyB0cnVuY2F0aW9uIGlmIG5lY2Vzc2FyeVxuICAgICAgICAgICAgICAgIGlmIChmbGFncyAmIDUxMikge1xuICAgICAgICAgICAgICAgICAgICBGUy50cnVuY2F0ZShub2RlLCAwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gd2UndmUgYWxyZWFkeSBoYW5kbGVkIHRoZXNlLCBkb24ndCBwYXNzIGRvd24gdG8gdGhlIHVuZGVybHlpbmcgdmZzXG4gICAgICAgICAgICAgICAgZmxhZ3MgJj0gfigxMjggfCA1MTIpO1xuICAgICAgICAgICAgICAgIC8vIHJlZ2lzdGVyIHRoZSBzdHJlYW0gd2l0aCB0aGUgZmlsZXN5c3RlbVxuICAgICAgICAgICAgICAgIHZhciBzdHJlYW0gPSBGUy5jcmVhdGVTdHJlYW0oXG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGU6IG5vZGUsXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiBGUy5nZXRQYXRoKG5vZGUpLCAvLyB3ZSB3YW50IHRoZSBhYnNvbHV0ZSBwYXRoIHRvIHRoZSBub2RlXG4gICAgICAgICAgICAgICAgICAgICAgICBmbGFnczogZmxhZ3MsXG4gICAgICAgICAgICAgICAgICAgICAgICBzZWVrYWJsZTogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtX29wczogbm9kZS5zdHJlYW1fb3BzLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gdXNlZCBieSB0aGUgZmlsZSBmYW1pbHkgbGliYyBjYWxscyAoZm9wZW4sIGZ3cml0ZSwgZmVycm9yLCBldGMuKVxuICAgICAgICAgICAgICAgICAgICAgICAgdW5nb3R0ZW46IFtdLFxuICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3I6IGZhbHNlXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIGZkX3N0YXJ0LFxuICAgICAgICAgICAgICAgICAgICBmZF9lbmRcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIC8vIGNhbGwgdGhlIG5ldyBzdHJlYW0ncyBvcGVuIGZ1bmN0aW9uXG4gICAgICAgICAgICAgICAgaWYgKHN0cmVhbS5zdHJlYW1fb3BzLm9wZW4pIHtcbiAgICAgICAgICAgICAgICAgICAgc3RyZWFtLnN0cmVhbV9vcHMub3BlbihzdHJlYW0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoTW9kdWxlWydsb2dSZWFkRmlsZXMnXSAmJiAhKGZsYWdzICYgMSkpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFGUy5yZWFkRmlsZXMpIEZTLnJlYWRGaWxlcyA9IHt9O1xuICAgICAgICAgICAgICAgICAgICBpZiAoIShwYXRoIGluIEZTLnJlYWRGaWxlcykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIEZTLnJlYWRGaWxlc1twYXRoXSA9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oJ3JlYWQgZmlsZTogJyArIHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBzdHJlYW07XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY2xvc2U6IGZ1bmN0aW9uKHN0cmVhbSkge1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzdHJlYW0uc3RyZWFtX29wcy5jbG9zZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtLnN0cmVhbV9vcHMuY2xvc2Uoc3RyZWFtKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgZTtcbiAgICAgICAgICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgICAgICAgICAgICBGUy5jbG9zZVN0cmVhbShzdHJlYW0uZmQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsbHNlZWs6IGZ1bmN0aW9uKHN0cmVhbSwgb2Zmc2V0LCB3aGVuY2UpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXN0cmVhbS5zZWVrYWJsZSB8fCAhc3RyZWFtLnN0cmVhbV9vcHMubGxzZWVrKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVTUElQRSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBzdHJlYW0uc3RyZWFtX29wcy5sbHNlZWsoc3RyZWFtLCBvZmZzZXQsIHdoZW5jZSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcmVhZDogZnVuY3Rpb24oc3RyZWFtLCBidWZmZXIsIG9mZnNldCwgbGVuZ3RoLCBwb3NpdGlvbikge1xuICAgICAgICAgICAgICAgIGlmIChsZW5ndGggPCAwIHx8IHBvc2l0aW9uIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSU5WQUwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKHN0cmVhbS5mbGFncyAmIDIwOTcxNTUpID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVCQURGKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKEZTLmlzRGlyKHN0cmVhbS5ub2RlLm1vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJU0RJUik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghc3RyZWFtLnN0cmVhbV9vcHMucmVhZCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSU5WQUwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgc2Vla2luZyA9IHRydWU7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwb3NpdGlvbiA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzdHJlYW0ucG9zaXRpb247XG4gICAgICAgICAgICAgICAgICAgIHNlZWtpbmcgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFzdHJlYW0uc2Vla2FibGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRVNQSVBFKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIGJ5dGVzUmVhZCA9IHN0cmVhbS5zdHJlYW1fb3BzLnJlYWQoXG4gICAgICAgICAgICAgICAgICAgIHN0cmVhbSxcbiAgICAgICAgICAgICAgICAgICAgYnVmZmVyLFxuICAgICAgICAgICAgICAgICAgICBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgIGxlbmd0aCxcbiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb25cbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIGlmICghc2Vla2luZykgc3RyZWFtLnBvc2l0aW9uICs9IGJ5dGVzUmVhZDtcbiAgICAgICAgICAgICAgICByZXR1cm4gYnl0ZXNSZWFkO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHdyaXRlOiBmdW5jdGlvbihzdHJlYW0sIGJ1ZmZlciwgb2Zmc2V0LCBsZW5ndGgsIHBvc2l0aW9uLCBjYW5Pd24pIHtcbiAgICAgICAgICAgICAgICBpZiAobGVuZ3RoIDwgMCB8fCBwb3NpdGlvbiA8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUlOVkFMKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKChzdHJlYW0uZmxhZ3MgJiAyMDk3MTU1KSA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FQkFERik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChGUy5pc0RpcihzdHJlYW0ubm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSVNESVIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIXN0cmVhbS5zdHJlYW1fb3BzLndyaXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlZBTCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBzZWVraW5nID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHBvc2l0aW9uID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHN0cmVhbS5wb3NpdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgc2Vla2luZyA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIXN0cmVhbS5zZWVrYWJsZSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FU1BJUEUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoc3RyZWFtLmZsYWdzICYgMTAyNCkge1xuICAgICAgICAgICAgICAgICAgICAvLyBzZWVrIHRvIHRoZSBlbmQgYmVmb3JlIHdyaXRpbmcgaW4gYXBwZW5kIG1vZGVcbiAgICAgICAgICAgICAgICAgICAgRlMubGxzZWVrKHN0cmVhbSwgMCwgMik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBieXRlc1dyaXR0ZW4gPSBzdHJlYW0uc3RyZWFtX29wcy53cml0ZShcbiAgICAgICAgICAgICAgICAgICAgc3RyZWFtLFxuICAgICAgICAgICAgICAgICAgICBidWZmZXIsXG4gICAgICAgICAgICAgICAgICAgIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbixcbiAgICAgICAgICAgICAgICAgICAgY2FuT3duXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICBpZiAoIXNlZWtpbmcpIHN0cmVhbS5wb3NpdGlvbiArPSBieXRlc1dyaXR0ZW47XG4gICAgICAgICAgICAgICAgcmV0dXJuIGJ5dGVzV3JpdHRlbjtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBhbGxvY2F0ZTogZnVuY3Rpb24oc3RyZWFtLCBvZmZzZXQsIGxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGlmIChvZmZzZXQgPCAwIHx8IGxlbmd0aCA8PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlZBTCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoc3RyZWFtLmZsYWdzICYgMjA5NzE1NSkgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUJBREYpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIUZTLmlzRmlsZShzdHJlYW0ubm9kZS5tb2RlKSAmJiAhRlMuaXNEaXIobm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FTk9ERVYpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIXN0cmVhbS5zdHJlYW1fb3BzLmFsbG9jYXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVPUE5PVFNVUFApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBzdHJlYW0uc3RyZWFtX29wcy5hbGxvY2F0ZShzdHJlYW0sIG9mZnNldCwgbGVuZ3RoKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBtbWFwOiBmdW5jdGlvbihcbiAgICAgICAgICAgICAgICBzdHJlYW0sXG4gICAgICAgICAgICAgICAgYnVmZmVyLFxuICAgICAgICAgICAgICAgIG9mZnNldCxcbiAgICAgICAgICAgICAgICBsZW5ndGgsXG4gICAgICAgICAgICAgICAgcG9zaXRpb24sXG4gICAgICAgICAgICAgICAgcHJvdCxcbiAgICAgICAgICAgICAgICBmbGFnc1xuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgLy8gVE9ETyBpZiBQUk9UIGlzIFBST1RfV1JJVEUsIG1ha2Ugc3VyZSB3ZSBoYXZlIHdyaXRlIGFjY2Vzc1xuICAgICAgICAgICAgICAgIGlmICgoc3RyZWFtLmZsYWdzICYgMjA5NzE1NSkgPT09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUFDQ0VTKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFzdHJlYW0uc3RyZWFtX29wcy5tbWFwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5lcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOT0RFVik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBzdHJlYW0uc3RyZWFtX29wcy5tbWFwKFxuICAgICAgICAgICAgICAgICAgICBzdHJlYW0sXG4gICAgICAgICAgICAgICAgICAgIGJ1ZmZlcixcbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0LFxuICAgICAgICAgICAgICAgICAgICBsZW5ndGgsXG4gICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uLFxuICAgICAgICAgICAgICAgICAgICBwcm90LFxuICAgICAgICAgICAgICAgICAgICBmbGFnc1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaW9jdGw6IGZ1bmN0aW9uKHN0cmVhbSwgY21kLCBhcmcpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXN0cmVhbS5zdHJlYW1fb3BzLmlvY3RsKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOT1RUWSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBzdHJlYW0uc3RyZWFtX29wcy5pb2N0bChzdHJlYW0sIGNtZCwgYXJnKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICByZWFkRmlsZTogZnVuY3Rpb24ocGF0aCwgb3B0cykge1xuICAgICAgICAgICAgICAgIG9wdHMgPSBvcHRzIHx8IHt9O1xuICAgICAgICAgICAgICAgIG9wdHMuZmxhZ3MgPSBvcHRzLmZsYWdzIHx8ICdyJztcbiAgICAgICAgICAgICAgICBvcHRzLmVuY29kaW5nID0gb3B0cy5lbmNvZGluZyB8fCAnYmluYXJ5JztcbiAgICAgICAgICAgICAgICB2YXIgcmV0O1xuICAgICAgICAgICAgICAgIHZhciBzdHJlYW0gPSBGUy5vcGVuKHBhdGgsIG9wdHMuZmxhZ3MpO1xuICAgICAgICAgICAgICAgIHZhciBzdGF0ID0gRlMuc3RhdChwYXRoKTtcbiAgICAgICAgICAgICAgICB2YXIgbGVuZ3RoID0gc3RhdC5zaXplO1xuICAgICAgICAgICAgICAgIHZhciBidWYgPSBuZXcgVWludDhBcnJheShsZW5ndGgpO1xuICAgICAgICAgICAgICAgIEZTLnJlYWQoc3RyZWFtLCBidWYsIDAsIGxlbmd0aCwgMCk7XG4gICAgICAgICAgICAgICAgaWYgKG9wdHMuZW5jb2RpbmcgPT09ICd1dGY4Jykge1xuICAgICAgICAgICAgICAgICAgICByZXQgPSAnJztcbiAgICAgICAgICAgICAgICAgICAgdmFyIHV0ZjggPSBuZXcgUnVudGltZS5VVEY4UHJvY2Vzc29yKCk7XG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldCArPSB1dGY4LnByb2Nlc3NDQ2hhcihidWZbaV0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChvcHRzLmVuY29kaW5nID09PSAnYmluYXJ5Jykge1xuICAgICAgICAgICAgICAgICAgICByZXQgPSBidWY7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ludmFsaWQgZW5jb2RpbmcgdHlwZSBcIicgKyBvcHRzLmVuY29kaW5nICsgJ1wiJ1xuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBGUy5jbG9zZShzdHJlYW0pO1xuICAgICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgd3JpdGVGaWxlOiBmdW5jdGlvbihwYXRoLCBkYXRhLCBvcHRzKSB7XG4gICAgICAgICAgICAgICAgb3B0cyA9IG9wdHMgfHwge307XG4gICAgICAgICAgICAgICAgb3B0cy5mbGFncyA9IG9wdHMuZmxhZ3MgfHwgJ3cnO1xuICAgICAgICAgICAgICAgIG9wdHMuZW5jb2RpbmcgPSBvcHRzLmVuY29kaW5nIHx8ICd1dGY4JztcbiAgICAgICAgICAgICAgICB2YXIgc3RyZWFtID0gRlMub3BlbihwYXRoLCBvcHRzLmZsYWdzLCBvcHRzLm1vZGUpO1xuICAgICAgICAgICAgICAgIGlmIChvcHRzLmVuY29kaW5nID09PSAndXRmOCcpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHV0ZjggPSBuZXcgUnVudGltZS5VVEY4UHJvY2Vzc29yKCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBidWYgPSBuZXcgVWludDhBcnJheSh1dGY4LnByb2Nlc3NKU1N0cmluZyhkYXRhKSk7XG4gICAgICAgICAgICAgICAgICAgIEZTLndyaXRlKHN0cmVhbSwgYnVmLCAwLCBidWYubGVuZ3RoLCAwKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9wdHMuZW5jb2RpbmcgPT09ICdiaW5hcnknKSB7XG4gICAgICAgICAgICAgICAgICAgIEZTLndyaXRlKHN0cmVhbSwgZGF0YSwgMCwgZGF0YS5sZW5ndGgsIDApO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbiAgICAgICAgICAgICAgICAgICAgICAgICdJbnZhbGlkIGVuY29kaW5nIHR5cGUgXCInICsgb3B0cy5lbmNvZGluZyArICdcIidcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgRlMuY2xvc2Uoc3RyZWFtKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBjd2Q6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBGUy5jdXJyZW50UGF0aDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBjaGRpcjogZnVuY3Rpb24ocGF0aCkge1xuICAgICAgICAgICAgICAgIHZhciBsb29rdXAgPSBGUy5sb29rdXBQYXRoKHBhdGgsIHsgZm9sbG93OiB0cnVlIH0pO1xuICAgICAgICAgICAgICAgIGlmICghRlMuaXNEaXIobG9va3VwLm5vZGUubW9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRU5PVERJUik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBlcnIgPSBGUy5ub2RlUGVybWlzc2lvbnMobG9va3VwLm5vZGUsICd4Jyk7XG4gICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihlcnIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBGUy5jdXJyZW50UGF0aCA9IGxvb2t1cC5wYXRoO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNyZWF0ZURlZmF1bHREaXJlY3RvcmllczogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgRlMubWtkaXIoJy90bXAnKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBjcmVhdGVEZWZhdWx0RGV2aWNlczogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgLy8gY3JlYXRlIC9kZXZcbiAgICAgICAgICAgICAgICBGUy5ta2RpcignL2RldicpO1xuICAgICAgICAgICAgICAgIC8vIHNldHVwIC9kZXYvbnVsbFxuICAgICAgICAgICAgICAgIEZTLnJlZ2lzdGVyRGV2aWNlKEZTLm1ha2VkZXYoMSwgMyksIHtcbiAgICAgICAgICAgICAgICAgICAgcmVhZDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgd3JpdGU6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBGUy5ta2RldignL2Rldi9udWxsJywgRlMubWFrZWRldigxLCAzKSk7XG4gICAgICAgICAgICAgICAgLy8gc2V0dXAgL2Rldi90dHkgYW5kIC9kZXYvdHR5MVxuICAgICAgICAgICAgICAgIC8vIHN0ZGVyciBuZWVkcyB0byBwcmludCBvdXRwdXQgdXNpbmcgY29uc29sZS53YXJuXG4gICAgICAgICAgICAgICAgLy8gc28gd2UgcmVnaXN0ZXIgYSBzZWNvbmQgdHR5IGp1c3QgZm9yIGl0LlxuICAgICAgICAgICAgICAgIFRUWS5yZWdpc3RlcihGUy5tYWtlZGV2KDUsIDApLCBUVFkuZGVmYXVsdF90dHlfb3BzKTtcbiAgICAgICAgICAgICAgICBUVFkucmVnaXN0ZXIoRlMubWFrZWRldig2LCAwKSwgVFRZLmRlZmF1bHRfdHR5MV9vcHMpO1xuICAgICAgICAgICAgICAgIEZTLm1rZGV2KCcvZGV2L3R0eScsIEZTLm1ha2VkZXYoNSwgMCkpO1xuICAgICAgICAgICAgICAgIEZTLm1rZGV2KCcvZGV2L3R0eTEnLCBGUy5tYWtlZGV2KDYsIDApKTtcbiAgICAgICAgICAgICAgICAvLyB3ZSdyZSBub3QgZ29pbmcgdG8gZW11bGF0ZSB0aGUgYWN0dWFsIHNobSBkZXZpY2UsXG4gICAgICAgICAgICAgICAgLy8ganVzdCBjcmVhdGUgdGhlIHRtcCBkaXJzIHRoYXQgcmVzaWRlIGluIGl0IGNvbW1vbmx5XG4gICAgICAgICAgICAgICAgRlMubWtkaXIoJy9kZXYvc2htJyk7XG4gICAgICAgICAgICAgICAgRlMubWtkaXIoJy9kZXYvc2htL3RtcCcpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNyZWF0ZVN0YW5kYXJkU3RyZWFtczogZnVuY3Rpb24oKSB7XG4gICAgICAg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gICAgICAgICAgIEZTLnN5bWxpbmsoJy9kZXYvdHR5JywgJy9kZXYvc3Rkb3V0Jyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChNb2R1bGVbJ3N0ZGVyciddKSB7XG4gICAgICAgICAgICAgICAgICAgIEZTLmNyZWF0ZURldmljZSgnL2RldicsICdzdGRlcnInLCBudWxsLCBNb2R1bGVbJ3N0ZGVyciddKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBGUy5zeW1saW5rKCcvZGV2L3R0eTEnLCAnL2Rldi9zdGRlcnInKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gb3BlbiBkZWZhdWx0IHN0cmVhbXMgZm9yIHRoZSBzdGRpbiwgc3Rkb3V0IGFuZCBzdGRlcnIgZGV2aWNlc1xuICAgICAgICAgICAgICAgIHZhciBzdGRpbiA9IEZTLm9wZW4oJy9kZXYvc3RkaW4nLCAncicpO1xuICAgICAgICAgICAgICAgIEhFQVAzMltfc3RkaW4gPj4gMl0gPSBzdGRpbi5mZDtcbiAgICAgICAgICAgICAgICBhc3NlcnQoXG4gICAgICAgICAgICAgICAgICAgIHN0ZGluLmZkID09PSAxLFxuICAgICAgICAgICAgICAgICAgICAnaW52YWxpZCBoYW5kbGUgZm9yIHN0ZGluICgnICsgc3RkaW4uZmQgKyAnKSdcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIHZhciBzdGRvdXQgPSBGUy5vcGVuKCcvZGV2L3N0ZG91dCcsICd3Jyk7XG4gICAgICAgICAgICAgICAgSEVBUDMyW19zdGRvdXQgPj4gMl0gPSBzdGRvdXQuZmQ7XG4gICAgICAgICAgICAgICAgYXNzZXJ0KFxuICAgICAgICAgICAgICAgICAgICBzdGRvdXQuZmQgPT09IDIsXG4gICAgICAgICAgICAgICAgICAgICdpbnZhbGlkIGhhbmRsZSBmb3Igc3Rkb3V0ICgnICsgc3Rkb3V0LmZkICsgJyknXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB2YXIgc3RkZXJyID0gRlMub3BlbignL2Rldi9zdGRlcnInLCAndycpO1xuICAgICAgICAgICAgICAgIEhFQVAzMltfc3RkZXJyID4+IDJdID0gc3RkZXJyLmZkO1xuICAgICAgICAgICAgICAgIGFzc2VydChcbiAgICAgICAgICAgICAgICAgICAgc3RkZXJyLmZkID09PSAzLFxuICAgICAgICAgICAgICAgICAgICAnaW52YWxpZCBoYW5kbGUgZm9yIHN0ZGVyciAoJyArIHN0ZGVyci5mZCArICcpJ1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc3RhdGljSW5pdDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgRlMubmFtZVRhYmxlID0gbmV3IEFycmF5KDQwOTYpO1xuICAgICAgICAgICAgICAgIEZTLnJvb3QgPSBGUy5jcmVhdGVOb2RlKG51bGwsICcvJywgMTYzODQgfCAwbzc3NywgMCk7XG4gICAgICAgICAgICAgICAgRlMubW91bnQoTUVNRlMsIHt9LCAnLycpO1xuICAgICAgICAgICAgICAgIEZTLmNyZWF0ZURlZmF1bHREaXJlY3RvcmllcygpO1xuICAgICAgICAgICAgICAgIEZTLmNyZWF0ZURlZmF1bHREZXZpY2VzKCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaW5pdDogZnVuY3Rpb24oaW5wdXQsIG91dHB1dCwgZXJyb3IpIHtcbiAgICAgICAgICAgICAgICBhc3NlcnQoXG4gICAgICAgICAgICAgICAgICAgICFGUy5pbml0LmluaXRpYWxpemVkLFxuICAgICAgICAgICAgICAgICAgICAnRlMuaW5pdCB3YXMgcHJldmlvdXNseSBjYWxsZWQuIElmIHlvdSB3YW50IHRvIGluaXRpYWxpemUgbGF0ZXIgd2l0aCBjdXN0b20gcGFyYW1ldGVycywgcmVtb3ZlIGFueSBlYXJsaWVyIGNhbGxzIChub3RlIHRoYXQgb25lIGlzIGF1dG9tYXRpY2FsbHkgYWRkZWQgdG8gdGhlIGdlbmVyYXRlZCBjb2RlKSdcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIEZTLmluaXQuaW5pdGlhbGl6ZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIC8vIEFsbG93IE1vZHVsZS5zdGRpbiBldGMuIHRvIHByb3ZpZGUgZGVmYXVsdHMsIGlmIG5vbmUgZXhwbGljaXRseSBwYXNzZWQgdG8gdXMgaGVyZVxuICAgICAgICAgICAgICAgIE1vZHVsZVsnc3RkaW4nXSA9IGlucHV0IHx8IE1vZHVsZVsnc3RkaW4nXTtcbiAgICAgICAgICAgICAgICBNb2R1bGVbJ3N0ZG91dCddID0gb3V0cHV0IHx8IE1vZHVsZVsnc3Rkb3V0J107XG4gICAgICAgICAgICAgICAgTW9kdWxlWydzdGRlcnInXSA9IGVycm9yIHx8IE1vZHVsZVsnc3RkZXJyJ107XG4gICAgICAgICAgICAgICAgRlMuY3JlYXRlU3RhbmRhcmRTdHJlYW1zKCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcXVpdDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgRlMuaW5pdC5pbml0aWFsaXplZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgRlMuc3RyZWFtcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgc3RyZWFtID0gRlMuc3RyZWFtc1tpXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzdHJlYW0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIEZTLmNsb3NlKHN0cmVhbSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdldE1vZGU6IGZ1bmN0aW9uKGNhblJlYWQsIGNhbldyaXRlKSB7XG4gICAgICAgICAgICAgICAgdmFyIG1vZGUgPSAwO1xuICAgICAgICAgICAgICAgIGlmIChjYW5SZWFkKSBtb2RlIHw9IDI5MiB8IDczO1xuICAgICAgICAgICAgICAgIGlmIChjYW5Xcml0ZSkgbW9kZSB8PSAxNDY7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1vZGU7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgam9pblBhdGg6IGZ1bmN0aW9uKHBhcnRzLCBmb3JjZVJlbGF0aXZlKSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhdGggPSBQQVRILmpvaW4uYXBwbHkobnVsbCwgcGFydHMpO1xuICAgICAgICAgICAgICAgIGlmIChmb3JjZVJlbGF0aXZlICYmIHBhdGhbMF0gPT0gJy8nKSBwYXRoID0gcGF0aC5zdWJzdHIoMSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhdGg7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYWJzb2x1dGVQYXRoOiBmdW5jdGlvbihyZWxhdGl2ZSwgYmFzZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBQQVRILnJlc29sdmUoYmFzZSwgcmVsYXRpdmUpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHN0YW5kYXJkaXplUGF0aDogZnVuY3Rpb24ocGF0aCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBQQVRILm5vcm1hbGl6ZShwYXRoKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBmaW5kT2JqZWN0OiBmdW5jdGlvbihwYXRoLCBkb250UmVzb2x2ZUxhc3RMaW5rKSB7XG4gICAgICAgICAgICAgICAgdmFyIHJldCA9IEZTLmFuYWx5emVQYXRoKHBhdGgsIGRvbnRSZXNvbHZlTGFzdExpbmspO1xuICAgICAgICAgICAgICAgIGlmIChyZXQuZXhpc3RzKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXQub2JqZWN0O1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIF9fX3NldEVyck5vKHJldC5lcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBhbmFseXplUGF0aDogZnVuY3Rpb24ocGF0aCwgZG9udFJlc29sdmVMYXN0TGluaykge1xuICAgICAgICAgICAgICAgIC8vIG9wZXJhdGUgZnJvbSB3aXRoaW4gdGhlIGNvbnRleHQgb2YgdGhlIHN5bWxpbmsncyB0YXJnZXRcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbG9va3VwID0gRlMubG9va3VwUGF0aChwYXRoLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb2xsb3c6ICFkb250UmVzb2x2ZUxhc3RMaW5rXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBwYXRoID0gbG9va3VwLnBhdGg7XG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cbiAgICAgICAgICAgICAgICB2YXIgcmV0ID0ge1xuICAgICAgICAgICAgICAgICAgICBpc1Jvb3Q6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICBleGlzdHM6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICBlcnJvcjogMCxcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgcGF0aDogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgb2JqZWN0OiBudWxsLFxuICAgICAgICAgICAgICAgICAgICBwYXJlbnRFeGlzdHM6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICBwYXJlbnRQYXRoOiBudWxsLFxuICAgICAgICAgICAgICAgICAgICBwYXJlbnRPYmplY3Q6IG51bGxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBsb29rdXAgPSBGUy5sb29rdXBQYXRoKHBhdGgsIHsgcGFyZW50OiB0cnVlIH0pO1xuICAgICAgICAgICAgICAgICAgICByZXQucGFyZW50RXhpc3RzID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0LnBhcmVudFBhdGggPSBsb29rdXAucGF0aDtcbiAgICAgICAgICAgICAgICAgICAgcmV0LnBhcmVudE9iamVjdCA9IGxvb2t1cC5ub2RlO1xuICAgICAgICAgICAgICAgICAgICByZXQubmFtZSA9IFBBVEguYmFzZW5hbWUocGF0aCk7XG4gICAgICAgICAgICAgICAgICAgIGxvb2t1cCA9IEZTLmxvb2t1cFBhdGgocGF0aCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9sbG93OiAhZG9udFJlc29sdmVMYXN0TGlua1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0LmV4aXN0cyA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIHJldC5wYXRoID0gbG9va3VwLnBhdGg7XG4gICAgICAgICAgICAgICAgICAgIHJldC5vYmplY3QgPSBsb29rdXAubm9kZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0Lm5hbWUgPSBsb29rdXAubm9kZS5uYW1lO1xuICAgICAgICAgICAgICAgICAgICByZXQuaXNSb290ID0gbG9va3VwLnBhdGggPT09ICcvJztcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldC5lcnJvciA9IGUuZXJybm87XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY3JlYXRlRm9sZGVyOiBmdW5jdGlvbihwYXJlbnQsIG5hbWUsIGNhblJlYWQsIGNhbldyaXRlKSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhdGggPSBQQVRILmpvaW4oXG4gICAgICAgICAgICAgICAgICAgIHR5cGVvZiBwYXJlbnQgPT09ICdzdHJpbmcnID8gcGFyZW50IDogRlMuZ2V0UGF0aChwYXJlbnQpLFxuICAgICAgICAgICAgICAgICAgICBuYW1lXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB2YXIgbW9kZSA9IEZTLmdldE1vZGUoY2FuUmVhZCwgY2FuV3JpdGUpO1xuICAgICAgICAgICAgICAgIHJldHVybiBGUy5ta2RpcihwYXRoLCBtb2RlKTtcbiAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQ3JlYXRlcyBhIGRpcmVjdG9yeS5cbiAgICAgICAgICAgICAqIEBmdW5jdGlvbiBjcmVhdGVQYXRoXG4gICAgICAgICAgICAgKiBAbWVtYmVyb2YgTGliVGlNaWRpdHlcbiAgICAgICAgICAgICAqIEBpbnN0YW5jZVxuICAgICAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IHBhcmVudCBUaGUgcGFyZW50IGZvbGRlci5cbiAgICAgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBwYXRoIFRoZSBwYXRoIHRvIGNyZWF0ZS5cbiAgICAgICAgICAgICAqIEBwYXJhbSB7Ym9vbGVhbn0gW3Rocm93RXJyb3IgPSB0cnVlXSBJZiBkaXJlY3RvcnkgY3JlYXRpb24gZmFpbGVkLCB0aHJvdyBhbiBlcnJvci5cbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgY3JlYXRlUGF0aDogZnVuY3Rpb24ocGFyZW50LCBwYXRoLCB0aHJvd0Vycm9yID0gdHJ1ZSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHBhcnRzID0gcGF0aC5zcGxpdCgnLycpLnJldmVyc2UoKTtcbiAgICAgICAgICAgICAgICB3aGlsZSAocGFydHMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHBhcnQgPSBwYXJ0cy5wb3AoKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFwYXJ0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjb25zdCBjdXJyZW50ID0gUEFUSC5qb2luKHBhcmVudCwgcGFydCk7XG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBGUy5ta2RpcihjdXJyZW50LCB1bmRlZmluZWQsIHRocm93RXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29uc29sZS5lcnJvcihlcnJvcilcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBwYXJlbnQgPSBjdXJyZW50O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQ3JlYXRlcyBhIGZpbGUuXG4gICAgICAgICAgICAgKiBAZnVuY3Rpb24gY3JlYXRlRmlsZVxuICAgICAgICAgICAgICogQG1lbWJlcm9mIExpYlRpTWlkaXR5XG4gICAgICAgICAgICAgKiBAaW5zdGFuY2VcbiAgICAgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBwYXJlbnQgVGhlIHBhcmVudCBmb2xkZXIuXG4gICAgICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbmFtZSBUaGUgcGF0aCB0byBjcmVhdGUuXG4gICAgICAgICAgICAgKiBAcGFyYW0ge2Jvb2xlYW59IGNhblJlYWRcbiAgICAgICAgICAgICAqIEBwYXJhbSB7Ym9vbGVhbn0gY2FuV3JpdGVcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgY3JlYXRlRmlsZTogZnVuY3Rpb24ocGFyZW50LCBuYW1lLCBjYW5SZWFkLCBjYW5Xcml0ZSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHBhdGggPSBQQVRILmpvaW4oXG4gICAgICAgICAgICAgICAgICAgIHR5cGVvZiBwYXJlbnQgPT09ICdzdHJpbmcnID8gcGFyZW50IDogRlMuZ2V0UGF0aChwYXJlbnQpLFxuICAgICAgICAgICAgICAgICAgICBuYW1lXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICBjb25zdCBtb2RlID0gRlMuZ2V0TW9kZShjYW5SZWFkLCBjYW5Xcml0ZSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEZTLmNyZWF0ZShwYXRoLCBtb2RlKTtcbiAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQ3JlYXRlcyBhIGRhdGEgZmlsZSBhbmQgd3JpdGVzIGRhdGEgdG8gaXQuXG4gICAgICAgICAgICAgKiBAZnVuY3Rpb24gY3JlYXRlRGF0YUZpbGVcbiAgICAgICAgICAgICAqIEBtZW1iZXJvZiBMaWJUaU1pZGl0eVxuICAgICAgICAgICAgICogQGluc3RhbmNlXG4gICAgICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gcGFyZW50XG4gICAgICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbmFtZVxuICAgICAgICAgICAgICogQHBhcmFtIHthcnJheX0gZGF0YVxuICAgICAgICAgICAgICogQHBhcmFtIHtib29sZWFufSBjYW5SZWFkXG4gICAgICAgICAgICAgKiBAcGFyYW0ge2Jvb2xlYW59IGNhbldyaXRlXG4gICAgICAgICAgICAgKiBAcGFyYW0ge2Jvb2xlYW59IFtjYW5Pd25dXG4gICAgICAgICAgICAgKiBAcGFyYW0ge2Jvb2xlYW59IFt0aHJvd0Vycm9yID0gdHJ1ZV0gSWYgZmlsZSBjcmVhdGlvbiBmYWlsZWQsIHRocm93IGFuIGVycm9yLlxuICAgICAgICAgICAgICovXG5cbiAgICAgICAgICAgIGNyZWF0ZURhdGFGaWxlOiBmdW5jdGlvbihcbiAgICAgICAgICAgICAgICBwYXJlbnQsXG4gICAgICAgICAgICAgICAgbmFtZSxcbiAgICAgICAgICAgICAgICBkYXRhLFxuICAgICAgICAgICAgICAgIGNhblJlYWQsXG4gICAgICAgICAgICAgICAgY2FuV3JpdGUsXG4gICAgICAgICAgICAgICAgY2FuT3duLFxuICAgICAgICAgICAgICAgIHRocm93RXJyb3IgPSB0cnVlXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBjb25zdCBwYXRoID0gbmFtZVxuICAgICAgICAgICAgICAgICAgICA/IFBBVEguam9pbihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZW9mIHBhcmVudCA9PT0gJ3N0cmluZydcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcGFyZW50XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IEZTLmdldFBhdGgocGFyZW50KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZVxuICAgICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgICAgOiBwYXJlbnQ7XG4gICAgICAgICAgICAgICAgY29uc3QgbW9kZSA9IEZTLmdldE1vZGUoY2FuUmVhZCwgY2FuV3JpdGUpO1xuXG4gICAgICAgICAgICAgICAgaWYgKHRocm93RXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgRlMuY3JlYXRlKHBhdGgsIG1vZGUpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBGUy5jcmVhdGUocGF0aCwgbW9kZSk7XG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGRhdGEgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXJyID0gbmV3IEFycmF5KGRhdGEubGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwLCBsZW4gPSBkYXRhLmxlbmd0aDsgaSA8IGxlbjsgKytpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyW2ldID0gZGF0YS5jaGFyQ29kZUF0KGkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSA9IGFycjtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIC8vIG1ha2Ugc3VyZSB3ZSBjYW4gd3JpdGUgdG8gdGhlIGZpbGVcbiAgICAgICAgICAgICAgICAgICAgRlMuY2htb2QocGF0aCwgbW9kZSB8IDE0Nik7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHN0cmVhbSA9IEZTLm9wZW4ocGF0aCwgJ3cnKTtcbiAgICAgICAgICAgICAgICAgICAgRlMud3JpdGUoc3RyZWFtLCBkYXRhLCAwLCBkYXRhLmxlbmd0aCwgMCwgY2FuT3duKTtcbiAgICAgICAgICAgICAgICAgICAgRlMuY2xvc2Uoc3RyZWFtKTtcbiAgICAgICAgICAgICAgICAgICAgRlMuY2htb2QocGF0aCwgbW9kZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBDcmVhdGVzIGEgZmlsZSBpbiB0aGUgcGF0Y2ggZGlyZWN0b3J5IGFuZCB3cml0ZXMgdGhlIGluc3RydW1lbnQgZGF0YSB0byBpdC5cbiAgICAgICAgICAgICAqIEBmdW5jdGlvbiBsb2FkUGF0Y2hGcm9tVXJsXG4gICAgICAgICAgICAgKiBAbWVtYmVyb2YgTGliVG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ZGUpO1xuICAgICAgICAgICAgICAgIEZTLmNobW9kKHBhdGgsIG1vZGUgfCAxNDYpO1xuICAgICAgICAgICAgICAgIGNvbnN0IHN0cmVhbSA9IEZTLm9wZW4ocGF0aCwgJ3cnKTtcbiAgICAgICAgICAgICAgICBGUy53cml0ZShzdHJlYW0sIGRhdGEsIDAsIGRhdGEubGVuZ3RoLCAwLCB1bmRlZmluZWQpO1xuICAgICAgICAgICAgICAgIEZTLmNsb3NlKHN0cmVhbSk7XG4gICAgICAgICAgICAgICAgRlMuY2htb2QocGF0aCwgbW9kZSk7XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICBjcmVhdGVEZXZpY2U6IGZ1bmN0aW9uKHBhcmVudCwgbmFtZSwgaW5wdXQsIG91dHB1dCkge1xuICAgICAgICAgICAgICAgIHZhciBwYXRoID0gUEFUSC5qb2luKFxuICAgICAgICAgICAgICAgICAgICB0eXBlb2YgcGFyZW50ID09PSAnc3RyaW5nJyA/IHBhcmVudCA6IEZTLmdldFBhdGgocGFyZW50KSxcbiAgICAgICAgICAgICAgICAgICAgbmFtZVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgdmFyIG1vZGUgPSBGUy5nZXRNb2RlKCEhaW5wdXQsICEhb3V0cHV0KTtcbiAgICAgICAgICAgICAgICBpZiAoIUZTLmNyZWF0ZURldmljZS5tYWpvcikgRlMuY3JlYXRlRGV2aWNlLm1ham9yID0gNjQ7XG4gICAgICAgICAgICAgICAgdmFyIGRldiA9IEZTLm1ha2VkZXYoRlMuY3JlYXRlRGV2aWNlLm1ham9yKyssIDApO1xuICAgICAgICAgICAgICAgIC8vIENyZWF0ZSBhIGZha2UgZGV2aWNlIHRoYXQgYSBzZXQgb2Ygc3RyZWFtIG9wcyB0byBlbXVsYXRlXG4gICAgICAgICAgICAgICAgLy8gdGhlIG9sZCBiZWhhdmlvci5cbiAgICAgICAgICAgICAgICBGUy5yZWdpc3RlckRldmljZShkZXYsIHtcbiAgICAgICAgICAgICAgICAgICAgb3BlbjogZnVuY3Rpb24oc3RyZWFtKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW0uc2Vla2FibGUgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgY2xvc2U6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmx1c2ggYW55IHBlbmRpbmcgbGluZSBkYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3V0cHV0ICYmIG91dHB1dC5idWZmZXIgJiYgb3V0cHV0LmJ1ZmZlci5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRwdXQoMTApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICByZWFkOiBmdW5jdGlvbihcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlcixcbiAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvcyAvKiBpZ25vcmVkICovXG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGJ5dGVzUmVhZCA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBpbnB1dCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUlPKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCA9PT0gdW5kZWZpbmVkICYmIGJ5dGVzUmVhZCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FQUdBSU4pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0ID09PSBudWxsIHx8IHJlc3VsdCA9PT0gdW5kZWZpbmVkKSBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlc1JlYWQrKztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWZmZXJbb2Zmc2V0ICsgaV0gPSByZXN1bHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYnl0ZXNSZWFkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtLm5vZGUudGltZXN0YW1wID0gRGF0ZS5ub3coKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBieXRlc1JlYWQ7XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlOiBmdW5jdGlvbihzdHJlYW0sIGJ1ZmZlciwgb2Zmc2V0LCBsZW5ndGgsIHBvcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dHB1dChidWZmZXJbb2Zmc2V0ICsgaV0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUlPKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtLm5vZGUudGltZXN0YW1wID0gRGF0ZS5ub3coKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEZTLm1rZGV2KHBhdGgsIG1vZGUsIGRldik7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY3JlYXRlTGluazogZnVuY3Rpb24ocGFyZW50LCBuYW1lLCB0YXJnZXQsIGNhblJlYWQsIGNhbldyaXRlKSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhdGggPSBQQVRILmpvaW4oXG4gICAgICAgICAgICAgICAgICAgIHR5cGVvZiBwYXJlbnQgPT09ICdzdHJpbmcnID8gcGFyZW50IDogRlMuZ2V0UGF0aChwYXJlbnQpLFxuICAgICAgICAgICAgICAgICAgICBuYW1lXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gRlMuc3ltbGluayh0YXJnZXQsIHBhdGgpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGZvcmNlTG9hZEZpbGU6IGZ1bmN0aW9uKG9iaikge1xuICAgICAgICAgICAgICAgIGlmIChvYmouaXNEZXZpY2UgfHwgb2JqLmlzRm9sZGVyIHx8IG9iai5saW5rIHx8IG9iai5jb250ZW50cylcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgdmFyIHN1Y2Nlc3MgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgWE1MSHR0cFJlcXVlc3QgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbiAgICAgICAgICAgICAgICAgICAgICAgICdMYXp5IGxvYWRpbmcgc2hvdWxkIGhhdmUgYmVlbiBwZXJmb3JtZWQgKGNvbnRlbnRzIHNldCkgaW4gY3JlYXRlTGF6eUZpbGUsIGJ1dCBpdCB3YXMgbm90LiBMYXp5IGxvYWRpbmcgb25seSB3b3JrcyBpbiB3ZWIgd29ya2Vycy4gVXNlIC0tZW1iZWQtZmlsZSBvciAtLXByZWxvYWQtZmlsZSBpbiBlbWNjIG9uIHRoZSBtYWluIHRocmVhZC4nXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChNb2R1bGVbJ3JlYWQnXSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBDb21tYW5kLWxpbmUuXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBXQVJOSU5HOiBDYW4ndCByZWFkIGJpbmFyeSBmaWxlcyBpbiBWOCdzIGQ4IG9yIHRyYWNlbW9ua2V5J3MganMsIGFzXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICByZWFkKCkgd2lsbCB0cnkgdG8gcGFyc2UgVVRGOC5cbiAgICAgICAgICAgICAgICAgICAgICAgIG9iai5jb250ZW50cyA9IGludEFycmF5RnJvbVN0cmluZyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBNb2R1bGVbJ3JlYWQnXShvYmoudXJsKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnVlXG4gICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdWNjZXNzID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2Fubm90IGxvYWQgd2l0aG91dCByZWFkKCkgb3IgWE1MSHR0cFJlcXVlc3QuJ1xuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIXN1Y2Nlc3MpIF9fX3NldEVyck5vKEVSUk5PX0NPREVTLkVJTyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHN1Y2Nlc3M7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY3JlYXRlTGF6eUZpbGU6IGZ1bmN0aW9uKHBhcmVudCwgbmFtZSwgdXJsLCBjYW5SZWFkLCBjYW5Xcml0ZSkge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgWE1MSHR0cFJlcXVlc3QgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93ICdDYW5ub3QgZG8gc3luY2hyb25vdXMgYmluYXJ5IFhIUnMgb3V0c2lkZSB3ZWJ3b3JrZXJzIGluIG1vZGVybiBicm93c2Vycy4gVXNlIC0tZW1iZWQtZmlsZSBvciAtLXByZWxvYWQtZmlsZSBpbiBlbWNjJztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcHJvcGVydGllcyA9IHsgaXNEZXZpY2U6IGZhbHNlLCB1cmw6IHVybCB9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgbm9kZSA9IEZTLmNyZWF0ZUZpbGUocGFyZW50LCBuYW1lLCBjYW5SZWFkLCBjYW5Xcml0ZSk7XG4gICAgICAgICAgICAgICAgLy8gVGhpcyBpcyBhIHRvdGFsIGhhY2ssIGJ1dCBJIHdhbnQgdG8gZ2V0IHRoaXMgbGF6eSBmaWxlIGNvZGUgb3V0IG9mIHRoZVxuICAgICAgICAgICAgICAgIC8vIGNvcmUgb2YgTUVNRlMuIElmIHdlIHdhbnQgdG8ga2VlcCB0aGlzIGxhenkgZmlsZSBjb25jZXB0IEkgZmVlbCBpdCBzaG91bGRcbiAgICAgICAgICAgICAgICAvLyBiZSBpdHMgb3duIHRoaW4gTEFaWUZTIHByb3h5aW5nIGNhbGxzIHRvIE1FTUZTLlxuICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0aWVzLmNvbnRlbnRzKSB7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUuY29udGVudHMgPSBwcm9wZXJ0aWVzLmNvbnRlbnRzO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocHJvcGVydGllcy51cmwpIHtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5jb250ZW50cyA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUudXJsID0gcHJvcGVydGllcy51cmw7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIG92ZXJyaWRlIGVhY2ggc3RyZWFtIG9wIHdpdGggb25lIHRoYXQgdHJpZXMgdG8gZm9yY2UgbG9hZCB0aGUgbGF6eSBmaWxlIGZpcnN0XG4gICAgICAgICAgICAgICAgdmFyIHN0cmVhbV9vcHMgPSB7fTtcbiAgICAgICAgICAgICAgICB2YXIga2V5cyA9IE9iamVjdC5rZXlzKG5vZGUuc3RyZWFtX29wcyk7XG4gICAgICAgICAgICAgICAga2V5cy5mb3JFYWNoKGZ1bmN0aW9uKGtleSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZm4gPSBub2RlLnN0cmVhbV9vcHNba2V5XTtcbiAgICAgICAgICAgICAgICAgICAgc3RyZWFtX29wc1trZXldID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUZTLmZvcmNlTG9hZEZpbGUobm9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSU8pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZuLmFwcGx5KG51bGwsIGFyZ3VtZW50cyk7XG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgLy8gdXNlIGEgY3VzdG9tIHJlYWQgZnVuY3Rpb25cbiAgICAgICAgICAgICAgICBzdHJlYW1fb3BzLnJlYWQgPSBmdW5jdGlvbihcbiAgICAgICAgICAgICAgICAgICAgc3RyZWFtLFxuICAgICAgICAgICAgICAgICAgICBidWZmZXIsXG4gICAgICAgICAgICAgICAgICAgIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvblxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIUZTLmZvcmNlTG9hZEZpbGUobm9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRlbnRzID0gc3RyZWFtLm5vZGUuY29udGVudHM7XG4gICAgICAgICAgICAgICAgICAgIGlmIChwb3NpdGlvbiA+PSBjb250ZW50cy5sZW5ndGgpIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICB2YXIgc2l6ZSA9IE1hdGgubWluKGNvbnRlbnRzLmxlbmd0aCAtIHBvc2l0aW9uLCBsZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICBhc3NlcnQoc2l6ZSA+PSAwKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnRlbnRzLnNsaWNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBub3JtYWwgYXJyYXlcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2l6ZTsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyW29mZnNldCArIGldID0gY29udGVudHNbcG9zaXRpb24gKyBpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2l6ZTsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTGF6eVVpbnQ4QXJyYXkgZnJvbSBzeW5jIGJpbmFyeSBYSFJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWZmZXJbb2Zmc2V0ICsgaV0gPSBjb250ZW50cy5nZXQocG9zaXRpb24gKyBpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2l6ZTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIG5vZGUuc3RyZWFtX29wcyA9IHN0cmVhbV9vcHM7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5vZGU7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY3JlYXRlUHJlbG9hZGVkRmlsZTogZnVuY3Rpb24oXG4gICAgICAgICAgICAgICAgcGFyZW50LFxuICAgICAgICAgICAgICAgIG5hbWUsXG4gICAgICAgICAgICAgICAgdXJsLFxuICAgICAgICAgICAgICAgIGNhblJlYWQsXG4gICAgICAgICAgICAgICAgY2FuV3JpdGUsXG4gICAgICAgICAgICAgICAgb25sb2FkLFxuICAgICAgICAgICAgICAgIG9uZXJyb3IsXG4gICAgICAgICAgICAgICAgZG9udENyZWF0ZUZpbGUsXG4gICAgICAgICAgICAgICAgY2FuT3duXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBCcm93c2VyLmluaXQoKTtcbiAgICAgICAgICAgICAgICAvLyBUT0RPIHdlIHNob3VsZCBhbGxvdyBwZW9wbGUgdG8ganVzdCBwYXNzIGluIGEgY29tcGxldGUgZmlsZW5hbWUgaW5zdGVhZFxuICAgICAgICAgICAgICAgIC8vIG9mIHBhcmVudCBhbmQgbmFtZSBiZWluZyB0aGF0IHdlIGp1c3Qgam9pbiB0aGVtIGFueXdheXNcbiAgICAgICAgICAgICAgICB2YXIgZnVsbG5hbWUgPSBuYW1lXG4gICAgICAgICAgICAgICAgICAgID8gUEFUSC5yZXNvbHZlKFBBVEguam9pbihwYXJlbnQsIG5hbWUpKVxuICAgICAgICAgICAgICAgICAgICA6IHBhcmVudDtcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBwcm9jZXNzRGF0YShieXRlQXJyYXkpIHtcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gZmluaXNoKGJ5dGVBcnJheSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFkb250Q3JlYXRlRmlsZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZTLmNyZWF0ZURhdGFGaWxlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVBcnJheSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FuUmVhZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FuV3JpdGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbk93blxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob25sb2FkKSBvbmxvYWQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZVJ1bkRlcGVuZGVuY3koJ2NwICcgKyBmdWxsbmFtZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdmFyIGhhbmRsZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgTW9kdWxlWydwcmVsb2FkUGx1Z2lucyddLmZvckVhY2goZnVuY3Rpb24ocGx1Z2luKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGFuZGxlZCkgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBsdWdpblsnY2FuSGFuZGxlJ10oZnVsbG5hbWUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGx1Z2luWydoYW5kbGUnXShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUFycmF5LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdWxsbmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluaXNoLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvbmVycm9yKSBvbmVycm9yKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVSdW5EZXBlbmRlbmN5KCdjcCAnICsgZnVsbG5hbWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghaGFuZGxlZCkgZmluaXNoKGJ5dGVBcnJheSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGFkZFJ1bkRlcGVuZGVuY3koJ2NwICcgKyBmdWxsbmFtZSk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB1cmwgPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5hc3luY0xvYWQoXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwsXG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbihieXRlQXJyYXkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9jZXNzRGF0YShieXRlQXJyYXkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uZXJyb3JcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwcm9jZXNzRGF0YSh1cmwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBpbmRleGVkREI6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5pbmRleGVkREIgfHxcbiAgICAgICAgICAgICAgICAgICAgd2luZG93Lm1vekluZGV4ZWREQiB8fFxuICAgICAgICAgICAgICAgICAgICB3aW5kb3cud2Via2l0SW5kZXhlZERCIHx8XG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5tc0luZGV4ZWREQlxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgREJfTkFNRTogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdFTV9GU18nICsgd2luZG93LmxvY2F0aW9uLnBhdGhuYW1lO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIERCX1ZFUlNJT046IDIwLFxuICAgICAgICAgICAgREJfU1RPUkVfTkFNRTogJ0ZJTEVfREFUQScsXG4gICAgICAgICAgICBzYXZlRmlsZXNUb0RCOiBmdW5jdGlvbihwYXRocywgb25sb2FkLCBvbmVycm9yKSB7XG4gICAgICAgICAgICAgICAgb25sb2FkID0gb25sb2FkIHx8IGZ1bmN0aW9uKCkge307XG4gICAgICAgICAgICAgICAgb25lcnJvciA9IG9uZXJyb3IgfHwgZnVuY3Rpb24oKSB7fTtcbiAgICAgICAgICAgICAgICB2YXIgaW5kZXhlZERCID0gRlMuaW5kZXhlZERCKCk7XG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG9wZW5SZXF1ZXN0ID0gaW5kZXhlZERCLm9wZW4oXG4gICAgICAgICAgICAgICAgICAgICAgICBGUy5EQl9OQU1FKCksXG4gICAgICAgICAgICAgICAgICAgICAgICBGUy5EQl9WRVJTSU9OXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb25lcnJvcihlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgb3BlblJlcXVlc3Qub251cGdyYWRlbmVlZGVkID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKCdjcmVhdGluZyBkYicpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZGIgPSBvcGVuUmVxdWVzdC5yZXN1bHQ7XG4gICAgICAgICAgICAgICAgICAgIGRiLmNyZWF0ZU9iamVjdFN0b3JlKEZTLkRCX1NUT1JFX05BTUUpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgb3BlblJlcXVlc3Qub25zdWNjZXNzID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBkYiA9IG9wZW5SZXF1ZXN0LnJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRyYW5zYWN0aW9uID0gZGIudHJhbnNhY3Rpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICBbRlMuREJfU1RPUkVfTkFNRV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVhZHdyaXRlJ1xuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZmlsZXMgPSB0cmFuc2FjdGlvbi5vYmplY3RTdG9yZShGUy5EQl9TVE9SRV9OQU1FKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG9rID0gMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZhaWwgPSAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgdG90YWwgPSBwYXRocy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGZpbmlzaCgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmYWlsID09IDApIG9ubG9hZCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBvbmVycm9yKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcGF0aHMuZm9yRWFjaChmdW5jdGlvbihwYXRoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHV0UmVxdWVzdCA9IGZpbGVzLnB1dChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUy5hbmFseXplUGF0aChwYXRoKS5vYmplY3QuY29udGVudHMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aFxuICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFJlcXVlc3Qub25zdWNjZXNzID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb2srKztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob2sgKyBmYWlsID09IHRvdGFsKSBmaW5pc2goKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRSZXF1ZXN0Lm9uZXJyb3IgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWlsKys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9rICsgZmFpbCA9PSB0b3RhbCkgZmluaXNoKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgdHJhbnNhY3Rpb24ub25lcnJvciA9IG9uZXJyb3I7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBvcGVuUmVxdWVzdC5vbmVycm9yID0gb25lcnJvcjtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsb2FkRmlsZXNGcm9tREI6IGZ1bmN0aW9uKHBhdGhzLCBvbmxvYWQsIG9uZXJyb3IpIHtcbiAgICAgICAgICAgICAgICBvbmxvYWQgPSBvbmxvYWQgfHwgZnVuY3Rpb24oKSB7fTtcbiAgICAgICAgICAgICAgICBvbmVycm9yID0gb25lcnJvciB8fCBmdW5jdGlvbigpIHt9O1xuICAgICAgICAgICAgICAgIHZhciBpbmRleGVkREIgPSBGUy5pbmRleGVkREIoKTtcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgb3BlblJlcXVlc3QgPSBpbmRleGVkREIub3BlbihcbiAgICAgICAgICAgICAgICAgICAgICAgIEZTLkRCX05BTUUoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIEZTLkRCX1ZFUlNJT05cbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBvbmVycm9yKGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBvcGVuUmVxdWVzdC5vbnVwZ3JhZGVuZWVkZWQgPSBvbmVycm9yOyAvLyBubyBkYXRhYmFzZSB0byBsb2FkIGZyb21cbiAgICAgICAgICAgICAgICBvcGVuUmVxdWVzdC5vbnN1Y2Nlc3MgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRiID0gb3BlblJlcXVlc3QucmVzdWx0O1xuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRyYW5zYWN0aW9uID0gZGIudHJhbnNhY3Rpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgW0ZTLkRCX1NUT1JFX05BTUVdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdyZWFkb25seSdcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uZXJyb3IoZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdmFyIGZpbGVzID0gdHJhbnNhY3Rpb24ub2JqZWN0U3RvcmUoRlMuREJfU1RPUkVfTkFNRSk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBvayA9IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICBmYWlsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvdGFsID0gcGF0aHMubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBmaW5pc2goKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmFpbCA9PSAwKSBvbmxvYWQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Ugb25lcnJvcigpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHBhdGhzLmZvckVhY2goZnVuY3Rpb24ocGF0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGdldFJlcXVlc3QgPSBmaWxlcy5nZXQocGF0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBnZXRSZXF1ZXN0Lm9uc3VjY2VzcyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGUy5hbmFseXplUGF0aChwYXRoKS5leGlzdHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlMudW5saW5rKHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUy5jcmVhdGVEYXRhRmlsZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUEFUSC5kaXJuYW1lKHBhdGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQQVRILmJhc2VuYW1lKHBhdGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRSZXF1ZXN0LnJlc3VsdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb2srKztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob2sgKyBmYWlsID09IHRvdGFsKSBmaW5pc2goKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICBnZXRSZXF1ZXN0Lm9uZXJyb3IgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWlsKys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9rICsgZmFpbCA9PSB0b3RhbCkgZmluaXNoKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgdHJhbnNhY3Rpb24ub25lcnJvciA9IG9uZXJyb3I7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBvcGVuUmVxdWVzdC5vbmVycm9yID0gb25lcnJvcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgZnVuY3Rpb24gX29wZW4ocGF0aCwgb2ZsYWcsIHZhcmFyZ3MpIHtcbiAgICAgICAgICAgIC8vIGludCBvcGVuKGNvbnN0IGNoYXIgKnBhdGgsIGludCBvZmxhZywgLi4uKTtcbiAgICAgICAgICAgIC8vIGh0dHA6Ly9wdWJzLm9wZW5ncm91cC5vcmcvb25saW5lcHVicy8wMDk2OTUzOTkvZnVuY3Rpb25zL29wZW4uaHRtbFxuICAgICAgICAgICAgdmFyIG1vZGUgPSBIRUFQMzJbdmFyYXJncyA+PiAyXTtcbiAgICAgICAgICAgIHBhdGggPSBQb2ludGVyX3N0cmluZ2lmeShwYXRoKTtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgdmFyIHN0cmVhbSA9IEZTLm9wZW4ocGF0aCwgb2ZsYWcsIG1vZGUpO1xuICAgICAgICAgICAgICAgIHJldHVybiBzdHJlYW0uZmQ7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgRlMuaGFuZGxlRlNFcnJvcihlKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gLTE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX2ZvcGVuKGZpbGVuYW1lLCBtb2RlKSB7XG4gICAgICAgICAgICAvLyBGSUxFICpmb3Blbihjb25zdCBjaGFyICpyZXN0cmljdCBmaWxlbmFtZSwgY29uc3QgY2hhciAqcmVzdHJpY3QgbW9kZSk7XG4gICAgICAgICAgICAvLyBodHRwOi8vcHVicy5vcGVuZ3JvdXAub3JnL29ubGluZXB1YnMvMDAwMDk1Mzk5L2Z1bmN0aW9ucy9mb3Blbi5odG1sXG4gICAgICAgICAgICB2YXIgZmxhZ3M7XG4gICAgICAgICAgICBtb2RlID0gUG9pbnRlcl9zdHJpbmdpZnkobW9kZSk7XG4gICAgICAgICAgICBpZiAobW9kZVswXSA9PSAncicpIHtcbiAgICAgICAgICAgICAgICBpZiAobW9kZS5pbmRleE9mKCcrJykgIT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgZmxhZ3MgPSAyO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGZsYWdzID0gMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1vZGVbMF0gPT0gJ3cnKSB7XG4gICAgICAgICAgICAgICAgaWYgKG1vZGUuaW5kZXhPZignKycpICE9IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIGZsYWdzID0gMjtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBmbGFncyA9IDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGZsYWdzIHw9IDY0O1xuICAgICAgICAgICAgICAgIGZsYWdzIHw9IDUxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobW9kZVswXSA9PSAnYScpIHtcbiAgICAgICAgICAgICAgICBpZiAobW9kZS5pbmRleE9mKCcrJykgIT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgZmxhZ3MgPSAyO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGZsYWdzID0gMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZmxhZ3MgfD0gNjQ7XG4gICAgICAgICAgICAgICAgZmxhZ3MgfD0gMTAyNDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgX19fc2V0RXJyTm8oRVJSTk9fQ09ERVMuRUlOVkFMKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciByZXQgPSBfb3BlbihcbiAgICAgICAgICAgICAgICBmaWxlbmFtZSxcbiAgICAgICAgICAgICAgICBmbGFncyxcbiAgICAgICAgICAgICAgICBhbGxvY2F0ZShbMHgxZmYsIDAsIDAsIDBdLCAnaTMyJywgQUxMT0NfU1RBQ0spXG4gICAgICAgICAgICApOyAvLyBBbGwgY3JlYXRpb24gcGVybWlzc2lvbnMuXG4gICAgICAgICAgICByZXR1cm4gcmV0ID09IC0xID8gMCA6IHJldDtcbiAgICAgICAgfVxuICAgICAgICBNb2R1bGVbJ19zdHJsZW4nXSA9IF9zdHJsZW47XG4gICAgICAgIE1vZHVsZVsnX3N0cmNweSddID0gX3N0cmNweTtcbiAgICAgICAgTW9kdWxlWydfc3RyY2F0J10gPSBfc3RyY2F0O1xuICAgICAgICB2YXIgU09DS0ZTID0ge1xuICAgICAgICAgICAgbW91bnQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBGUy5jcmVhdGVOb2RlKG51bGwsICcvJywgMTYzODQgfCAwbzc3NywgMCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY3JlYXRlU29ja2V0OiBmdW5jdGlvbihmYW1pbHksIHR5cGUsIHByb3RvY29sKSB7XG4gICAgICAgICAgICAgICAgdmFyIHN0cmVhbWluZyA9IHR5cGUgPT0gMTtcbiAgICAgICAgICAgICAgICBpZiAocHJvdG9jb2wpIHtcbiAgICAgICAgICAgICAgICAgICAgYXNzZXJ0KHN0cmVhbWluZyA9PSAocHJvdG9jb2wgPT0gNikpOyAvLyBpZiBTT0NLX1NUUkVBTSwgbXVzdCBiZSB0Y3BcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gY3JlYXRlIG91ciBpbnRlcm5hbCBzb2NrZXQgc3RydWN0dXJlXG4gICAgICAgICAgICAgICAgdmFyIHNvY2sgPSB7XG4gICAgICAgICAgICAgICAgICAgIGZhbWlseTogZmFtaWx5LFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiB0eXBlLFxuICAgICAgICAgICAgICAgICAgICBwcm90b2NvbDogcHJvdG9jb2wsXG4gICAgICAgICAgICAgICAgICAgIHNlcnZlcjogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgcGVlcnM6IHt9LFxuICAgICAgICAgICAgICAgICAgICBwZW5kaW5nOiBbXSxcbiAgICAgICAgICAgICAgICAgICAgcmVjdl9xdWV1ZTogW10sXG4gICAgICAgICAgICAgICAgICAgIHNvY2tfb3BzOiBTT0NLRlMud2Vic29ja2V0X3NvY2tfb3BzXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAvLyBjcmVhdGUgdGhlIGZpbGVzeXN0ZW0gbm9kZSB0byBzdG9yZSB0aGUgc29ja2V0IHN0cnVjdHVyZVxuICAgICAgICAgICAgICAgIHZhciBuYW1lID0gU09DS0ZTLm5leHRuYW1lKCk7XG4gICAgICAgICAgICAgICAgdmFyIG5vZGUgPSBGUy5jcmVhdGVOb2RlKFNPQ0tGUy5yb290LCBuYW1lLCA0OTE1MiwgMCk7XG4gICAgICAgICAgICAgICAgbm9kZS5zb2NrID0gc29jaztcbiAgICAgICAgICAgICAgICAvLyBhbmQgdGhlIHdyYXBwaW5nIHN0cmVhbSB0aGF0IGVuYWJsZXMgbGlicmFyeSBmdW5jdGlvbnMgc3VjaFxuICAgICAgICAgICAgICAgIC8vIGFzIHJlYWQgYW5kIHdyaXRlIHRvIGluZGlyZWN0bHkgaW50ZXJhY3Qgd2l0aCB0aGUgc29ja2V0XG4gICAgICAgICAgICAgICAgdmFyIHN0cmVhbSA9IEZTLmNyZWF0ZVN0cmVhbSh7XG4gICAgICAgICAgICAgICAgICAgIHBhdGg6IG5hbWUsXG4gICAgICAgICAgICAgICAgICAgIG5vZGU6IG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIGZsYWdzOiBGUy5tb2RlU3RyaW5nVG9GbGFncygncisnKSxcbiAgICAgICAgICAgICAgICAgICAgc2Vla2FibGU6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICBzdHJlYW1fb3BzOiBTT0NLRlMuc3RyZWFtX29wc1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIC8vIG1hcCB0aGUgbmV3IHN0cmVhbSB0byB0aGUgc29ja2V0IHN0cnVjdHVyZSAoc29ja2V0cyBoYXZlIGEgMToxXG4gICAgICAgICAgICAgICAgLy8gcmVsYXRpb25zaGlwIHdpdGggYSBzdHJlYW0pXG4gICAgICAgICAgICAgICAgc29jay5zdHJlYW0gPSBzdHJlYW07XG4gICAgICAgICAgICAgICAgcmV0dXJuIHNvY2s7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZ2V0U29ja2V0OiBmdW5jdGlvbihmZCkge1xuICAgICAgICAgICAgICAgIHZhciBzdHJlYW0gPSBGUy5nZXRTdHJlYW0oZmQpO1xuICAgICAgICAgICAgICAgIGlmICghc3RyZWFtIHx8ICFGUy5pc1NvY2tldChzdHJlYW0ubm9kZS5tb2RlKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHN0cmVhbS5ub2RlLnNvY2s7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc3RyZWFtX29wczoge1xuICAgICAgICAgICAgICAgIHBvbGw6IGZ1bmN0aW9uKHN0cmVhbSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgc29jayA9IHN0cmVhbS5ub2RlLnNvY2s7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzb2NrLnNvY2tfb3BzLnBvbGwoc29jayk7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBpb2N0bDogZnVuY3Rpb24oc3RyZWFtLCByZXF1ZXN0LCB2YXJhcmdzKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBzb2NrID0gc3RyZWFtLm5vZGUuc29jaztcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNvY2suc29ja19vcHMuaW9jdGwoc29jaywgcmVxdWVzdCwgdmFyYXJncyk7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICByZWFkOiBmdW5jdGlvbihzdHJlYW0sIGJ1ZmZlciwgb2Zmc2V0LCBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNvY2sgPSBzdHJlYW0ubm9kZS5zb2NrO1xuICAgICAgICAgICAgICAgICAgICB2YXIgbXNnID0gc29jay5zb2NrX29wcy5yZWN2bXNnKHNvY2ssIGxlbmd0aCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghbXNnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzb2NrZXQgaXMgY2xvc2VkXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBidWZmZXIuc2V0KG1zZy5idWZmZXIsIG9mZnNldCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtc2cuYnVmZmVyLmxlbmd0aDtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHdyaXRlOiBmdW5jdGlvbihzdHJlYW0sIGJ1ZmZlciwgb2Zmc2V0LCBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNvY2sgPSBzdHJlYW0ubm9kZS5zb2NrO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc29jay5zb2NrX29wcy5zZW5kbXNnKHNvY2ssIGJ1ZmZlciwgb2Zmc2V0LCBsZW5ndGgpO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgY2xvc2U6IGZ1bmN0aW9uKHN0cmVhbSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgc29jayA9IHN0cmVhbS5ub2RlLnNvY2s7XG4gICAgICAgICAgICAgICAgICAgIHNvY2suc29ja19vcHMuY2xvc2Uoc29jayk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG5leHRuYW1lOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBpZiAoIVNPQ0tGUy5uZXh0bmFtZS5jdXJyZW50KSB7XG4gICAgICAgICAgICAgICAgICAgIFNPQ0tGUy5uZXh0bmFtZS5jdXJyZW50ID0gMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuICdzb2NrZXRbJyArIFNPQ0tGUy5uZXh0bmFtZS5jdXJyZW50KysgKyAnXSc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgd2Vic29ja2V0X3NvY2tfb3BzOiB7XG4gICAgICAgICAgICAgICAgY3JlYXRlUGVlcjogZnVuY3Rpb24oc29jaywgYWRkciwgcG9ydCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgd3M7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgYWRkciA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdzID0gYWRkcjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFkZHIgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgcG9ydCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKHdzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBmb3Igc29ja2V0cyB0aGF0J3ZlIGFscmVhZHkgY29ubmVjdGVkIChlLmcuIHdlJ3JlIHRoZSBzZXJ2ZXIpXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB3ZSBjYW4gaW5zcGVjdCB0aGUgX3NvY2tldCBwcm9wZXJ0eSBmb3IgdGhlIGFkZHJlc3NcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh3cy5fc29ja2V0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkciA9IHdzLl9zb2NrZXQucmVtb3RlQWRkcmVzcztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3J0ID0gd3MuX3NvY2tldC5yZW1vdGVQb3J0O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgd2UncmUganVzdCBub3cgaW5pdGlhbGl6aW5nIGEgY29ubmVjdGlvbiB0byB0aGUgcmVtb3RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW5zcGVjdCB0aGUgdXJsIHByb3BlcnR5XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVzdWx0ID0gL3dzW3NdPzpcXC9cXC8oW146XSspOihcXGQrKS8uZXhlYyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3MudXJsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXJlc3VsdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnV2ViU29ja2V0IFVSTCBtdXN0IGJlIGluIHRoZSBmb3JtYXQgd3Mocyk6Ly9hZGRyZXNzOnBvcnQnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZHIgPSByZXN1bHRbMV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9ydCA9IHBhcnNlSW50KHJlc3VsdFsyXSwgMTApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gY3JlYXRlIHRoZSBhY3R1YWwgd2Vic29ja2V0IG9iamVjdCBhbmQgY29ubmVjdFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdXJsID0gJ3dzOi8vJyArIGFkZHIgKyAnOicgKyBwb3J0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBub2RlIHdzIGxpYnJhcnkgQVBJIGlzIHNsaWdodGx5IGRpZmZlcmVudCB0aGFuIHRoZSBicm93c2VyJ3NcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb3B0cyA9IFsnYmluYXJ5J107XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd3MgPSBuZXcgV2ViU29ja2V0KHVybCwgb3B0cyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd3MuYmluYXJ5VHlwZSA9ICdhcnJheWJ1ZmZlcic7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUhPU1RVTlJFQUNIKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB2YXIgcGVlciA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFkZHI6IGFkZHIsXG4gICAgICAgICAgICAgICAgICAgICAgICBwb3J0OiBwb3J0LFxuICAgICAgICAgICAgICAgICAgICAgICAgc29ja2V0OiB3cyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRncmFtX3NlbmRfcXVldWU6IFtdXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIFNPQ0tGUy53ZWJzb2NrZXRfc29ja19vcHMuYWRkUGVlcihzb2NrLCBwZWVyKTtcbiAgICAgICAgICAgICAgICAgICAgU09DS0ZTLndlYnNvY2tldF9zb2NrX29wcy5oYW5kbGVQZWVyRXZlbnRzKHNvY2ssIHBlZXIpO1xuICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGlzIGlzIGEgYm91bmQgZGdyYW0gc29ja2V0LCBzZW5kIHRoZSBwb3J0IG51bWJlciBmaXJzdCB0byBhbGxvd1xuICAgICAgICAgICAgICAgICAgICAvLyB1cyB0byBvdmVycmlkZSB0aGUgZXBoZW1lcmFsIHBvcnQgcmVwb3J0ZWQgdG8gdXMgYnkgcmVtb3RlUG9ydCBvbiB0aGVcbiAgICAgICAgICAgICAgICAgICAgLy8gcmVtb3RlIGVuZC5cbiAgICAgICAgICAgICAgICAgICAgaWYgKHNvY2sudHlwZSA9PT0gMiAmJiB0eXBlb2Ygc29jay5zcG9ydCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBlZXIuZGdyYW1fc2VuZF9xdWV1ZS5wdXNoKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBVaW50OEFycmF5KFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjU1LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI1NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjU1LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAncCcuY2hhckNvZGVBdCgwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ28nLmNoYXJDb2RlQXQoMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdyJy5jaGFyQ29kZUF0KDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAndCcuY2hhckNvZGVBdCgwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHNvY2suc3BvcnQgJiAweGZmMDApID4+IDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvY2suc3BvcnQgJiAweGZmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSlcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBlZXI7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBnZXRQZWVyOiBmdW5jdGlvbihzb2NrLCBhZGRyLCBwb3J0KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzb2NrLnBlZXJzW2FkZHIgKyAnOicgKyBwb3J0XTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIGFkZFBlZXI6IGZ1bmN0aW9uKHNvY2ssIHBlZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgc29jay5wZWVyc1twZWVyLmFkZHIgKyAnOicgKyBwZWVyLnBvcnRdID0gcGVlcjtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHJlbW92ZVBlZXI6IGZ1bmN0aW9uKHNvY2ssIHBlZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHNvY2sucGVlcnNbcGVlci5hZGRyICsgJzonICsgcGVlci5wb3J0XTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIGhhbmRsZVBlZXJFdmVudHM6IGZ1bmN0aW9uKHNvY2ssIHBlZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZpcnN0ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGhhbmRsZU9wZW4gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHF1ZXVlZCA9IHBlZXIuZGdyYW1fc2VuZF9xdWV1ZS5zaGlmdCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChxdWV1ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVlci5zb2NrZXQuc2VuZChxdWV1ZWQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWV1ZWQgPSBwZWVyLmRncmFtX3NlbmRfcXVldWUuc2hpZnQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm90IG11Y2ggd2UgY2FuIGRvIGhlcmUgaW4gdGhlIHdheSBvZiBwcm9wZXIgZXJyb3IgaGFuZGxpbmcgYXMgd2UndmUgYWxyZWFkeVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxpZWQgYW5kIHNhaWQgdGhpcyBkYXRhIHdhcyBzZW50LiBzaHV0IGl0IGRvd24uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVlci5zb2NrZXQuY2xvc2UoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGhhbmRsZU1lc3NhZ2UgPSBmdW5jdGlvbihkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhc3NlcnQoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZW9mIGRhdGEgIT09ICdzdHJpbmcnICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEuYnl0ZUxlbmd0aCAhPT0gdW5kZWZpbmVkXG4gICAgICAgICAgICAgICAgICAgICAgICApOyAvLyBtdXN0IHJlY2VpdmUgYW4gQXJyYXlCdWZmZXJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEgPSBuZXcgVWludDhBcnJheShkYXRhKTsgLy8gbWFrZSBhIHR5cGVkIGFycmF5IHZpZXcgb24gdGhlIGFycmF5IGJ1ZmZlclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGhpcyBpcyB0aGUgcG9ydCBtZXNzYWdlLCBvdmVycmlkZSB0aGUgcGVlcidzIHBvcnQgd2l0aCBpdFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHdhc2ZpcnN0ID0gZmlyc3Q7XG4gICAgICAgICAgICAgICAgICAgICAgICBmaXJzdCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdhc2ZpcnN0ICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5sZW5ndGggPT09IDEwICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVswXSA9PT0gMjU1ICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVsxXSA9PT0gMjU1ICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVsyXSA9PT0gMjU1ICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVszXSA9PT0gMjU1ICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVs0XSA9PT0gJ3AnLmNoYXJDb2RlQXQoMCkgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzVdID09PSAnbycuY2hhckNvZGVBdCgwKSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbNl0gPT09ICdyJy5jaGFyQ29kZUF0KDApICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVs3XSA9PT0gJ3QnLmNoYXJDb2RlQXQoMClcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVwZGF0ZSB0aGUgcGVlcidzIHBvcnQgYW5kIGl0J3Mga2V5IGluIHRoZSBwZWVyIG1hcFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuZXdwb3J0ID0gKGRhdGFbOF0gPDwgOCkgfCBkYXRhWzldO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNPQ0tGUy53ZWJzb2NrZXRfc29ja19vcHMucmVtb3ZlUGVlcihzb2NrLCBwZWVyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZWVyLnBvcnQgPSBuZXdwb3J0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNPQ0tGUy53ZWJzb2NrZXRfc29ja19vcHMuYWRkUGVlcihzb2NrLCBwZWVyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBzb2NrLnJlY3ZfcXVldWUucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkcjogcGVlci5hZGRyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvcnQ6IHBlZXIucG9ydCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiBkYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgcGVlci5zb2NrZXQub25vcGVuID0gaGFuZGxlT3BlbjtcbiAgICAgICAgICAgICAgICAgICAgcGVlci5zb2NrZXQub25tZXNzYWdlID0gZnVuY3Rpb24oZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZU1lc3NhZ2UoZXZlbnQuZGF0YSk7XG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBwb2xsOiBmdW5jdGlvbihzb2NrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzb2NrLnR5cGUgPT09IDEgJiYgc29jay5zZXJ2ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxpc3RlbiBzb2NrZXRzIHNob3VsZCBvbmx5IHNheSB0aGV5J3JlIGF2YWlsYWJsZSBmb3IgcmVhZGluZ1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGhlcmUgYXJlIHBlbmRpbmcgY2xpZW50cy5cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzb2NrLnBlbmRpbmcubGVuZ3RoID8gNjQgfCAxIDogMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB2YXIgbWFzayA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHZhciBkZXN0ID1cbiAgICAgICAgICAgICAgICAgICAgICAgIHNvY2sudHlwZSA9PT0gMSAvLyB3ZSBvbmx5IGNhcmUgYWJvdXQgdGhlIHNvY2tldCBzdGF0ZSBmb3IgY29ubmVjdGlvbi1iYXNlZCBzb2NrZXRzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBTT0NLRlMud2Vic29ja2V0X3NvY2tfb3BzLmdldFBlZXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc29jayxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb2NrLmRhZGRyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvY2suZHBvcnRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIHNvY2sucmVjdl9xdWV1ZS5sZW5ndGggfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICFkZXN0IHx8IC8vIGNvbm5lY3Rpb24tbGVzcyBzb2NrZXRzIGFyZSBhbHdheXMgcmVhZHkgdG8gcmVhZFxuICAgICAgICAgICAgICAgICAgICAgICAgKGRlc3QgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXN0LnNvY2tldC5yZWFkeVN0YXRlID09PSBkZXN0LnNvY2tldC5DTE9TSU5HKSB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgKGRlc3QgJiYgZGVzdC5zb2NrZXQucmVhZHlTdGF0ZSA9PT0gZGVzdC5zb2NrZXQuQ0xPU0VEKVxuICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxldCByZWN2IHJldHVybiAwIG9uY2UgY2xvc2VkXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXNrIHw9IDY0IHwgMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAhZGVzdCB8fCAvLyBjb25uZWN0aW9uLWxlc3Mgc29ja2V0cyBhcmUgYWx3YXlzIHJlYWR5IHRvIHdyaXRlXG4gICAgICAgICAgICAgICAgICAgICAgICAoZGVzdCAmJiBkZXN0LnNvY2tldC5yZWFkeVN0YXRlID09PSBkZXN0LnNvY2tldC5PUEVOKVxuICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hc2sgfD0gNDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAoZGVzdCAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc3Quc29ja2V0LnJlYWR5U3RhdGUgPT09IGRlc3Quc29ja2V0LkNMT1NJTkcpIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAoZGVzdCAmJiBkZXN0LnNvY2tldC5yZWFkeVN0YXRlID09PSBkZXN0LnNvY2tldC5DTE9TRUQpXG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWFzayB8PSAxNjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbWFzaztcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIGlvY3RsOiBmdW5jdGlvbihzb2NrLCByZXF1ZXN0LCBhcmcpIHtcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChyZXF1ZXN0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDIxNTMxOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBieXRlcyA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNvY2sucmVjdl9xdWV1ZS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZXMgPSBzb2NrLnJlY3ZfcXVldWVbMF0uZGF0YS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhFQVAzMlthcmcgPj4gMl0gPSBieXRlcztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk5PX0NPREVTLkVJTlZBTDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgY2xvc2U6IGZ1bmN0aW9uKHNvY2spIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gaWYgd2UndmUgc3Bhd25lZCBhIGxpc3RlbiBzZXJ2ZXIsIGNsb3NlIGl0XG4gICAgICAgICAgICAgICAgICAgIGlmIChzb2NrLnNlcnZlcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb2NrLnNlcnZlci5jbG9zZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cbiAgICAgICAgICAgICAgICAgICAgICAgIHNvY2suc2VydmVyID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBjbG9zZSBhbnkgcGVlciBjb25uZWN0aW9uc1xuICAgICAgICAgICAgICAgICAgICB2YXIgcGVlcnMgPSBPYmplY3Qua2V5cyhzb2NrLnBlZXJzKTtcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBwZWVycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBlZXIgPSBzb2NrLnBlZXJzW3BlZXJzW2ldXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVlci5zb2NrZXQuY2xvc2UoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XG4gICAgICAgICAgICAgICAgICAgICAgICBTT0NLRlMud2Vic29ja2V0X3NvY2tfb3BzLnJlbW92ZVBlZXIoc29jaywgcGVlcik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBiaW5kOiBmdW5jdGlvbihzb2NrLCBhZGRyLCBwb3J0KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVvZiBzb2NrLnNhZGRyICE9PSAndW5kZWZpbmVkJyB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZW9mIHNvY2suc3BvcnQgIT09ICd1bmRlZmluZWQnXG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUlOVkFMKTsgLy8gYWxyZWFkeSBib3VuZFxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHNvY2suc2FkZHIgPSBhZGRyO1xuICAgICAgICAgICAgICAgICAgICBzb2NrLnNwb3J0ID0gcG9ydCB8fCBfbWtwb3J0KCk7XG4gICAgICAgICAgICAgICAgICAgIC8vIGluIG9yZGVyIHRvIGVtdWxhdGUgZGdyYW0gc29ja2V0cywgd2UgbmVlZCB0byBsYXVuY2ggYSBsaXN0ZW4gc2VydmVyIHdoZW5cbiAgICAgICAgICAgICAgICAgICAgLy8gYmluZGluZyBvbiBhIGNvbm5lY3Rpb24tbGVzcyBzb2NrZXRcbiAgICAgICAgICAgICAgICAgICAgLy8gbm90ZTogdGhpcyBpcyBvbmx5IHJlcXVpcmVkIG9uIHRoZSBzZXJ2ZXIgc2lkZVxuICAgICAgICAgICAgICAgICAgICBpZiAoc29jay50eXBlID09PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBjbG9zZSB0aGUgZXhpc3Rpbmcgc2VydmVyIGlmIGl0IGV4aXN0c1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNvY2suc2VydmVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc29jay5zZXJ2ZXIuY2xvc2UoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb2NrLnNlcnZlciA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzd2FsbG93IGVycm9yIG9wZXJhdGlvbiBub3Qgc3VwcG9ydGVkIGVycm9yIHRoYXQgb2NjdXJzIHdoZW4gYmluZGluZyBpbiB0aGVcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGJyb3dzZXIgd2hlcmUgdGhpcyBpc24ndCBzdXBwb3J0ZWRcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc29jay5zb2NrX29wcy5saXN0ZW4oc29jaywgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEoZSBpbnN0YW5jZW9mIEZTLkVycm5vRXJyb3IpKSB0aHJvdyBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmVycm5vICE9PSBFUlJOT19DT0RFUy5FT1BOT1RTVVBQKSB0aHJvdyBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBjb25uZWN0OiBmdW5jdGlvbihzb2NrLCBhZGRyLCBwb3J0KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzb2NrLnNlcnZlcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09EUy5FT1BOT1RTVVBQKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBUT0RPIGF1dG9iaW5kXG4gICAgICAgICAgICAgICAgICAgIC8vIGlmICghc29jay5hZGRyICYmIHNvY2sudHlwZSA9PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIH1cbiAgICAgICAgICAgICAgICAgICAgLy8gZWFybHkgb3V0IGlmIHdlJ3JlIGFscmVhZHkgY29ubmVjdGVkIC8gaW4gdGhlIG1pZGRsZSBvZiBjb25uZWN0aW5nXG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVvZiBzb2NrLmRhZGRyICE9PSAndW5kZWZpbmVkJyAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZW9mIHNvY2suZHBvcnQgIT09ICd1bmRlZmluZWQnXG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRlc3QgPSBTT0NLRlMud2Vic29ja2V0X3NvY2tfb3BzLmdldFBlZXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc29jayxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb2NrLmRhZGRyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvY2suZHBvcnRcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGVzdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdC5zb2NrZXQucmVhZHlTdGF0ZSA9PT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdC5zb2NrZXQuQ09OTkVDVElOR1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FQUxSRUFEWSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUlTQ09OTik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIC8vIGFkZCB0aGUgc29ja2V0IHRvIG91ciBwZWVyIGxpc3QgYW5kIHNldCBvdXJcbiAgICAgICAgICAgICAgICAgICAgLy8gZGVzdGluYXRpb24gYWRkcmVzcyAvIHBvcnQgdG8gbWF0Y2hcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBlZXIgPSBTT0NLRlMud2Vic29ja2V0X3NvY2tfb3BzLmNyZWF0ZVBlZXIoXG4gICAgICAgICAgICAgICAgICAgICAgICBzb2NrLFxuICAgICAgICAgICAgICAgICAgICAgICAgYWRkcixcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvcnRcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgc29jay5kYWRkciA9IHBlZXIuYWRkcjtcbiAgICAgICAgICAgICAgICAgICAgc29jay5kcG9ydCA9IHBlZXIucG9ydDtcbiAgICAgICAgICAgICAgICAgICAgLy8gYWx3YXlzIFwiZmFpbFwiIGluIG5vbi1ibG9ja2luZyBtb2RlXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlBST0dSRVNTKTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIGxpc3RlbjogZnVuY3Rpb24oc29jaykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoc29jay5zZXJ2ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlZBTCk7IC8vIGFscmVhZHkgbGlzdGVuaW5nXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdmFyIFdlYlNvY2tldFNlcnZlciA9IHJlcXVpcmUoJ3dzJykuU2VydmVyO1xuICAgICAgICAgICAgICAgICAgICB2YXIgaG9zdCA9IHNvY2suc2FkZHI7XG4gICAgICAgICAgICAgICAgICAgIHNvY2suc2VydmVyID0gbmV3IFdlYlNvY2tldFNlcnZlcih7XG4gICAgICAgICAgICAgICAgICAgICAgICBob3N0OiBob3N0LFxuICAgICAgICAgICAgICAgICAgICAgICAgcG9ydDogc29jay5zcG9ydFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgc29jay5zZXJ2ZXIub24oJ2Nvbm5lY3Rpb24nLCBmdW5jdGlvbih3cykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNvY2sudHlwZSA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuZXdzb2NrID0gU09DS0ZTLmNyZWF0ZVNvY2tldChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc29jay5mYW1pbHksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvY2sudHlwZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc29jay5wcm90b2NvbFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY3JlYXRlIGEgcGVlciBvbiB0aGUgbmV3IHNvY2tldFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwZWVyID0gU09DS0ZTLndlYnNvY2tldF9zb2NrX29wcy5jcmVhdGVQZWVyKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdzb2NrLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3c29jay5kYWRkciA9IHBlZXIuYWRkcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdzb2NrLmRwb3J0ID0gcGVlci5wb3J0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHB1c2ggdG8gcXVldWUgZm9yIGFjY2VwdCB0byBwaWNrIHVwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc29jay5wZW5kaW5nLnB1c2gobmV3c29jayk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNyZWF0ZSBhIHBlZXIgb24gdGhlIGxpc3RlbiBzb2NrZXQgc28gY2FsbGluZyBzZW5kdG9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3aXRoIHRoZSBsaXN0ZW4gc29ja2V0IGFuZCBhbiBhZGRyZXNzIHdpbGwgcmVzb2x2ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRvIHRoZSBjb3JyZWN0IGNsaWVudFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNPQ0tGUy53ZWJzb2NrZXRfc29ja19vcHMuY3JlYXRlUGVlcihzb2NrLCB3cyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBzb2NrLnNlcnZlci5vbignY2xvc2VkJywgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzb2NrLnNlcnZlciA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBzb2NrLnNlcnZlci5vbignZXJyb3InLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRvbid0IHRocm93XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgYWNjZXB0OiBmdW5jdGlvbihsaXN0ZW5zb2NrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghbGlzdGVuc29jay5zZXJ2ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVJTlZBTCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdmFyIG5ld3NvY2sgPSBsaXN0ZW5zb2NrLnBlbmRpbmcuc2hpZnQoKTtcbiAgICAgICAgICAgICAgICAgICAgbmV3c29jay5zdHJlYW0uZmxhZ3MgPSBsaXN0ZW5zb2NrLnN0cmVhbS5mbGFncztcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ld3NvY2s7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBnZXRuYW1lOiBmdW5jdGlvbihzb2NrLCBwZWVyKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBhZGRyLCBwb3J0O1xuICAgICAgICAgICAgICAgICAgICBpZiAocGVlcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvY2suZGFkZHIgPT09IHVuZGVmaW5lZCB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvY2suZHBvcnQgPT09IHVuZGVmaW5lZFxuICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRU5PVENPTk4pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYWRkciA9IHNvY2suZGFkZHI7XG4gICAgICAgICAgICAgICAgICAgICAgICBwb3J0ID0gc29jay5kcG9ydDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPRE8gc2FkZHIgYW5kIHNwb3J0IHdpbGwgYmUgc2V0IGZvciBiaW5kKCknZCBVRFAgc29ja2V0cywgYnV0IHdoYXRcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNob3VsZCB3ZSBiZSByZXR1cm5pbmcgZm9yIFRDUCBzb2NrZXRzIHRoYXQndmUgYmVlbiBjb25uZWN0KCknZD9cbiAgICAgICAgICAgICAgICAgICAgICAgIGFkZHIgPSBzb2NrLnNhZGRyIHx8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBwb3J0ID0gc29jay5zcG9ydCB8fCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7IGFkZHI6IGFkZHIsIHBvcnQ6IHBvcnQgfTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHNlbmRtc2c6IGZ1bmN0aW9uKHNvY2ssIGJ1ZmZlciwgb2Zmc2V0LCBsZW5ndGgsIGFkZHIsIHBvcnQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNvY2sudHlwZSA9PT0gMikge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29ubmVjdGlvbi1sZXNzIHNvY2tldHMgd2lsbCBob25vciB0aGUgbWVzc2FnZSBhZGRyZXNzLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYW5kIG90aGVyd2lzZSBmYWxsIGJhY2sgdG8gdGhlIGJvdW5kIGRlc3RpbmF0aW9uIGFkZHJlc3NcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhZGRyID09PSB1bmRlZmluZWQgfHwgcG9ydCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkciA9IHNvY2suZGFkZHI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9ydCA9IHNvY2suZHBvcnQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGVyZSB3YXMgbm8gYWRkcmVzcyB0byBmYWxsIGJhY2sgdG8sIGVycm9yIG91dFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFkZHIgPT09IHVuZGVmaW5lZCB8fCBwb3J0ID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FREVTVEFERFJSRVEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29ubmVjdGlvbi1iYXNlZCBzb2NrZXRzIHdpbGwgb25seSB1c2UgdGhlIGJvdW5kXG4gICAgICAgICAgICAgICAgICAgICAgICBhZGRyID0gc29jay5kYWRkcjtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvcnQgPSBzb2NrLmRwb3J0O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIC8vIGZpbmQgdGhlIHBlZXIgZm9yIHRoZSBkZXN0aW5hdGlvbiBhZGRyZXNzXG4gICAgICAgICAgICAgICAgICAgIHZhciBkZXN0ID0gU09DS0ZTLndlYnNvY2tldF9zb2NrX29wcy5nZXRQZWVyKFxuICAgICAgICAgICAgICAgICAgICAgICAgc29jayxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFkZHIsXG4gICAgICAgICAgICAgICAgICAgICAgICBwb3J0XG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIC8vIGVhcmx5IG91dCBpZiBub3QgY29ubmVjdGVkIHdpdGggYSBjb25uZWN0aW9uLWJhc2VkIHNvY2tldFxuICAgICAgICAgICAgICAgICAgICBpZiAoc29jay50eXBlID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIWRlc3QgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXN0LnNvY2tldC5yZWFkeVN0YXRlID09PSBkZXN0LnNvY2tldC5DTE9TSU5HIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdC5zb2NrZXQucmVhZHlTdGF0ZSA9PT0gZGVzdC5zb2NrZXQuQ0xPU0VEXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FTk9UQ09OTik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc3Quc29ja2V0LnJlYWR5U3RhdGUgPT09IGRlc3Quc29ja2V0LkNPTk5FQ1RJTkdcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVBR0FJTik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgLy8gY3JlYXRlIGEgY29weSBvZiB0aGUgaW5jb21pbmcgZGF0YSB0byBzZW5kLCBhcyB0aGUgV2ViU29ja2V0IEFQSVxuICAgICAgICAgICAgICAgICAgICAvLyBkb2Vzbid0IHdvcmsgZW50aXJlbHkgd2l0aCBhbiBBcnJheUJ1ZmZlclZpZXcsIGl0J2xsIGp1c3Qgc2VuZFxuICAgICAgICAgICAgICAgICAgICAvLyB0aGUgZW50aXJlIHVuZGVybHlpbmcgYnVmZmVyXG4gICAgICAgICAgICAgICAgICAgIHZhciBkYXRhO1xuICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICBidWZmZXIgaW5zdGFuY2VvZiBBcnJheSB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyIGluc3RhbmNlb2YgQXJyYXlCdWZmZXJcbiAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhID0gYnVmZmVyLnNsaWNlKG9mZnNldCwgb2Zmc2V0ICsgbGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIEFycmF5QnVmZmVyVmlld1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSA9IGJ1ZmZlci5idWZmZXIuc2xpY2UoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLmJ5dGVPZmZzZXQgKyBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLmJ5dGVPZmZzZXQgKyBvZmZzZXQgKyBsZW5ndGhcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgLy8gaWYgd2UncmUgZW11bGF0aW5nIGEgY29ubmVjdGlvbi1sZXNzIGRncmFtIHNvY2tldCBhbmQgZG9uJ3QgaGF2ZVxuICAgICAgICAgICAgICAgICAgICAvLyBhIGNhY2hlZCBjb25uZWN0aW9uLCBxdWV1ZSB0aGUgYnVmZmVyIHRvIHNlbmQgdXBvbiBjb25uZWN0IGFuZFxuICAgICAgICAgICAgICAgICAgICAvLyBsaWUsIHNheWluZyB0aGUgZGF0YSB3YXMgc2VudCBub3cuXG4gICAgICAgICAgICAgICAgICAgIGlmIChzb2NrLnR5cGUgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAhZGVzdCB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc3Quc29ja2V0LnJlYWR5U3RhdGUgIT09IGRlc3Quc29ja2V0Lk9QRU5cbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlmIHdlJ3JlIG5vdCBjb25uZWN0ZWQsIG9wZW4gYSBuZXcgY29ubmVjdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIWRlc3QgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdC5zb2NrZXQucmVhZHlTdGF0ZSA9PT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc3Quc29ja2V0LkNMT1NJTkcgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdC5zb2NrZXQucmVhZHlTdGF0ZSA9PT0gZGVzdC5zb2NrZXQuQ0xPU0VEXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc3QgPSBTT0NLRlMud2Vic29ja2V0X3NvY2tfb3BzLmNyZWF0ZVBlZXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb2NrLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkcixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvcnRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdC5kZ3JhbV9zZW5kX3F1ZXVlLnB1c2goZGF0YSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2VuZCB0aGUgYWN0dWFsIGRhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc3Quc29ja2V0LnNlbmQoZGF0YSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FSU5WQUwpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICByZWN2bXNnOiBmdW5jdGlvbihzb2NrLCBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gaHR0cDovL3B1YnMub3Blbmdyb3VwLm9yZy9vbmxpbmVwdWJzLzc5MDg3OTkveG5zL3JlY3Ztc2cuaHRtbFxuICAgICAgICAgICAgICAgICAgICBpZiAoc29jay50eXBlID09PSAxICYmIHNvY2suc2VydmVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB0Y3Agc2VydmVycyBzaG91bGQgbm90IGJlIHJlY3YoKSdpbmcgb24gdGhlIGxpc3RlbiBzb2NrZXRcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBGUy5FcnJub0Vycm9yKEVSUk5PX0NPREVTLkVOT1RDT05OKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB2YXIgcXVldWVkID0gc29jay5yZWN2X3F1ZXVlLnNoaWZ0KCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcXVldWVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc29jay50eXBlID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRlc3QgPSBTT0NLRlMud2Vic29ja2V0X3NvY2tfb3BzLmdldFBlZXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvY2ssXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvY2suZGFkZHIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvY2suZHBvcnRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZGVzdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiB3ZSBoYXZlIGEgZGVzdGluYXRpb24gYWRkcmVzcyBidXQgYXJlIG5vdCBjb25uZWN0ZWQsIGVycm9yIG91dFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FTk9UQ09OTik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdC5zb2NrZXQucmVhZHlTdGF0ZSA9PT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc3Quc29ja2V0LkNMT1NJTkcgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdC5zb2NrZXQucmVhZHlTdGF0ZSA9PT0gZGVzdC5zb2NrZXQuQ0xPU0VEXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJldHVybiBudWxsIGlmIHRoZSBzb2NrZXQgaGFzIGNsb3NlZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBlbHNlLCBvdXIgc29ja2V0IGlzIGluIGEgdmFsaWQgc3RhdGUgYnV0IHRydWx5IGhhcyBub3RoaW5nIGF2YWlsYWJsZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRlMuRXJybm9FcnJvcihFUlJOT19DT0RFUy5FQUdBSU4pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEZTLkVycm5vRXJyb3IoRVJSTk9fQ09ERVMuRUFHQUlOKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBxdWV1ZWQuZGF0YSB3aWxsIGJlIGFuIEFycmF5QnVmZmVyIGlmIGl0J3MgdW5hZHVsdGVyYXRlZCwgYnV0IGlmIGl0J3NcbiAgICAgICAgICAgICAgICAgICAgLy8gcmVxdWV1ZWQgVENQIGRhdGEgaXQnbGwgYmUgYW4gQXJyYXlCdWZmZXJWaWV3XG4gICAgICAgICAgICAgICAgICAgIHZhciBxdWV1ZWRMZW5ndGggPVxuICAgICAgICAgICAgICAgICAgICAgICAgcXVldWVkLmRhdGEuYnl0ZUxlbmd0aCB8fCBxdWV1ZWQuZGF0YS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgIHZhciBxdWV1ZWRPZmZzZXQgPSBxdWV1ZWQuZGF0YS5ieXRlT2Zmc2V0IHx8IDA7XG4gICAgICAgICAgICAgICAgICAgIHZhciBxdWV1ZWRCdWZmZXIgPSBxdWV1ZWQuZGF0YS5idWZmZXIgfHwgcXVldWVkLmRhdGE7XG4gICAgICAgICAgICAgICAgICAgIHZhciBieXRlc1JlYWQgPSBNYXRoLm1pbihsZW5ndGgsIHF1ZXVlZExlbmd0aCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBidWZmZXI6IG5ldyBVaW50OEFycmF5KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1ZXVlZEJ1ZmZlcixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWV1ZWRPZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZXNSZWFkXG4gICAgICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgICAgICAgYWRkcjogcXVldWVkLmFkZHIsXG4gICAgICAgICAgICAgICAgICAgICAgICBwb3J0OiBxdWV1ZWQucG9ydFxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAvLyBwdXNoIGJhY2sgYW55IHVucmVhZCBkYXRhIGZvciBUQ1AgY29ubmVjdGlvbnNcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNvY2sudHlwZSA9PT0gMSAmJiBieXRlc1JlYWQgPCBxdWV1ZWRMZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBieXRlc1JlbWFpbmluZyA9IHF1ZXVlZExlbmd0aCAtIGJ5dGVzUmVhZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHF1ZXVlZC5kYXRhID0gbmV3IFVpbnQ4QXJyYXkoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVldWVkQnVmZmVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1ZXVlZE9mZnNldCArIGJ5dGVzUmVhZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlc1JlbWFpbmluZ1xuICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNvY2sucmVjdl9xdWV1ZS51bnNoaWZ0KHF1ZXVlZCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlcztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIGZ1bmN0aW9uIF9zZW5kKGZkLCBidWYsIGxlbiwgZmxhZ3MpIHtcbiAgICAgICAgICAgIHZhciBzb2NrID0gU09DS0ZTLmdldFNvY2tldChmZCk7XG4gICAgICAgICAgICBpZiAoIXNvY2spIHtcbiAgICAgICAgICAgICAgICBfX19zZXRFcnJObyhFUlJOT19DT0RFUy5FQkFERik7XG4gICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gVE9ETyBob25vciBmbGFnc1xuICAgICAgICAgICAgcmV0dXJuIF93cml0ZShmZCwgYnVmLCBsZW4pO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIF9wd3JpdGUoZmlsZGVzLCBidWYsIG5ieXRlLCBvZmZzZXQpIHtcbiAgICAgICAgICAgIC8vIHNzaXplX3QgcHdyaXRlKGludCBmaWxkZXMsIGNvbnN0IHZvaWQgKmJ1Ziwgc2l6ZV90IG5ieXRlLCBvZmZfdCBvZmZzZXQpO1xuICAgICAgICAgICAgLy8gaHR0cDovL3B1YnMub3Blbmdyb3VwLm9yZy9vbmxpbmVwdWJzLzAwMDA5NTM5OS9mdW5jdGlvbnMvd3JpdGUuaHRtbFxuICAgICAgICAgICAgdmFyIHN0cmVhbSA9IEZTLmdldFN0cmVhbShmaWxkZXMpO1xuICAgICAgICAgICAgaWYgKCFzdHJlYW0pIHtcbiAgICAgICAgICAgICAgICBfX19zZXRFcnJObyhFUlJOT19DT0RFUy5FQkFERik7XG4gICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICB2YXIgc2xhYiA9IEhFQVA4O1xuICAgICAgICAgICAgICAgIHJldHVybiBGUy53cml0ZShzdHJlYW0sIHNsYWIsIGJ1ZiwgbmJ5dGUsIG9mZnNldCk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgRlMuaGFuZGxlRlNFcnJvcihlKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gLTE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX3dyaXRlKGZpbGRlcywgYnVmLCBuYnl0ZSkge1xuICAgICAgICAgICAgLy8gc3NpemVfdCB3cml0ZShpbnQgZmlsZGVzLCBjb25zdCB2b2lkICpidWYsIHNpemVfdCBuYnl0ZSk7XG4gICAgICAgICAgICAvLyBodHRwOi8vcHVicy5vcGVuZ3JvdXAub3JnL29ubGluZXB1YnMvMDAwMDk1Mzk5L2Z1bmN0aW9ucy93cml0ZS5odG1sXG4gICAgICAgICAgICB2YXIgc3RyZWFtID0gRlMuZ2V0U3RyZWFtKGZpbGRlcyk7XG4gICAgICAgICAgICBpZiAoIXN0cmVhbSkge1xuICAgICAgICAgICAgICAgIF9fX3NldEVyck5vKEVSUk5PX0NPREVTLkVCQURGKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gLTE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHZhciBzbGFiID0gSEVBUDg7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEZTLndyaXRlKHN0cmVhbSwgc2xhYiwgYnVmLCBuYnl0ZSk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgRlMuaGFuZGxlRlNFcnJvcihlKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gLTE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX2Z3cml0ZShwdHIsIHNpemUsIG5pdGVtcywgc3RyZWFtKSB7XG4gICAgICAgICAgICAvLyBzaXplX3QgZndyaXRlKGNvbnN0IHZvaWQgKnJlc3RyaWN0IHB0ciwgc2l6ZV90IHNpemUsIHNpemVfdCBuaXRlbXMsIEZJTEUgKnJlc3RyaWN0IHN0cmVhbSk7XG4gICAgICAgICAgICAvLyBodHRwOi8vcHVicy5vcGVuZ3JvdXAub3JnL29ubGluZXB1YnMvMDAwMDk1Mzk5L2Z1bmN0aW9ucy9md3JpdGUuaHRtbFxuICAgICAgICAgICAgdmFyIGJ5dGVzVG9Xcml0ZSA9IG5pdGVtcyAqIHNpemU7XG4gICAgICAgICAgICBpZiAoYnl0ZXNUb1dyaXRlID09IDApIHJldHVybiAwO1xuICAgICAgICAgICAgdmFyIGJ5dGVzV3JpdHRlbiA9IF93cml0ZShzdHJlYW0sIHB0ciwgYnl0ZXNUb1dyaXRlKTtcbiAgICAgICAgICAgIGlmIChieXRlc1dyaXR0ZW4gPT0gLTEpIHtcbiAgICAgICAgICAgICAgICB2YXIgc3RyZWFtT2JqID0gRlMuZ2V0U3RyZWFtKHN0cmVhbSk7XG4gICAgICAgICAgICAgICAgaWYgKHN0cmVhbU9iaikgc3RyZWFtT2JqLmVycm9yID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIE1hdGguZmxvb3IoYnl0ZXNXcml0dGVuIC8gc2l6ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX19yZWFsbHlOZWdhdGl2ZSh4KSB7XG4gICAgICAgICAgICByZXR1cm4geCA8IDAgfHwgKHggPT09IDAgJiYgMSAvIHggPT09IC1JbmZpbml0eSk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX19mb3JtYXRTdHJpbmcoZm9ybWF0LCB2YXJhcmdzKSB7XG4gICAgICAgICAgICB2YXIgdGV4dEluZGV4ID0gZm9ybWF0O1xuICAgICAgICAgICAgdmFyIGFyZ0luZGV4ID0gMDtcbiAgICAgICAgICAgIGZ1bmN0aW9uIGdldE5leHRBcmcodHlwZSkge1xuICAgICAgICAgICAgICAgIC8vIE5PVEU6IEV4cGxpY2l0bHkgaWdub3JpbmcgdHlwZSBzYWZldHkuIE90aGVyd2lzZSB0aGlzIGZhaWxzOlxuICAgICAgICAgICAgICAgIC8vICAgICAgIGludCB4ID0gNDsgcHJpbnRmKFwiJWNcXG5cIiwgKGNoYXIpeCk7XG4gICAgICAgICAgICAgICAgdmFyIHJldDtcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gJ2RvdWJsZScpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0ID0gSEVBUEY2NFsodmFyYXJncyArIGFyZ0luZGV4KSA+PiAzXTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gJ2k2NCcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0ID0gW1xuICAgICAgICAgICAgICAgICAgICAgICAgSEVBUDMyWyh2YXJhcmdzICsgYXJnSW5kZXgpID4+IDJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgSEVBUDMyWyh2YXJhcmdzICsgKGFyZ0luZGV4ICsgOCkpID4+IDJdXG4gICAgICAgICAgICAgICAgICAgIF07XG4gICAgICAgICAgICAgICAgICAgIGFyZ0luZGV4ICs9IDg7IC8vIGVhY2ggMzItYml0IGNodW5rIGlzIGluIGEgNjQtYml0IGJsb2NrXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZSA9ICdpMzInOyAvLyB2YXJhcmdzIGFyZSBhbHdheXMgaTMyLCBpNjQsIG9yIGRvdWJsZVxuICAgICAgICAgICAgICAgICAgICByZXQgPSBIRUFQMzJbKHZhcmFyZ3MgKyBhcmdJbmRleCkgPj4gMl07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGFyZ0luZGV4ICs9IE1hdGgubWF4KFxuICAgICAgICAgICAgICAgICAgICBSdW50aW1lLmdldE5hdGl2ZUZpZWxkU2l6ZSh0eXBlKSxcbiAgICAgICAgICAgICAgICAgICAgUnVudGltZS5nZXRBbGlnblNpemUodHlwZSwgbnVsbCwgdHJ1ZSlcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgcmV0ID0gW107XG4gICAgICAgICAgICB2YXIgY3VyciwgbmV4dCwgY3VyckFyZztcbiAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgdmFyIHN0YXJ0VGV4dEluZGV4ID0gdGV4dEluZGV4O1xuICAgICAgICAgICAgICAgIGN1cnIgPSBIRUFQOFt0ZXh0SW5kZXhdO1xuICAgICAgICAgICAgICAgIGlmIChjdXJyID09PSAwKSBicmVhaztcbiAgICAgICAgICAgICAgICBuZXh0ID0gSEVBUDhbKHRleHRJbmRleCArIDEpIHwgMF07XG4gICAgICAgICAgICAgICAgaWYgKGN1cnIgPT0gMzcpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gSGFuZGxlIGZsYWdzLlxuICAgICAgICAgICAgICAgICAgICB2YXIgZmxhZ0Fsd2F5c1NpZ25lZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZmxhZ0xlZnRBbGlnbiA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZmxhZ0FsdGVybmF0aXZlID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIHZhciBmbGFnWmVyb1BhZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZmxhZ1BhZFNpZ24gPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgZmxhZ3NMb29wOiB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChuZXh0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA0MzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ0Fsd2F5c1NpZ25lZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNDU6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdMZWZ0QWxpZ24gPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDM1OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGFnQWx0ZXJuYXRpdmUgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDQ4OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmxhZ1plcm9QYWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIGZsYWdzTG9vcDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdaZXJvUGFkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAzMjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ1BhZFNpZ24gPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBmbGFnc0xvb3A7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQgPSBIRUFQOFsodGV4dEluZGV4ICsgMSkgfCAwXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBIYW5kbGUgd2lkdGguXG4gICAgICAgICAgICAgICAgICAgIHZhciB3aWR0aCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmIChuZXh0ID09IDQyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3aWR0aCA9IGdldE5leHRBcmcoJ2kzMicpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID0gSEVBUDhbKHRleHRJbmRleCArIDEpIHwgMF07XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAobmV4dCA+PSA0OCAmJiBuZXh0IDw9IDU3KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGggPSB3aWR0aCAqIDEwICsgKG5leHQgLSA0OCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV4dCA9IEhFQVA4Wyh0ZXh0SW5kZXggKyAxKSB8IDBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIC8vIEhhbmRsZSBwcmVjaXNpb24uXG4gICAgICAgICAgICAgICAgICAgIHZhciBwcmVjaXNpb25TZXQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG5leHQgPT0gNDYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwcmVjaXNpb24gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uU2V0ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRJbmRleCsrO1xuICAgICAgICAgICAgICAgICAgICAgICAgbmV4dCA9IEhFQVA4Wyh0ZXh0SW5kZXggKyAxKSB8IDBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5leHQgPT0gNDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVjaXNpb24gPSBnZXROZXh0QXJnKCdpMzInKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHByZWNpc2lvbkNociA9IEhFQVA4Wyh0ZXh0SW5kZXggKyAxKSB8IDBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocHJlY2lzaW9uQ2hyIDwgNDggfHwgcHJlY2lzaW9uQ2hyID4gNTcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWNpc2lvbiAqIDEwICsgKHByZWNpc2lvbkNociAtIDQ4KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgbmV4dCA9IEhFQVA4Wyh0ZXh0SW5kZXggKyAxKSB8IDBdO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHByZWNpc2lvbiA9IDY7IC8vIFN0YW5kYXJkIGRlZmF1bHQuXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgLy8gSGFuZGxlIGludGVnZXIgc2l6ZXMuIFdBUk5JTkc6IFRoZXNlIGFzc3VtZSBhIDMyLWJpdCBhcmNoaXRlY3R1cmUhXG4gICAgICAgICAgICAgICAgICAgIHZhciBhcmdTaXplO1xuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKFN0cmluZy5mcm9tQ2hhckNvZGUobmV4dCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2gnOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuZXh0TmV4dCA9IEhFQVA4Wyh0ZXh0SW5kZXggKyAyKSB8IDBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXh0TmV4dCA9PSAxMDQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1NpemUgPSAxOyAvLyBjaGFyIChhY3R1YWxseSBpMzIgaW4gdmFyYXJncylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdTaXplID0gMjsgLy8gc2hvcnQgKGFjdHVhbGx5IGkzMiBpbiB2YXJhcmdzKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2wnOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuZXh0TmV4dCA9IEhFQVA4Wyh0ZXh0SW5kZXggKyAyKSB8IDBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXh0TmV4dCA9PSAxMDgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1NpemUgPSA4OyAvLyBsb25nIGxvbmdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdTaXplID0gNDsgLy8gbG9uZ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ0wnOiAvLyBsb25nIGxvbmdcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3EnOiAvLyBpbnQ2NF90XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdqJzogLy8gaW50bWF4X3RcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdTaXplID0gODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3onOiAvLyBzaXplX3RcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3QnOiAvLyBwdHJkaWZmX3RcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ0knOiAvLyBzaWduZWQgcHRyZGlmZl90IG9yIHVuc2lnbmVkIHNpemVfdFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1NpemUgPSA0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdTaXplID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoYXJnU2l6ZSkgdGV4dEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgIG5leHQgPSBIRUFQOFsodGV4dEluZGV4ICsgMSkgfCAwXTtcbiAgICAgICAgICAgICAgICAgICAgLy8gSGFuZGxlIHR5cGUgc3BlY2lmaWVyLlxuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKFN0cmluZy5mcm9tQ2hhckNvZGUobmV4dCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnaSc6XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICd1JzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ28nOlxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAneCc6XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdYJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3AnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSW50ZWdlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2lnbmVkID0gbmV4dCA9PSAxMDAgfHwgbmV4dCA9PSAxMDU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnU2l6ZSA9IGFyZ1NpemUgfHwgNDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY3VyckFyZyA9IGdldE5leHRBcmcoJ2knICsgYXJnU2l6ZSAqIDgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvcmlnQXJnID0gY3VyckFyZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXJnVGV4dDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBGbGF0dGVuIGk2NC0xIFtsb3csIGhpZ2hdIGludG8gYSAoc2xpZ2h0bHkgcm91bmRlZCkgZG91YmxlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFyZ1NpemUgPT0gOCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyQXJnID0gUnVudGltZS5tYWtlQmlnSW50KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VyckFyZ1swXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJBcmdbMV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID09IDExN1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUcnVuY2F0ZSB0byByZXF1ZXN0ZWQgc2l6ZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXJnU2l6ZSA8PSA0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW1pdCA9IE1hdGgucG93KDI1NiwgYXJnU2l6ZSkgLSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyQXJnID0gKHNpZ25lZCA/IHJlU2lnbiA6IHVuU2lnbikoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyQXJnICYgbGltaXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdTaXplICogOFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBGb3JtYXQgdGhlIG51bWJlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY3VyckFic0FyZyA9IE1hdGguYWJzKGN1cnJBcmcpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwcmVmaXggPSAnJztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV4dCA9PSAxMDAgfHwgbmV4dCA9PSAxMDUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFyZ1NpemUgPT0gOCAmJiBpNjRNYXRoKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCA9IGk2NE1hdGguc3RyaW5naWZ5KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9yaWdBcmdbMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3JpZ0FyZ1sxXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gcmVTaWduKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJBcmcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCAqIGFyZ1NpemUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKS50b1N0cmluZygxMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChuZXh0ID09IDExNykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXJnU2l6ZSA9PSA4ICYmIGk2NE1hdGgpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gaTY0TWF0aC5zdHJpbmdpZnkoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3JpZ0FyZ1swXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcmlnQXJnWzFdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRydWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQgPSB1blNpZ24oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VyckFyZyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4ICogYXJnU2l6ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApLnRvU3RyaW5nKDEwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VyckFyZyA9IE1hdGguYWJzKGN1cnJBcmcpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobmV4dCA9PSAxMTEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZmxhZ0FsdGVybmF0aXZlID8gJzAnIDogJycpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJBYnNBcmcudG9TdHJpbmcoOCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChuZXh0ID09IDEyMCB8fCBuZXh0ID09IDg4KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWZpeCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGFnQWx0ZXJuYXRpdmUgJiYgY3VyckFyZyAhPSAwID8gJzB4JyA6ICcnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXJnU2l6ZSA9PSA4ICYmIGk2NE1hdGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcmlnQXJnWzFdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCA9IChvcmlnQXJnWzFdID4+PiAwKS50b1N0cmluZyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsb3dlciA9IChvcmlnQXJnWzBdID4+PiAwKS50b1N0cmluZyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChsb3dlci5sZW5ndGggPCA4KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb3dlciA9ICcwJyArIGxvd2VyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQgKz0gbG93ZXI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQgPSAob3JpZ0FyZ1swXSA+Pj4gMCkudG9TdHJpbmcoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjdXJyQXJnIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gUmVwcmVzZW50IG5lZ2F0aXZlIG51bWJlcnMgaW4gaGV4IGFzIDIncyBjb21wbGVtZW50LlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VyckFyZyA9IC1jdXJyQXJnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCA9IChjdXJyQWJzQXJnIC0gMSkudG9TdHJpbmcoMTYpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGJ1ZmZlciA9IFtdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhcmdUZXh0Lmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLnB1c2goXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4ZiAtIHBhcnNlSW50KGFyZ1RleHRbaV0sIDE2KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApLnRvU3RyaW5nKDE2KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gYnVmZmVyLmpvaW4oJycpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGFyZ1RleHQubGVuZ3RoIDwgYXJnU2l6ZSAqIDIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCA9ICdmJyArIGFyZ1RleHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gY3VyckFic0FyZy50b1N0cmluZygxNik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5leHQgPT0gODgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWZpeCA9IHByZWZpeC50b1VwcGVyQ2FzZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCA9IGFyZ1RleHQudG9VcHBlckNhc2UoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobmV4dCA9PSAxMTIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJBYnNBcmcgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQgPSAnKG5pbCknO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZml4ID0gJzB4JztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQgPSBjdXJyQWJzQXJnLnRvU3RyaW5nKDE2KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocHJlY2lzaW9uU2V0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChhcmdUZXh0Lmxlbmd0aCA8IHByZWNpc2lvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCA9ICcwJyArIGFyZ1RleHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWRkIHNpZ24gaWYgbmVlZGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJBcmcgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmxhZ0Fsd2F5c1NpZ25lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZml4ID0gJysnICsgcHJlZml4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGZsYWdQYWRTaWduKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVmaXggPSAnICcgKyBwcmVmaXg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTW92ZSBzaWduIHRvIHByZWZpeCBzbyB3ZSB6ZXJvLXBhZCBhZnRlciB0aGUgc2lnblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcmdUZXh0LmNoYXJBdCgwKSA9PSAnLScpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZml4ID0gJy0nICsgcHJlZml4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gYXJnVGV4dC5zdWJzdHIoMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEFkZCBwYWRkaW5nLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChwcmVmaXgubGVuZ3RoICsgYXJnVGV4dC5sZW5ndGggPCB3aWR0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmxhZ0xlZnRBbGlnbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCArPSAnICc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmxhZ1plcm9QYWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gJzAnICsgYXJnVGV4dDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZml4ID0gJyAnICsgcHJlZml4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEluc2VydCB0aGUgcmVzdWx0IGludG8gdGhlIGJ1ZmZlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gcHJlZml4ICsgYXJnVGV4dDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0LnNwbGl0KCcnKS5mb3JFYWNoKGZ1bmN0aW9uKGNocikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXQucHVzaChjaHIuY2hhckNvZGVBdCgwKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdmJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ0YnOlxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnZSc6XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdFJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2cnOlxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnRyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBGbG9hdC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY3VyckFyZyA9IGdldE5leHRBcmcoJ2RvdWJsZScpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhcmdUZXh0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc05hTihjdXJyQXJnKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gJ25hbic7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdaZXJvUGFkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghaXNGaW5pdGUoY3VyckFyZykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCA9IChjdXJyQXJnIDwgMCA/ICctJyA6ICcnKSArICdpbmYnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGFnWmVyb1BhZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpc0dlbmVyYWwgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVmZmVjdGl2ZVByZWNpc2lvbiA9IE1hdGgubWluKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQ29udmVydCBnL0cgdG8gZi9GIG9yIGUvRSwgYXMgcGVyOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBodHRwOi8vcHVicy5vcGVuZ3JvdXAub3JnL29ubGluZXB1YnMvOTY5OTkxOTc5OS9mdW5jdGlvbnMvcHJpbnRmLmh0bWxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5leHQgPT0gMTAzIHx8IG5leHQgPT0gNzEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzR2VuZXJhbCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVjaXNpb24gPSBwcmVjaXNpb24gfHwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBleHBvbmVudCA9IHBhcnNlSW50KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJBcmdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnRvRXhwb25lbnRpYWwoZWZmZWN0aXZlUHJlY2lzaW9uKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3BsaXQoJ2UnKVsxXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVjaXNpb24gPiBleHBvbmVudCAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4cG9uZW50ID49IC00XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID0gKG5leHQgPT0gMTAzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ2YnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogJ0YnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKS5jaGFyQ29kZUF0KDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWNpc2lvbiAtPSBleHBvbmVudCArIDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5leHQgPSAobmV4dCA9PSAxMDNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAnZSdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAnRSdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApLmNoYXJDb2RlQXQoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uLS07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlZmZlY3RpdmVQcmVjaXNpb24gPSBNYXRoLm1pbihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5leHQgPT0gMTAxIHx8IG5leHQgPT0gNjkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQgPSBjdXJyQXJnLnRvRXhwb25lbnRpYWwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWZmZWN0aXZlUHJlY2lzaW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTWFrZSBzdXJlIHRoZSBleHBvbmVudCBoYXMgYXQgbGVhc3QgMiBkaWdpdHMuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL1tlRV1bLStdXFxkJC8udGVzdChhcmdUZXh0KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0LnNsaWNlKDAsIC0xKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcwJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQuc2xpY2UoLTEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG5leHQgPT0gMTAyIHx8IG5leHQgPT0gNzApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQgPSBjdXJyQXJnLnRvRml4ZWQoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWZmZWN0aXZlUHJlY2lzaW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJBcmcgPT09IDAgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX3JlYWxseU5lZ2F0aXZlKGN1cnJBcmcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gJy0nICsgYXJnVGV4dDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGFydHMgPSBhcmdUZXh0LnNwbGl0KCdlJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0dlbmVyYWwgJiYgIWZsYWdBbHRlcm5hdGl2ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gRGlzY2FyZCB0cmFpbGluZyB6ZXJvcyBhbmQgcGVyaW9kcy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJ0c1swXS5sZW5ndGggPiAxICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFydHNbMF0uaW5kZXhPZignLicpICE9IC0xICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBhcnRzWzBdLnNsaWNlKC0xKSA9PSAnMCcgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFydHNbMF0uc2xpY2UoLTEpID09ICcuJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnRzWzBdID0gcGFydHNbMF0uc2xpY2UoMCwgLTEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTWFrZSBzdXJlIHdlIGhhdmUgYSBwZXJpb2QgaW4gYWx0ZXJuYXRpdmUgbW9kZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGFnQWx0ZXJuYXRpdmUgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0LmluZGV4T2YoJy4nKSA9PSAtMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnRzWzBdICs9ICcuJztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFplcm8gcGFkIHVudGlsIHJlcXVpcmVkIHByZWNpc2lvbi5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChwcmVjaXNpb24gPiBlZmZlY3RpdmVQcmVjaXNpb24rKylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJ0c1swXSArPSAnMCc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJ0c1swXSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocGFydHMubGVuZ3RoID4gMSA/ICdlJyArIHBhcnRzWzFdIDogJycpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBDYXBpdGFsaXplICdFJyBpZiBuZWVkZWQuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXh0ID09IDY5KSBhcmdUZXh0ID0gYXJnVGV4dC50b1VwcGVyQ2FzZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBZGQgc2lnbi5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJBcmcgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZsYWdBbHdheXNTaWduZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gJysnICsgYXJnVGV4dDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZmxhZ1BhZFNpZ24pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID0gJyAnICsgYXJnVGV4dDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBZGQgcGFkZGluZy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoYXJnVGV4dC5sZW5ndGggPCB3aWR0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmxhZ0xlZnRBbGlnbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dCArPSAnICc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ1plcm9QYWQgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYXJnVGV4dFswXSA9PSAnLScgfHwgYXJnVGV4dFswXSA9PSAnKycpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0ID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnVGV4dFswXSArICcwJyArIGFyZ1RleHQuc2xpY2UoMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ1RleHQgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZmxhZ1plcm9QYWQgPyAnMCcgOiAnICcpICsgYXJnVGV4dDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBZGp1c3QgY2FzZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV4dCA8IDk3KSBhcmdUZXh0ID0gYXJnVGV4dC50b1VwcGVyQ2FzZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEluc2VydCB0aGUgcmVzdWx0IGludG8gdGhlIGJ1ZmZlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdUZXh0LnNwbGl0KCcnKS5mb3JFYWNoKGZ1bmN0aW9uKGNocikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXQucHVzaChjaHIuY2hhckNvZGVBdCgwKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN0cmluZy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXJnID0gZ2V0TmV4dEFyZygnaTgqJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGFyZ0xlbmd0aCA9IGFyZ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IF9zdHJsZW4oYXJnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICcobnVsbCknLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocHJlY2lzaW9uU2V0KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdMZW5ndGggPSBNYXRoLm1pbihhcmdMZW5ndGgsIHByZWNpc2lvbik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmbGFnTGVmdEFsaWduKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChhcmdMZW5ndGggPCB3aWR0aC0tKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXQucHVzaCgzMik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFyZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGFyZ0xlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXQucHVzaChIRUFQVThbYXJnKysgfCAwXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXQgPSByZXQuY29uY2F0KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50QXJyYXlGcm9tU3RyaW5nKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcobnVsbCknLnN1YnN0cigwLCBhcmdMZW5ndGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRydWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZsYWdMZWZ0QWxpZ24pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGFyZ0xlbmd0aCA8IHdpZHRoLS0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldC5wdXNoKDMyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2MnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQ2hhcmFjdGVyLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmbGFnTGVmdEFsaWduKSByZXQucHVzaChnZXROZXh0QXJnKCdpOCcpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoLS13aWR0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0LnB1c2goMzIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWZsYWdMZWZ0QWxpZ24pIHJldC5wdXNoKGdldE5leHRBcmcoJ2k4JykpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnbic6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBXcml0ZSB0aGUgbGVuZ3RoIHdyaXR0ZW4gc28gZmFyIHRvIHRoZSBuZXh0IHBhcmFtZXRlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHRyID0gZ2V0TmV4dEFyZygnaTMyKicpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhFQVAzMltwdHIgPj4gMl0gPSByZXQubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnJSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBMaXRlcmFsIHBlcmNlbnQgc2lnbi5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXQucHVzaChjdXJyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBVbmtub3duIHNwZWNpZmllcnMgcmVtYWluIHVudG91Y2hlZC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaSA9IHN0YXJ0VGV4dEluZGV4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpIDwgdGV4dEluZGV4ICsgMjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSsrXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldC5wdXNoKEhFQVA4W2ldKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGV4dEluZGV4ICs9IDI7XG4gICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IFN1cHBvcnQgYS9BIChoZXggZmxvYXQpIGFuZCBtIChsYXN0IGVycm9yKSBzcGVjaWZpZXJzLlxuICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiBTdXBwb3J0ICUxJHtzcGVjaWZpZXJ9IGZvciBhcmcgc2VsZWN0aW9uLlxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldC5wdXNoKGN1cnIpO1xuICAgICAgICAgICAgICAgICAgICB0ZXh0SW5kZXggKz0gMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIF9mcHJpbnRmKHN0cmVhbSwgZm9ybWF0LCB2YXJhcmdzKSB7XG4gICAgICAgICAgICAvLyBpbnQgZnByaW50ZihGSUxFICpyZXN0cmljdCBzdHJlYW0sIGNvbnN0IGNoYXIgKnJlc3RyaWN0IGZvcm1hdCwgLi4uKTtcbiAgICAgICAgICAgIC8vIGh0dHA6Ly9wdWJzLm9wZW5ncm91cC5vcmcvb25saW5lcHVicy8wMDAwOTUzOTkvZnVuY3Rpb25zL3ByaW50Zi5odG1sXG4gICAgICAgICAgICB2YXIgcmVzdWx0ID0gX19mb3JtYXRTdHJpbmcoZm9ybWF0LCB2YXJhcmdzKTtcbiAgICAgICAgICAgIHZhciBzdGFjayA9IFJ1bnRpbWUuc3RhY2tTYXZlKCk7XG4gICAgICAgICAgICB2YXIgcmV0ID0gX2Z3cml0ZShcbiAgICAgICAgICAgICAgICBhbGxvY2F0ZShyZXN1bHQsICdpOCcsIEFMTE9DX1NUQUNLKSxcbiAgICAgICAgICAgICAgICAxLFxuICAgICAgICAgICAgICAgIHJlc3VsdC5sZW5ndGgsXG4gICAgICAgICAgICAgICAgc3RyZWFtXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgUnVudGltZS5zdGFja1Jlc3RvcmUoc3RhY2spO1xuICAgICAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBfcmVjdihmZCwgYnVmLCBsZW4sIGZsYWdzKSB7XG4gICAgICAgICAgICB2YXIgc29jayA9IFNPQ0tGUy5nZXRTb2NrZXQoZmQpO1xuICAgICAgICAgICAgaWYgKCFzb2NrKSB7XG4gICAgICAgICAgICAgICAgX19fc2V0RXJyTm8oRVJSTk9fQ09ERVMuRUJBREYpO1xuICAgICAgICAgICAgICAgIHJldHVybiAtMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIFRPRE8gaG9ub3IgZmxhZ3NcbiAgICAgICAgICAgIHJldHVybiBfcmVhZChmZCwgYnVmLCBsZW4pO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIF9wcmVhZChmaWxkZXMsIGJ1ZiwgbmJ5dGUsIG9mZnNldCkge1xuICAgICAgICAgICAgLy8gc3NpemVfdCBwcmVhZChpbnQgZmlsZGVzLCB2b2lkICpidWYsIHNpemVfdCBuYnl0ZSwgb2ZmX3Qgb2Zmc2V0KTtcbiAgICAgICAgICAgIC8vIGh0dHA6Ly9wdWJzLm9wZW5ncm91cC5vcmcvb25saW5lcHVicy8wMDAwOTUzOTkvZnVuY3Rpb25zL3JlYWQuaHRtbFxuICAgICAgICAgICAgdmFyIHN0cmVhbSA9IEZTLmdldFN0cmVhbShmaWxkZXMpO1xuICAgICAgICAgICAgaWYgKCFzdHJlYW0pIHtcbiAgICAgICAgICAgICAgICBfX19zZXRFcnJObyhFUlJOT19DT0RFUy5FQkFERik7XG4gICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICB2YXIgc2xhYiA9IEhFQVA4O1xuICAgICAgICAgICAgICAgIHJldHVybiBGUy5yZWFkKHN0cmVhbSwgc2xhYiwgYnVmLCBuYnl0ZSwgb2Zmc2V0KTtcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICBGUy5oYW5kbGVGU0Vycm9yKGUpO1xuICAgICAgICAgICAgICAgIHJldHVybiAtMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBfcmVhZChmaWxkZXMsIGJ1ZiwgbmJ5dGUpIHtcbiAgICAgICAgICAgIC8vIHNzaXplX3QgcmVhZChpbnQgZmlsZGVzLCB2b2lkICpidWYsIHNpemVfdCBuYnl0ZSk7XG4gICAgICAgICAgICAvLyBodHRwOi8vcHVicy5vcGVuZ3JvdXAub3JnL29ubGluZXB1YnMvMDAwMDk1Mzk5L2Z1bmN0aW9ucy9yZWFkLmh0bWxcbiAgICAgICAgICAgIHZhciBzdHJlYW0gPSBGUy5nZXRTdHJlYW0oZmlsZGVzKTtcbiAgICAgICAgICAgIGlmICghc3RyZWFtKSB7XG4gICAgICAgICAgICAgICAgX19fc2V0RXJyTm8oRVJSTk9fQ09ERVMuRUJBREYpO1xuICAgICAgICAgICAgICAgIHJldHVybiAtMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgdmFyIHNsYWIgPSBI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ICAgICAgICB2YXIgZXJyID0gX3JlYWQoc3RyZWFtLCBwdHIsIGJ5dGVzVG9SZWFkKTtcbiAgICAgICAgICAgIGlmIChlcnIgPT0gLTEpIHtcbiAgICAgICAgICAgICAgICBpZiAoc3RyZWFtT2JqKSBzdHJlYW1PYmouZXJyb3IgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnl0ZXNSZWFkICs9IGVycjtcbiAgICAgICAgICAgIGlmIChieXRlc1JlYWQgPCBieXRlc1RvUmVhZCkgc3RyZWFtT2JqLmVvZiA9IHRydWU7XG4gICAgICAgICAgICByZXR1cm4gTWF0aC5mbG9vcihieXRlc1JlYWQgLyBzaXplKTtcbiAgICAgICAgfVxuICAgICAgICBNb2R1bGVbJ19tZW1jbXAnXSA9IF9tZW1jbXA7XG4gICAgICAgIGZ1bmN0aW9uIF9sc2VlayhmaWxkZXMsIG9mZnNldCwgd2hlbmNlKSB7XG4gICAgICAgICAgICAvLyBvZmZfdCBsc2VlayhpbnQgZmlsZGVzLCBvZmZfdCBvZmZzZXQsIGludCB3aGVuY2UpO1xuICAgICAgICAgICAgLy8gaHR0cDovL3B1YnMub3Blbmdyb3VwLm9yZy9vbmxpbmVwdWJzLzAwMDA5NTM5OS9mdW5jdGlvbnMvbHNlZWsuaHRtbFxuICAgICAgICAgICAgdmFyIHN0cmVhbSA9IEZTLmdldFN0cmVhbShmaWxkZXMpO1xuICAgICAgICAgICAgaWYgKCFzdHJlYW0pIHtcbiAgICAgICAgICAgICAgICBfX19zZXRFcnJObyhFUlJOT19DT0RFUy5FQkFERik7XG4gICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICByZXR1cm4gRlMubGxzZWVrKHN0cmVhbSwgb2Zmc2V0LCB3aGVuY2UpO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgIEZTLmhhbmRsZUZTRXJyb3IoZSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIF9mc2VlayhzdHJlYW0sIG9mZnNldCwgd2hlbmNlKSB7XG4gICAgICAgICAgICAvLyBpbnQgZnNlZWsoRklMRSAqc3RyZWFtLCBsb25nIG9mZnNldCwgaW50IHdoZW5jZSk7XG4gICAgICAgICAgICAvLyBodHRwOi8vcHVicy5vcGVuZ3JvdXAub3JnL29ubGluZXB1YnMvMDAwMDk1Mzk5L2Z1bmN0aW9ucy9mc2Vlay5odG1sXG4gICAgICAgICAgICB2YXIgcmV0ID0gX2xzZWVrKHN0cmVhbSwgb2Zmc2V0LCB3aGVuY2UpO1xuICAgICAgICAgICAgaWYgKHJldCA9PSAtMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAtMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHN0cmVhbSA9IEZTLmdldFN0cmVhbShzdHJlYW0pO1xuICAgICAgICAgICAgc3RyZWFtLmVvZiA9IGZhbHNlO1xuICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX2Nsb3NlKGZpbGRlcykge1xuICAgICAgICAgICAgLy8gaW50IGNsb3NlKGludCBmaWxkZXMpO1xuICAgICAgICAgICAgLy8gaHR0cDovL3B1YnMub3Blbmdyb3VwLm9yZy9vbmxpbmVwdWJzLzAwMDA5NTM5OS9mdW5jdGlvbnMvY2xvc2UuaHRtbFxuICAgICAgICAgICAgdmFyIHN0cmVhbSA9IEZTLmdldFN0cmVhbShmaWxkZXMpO1xuICAgICAgICAgICAgaWYgKCFzdHJlYW0pIHtcbiAgICAgICAgICAgICAgICBfX19zZXRFcnJObyhFUlJOT19DT0RFUy5FQkFERik7XG4gICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBGUy5jbG9zZShzdHJlYW0pO1xuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgIEZTLmhhbmRsZUZTRXJyb3IoZSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIF9mc3luYyhmaWxkZXMpIHtcbiAgICAgICAgICAgIC8vIGludCBmc3luYyhpbnQgZmlsZGVzKTtcbiAgICAgICAgICAgIC8vIGh0dHA6Ly9wdWJzLm9wZW5ncm91cC5vcmcvb25saW5lcHVicy8wMDAwOTUzOTkvZnVuY3Rpb25zL2ZzeW5jLmh0bWxcbiAgICAgICAgICAgIHZhciBzdHJlYW0gPSBGUy5nZXRTdHJlYW0oZmlsZGVzKTtcbiAgICAgICAgICAgIGlmIChzdHJlYW0pIHtcbiAgICAgICAgICAgICAgICAvLyBXZSB3cml0ZSBkaXJlY3RseSB0byB0aGUgZmlsZSBzeXN0ZW0sIHNvIHRoZXJlJ3Mgbm90aGluZyB0byBkbyBoZXJlLlxuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBfX19zZXRFcnJObyhFUlJOT19DT0RFUy5FQkFERik7XG4gICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIF9mY2xvc2Uoc3RyZWFtKSB7XG4gICAgICAgICAgICAvLyBpbnQgZmNsb3NlKEZJTEUgKnN0cmVhbSk7XG4gICAgICAgICAgICAvLyBodHRwOi8vcHVicy5vcGVuZ3JvdXAub3JnL29ubGluZXB1YnMvMDAwMDk1Mzk5L2Z1bmN0aW9ucy9mY2xvc2UuaHRtbFxuICAgICAgICAgICAgX2ZzeW5jKHN0cmVhbSk7XG4gICAgICAgICAgICByZXR1cm4gX2Nsb3NlKHN0cmVhbSk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX3ByaW50Zihmb3JtYXQsIHZhcmFyZ3MpIHtcbiAgICAgICAgICAgIC8vIGludCBwcmludGYoY29uc3QgY2hhciAqcmVzdHJpY3QgZm9ybWF0LCAuLi4pO1xuICAgICAgICAgICAgLy8gaHR0cDovL3B1YnMub3Blbmdyb3VwLm9yZy9vbmxpbmVwdWJzLzAwMDA5NTM5OS9mdW5jdGlvbnMvcHJpbnRmLmh0bWxcbiAgICAgICAgICAgIHZhciBzdGRvdXQgPSBIRUFQMzJbX3N0ZG91dCA+PiAyXTtcbiAgICAgICAgICAgIHJldHVybiBfZnByaW50ZihzdGRvdXQsIGZvcm1hdCwgdmFyYXJncyk7XG4gICAgICAgIH1cbiAgICAgICAgTW9kdWxlWydfbWVtc2V0J10gPSBfbWVtc2V0O1xuICAgICAgICB2YXIgX2xsdm1fbWVtc2V0X3AwaThfaTMyID0gX21lbXNldDtcbiAgICAgICAgTW9kdWxlWydfbWVtY3B5J10gPSBfbWVtY3B5O1xuICAgICAgICB2YXIgX2xsdm1fbWVtY3B5X3AwaThfcDBpOF9pMzIgPSBfbWVtY3B5O1xuICAgICAgICB2YXIgX2xsdm1fcG93X2Y2NCA9IE1hdGhfcG93O1xuICAgICAgICB2YXIgX3NpbiA9IE1hdGhfc2luO1xuICAgICAgICBmdW5jdGlvbiBfc3RycmNocihwdHIsIGNocikge1xuICAgICAgICAgICAgdmFyIHB0cjIgPSBwdHIgKyBfc3RybGVuKHB0cik7XG4gICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgaWYgKEhFQVA4W3B0cjJdID09IGNocikgcmV0dXJuIHB0cjI7XG4gICAgICAgICAgICAgICAgcHRyMi0tO1xuICAgICAgICAgICAgfSB3aGlsZSAocHRyMiA+PSBwdHIpO1xuICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIF9fX3N0cnRva19zdGF0ZSA9IDA7XG4gICAgICAgIGZ1bmN0aW9uIF9zdHJ0b2tfcihzLCBkZWxpbSwgbGFzdHMpIHtcbiAgICAgICAgICAgIHZhciBza2lwX2xlYWRpbmdfZGVsaW0gPSAxO1xuICAgICAgICAgICAgdmFyIHNwYW5wO1xuICAgICAgICAgICAgdmFyIGMsIHNjO1xuICAgICAgICAgICAgdmFyIHRvaztcbiAgICAgICAgICAgIGlmIChzID09IDAgJiYgKHMgPSBnZXRWYWx1ZShsYXN0cywgJ2k4KicpKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjb250OiB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgIGMgPSBnZXRWYWx1ZShzKyssICdpOCcpO1xuICAgICAgICAgICAgICAgIGZvciAoc3BhbnAgPSBkZWxpbTsgKHNjID0gZ2V0VmFsdWUoc3BhbnArKywgJ2k4JykpICE9IDA7ICkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoYyA9PSBzYykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNraXBfbGVhZGluZ19kZWxpbSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIGNvbnQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFZhbHVlKGxhc3RzLCBzLCAnaTgqJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VmFsdWUocyAtIDEsIDAsICdpOCcpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzIC0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjID09IDApIHtcbiAgICAgICAgICAgICAgICBzZXRWYWx1ZShsYXN0cywgMCwgJ2k4KicpO1xuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdG9rID0gcyAtIDE7XG4gICAgICAgICAgICBmb3IgKDs7KSB7XG4gICAgICAgICAgICAgICAgYyA9IGdldFZhbHVlKHMrKywgJ2k4Jyk7XG4gICAgICAgICAgICAgICAgc3BhbnAgPSBkZWxpbTtcbiAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoc2MgPSBnZXRWYWx1ZShzcGFucCsrLCAnaTgnKSkgPT0gYykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGMgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRWYWx1ZShzIC0gMSwgMCwgJ2k4Jyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRWYWx1ZShsYXN0cywgcywgJ2k4KicpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRvaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKHNjICE9IDApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYWJvcnQoJ3N0cnRva19yIGVycm9yIScpO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIF9zdHJ0b2socywgZGVsaW0pIHtcbiAgICAgICAgICAgIHJldHVybiBfc3RydG9rX3IocywgZGVsaW0sIF9fX3N0cnRva19zdGF0ZSk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX3N0cm5jbXAocHgsIHB5LCBuKSB7XG4gICAgICAgICAgICB2YXIgaSA9IDA7XG4gICAgICAgICAgICB3aGlsZSAoaSA8IG4pIHtcbiAgICAgICAgICAgICAgICB2YXIgeCA9IEhFQVBVOFsocHggKyBpKSB8IDBdO1xuICAgICAgICAgICAgICAgIHZhciB5ID0gSEVBUFU4WyhweSArIGkpIHwgMF07XG4gICAgICAgICAgICAgICAgaWYgKHggPT0geSAmJiB4ID09IDApIHJldHVybiAwO1xuICAgICAgICAgICAgICAgIGlmICh4ID09IDApIHJldHVybiAtMTtcbiAgICAgICAgICAgICAgICBpZiAoeSA9PSAwKSByZXR1cm4gMTtcbiAgICAgICAgICAgICAgICBpZiAoeCA9PSB5KSB7XG4gICAgICAgICAgICAgICAgICAgIGkrKztcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHggPiB5ID8gMSA6IC0xO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIF9zdHJjbXAocHgsIHB5KSB7XG4gICAgICAgICAgICByZXR1cm4gX3N0cm5jbXAocHgsIHB5LCBUT1RBTF9NRU1PUlkpO1xuICAgICAgICB9XG4gICAgICAgIE1vZHVsZVsnX3N0cm5jcHknXSA9IF9zdHJuY3B5O1xuICAgICAgICBmdW5jdGlvbiBfaXNzcGFjZShjaHIpIHtcbiAgICAgICAgICAgIHJldHVybiBjaHIgPT0gMzIgfHwgKGNociA+PSA5ICYmIGNociA8PSAxMyk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX19wYXJzZUludChzdHIsIGVuZHB0ciwgYmFzZSwgbWluLCBtYXgsIGJpdHMsIHVuc2lnbikge1xuICAgICAgICAgICAgLy8gU2tpcCBzcGFjZS5cbiAgICAgICAgICAgIHdoaWxlIChfaXNzcGFjZShIRUFQOFtzdHJdKSkgc3RyKys7XG4gICAgICAgICAgICAvLyBDaGVjayBmb3IgYSBwbHVzL21pbnVzIHNpZ24uXG4gICAgICAgICAgICB2YXIgbXVsdGlwbGllciA9IDE7XG4gICAgICAgICAgICBpZiAoSEVBUDhbc3RyXSA9PSA0NSkge1xuICAgICAgICAgICAgICAgIG11bHRpcGxpZXIgPSAtMTtcbiAgICAgICAgICAgICAgICBzdHIrKztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoSEVBUDhbc3RyXSA9PSA0Mykge1xuICAgICAgICAgICAgICAgIHN0cisrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gRmluZCBiYXNlLlxuICAgICAgICAgICAgdmFyIGZpbmFsQmFzZSA9IGJhc2U7XG4gICAgICAgICAgICBpZiAoIWZpbmFsQmFzZSkge1xuICAgICAgICAgICAgICAgIGlmIChIRUFQOFtzdHJdID09IDQ4KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIEhFQVA4WyhzdHIgKyAxKSB8IDBdID09IDEyMCB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgSEVBUDhbKHN0ciArIDEpIHwgMF0gPT0gODhcbiAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmaW5hbEJhc2UgPSAxNjtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ciArPSAyO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgZmluYWxCYXNlID0gODtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0cisrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmIChmaW5hbEJhc2UgPT0gMTYpIHtcbiAgICAgICAgICAgICAgICBpZiAoSEVBUDhbc3RyXSA9PSA0OCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICBIRUFQOFsoc3RyICsgMSkgfCAwXSA9PSAxMjAgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIEhFQVA4WyhzdHIgKyAxKSB8IDBdID09IDg4XG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3RyICs9IDI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIWZpbmFsQmFzZSkgZmluYWxCYXNlID0gMTA7XG4gICAgICAgICAgICAvLyBHZXQgZGlnaXRzLlxuICAgICAgICAgICAgdmFyIGNocjtcbiAgICAgICAgICAgIHZhciByZXQgPSAwO1xuICAgICAgICAgICAgd2hpbGUgKChjaHIgPSBIRUFQOFtzdHJdKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgdmFyIGRpZ2l0ID0gcGFyc2VJbnQoU3RyaW5nLmZyb21DaGFyQ29kZShjaHIpLCBmaW5hbEJhc2UpO1xuICAgICAgICAgICAgICAgIGlmIChpc05hTihkaWdpdCkpIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0ID0gcmV0ICogZmluYWxCYXNlICsgZGlnaXQ7XG4gICAgICAgICAgICAgICAgICAgIHN0cisrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIEFwcGx5IHNpZ24uXG4gICAgICAgICAgICByZXQgKj0gbXVsdGlwbGllcjtcbiAgICAgICAgICAgIC8vIFNldCBlbmQgcG9pbnRlci5cbiAgICAgICAgICAgIGlmIChlbmRwdHIpIHtcbiAgICAgICAgICAgICAgICBIRUFQMzJbZW5kcHRyID4+IDJdID0gc3RyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gVW5zaWduIGlmIG5lZWRlZC5cbiAgICAgICAgICAgIGlmICh1bnNpZ24pIHtcbiAgICAgICAgICAgICAgICBpZiAoTWF0aC5hYnMocmV0KSA+IG1heCkge1xuICAgICAgICAgICAgICAgICAgICByZXQgPSBtYXg7XG4gICAgICAgICAgICAgICAgICAgIF9fX3NldEVyck5vKEVSUk5PX0NPREVTLkVSQU5HRSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0ID0gdW5TaWduKHJldCwgYml0cyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gVmFsaWRhdGUgcmFuZ2UuXG4gICAgICAgICAgICBpZiAocmV0ID4gbWF4IHx8IHJldCA8IG1pbikge1xuICAgICAgICAgICAgICAgIHJldCA9IHJldCA+IG1heCA/IG1heCA6IG1pbjtcbiAgICAgICAgICAgICAgICBfX19zZXRFcnJObyhFUlJOT19DT0RFUy5FUkFOR0UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGJpdHMgPT0gNjQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAoYXNtWydzZXRUZW1wUmV0MCddKFxuICAgICAgICAgICAgICAgICAgICAgICAgKCh0ZW1wRG91YmxlID0gcmV0KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICtNYXRoX2Ficyh0ZW1wRG91YmxlKSA+PSArMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdGVtcERvdWJsZSA+ICswXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gKE1hdGhfbWluKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArTWF0aF9mbG9vcih0ZW1wRG91YmxlIC8gKzQyOTQ5NjcyOTYpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArNDI5NDk2NzI5NVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogfn4rTWF0aF9jZWlsKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodGVtcERvdWJsZSAtICsofn50ZW1wRG91YmxlID4+PiAwKSkgL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKzQyOTQ5NjcyOTZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApID4+PiAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAwKVxuICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgICByZXQgPj4+IDApIHwgMFxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIF9zdHJ0b2woc3RyLCBlbmRwdHIsIGJhc2UpIHtcbiAgICAgICAgICAgIHJldHVybiBfX3BhcnNlSW50KHN0ciwgZW5kcHRyLCBiYXNlLCAtMjE0NzQ4MzY0OCwgMjE0NzQ4MzY0NywgMzIpOyAvLyBMT05HX01JTiwgTE9OR19NQVguXG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gX2F0b2kocHRyKSB7XG4gICAgICAgICAgICByZXR1cm4gX3N0cnRvbChwdHIsIG51bGwsIDEwKTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBfc3RyY2hyKHB0ciwgY2hyKSB7XG4gICAgICAgICAgICBwdHItLTtcbiAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICBwdHIrKztcbiAgICAgICAgICAgICAgICB2YXIgdmFsID0gSEVBUDhbcHRyXTtcbiAgICAgICAgICAgICAgICBpZiAodmFsID09IGNocikgcmV0dXJuIHB0cjtcbiAgICAgICAgICAg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AgICAgICAgICAgICAgUnVudGltZS5keW5hbWljQWxsb2MgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgYWJvcnQoJ2Nhbm5vdCBkeW5hbWljYWxseSBhbGxvY2F0ZSwgc2JyayBub3cgaGFzIGNvbnRyb2wnKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHJldCA9IERZTkFNSUNUT1A7XG4gICAgICAgICAgICBpZiAoYnl0ZXMgIT0gMCkgc2VsZi5hbGxvYyhieXRlcyk7XG4gICAgICAgICAgICByZXR1cm4gcmV0OyAvLyBQcmV2aW91cyBicmVhayBsb2NhdGlvbi5cbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBfc3lzY29uZihuYW1lKSB7XG4gICAgICAgICAgICAvLyBsb25nIHN5c2NvbmYoaW50IG5hbWUpO1xuICAgICAgICAgICAgLy8gaHR0cDovL3B1YnMub3Blbmdyb3VwLm9yZy9vbmxpbmVwdWJzLzAwOTY5NTM5OS9mdW5jdGlvbnMvc3lzY29uZi5odG1sXG4gICAgICAgICAgICBzd2l0Y2ggKG5hbWUpIHtcbiAgICAgICAgICAgICAgICBjYXNlIDMwOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gUEFHRV9TSVpFO1xuICAgICAgICAgICAgICAgIGNhc2UgMTMyOlxuICAgICAgICAgICAgICAgIGNhc2UgMTMzOlxuICAgICAgICAgICAgICAgIGNhc2UgMTI6XG4gICAgICAgICAgICAgICAgY2FzZSAxMzc6XG4gICAgICAgICAgICAgICAgY2FzZSAxMzg6XG4gICAgICAgICAgICAgICAgY2FzZSAxNTpcbiAgICAgICAgICAgICAgICBjYXNlIDIzNTpcbiAgICAgICAgICAgICAgICBjYXNlIDE2OlxuICAgICAgICAgICAgICAgIGNhc2UgMTc6XG4gICAgICAgICAgICAgICAgY2FzZSAxODpcbiAgICAgICAgICAgICAgICBjYXNlIDE5OlxuICAgICAgICAgICAgICAgIGNhc2UgMjA6XG4gICAgICAgICAgICAgICAgY2FzZSAxNDk6XG4gICAgICAgICAgICAgICAgY2FzZSAxMzpcbiAgICAgICAgICAgICAgICBjYXNlIDEwOlxuICAgICAgICAgICAgICAgIGNhc2UgMjM2OlxuICAgICAgICAgICAgICAgIGNhc2UgMTUzOlxuICAgICAgICAgICAgICAgIGNhc2UgOTpcbiAgICAgICAgICAgICAgICBjYXNlIDIxOlxuICAgICAgICAgICAgICAgIGNhc2UgMjI6XG4gICAgICAgICAgICAgICAgY2FzZSAxNTk6XG4gICAgICAgICAgICAgICAgY2FzZSAxNTQ6XG4gICAgICAgICAgICAgICAgY2FzZSAxNDpcbiAgICAgICAgICAgICAgICBjYXNlIDc3OlxuICAgICAgICAgICAgICAgIGNhc2UgNzg6XG4gICAgICAgICAgICAgICAgY2FzZSAxMzk6XG4gICAgICAgICAgICAgICAgY2FzZSA4MDpcbiAgICAgICAgICAgICAgICBjYXNlIDgxOlxuICAgICAgICAgICAgICAgIGNhc2UgNzk6XG4gICAgICAgICAgICAgICAgY2FzZSA4MjpcbiAgICAgICAgICAgICAgICBjYXNlIDY4OlxuICAgICAgICAgICAgICAgIGNhc2UgNjc6XG4gICAgICAgICAgICAgICAgY2FzZSAxNjQ6XG4gICAgICAgICAgICAgICAgY2FzZSAxMTpcbiAgICAgICAgICAgICAgICBjYXNlIDI5OlxuICAgICAgICAgICAgICAgIGNhc2UgNDc6XG4gICAgICAgICAgICAgICAgY2FzZSA0ODpcbiAgICAgICAgICAgICAgICBjYXNlIDk1OlxuICAgICAgICAgICAgICAgIGNhc2UgNTI6XG4gICAgICAgICAgICAgICAgY2FzZSA1MTpcbiAgICAgICAgICAgICAgICBjYXNlIDQ2OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMjAwODA5O1xuICAgICAgICAgICAgICAgIGNhc2UgMjc6XG4gICAgICAgICAgICAgICAgY2FzZSAyNDY6XG4gICAgICAgICAgICAgICAgY2FzZSAxMjc6XG4gICAgICAgICAgICAgICAgY2FzZSAxMjg6XG4gICAgICAgICAgICAgICAgY2FzZSAyMzpcbiAgICAgICAgICAgICAgICBjYXNlIDI0OlxuICAgICAgICAgICAgICAgIGNhc2UgMTYwOlxuICAgICAgICAgICAgICAgIGNhc2UgMTYxOlxuICAgICAgICAgICAgICAgIGNhc2UgMTgxOlxuICAgICAgICAgICAgICAgIGNhc2UgMTgyOlxuICAgICAgICAgICAgICAgIGNhc2UgMjQyOlxuICAgICAgICAgICAgICAgIGNhc2UgMTgzOlxuICAgICAgICAgICAgICAgIGNhc2UgMTg0OlxuICAgICAgICAgICAgICAgIGNhc2UgMjQzOlxuICAgICAgICAgICAgICAgIGNhc2UgMjQ0OlxuICAgICAgICAgICAgICAgIGNhc2UgMjQ1OlxuICAgICAgICAgICAgICAgIGNhc2UgMTY1OlxuICAgICAgICAgICAgICAgIGNhc2UgMTc4OlxuICAgICAgICAgICAgICAgIGNhc2UgMTc5OlxuICAgICAgICAgICAgICAgIGNhc2UgNDk6XG4gICAgICAgICAgICAgICAgY2FzZSA1MDpcbiAgICAgICAgICAgICAgICBjYXNlIDE2ODpcbiAgICAgICAgICAgICAgICBjYXNlIDE2OTpcbiAgICAgICAgICAgICAgICBjYXNlIDE3NTpcbiAgICAgICAgICAgICAgICBjYXNlIDE3MDpcbiAgICAgICAgICAgICAgICBjYXNlIDE3MTpcbiAgICAgICAgICAgICAgICBjYXNlIDE3MjpcbiAgICAgICAgICAgICAgICBjYXNlIDk3OlxuICAgICAgICAgICAgICAgIGNhc2UgNzY6XG4gICAgICAgICAgICAgICAgY2FzZSAzMjpcbiAgICAgICAgICAgICAgICBjYXNlIDE3MzpcbiAgICAgICAgICAgICAgICBjYXNlIDM1OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTE7XG4gICAgICAgICAgICAgICAgY2FzZSAxNzY6XG4gICAgICAgICAgICAgICAgY2FzZSAxNzc6XG4gICAgICAgICAgICAgICAgY2FzZSA3OlxuICAgICAgICAgICAgICAgIGNhc2UgMTU1OlxuICAgICAgICAgICAgICAgIGNhc2UgODpcbiAgICAgICAgICAgICAgICBjYXNlIDE1NzpcbiAgICAgICAgICAgICAgICBjYXNlIDEyNTpcbiAgICAgICAgICAgICAgICBjYXNlIDEyNjpcbiAgICAgICAgICAgICAgICBjYXNlIDkyOlxuICAgICAgICAgICAgICAgIGNhc2UgOTM6XG4gICAgICAgICAgICAgICAgY2FzZSAxMjk6XG4gICAgICAgICAgICAgICAgY2FzZSAxMzA6XG4gICAgICAgICAgICAgICAgY2FzZSAxMzE6XG4gICAgICAgICAgICAgICAgY2FzZSA5NDpcbiAgICAgICAgICAgICAgICBjYXNlIDkxOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMTtcbiAgICAgICAgICAgICAgICBjYXNlIDc0OlxuICAgICAgICAgICAgICAgIGNhc2UgNjA6XG4gICAgICAgICAgICAgICAgY2FzZSA2OTpcbiAgICAgICAgICAgICAgICBjYXNlIDcwOlxuICAgICAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDEwMjQ7XG4gICAgICAgICAgICAgICAgY2FzZSAzMTpcbiAgICAgICAgICAgICAgICBjYXNlIDQyOlxuICAgICAgICAgICAgICAgIGNhc2UgNzI6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAzMjtcbiAgICAgICAgICAgICAgICBjYXNlIDg3OlxuICAgICAgICAgICAgICAgIGNhc2UgMjY6XG4gICAgICAgICAgICAgICAgY2FzZSAzMzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDIxNDc0ODM2NDc7XG4gICAgICAgICAgICAgICAgY2FzZSAzNDpcbiAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiA0NzgzOTtcbiAgICAgICAgICAgICAgICBjYXNlIDM4OlxuICAgICAgICAgICAgICAgIGNhc2UgMzY6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiA5OTtcbiAgICAgICAgICAgICAgICBjYXNlIDQzOlxuICAgICAgICAgICAgICAgIGNhc2UgMzc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAyMDQ4O1xuICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDIwOTcxNTI7XG4gICAgICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gNjU1MzY7XG4gICAgICAgICAgICAgICAgY2FzZSAyODpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDMyNzY4O1xuICAgICAgICAgICAgICAgIGNhc2UgNDQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAzMjc2NztcbiAgICAgICAgICAgICAgICBjYXNlIDc1OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMTYzODQ7XG4gICAgICAgICAgICAgICAgY2FzZSAzOTpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDEwMDA7XG4gICAgICAgICAgICAgICAgY2FzZSA4OTpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDcwMDtcbiAgICAgICAgICAgICAgICBjYXNlIDcxOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMjU2O1xuICAgICAgICAgICAgICAgIGNhc2UgNDA6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAyNTU7XG4gICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMTAwO1xuICAgICAgICAgICAgICAgIGNhc2UgMTgwOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gNjQ7XG4gICAgICAgICAgICAgICAgY2FzZSAyNTpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDIwO1xuICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDE2O1xuICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDY7XG4gICAgICAgICAgICAgICAgY2FzZSA3MzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDQ7XG4gICAgICAgICAgICAgICAgY2FzZSA4NDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBfX19zZXRFcnJObyhFUlJOT19DT0RFUy5FSU5WQUwpO1xuICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIF90aW1lKHB0cikge1xuICAgICAgICAgICAgdmFyIHJldCA9IE1hdGguZmxvb3IoRGF0ZS5ub3coKSAvIDEwMDApO1xuICAgICAgICAgICAgaWYgKHB0cikge1xuICAgICAgICAgICAgICAgIEhFQVAzMltwdHIgPj4gMl0gPSByZXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICB9XG4gICAgICAgIHZhciBCcm93c2VyID0ge1xuICAgICAgICAgICAgbWFpbkxvb3A6IHtcbiAgICAgICAgICAgICAgICBzY2hlZHVsZXI6IG51bGwsXG4gICAgICAgICAgICAgICAgc2hvdWxkUGF1c2U6IGZhbHNlLFxuICAgICAgICAgICAgICAgIHBhdXNlZDogZmFsc2UsXG4gICAgICAgICAgICAgICAgcXVldWU6IFtdLFxuICAgICAgICAgICAgICAgIHBhdXNlOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5tYWluTG9vcC5zaG91bGRQYXVzZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICByZXN1bWU6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoQnJvd3Nlci5tYWluTG9vcC5wYXVzZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIEJyb3dzZXIubWFpbkxvb3AucGF1c2VkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICBCcm93c2VyLm1haW5Mb29wLnNjaGVkdWxlcigpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIEJyb3dzZXIubWFpbkxvb3Auc2hvdWxkUGF1c2UgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHVwZGF0ZVN0YXR1czogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChNb2R1bGVbJ3NldFN0YXR1cyddKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWVzc2FnZSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgTW9kdWxlWydzdGF0dXNNZXNzYWdlJ10gfHwgJ1BsZWFzZSB3YWl0Li4uJztcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZW1haW5pbmcgPSBCcm93c2VyLm1haW5Mb29wLnJlbWFpbmluZ0Jsb2NrZXJzO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGV4cGVjdGVkID0gQnJvd3Nlci5tYWluTG9vcC5leHBlY3RlZEJsb2NrZXJzO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlbWFpbmluZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZW1haW5pbmcgPCBleHBlY3RlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNb2R1bGVbJ3NldFN0YXR1cyddKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJyAoJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGV4cGVjdGVkIC0gcmVtYWluaW5nKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJy8nICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHBlY3RlZCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJyknXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTW9kdWxlWydzZXRTdGF0dXMnXShtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1vZHVsZVsnc2V0U3RhdHVzJ10oJycpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGlzRnVsbFNjcmVlbjogZmFsc2UsXG4gICAgICAgICAgICBwb2ludGVyTG9jazogZmFsc2UsXG4gICAgICAgICAgICBtb2R1bGVDb250ZXh0Q3JlYXRlZENhbGxiYWNrczogW10sXG4gICAgICAgICAgICB3b3JrZXJzOiBbXSxcbiAgICAgICAgICAgIGluaXQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIGlmICghTW9kdWxlWydwcmVsb2FkUGx1Z2lucyddKSBNb2R1bGVbJ3ByZWxvYWRQbHVnaW5zJ10gPSBbXTsgLy8gbmVlZHMgdG8gZXhpc3QgZXZlbiBpbiB3b3JrZXJzXG4gICAgICAgICAgICAgICAgaWYgKEJyb3dzZXIuaW5pdHRlZCkgcmV0dXJuO1xuICAgICAgICAgICAgICAgIEJyb3dzZXIuaW5pdHRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgbmV3IEJsb2IoKTtcbiAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5oYXNCbG9iQ29uc3RydWN0b3IgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5oYXNCbG9iQ29uc3RydWN0b3IgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05vIGJsb2IgY29uc3RydWN0b3IsIGNhbm5vdCBjcmVhdGUgYmxvYnMgd2l0aCBtaW1ldHlwZXMnXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIEJyb3dzZXIuQmxvYkJ1aWxkZXIgPVxuICAgICAgICAgICAgICAgICAgICB0eXBlb2YgTW96QmxvYkJ1aWxkZXIgIT0gJ3VuZGVmaW5lZCdcbiAgICAgICAgICAgICAgICAgICAgICAgID8gTW96QmxvYkJ1aWxkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgIDogdHlwZW9mIFdlYktpdEJsb2JCdWlsZGVyICE9ICd1bmRlZmluZWQnXG4gICAgICAgICAgICAgICAgICAgICAgICA/IFdlYktpdEJsb2JCdWlsZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICA6ICFCcm93c2VyLmhhc0Jsb2JDb25zdHJ1Y3RvclxuICAgICAgICAgICAgICAgICAgICAgICAgPyBjb25zb2xlLndhcm4oJ05vIEJsb2JCdWlsZGVyJylcbiAgICAgICAgICAgICAgICAgICAgICAgIDogbnVsbDtcbiAgICAgICAgICAgICAgICBCcm93c2VyLlVSTE9iamVjdCA9XG4gICAgICAgICAgICAgICAgICAgIHR5cGVvZiB3aW5kb3cgIT0gJ3VuZGVmaW5lZCdcbiAgICAgICAgICAgICAgICAgICAgICAgID8gd2luZG93LlVSTFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gd2luZG93LlVSTFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogd2luZG93LndlYmtpdFVSTFxuICAgICAgICAgICAgICAgICAgICAgICAgOiB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgIC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gbW9kaWZpZWQpIGRhdGEuIEZvciBleGFtcGxlLCBhIHBsdWdpbiBtaWdodCBkZWNvbXByZXNzIGEgZmlsZSwgb3IgaXRcbiAgICAgICAgICAgICAgICAvLyBtaWdodCBjcmVhdGUgc29tZSBzaWRlIGRhdGEgc3RydWN0dXJlIGZvciB1c2UgbGF0ZXIgKGxpa2UgYW4gSW1hZ2UgZWxlbWVudCwgZXRjLikuXG4gICAgICAgICAgICAgICAgdmFyIGltYWdlUGx1Z2luID0ge307XG4gICAgICAgICAgICAgICAgaW1hZ2VQbHVnaW5bJ2NhbkhhbmRsZSddID0gZnVuY3Rpb24obmFtZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAgICAgIU1vZHVsZS5ub0ltYWdlRGVjb2RpbmcgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIC9cXC4oanBnfGpwZWd8cG5nfGJtcCkkL2kudGVzdChuYW1lKVxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgaW1hZ2VQbHVnaW5bJ2hhbmRsZSddID0gZnVuY3Rpb24oXG4gICAgICAgICAgICAgICAgICAgIGJ5dGVBcnJheSxcbiAgICAgICAgICAgICAgICAgICAgbmFtZSxcbiAgICAgICAgICAgICAgICAgICAgb25sb2FkLFxuICAgICAgICAgICAgICAgICAgICBvbmVycm9yXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBiID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKEJyb3dzZXIuaGFzQmxvYkNvbnN0cnVjdG9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPSBuZXcgQmxvYihbYnl0ZUFycmF5XSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBCcm93c2VyLmdldE1pbWV0eXBlKG5hbWUpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGIuc2l6ZSAhPT0gYnl0ZUFycmF5Lmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBTYWZhcmkgYnVnICMxMTg2MzBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2FmYXJpJ3MgQmxvYiBjYW4gb25seSB0YWtlIGFuIEFycmF5QnVmZmVyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPSBuZXcgQmxvYihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFtuZXcgVWludDhBcnJheShieXRlQXJyYXkpLmJ1ZmZlcl0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IHR5cGU6IEJyb3dzZXIuZ2V0TWltZXR5cGUobmFtZSkgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBSdW50aW1lLndhcm5PbmNlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnQmxvYiBjb25zdHJ1Y3RvciBwcmVzZW50IGJ1dCBmYWlsczogJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICc7IGZhbGxpbmcgYmFjayB0byBibG9iIGJ1aWxkZXInXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoIWIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBiYiA9IG5ldyBCcm93c2VyLkJsb2JCdWlsZGVyKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBiYi5hcHBlbmQobmV3IFVpbnQ4QXJyYXkoYnl0ZUFycmF5KS5idWZmZXIpOyAvLyB3ZSBuZWVkIHRvIHBhc3MgYSBidWZmZXIsIGFuZCBtdXN0IGNvcHkgdGhlIGFycmF5IHRvIGdldCB0aGUgcmlnaHQgZGF0YSByYW5nZVxuICAgICAgICAgICAgICAgICAgICAgICAgYiA9IGJiLmdldEJsb2IoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB2YXIgdXJsID0gQnJvd3Nlci5VUkxPYmplY3QuY3JlYXRlT2JqZWN0VVJMKGIpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgaW1nID0gbmV3IEltYWdlKCk7XG4gICAgICAgICAgICAgICAgICAgIGltZy5vbmxvYWQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFzc2VydChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWcuY29tcGxldGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0ltYWdlICcgKyBuYW1lICsgJyBjb3VsZCBub3QgYmUgZGVjb2RlZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2FudmFzID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnY2FudmFzJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMud2lkdGggPSBpbWcud2lkdGg7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMuaGVpZ2h0ID0gaW1nLmhlaWdodDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjdHggPSBjYW52YXMuZ2V0Q29udGV4dCgnMmQnKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoaW1nLCAwLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIE1vZHVsZVsncHJlbG9hZGVkSW1hZ2VzJ11bbmFtZV0gPSBjYW52YXM7XG4gICAgICAgICAgICAgICAgICAgICAgICBCcm93c2VyLlVSTE9iamVjdC5yZXZva2VPYmplY3RVUkwodXJsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvbmxvYWQpIG9ubG9hZChieXRlQXJyYXkpO1xuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICBpbWcub25lcnJvciA9IGZ1bmN0aW9uKGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKCdJbWFnZSAnICsgdXJsICsgJyBjb3VsZCBub3QgYmUgZGVjb2RlZCcpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9uZXJyb3IpIG9uZXJyb3IoKTtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgaW1nLnNyYyA9IHVybDtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIE1vZHVsZVsncHJlbG9hZFBsdWdpbnMnXS5wdXNoKGltYWdlUGx1Z2luKTtcbiAgICAgICAgICAgICAgICB2YXIgYXVkaW9QbHVnaW4gPSB7fTtcbiAgICAgICAgICAgICAgICBhdWRpb1BsdWdpblsnY2FuSGFuZGxlJ10gPSBmdW5jdGlvbihuYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAhTW9kdWxlLm5vQXVkaW9EZWNvZGluZyAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZS5zdWJzdHIoLTQpIGluIHsgJy5vZ2cnOiAxLCAnLndhdic6IDEsICcubXAzJzogMSB9XG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBhdWRpb1BsdWdpblsnaGFuZGxlJ10gPSBmdW5jdGlvbihcbiAgICAgICAgICAgICAgICAgICAgYnl0ZUFycmF5LFxuICAgICAgICAgICAgICAgICAgICBuYW1lLFxuICAgICAgICAgICAgICAgICAgICBvbmxvYWQsXG4gICAgICAgICAgICAgICAgICAgIG9uZXJyb3JcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRvbmUgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gZmluaXNoKGF1ZGlvKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZG9uZSkgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgZG9uZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICBNb2R1bGVbJ3ByZWxvYWRlZEF1ZGlvcyddW25hbWVdID0gYXVkaW87XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob25sb2FkKSBvbmxvYWQoYnl0ZUFycmF5KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBmYWlsKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRvbmUpIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvbmUgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgTW9kdWxlWydwcmVsb2FkZWRBdWRpb3MnXVtuYW1lXSA9IG5ldyBBdWRpbygpOyAvLyBlbXB0eSBzaGltXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob25lcnJvcikgb25lcnJvcigpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChCcm93c2VyLmhhc0Jsb2JDb25zdHJ1Y3Rvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYiA9IG5ldyBCbG9iKFtieXRlQXJyYXldLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IEJyb3dzZXIuZ2V0TWltZXR5cGUobmFtZSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFpbCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHVybCA9IEJyb3dzZXIuVVJMT2JqZWN0LmNyZWF0ZU9iamVjdFVSTChiKTsgLy8gWFhYIHdlIG5ldmVyIHJldm9rZSB0aGlzIVxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGF1ZGlvID0gbmV3IEF1ZGlvKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBhdWRpby5hZGRFdmVudExpc3RlbmVyKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjYW5wbGF5dGhyb3VnaCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmlzaChhdWRpbyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZVxuICAgICAgICAgICAgICAgICAgICAgICAgKTsgLy8gdXNlIGFkZEV2ZW50TGlzdGVuZXIgZHVlIHRvIGNocm9taXVtIGJ1ZyAxMjQ5MjZcbiAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvLm9uZXJyb3IgPSBmdW5jdGlvbihldmVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkb25lKSByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnQnJvd3NlciBjb3VsZCBub3QgZnVsbHkgZGVjb2RlIGF1ZGlvICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnLCB0cnlpbmcgc2xvd2VyIGJhc2U2NCBhcHByb2FjaCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGVuY29kZTY0KGRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIEJBU0UgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0FCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXowMTIzNDU2Nzg5Ky8nO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgUEFEID0gJz0nO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmV0ID0gJyc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsZWZ0Y2hhciA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsZWZ0Yml0cyA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZGF0YS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdGNoYXIgPSAobGVmdGNoYXIgPDwgOCkgfCBkYXRhW2ldO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdGJpdHMgKz0gODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChsZWZ0Yml0cyA+PSA2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnIgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobGVmdGNoYXIgPj4gKGxlZnRiaXRzIC0gNikpICYgMHgzZjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0Yml0cyAtPSA2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldCArPSBCQVNFW2N1cnJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsZWZ0Yml0cyA9PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXQgKz0gQkFTRVsobGVmdGNoYXIgJiAzKSA8PCA0XTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldCArPSBQQUQgKyBQQUQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobGVmdGJpdHMgPT0gNCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0ICs9IEJBU0VbKGxlZnRjaGFyICYgMHhmKSA8PCAyXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldCArPSBQQUQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW8uc3JjID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2RhdGE6YXVkaW8veC0nICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZS5zdWJzdHIoLTMpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJztiYXNlNjQsJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuY29kZTY0KGJ5dGVBcnJheSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluaXNoKGF1ZGlvKTsgLy8gd2UgZG9uJ3Qgd2FpdCBmb3IgY29uZmlybWF0aW9uIHRoaXMgd29ya2VkIC0gYnV0IGl0J3Mgd29ydGggdHJ5aW5nXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW8uc3JjID0gdXJsO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gd29ya2Fyb3VuZCBmb3IgY2hyb21lIGJ1ZyAxMjQ5MjYgLSB3ZSBkbyBub3QgYWx3YXlzIGdldCBvbmNhbnBsYXl0aHJvdWdoIG9yIG9uZXJyb3JcbiAgICAgICAgICAgICAgICAgICAgICAgIEJyb3dzZXIuc2FmZVNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluaXNoKGF1ZGlvKTsgLy8gdHJ5IHRvIHVzZSBpdCBldmVuIHRob3VnaCBpdCBpcyBub3QgbmVjZXNzYXJpbHkgcmVhZHkgdG8gcGxheVxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAwMDApO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhaWwoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgTW9kdWxlWydwcmVsb2FkUGx1Z2lucyddLnB1c2goYXVkaW9QbHVnaW4pO1xuICAgICAgICAgICAgICAgIC8vIENhbnZhcyBldmVudCBzZXR1cFxuICAgICAgICAgICAgICAgIHZhciBjYW52YXMgPSBNb2R1bGVbJ2NhbnZhcyddO1xuICAgICAgICAgICAgICAgIGNhbnZhcy5yZXF1ZXN0UG9pbnRlckxvY2sgPVxuICAgICAgICAgICAgICAgICAgICBjYW52YXNbJ3JlcXVlc3RQb2ludGVyTG9jayddIHx8XG4gICAgICAgICAgICAgICAgICAgIGNhbnZhc1snbW96UmVxdWVzdFBvaW50ZXJMb2NrJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgY2FudmFzWyd3ZWJraXRSZXF1ZXN0UG9pbnRlckxvY2snXTtcbiAgICAgICAgICAgICAgICBjYW52YXMuZXhpdFBvaW50ZXJMb2NrID1cbiAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnRbJ2V4aXRQb2ludGVyTG9jayddIHx8XG4gICAgICAgICAgICAgICAgICAgIGRvY3VtZW50Wydtb3pFeGl0UG9pbnRlckxvY2snXSB8fFxuICAgICAgICAgICAgICAgICAgICBkb2N1bWVudFsnd2Via2l0RXhpdFBvaW50ZXJMb2NrJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24oKSB7fTsgLy8gbm8tb3AgaWYgZnVuY3Rpb24gZG9lcyBub3QgZXhpc3RcbiAgICAgICAgICAgICAgICBjYW52YXMuZXhpdFBvaW50ZXJMb2NrID0gY2FudmFzLmV4aXRQb2ludGVyTG9jay5iaW5kKGRvY3VtZW50KTtcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBwb2ludGVyTG9ja0NoYW5nZSgpIHtcbiAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5wb2ludGVyTG9jayA9XG4gICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudFsncG9pbnRlckxvY2tFbGVtZW50J10gPT09IGNhbnZhcyB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnRbJ21velBvaW50ZXJMb2NrRWxlbWVudCddID09PSBjYW52YXMgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50Wyd3ZWJraXRQb2ludGVyTG9ja0VsZW1lbnQnXSA9PT0gY2FudmFzO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKFxuICAgICAgICAgICAgICAgICAgICAncG9pbnRlcmxvY2tjaGFuZ2UnLFxuICAgICAgICAgICAgICAgICAgICBwb2ludGVyTG9ja0NoYW5nZSxcbiAgICAgICAgICAgICAgICAgICAgZmFsc2VcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoXG4gICAgICAgICAgICAgICAgICAgICdtb3pwb2ludGVybG9ja2NoYW5nZScsXG4gICAgICAgICAgICAgICAgICAgIHBvaW50ZXJMb2NrQ2hhbmdlLFxuICAgICAgICAgICAgICAgICAgICBmYWxzZVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcihcbiAgICAgICAgICAgICAgICAgICAgJ3dlYmtpdHBvaW50ZXJsb2NrY2hhbmdlJyxcbiAgICAgICAgICAgICAgICAgICAgcG9pbnRlckxvY2tDaGFuZ2UsXG4gICAgICAgICAgICAgICAgICAgIGZhbHNlXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICBpZiAoTW9kdWxlWydlbGVtZW50UG9pbnRlckxvY2snXSkge1xuICAgICAgICAgICAgICAgICAgICBjYW52YXMuYWRkRXZlbnRMaXN0ZW5lcihcbiAgICAgICAgICAgICAgICAgICAgICAgICdjbGljaycsXG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbihldikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIUJyb3dzZXIucG9pbnRlckxvY2sgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FudmFzLnJlcXVlc3RQb2ludGVyTG9ja1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMucmVxdWVzdFBvaW50ZXJMb2NrKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNyZWF0ZUNvbnRleHQ6IGZ1bmN0aW9uKGNhbnZhcywgdXNlV2ViR0wsIHNldEluTW9kdWxlKSB7XG4gICAgICAgICAgICAgICAgdmFyIGN0eDtcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodXNlV2ViR0wpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eCA9IGNhbnZhcy5nZXRDb250ZXh0KCdleHBlcmltZW50YWwtd2ViZ2wnLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IGZhbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGN0eCA9IGNhbnZhcy5nZXRDb250ZXh0KCcyZCcpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICghY3R4KSB0aHJvdyAnOignO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcignQ291bGQgbm90IGNyZWF0ZSBjYW52YXMgLSAnICsgZSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAodXNlV2ViR0wpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gU2V0IHRoZSBiYWNrZ3JvdW5kIG9mIHRoZSBXZWJHTCBjYW52YXMgdG8gYmxhY2tcbiAgICAgICAgICAgICAgICAgICAgY2FudmFzLnN0eWxlLmJhY2tncm91bmRDb2xvciA9ICdibGFjayc7XG4gICAgICAgICAgICAgICAgICAgIC8vIFdhcm4gb24gY29udGV4dCBsb3NzXG4gICAgICAgICAgICAgICAgICAgIGNhbnZhcy5hZGRFdmVudExpc3RlbmVyKFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dlYmdsY29udGV4dGxvc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24oZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGVydChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1dlYkdMIGNvbnRleHQgbG9zdC4gWW91IHdpbGwgbmVlZCB0byByZWxvYWQgdGhlIHBhZ2UuJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2VcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHNldEluTW9kdWxlKSB7XG4gICAgICAgICAgICAgICAgICAgIE1vZHVsZS5jdHggPSBjdHg7XG4gICAgICAgICAgICAgICAgICAgIE1vZHVsZS51c2VXZWJHTCA9IHVzZVdlYkdMO1xuICAgICAgICAgICAgICAgICAgICBCcm93c2VyLm1vZHVsZUNvbnRleHRDcmVhdGVkQ2FsbGJhY2tzLmZvckVhY2goZnVuY3Rpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFja1xuICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBCcm93c2VyLmluaXQoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGN0eDtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBkZXN0cm95Q29udGV4dDogZnVuY3Rpb24oY2FudmFzLCB1c2VXZWJHTCwgc2V0SW5Nb2R1bGUpIHt9LFxuICAgICAgICAgICAgZnVsbFNjcmVlbkhhbmRsZXJzSW5zdGFsbGVkOiBmYWxzZSxcbiAgICAgICAgICAgIGxvY2tQb2ludGVyOiB1bmRlZmluZWQsXG4gICAgICAgICAgICByZXNpemVDYW52YXM6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHJlcXVlc3RGdWxsU2NyZWVuOiBmdW5jdGlvbihsb2NrUG9pbnRlciwgcmVzaXplQ2FudmFzKSB7XG4gICAgICAgICAgICAgICAgQnJvd3Nlci5sb2NrUG9pbnRlciA9IGxvY2tQb2ludGVyO1xuICAgICAgICAgICAgICAgIEJyb3dzZXIucmVzaXplQ2FudmFzID0gcmVzaXplQ2FudmFzO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgQnJvd3Nlci5sb2NrUG9pbnRlciA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIEJyb3dzZXIubG9ja1BvaW50ZXIgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgQnJvd3Nlci5yZXNpemVDYW52YXMgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBCcm93c2VyLnJlc2l6ZUNhbnZhcyA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIHZhciBjYW52YXMgPSBNb2R1bGVbJ2NhbnZhcyddO1xuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGZ1bGxTY3JlZW5DaGFuZ2UoKSB7XG4gICAgICAgICAgICAgICAgICAgIEJyb3dzZXIuaXNGdWxsU2NyZWVuID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIChkb2N1bWVudFsnd2Via2l0RnVsbFNjcmVlbkVsZW1lbnQnXSB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50Wyd3ZWJraXRGdWxsc2NyZWVuRWxlbWVudCddIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnRbJ21vekZ1bGxTY3JlZW5FbGVtZW50J10gfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudFsnbW96RnVsbHNjcmVlbkVsZW1lbnQnXSB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50WydmdWxsU2NyZWVuRWxlbWVudCddIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnRbJ2Z1bGxzY3JlZW5FbGVtZW50J10pID09PSBjYW52YXNcbiAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMuY2FuY2VsRnVsbFNjcmVlbiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnRbJ2NhbmNlbEZ1bGxTY3JlZW4nXSB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50Wydtb3pDYW5jZWxGdWxsU2NyZWVuJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudFsnd2Via2l0Q2FuY2VsRnVsbFNjcmVlbiddO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FudmFzLmNhbmNlbEZ1bGxTY3JlZW4gPSBjYW52YXMuY2FuY2VsRnVsbFNjcmVlbi5iaW5kKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50XG4gICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEJyb3dzZXIubG9ja1BvaW50ZXIpIGNhbnZhcy5yZXF1ZXN0UG9pbnRlckxvY2soKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIEJyb3dzZXIuaXNGdWxsU2NyZWVuID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChCcm93c2VyLnJlc2l6ZUNhbnZhcylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCcm93c2VyLnNldEZ1bGxTY3JlZW5DYW52YXNTaXplKCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoQnJvd3Nlci5yZXNpemVDYW52YXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIEJyb3dzZXIuc2V0V2luZG93ZWRDYW52YXNTaXplKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKE1vZHVsZVsnb25GdWxsU2NyZWVuJ10pXG4gICAgICAgICAgICAgICAgICAgICAgICBNb2R1bGVbJ29uRnVsbFNjcmVlbiddKEJyb3dzZXIuaXNGdWxsU2NyZWVuKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFCcm93c2VyLmZ1bGxTY3JlZW5IYW5kbGVyc0luc3RhbGxlZCkge1xuICAgICAgICAgICAgICAgICAgICBCcm93c2VyLmZ1bGxTY3JlZW5IYW5kbGVyc0luc3RhbGxlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVsbHNjcmVlbmNoYW5nZScsXG4gICAgICAgICAgICAgICAgICAgICAgICBmdWxsU2NyZWVuQ2hhbmdlLFxuICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2VcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcihcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb3pmdWxsc2NyZWVuY2hhbmdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZ1bGxTY3JlZW5DaGFuZ2UsXG4gICAgICAgICAgICAgICAgICAgICAgICBmYWxzZVxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dlYmtpdGZ1bGxzY3JlZW5jaGFuZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgZnVsbFNjcmVlbkNoYW5nZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNhbnZhcy5yZXF1ZXN0RnVsbFNjcmVlbiA9XG4gICAgICAgICAgICAgICAgICAgIGNhbnZhc1sncmVxdWVzdEZ1bGxTY3JlZW4nXSB8fFxuICAgICAgICAgICAgICAgICAgICBjYW52YXNbJ21velJlcXVlc3RGdWxsU2NyZWVuJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgKGNhbnZhc1snd2Via2l0UmVxdWVzdEZ1bGxTY3JlZW4nXVxuICAgICAgICAgICAgICAgICAgICAgICAgPyBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhc1snd2Via2l0UmVxdWVzdEZ1bGxTY3JlZW4nXShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbGVtZW50WydBTExPV19LRVlCT0FSRF9JTlBVVCddXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICA6IG51bGwpO1xuICAgICAgICAgICAgICAgIGNhbnZhcy5yZXF1ZXN0RnVsbFNjcmVlbigpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHJlcXVlc3RBbmltYXRpb25GcmFtZTogZnVuY3Rpb24oZnVuYykge1xuICAgICAgICAgICAgICAgIGlmICghd2luZG93LnJlcXVlc3RBbmltYXRpb25GcmFtZSkge1xuICAgICAgICAgICAgICAgICAgICB3aW5kb3cucmVxdWVzdEFuaW1hdGlvbkZyYW1lID1cbiAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvd1sncmVxdWVzdEFuaW1hdGlvbkZyYW1lJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvd1snbW96UmVxdWVzdEFuaW1hdGlvbkZyYW1lJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvd1snd2Via2l0UmVxdWVzdEFuaW1hdGlvbkZyYW1lJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvd1snbXNSZXF1ZXN0QW5pbWF0aW9uRnJhbWUnXSB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93WydvUmVxdWVzdEFuaW1hdGlvbkZyYW1lJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvd1snc2V0VGltZW91dCddO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB3aW5kb3cucmVxdWVzdEFuaW1hdGlvbkZyYW1lKGZ1bmMpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhZmVDYWxsYmFjazogZnVuY3Rpb24oZnVuYykge1xuICAgICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFBQk9SVCkgcmV0dXJuIGZ1bmMuYXBwbHkobnVsbCwgYXJndW1lbnRzKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhZmVSZXF1ZXN0QW5pbWF0aW9uRnJhbWU6IGZ1bmN0aW9uKGZ1bmMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gQnJvd3Nlci5yZXF1ZXN0QW5pbWF0aW9uRnJhbWUoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghQUJPUlQpIGZ1bmMoKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzYWZlU2V0VGltZW91dDogZnVuY3Rpb24oZnVuYywgdGltZW91dCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIUFCT1JUKSBmdW5jKCk7XG4gICAgICAgICAgICAgICAgfSwgdGltZW91dCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FmZVNldEludGVydmFsOiBmdW5jdGlvbihmdW5jLCB0aW1lb3V0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHNldEludGVydmFsKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIUFCT1JUKSBmdW5jKCk7XG4gICAgICAgICAgICAgICAgfSwgdGltZW91dCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZ2V0TWltZXR5cGU6IGZ1bmN0aW9uKG5hbWUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICBqcGc6ICdpbWFnZS9qcGVnJyxcbiAgICAgICAgICAgICAgICAgICAganBlZzogJ2ltYWdlL2pwZWcnLFxuICAgICAgICAgICAgICAgICAgICBwbmc6ICdpbWFnZS9wbmcnLFxuICAgICAgICAgICAgICAgICAgICBibXA6ICdpbWFnZS9ibXAnLFxuICAgICAgICAgICAgICAgICAgICBvZ2c6ICdhdWRpby9vZ2cnLFxuICAgICAgICAgICAgICAgICAgICB3YXY6ICdhdWRpby93YXYnLFxuICAgICAgICAgICAgICAgICAgICBtcDM6ICdhdWRpby9tcGVnJ1xuICAgICAgICAgICAgICAgIH1bbmFtZS5zdWJzdHIobmFtZS5sYXN0SW5kZXhPZignLicpICsgMSldO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdldFVzZXJNZWRpYTogZnVuY3Rpb24oZnVuYykge1xuICAgICAgICAgICAgICAgIGlmICghd2luZG93LmdldFVzZXJNZWRpYSkge1xuICAgICAgICAgICAgICAgICAgICB3aW5kb3cuZ2V0VXNlck1lZGlhID1cbiAgICAgICAgICAgICAgICAgICAgICAgIG5hdmlnYXRvclsnZ2V0VXNlck1lZGlhJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hdmlnYXRvclsnbW96R2V0VXNlck1lZGlhJ107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHdpbmRvdy5nZXRVc2VyTWVkaWEoZnVuYyk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZ2V0TW92ZW1lbnRYOiBmdW5jdGlvbihldmVudCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgIGV2ZW50Wydtb3ZlbWVudFgnXSB8fFxuICAgICAgICAgICAgICAgICAgICBldmVudFsnbW96TW92ZW1lbnRYJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgZXZlbnRbJ3dlYmtpdE1vdmVtZW50WCddIHx8XG4gICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdldE1vdmVtZW50WTogZnVuY3Rpb24oZXZlbnQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICBldmVudFsnbW92ZW1lbnRZJ10gfHxcbiAgICAgICAgICAgICAgICAgICAgZXZlbnRbJ21vek1vdmVtZW50WSddIHx8XG4gICAgICAgICAgICAgICAgICAgIGV2ZW50Wyd3ZWJraXRNb3ZlbWVudFknXSB8fFxuICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBtb3VzZVg6IDAsXG4gICAgICAgICAgICBtb3VzZVk6IDAsXG4gICAgICAgICAgICBtb3VzZU1vdmVtZW50WDogMCxcbiAgICAgICAgICAgIG1vdXNlTW92ZW1lbnRZOiAwLFxuICAgICAgICAgICAgY2FsY3VsYXRlTW91c2VFdmVudDogZnVuY3Rpb24oZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAvLyBldmVudCBzaG91bGQgYmUgbW91c2Vtb3ZlLCBtb3VzZWRvd24gb3IgbW91c2V1cFxuICAgICAgICAgICAgICAgIGlmIChCcm93c2VyLnBvaW50ZXJMb2NrKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIFdoZW4gdGhlIHBvaW50ZXIgaXMgbG9ja2VkLCBjYWxjdWxhdGUgdGhlIGNvb3JkaW5hdGVzXG4gICAgICAgICAgICAgICAgICAgIC8vIGJhc2VkIG9uIHRoZSBtb3ZlbWVudCBvZiB0aGUgbW91c2UuXG4gICAgICAgICAgICAgICAgICAgIC8vIFdvcmthcm91bmQgZm9yIEZpcmVmb3ggYnVnIDc2NDQ5OFxuICAgICAgICAgICAgICAgICAgICBpZiAoZXZlbnQudHlwZSAhPSAnbW91c2Vtb3ZlJyAmJiAnbW96TW92ZW1lbnRYJyBpbiBldmVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5tb3VzZU1vdmVtZW50WCA9IEJyb3dzZXIubW91c2VNb3ZlbWVudFkgPSAwO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5tb3VzZU1vdmVtZW50WCA9IEJyb3dzZXIuZ2V0TW92ZW1lbnRYKGV2ZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIEJyb3dzZXIubW91c2VNb3ZlbWVudFkgPSBCcm93c2VyLmdldE1vdmVtZW50WShldmVudCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgLy8gY2hlY2sgaWYgU0RMIGlzIGF2YWlsYWJsZVxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIFNETCAhPSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5tb3VzZVggPSBTREwubW91c2VYICsgQnJvd3Nlci5tb3VzZU1vdmVtZW50WDtcbiAgICAgICAgICAgICAgICAgICAgICAgIEJyb3dzZXIubW91c2VZID0gU0RMLm1vdXNlWSArIEJyb3dzZXIubW91c2VNb3ZlbWVudFk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBqdXN0IGFkZCB0aGUgbW91c2UgZGVsdGEgdG8gdGhlIGN1cnJlbnQgYWJzb2x1dCBtb3VzZSBwb3NpdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gRklYTUU6IGlkZWFsbHkgdGhpcyBzaG91bGQgYmUgY2xhbXBlZCBhZ2FpbnN0IHRoZSBjYW52YXMgc2l6ZSBhbmQgemVyb1xuICAgICAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5tb3VzZVggKz0gQnJvd3Nlci5tb3VzZU1vdmVtZW50WDtcbiAgICAgICAgICAgICAgICAgICAgICAgIEJyb3dzZXIubW91c2VZICs9IEJyb3dzZXIubW91c2VNb3ZlbWVudFk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvLyBPdGhlcndpc2UsIGNhbGN1bGF0ZSB0aGUgbW92ZW1lbnQgYmFzZWQgb24gdGhlIGNoYW5nZXNcbiAgICAgICAgICAgICAgICAgICAgLy8gaW4gdGhlIGNvb3JkaW5hdGVzLlxuICAgICAgICAgICAgICAgICAgICB2YXIgcmVjdCA9IE1vZHVsZVsnY2FudmFzJ10uZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciB4LCB5O1xuICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICBldmVudC50eXBlID09ICd0b3VjaHN0YXJ0JyB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQudHlwZSA9PSAndG91Y2hlbmQnIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICBldmVudC50eXBlID09ICd0b3VjaG1vdmUnXG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHQgPSBldmVudC50b3VjaGVzLml0ZW0oMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggPSB0LnBhZ2VYIC0gKHdpbmRvdy5zY3JvbGxYICsgcmVjdC5sZWZ0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB5ID0gdC5wYWdlWSAtICh3aW5kb3cuc2Nyb2xsWSArIHJlY3QudG9wKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgeCA9IGV2ZW50LnBhZ2VYIC0gKHdpbmRvdy5zY3JvbGxYICsgcmVjdC5sZWZ0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHkgPSBldmVudC5wYWdlWSAtICh3aW5kb3cuc2Nyb2xsWSArIHJlY3QudG9wKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyB0aGUgY2FudmFzIG1pZ2h0IGJlIENTUy1zY2FsZWQgY29tcGFyZWQgdG8gaXRzIGJhY2tidWZmZXI7XG4gICAgICAgICAgICAgICAgICAgIC8vIFNETC11c2luZyBjb250ZW50IHdpbGwgd2FudCBtb3VzZSBjb29yZGluYXRlcyBpbiB0ZXJtc1xuICAgICAgICAgICAgICAgICAgICAvLyBvZiBiYWNrYnVmZmVyIHVuaXRzLlxuICAgICAgICAgICAgICAgICAgICB2YXIgY3cgPSBNb2R1bGVbJ2NhbnZhcyddLndpZHRoO1xuICAgICAgICAgICAgICAgICAgICB2YXIgY2ggPSBNb2R1bGVbJ2NhbnZhcyddLmhlaWdodDtcbiAgICAgICAgICAgICAgICAgICAgeCA9IHggKiAoY3cgLyByZWN0LndpZHRoKTtcbiAgICAgICAgICAgICAgICAgICAgeSA9IHkgKiAoY2ggLyByZWN0LmhlaWdodCk7XG4gICAgICAgICAgICAgICAgICAgIEJyb3dzZXIubW91c2VNb3ZlbWVudFggPSB4IC0gQnJvd3Nlci5tb3VzZVg7XG4gICAgICAgICAgICAgICAgICAgIEJyb3dzZXIubW91c2VNb3ZlbWVudFkgPSB5IC0gQnJvd3Nlci5tb3VzZVk7XG4gICAgICAgICAgICAgICAgICAgIEJyb3dzZXIubW91c2VYID0geDtcbiAgICAgICAgICAgICAgICAgICAgQnJvd3Nlci5tb3VzZVkgPSB5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB4aHJMb2FkOiBmdW5jdGlvbih1cmwsIG9ubG9hZCwgb25lcnJvcikge1xuICAgICAgICAgICAgICAgIHZhciB4aHIgPSBuZXcgWE1MSHR0cFJlcXVlc3QoKTtcbiAgICAgICAgICAgICAgICB4aHIub3BlbignR0VUJywgdXJsLCB0cnVlKTtcbiAgICAgICAgICAgICAgICB4aHIucmVzcG9uc2VUeXBlID0gJ2FycmF5YnVmZmVyJztcbiAgICAgICAgICAgICAgICB4aHIub25sb2FkID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIHhoci5zdGF0dXMgPT0gMjAwIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAoeGhyLnN0YXR1cyA9PSAwICYmIHhoci5yZXNwb25zZSlcbiAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBmaWxlIFVSTHMgY2FuIHJldHVybiAwXG4gICAgICAgICAgICAgICAgICAgICAgICBvbmxvYWQoeGhyLnJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uZXJyb3IoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgeGhyLm9uZXJyb3IgPSBvbmVycm9yO1xuICAgICAgICAgICAgICAgIHhoci5zZW5kKG51bGwpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGFzeW5jTG9hZDogZnVuY3Rpb24odXJsLCBvbmxvYWQsIG9uZXJyb3IsIG5vUnVuRGVwKSB7XG4gICAgICAgICAgICAgICAgQnJvd3Nlci54aHJMb2FkKFxuICAgICAgICAgICAgICAgICAgICB1cmwsXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uKGFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhc3NlcnQoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyYXlCdWZmZXIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0xvYWRpbmcgZGF0YSBmaWxlIFwiJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdcIiBmYWlsZWQgKG5vIGFycmF5QnVmZmVyKS4nXG4gICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgb25sb2FkKG5ldyBVaW50OEFycmF5KGFycmF5QnVmZmVyKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW5vUnVuRGVwKSByZW1vdmVSdW5EZXBlbmRlbmN5KCdhbCAnICsgdXJsKTtcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob25lcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uZXJyb3IoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgJ0xvYWRpbmcgZGF0YSBmaWxlIFwiJyArIHVybCArICdcIiBmYWlsZWQuJztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgaWYgKCFub1J1bkRlcCkgYWRkUnVuRGVwZW5kZW5jeSgnYWwgJyArIHVybCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcmVzaXplTGlzdGVuZXJzOiBbXSxcbiAgICAgICAgICAgIHVwZGF0ZVJlc2l6ZUxpc3RlbmVyczogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgdmFyIGNhbnZhcyA9IE1vZHVsZVsnY2FudmFzJ107XG4gICAgICAgICAgICAgICAgQnJvd3Nlci5yZXNpemVMaXN0ZW5lcnMuZm9yRWFjaChmdW5jdGlvbihsaXN0ZW5lcikge1xuICAgICAgICAgICAgICAgICAgICBsaXN0ZW5lcihjYW52YXMud2lkdGgsIGNhbnZhcy5oZWlnaHQpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNldENhbnZhc1NpemU6IGZ1bmN0aW9uKHdpZHRoLCBoZWlnaHQsIG5vVXBkYXRlcykge1xuICAgICAgICAgICAgICAgIHZhciBjYW52YXMgPSBNb2R1bGVbJ2NhbnZhcyddO1xuICAgICAgICAgICAgICAgIGNhbnZhcy53aWR0aCA9IHdpZHRoO1xuICAgICAgICAgICAgICAgIGNhbnZhcy5oZWlnaHQgPSBoZWlnaHQ7XG4gICAgICAgICAgICAgICAgaWYgKCFub1VwZGF0ZXMpIEJyb3dzZXIudXBkYXRlUmVzaXplTGlzdGVuZXJzKCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgd2luZG93ZWRXaWR0aDogMCxcbiAgICAgICAgICAgIHdpbmRvd2VkSGVpZ2h0OiAwLFxuICAgICAgICAgICAgc2V0RnVsbFNjcmVlbkNhbnZhc1NpemU6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHZhciBjYW52YXMgPSBNb2R1bGVbJ2NhbnZhcyddO1xuICAgICAgICAgICAgICAgIHRoaXMud2luZG93ZWRXaWR0aCA9IGNhbnZhcy53aWR0aDtcbiAgICAgICAgICAgICAgICB0aGlzLndpbmRvd2VkSGVpZ2h0ID0gY2FudmFzLmhlaWdodDtcbiAgICAgICAgICAgICAgICBjYW52YXMud2lkdGggPSBzY3JlZW4ud2lkdGg7XG4gICAgICAgICAgICAgICAgY2FudmFzLmhlaWdodCA9IHNjcmVlbi5oZWlnaHQ7XG4gICAgICAgICAgICAgICAgLy8gY2hlY2sgaWYgU0RMIGlzIGF2YWlsYWJsZVxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgU0RMICE9ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBmbGFncyA9XG4gICAgICAgICAgICAgICAgICAgICAgICBIRUFQVTMyWyhTREwuc2NyZWVuICsgUnVudGltZS5RVUFOVFVNX1NJWkUgKiAwKSA+PiAyXTtcbiAgICAgICAgICAgICAgICAgICAgZmxhZ3MgPSBmbGFncyB8IDB4MDA4MDAwMDA7IC8vIHNldCBTRExfRlVMTFNDUkVFTiBmbGFnXG4gICAgICAgICAgICAgICAgICAgIEhFQVAzMltcbiAgICAgICAgICAgICAgICAgICAgICAgIChTREwuc2NyZWVuICsgUnVudGltZS5RVUFOVFVNX1NJWkUgKiAwKSA+PiAyXG4gICAgICAgICAgICAgICAgICAgIF0gPSBmbGFncztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgQnJvd3Nlci51cGRhdGVSZXNpemVMaXN0ZW5lcnMoKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzZXRXaW5kb3dlZENhbnZhc1NpemU6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHZhciBjYW52YXMgPSBNb2R1bGVbJ2NhbnZhcyddO1xuICAgICAgICAgICAgICAgIGNhbnZhcy53aWR0aCA9IHRoaXMud2luZG93ZWRXaWR0aDtcbiAgICAgICAgICAgICAgICBjYW52YXMuaGVpZ2h0ID0gdGhpcy53aW5kb3dlZEhlaWdodDtcbiAgICAgICAgICAgICAgICAvLyBjaGVjayBpZiBTREwgaXMgYXZhaWxhYmxlXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBTREwgIT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZsYWdzID1cbiAgICAgICAgICAgICAgICAgICAgICAgIEhFQVBVMzJbKFNETC5zY3JlZW4gKyBSdW50aW1lLlFVQU5UVU1fU0laRSAqIDApID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICBmbGFncyA9IGZsYWdzICYgfjB4MDA4MDAwMDA7IC8vIGNsZWFyIFNETF9GVUxMU0NSRUVOIGZsYWdcbiAgICAgICAgICAgICAgICAgICAgSEVBUDMyW1xuICAgICAgICAgICAgICAgICAgICAgICAgKFNETC5zY3JlZW4gKyBSdW50aW1lLlFVQU5UVU1fU0laRSAqIDApID4+IDJcbiAgICAgICAgICAgICAgICAgICAgXSA9IGZsYWdzO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBCcm93c2VyLnVwZGF0ZVJlc2l6ZUxpc3RlbmVycygpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIEZTLnN0YXRpY0luaXQoKTtcbiAgICAgICAgX19BVElOSVRfXy51bnNoaWZ0KHtcbiAgICAgICAgICAgIGZ1bmM6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIGlmICghTW9kdWxlWydub0ZTSW5pdCddICYmICFGUy5pbml0LmluaXRpYWxpemVkK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VElOSVRfXy51bnNoaWZ0KHtcbiAgICAgICAgICAgIGZ1bmM6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIFRUWS5pbml0KCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBfX0FURVhJVF9fLnB1c2goe1xuICAgICAgICAgICAgZnVuYzogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgVFRZLnNodXRkb3duKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBUVFkudXRmOCA9IG5ldyBSdW50aW1lLlVURjhQcm9jZXNzb3IoKTtcbiAgICAgICAgX19BVElOSVRfXy5wdXNoKHtcbiAgICAgICAgICAgIGZ1bmM6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIFNPQ0tGUy5yb290ID0gRlMubW91bnQoU09DS0ZTLCB7fSwgbnVsbCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBfX19zdHJ0b2tfc3RhdGUgPSBSdW50aW1lLnN0YXRpY0FsbG9jKDQpO1xuICAgICAgICBNb2R1bGVbJ3JlcXVlc3RGdWxsU2NyZWVuJ10gPSBmdW5jdGlvbihsb2NrUG9pbnRlciwgcmVzaXplQ2FudmFzKSB7XG4gICAgICAgICAgICBCcm93c2VyLnJlcXVlc3RGdWxsU2NyZWVuKGxvY2tQb2ludGVyLCByZXNpemVDYW52YXMpO1xuICAgICAgICB9O1xuICAgICAgICBNb2R1bGVbJ3JlcXVlc3RBbmltYXRpb25GcmFtZSddID0gZnVuY3Rpb24oZnVuYykge1xuICAgICAgICAgICAgQnJvd3Nlci5yZXF1ZXN0QW5pbWF0aW9uRnJhbWUoZnVuYyk7XG4gICAgICAgIH07XG4gICAgICAgIE1vZHVsZVsnc2V0Q2FudmFzU2l6ZSddID0gZnVuY3Rpb24od2lkdGgsIGhlaWdodCwgbm9VcGRhdGVzKSB7XG4gICAgICAgICAgICBCcm93c2VyLnNldENhbnZ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AgICAgaWYgKHR5cGVvZiBlICE9PSAnbnVtYmVyJyAmJiBlICE9PSAnbG9uZ2ptcCcpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgYXNtWydzZXRUaHJldyddKDEsIDApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gaW52b2tlX3ZpKGluZGV4LCBhMSkge1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBNb2R1bGVbJ2R5bkNhbGxfdmknXShpbmRleCwgYTEpO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZSAhPT0gJ251bWJlcicgJiYgZSAhPT0gJ2xvbmdqbXAnKSB0aHJvdyBlO1xuICAgICAgICAgICAgICAgIGFzbVsnc2V0VGhyZXcnXSgxLCAwKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGludm9rZV9paWlpaShpbmRleCwgYTEsIGEyLCBhMywgYTQpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIE1vZHVsZVsnZHluQ2FsbF9paWlpaSddKGluZGV4LCBhMSwgYTIsIGEzLCBhNCk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBlICE9PSAnbnVtYmVyJyAmJiBlICE9PSAnbG9uZ2ptcCcpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgYXNtWydzZXRUaHJldyddKDEsIDApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gaW52b2tlX3ZpaWkoaW5kZXgsIGExLCBhMiwgYTMpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgTW9kdWxlWydkeW5DYWxsX3ZpaWknXShpbmRleCwgYTEsIGEyLCBhMyk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBlICE9PSAnbnVtYmVyJyAmJiBlICE9PSAnbG9uZ2ptcCcpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgYXNtWydzZXRUaHJldyddKDEsIDApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gaW52b2tlX3YoaW5kZXgpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgTW9kdWxlWydkeW5DYWxsX3YnXShpbmRleCk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBlICE9PSAnbnVtYmVyJyAmJiBlICE9PSAnbG9uZ2ptcCcpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgYXNtWydzZXRUaHJldyddKDEsIDApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gaW52b2tlX2lpaShpbmRleCwgYTEsIGEyKSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHJldHVybiBNb2R1bGVbJ2R5bkNhbGxfaWlpJ10oaW5kZXgsIGExLCBhMik7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBlICE9PSAnbnVtYmVyJyAmJiBlICE9PSAnbG9uZ2ptcCcpIHRocm93IGU7XG4gICAgICAgICAgICAgICAgYXNtWydzZXRUaHJldyddKDEsIDApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gYXNtUHJpbnRJbnQoeCwgeSkge1xuICAgICAgICAgICAgY29uc29sZS5sb2coJ2ludCAnICsgeCArICcsJyArIHkpOyAvLyArICcgJyArIG5ldyBFcnJvcigpLnN0YWNrKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGFzbVBy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cbiAgICAgICAgICAgIHZhciBuID0gK2Vudi5OYU47XG4gICAgICAgICAgICB2YXIgbyA9ICtlbnYuSW5maW5pdHk7XG4gICAgICAgICAgICB2YXIgcCA9IDA7XG4gICAgICAgICAgICB2YXIgcSA9IDA7XG4gICAgICAgICAgICB2YXIgciA9IDA7XG4gICAgICAgICAgICB2YXIgcyA9IDA7XG4gICAgICAgICAgICB2YXIgdCA9IDAsXG4gICAgICAgICAgICAgICAgdSA9IDAsXG4gICAgICAgICAgICAgICAgdiA9IDAsXG4gICAgICAgICAgICAgICAgdyA9IDAsXG4gICAgICAgICAgICAgICAgeCA9IDAuMCxcbiAgICAgICAgICAgICAgICB5ID0gMCxcbiAgICAgICAgICAgICAgICB6ID0gMCxcbiAgICAgICAgICAgICAgICBBID0gMCxcbiAgICAgICAgICAgICAgICBCID0gMC4wO1xuICAgICAgICAgICAgdmFyIEMgPSAwO1xuICAgICAgICAgICAgdmFyIEQgPSAwO1xuICAgICAgICAgICAgdmFyIEUgPSAwO1xuICAgICAgICAgICAgdmFyIEYgPSAwO1xuICAgICAgICAgICAgdmFyIEcgPSAwO1xuICAgICAgICAgICAgdmFyIEggPSAwO1xuICAgICAgICAgICAgdmFyIEkgPSAwO1xuICAgICAgICAgICAgdmFyIEogPSAwO1xuICAgICAgICAgICAgdmFyIEsgPSAwO1xuICAgICAgICAgICAgdmFyIEwgPSAwO1xuICAgICAgICAgICAgdmFyIE0gPSBnbG9iYWwuTWF0aC5mbG9vcjtcbiAgICAgICAgICAgIHZhciBOID0gZ2xvYmFsLk1hdGguYWJzO1xuICAgICAgICAgICAgdmFyIE8gPSBnbG9iYWwuTWF0aC5zcXJ0O1xuICAgICAgICAgICAgdmFyIFAgPSBnbG9iYWwuTWF0aC5wb3c7XG4gICAgICAgICAgICB2YXIgUSA9IGdsb2JhbC5NYXRoLmNvcztcbiAgICAgICAgICAgIHZhciBSID0gZ2xvYmFsLk1hdGguc2luO1xuICAgICAgICAgICAgdmFyIFMgPSBnbG9iYWwuTWF0aC50YW47XG4gICAgICAgICAgICB2YXIgVCA9IGdsb2JhbC5NYXRoLmFjb3M7XG4gICAgICAgICAgICB2YXIgVSA9IGdsb2JhbC5NYXRoLmFzaW47XG4gICAgICAgICAgICB2YXIgViA9IGdsb2JhbC5NYXRoLmF0YW47XG4gICAgICAgICAgICB2YXIgVyA9IGdsb2JhbC5NYXRoLmF0YW4yO1xuICAgICAgICAgICAgdmFyIFggPSBnbG9iYWwuTWF0aC5leHA7XG4gICAgICAgICAgICB2YXIgWSA9IGdsb2JhbC5NYXRoLmxvZztcbiAgICAgICAgICAgIHZhciBaID0gZ2xvYmFsLk1hdGguY2VpbDtcbiAgICAgICAgICAgIHZhciBfID0gZ2xvYmFsLk1hdGguaW11bDtcbiAgICAgICAgICAgIHZhciAkID0gZW52LmFib3J0O1xuICAgICAgICAgICAgdmFyIGFhID0gZW52LmFzc2VydDtcbiAgICAgICAgICAgIHZhciBhYiA9IGVudi5hc21QcmludEludDtcbiAgICAgICAgICAgIHZhciBhYyA9IGVudi5hc21QcmludEZsb2F0O1xuICAgICAgICAgICAgdmFyIGFkID0gZW52Lm1pbjtcbiAgICAgICAgICAgIHZhciBhZSA9IGVudi5pbnZva2VfaWk7XG4gICAgICAgICAgICB2YXIgYWYgPSBlbnYuaW52b2tlX3ZpO1xuICAgICAgICAgICAgdmFyIGFnID0gZW52Lmludm9rZV9paWlpaTtcbiAgICAgICAgICAgIHZhciBhaCA9IGVudi5pbnZva2VfdmlpaTtcbiAgICAgICAgICAgIHZhciBhaSA9IGVudi5pbnZva2VfdjtcbiAgICAgICAgICAgIHZhciBhaiA9IGVudi5pbnZva2VfaWlpO1xuICAgICAgICAgICAgdmFyIGFrID0gZW52Ll9zdHJuY21wO1xuICAgICAgICAgICAgdmFyIGFsID0gZW52Ll9sc2VlaztcbiAgICAgICAgICAgIHZhciBhbSA9IGVudi5fc3lzY29uZjtcbiAgICAgICAgICAgIHZhciBhbiA9IGVudi5fZnJlYWQ7XG4gICAgICAgICAgICB2YXIgYW8gPSBlbnYuX2ZjbG9zZTtcbiAgICAgICAgICAgIHZhciBhcCA9IGVudi5fc3RydG9rX3I7XG4gICAgICAgICAgICB2YXIgYXEgPSBlbnYuX2Fib3J0O1xuICAgICAgICAgICAgdmFyIGFyID0gZW52Ll9mcHJpbnRmO1xuICAgICAgICAgICAgdmFyIGFzID0gZW52Ll9jbG9zZTtcbiAgICAgICAgICAgIHZhciBhdCA9IGVudi5fcHJlYWQ7XG4gICAgICAgICAgICB2YXIgYXUgPSBlbnYuX2ZmbHVzaDtcbiAgICAgICAgICAgIHZhciBhdiA9IGVudi5fZm9wZW47XG4gICAgICAgICAgICB2YXIgYXcgPSBlbnYuX29wZW47XG4gICAgICAgICAgICB2YXIgYXggPSBlbnYuX3N0cnRvbDtcbiAgICAgICAgICAgIHZhciBheSA9IGVudi5fc3RydG9rO1xuICAgICAgICAgICAgdmFyIGF6ID0gZW52Ll9fX3NldEVyck5vO1xuICAgICAgICAgICAgdmFyIGFBID0gZW52Ll9fcmVhbGx5TmVnYXRpdmU7XG4gICAgICAgICAgICB2YXIgYUIgPSBlbnYuX2ZzZWVrO1xuICAgICAgICAgICAgdmFyIGFDID0gZW52Ll9zZW5kO1xuICAgICAgICAgICAgdmFyIGFEID0gZW52Ll93cml0ZTtcbiAgICAgICAgICAgIHZhciBhRSA9IGVudi5fc3RycmNocjtcbiAgICAgICAgICAgIHZhciBhRiA9IGVudi5fc2luO1xuICAgICAgICAgICAgdmFyIGFHID0gZW52Ll9wcmludGY7XG4gICAgICAgICAgICB2YXIgYUggPSBlbnYuX3N0cmNocjtcbiAgICAgICAgICAgIHZhciBhSSA9IGVudi5fcmVhZDtcbiAgICAgICAgICAgIHZhciBhSiA9IGVudi5fdGltZTtcbiAgICAgICAgICAgIHZhciBhSyA9IGVudi5fX2Zvcm1hdFN0cmluZztcbiAgICAgICAgICAgIHZhciBhTCA9IGVudi5fYXRvaTtcbiAgICAgICAgICAgIHZhciBhTSA9IGVudi5fcmVjdjtcbiAgICAgICAgICAgIHZhciBhTiA9IGVudi5fcHdyaXRlO1xuICAgICAgICAgICAgdmFyIGFPID0gZW52Ll9sbHZtX3Bvd19mNjQ7XG4gICAgICAgICAgICB2YXIgYVAgPSBlbnYuX2ZzeW5jO1xuICAgICAgICAgICAgdmFyIGFRID0gZW52Ll9fX2Vycm5vX2xvY2F0aW9uO1xuICAgICAgICAgICAgdmFyIGFSID0gZW52Ll9pc3NwYWNlO1xuICAgICAgICAgICAgdmFyIGFTID0gZW52Ll9zYnJrO1xuICAgICAgICAgICAgdmFyIGFUID0gZW52Ll9fcGFyc2VJbnQ7XG4gICAgICAgICAgICB2YXIgYVUgPSBlbnYuX2Z3cml0ZTtcbiAgICAgICAgICAgIHZhciBhViA9IGVudi5fc3RyY21wO1xuXG4gICAgICAgICAgICAvLyBFTVNDUklQVEVOX1NUQVJUX0ZVTkNTXG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGEwKGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGIgPSAwO1xuICAgICAgICAgICAgICAgIGIgPSBpO1xuICAgICAgICAgICAgICAgIGkgPSAoaSArIGEpIHwgMDtcbiAgICAgICAgICAgICAgICBpID0gKGkgKyA3KSAmIC04O1xuICAgICAgICAgICAgICAgIHJldHVybiBiIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGExKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBpIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGEyKGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgaSA9IGE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBhMyhhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKHAgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHAgPSBhO1xuICAgICAgICAgICAgICAgICAgICBxID0gYjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBhNChiKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGFba10gPSBhW2JdO1xuICAgICAgICAgICAgICAgIGFbKGsgKyAxKSB8IDBdID0gYVsoYiArIDEpIHwgMF07XG4gICAgICAgICAgICAgICAgYVsoayArIDIpIHwgMF0gPSBhWyhiICsgMikgfCAwXTtcbiAgICAgICAgICAgICAgICBhWyhrICsgMykgfCAwXSA9IGFbKGIgKyAzKSB8IDBdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYTUoYikge1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBhW2tdID0gYVtiXTtcbiAgICAgICAgICAgICAgICBhWyhrICsgMSkgfCAwXSA9IGFbKGIgKyAxKSB8IDBdO1xuICAgICAgICAgICAgICAgIGFbKGsgKyAyKSB8IDBdID0gYVsoYiArIDIpIHwgMF07XG4gICAgICAgICAgICAgICAgYVsoayArIDMpIHwgMF0gPSBhWyhiICsgMykgfCAwXTtcbiAgICAgICAgICAgICAgICBhWyhrICsgNCkgfCAwXSA9IGFbKGIgKyA0KSB8IDBdO1xuICAgICAgICAgICAgICAgIGFbKGsgKyA1KSB8IDBdID0gYVsoYiArIDUpIHwgMF07XG4gICAgICAgICAgICAgICAgYVsoayArIDYpIHwgMF0gPSBhWyhiICsgNikgfCAwXTtcbiAgICAgICAgICAgICAgICBhWyhrICsgNykgfCAwXSA9IGFbKGIgKyA3KSB8IDBdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYTYoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBDID0gYTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGE3KGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgRCA9IGE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBhOChhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIEUgPSBhO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYTkoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBGID0gYTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJhKGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgRyA9IGE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiYihhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIEggPSBhO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYmMoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBJID0gYTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJkKGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgSiA9IGE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiZShhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIEsgPSBhO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYmYoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBMID0gYTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJnKCkge31cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJoKGIpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGQgPSAwLFxuICAgICAgICAgICAgICAgICAgICBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGcgPSAwLFxuICAgICAgICAgICAgICAgICAgICBoID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwO1xuICAgICAgICAgICAgICAgIGQgPSBpO1xuICAgICAgICAgICAgICAgIGkgPSAoaSArIDEwMjQpIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGI7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFbZl0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBiID0gYXYoZiB8IDAsIDY1NzYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGcgPSBiO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggPSBnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSBoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBqIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFbZiB8IDBdIHwgMCkgIT0gNDcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9IGNbMTY2NF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSAxNjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbZSB8IDBdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBjMShjW2IgPj4gMl0gfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG4gPSBjW2IgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMyKG0gfCAwLCBuIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYVsoZSArIChsIC0gMSkpIHwgMF0gfCAwKSAhPSA0Nykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhWyhlICsgbCkgfCAwXSA9IDQ3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhWyhlICsgKGwgKyAxKSkgfCAwXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYzMoZSB8IDAsIGYgfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gYXYoZSB8IDAsIDY1NzYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPSBsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChsIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9IGNbKGIgKyA0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgPT0gMTYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggPSBnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gaDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBqIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGggPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaiA9IGg7XG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBqIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIGggPSAwO1xuICAgICAgICAgICAgICAgIGogPSBoO1xuICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgIHJldHVybiBqIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJpKGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGIgPSAwO1xuICAgICAgICAgICAgICAgIGIgPSBjJChhKSB8IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGIgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYmooYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgYiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGQgPSAwLFxuICAgICAgICAgICAgICAgICAgICBlID0gMDtcbiAgICAgICAgICAgICAgICBiID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYmkoOCkgfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoYSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjW2EgPj4gMl0gPSBiaSgoKGMxKGIgfCAwKSB8IDApICsgMSkgfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKChjW2EgPj4gMl0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGMwKGEpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZCA9IGNbYSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGUgPSBiO1xuICAgICAgICAgICAgICAgICAgICBjMihkIHwgMCwgZSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1soYSArIDQpID4+IDJdID0gY1sxNjY0XTtcbiAgICAgICAgICAgICAgICAgICAgY1sxNjY0XSA9IGE7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiaygpIHtcbiAgICAgICAgICAgICAgICB2YXIgYSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGIgPSAwO1xuICAgICAgICAgICAgICAgIGEgPSBjWzE2NjRdIHwgMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGEgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBiID0gY1soYSArIDQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYzAoY1thID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgIGMwKGEpO1xuICAgICAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1sxNjY0XSA9IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYmwoZiwgaCwgaiwgaywgbCwgbiwgbywgcCwgcSkge1xuICAgICAgICAgICAgICAgIGYgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICBoID0gaCB8IDA7XG4gICAgICAgICAgICAgICAgaiA9IGogfCAwO1xuICAgICAgICAgICAgICAgIGsgPSBrIHwgMDtcbiAgICAgICAgICAgICAgICBsID0gbCB8IDA7XG4gICAgICAgICAgICAgICAgbiA9IG4gfCAwO1xuICAgICAgICAgICAgICAgIG8gPSBvIHwgMDtcbiAgICAgICAgICAgICAgICBwID0gcCB8IDA7XG4gICAgICAgICAgICAgICAgcSA9IHEgfCAwO1xuICAgICAgICAgICAgICAgIHZhciByID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHQgPSAwLFxuICAgICAgICAgICAgICAgICAgICB1ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHcgPSAwLFxuICAgICAgICAgICAgICAgICAgICB4ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgeSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHogPSAwLFxuICAgICAgICAgICAgICAgICAgICBBID0gMCxcbiAgICAgICAgICAgICAgICAgICAgQiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEMgPSAwLFxuICAgICAgICAgICAgICAgICAgICBEID0gMCxcbiAgICAgICAgICAgICAgICAgICAgRSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBHID0gMCxcbiAgICAgICAgICAgICAgICAgICAgSCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEkgPSAwO1xuICAgICAgICAgICAgICAgIGogPSBpO1xuICAgICAgICAgICAgICAgIGkgPSAoaSArIDEwNTYpIHwgMDtcbiAgICAgICAgICAgICAgICByID0gaiB8IDA7XG4gICAgICAgICAgICAgICAgcyA9IChqICsgMTAyNCkgfCAwO1xuICAgICAgICAgICAgICAgIHQgPSAoaiArIDEwMzIpIHwgMDtcbiAgICAgICAgICAgICAgICB1ID0gKGogKyAxMDQwKSB8IDA7XG4gICAgICAgICAgICAgICAgdiA9IChqICsgMTA0OCkgfCAwO1xuICAgICAgICAgICAgICAgIHcgPSBmO1xuICAgICAgICAgICAgICAgIGYgPSBoO1xuICAgICAgICAgICAgICAgIGggPSBrO1xuICAgICAgICAgICAgICAgIGsgPSBsO1xuICAgICAgICAgICAgICAgIGwgPSBuO1xuICAgICAgICAgICAgICAgIG4gPSBvO1xuICAgICAgICAgICAgICAgIG8gPSBwO1xuICAgICAgICAgICAgICAgIHAgPSBxO1xuICAgICAgICAgICAgICAgIHEgPSAwO1xuICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgeCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHkgPSB4O1xuICAgICAgICAgICAgICAgICAgICBpID0gajtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHkgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB6ID0gYmgoZikgfCAwO1xuICAgICAgICAgICAgICAgIEEgPSB6O1xuICAgICAgICAgICAgICAgIGlmICgoeiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgeiA9IGNbbSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgeiB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICA2NTEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgKCh6ID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgMSkgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyA3KSAmIC04KSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjW3ogPj4gMl0gPSAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHopIHwgMFxuICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IHo7XG4gICAgICAgICAgICAgICAgICAgIHEgPSAxO1xuICAgICAgICAgICAgICAgICAgICBCID0gMDtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soMTA0OCArIChCIDw8IDIpKSA+PiAyXSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHogPSBjMShmIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoeiArIChjMShjWygxMDQ4ICsgKEIgPDwgMikpID4+IDJdIHwgMCkgfCAwKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAyNFxuICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IHIgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSBmO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMyKHogfCAwLCBDIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSByIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gY1soMTA0OCArIChCIDw8IDIpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYzMoQyB8IDAsIHogfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IGJoKHIgfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgQSA9IHo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh6IHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gNDY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIEIgPSAoQiArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKEQgfCAwKSA9PSA0Nikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gciB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKChxIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICB4ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgeSA9IHg7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBqO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4geSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKDIzOSA9PSAoYW4ociB8IDAsIDEsIDIzOSwgQSB8IDApIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYzQociB8IDAsIDYyNDgsIDIyKSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGM0KHIgfCAwLCA1ODg4LCAyMikgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFbKHIgKyA4MikgfCAwXSB8IDApICE9IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhWyhyICsgODIpIHwgMF0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeSA9IHg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhWyhyICsgMTUxKSB8IDBdIHwgMCkgIT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFbKHIgKyAxNTEpIHwgMF0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeSA9IHg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBxID0gYmkoOCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1txID4+IDJdID0gYVsociArIDE5OCkgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgNCkgPj4gMl0gPSBiaSgoKGNbcSA+PiAyXSB8IDApICogMTE2KSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIEIgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEIgfCAwKSA+PSAoY1txID4+IDJdIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDE2MjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFCKEEgfCAwLCA3LCAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDEgIT0gKGFuKHMgfCAwLCAxLCAxLCBBIHwgMCkgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gNjY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmID0gKChjWyhxICsgNCkgPj4gMl0gfCAwKSArICgoQiAqIDExNikgfCAwKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgxICE9IChhbih0IHwgMCwgNCwgMSwgQSB8IDApIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDczO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDgpID4+IDJdID0gY1t0ID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgxICE9IChhbih0IHwgMCwgNCwgMSwgQSB8IDApIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDc1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tmID4+IDJdID0gY1t0ID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgxICE9IChhbih0IHwgMCwgNCwgMSwgQSB8IDApIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDc3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDQpID4+IDJdID0gY1t0ID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgxICE9IChhbih1IHwgMCwgMiwgMSwgQSB8IDApIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDc5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDEyKSA+PiAyXSA9IGVbdSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDEgIT0gKGFuKHQgfCAwLCA0LCAxLCBBIHwgMCkgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgMjQpID4+IDJdID0gY1t0ID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgxICE9IChhbih0IHwgMCwgNCwgMSwgQSB8IDApIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDgzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDI4KSA+PiAyXSA9IGNbdCA+PiAyXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMSAhPSAoYW4odCB8IDAsIDQsIDEsIEEgfCAwKSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEQgPSA4NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGYgKyAzMikgPj4gMl0gPSBjW3QgPj4gMl07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDE2KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDIwKSA+PiAyXSA9IDEyNztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhQihBIHwgMCwgMiwgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgxICE9IChhbih2IHwgMCwgMSwgMSwgQSB8IDApIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDg3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYVtyIHwgMF0gPSBhW3ZdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGggfCAwKSA9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhWyhmICsgMTExKSB8IDBdID0gKChhW3IgfCAwXSA8PCAzKSArIDQpICYgMTI3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbKGYgKyAxMTEpIHwgMF0gPSBoICYgMTI3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMTggIT0gKGFuKHIgfCAwLCAxLCAxOCwgQSB8IDApIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDkyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFbKHIgKyAxMykgfCAwXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYVsociArIDE0KSB8IDBdIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEQgPSA5NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGYgKyA5MikgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJtKHcsIGFbKHIgKyAxMikgfCAwXSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGYgKyA5NikgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJuKHcsIGFbKHIgKyAxMykgfCAwXSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbKGYgKyAxMDgpIHwgMF0gPSBhWyhyICsgMTQpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDk1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChEIHwgMCkgPT0gOTUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbKGYgKyAxMDgpIHwgMF0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgOTYpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDkyKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhWyhyICsgMTYpIHwgMF0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFbKHIgKyAxNykgfCAwXSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gOTk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgMTA0KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm8odywgYVsociArIDE2KSB8IDBdIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDEwMCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJwKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhWyhyICsgMTUpIHwgMF0gfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgMTA0KSA+PiAyXSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbKGYgKyAxMDkpIHwgMF0gPSBhWyhyICsgMTcpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDk5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChEIHwgMCkgPT0gOTkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbKGYgKyAxMDkpIHwgMF0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgMTA0KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGYgKyAxMDApID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDEgIT0gKGFuKHYgfCAwLCAxLCAxLCBBIHwgMCkgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gMTAyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYVsoZiArIDExMCkgfCAwXSA9IGFbdl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFCKEEgfCAwLCA0MCwgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobCB8IDApICE9IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbKGYgKyAxMTIpIHwgMF0gPSBsICYgMjU1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbKGYgKyAxMTIpIHwgMF0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChhWyhmICsgMTEwKSB8IDBdICYgNCkgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHogPSAoZiArIDExMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhW3pdID0gKGRbel0gfCAzMikgJiAyNTU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChuIHwgMCkgPT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoYVsoZiArIDExMCkgfCAwXSAmIDYwKSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHogPSAoZiArIDExMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVt6XSA9IGRbel0gJiAtNjEgJiAyNTU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG8gfCAwKSA9PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoYVsoZiArIDExMCkgfCAwXSAmIDY0KSB8IDApICE9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHogPSAoZiArIDExMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhW3pdID0gZFt6XSAmIC02NSAmIDI1NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG8gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChhWyhmICsgMTEwKSB8IDBdICYgMjgpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjNChyIHwgMCwgNTUxMiwgNikgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFbKHIgKyAxMSkgfCAwXSB8IDApID49XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gMTIwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoYVsoZiArIDExMCkgfCAwXSAmIDMyKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IChmICsgMTEwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVt6XSA9IGRbel0gJiAtNjUgJiAyNTU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gMTIwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChEIHwgMCkgPT0gMTIwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEQgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gKGYgKyAxMTApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVt6XSA9IGRbel0gJiAtNjUgJiAyNTU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gKGYgKyAxMTApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhW3pdID0gZFt6XSAmIC05NyAmIDI1NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEUgfCAwKSA+PSA2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgMzYgKyAoRSA8PCAyKSkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnEodywgYVsociArIEUpIHwgMF0gfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGYgKyA2MCArIChFIDw8IDIpKSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicihhWyhyICsgKEUgKyA2KSkgfCAwXSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRSA9IChFICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgODgpID4+IDJdID0gYmkoY1soZiArIDgpID4+IDJdIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYW4oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgODgpID4+IDJdIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGYgKyA4KSA+PiAyXSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gMTMyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoYVsoZiArIDExMCkgfCAwXSAmIDEpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gY1soZiArIDgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQyA9IGNbKGYgKyA4OCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGID0gYmkoY1soZiArIDgpID4+IDJdIDw8IDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRyA9IEY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEggPSBGO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRiA9IHo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gKEYgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGID0gQztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSAoRiArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEkgPSBIO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSCA9IChJICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYltJID4+IDFdID0gKChhW0ZdICYgMjU1KSA8PCA4KSAmIDY1NTM1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSBjWyhmICsgODgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDg4KSA+PiAyXSA9IEc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMwKEMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIID0gKGYgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbSCA+PiAyXSA9IGNbSCA+PiAyXSA8PCAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIID0gZiB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbSCA+PiAyXSA9IGNbSCA+PiAyXSA8PCAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIID0gKGYgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbSCA+PiAyXSA9IGNbSCA+PiAyXSA8PCAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChhWyhmICsgMTEwKSB8IDBdICYgMikgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEggPSAoKGNbKGYgKyA4KSA+PiAyXSB8IDApIC8gMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gY1soZiArIDg4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGID0gSDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEggPSAoRiAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoRiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEYgPSB6O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IChGICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYltGID4+IDFdID0gKGJbRiA+PiAxXSBeIDMyNzY4KSAmIDY1NTM1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKGFbKGYgKyAxMTApIHwgMF0gJiAxNikgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJzKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDg4KSA+PiAyXSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhmICsgOCkgPj4gMl0gfCAwKSAvIDIpIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gY1tmID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tmID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWyhmICsgOCkgPj4gMl0gfCAwKSAtXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1soZiArIDQpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGYgKyA0KSA+PiAyXSA9IChjWyhmICsgOCkgPj4gMl0gfCAwKSAtIHo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHogPSAoZiArIDExMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhW3pdID0gZFt6XSAmIC0xNyAmIDI1NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IChmICsgMTEwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbel0gPSAoZFt6XSB8IDQpICYgMjU1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGsgfCAwKSAhPSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnWyhmICsgODQpID4+IDJdID0gKyhrIHwgMCkgLyAxMDAuMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gKChjWyhmICsgOCkgPj4gMl0gfCAwKSAvIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSCA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSBjWyhmICsgODgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEcgPSB6O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IChHIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChHIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRyA9IEM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDID0gKEcgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGID0gYltHID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKChGIDw8IDE2KSA+PiAxNikgfCAwKSA8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGID0gLSgoRiA8PCAxNikgPj4gMTYpICYgNjU1MzU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoRiA8PCAxNikgPj4gMTYpIHwgMCkgPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKEggPDwgMTYpID4+IDE2KSB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIID0gRjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnWyhmICsgODQpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMyNzY4LjAgLyArKCgoSCA8PCAxNikgPj4gMTYpIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSAoZiArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW0MgPj4gMl0gPSAoKGNbQyA+PiAyXSB8IDApIC8gMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW0MgPj4gMl0gPSAoKGNbQyA+PiAyXSB8IDApIC8gMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSAoZiArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW0MgPj4gMl0gPSAoKGNbQyA+PiAyXSB8IDApIC8gMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSAoZiArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW0MgPj4gMl0gPSBjW0MgPj4gMl0gPDwgMTI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgQyA9IGYgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbQyA+PiAyXSA9IGNbQyA+PiAyXSA8PCAxMjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDID0gKGYgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tDID4+IDJdID0gY1tDID4+IDJdIDw8IDEyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW0MgPj4gMl0gPSBjW0MgPj4gMl0gfCAoKGFbc10gJiAxNSkgPDwgOCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgQyA9IChmICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbQyA+PiAyXSA9IGNbQyA+PiAyXSB8ICgoKGRbc10gPj4gNCkgJiAxNSkgPDwgOCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFbKGYgKyAxMTIpIHwgMF0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChhWyhmICsgMTEwKSB8IDBdICYgNCkgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjRih3LCBmKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgocCB8IDApID09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZiArIDgpID4+IDJdID0gY1soZiArIDQpID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCID0gKEIgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEQgfCAwKSAhPSA2NilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEQgfCAwKSAhPSA3MylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChEIHwgMCkgIT0gNzUpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEQgfCAwKSAhPSA3NylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEQgfCAwKSAhPSA3OSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChEIHwgMCkgIT0gODEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEQgfCAwKSAhPSA4MylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEQgfCAwKSAhPSA4NSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChEIHwgMCkgIT0gODcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEQgfCAwKSAhPSA5MilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChEIHwgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoRCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEzMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEQgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2MlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW8oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEEgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggPSBxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHkgPSB4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIEUgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEUgfCAwKSA+PSAoQiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjMChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1socSArIDQpID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoRSAqIDExNikgfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgODgpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRSA9IChFICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYzAoY1socSArIDQpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjMChxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHggPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgeSA9IHg7XG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB5IHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIHggPSAwO1xuICAgICAgICAgICAgICAgIHkgPSB4O1xuICAgICAgICAgICAgICAgIGkgPSBqO1xuICAgICAgICAgICAgICAgIHJldHVybiB5IHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJtKGEsIGIpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBkID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGYgPSAwO1xuICAgICAgICAgICAgICAgIGQgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBiO1xuICAgICAgICAgICAgICAgIGlmICgoYSA8PCAyNCkgPj4gMjQgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBiID0gKCgoY1soZCArIDEzMDYwKSA+PiAyXSB8IDApICogMzgpIHwgMCkgPDwgMTY7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoKGIgfCAwKSAvIChfKGNbKGQgKyA0KSA+PiAyXSB8IDAsIGEgJiAyNTUpIHwgMCkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBlID0gMDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBibihhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZCA9IDA7XG4gICAgICAgICAgICAgICAgZCA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IChfKGNbKGQgKyAxMzA2MCkgPj4gMl0gPDwgMTAsIGIgJiAyNTUpIHwgMCkgPDwgNTtcbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAoKGEgfCAwKSAvICgoKGNbKGQgKyA0KSA+PiAyXSB8IDApICogMzgpIHwgMCB8IDApKSB8IDAgfCAwXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJvKGEsIGIpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICgoKChjWyhhICsgNCkgPj4gMl0gfCAwKSAqIDM4KSB8IDAgfCAwKSAvXG4gICAgICAgICAgICAgICAgICAgICAgICAoKCgoYiAmIDI1NSkgPDwgMSkgPDwgNSkgfCAwKSkgfFxuICAgICAgICAgICAgICAgICAgICAwIHxcbiAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBicChhLCBiLCBkKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgZSA9IGI7XG4gICAgICAgICAgICAgICAgaWYgKChlIDw8IDI0KSA+PiAyNCAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPSB+fihcbiAgICAgICAgICAgICAgICAgICAgICAgICgrKGQgfCAwKSAqIDM4LjAgKiA2NTUzNi4wKSAvXG4gICAgICAgICAgICAgICAgICAgICAgICArKF8oY1soYSArIDQpID4+IDJdIHwgMCwgZSAmIDI1NSkgfCAwKVxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICBnID0gZjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGcgfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPSAwO1xuICAgICAgICAgICAgICAgICAgICBnID0gZjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGcgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJxKGEsIGIpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBkID0gMDtcbiAgICAgICAgICAgICAgICBkID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICBiID0gKDMgLSAoKChhICYgMjU1KSA+PiA2KSAmIDMpKSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IChiICogMykgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSAoYSAmIDYzKSA8PCBiO1xuICAgICAgICAgICAgICAgIGIgPVxuICAgICAgICAgICAgICAgICAgICBfKFxuICAgICAgICAgICAgICAgICAgICAgICAgKCgoYiAqIDQ0MTAwKSB8IDAgfCAwKSAvIChjWyhkICsgNCkgPj4gMl0gfCAwKSkgfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgY1soZCArIDEzMDYwKSA+PiAyXSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuIChiIDw8IDEwKSB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBicihhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIHJldHVybiAoKGEgJiAyNTUpIDw8IDIyKSB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBicyhhLCBjLCBkKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGMgPSBjIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMDtcbiAgICAgICAgICAgICAgICBlID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYztcbiAgICAgICAgICAgICAgICBjID0gZDtcbiAgICAgICAgICAgICAgICBkID0gKGUgKyAoYyA8PCAxKSkgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSAoZSArIChhIDw8IDEpKSB8IDA7XG4gICAgICAgICAgICAgICAgYyA9IChjIC0gYSkgfCAwO1xuICAgICAgICAgICAgICAgIGMgPSAoKGMgfCAwKSAvIDIpIHwgMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBhID0gYztcbiAgICAgICAgICAgICAgICAgICAgYyA9IChhIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGEgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBhID0gYltlID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoZiArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYltmID4+IDFdID0gYltkID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIGQgPSAoZiAtIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYltmID4+IDFdID0gYTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYnQoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICByZXR1cm4gY1soYSArIDEzMTM2KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJ1KGEsIGIpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBkID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGYgPSAwO1xuICAgICAgICAgICAgICAgIGQgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBiO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChhIHwgMCkgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3RvcHMgd2hlbiByZWFjaGVkIGxhc3QgaW5zdHJ1bWVudFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhIHwgMCkgPj0gKGNbKGQgKyAxMzEzNikgPj4gMl0gfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gcGF0aCB0byBwYXRjaCBmaWxlXG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gY1soZCArIDEzMTQwICsgKGEgPDwgMikpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGYgPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGYgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgZSA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGYgfCAwO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBidihhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBiID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwO1xuICAgICAgICAgICAgICAgIGIgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSAxMjg7XG4gICAgICAgICAgICAgICAgZCA9IDA7XG4gICAgICAgICAgICAgICAgY1soYiArIDEzMTM2KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgZSA9IGE7XG4gICAgICAgICAgICAgICAgICAgIGEgPSAoZSAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChlIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhiICsgMjggKyAoYSA8PCAyKSkgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gKGQgKyAoYncoYiwgMCwgYSkgfCAwKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soYiArIDU0MCArIChhIDw8IDIpKSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZCArIChidyhiLCAxLCBhKSB8IDApKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGQgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYncoYSwgYiwgZCkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGcgPSAwLFxuICAgICAgICAgICAgICAgICAgICBoID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG8gPSAwLFxuICAgICAgICAgICAgICAgICAgICBwID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBzID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHUgPSAwLFxuICAgICAgICAgICAgICAgICAgICB2ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdyA9IDA7XG4gICAgICAgICAgICAgICAgZSA9IGk7XG4gICAgICAgICAgICAgICAgZiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGI7XG4gICAgICAgICAgICAgICAgYiA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IDA7XG4gICAgICAgICAgICAgICAgaWYgKChhIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBnID0gY1soZiArIDU0MCArIChiIDw8IDIpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZyA9IGNbKGYgKyAyOCArIChiIDw8IDIpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGggPSBnO1xuICAgICAgICAgICAgICAgIGlmICgoaCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgaiA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGsgPSBqO1xuICAgICAgICAgICAgICAgICAgICBpID0gZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGsgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBnID0gMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSA+PSAxMjgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soaCArIDQgKyAoZyA8PCAyKSkgPj4gMl0gfCAwKSA9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGggKyA0ICsgKGcgPDwgMikpID4+IDJdID0gYkIoZiwgYSwgYiwgZykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soaCArIDQgKyAoZyA8PCAyKSkgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWygoY1toID4+IDJdIHwgMCkgKyAoKGcgKiAyOCkgfCAwKSkgPj4gMl0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gZjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWygoY1toID4+IDJdIHwgMCkgKyAoKGcgKiAyOCkgfCAwKSkgPj4gMl0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IChhIHwgMCkgIT0gMCA/IDEgOiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW2ggPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZyAqIDI4KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW2ggPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZyAqIDI4KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1toID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGcgKiAyOCkgfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1toID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChnICogMjgpIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IC0xO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IHM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW2ggPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZyAqIDI4KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1toID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChnICogMjgpIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gKGEgfCAwKSAhPSAwID8gMSA6IC0xO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1toID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGcgKiAyOCkgfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIwKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbaCA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZyAqIDI4KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIwKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IChhIHwgMCkgIT0gMCA/IDEgOiAtMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbaCA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZyAqIDI4KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soaCArIDQgKyAoZyA8PCAyKSkgPj4gMl0gPSB2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gY1ttID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1toID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChnICogMjgpIHwgMCkpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2IHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1MTIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgodiA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyA4KSB8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW3YgPj4gMl0gPSBxKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2KSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IHY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKGYgKyAxMzEzNikgPj4gMl0gfCAwKSA8IDI1Nikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBjW20gPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBjWyhmICsgMTMxMzYpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ4NTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgodiA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgOCkgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbdiA+PiAyXSA9IHApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2KSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gdjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMzE0MCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1soZiArIDEzMTM2KSA+PiAyXSA8PCAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1toID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZyAqIDI4KSB8IDApKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gKGYgKyAxMzEzNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbdiA+PiAyXSA9IChjW3YgPj4gMl0gfCAwKSArIDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gKGQgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGEgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZiArIDU0MCkgPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGcgPDwgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZiArIDU0MCkgPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGcgPDwgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhmICsgMjgpID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChnIDw8IDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGYgKyAyOCkgPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGcgPDwgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGggKyA0ICsgKGcgPDwgMikpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChkICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gMjQ2O1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gMjQ2O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCh3IHwgMCkgPT0gMjQ2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBnID0gKGcgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGogPSBkO1xuICAgICAgICAgICAgICAgIGsgPSBqO1xuICAgICAgICAgICAgICAgIGkgPSBlO1xuICAgICAgICAgICAgICAgIHJldHVybiBrIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJ4KGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBkID0gMDtcbiAgICAgICAgICAgICAgICBiID0gYTtcbiAgICAgICAgICAgICAgICBhID0gMTI4O1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGQgPSBhO1xuICAgICAgICAgICAgICAgICAgICBhID0gKGQgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soYiArIDI4ICsgKGEgPDwgMikpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnkoYiwgMCwgYSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhiICsgNTQwICsgKGEgPDwgMikpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnkoYiwgMSwgYSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYnkoYSwgYiwgZCkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDA7XG4gICAgICAgICAgICAgICAgZSA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGQ7XG4gICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBmID0gY1soZSArIDU0MCArIChhIDw8IDIpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGNbKGUgKyAyOCArIChhIDw8IDIpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGEgPSBmO1xuICAgICAgICAgICAgICAgIGYgPSAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID49IDEyOCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhhICsgNCArIChmIDw8IDIpKSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soYSArIDQgKyAoZiA8PCAyKSkgPj4gMl0gfCAwKSAhPSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJBKGNbKGEgKyA0ICsgKGYgPDwgMikpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhhICsgNCArIChmIDw8IDIpKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZiA9IChmICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBieihhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMDtcbiAgICAgICAgICAgICAgICBkID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYmwoZCwgYiwgMCwgLTEsIC0xLCAtMSwgMCwgMCwgMCkgfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoYSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgY1soZCArIDEwNTIpID4+IDJdID0gYTtcbiAgICAgICAgICAgICAgICAgICAgY1soZCArIDEwNTYpID4+IDJdID0gLTE7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAwO1xuICAgICAgICAgICAgICAgICAgICBmID0gZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGYgfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAtMTtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiQShhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBiID0gMDtcbiAgICAgICAgICAgICAgICBiID0gYTtcbiAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYSA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChhIHwgMCkgPj0gKGNbYiA+PiAyXSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjMChcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKChjWyhiICsgNCkgPj4gMl0gfCAwKSArICgoYSAqIDExNikgfCAwKSArIDg4KSA+PiAyXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICBhID0gKGEgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGMwKGNbKGIgKyA0KSA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgIGMwKGIpO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJCKGEsIGIsIGQsIGUpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGkgPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMDtcbiAgICAgICAgICAgICAgICBmID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICBiID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZTtcbiAgICAgICAgICAgICAgICBpZiAoKGNbKGYgKyAyNCkgPj4gMl0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGcgPSAwO1xuICAgICAgICAgICAgICAgICAgICBoID0gZztcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGggfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBhID0gKGEgfCAwKSAhPSAwID8gLTIxNDc0ODM2NDggOiAwO1xuICAgICAgICAgICAgICAgIGUgPSAwO1xuICAgICAgICAgICAgICAgIEwzNjg6IHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPj4+IDAgPj1cbiAgICAgICAgICAgICAgICAgICAgICAgIChjWygoY1soZiArIDI0KSA+PiAyXSB8IDApICsgNCkgPj4gMl0gfCAwKSA+Pj4gMFxuICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGkgPVxuICAgICAgICAgICAgICAgICAgICAgICAgKChjWygoY1soZiArIDI0KSA+PiAyXSB8IDApICsgOCkgPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChlICogMjApIHwgMCkpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKChjWyhpICsgNCkgPj4gMl0gfCAwKSArIDQpID4+IDJdICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTIxNDc0ODM2NDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYSB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKChjWygoY1soaSArIDQpID4+IDJdIHwgMCkgKyA0KSA+PiAyXSB8IDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCkgJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjU1KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYiB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWygoY1soaSArIDQpID4+IDJdIHwgMCkgKyA4KSA+PiAyXSB8IDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IDI5NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDM2ODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGUgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChlIHwgMCkgPT0gKGNbKChjWyhmICsgMjQpID4+IDJdIHwgMCkgKyA0KSA+PiAyXSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlID4+PiAwID49XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWygoY1soZiArIDI0KSA+PiAyXSB8IDApICsgNCkgPj4gMl0gfCAwKSA+Pj4gMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soKGNbKGYgKyAyNCkgPj4gMl0gfCAwKSArIDgpID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChlICogMjApIHwgMCkpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soKGNbKGkgKyA0KSA+PiAyXSB8IDApICsgNCkgPj4gMl0gJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTIxNDc0ODM2NDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbKChjWyhpICsgNCkgPj4gMl0gfCAwKSArIDgpID4+IDJdIHwgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gMzA0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA9IChlICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgaWYgKChlIHwgMCkgPT0gKGNbKChjWyhmICsgMjQpID4+IDJdIHwgMCkgKyA0KSA+PiAyXSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgIGcgPSAwO1xuICAgICAgICAgICAgICAgICAgICBoID0gZztcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGggfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBqID0gYmkoOCkgfCAwO1xuICAgICAgICAgICAgICAgIGNbaiA+PiAyXSA9IGNbY1soaSArIDQpID4+IDJdID4+IDJdO1xuICAgICAgICAgICAgICAgIGNbKGogKyA0KSA+PiAyXSA9IGJpKCgoY1tqID4+IDJdIHwgMCkgKiAxMTYpIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgIGM1KGNbKGogKyA0KSA+PiAyXSB8IDAsIDAsICgoY1tqID4+IDJdIHwgMCkgKiAxMTYpIHwgMCB8IDApO1xuICAgICAgICAgICAgICAgIGUgPSAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChlID4+PiAwID49IChjW2NbKGkgKyA0KSA+PiAyXSA+PiAyXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBiQyhmLCAoKGNbKGogKyA0KSA+PiAyXSB8IDApICsgKChlICogMTE2KSB8IDApKSB8IDAsIGksIGUpO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGUgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGcgPSBqO1xuICAgICAgICAgICAgICAgIGggPSBnO1xuICAgICAgICAgICAgICAgIHJldHVybiBoIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJDKGIsIGYsIGgsIGkpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGYgfCAwO1xuICAgICAgICAgICAgICAgIGggPSBoIHwgMDtcbiAgICAgICAgICAgICAgICBpID0gaSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBrID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG0gPSAwLFxuICAgICAgICAgICAgICAgICAgICBuID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHAgPSAwLFxuICAgICAgICAgICAgICAgICAgICBxID0gMCxcbiAgICAgICAgICAgICAgICAgICAgciA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHMgPSAwLFxuICAgICAgICAgICAgICAgICAgICB0ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHYgPSAwLFxuICAgICAgICAgICAgICAgICAgICB3ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgeCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHkgPSAwLFxuICAgICAgICAgICAgICAgICAgICB6ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgQSA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgQiA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgQyA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgRCA9IDAuMDtcbiAgICAgICAgICAgICAgICBqID0gYjtcbiAgICAgICAgICAgICAgICBiID0gZjtcbiAgICAgICAgICAgICAgICBmID0gaDtcbiAgICAgICAgICAgICAgICBoID0gKChjWyhmICsgOCkgPj4gMl0gfCAwKSArICgoaSAqIDI0KSB8IDApKSB8IDA7XG4gICAgICAgICAgICAgICAgaSA9XG4gICAgICAgICAgICAgICAgICAgICgoY1soKGNbKGogKyAyNCkgPj4gMl0gfCAwKSArIDIwKSA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICgoKGNbKChjWyhoICsgNCkgPj4gMl0gfCAwKSArIDgpID4+IDJdIHwgMCkgKiAyMCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApKSB8XG4gICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgayA9ICgxMDU2ICsgKChlW2NbaCA+PiAyXSA+PiAxXSB8IDApIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgY1soYiArIDI0KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgIGRba10gfFxuICAgICAgICAgICAgICAgICAgICAoZFsoayArIDEpIHwgMF0gPDwgOCkgfFxuICAgICAgICAgICAgICAgICAgICAoZFsoayArIDIpIHwgMF0gPDwgMTYpIHxcbiAgICAgICAgICAgICAgICAgICAgKGRbKGsgKyAzKSB8IDBdIDw8IDI0KTtcbiAgICAgICAgICAgICAgICBrID0gKDEwNTYgKyAoKGVbKChjW2ggPj4gMl0gfCAwKSArIDIpID4+IDFdIHwgMCkgPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICBjWyhiICsgMjgpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgZFtrXSB8XG4gICAgICAgICAgICAgICAgICAgIChkWyhrICsgMSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgIChkWyhrICsgMikgfCAwXSA8PCAxNikgfFxuICAgICAgICAgICAgICAgICAgICAoZFsoayArIDMpIHwgMF0gPDwgMjQpO1xuICAgICAgICAgICAgICAgIGsgPVxuICAgICAgICAgICAgICAgICAgICAoMTA1NiArICgoZVsoKGNbKGggKyA4KSA+PiAyXSB8IDApICsgNCkgPj4gMV0gfCAwKSA8PCAyKSkgfFxuICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgIGNbKGIgKyAzMikgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICBkW2tdIHxcbiAgICAgICAgICAgICAgICAgICAgKGRbKGsgKyAxKSB8IDBdIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgKGRbKGsgKyAyKSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgIChkWyhrICsgMykgfCAwXSA8PCAyNCk7XG4gICAgICAgICAgICAgICAgY1soYiArIDE2KSA+PiAyXSA9IGVbKChjW2ggPj4gMl0gfCAwKSArIDQpID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICBjWyhiICsgMjApID4+IDJdID0gZVsoKGNbaCA+PiAyXSB8IDApICsgNikgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgIGFbKGIgKyAxMTApIHwgMF0gPSAxO1xuICAgICAgICAgICAgICAgIGNbKGIgKyAxMikgPj4gMl0gPSBjWygoY1tpID4+IDJdIHwgMCkgKyA0KSA+PiAyXTtcbiAgICAgICAgICAgICAgICBjWyhiICsgOCkgPj4gMl0gPSAoKChjWyhpICsgOCkgPj4gMl0gfCAwKSA+Pj4gMCkgLyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgY1soYiArIDg4KSA+PiAyXSA9IGJpKGNbKGkgKyA4KSA+PiAyXSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICBrID0gY1soYiArIDg4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgbCA9IGNbKGkgKyA0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgbSA9IGNbKGkgKyA4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgYzYoayB8IDAsIGwgfCAwLCBtKSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKChjWygoY1soaCArIDgpID4+IDJdIHwgMCkgKyAxNikgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIG0gPSAoYiArIDExMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBhW21dID0gKGRbbV0gfCAwIHwgMzYpICYgMjU1O1xuICAgICAgICAgICAgICAgICAgICBjW2IgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgKCgoY1soKGNbKGggKyAxMikgPj4gMl0gfCAwKSArIDgpID4+IDJdIHwgMCkgPj4+IDApIC9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICBjWyhiICsgNCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbYiA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICgoKChjWygoY1soaCArIDEyKSA+PiAyXSB8IDApICsgMTIpID4+IDJdIHwgMCkgPj4+IDApIC9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGdbKGIgKyA4NCkgPj4gMl0gPSAxLjA7XG4gICAgICAgICAgICAgICAgaWYgKCgoYVsoYiArIDExMCkgfCAwXSAmIDMyKSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgbiA9IGI7XG4gICAgICAgICAgICAgICAgICAgIG8gPSAobiArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgcCA9IGNbbyA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHEgPSBwIDw8IDEyO1xuICAgICAgICAgICAgICAgICAgICBjW28gPj4gMl0gPSBxO1xuICAgICAgICAgICAgICAgICAgICByID0gYjtcbiAgICAgICAgICAgICAgICAgICAgcyA9IHIgfCAwO1xuICAgICAgICAgICAgICAgICAgICB0ID0gY1tzID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgdSA9IHQgPDwgMTI7XG4gICAgICAgICAgICAgICAgICAgIGNbcyA+PiAyXSA9IHU7XG4gICAgICAgICAgICAgICAgICAgIHYgPSBiO1xuICAgICAgICAgICAgICAgICAgICB3ID0gKHYgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHggPSBjW3cgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICB5ID0geCA8PCAxMjtcbiAgICAgICAgICAgICAgICAgICAgY1t3ID4+IDJdID0geTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBtID0gMDtcbiAgICAgICAgICAgICAgICBsID0gMDtcbiAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soZiArIDEyKSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1soKGNbKGYgKyAxMikgPj4gMl0gfCAwKSArIDQpID4+IDJdIHwgMCkgPj4+IDAgPD1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gMzI2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhmICsgMTYpID4+IDJdIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHogPSAzMjY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBtID0gY1soZiArIDEyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gY1soZiArIDE2KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB6ID0gMzI2O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgaWYgKCh6IHwgMCkgPT0gMzI2KSB7XG4gICAgICAgICAgICAgICAgICAgIG0gPSBjWyhoICsgMTYpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgbCA9IGNbKGggKyAyMCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBoID0gYkQoY1sobSArIDQpID4+IDJdIHwgMCwgbCwgNTE4KSB8IDA7XG4gICAgICAgICAgICAgICAgQSA9ICtiRShoKTtcbiAgICAgICAgICAgICAgICBoID0gYkQoY1sobSArIDQpID4+IDJdIHwgMCwgbCwgNTI0KSB8IDA7XG4gICAgICAgICAgICAgICAgQiA9ICtiRShoKTtcbiAgICAgICAgICAgICAgICBoID0gYkQoY1sobSArIDQpID4+IDJdIHwgMCwgbCwgNTE5KSB8IDA7XG4gICAgICAgICAgICAgICAgQyA9ICtiRShoKTtcbiAgICAgICAgICAgICAgICBoID0gYkQoY1sobSArIDQpID4+IDJdIHwgMCwgbCwgNTIxKSB8IDA7XG4gICAgICAgICAgICAgICAgRCA9ICtiRShoKTtcbiAgICAgICAgICAgICAgICBoID0gYkQoY1sobSArIDQpID4+IDJdIHwgMCwgbCwgNTIyKSB8IDA7XG4gICAgICAgICAgICAgICAgeiA9IH5+KCgxLjAgLSArYkYoaCkpICogMjUwLjApO1xuICAgICAgICAgICAgICAgIGggPSBiRChjWyhtICsgNCkgPj4gMl0gfCAwLCBsLCA0KSB8IDA7XG4gICAgICAgICAgICAgICAgYVsoYiArIDExMSkgfCAwXSA9IH5+KCgrYkYoaCkgKyAwLjUpICogMTI3LjApICYgMjU1O1xuICAgICAgICAgICAgICAgIGNbKGIgKyA2MCkgPj4gMl0gPSBiRygyNTUpIHwgMDtcbiAgICAgICAgICAgICAgICBjWyhiICsgMzYpID4+IDJdID0gYkgoaiwgMjU1LCBjWyhiICsgMTIpID4+IDJdIHwgMCwgQSkgfCAwO1xuICAgICAgICAgICAgICAgIGNbKGIgKyA2NCkgPj4gMl0gPSBiRygyNTApIHwgMDtcbiAgICAgICAgICAgICAgICBjWyhiICsgNDApID4+IDJdID0gYkgoaiwgNSwgY1soYiArIDEyKSA+PiAyXSB8IDAsIEIpIHwgMDtcbiAgICAgICAgICAgICAgICBjWyhiICsgNjgpID4+IDJdID0gYkcoeikgfCAwO1xuICAgICAgICAgICAgICAgIGNbKGIgKyA0NCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICBiSChqLCAoMjU1IC0geikgfCAwLCBjWyhiICsgMTIpID4+IDJdIHwgMCwgQykgfCAwO1xuICAgICAgICAgICAgICAgIGNbKGIgKyA3MikgPj4gMl0gPSBiRygwKSB8IDA7XG4gICAgICAgICAgICAgICAgY1soYiArIDQ4KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgIGJIKGosICh6ICsgNSkgfCAwLCBjWyhiICsgMTIpID4+IDJdIHwgMCwgRCkgfCAwO1xuICAgICAgICAgICAgICAgIGNbKGIgKyA3NikgPj4gMl0gPSBiRygwKSB8IDA7XG4gICAgICAgICAgICAgICAgY1soYiArIDUyKSA+PiAyXSA9IGJHKDEpIHwgMDtcbiAgICAgICAgICAgICAgICBjWyhiICsgODApID4+IDJdID0gYkcoMCkgfCAwO1xuICAgICAgICAgICAgICAgIGNbKGIgKyA1NikgPj4gMl0gPSBiRygxKSB8IDA7XG4gICAgICAgICAgICAgICAgeiA9IChiICsgMTEwKSB8IDA7XG4gICAgICAgICAgICAgICAgYVt6XSA9IChkW3pdIHwgMCB8IDY0KSAmIDI1NTtcbiAgICAgICAgICAgICAgICBuID0gYjtcbiAgICAgICAgICAgICAgICBvID0gKG4gKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgcCA9IGNbbyA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgcSA9IHAgPDwgMTI7XG4gICAgICAgICAgICAgICAgY1tvID4+IDJdID0gcTtcbiAgICAgICAgICAgICAgICByID0gYjtcbiAgICAgICAgICAgICAgICBzID0gciB8IDA7XG4gICAgICAgICAgICAgICAgdCA9IGNbcyA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgdSA9IHQgPDwgMTI7XG4gICAgICAgICAgICAgICAgY1tzID4+IDJdID0gdTtcbiAgICAgICAgICAgICAgICB2ID0gYjtcbiAgICAgICAgICAgICAgICB3ID0gKHYgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgeCA9IGNbdyA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgeSA9IHggPDwgMTI7XG4gICAgICAgICAgICAgICAgY1t3ID4+IDJdID0geTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiRChhLCBiLCBkKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGI7XG4gICAgICAgICAgICAgICAgYiA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IDA7XG4gICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGcgPj4+IDAgPj0gZiA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaCA9IChhICsgKChnICogMTIpIHwgMCkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChlWyhoICsgNCkgPj4gMV0gfCAwIHwgMCkgPT0gKChiICYgNjU1MzUpIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGVbaCA+PiAxXSB8IDAgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZVsoaCArIDIpID4+IDFdIHwgMCB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZVsoaCArIDYpID4+IDFdIHwgMCB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZCArIChjWyhoICsgOCkgPj4gMl0gfCAwKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGcgPSAoZyArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGQgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYkUoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgYiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGMgPSAwLjAsXG4gICAgICAgICAgICAgICAgICAgIGQgPSAwLjA7XG4gICAgICAgICAgICAgICAgYiA9IGE7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSAhPSAtMjE0NzQ4MzY0OCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYyA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgK1AoMi4wLCArKCsoKChiIHwgMCkgLyA2NTUzNikgfCAwIHwgMCkgLyAxMjAwLjApKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMS4wZTM7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gYztcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiArZDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIGMgPSAwLjA7XG4gICAgICAgICAgICAgICAgZCA9IGM7XG4gICAgICAgICAgICAgICAgcmV0dXJuICtkO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYkYoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICByZXR1cm4gKygrKCgoYSB8IDApIC8gNjU1MzYpIHwgMCB8IDApIC8gMS4wZTMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYkcoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICByZXR1cm4gKGEgPDwgMjIpIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJIKGEsIGIsIGQsIGUpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gK2U7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLjA7XG4gICAgICAgICAgICAgICAgZCA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGI7XG4gICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgaWYgKGYgPCA2LjApIHtcbiAgICAgICAgICAgICAgICAgICAgZiA9IDYuMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKChhIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBhID0gMjU1O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBhID0gYSA8PCAyMjtcbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICB+fihcbiAgICAgICAgICAgICAgICAgICAgICAgICgoKyhhIHwgMCkgLyArKGNbKGQgKyA0KSA+PiAyXSB8IDApKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKyhjWyhkICsgMTMwNjApID4+IDJdIHwgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMGUzKSAvXG4gICAgICAgICAgICAgICAgICAgICAgICBmXG4gICAgICAgICAgICAgICAgICAgICkgfCAwXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJJKGIsIGUpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMDtcbiAgICAgICAgICAgICAgICBmID0gYjtcbiAgICAgICAgICAgICAgICBiID0gZTtcbiAgICAgICAgICAgICAgICBlID0gY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyAyMjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKGUgfCAwKSA+IDUpIHtcbiAgICAgICAgICAgICAgICAgICAgYVsoZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkpIHwgMF0gPSAwO1xuICAgICAgICAgICAgICAgICAgICBnID0gMTtcbiAgICAgICAgICAgICAgICAgICAgaCA9IGc7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBoIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAoKGFbXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApICsgNCkgPj4gMl0gfCAwKSArIDExMCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgXSAmXG4gICAgICAgICAgICAgICAgICAgICAgICA2NCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGRbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApKSB8IDBdIHwgMCB8IDApID09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGkgPSAzNjE7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApKSB8IDBdIHwgMCB8IDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IDM2MTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGkgfCAwKSA9PSAzNjEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGUgfCAwKSA8PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgMTcyNCArICgoYiAqIDIzNikgfCAwKSArIDMyKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA9IGc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGggfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyAyMjApID4+IDJdID0gZSArIDE7XG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyAyNCkgPj4gMl0gfCAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA0KSA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA2MCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgPDwgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgIDApXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIGcgPSBiSShmLCBiKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGggPSBnO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaCB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApICsgMjgpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA0KSA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA2MCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgPDwgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgICAgIGNbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApICsgMzIpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA0KSA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAzNiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgPDwgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgKGNbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApICsgMjgpID4+IDJdIHwgMCkgPFxuICAgICAgICAgICAgICAgICAgICAoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyAyNCkgPj4gMl0gfCAwKVxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICBjWyhmICsgMTcyNCArICgoYiAqIDIzNikgfCAwKSArIDMyKSA+PiAyXSA9IC0oXG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgMTcyNCArICgoYiAqIDIzNikgfCAwKSArIDMyKSA+PiAyXSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgaCA9IGc7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGggfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYkooYiwgZSkge1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMC4wLFxuICAgICAgICAgICAgICAgICAgICBqID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAuMDtcbiAgICAgICAgICAgICAgICBmID0gYjtcbiAgICAgICAgICAgICAgICBiID0gZTtcbiAgICAgICAgICAgICAgICBpID0gK2dbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApICsgNjgpID4+IDJdO1xuICAgICAgICAgICAgICAgIGlmICgoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyAyMzIpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApICsgNDgpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGkgKiArZ1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA3NikgPj4gMl07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgKChhW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA0KSA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTEwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgIF0gJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDY0KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoOCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyAyNCkgPj4gMl0gPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIzKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMykpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW2sgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkW2VdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAxKSB8IDBdIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAyKSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgMykgfCAwXSA8PCAyNCkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgNCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkWyhlICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgNSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgNikgfCAwXSA8PCAxNikgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDcpIHwgMF0gPDwgMjQpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAraFtrID4+IDNdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBqID0gfn4oaSAqIDQwOTYuMCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID4gODE5MSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaiA9IDgxOTE7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA2MCkgPj4gMl0gPSBqO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGwgPSArZ1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA3MikgPj4gMl07XG4gICAgICAgICAgICAgICAgaWYgKChjWyhmICsgMTcyNCArICgoYiAqIDIzNikgfCAwKSArIDQ4KSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGkgKiArZ1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA3NikgPj4gMl07XG4gICAgICAgICAgICAgICAgICAgIGwgPSBsICogK2dbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApICsgNzYpID4+IDJdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICgoYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA0KSA+PiAyXSB8IDApICsgMTEwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICBdICZcbiAgICAgICAgICAgICAgICAgICAgICAgIDY0KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIGUgPVxuICAgICAgICAgICAgICAgICAgICAgICAgKDggK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyAyNCkgPj4gMl0gPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjMpIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICBpID1cbiAgICAgICAgICAgICAgICAgICAgICAgIGkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgKChjW2sgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRbZV0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgMSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAyKSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAzKSB8IDBdIDw8IDI0KSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDQpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkWyhlICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyA1KSB8IDBdIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDYpIHwgMF0gPDwgMTYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDcpIHwgMF0gPDwgMjQpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICtoW2sgPj4gM10pO1xuICAgICAgICAgICAgICAgICAgICBlID1cbiAgICAgICAgICAgICAgICAgICAgICAgICg4ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApICsgMjQpID4+IDJdID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIzKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgbCA9XG4gICAgICAgICAgICAgICAgICAgICAgICBsICpcbiAgICAgICAgICAgICAgICAgICAgICAgICgoY1trID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkW2VdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDEpIHwgMF0gPDwgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgMikgfCAwXSA8PCAxNikgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgMykgfCAwXSA8PCAyNCkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyA0KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZFsoZSArIDQpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgNSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyA2KSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyA3KSB8IDBdIDw8IDI0KSksXG4gICAgICAgICAgICAgICAgICAgICAgICAraFtrID4+IDNdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaiA9IH5+KGkgKiA0MDk2LjApO1xuICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID4gODE5MSkge1xuICAgICAgICAgICAgICAgICAgICBqID0gODE5MTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZSA9IH5+KGwgKiA0MDk2LjApO1xuICAgICAgICAgICAgICAgIGlmICgoZSB8IDApID4gODE5MSkge1xuICAgICAgICAgICAgICAgICAgICBlID0gODE5MTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1soZiArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyA2MCkgPj4gMl0gPSBqO1xuICAgICAgICAgICAgICAgIGNbKGYgKyAxNzI0ICsgKChiICogMjM2KSB8IDApICsgNjQpID4+IDJdID0gZTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiSyhiLCBlLCBmLCBnKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBlIHwgMDtcbiAgICAgICAgICAgICAgICBmID0gZiB8IDA7XG4gICAgICAgICAgICAgICAgZyA9IGcgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBoID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDA7XG4gICAgICAgICAgICAgICAgaCA9IGk7XG4gICAgICAgICAgICAgICAgaSA9IChpICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgIGogPSBoIHwgMDtcbiAgICAgICAgICAgICAgICBrID0gYjtcbiAgICAgICAgICAgICAgICBiID0gZTtcbiAgICAgICAgICAgICAgICBlID0gZjtcbiAgICAgICAgICAgICAgICBjW2ogPj4gMl0gPSBnO1xuICAgICAgICAgICAgICAgIGcgPSAoayArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkpIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKGRbZyB8IDBdIHwgMCB8IDApID09IDQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChjW2ogPj4gMl0gfCAwKSA+PSAyMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tqID4+IDJdID0gMjA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbCA9IGN5KGssIGUsIGopIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYkwoaywgbCwgYiwgZSwgY1tqID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgIGFbZyB8IDBdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGg7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbCA9IGN5KGssIGUsIGopIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKChjWyhrICsgOCkgPj4gMl0gJiAxKSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhnICsgMzIpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSA0MDI7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soZyArIDQ4KSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IDQwMjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJOKGssIGwsIGIsIGUsIGNbaiA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChtIHwgMCkgPT0gNDAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBiTShrLCBsLCBiLCBlLCBjW2ogPj4gMl0gfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soZyArIDIzMikgPj4gMl0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhnICsgMzIpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gNDA4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soZyArIDQ4KSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSA0MDg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiUChrLCBsLCBiLCBlLCBjW2ogPj4gMl0gfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobSB8IDApID09IDQwOCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJPKGssIGwsIGIsIGUsIGNbaiA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhnICsgMjMyKSA+PiAyXSB8IDApID09IDMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soZyArIDMyKSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSA0MTQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKGcgKyA0OCkgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IDQxNDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJSKGssIGwsIGIsIGUsIGNbaiA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChtIHwgMCkgPT0gNDE0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJRKGssIGwsIGIsIGUsIGNbaiA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhnICsgMjMyKSA+PiAyXSB8IDApID09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9IChiICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soZyArIDMyKSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSA0MjE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKGcgKyA0OCkgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IDQyMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJUKGssIGwsIGIsIGUsIGNbaiA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChtIHwgMCkgPT0gNDIxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJTKGssIGwsIGIsIGUsIGNbaiA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpID0gaDtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiTChhLCBkLCBlLCBmLCBnKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGYgfCAwO1xuICAgICAgICAgICAgICAgIGcgPSBnIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGkgPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMCxcbiAgICAgICAgICAgICAgICAgICAgayA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGwgPSAwLFxuICAgICAgICAgICAgICAgICAgICBtID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG8gPSAwO1xuICAgICAgICAgICAgICAgIGggPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBkO1xuICAgICAgICAgICAgICAgIGQgPSBlO1xuICAgICAgICAgICAgICAgIGUgPSBmO1xuICAgICAgICAgICAgICAgIGYgPSBnO1xuICAgICAgICAgICAgICAgIGcgPSAwO1xuICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZiA9IDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGkgPSBjWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDYwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaiA9IC0oKChpIHwgMCkgLyAoZiB8IDApKSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKGogfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGogPSAtMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCgoY1soaCArIDgpID4+IDJdICYgMSkgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBrID0gZjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAoayAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoayB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gNDc0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IChpICsgaikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChpIHwgMCkgPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IDQ3MjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBhO1xuICAgICAgICAgICAgICAgICAgICAgICAgYSA9IChrICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IGJbayA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBrID0gXyhpLCAoZyA8PCAxNikgPj4gMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChtICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdID0gKGNbbSA+PiAyXSB8IDApICsgaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSA9PSA0NzIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgobCB8IDApID09IDQ3NCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyAyMzIpID4+IDJdIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBrID0gY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA2NCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBtID0gLSgoKGsgfCAwKSAvIChmIHwgMCkpIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbiA9IGY7XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gKG4gLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG4gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gKGkgKyBqKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGkgfCAwKSA8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSAoayArIG0pIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoayB8IDApIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgbiA9IGE7XG4gICAgICAgICAgICAgICAgICAgICAgICBhID0gKG4gKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBnID0gYltuID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSBfKGksIChnIDw8IDE2KSA+PiAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgbyA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gKG8gKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjW28gPj4gMl0gPSAoY1tvID4+IDJdIHwgMCkgKyBuO1xuICAgICAgICAgICAgICAgICAgICAgICAgbiA9IF8oaywgKGcgPDwgMTYpID4+IDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAobyArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbbyA+PiAyXSA9IChjW28gPj4gMl0gfCAwKSArIG47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMjMyKSA+PiAyXSB8IDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgM1xuICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgayA9IGY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAoayAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IDQ1MDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSAoaSArIGopIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChpIHwgMCkgPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gYTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYSA9IChrICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gYltrID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgayA9IF8oaSwgKGcgPDwgMTYpID4+IDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gKG0gKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbbSA+PiAyXSA9IChjW20gPj4gMl0gfCAwKSArIGs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBfKGksIChnIDw8IDE2KSA+PiAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChtICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gPSAoY1ttID4+IDJdIHwgMCkgKyBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSA9PSA0NTApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyAyMzIpID4+IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gZjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmID0gKGsgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gNDU3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IChpICsgaikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoaSB8IDApIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgayA9IGE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYSA9IChrICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPSBiW2sgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBfKGksIChnIDw8IDE2KSA+PiAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAobSArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gPSAoY1ttID4+IDJdIHwgMCkgKyBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZCArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobCB8IDApID09IDQ1Nykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTcyNCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChlICogMjM2KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMzIpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBmO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZiA9IChrIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSA0NjQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gKGkgKyBqKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGkgfCAwKSA8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBhO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYSA9IChrICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZyA9IGJbayA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gKGQgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gXyhpLCAoZyA8PCAxNikgPj4gMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChtICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdID0gKGNbbSA+PiAyXSB8IDApICsgaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSA9PSA0NjQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYk0oYSwgZCwgZSwgZiwgZykge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gZyB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwO1xuICAgICAgICAgICAgICAgIGggPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBkO1xuICAgICAgICAgICAgICAgIGQgPSBlO1xuICAgICAgICAgICAgICAgIGUgPSBmO1xuICAgICAgICAgICAgICAgIGYgPSBnO1xuICAgICAgICAgICAgICAgIGcgPSAoaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkpIHwgMDtcbiAgICAgICAgICAgICAgICBpID0gY1soZyArIDYwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaiA9IGNbKGcgKyAyMjQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBrID0gajtcbiAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBjWyhoICsgMTMwNjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYlUoaCwgZSkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGNbKGcgKyA2MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbCA9IDUwMjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoayB8IDApID49IChmIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGwgPSA0OTU7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBmID0gKGYgLSBrKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBqID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSAoaiAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGogPSBhO1xuICAgICAgICAgICAgICAgICAgICAgICAgYSA9IChqICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGJbaiA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBqID0gXyhpLCAobSA8PCAxNikgPj4gMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChuICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tuID4+IDJdID0gKGNbbiA+PiAyXSB8IDApICsgajtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBrID0gY1soaCArIDEzMDYwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoYlUoaCwgZSkgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gNDkzO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaSA9IGNbKGcgKyA2MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSA9PSA1MDIpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKGwgfCAwKSA9PSA0OTMpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKGwgfCAwKSA9PSA0OTUpIHtcbiAgICAgICAgICAgICAgICAgICAgY1soZyArIDIyNCkgPj4gMl0gPSBrIC0gZjtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBmO1xuICAgICAgICAgICAgICAgICAgICAgICAgZiA9IChrIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgayA9IGE7XG4gICAgICAgICAgICAgICAgICAgICAgICBhID0gKGsgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBtID0gYltrID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBfKGksIChtIDw8IDE2KSA+PiAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gKGcgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjW2cgPj4gMl0gPSAoY1tnID4+IDJdIHwgMCkgKyBrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiTihhLCBkLCBlLCBmLCBnKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGYgfCAwO1xuICAgICAgICAgICAgICAgIGcgPSBnIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgaCA9IDA7XG4gICAgICAgICAgICAgICAgaCA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGc7XG4gICAgICAgICAgICAgICAgZyA9IGNbKGEgKyAxNzI0ICsgKChmICogMjM2KSB8IDApICsgNjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBmID0gZTtcbiAgICAgICAgICAgICAgICAgICAgZSA9IChmIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBmID0gaDtcbiAgICAgICAgICAgICAgICAgICAgaCA9IChmICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBhID0gXyhnLCBiW2YgPj4gMV0gfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGYgPSBkO1xuICAgICAgICAgICAgICAgICAgICBkID0gKGYgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbZiA+PiAyXSA9IChjW2YgPj4gMl0gfCAwKSArIGE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJPKGEsIGQsIGUsIGYsIGcpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBlIHwgMDtcbiAgICAgICAgICAgICAgICBmID0gZiB8IDA7XG4gICAgICAgICAgICAgICAgZyA9IGcgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBoID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBrID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG0gPSAwLFxuICAgICAgICAgICAgICAgICAgICBuID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbyA9IDA7XG4gICAgICAgICAgICAgICAgaCA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGY7XG4gICAgICAgICAgICAgICAgZiA9IGc7XG4gICAgICAgICAgICAgICAgZyA9IChoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSkgfCAwO1xuICAgICAgICAgICAgICAgIGkgPSBjWyhnICsgNjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBqID0gY1soZyArIDY0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgayA9IGNbKGcgKyAyMjQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBsID0gaztcbiAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoayB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBjWyhoICsgMTMwNjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYlUoaCwgZSkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGNbKGcgKyA2MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSBjWyhnICsgNjQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG0gPSA1MzA7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSA+PSAoZiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtID0gNTIyO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZiA9IChmIC0gbCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgayA9IGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gKGsgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGsgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBrID0gYTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGEgPSAoayArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSBiW2sgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgayA9IF8oaSwgKG4gPDwgMTYpID4+IDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAobyArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbbyA+PiAyXSA9IChjW28gPj4gMl0gfCAwKSArIGs7XG4gICAgICAgICAgICAgICAgICAgICAgICBrID0gXyhqLCAobiA8PCAxNikgPj4gMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG8gPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChvICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tvID4+IDJdID0gKGNbbyA+PiAyXSB8IDApICsgaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBsID0gY1soaCArIDEzMDYwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoYlUoaCwgZSkgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtID0gNTIwO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaSA9IGNbKGcgKyA2MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBqID0gY1soZyArIDY0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgobSB8IDApID09IDUyMikge1xuICAgICAgICAgICAgICAgICAgICBjWyhnICsgMjI0KSA+PiAyXSA9IGwgLSBmO1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbCA9IGY7XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gKGwgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gYTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGEgPSAobCArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSBiW2wgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgbCA9IF8oaSwgKG4gPDwgMTYpID4+IDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBnID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZyArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbZyA+PiAyXSA9IChjW2cgPj4gMl0gfCAwKSArIGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gXyhqLCAobiA8PCAxNikgPj4gMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGcgPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChnICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tnID4+IDJdID0gKGNbZyA+PiAyXSB8IDApICsgbDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgobSB8IDApID09IDUyMCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgobSB8IDApID09IDUzMCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYlAoYSwgZCwgZSwgZiwgZykge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gZyB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDA7XG4gICAgICAgICAgICAgICAgaCA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGY7XG4gICAgICAgICAgICAgICAgZiA9IGc7XG4gICAgICAgICAgICAgICAgZyA9IGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgNjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBpID0gY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA2NCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGUgPSBmO1xuICAgICAgICAgICAgICAgICAgICBmID0gKGUgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGUgPSBhO1xuICAgICAgICAgICAgICAgICAgICBhID0gKGUgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGggPSBiW2UgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBlID0gXyhnLCAoaCA8PCAxNikgPj4gMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaiA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIGQgPSAoaiArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tqID4+IDJdID0gKGNbaiA+PiAyXSB8IDApICsgZTtcbiAgICAgICAgICAgICAgICAgICAgZSA9IF8oaSwgKGggPDwgMTYpID4+IDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGggPSBkO1xuICAgICAgICAgICAgICAgICAgICBkID0gKGggKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbaCA+PiAyXSA9IChjW2ggPj4gMl0gfCAwKSArIGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJRKGEsIGQsIGUsIGYsIGcpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBlIHwgMDtcbiAgICAgICAgICAgICAgICBmID0gZiB8IDA7XG4gICAgICAgICAgICAgICAgZyA9IGcgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBoID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBrID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG0gPSAwLFxuICAgICAgICAgICAgICAgICAgICBuID0gMDtcbiAgICAgICAgICAgICAgICBoID0gYTtcbiAgICAgICAgICAgICAgICBhID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZTtcbiAgICAgICAgICAgICAgICBlID0gZjtcbiAgICAgICAgICAgICAgICBmID0gZztcbiAgICAgICAgICAgICAgICBnID0gKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApKSB8IDA7XG4gICAgICAgICAgICAgICAgaSA9IGNbKGcgKyA2MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGogPSBjWyhnICsgMjI0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgayA9IGo7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGogfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBrID0gY1soaCArIDEzMDYwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGJVKGgsIGUpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBjWyhnICsgNjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGwgPSA1NTY7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGsgfCAwKSA+PSAoZiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gNTQ5O1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZiA9IChmIC0gaykgfCAwO1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaiA9IGs7XG4gICAgICAgICAgICAgICAgICAgICAgICBrID0gKGogLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGogfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBqID0gYTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGEgPSAoaiArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBiW2ogPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaiA9IF8oaSwgKG0gPDwgMTYpID4+IDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBuID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAobiArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbbiA+PiAyXSA9IChjW24gPj4gMl0gfCAwKSArIGo7XG4gICAgICAgICAgICAgICAgICAgICAgICBqID0gXyhpLCAobSA8PCAxNikgPj4gMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChuICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tuID4+IDJdID0gKGNbbiA+PiAyXSB8IDApICsgajtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBrID0gY1soaCArIDEzMDYwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoYlUoaCwgZSkgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gNTQ3O1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaSA9IGNbKGcgKyA2MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSA9PSA1NDkpIHtcbiAgICAgICAgICAgICAgICAgICAgY1soZyArIDIyNCkgPj4gMl0gPSBrIC0gZjtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBmO1xuICAgICAgICAgICAgICAgICAgICAgICAgZiA9IChrIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgayA9IGE7XG4gICAgICAgICAgICAgICAgICAgICAgICBhID0gKGsgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBtID0gYltrID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBfKGksIChtIDw8IDE2KSA+PiAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gKGcgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjW2cgPj4gMl0gPSAoY1tnID4+IDJdIHwgMCkgKyBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgayA9IF8oaSwgKG0gPDwgMTYpID4+IDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBnID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZyArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbZyA+PiAyXSA9IChjW2cgPj4gMl0gfCAwKSArIGs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKGwgfCAwKSA9PSA1NTYpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKGwgfCAwKSA9PSA1NDcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJSKGEsIGQsIGUsIGYsIGcpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBlIHwgMDtcbiAgICAgICAgICAgICAgICBmID0gZiB8IDA7XG4gICAgICAgICAgICAgICAgZyA9IGcgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBoID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaSA9IDA7XG4gICAgICAgICAgICAgICAgaCA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGc7XG4gICAgICAgICAgICAgICAgZyA9IGNbKGEgKyAxNzI0ICsgKChmICogMjM2KSB8IDApICsgNjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBmID0gZTtcbiAgICAgICAgICAgICAgICAgICAgZSA9IChmIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBmID0gaDtcbiAgICAgICAgICAgICAgICAgICAgaCA9IChmICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBhID0gYltmID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IF8oZywgKGEgPDwgMTYpID4+IDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgICAgICBkID0gKGkgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbaSA+PiAyXSA9IChjW2kgPj4gMl0gfCAwKSArIGY7XG4gICAgICAgICAgICAgICAgICAgIGYgPSBfKGcsIChhIDw8IDE2KSA+PiAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBhID0gZDtcbiAgICAgICAgICAgICAgICAgICAgZCA9IChhICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW2EgPj4gMl0gPSAoY1thID4+IDJdIHwgMCkgKyBmO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiUyhhLCBkLCBlLCBmLCBnKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGYgfCAwO1xuICAgICAgICAgICAgICAgIGcgPSBnIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGkgPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMCxcbiAgICAgICAgICAgICAgICAgICAgayA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGwgPSAwLFxuICAgICAgICAgICAgICAgICAgICBtID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbiA9IDA7XG4gICAgICAgICAgICAgICAgaCA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGY7XG4gICAgICAgICAgICAgICAgZiA9IGc7XG4gICAgICAgICAgICAgICAgZyA9IChoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSkgfCAwO1xuICAgICAgICAgICAgICAgIGkgPSBjWyhnICsgNjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBqID0gY1soZyArIDIyNCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGsgPSBqO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChqIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgayA9IGNbKGggKyAxMzA2MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiVShoLCBlKSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gY1soZyArIDYwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gNTgyO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgPj0gKGYgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbCA9IDU3NjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGYgPSAoZiAtIGspIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGogPSBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgayA9IChqIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChqIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaiA9IGE7XG4gICAgICAgICAgICAgICAgICAgICAgICBhID0gKGogKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBtID0gYltqID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGogPSBfKGksIChtIDw8IDE2KSA+PiAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgbiA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gKG4gKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjW24gPj4gMl0gPSAoY1tuID4+IDJdIHwgMCkgKyBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChkICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGsgPSBjWyhoICsgMTMwNjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChiVShoLCBlKSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGwgPSA1NzQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpID0gY1soZyArIDYwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgobCB8IDApID09IDU4Mikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgobCB8IDApID09IDU3Nikge1xuICAgICAgICAgICAgICAgICAgICBjWyhnICsgMjI0KSA+PiAyXSA9IGsgLSBmO1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgayA9IGY7XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gKGsgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGsgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBrID0gYTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGEgPSAoayArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBiW2sgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgayA9IF8oaSwgKG0gPDwgMTYpID4+IDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBnID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZyArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbZyA+PiAyXSA9IChjW2cgPj4gMl0gfCAwKSArIGs7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gKGQgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKGwgfCAwKSA9PSA1NzQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGJUKGEsIGQsIGUsIGYsIGcpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBlIHwgMDtcbiAgICAgICAgICAgICAgICBmID0gZiB8IDA7XG4gICAgICAgICAgICAgICAgZyA9IGcgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBoID0gMDtcbiAgICAgICAgICAgICAgICBoID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZTtcbiAgICAgICAgICAgICAgICBlID0gZztcbiAgICAgICAgICAgICAgICBnID0gY1soYSArIDE3MjQgKyAoKGYgKiAyMzYpIHwgMCkgKyA2MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPSBlO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGYgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGYgPSBoO1xuICAgICAgICAgICAgICAgICAgICBoID0gKGYgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGEgPSBfKGcsIGJbZiA+PiAxXSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIGQgPSAoZiArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tmID4+IDJdID0gKGNbZiA+PiAyXSB8IDApICsgYTtcbiAgICAgICAgICAgICAgICAgICAgZCA9IChkICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiVShhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMDtcbiAgICAgICAgICAgICAgICBkID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soZCArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAzMikgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGJWKGQsIGEpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZSA9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIGlmICgoY1soZCArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA0OCkgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGJXKGQsIGEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBiSihkLCBhKTtcbiAgICAgICAgICAgICAgICBlID0gMDtcbiAgICAgICAgICAgICAgICBmID0gZTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZiB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiVihhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgZCA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGI7XG4gICAgICAgICAgICAgICAgYiA9IChkICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDI0KSB8IDA7XG4gICAgICAgICAgICAgICAgY1tiID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgKGNbYiA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgKGNbKGQgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMzIpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgaWYgKChjWyhkICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDMyKSA+PiAyXSB8IDApIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soZCArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAyNCkgPj4gMl0gfCAwKSA8PVxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGQgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMjgpID4+IDJdIHwgMClcbiAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gNjAzO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgZSA9IDYwMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGUgPSA2MDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChlIHwgMCkgPT0gNjAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGQgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMzIpID4+IDJdIHwgMCkgPD1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1soZCArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAyNCkgPj4gMl0gfCAwKSA+PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWyhkICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDI4KSA+PiAyXSB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlID0gNjAzO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGUgfCAwKSA9PSA2MDMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKGQgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMjQpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhkICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDI4KSA+PiAyXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYkkoZCwgYSkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGcgPSBmO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGcgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgZiA9IDA7XG4gICAgICAgICAgICAgICAgZyA9IGY7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGcgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYlcoYSwgYikge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMDtcbiAgICAgICAgICAgICAgICBlID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICBiID1cbiAgICAgICAgICAgICAgICAgICAgKGRbXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgNCkgPj4gMl0gfCAwKSArIDEwOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAwKSA8PFxuICAgICAgICAgICAgICAgICAgICA3O1xuICAgICAgICAgICAgICAgIGlmICgoY1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAzNikgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPSAoZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA0MCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW2YgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbZiA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgIChjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDM2KSA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA0MCkgPj4gMl0gfCAwKSA+PVxuICAgICAgICAgICAgICAgICAgICAgICAgNjU1MzZcbiAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDM2KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBiID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDQwKSA+PiAyXSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGIgPSBiID4+IDE2O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGYgPSAoZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA0NCkgfCAwO1xuICAgICAgICAgICAgICAgIGNbZiA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgIChjW2YgPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgIChjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDQ4KSA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgIGdbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgNzYpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgMS4wIC1cbiAgICAgICAgICAgICAgICAgICAgKCtSKFxuICAgICAgICAgICAgICAgICAgICAgICAgKyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICArKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA0NCkgPj4gMl0gPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDUpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgKiAwLjAwNjEzNTkyMzE1MTU0MjU2NVxuICAgICAgICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgICApICtcbiAgICAgICAgICAgICAgICAgICAgICAgIDEuMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgKyhiIHwgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgMS4wICpcbiAgICAgICAgICAgICAgICAgICAgICAgIDc2MjkzOTQ1MzEyNS4wZS0xNztcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiWChiLCBkLCBlKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMDtcbiAgICAgICAgICAgICAgICBmID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZTtcbiAgICAgICAgICAgICAgICBlID0gYjtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBiID0gZDtcbiAgICAgICAgICAgICAgICAgICAgZCA9IChiIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBiID0gZjtcbiAgICAgICAgICAgICAgICAgICAgZiA9IChiICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBnID0gY1tiID4+IDJdID4+IDIxO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSA+IDEyNykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IDEyNztcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApIDwgLTEyOCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPSAtMTI4O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGIgPSBlO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGIgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFbYl0gPSBnICYgMjU1O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiWShiLCBkLCBlKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMDtcbiAgICAgICAgICAgICAgICBmID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZTtcbiAgICAgICAgICAgICAgICBlID0gYjtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBiID0gZDtcbiAgICAgICAgICAgICAgICAgICAgZCA9IChiIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBiID0gZjtcbiAgICAgICAgICAgICAgICAgICAgZiA9IChiICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBnID0gY1tiID4+IDJdID4+IDIxO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSA+IDEyNykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IDEyNztcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApIDwgLTEyOCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPSAtMTI4O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGIgPSBlO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGIgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFbYl0gPSAoMTI4IF4gKGcgJiAyNTUpKSAmIDI1NTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYlooYSwgZCwgZSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGE7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgYSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIGQgPSAoYSAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChhIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYSA9IGY7XG4gICAgICAgICAgICAgICAgICAgIGYgPSAoYSArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZyA9IGNbYSA+PiAyXSA+PiAxMztcbiAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPiAzMjc2Nykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IDMyNzY3O1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPCAtMzI3NjgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gLTMyNzY4O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGEgPSBlO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGEgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGJbYSA+PiAxXSA9IGcgJiA2NTUzNTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYl8oYSwgZCwgZSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGE7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgYSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIGQgPSAoYSAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChhIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYSA9IGY7XG4gICAgICAgICAgICAgICAgICAgIGYgPSAoYSArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZyA9IGNbYSA+PiAyXSA+PiAxMztcbiAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPiAzMjc2Nykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IDMyNzY3O1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPCAtMzI3NjgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gLTMyNzY4O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGEgPSBlO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGEgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGJbYSA+PiAxXSA9ICgzMjc2OCBeIChnICYgNjU1MzUpKSAmIDY1NTM1O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiJChhLCBkLCBlKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMDtcbiAgICAgICAgICAgICAgICBmID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZTtcbiAgICAgICAgICAgICAgICBlID0gYTtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBhID0gZDtcbiAgICAgICAgICAgICAgICAgICAgZCA9IChhIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGEgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBhID0gZjtcbiAgICAgICAgICAgICAgICAgICAgZiA9IChhICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBnID0gY1thID4+IDJdID4+IDEzO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSA+IDMyNzY3KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBnID0gMzI3Njc7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSA8IC0zMjc2OCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPSAtMzI3Njg7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYSA9IGU7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoYSArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYlthID4+IDFdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICgoKCgoKGcgJiA2NTUzNSkgPDwgMTYpID4+IDE2KSAmIDI1NSkgPDwgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKCgoZyAmIDY1NTM1KSA8PCAxNikgPj4gMTYpID4+IDgpICYgMjU1KSkgJlxuICAgICAgICAgICAgICAgICAgICAgICAgNjU1MzU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGIwKGIsIGQsIGUsIGYpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBlIHwgMDtcbiAgICAgICAgICAgICAgICBmID0gZiB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGcgPSAwLFxuICAgICAgICAgICAgICAgICAgICBoID0gMDtcbiAgICAgICAgICAgICAgICBnID0gaTtcbiAgICAgICAgICAgICAgICBpID0gKGkgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgaCA9IGcgfCAwO1xuICAgICAgICAgICAgICAgIGNbaCA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgYVsoaCArIDUpIHwgMF0gPSAxO1xuICAgICAgICAgICAgICAgIGFbKGggKyA0KSB8IDBdID0gZCAmIDI1NTtcbiAgICAgICAgICAgICAgICBhWyhoICsgNikgfCAwXSA9IGUgJiAyNTU7XG4gICAgICAgICAgICAgICAgYVsoaCArIDcpIHwgMF0gPSBmICYgMjU1O1xuICAgICAgICAgICAgICAgIGIxKGIsIGgpO1xuICAgICAgICAgICAgICAgIGkgPSBnO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGIxKGIsIGUpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMDtcbiAgICAgICAgICAgICAgICBmID0gYjtcbiAgICAgICAgICAgICAgICBiID0gZTtcbiAgICAgICAgICAgICAgICBlID0gY1soZiArIDEzMDUyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgZyA9IC0xO1xuICAgICAgICAgICAgICAgIGggPSAyMTQ3NDgzNjQ3O1xuICAgICAgICAgICAgICAgIGlmICgwID09IChiIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGNbKGYgKyAxMzA4MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBiO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBiID0gZTtcbiAgICAgICAgICAgICAgICAgICAgZSA9IChiIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGRbKGYgKyAxNzI0ICsgKChlICogMjM2KSB8IDApKSB8IDBdIHwgMCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGcgPSBlO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGYgKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMSkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhpICsgNCkgfCAwXSB8IDAgfCAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZiArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyAyKSB8IDBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGkgKyA2KSB8IDBdIHwgMCB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNzI0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChlICogMjM2KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaChmLCBlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSAhPSAtMSkge1xuICAgICAgICAgICAgICAgICAgICBjbihmLCBpLCBnKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlID0gY1soZiArIDEzMDUyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgYiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoYiAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhmICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSkgfCAwXSB8IDAgfCAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDFcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGYgKyAxNzI0ICsgKChlICogMjM2KSB8IDApKSB8IDBdIHwgMCB8IDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPSBjWyhmICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDYwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyAyMzIpID4+IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA2NCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPD1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYiB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDY0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgPCAoaCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggPSBiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSAhPSAtMSkge1xuICAgICAgICAgICAgICAgICAgICBlID0gKGYgKyAxMzA2OCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW2UgPj4gMl0gPSAoY1tlID4+IDJdIHwgMCkgKyAxO1xuICAgICAgICAgICAgICAgICAgICBhWyhmICsgMTcyNCArICgoZyAqIDIzNikgfCAwKSkgfCAwXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGNuKGYsIGksIGcpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZyA9IChmICsgMTMwNjQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tnID4+IDJdID0gKGNbZyA+PiAyXSB8IDApICsgMTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGIyKGIsIGUpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwO1xuICAgICAgICAgICAgICAgIGYgPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBlO1xuICAgICAgICAgICAgICAgIGUgPSBjWyhmICsgMTMwNTIpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoMCA9PSAoYiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgIGcgPSBjWyhmICsgMTMwODApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBnID0gYjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgTDg5MDogd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgYiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoYiAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaCA9IDcwOTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZiArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkpIHwgMF0gfCAwIHwgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAxXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhmICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDEpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZyArIDQpIHwgMF0gfCAwIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGYgKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMikgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhnICsgNikgfCAwXSB8IDAgfCAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMODkwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoaCB8IDApID09IDcwOSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAoZiArIDEwODQgKyAoKChkWyhnICsgNCkgfCAwXSB8IDApICogNDApIHwgMCkgKyAxMikgPj4gMlxuICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgYVsoZiArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkpIHwgMF0gPSAyO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGNpKGYsIGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiMyhhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBiID0gMDtcbiAgICAgICAgICAgICAgICBiID0gYTtcbiAgICAgICAgICAgICAgICBjW2IgPj4gMl0gPSAxO1xuICAgICAgICAgICAgICAgIGI0KGIpO1xuICAgICAgICAgICAgICAgIGI1KGIsIDApO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGI0KGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGIgPSAwO1xuICAgICAgICAgICAgICAgIGIgPSBhO1xuICAgICAgICAgICAgICAgIGdbKGIgKyAxNikgPj4gMl0gPSArKGNbKGIgKyAyMCkgPj4gMl0gfCAwKSAvIDEwMC4wO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGI1KGEsIGIpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBkID0gMDtcbiAgICAgICAgICAgICAgICBkID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICBpZiAoKGNbKGQgKyAxMzA4OCkgPj4gMl0gfCAwKSA+IChhIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY1soZCArIDEzMDg4KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNrKGQpO1xuICAgICAgICAgICAgICAgIGNbKGQgKyAxMzA4MCkgPj4gMl0gPSBjWyhkICsgMTMwNzYpID4+IDJdO1xuICAgICAgICAgICAgICAgIGNbMzkyXSA9IDVlNTtcbiAgICAgICAgICAgICAgICBpZiAoKGEgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY2woZCwgYSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYjYoYiwgZSwgZiwgaCkge1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGYgfCAwO1xuICAgICAgICAgICAgICAgIGggPSBoIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwLFxuICAgICAgICAgICAgICAgICAgICBvID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcCA9IDA7XG4gICAgICAgICAgICAgICAgaiA9IGk7XG4gICAgICAgICAgICAgICAgaSA9IChpICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgIGsgPSBqIHwgMDtcbiAgICAgICAgICAgICAgICBsID0gYjtcbiAgICAgICAgICAgICAgICBjW2sgPj4gMl0gPSBlO1xuICAgICAgICAgICAgICAgIGUgPSBoO1xuICAgICAgICAgICAgICAgIGlmICgoY1tsID4+IDJdIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBtID0gMDtcbiAgICAgICAgICAgICAgICAgICAgbiA9IG07XG4gICAgICAgICAgICAgICAgICAgIGkgPSBqO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGggPSAoKGYgPj4+IDApIC8gKChjWyhsICsgMTIpID4+IDJdIHwgMCkgPj4+IDApKSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGNbKGwgKyAxMzA4OCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGIgPSAoKGNbKGwgKyAxMzA4OCkgPj4gMl0gfCAwKSArIGgpIHwgMDtcbiAgICAgICAgICAgICAgICBMOTIwOiB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKGwgKyAxMzA4OCkgPj4gMl0gfCAwKSA+PSAoYiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gNzU4O1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB+figrKGNbY1sobCArIDEzMDgwKSA+PiAyXSA+PiAyXSB8IDApIC8gK2dbMjU4XSkgPj4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWyhsICsgMTMwODgpID4+IDJdIHwgMCkgPj4+IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChkWygoY1sobCArIDEzMDgwKSA+PiAyXSB8IDApICsgNSkgfCAwXSB8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDk5OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09IChlIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8gPSA3NTI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMOTIwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDY6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGwgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDQpIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMikgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSBkWygoY1sobCArIDEzMDgwKSA+PiAyXSB8IDApICsgNikgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhWygoY1sobCArIDEzMDgwKSA+PiAyXSB8IDApICsgNikgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYShsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAzOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGI3KGwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGwgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1sobCArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMyKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGRbKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA2KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGwgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDQpIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzNikgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSAwLjA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE0OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNjKGwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZChsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTM6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2IoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZFsoKGNbKGwgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDQpIHwgMF0gfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDk6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhsICsgMTMwNTYpID4+IDJdICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGwgKyAxMzA4MCkgPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRbKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA2KSB8IDBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZFsoKGNbKGwgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDYpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGwgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1sobCArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGRbKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA2KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGwgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1sobCArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGRbKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA2KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYjkobCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFbKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA3KSB8IDBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIxKGwsIDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYjIobCwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTU6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGwgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDQpIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGRbKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA2KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTA6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1szOTJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWygoY1sobCArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA3KSB8IDBdIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA2KSB8IDBdIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA4OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoZFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA0KSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjApID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWygoY1sobCArIDEzMDgwKSA+PiAyXSB8IDApICsgNikgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA3KSB8IDBdIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoZFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhsICsgMTMwODApID4+IDJdIHwgMCkgKyA0KSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gMC4wO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiOChsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGwgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1sobCArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDgpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gZFsoKGNbKGwgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDYpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiOShsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiMihsLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBwID0gKGwgKyAxMzA4MCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1twID4+IDJdID0gKGNbcCA+PiAyXSB8IDApICsgODtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICB+figrKGNbY1sobCArIDEzMDgwKSA+PiAyXSA+PiAyXSB8IDApIC8gK2dbMjU4XSkgPj4+IDAgPlxuICAgICAgICAgICAgICAgICAgICAgICAgYiA+Pj4gMFxuICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNlKGwsIGssIChiIC0gKGNbKGwgKyAxMzA4OCkgPj4gMl0gfCAwKSkgfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgayxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAofn4oKyhjW2NbKGwgKyAxMzA4MCkgPj4gMl0gPj4gMl0gfCAwKSAvICtnWzI1OF0pIC1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGwgKyAxMzA4OCkgPj4gMl0gfCAwKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgobyB8IDApID09IDc1Mikge1xuICAgICAgICAgICAgICAgICAgICBjW2wgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICBtID1cbiAgICAgICAgICAgICAgICAgICAgICAgIF8oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhsICsgMTMwODgpID4+IDJdIHwgMCkgLSBmKSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sobCArIDEyKSA+PiAyXSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBuID0gbTtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGo7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChvIHwgMCkgPT0gNzU4KSB7XG4gICAgICAgICAgICAgICAgICAgIG0gPSBfKGgsIGNbKGwgKyAxMikgPj4gMl0gfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBtO1xuICAgICAgICAgICAgICAgICAgICBpID0gajtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGI3KGIpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwO1xuICAgICAgICAgICAgICAgIGUgPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBjWyhlICsgMTMwODApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBmID0gY1soZSArIDEzMDUyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgTDk2Nzogd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgZyA9IGY7XG4gICAgICAgICAgICAgICAgICAgIGYgPSAoZyAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaCA9IDc3MjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDE3MjQgKyAoKGYgKiAyMzYpIHwgMCkpIHwgMF0gfCAwIHwgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAxXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgMTcyNCArICgoZiAqIDIzNikgfCAwKSArIDEpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoYiArIDQpIHwgMF0gfCAwIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAxNzI0ICsgKChmICogMjM2KSB8IDApICsgMikgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgNikgfCAwXSB8IDAgfCAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMOTY3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoaCB8IDApID09IDc3Mikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGFbKGUgKyAxNzI0ICsgKChmICogMjM2KSB8IDApICsgMykgfCAwXSA9IGFbKGIgKyA3KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICBjZihlLCBmKTtcbiAgICAgICAgICAgICAgICBiSihlLCBmKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBiOChhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBiID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGYgPSAwO1xuICAgICAgICAgICAgICAgIGIgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBkWygoY1soYiArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGNbKGIgKyAxMzA1MikgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPSBlO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGYgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoYiArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkpIHwgMF0gfCAwIHwgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDEpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYSB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaihiLCBlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGI5KGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDA7XG4gICAgICAgICAgICAgICAgYiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGRbKChjWyhiICsgMTMwODApID4+IDJdIHwgMCkgKyA0KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gY1soYiArIDEzMDUyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoZiAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDEpIHwgMF0gfCAwIHwgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYSB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSkgfCAwXSB8IDAgfCAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZihiLCBlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiSihiLCBlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNhKGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDA7XG4gICAgICAgICAgICAgICAgYiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGNbKGIgKyAxMzA1MikgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBkWygoY1soYiArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGE7XG4gICAgICAgICAgICAgICAgICAgIGEgPSAoZiAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSkgfCAwXSB8IDAgfCAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGIgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMSkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpKGIsIGEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY2IoYSwgYikge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGQgPSAwO1xuICAgICAgICAgICAgICAgIGQgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBiO1xuICAgICAgICAgICAgICAgIGNbKGQgKyAxMDg0ICsgKChhICogNDApIHwgMCkgKyA4KSA+PiAyXSA9IDkwO1xuICAgICAgICAgICAgICAgIGNbKGQgKyAxMDg0ICsgKChhICogNDApIHwgMCkgKyAyNCkgPj4gMl0gPSAxMjc7XG4gICAgICAgICAgICAgICAgY1soZCArIDEwODQgKyAoKGEgKiA0MCkgfCAwKSArIDEyKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgY1soZCArIDEwODQgKyAoKGEgKiA0MCkgfCAwKSArIDIwKSA+PiAyXSA9IDgxOTI7XG4gICAgICAgICAgICAgICAgZ1soZCArIDEwODQgKyAoKGEgKiA0MCkgfCAwKSArIDM2KSA+PiAyXSA9IDAuMDtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjYyhiKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGcgPSAwO1xuICAgICAgICAgICAgICAgIGUgPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBjWyhlICsgMTMwNTIpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBmID0gZFsoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDQpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGcgPSBiO1xuICAgICAgICAgICAgICAgICAgICBiID0gKGcgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkpIHwgMF0gfCAwIHwgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAxXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgMTcyNCArICgoYiAqIDIzNikgfCAwKSArIDEpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWyhlICsgMTA4NCArICgoZiAqIDQwKSB8IDApICsgMTIpID4+IDJdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVsoZSArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkpIHwgMF0gPSAyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpKGUsIGIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNkKGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDA7XG4gICAgICAgICAgICAgICAgYiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGNbKGIgKyAxMzA1MikgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBkWygoY1soYiArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGE7XG4gICAgICAgICAgICAgICAgICAgIGEgPSAoZiAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDEpIHwgMF0gfCAwIHwgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZSB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSkgfCAwXSB8IDAgfCAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSkgfCAwXSB8IDAgfCAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaChiLCBhKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNlKGEsIGIsIGQpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGkgPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMDtcbiAgICAgICAgICAgICAgICBlID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICBiID0gZDtcbiAgICAgICAgICAgICAgICBpZiAoKChjWyhlICsgOCkgPj4gMl0gJiAxKSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZiA9IDE7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZiA9IDI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoYiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGQgPSBiO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGQgfCAwKSA+IChjWyhlICsgMTA2NCkgPj4gMl0gfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IGNbKGUgKyAxMDY0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgY2coZSwgZCk7XG4gICAgICAgICAgICAgICAgICAgIGcgPSBjWyhlICsgMTA2MCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBoID0gY1thID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGNbKGUgKyAxMDcyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGogPSBfKGYsIGQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYVpbZyAmIDE1XShoLCBpLCBqKTtcbiAgICAgICAgICAgICAgICAgICAgaiA9IF8oY1soZSArIDEyKSA+PiAyXSB8IDAsIGQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGE7XG4gICAgICAgICAgICAgICAgICAgIGNbaSA+PiAyXSA9IChjW2kgPj4gMl0gfCAwKSArIGo7XG4gICAgICAgICAgICAgICAgICAgIGIgPSAoYiAtIGQpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY2YoYSwgYikge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDA7XG4gICAgICAgICAgICAgICAgZSA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGI7XG4gICAgICAgICAgICAgICAgYiA9XG4gICAgICAgICAgICAgICAgICAgIF8oXG4gICAgICAgICAgICAgICAgICAgICAgICBkWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDMpIHwgMF0gfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDEpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9XG4gICAgICAgICAgICAgICAgICAgIF8oXG4gICAgICAgICAgICAgICAgICAgICAgICBiLFxuICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDEpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwXG4gICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoKGNbKGUgKyA4KSA+PiAyXSAmIDEpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDIzMikgPj4gMl0gPSAzO1xuICAgICAgICAgICAgICAgICAgICBnWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDY4KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICArKGYgfCAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICArZ1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgNCkgPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDg0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICBdICpcbiAgICAgICAgICAgICAgICAgICAgICAgICtnWyhlICsgMTYpID4+IDJdICpcbiAgICAgICAgICAgICAgICAgICAgICAgIDQuNzY4MzcxNTgyMDMxMjVlLTc7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMjI4KSA+PiAyXSB8IDApID4gNjApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAyMjgpID4+IDJdIHwgMCkgPj1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA2OFxuICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA9IDgyNztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMjMyKSA+PiAyXSA9IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICBnWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDY4KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKyhmIHwgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICtnW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgNCkgPj4gMl0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgODQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgK2dbKGUgKyAxNikgPj4gMl0gKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQuNzY4MzcxNTgyMDMxMjVlLTc7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBoID0gODI3O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgaWYgKChoIHwgMCkgPT0gODI3KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAyMjgpID4+IDJdIHwgMCkgPCA1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDIzMikgPj4gMl0gPSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgZ1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA2OCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICsoZiB8IDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICArZ1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDQpID4+IDJdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDg0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICtnWyhlICsgMTYpID4+IDJdICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA5LjUzNjc0MzE2NDA2MjVlLTc7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMjI4KSA+PiAyXSB8IDApID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMjNcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMjMyKSA+PiAyXSA9IDI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA2OCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArKGYgfCAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICtnW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDQpID4+IDJdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgODQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgK2dbKGUgKyAxNikgPj4gMl0gKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA5LjUzNjc0MzE2NDA2MjVlLTc7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMjMyKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA2OCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArKGYgfCAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICtnW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDQpID4+IDJdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgODQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgK2dbKGUgKyAxNikgPj4gMl0gKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA3LjQ1MDU4MDU5NjkyMzgyOGUtOTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDcyKSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICtnWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDY4KSA+PiAyXSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDIyOCkgPj4gMl0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAoZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA2OCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdbZiA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICtnW2YgPj4gMl0gKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDEyNyAtXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE3MjQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChhICogMjM2KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIyOCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjZyhhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGYgPSAwO1xuICAgICAgICAgICAgICAgIGUgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBiO1xuICAgICAgICAgICAgICAgIGlmICgoKGNbKGUgKyA4KSA+PiAyXSAmIDEpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBmID0gYSA8PCAyO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPSBhIDw8IDM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGM1KGNbKGUgKyAxMDcyKSA+PiAyXSB8IDAsIDAsIGYgfCAwKTtcbiAgICAgICAgICAgICAgICBmID0gMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSA+PSAoY1soZSArIDEzMDUyKSA+PiAyXSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGRbKGUgKyAxNzI0ICsgKChmICogMjM2KSB8IDApKSB8IDBdIHwgMCB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJLKGUsIGNbKGUgKyAxMDcyKSA+PiAyXSB8IDAsIGYsIGEpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGYgPSAoZiArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZiA9IChlICsgMTMwODgpIHwgMDtcbiAgICAgICAgICAgICAgICBjW2YgPj4gMl0gPSAoY1tmID4+IDJdIHwgMCkgKyBhO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNoKGIsIGMpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgYyA9IGMgfCAwO1xuICAgICAgICAgICAgICAgIGFbKGIgKyAxNzI0ICsgKChjICogMjM2KSB8IDApKSB8IDBdID0gNDtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjaShiLCBkKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGYgPSAwO1xuICAgICAgICAgICAgICAgIGUgPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBkO1xuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgKChhW1xuICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhlICsgMTcyNCArICgoYiAqIDIzNikgfCAwKSArIDQpID4+IDJdIHwgMCkgKyAxMTApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgIF0gJlxuICAgICAgICAgICAgICAgICAgICAgICAgNjQpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgY1soZSArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkgKyAyMjApID4+IDJdID0gMztcbiAgICAgICAgICAgICAgICAgICAgYVsoZSArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkpIHwgMF0gPSAzO1xuICAgICAgICAgICAgICAgICAgICBkID0gZTtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGI7XG4gICAgICAgICAgICAgICAgICAgIGJJKGQsIGYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYkooZSwgYik7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBhWyhlICsgMTcyNCArICgoYiAqIDIzNikgfCAwKSkgfCAwXSA9IDM7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjaihhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGwgPSAwLFxuICAgICAgICAgICAgICAgICAgICBtID0gMC4wO1xuICAgICAgICAgICAgICAgIGUgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBiO1xuICAgICAgICAgICAgICAgIGIgPSAoKGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMjApID4+IDJdIHwgMCkgPCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9XG4gICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAoZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoZFsoZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAxKSB8IDBdIHwgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMjApID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICBdIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDQpID4+IDJdIHwgMCkgKyAxMikgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoY1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAyMTIpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBpID0gMzI7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBqID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGkgPSAoaiAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgODAgKyAoaSA8PCAyKSkgPj4gMlxuICAgICAgICAgICAgICAgICAgICAgICAgXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSA9PSA4MTkyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gODY2O1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IDg2NjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID4gMTYzODMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gODY2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZiA9IChmIC0gODE5MikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICtnW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMSkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9PSAwLjBcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoZFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNzI0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGEgKiAyMzYpIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzIpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gLWkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gKDE3MDQgKyAoKChpID4+IDUpICYgMjU1KSA8PCAzKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbayA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkW2pdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhqICsgMSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoaiArIDIpIHwgMF0gPDwgMTYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhqICsgMykgfCAwXSA8PCAyNCkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDQpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRbKGogKyA0KSB8IDBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhqICsgNSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoaiArIDYpIHwgMF0gPDwgMTYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhqICsgNykgfCAwXSA8PCAyNCkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAraFtrID4+IDNdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gKDM3NTIgKyAoKGkgPj4gMTMpIDw8IDMpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDEpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDM2KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW2sgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZFtqXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoaiArIDEpIHwgMF0gPDwgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGogKyAyKSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoaiArIDMpIHwgMF0gPDwgMjQpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyA0KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkWyhqICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoaiArIDUpIHwgMF0gPDwgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGogKyA2KSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoaiArIDcpIHwgMF0gPDwgMjQpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgK2hbayA+PiAzXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDEyKSA+PiAyXSA9IH5+KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArZ1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAxKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyhjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDgpID4+IDJdIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDEyKSA+PiAyXSA9IH5+KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA4KSA+PiAyXSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSAvXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICtnW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDEpIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzNikgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgaWYgKChsIHwgMCkgPT0gODY2KSB7XG4gICAgICAgICAgICAgICAgICAgIGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgMTIpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgOCkgPj4gMl07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG0gPVxuICAgICAgICAgICAgICAgICAgICAoKCsoXG4gICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA0KSA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwXG4gICAgICAgICAgICAgICAgICAgICkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgKyhjWyhlICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDEyKSA+PiAyXSB8IDApKSAvXG4gICAgICAgICAgICAgICAgICAgICAgICAoKyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGUgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgNCkgPj4gMl0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzIpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICsoY1soZSArIDQpID4+IDJdIHwgMCkpKSAqXG4gICAgICAgICAgICAgICAgICAgIDQwOTYuMDtcbiAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIG0gPSAtMC4wIC0gbTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1soZSArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyAyMCkgPj4gMl0gPSB+fm07XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY2soYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgYiA9IDA7XG4gICAgICAgICAgICAgICAgYiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChhIHwgMCkgPj0gMTYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNiKGIsIGEpO1xuICAgICAgICAgICAgICAgICAgICBjWyhiICsgMTA4NCArICgoYSAqIDQwKSB8IDApICsgNCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgY1soYiArIDEwNTYpID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICBjWyhiICsgMTA4NCArICgoYSAqIDQwKSB8IDApICsgMTYpID4+IDJdID0gLTE7XG4gICAgICAgICAgICAgICAgICAgIGNbKGIgKyAxMDg0ICsgKChhICogNDApIHwgMCkgKyAzMikgPj4gMl0gPSAyO1xuICAgICAgICAgICAgICAgICAgICBjWyhiICsgMTA4NCArICgoYSAqIDQwKSB8IDApKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGEgPSAoYSArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY20oYik7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY2woYSwgYikge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMDtcbiAgICAgICAgICAgICAgICBlID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICBjbShlKTtcbiAgICAgICAgICAgICAgICBMMTEyMzogd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgKyhjW2NbKGUgKyAxMzA4MCkgPj4gMl0gPj4gMl0gfCAwKSAvICtnWzI1OF0gPj1cbiAgICAgICAgICAgICAgICAgICAgICAgICsoYSB8IDApXG4gICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChkWygoY1soZSArIDEzMDgwKSA+PiAyXSB8IDApICsgNSkgfCAwXSB8IDAgfCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbKChjWyhlICsgMTMwODApID4+IDJdIHwgMCkgKyA0KSB8IDBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gZFsoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDYpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNiKGUsIGRbKChjWyhlICsgMTMwODApID4+IDJdIHwgMCkgKyA0KSB8IDBdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbKChjWyhlICsgMTMwODApID4+IDJdIHwgMCkgKyA0KSB8IDBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSBkWygoY1soZSArIDEzMDgwKSA+PiAyXSB8IDApICsgNikgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDExOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkWygoY1soZSArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzIpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGRbKChjWyhlICsgMTMwODApID4+IDJdIHwgMCkgKyA2KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbKChjWyhlICsgMTMwODApID4+IDJdIHwgMCkgKyA0KSB8IDBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzNikgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gMC4wO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA5OToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSA5MDI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDExMjM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDk6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZSArIDEzMDU2KSA+PiAyXSAmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDQpIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSkpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDQpIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGRbKChjWyhlICsgMTMwODApID4+IDJdIHwgMCkgKyA2KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soZSArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gZFsoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDYpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgODoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoZFsoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDQpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIwKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDYpIHwgMF0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZFsoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDcpIHwgMF0gfCAwKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkWygoY1soZSArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IDAuMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTU6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbKChjWyhlICsgMTMwODApID4+IDJdIHwgMCkgKyA0KSB8IDBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gZFsoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDYpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMzkyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWygoY1soZSArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChkWygoY1soZSArIDEzMDgwKSA+PiAyXSB8IDApICsgNykgfCAwXSB8IDApIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4KSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZFsoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDYpIHwgMF0gfCAwKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA1OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGUgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkWygoY1soZSArIDEzMDgwKSA+PiAyXSB8IDApICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGRbKChjWyhlICsgMTMwODApID4+IDJdIHwgMCkgKyA2KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoZFsoKGNbKGUgKyAxMzA4MCkgPj4gMl0gfCAwKSArIDQpIHwgMF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSBkWygoY1soZSArIDEzMDgwKSA+PiAyXSB8IDApICsgNikgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYiA9IChlICsgMTMwODApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tiID4+IDJdID0gKGNbYiA+PiAyXSB8IDApICsgODtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgPT0gOTAyKSB7XG4gICAgICAgICAgICAgICAgICAgIGNbKGUgKyAxMzA4OCkgPj4gMl0gPSB+fihcbiAgICAgICAgICAgICAgICAgICAgICAgICsoY1tjWyhlICsgMTMwODApID4+IDJdID4+IDJdIHwgMCkgLyArZ1syNThdXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKChjWyhlICsgMTMwODApID4+IDJdIHwgMCkgIT0gKGNbKGUgKyAxMzA3NikgPj4gMl0gfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICBmID0gKGUgKyAxMzA4MCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW2YgPj4gMl0gPSAoY1tmID4+IDJdIHwgMCkgLSA4O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjWyhlICsgMTMwODgpID4+IDJdID0gYTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjbShiKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBjID0gMDtcbiAgICAgICAgICAgICAgICBjID0gYjtcbiAgICAgICAgICAgICAgICBiID0gMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSA+PSA0OCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYVsoYyArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkpIHwgMF0gPSAwO1xuICAgICAgICAgICAgICAgICAgICBiID0gKGIgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNuKGIsIGUsIGYpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGkgPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMCxcbiAgICAgICAgICAgICAgICAgICAgayA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGwgPSAwLFxuICAgICAgICAgICAgICAgICAgICBtID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG8gPSAwLFxuICAgICAgICAgICAgICAgICAgICBwID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBzID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdCA9IDA7XG4gICAgICAgICAgICAgICAgaCA9IGI7XG4gICAgICAgICAgICAgICAgYiA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGY7XG4gICAgICAgICAgICAgICAgaWYgKCgoY1soaCArIDEzMDU2KSA+PiAyXSAmICgxIDw8IGRbKGIgKyA0KSB8IDBdKSkgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPVxuICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChoICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDU0MCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkWyhiICsgNCkgfCAwXSB8IDApICogNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgNikgfCAwXSA8PCAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBmO1xuICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGggKyA1NDApID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhiICsgNikgfCAwXSA8PCAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoaiB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgIChjW2kgPj4gMl0gfCAwKSAhPSAxO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGFbKChjWyhpICsgNCkgPj4gMl0gfCAwKSArIDExMikgfCAwXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGYgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgxMDU2ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFbKChjWyhpICsgNCkgPj4gMl0gfCAwKSArIDExMikgfCAwXSA8PCAyKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDgpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkW2ZdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZiArIDEpIHwgMF0gPDwgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhmICsgMikgfCAwXSA8PCAxNikgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhmICsgMykgfCAwXSA8PCAyNCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gKDEwNTYgKyAoKGFbKGIgKyA2KSB8IDBdICYgMTI3KSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA4KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZFtmXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGYgKyAxKSB8IDBdIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZiArIDIpIHwgMF0gPDwgMTYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZiArIDMpIHwgMF0gPDwgMjQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgNCkgPj4gMl0gPSBjWyhpICsgNCkgPj4gMl07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKC0xICE9IChjWygxNjQwICsgKGRbKGIgKyA0KSB8IDBdIDw8IDIpKSA+PiAyXSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkWyhiICsgNCkgfCAwXSB8IDApICogNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBqID0gY1soMTY0MCArIChkWyhiICsgNCkgfCAwXSA8PCAyKSkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDAgPT0gKGNbKGYgKyA0ICsgKGogPDwgMikpID4+IDJdIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gaDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gY1soKGNbZiA+PiAyXSB8IDApICsgKChqICogMjgpIHwgMCkpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuID0gKGsgfCAwKSAhPSAwID8gMSA6IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbZiA+PiAyXSB8IDApICsgKChqICogMjgpIHwgMCkgKyAxMikgPj4gMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soKGNbZiA+PiAyXSB8IDApICsgKChqICogMjgpIHwgMCkgKyA4KSA+PiAyXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tmID4+IDJdIHwgMCkgKyAoKGogKiAyOCkgfCAwKSArIDQpID4+IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW2YgPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoaiAqIDI4KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IHI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbZiA+PiAyXSB8IDApICsgKChqICogMjgpIHwgMCkgKyAxNikgPj4gMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0xXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbZiA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChqICogMjgpIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNikgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IChrIHwgMCkgIT0gMCA/IDEgOiAtMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tmID4+IDJdIHwgMCkgKyAoKGogKiAyOCkgfCAwKSArIDIwKSA+PiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tmID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGogKiAyOCkgfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIwKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gKGsgfCAwKSAhPSAwID8gMSA6IC0xO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgNCArIChqIDw8IDIpKSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tmID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGogKiAyOCkgfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBjWyhmICsgNCArIChqIDw8IDIpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChoICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoZFsoYiArIDQpIHwgMF0gfCAwKSAqIDQwKSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLTFcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBjWyhoICsgMTA1MikgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI4ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoZFsoYiArIDQpIHwgMF0gfCAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGggK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChkWyhiICsgNCkgfCAwXSB8IDApICogNDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soaCArIDI4KSA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGggK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDg0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoZFsoYiArIDQpIHwgMF0gfCAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gZjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoYVsoKGNbKGkgKyA0KSA+PiAyXSB8IDApICsgMTEyKSB8IDBdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKDEwNTYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVsoKGNbKGkgKyA0KSA+PiAyXSB8IDApICsgMTEyKSB8IDBdIDw8IDIpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgOCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRbal0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhqICsgMSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGogKyAyKSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGogKyAzKSB8IDBdIDw8IDI0KTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGogPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgxMDU2ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoKGRbKGIgKyA2KSB8IDBdIHwgMCkgKyAoY1sxNjYyXSB8IDApKSAmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMjcpIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDgpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkW2pdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoaiArIDEpIHwgMF0gPDwgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhqICsgMikgfCAwXSA8PCAxNikgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhqICsgMykgfCAwXSA8PCAyNCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA4KSA+PiAyXSA9IH5+KFxuICAgICAgICAgICAgICAgICAgICAgICAgKCsoY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA4KSA+PiAyXSB8IDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICArZ1syNjBdKSAvXG4gICAgICAgICAgICAgICAgICAgICAgICA0NDAuMFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICBjbyhoLCBlLCBpLCBkWyhiICsgNykgfCAwXSB8IDApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBhWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSkgfCAwXSA9IDE7XG4gICAgICAgICAgICAgICAgYVsoaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyAxKSB8IDBdID0gYVsoYiArIDQpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgIGFbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMikgfCAwXSA9IGFbKGIgKyA2KSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICBhWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDMpIHwgMF0gPVxuICAgICAgICAgICAgICAgICAgICBjcChcbiAgICAgICAgICAgICAgICAgICAgICAgIGFbKGIgKyA3KSB8IDBdIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICtnWygxNTc2ICsgKGRbKGIgKyA0KSB8IDBdIDw8IDIpKSA+PiAyXVxuICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICBjWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDE2KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyAyMCkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgNDQpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICBjWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDQ4KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgNCkgPj4gMl0gfCAwKSArIDk2KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICAgICBjWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDM2KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgNCkgPj4gMl0gfCAwKSArIDkyKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICAgICBjWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDQwKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA1MikgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDQpID4+IDJdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwMCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgIF07XG4gICAgICAgICAgICAgICAgY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA1NikgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMjEyKSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgNCkgPj4gMl0gfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICAgICBjWyhoICsgMTcyNCArICgoZSAqIDIzNikgfCAwKSArIDIwOCkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMjE2KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgaSA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChpIHwgMCkgPj0gMzIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgODAgKyAoaSA8PCAyKSkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICBpID0gKGkgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAoaCArIDEwODQgKyAoKChkWyhiICsgNCkgfCAwXSB8IDApICogNDApIHwgMCkgKyAxNikgPj4gMlxuICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgIC0xXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMjI4KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChoICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA4NCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGRbKGIgKyA0KSB8IDBdIHwgMCkgKiA0MCkgfCAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMjI4KSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICBhW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA0KSA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTExKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjaihoLCBlKTtcbiAgICAgICAgICAgICAgICBjZihoLCBlKTtcbiAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICgoYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICgoY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyA0KSA+PiAyXSB8IDApICsgMTEwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICBdICZcbiAgICAgICAgICAgICAgICAgICAgICAgIDY0KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMjIwKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyAxNzI0ICsgKChlICogMjM2KSB8IDApICsgMjQpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyAyMjQpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgYiA9IGg7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBlO1xuICAgICAgICAgICAgICAgICAgICBiSShiLCBpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGJKKGgsIGUpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY1soaCArIDE3MjQgKyAoKGUgKiAyMzYpIHwgMCkgKyAzMikgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICBiSihoLCBlKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNvKGEsIGIsIGQsIGUpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGkgPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMDtcbiAgICAgICAgICAgICAgICBmID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICBiID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZTtcbiAgICAgICAgICAgICAgICBlID0gY1tiID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gY1soYiArIDQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKGUgfCAwKSA9PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIGNbKGYgKyAxNzI0ICsgKChhICogMjM2KSB8IDApICsgNCkgPj4gMl0gPSBnO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGggPSBjWyhmICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBpID0gMDtcbiAgICAgICAgICAgICAgICBMMTIzMjogd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChpIHwgMCkgPj0gKGUgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhnICsgMTYpID4+IDJdIHwgMCkgPD0gKGQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soZyArIDIwKSA+PiAyXSB8IDApIDwgKGQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhnICsgMjQpID4+IDJdIHwgMCkgPiAoaCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKGcgKyAyOCkgPj4gMl0gfCAwKSA+PSAoaCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSA5Nzc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxMjMyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgIGcgPSAoZyArIDExNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpID0gKGkgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IDk3Nykge1xuICAgICAgICAgICAgICAgICAgICBjWyhmICsgMTcyNCArICgoYSAqIDIzNikgfCAwKSArIDQpID4+IDJdID0gZztcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBqID0gMjE0NzQ4MzY0NztcbiAgICAgICAgICAgICAgICBkID0gY1soYiArIDQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gZDtcbiAgICAgICAgICAgICAgICBiID0gZDtcbiAgICAgICAgICAgICAgICBpID0gMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGkgfCAwKSA+PSAoZSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBkID0gKChjWyhnICsgMzIpID4+IDJdIHwgMCkgLSBoKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IC1kIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGQgfCAwKSA8IChqIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGogPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgYiA9IGc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZyA9IChnICsgMTE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSAoaSArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1soZiArIDE3MjQgKyAoKGEgKiAyMzYpIHwgMCkgKyA0KSA+PiAyXSA9IGI7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY3AoYSwgYikge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gK2I7XG4gICAgICAgICAgICAgICAgdmFyIGQgPSAwLFxuICAgICAgICAgICAgICAgICAgICBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMCxcbiAgICAgICAgICAgICAgICAgICAgayA9IDA7XG4gICAgICAgICAgICAgICAgZCA9IGk7XG4gICAgICAgICAgICAgICAgZSA9IGE7XG4gICAgICAgICAgICAgICAgZiA9IGI7XG4gICAgICAgICAgICAgICAgaWYgKGYgPD0gMS4wKSB7XG4gICAgICAgICAgICAgICAgICAgIGcgPSB+figrKChlICYgMjU1KSB8IDApICogZik7XG4gICAgICAgICAgICAgICAgICAgIGggPSBnO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGggfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGEgPVxuICAgICAgICAgICAgICAgICAgICAgICAgKChlICYgMjU1KSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKH5+KCsoKDEyNyAtIChlICYgMjU1KSkgfCAwKSAqIChmIC0gMS4wKSkgJiAyNTUpKSAmXG4gICAgICAgICAgICAgICAgICAgICAgICAyNTU7XG4gICAgICAgICAgICAgICAgICAgIGogPSBlICYgMjU1O1xuICAgICAgICAgICAgICAgICAgICBlID0gYSAmIDI1NTtcbiAgICAgICAgICAgICAgICAgICAgYUcoXG4gICAgICAgICAgICAgICAgICAgICAgICA0Nzg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgMTYpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gaiksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDgpID4+IDJdID0gZSksXG4gICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICBnID0gYTtcbiAgICAgICAgICAgICAgICAgICAgaCA9IGc7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaCB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY3EoZCwgZSwgZiwgZykge1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGYgfCAwO1xuICAgICAgICAgICAgICAgIGcgPSBnIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBrID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG0gPSAwLFxuICAgICAgICAgICAgICAgICAgICBuID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHAgPSAwLFxuICAgICAgICAgICAgICAgICAgICBxID0gMCxcbiAgICAgICAgICAgICAgICAgICAgciA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHMgPSAwLFxuICAgICAgICAgICAgICAgICAgICB0ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdSA9IDA7XG4gICAgICAgICAgICAgICAgaCA9IGk7XG4gICAgICAgICAgICAgICAgaSA9IChpICsgNDApIHwgMDtcbiAgICAgICAgICAgICAgICBqID0gaCB8IDA7XG4gICAgICAgICAgICAgICAgayA9IChoICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgIGwgPSAoaCArIDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgbSA9IChoICsgMjQpIHwgMDtcbiAgICAgICAgICAgICAgICBuID0gKGggKyAzMikgfCAwO1xuICAgICAgICAgICAgICAgIG8gPSBkO1xuICAgICAgICAgICAgICAgIGQgPSBlO1xuICAgICAgICAgICAgICAgIGUgPSBmO1xuICAgICAgICAgICAgICAgIGYgPSBnO1xuICAgICAgICAgICAgICAgIGNbKGQgKyAxMzA5MikgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGNbKGQgKyAxMzA5NikgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGNbKGQgKyAxMzA4NCkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChjUChvLCBuIHwgMCwgMSwgNCkgfCAwKSA9PSA0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNQKG8sIGosIDQsIDEpIHwgMCkgIT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY1tqID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbaiA+PiAyXSAmIDI1NSkgPDwgMjQpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbaiA+PiAyXSAmIDY1MjgwKSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW2ogPj4gMl0gJiAxNjcxMTY4MCkgPj4gOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tqID4+IDJdID4+IDI0KSAmIDI1NSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjNChuIHwgMCwgNDc3NiwgNCkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1tqID4+IDJdIHwgMCkgPCA2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gbztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IGs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNQKGcsIHAsIDIsIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IG87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPSBsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjUChwLCBnLCAyLCAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPSBvO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwID0gbTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1AoZywgcCwgMiwgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiW2sgPj4gMV0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoYltrID4+IDFdICYgMjU1KSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChiW2sgPj4gMV0gPj4gOCkgJiAyNTUpKSAmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA2NTUzNTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYltsID4+IDFdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGJbbCA+PiAxXSAmIDI1NSkgPDwgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoYltsID4+IDFdID4+IDgpICYgMjU1KSkgJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjU1MzU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJbbSA+PiAxXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChiW20gPj4gMV0gJiAyNTUpIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGJbbSA+PiAxXSA+PiA4KSAmIDI1NSkpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDY1NTM1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGJbbSA+PiAxXSB8IDApIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSgoKGJbbSA+PiAxXSB8IDApIC8gMjU2KSB8IDApIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYlttID4+IDFdICYgMjU1XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gYlttID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbaiA+PiAyXSB8IDApID4gNikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1EobywgKChjW2ogPj4gMl0gfCAwKSAtIDYpIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiW2sgPj4gMV0gfCAwKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiW2sgPj4gMV0gfCAwKSA+IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGQgKyAxMzA4NCkgPj4gMl0gPSBiaSgxMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbY1soZCArIDEzMDg0KSA+PiAyXSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhkICsgMTMwODQpID4+IDJdIHwgMCkgKyA1KSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGQgKyAxMzA4NCkgPj4gMl0gfCAwKSArIDgpID4+IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwID0gKGQgKyAxMzA5MikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbcCA+PiAyXSA9IChjW3AgPj4gMl0gfCAwKSArIDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IGJbayA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHAgfCAwKSA9PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAociB8IDApID49XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChiW2wgPj4gMV0gfCAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzID0gMTAyMztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNyKG8sIGQsIDApIHwgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IChyICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChzIHwgMCkgPT0gMTAyMykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3MoZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHAgfCAwKSA9PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAociB8IDApID49XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChiW2wgPj4gMV0gfCAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzID0gMTAzMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNyKG8sIGQsIDEpIHwgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IChyICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChzIHwgMCkgPT0gMTAzMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3MoZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHAgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNyKG8sIGQsIDApIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3MoZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gY3QoZCwgcSwgZSwgZikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1IHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gdDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1IHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgdSA9IHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gaDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1IHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIHQgPSAwO1xuICAgICAgICAgICAgICAgIHUgPSB0O1xuICAgICAgICAgICAgICAgIGkgPSBoO1xuICAgICAgICAgICAgICAgIHJldHVybiB1IHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNyKGEsIGIsIGQpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBrID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG0gPSAwLFxuICAgICAgICAgICAgICAgICAgICBuID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbyA9IDA7XG4gICAgICAgICAgICAgICAgZSA9IGk7XG4gICAgICAgICAgICAgICAgaSA9IChpICsgMTYpIHwgMDtcbiAgICAgICAgICAgICAgICBmID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgZyA9IChlICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgIGggPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBjWyhhICsgMTMwODQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gMTA0NztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhiICsgOCkgPj4gMl0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID0gY1soYiArIDgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKGEgKyAxMzA5NikgPj4gMl0gPSBjW2IgPj4gMl07XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBqID0gMTA0NztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IDEwNDcpIHtcbiAgICAgICAgICAgICAgICAgICAgY1soYSArIDEzMDk2KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChjUChoLCBnIHwgMCwgMSwgNCkgfCAwKSA9PSA0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNQKGgsIGYsIDQsIDEpIHwgMCkgIT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY1tmID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbZiA+PiAyXSAmIDI1NSkgPDwgMjQpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbZiA+PiAyXSAmIDY1MjgwKSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW2YgPj4gMl0gJiAxNjcxMTY4MCkgPj4gOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tmID4+IDJdID4+IDI0KSAmIDI1NSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGM0KGcgfCAwLCA2MjcyLCA0KSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gLTI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IGs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGwgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gY3YoaCwgYSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IDEwNTU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG0gfCAwKSA9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gMTA1NztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSBjWyhiICsgOCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG4gPSAoY1tkID4+IDJdIHwgMCkgPCAoY1ttID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW4pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gY1soYiArIDgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sobSArIDgpID4+IDJdID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhiICsgOCkgPj4gMl0gPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8gPSAoYSArIDEzMDkyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tvID4+IDJdID0gKGNbbyA+PiAyXSB8IDApICsgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID0gbTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IDEwNTUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gLTI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IGs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGwgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoaiB8IDApID09IDEwNTcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbCB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICBrID0gLTE7XG4gICAgICAgICAgICAgICAgbCA9IGs7XG4gICAgICAgICAgICAgICAgaSA9IGU7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGwgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY3MoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgYiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGQgPSAwO1xuICAgICAgICAgICAgICAgIGIgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBjWyhiICsgMTMwODQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gYTtcbiAgICAgICAgICAgICAgICBpZiAoKGEgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChkIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYSA9IGNbKGQgKyA4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGMwKGQpO1xuICAgICAgICAgICAgICAgICAgICBkID0gYTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1soYiArIDEzMDg0KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY3QoYiwgZSwgZiwgZykge1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGYgfCAwO1xuICAgICAgICAgICAgICAgIGcgPSBnIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBrID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG0gPSAwLFxuICAgICAgICAgICAgICAgICAgICBuID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHAgPSAwLFxuICAgICAgICAgICAgICAgICAgICBxID0gMCxcbiAgICAgICAgICAgICAgICAgICAgciA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHMgPSAwLFxuICAgICAgICAgICAgICAgICAgICB0ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHYgPSAwLFxuICAgICAgICAgICAgICAgICAgICB3ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgeCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHkgPSAwLFxuICAgICAgICAgICAgICAgICAgICB6ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgQSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEIgPSAwO1xuICAgICAgICAgICAgICAgIGggPSBpO1xuICAgICAgICAgICAgICAgIGkgPSAoaSArIDE5MikgfCAwO1xuICAgICAgICAgICAgICAgIGogPSBoIHwgMDtcbiAgICAgICAgICAgICAgICBrID0gKGggKyA2NCkgfCAwO1xuICAgICAgICAgICAgICAgIGwgPSAoaCArIDEyOCkgfCAwO1xuICAgICAgICAgICAgICAgIG0gPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBlO1xuICAgICAgICAgICAgICAgIGUgPSBmO1xuICAgICAgICAgICAgICAgIGYgPSBnO1xuICAgICAgICAgICAgICAgIGcgPSAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApID49IDE2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjWyhqICsgKGcgPDwgMikpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgY1soayArIChnIDw8IDIpKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbKGwgKyAoZyA8PCAyKSkgPj4gMl0gPSBjWyhtICsgMTA1NikgPj4gMl07XG4gICAgICAgICAgICAgICAgICAgIGcgPSAoZyArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbiA9IDVlNTtcbiAgICAgICAgICAgICAgICBjdShtLCBuLCBiKTtcbiAgICAgICAgICAgICAgICBvID0gYmkoKChjWyhtICsgMTMwOTIpID4+IDJdIHwgMCkgKyAxKSA8PCAzKSB8IDA7XG4gICAgICAgICAgICAgICAgcCA9IG87XG4gICAgICAgICAgICAgICAgcSA9IG87XG4gICAgICAgICAgICAgICAgbyA9IGNbKG0gKyAxMzA4NCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIHIgPSAwO1xuICAgICAgICAgICAgICAgIHMgPSAwO1xuICAgICAgICAgICAgICAgIHQgPSAwO1xuICAgICAgICAgICAgICAgIHUgPSAwO1xuICAgICAgICAgICAgICAgIHYgPSAwO1xuICAgICAgICAgICAgICAgIGcgPSAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApID49IChjWyhtICsgMTMwOTIpID4+IDJdIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHcgPSAwO1xuICAgICAgICAgICAgICAgICAgICB4ID0gZFsobyArIDUpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHggfCAwKSA9PSA5KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKG0gKyAxMzA1NikgPj4gMl0gJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDEgPDwgKGRbKG8gKyA0KSB8IDBdIHwgMCkpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTQwICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChkWyhvICsgNikgfCAwXSB8IDApIDw8IDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHkgPSBkWyhvICsgNikgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhWyhvICsgNikgfCAwXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1soayArICgoZFsobyArIDQpIHwgMF0gfCAwKSA8PCAyKSkgPj4gMl0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoeSB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoayArICgoZFsobyArIDQpIHwgMF0gfCAwKSA8PCAyKSkgPj4gMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IHk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHkgPSBkWyhvICsgNikgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGwgKyAoKGRbKG8gKyA0KSB8IDBdIHwgMCkgPDwgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChkWyhvICsgNCkgfCAwXSB8IDApIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoeSB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHogPSAxMDk2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGwgKyAoKGRbKG8gKyA0KSB8IDBdIHwgMCkgPDwgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IHk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHogPSAxMDk2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh6IHwgMCkgPT0gMTA5Nikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHggfCAwKSA9PSAxNSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhtICsgMTMwNTYpID4+IDJdICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgxIDw8IChkWyhvICsgNCkgfCAwXSB8IDApKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobSArIDI4ICsgKChkWyhvICsgNikgfCAwXSB8IDApIDw8IDIpKSA+PiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5ID0gZFsobyArIDYpIHwgMF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbKG8gKyA2KSB8IDBdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGogKyAoKGRbKG8gKyA0KSB8IDBdIHwgMCkgPDwgMikpID4+IDJdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh5IHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soaiArICgoZFsobyArIDQpIHwgMF0gfCAwKSA8PCAyKSkgPj4gMl0gPSB5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgPSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHggfCAwKSA9PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh2IHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKG0gKyAxMzA1NikgPj4gMl0gJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDEgPDwgKGRbKG8gKyA0KSB8IDBdIHwgMCkpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG0gK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTQwICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChrICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChkWyhvICsgNCkgfCAwXSB8IDApIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGRbKG8gKyA2KSB8IDBdIHwgMCkgPDwgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDU0MCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoayArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZFsobyArIDQpIHwgMF0gfCAwKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChkWyhvICsgNikgfCAwXSB8IDApIDw8IDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1sobCArICgoZFsobyArIDQpIHwgMF0gfCAwKSA8PCAyKSkgPj4gMl0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG0gK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjggK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGogK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGRbKG8gKyA0KSB8IDBdIHwgMCkgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGwgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZFsobyArIDQpIHwgMF0gfCAwKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZFsobyArIDQpIHwgMF0gfCAwKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChkWyhvICsgNCkgfCAwXSB8IDApIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSAtMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgIHggPSAoKGNbbyA+PiAyXSB8IDApIC0gdCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBBID0geDtcbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh4IHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodiB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IDExMjU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCID0gXyhjWyhtICsgMTA3NikgPj4gMl0gfCAwLCBBKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IChzICsgKF8oY1sobSArIDEwODApID4+IDJdIHwgMCwgQSkgfCAwKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKHMgJiAtNjU1MzYpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCID0gKEIgKyAoKHMgPj4gMTYpICYgNjU1MzUpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPSBzICYgNjU1MzU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSAodSArIEIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IDExMjU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKHogfCAwKSA9PSAxMTI1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB6ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodiB8IDApID09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGRbKG8gKyA1KSB8IDBdIHwgMCB8IDApID09IDEwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGRbKG8gKyA0KSB8IDBdIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGRbKG8gKyA3KSB8IDBdIHwgMCkgPDwgOCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGRbKG8gKyA2KSB8IDBdIHwgMCkgPDwgMTYpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGN1KG0sIG4sIGIpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgodyB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIEEgPSBwO1xuICAgICAgICAgICAgICAgICAgICAgICAgeCA9IG8gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tBID4+IDJdID0gY1t4ID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1soQSArIDQpID4+IDJdID0gY1soeCArIDQpID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1twID4+IDJdID0gdTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHAgPSAocCArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHIgPSAociArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0ID0gY1tvID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgbyA9IGNbKG8gKyA4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGcgPSAoZyArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1twID4+IDJdID0gdTtcbiAgICAgICAgICAgICAgICBhWyhwICsgNSkgfCAwXSA9IDk5O1xuICAgICAgICAgICAgICAgIHIgPSAociArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICBjcyhtKTtcbiAgICAgICAgICAgICAgICBjW2UgPj4gMl0gPSByO1xuICAgICAgICAgICAgICAgIGNbZiA+PiAyXSA9IHU7XG4gICAgICAgICAgICAgICAgaSA9IGg7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHEgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY3UoYSwgYiwgZCkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDAuMDtcbiAgICAgICAgICAgICAgICBlID0gYTtcbiAgICAgICAgICAgICAgICBmID0gKCsoYiB8IDApICogKyhjWyhlICsgNCkgPj4gMl0gfCAwKSAqIDAuMDY1NTM2KSAvICsoZCB8IDApO1xuICAgICAgICAgICAgICAgIGNbKGUgKyAxMDgwKSA+PiAyXSA9IH5+ZiAmIDY1NTM1O1xuICAgICAgICAgICAgICAgIGNbKGUgKyAxMDc2KSA+PiAyXSA9IH5+ZiA+PiAxNjtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjdihiLCBlKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBlIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGcgPSAwLFxuICAgICAgICAgICAgICAgICAgICBoID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwLFxuICAgICAgICAgICAgICAgICAgICBvID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHEgPSAwLFxuICAgICAgICAgICAgICAgICAgICByID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHQgPSAwLFxuICAgICAgICAgICAgICAgICAgICB1ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdiA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IGk7XG4gICAgICAgICAgICAgICAgaSA9IChpICsgNDApIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gZiB8IDA7XG4gICAgICAgICAgICAgICAgaCA9IChmICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgIGogPSAoZiArIDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgayA9IChmICsgMjQpIHwgMDtcbiAgICAgICAgICAgICAgICBsID0gKGYgKyAzMikgfCAwO1xuICAgICAgICAgICAgICAgIG0gPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBlO1xuICAgICAgICAgICAgICAgIEwxNDQyOiB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBlID0gY3cobSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBuID0gKGIgKyAxMzA5NikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW24gPj4gMl0gPSAoY1tuID4+IDJdIHwgMCkgKyBlO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGNQKG0sIGcsIDEsIDEpIHwgMCkgIT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbyA9IDExMzg7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGRbZ10gfCAwKSA9PSAyNDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvID0gMTE0MTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChkW2ddIHwgMCkgPT0gMjQ3KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8gPSAxMTQxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChkW2ddIHwgMCkgPT0gMjU1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjUChlLCBoLCAxLCAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBjdyhtKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZFtoXSB8IDApID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZFtoXSB8IDApID49IDE2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8gPSAxMTQ2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA9IG07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbiA9IHA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IGFbaF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN4KGUsIG4sIHEsIHIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IDExNDY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG8gfCAwKSA9PSAxMTQ2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBkW2hdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgociB8IDApID09IDQ3KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IDExNDc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE0NDI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChyIHwgMCkgPT0gODEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvID0gMTE0ODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTQ0MjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNRKG0sIHApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVtqXSA9IGFbZ10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChhW2pdICYgMTI4KSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbNjYzMl0gPSBkW2pdICYgMTU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhWzY2MjRdID0gKGRbal0gPj4gNCkgJiA3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IG07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjUChyLCBqLCAxLCAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhW2pdID0gZFtqXSAmIDEyNztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGRbNjYyNF0gfCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvID0gMTE1NjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTQ0MjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8gPSAxMTg4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxNDQyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA0OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IDExODY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE0NDI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDU6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8gPSAxMTU1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxNDQyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAyOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IDExNTc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE0NDI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDM6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjUChtLCBrLCAxLCAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVtrXSA9IGRba10gJiAxMjc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IDI1NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMMTQ2NjogZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGRbal0gfCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDk4OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVs2NjE2XSA9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDY2MDAgKyAoZFs2NjMyXSB8IDApKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGFba10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA2OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhWzY2MTZdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTQ2NjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDY1ODQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWzY2MzJdIHwgMCkpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICg2NjAwICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFs2NjMyXSB8IDApKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgociB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IDExO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChyIHwgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzI2MzlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IDExNzk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxNDQyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPSA0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPSA1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPSA3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA2NDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPSA2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMjA6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzID0gMTI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDEyMToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPSAxMztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTIzOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IDE0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IDE1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAzMjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZFtrXSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IDE1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTAwOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVs2NjE2XSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDY1ODQgKyAoZFs2NjMyXSB8IDApKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGFba10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMDE6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhWzY2MTZdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNjYwMCArIChkWzY2MzJdIHwgMCkpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gYVtrXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDk5OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVs2NjE2XSA9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDY1ODQgKyAoZFs2NjMyXSB8IDApKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGFba10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChzIHwgMCkgIT0gMjU1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8gPSAxMTg0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTQ0MjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKG8gfCAwKSA9PSAxMTQxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBjdyhtKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjUShtLCBwKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKG8gfCAwKSA9PSAxMTg0KSB7XG4gICAgICAgICAgICAgICAgICAgIHQgPSBiaSgxMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW3QgPj4gMl0gPSBjWyhiICsgMTMwOTYpID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNSkgfCAwXSA9IHMgJiAyNTU7XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA0KSB8IDBdID0gYVs2NjMyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA2KSB8IDBdID0gYVtrXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA3KSB8IDBdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgY1sodCArIDgpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgdSA9IHQ7XG4gICAgICAgICAgICAgICAgICAgIHYgPSB1O1xuICAgICAgICAgICAgICAgICAgICBpID0gZjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHYgfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKG8gfCAwKSA9PSAxMTU2KSB7XG4gICAgICAgICAgICAgICAgICAgIGNQKG0sIGssIDEsIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYVtrXSA9IGRba10gJiAxMjc7XG4gICAgICAgICAgICAgICAgICAgIHQgPSBiaSgxMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW3QgPj4gMl0gPSBjWyhiICsgMTMwOTYpID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNSkgfCAwXSA9IDE7XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA0KSB8IDBdID0gYVs2NjMyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA2KSB8IDBdID0gYVtqXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA3KSB8IDBdID0gYVtrXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbKHQgKyA4KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHUgPSB0O1xuICAgICAgICAgICAgICAgICAgICB2ID0gdTtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGY7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2IHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChvIHwgMCkgPT0gMTE3OSkge1xuICAgICAgICAgICAgICAgICAgICB0ID0gYmkoMTIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1t0ID4+IDJdID0gY1soYiArIDEzMDk2KSA+PiAyXTtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDUpIHwgMF0gPSAxMTtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDQpIHwgMF0gPSBhWzY2MzJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDYpIHwgMF0gPSAyO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNykgfCAwXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbKHQgKyA4KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHUgPSB0O1xuICAgICAgICAgICAgICAgICAgICB2ID0gdTtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGY7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2IHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChvIHwgMCkgPT0gMTEzOCkge1xuICAgICAgICAgICAgICAgICAgICB1ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgdiA9IHU7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBmO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdiB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgobyB8IDApID09IDExODgpIHtcbiAgICAgICAgICAgICAgICAgICAgY1AobSwgaywgMSwgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBhW2tdID0gZFtrXSAmIDEyNztcbiAgICAgICAgICAgICAgICAgICAgdCA9IGJpKDEyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbdCA+PiAyXSA9IGNbKGIgKyAxMzA5NikgPj4gMl07XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA1KSB8IDBdID0gODtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDQpIHwgMF0gPSBhWzY2MzJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDYpIHwgMF0gPSBhW2pdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDcpIHwgMF0gPSBhW2tdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1sodCArIDgpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgdSA9IHQ7XG4gICAgICAgICAgICAgICAgICAgIHYgPSB1O1xuICAgICAgICAgICAgICAgICAgICBpID0gZjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHYgfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKG8gfCAwKSA9PSAxMTg2KSB7XG4gICAgICAgICAgICAgICAgICAgIGFbal0gPSBkW2pdICYgMTI3O1xuICAgICAgICAgICAgICAgICAgICB0ID0gYmkoMTIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1t0ID4+IDJdID0gY1soYiArIDEzMDk2KSA+PiAyXTtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDUpIHwgMF0gPSA5O1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNCkgfCAwXSA9IGFbNjYzMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNikgfCAwXSA9IGFbal0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNykgfCAwXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbKHQgKyA4KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHUgPSB0O1xuICAgICAgICAgICAgICAgICAgICB2ID0gdTtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGY7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2IHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChvIHwgMCkgPT0gMTE0Nykge1xuICAgICAgICAgICAgICAgICAgICB1ID0gLTE7XG4gICAgICAgICAgICAgICAgICAgIHYgPSB1O1xuICAgICAgICAgICAgICAgICAgICBpID0gZjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHYgfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKG8gfCAwKSA9PSAxMTQ4KSB7XG4gICAgICAgICAgICAgICAgICAgIGNQKG0sIGosIDEsIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1AobSwgaywgMSwgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjUChtLCBsLCAxLCAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHQgPSBiaSgxMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW3QgPj4gMl0gPSBjWyhiICsgMTMwOTYpID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNSkgfCAwXSA9IDEwO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNCkgfCAwXSA9IGFbbF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNikgfCAwXSA9IGFbal0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNykgfCAwXSA9IGFba10gfCAwO1xuICAgICAgICAgICAgICAgICAgICBjWyh0ICsgOCkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICB1ID0gdDtcbiAgICAgICAgICAgICAgICAgICAgdiA9IHU7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBmO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdiB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgobyB8IDApID09IDExNTUpIHtcbiAgICAgICAgICAgICAgICAgICAgY1AobSwgaywgMSwgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBhW2tdID0gZFtrXSAmIDEyNztcbiAgICAgICAgICAgICAgICAgICAgdCA9IGJpKDEyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbdCA+PiAyXSA9IGNbKGIgKyAxMzA5NikgPj4gMl07XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA1KSB8IDBdID0gMjtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDQpIHwgMF0gPSBhWzY2MzJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDYpIHwgMF0gPSBhW2pdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYVsodCArIDcpIHwgMF0gPSBhW2tdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1sodCArIDgpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgdSA9IHQ7XG4gICAgICAgICAgICAgICAgICAgIHYgPSB1O1xuICAgICAgICAgICAgICAgICAgICBpID0gZjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHYgfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKG8gfCAwKSA9PSAxMTU3KSB7XG4gICAgICAgICAgICAgICAgICAgIGNQKG0sIGssIDEsIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYVtrXSA9IGRba10gJiAxMjc7XG4gICAgICAgICAgICAgICAgICAgIHQgPSBiaSgxMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW3QgPj4gMl0gPSBjWyhiICsgMTMwOTYpID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICBhWyh0ICsgNSkgfCAwXSA9IDM7XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA0KSB8IDBdID0gYVs2NjMyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA2KSB8IDBdID0gYVtqXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFbKHQgKyA3KSB8IDBdID0gYVtrXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbKHQgKyA4KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHUgPSB0O1xuICAgICAgICAgICAgICAgICAgICB2ID0gdTtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGY7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2IHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjdyhiKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBjID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwO1xuICAgICAgICAgICAgICAgIGMgPSBpO1xuICAgICAgICAgICAgICAgIGkgPSAoaSArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gYyB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGI7XG4gICAgICAgICAgICAgICAgYiA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgY1AoZSwgZCwgMSwgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBiID0gKGIgKyAoYVtkXSAmIDEyNykpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCgoYVtkXSAmIDEyOCkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBiID0gYiA8PCA3O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpID0gYztcbiAgICAgICAgICAgICAgICByZXR1cm4gYiB8IDA7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGN4KGIsIGUsIGYsIGcpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gZyB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwO1xuICAgICAgICAgICAgICAgIGggPSBlO1xuICAgICAgICAgICAgICAgIGUgPSBmO1xuICAgICAgICAgICAgICAgIGYgPSBnO1xuICAgICAgICAgICAgICAgIGcgPSBiaSgoaCArIDEpIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoaCB8IDApICE9IChjUChiLCBnLCAxLCBoKSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgIGMwKGcpO1xuICAgICAgICAgICAgICAgICAgICBpID0gLTE7XG4gICAgICAgICAgICAgICAgICAgIGogPSBpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaiB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGFbKGcgKyBoKSB8IDBdID0gMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBiID0gaDtcbiAgICAgICAgICAgICAgICAgICAgaCA9IChiIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGIgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGRbKGcgKyBoKSB8IDBdIHwgMCB8IDApIDwgMzIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFbKGcgKyBoKSB8IDBdID0gNDY7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaCA9IGUgJiAyNTU7XG4gICAgICAgICAgICAgICAgaWYgKChoIHwgMCkgPT0gMSkge1xuICAgICAgICAgICAgICAgICAgICBrID0gMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChoIHwgMCkgPT0gMikge1xuICAgICAgICAgICAgICAgICAgICBrID0gMTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBjMChnKTtcbiAgICAgICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoZyB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhmICsgMTMxMDQgKyAoayA8PCAyKSkgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjMChjWyhmICsgMTMxMDQgKyAoayA8PCAyKSkgPj4gMl0gfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjWyhmICsgMTMxMDQgKyAoayA8PCAyKSkgPj4gMl0gPSBnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpID0gMDtcbiAgICAgICAgICAgICAgICBqID0gaTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaiB8IDA7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGN5KGIsIGUsIGYpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwO1xuICAgICAgICAgICAgICAgIGcgPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBlO1xuICAgICAgICAgICAgICAgIGUgPSBmO1xuICAgICAgICAgICAgICAgIGYgPSAoZyArIDE3MjQgKyAoKGIgKiAyMzYpIHwgMCkpIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKGNbKChjWyhmICsgNCkgPj4gMl0gfCAwKSArIDEyKSA+PiAyXSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgaCA9IGNbKGYgKyAxNikgPj4gMl0gPj4gMTI7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgIChjW2UgPj4gMl0gfCAwKSA+PVxuICAgICAgICAgICAgICAgICAgICAgICAgKCgoY1soKGNbKGYgKyA0KSA+PiAyXSB8IDApICsgOCkgPj4gMl0gPj4gMTIpIC0gaCkgfCAwKVxuICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFbZiB8IDBdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbZSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbKChjWyhmICsgNCkgPj4gMl0gfCAwKSArIDgpID4+IDJdID4+IDEyKSAtIGg7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gKGYgKyAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tpID4+IDJdID0gKGNbaSA+PiAyXSB8IDApICsgKGNbZSA+PiAyXSA8PCAxMik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAoKGNbKChjWyhmICsgNCkgPj4gMl0gfCAwKSArIDg4KSA+PiAyXSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaCA8PCAxKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgayA9IGo7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBrIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaCA9IGFbKChjWyhmICsgNCkgPj4gMl0gfCAwKSArIDExMCkgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKChjWyhmICsgMjEyKSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgTDE1NzU6IGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKGggJiA0KSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKGggJiA2NCkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGRbZiB8IDBdIHwgMCB8IDApID09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZFtmIHwgMF0gfCAwIHwgMCkgIT0gMikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxNTc1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoaCAmIDgpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gY3ooZywgZiwgY1tlID4+IDJdIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGsgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSBjQShnLCBmLCBjW2UgPj4gMl0gfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gayB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgaiA9IGNCKGcsIGIsIGUpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgayA9IGo7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBrIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBMMTU2MTogZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoaCAmIDQpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoaCAmIDY0KSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZFtmIHwgMF0gfCAwIHwgMCkgPT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChkW2YgfCAwXSB8IDAgfCAwKSAhPSAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE1NjE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChoICYgOCkgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSBjQyhnLCBmLCBjW2UgPj4gMl0gfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gayB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IGNEKGcsIGYsIGNbZSA+PiAyXSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgayA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBrIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICBqID0gY0UoZywgYiwgZSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBrID0gajtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGsgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGN6KGEsIGQsIGUpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBlIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGcgPSAwLFxuICAgICAgICAgICAgICAgICAgICBoID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBrID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG0gPSAwLFxuICAgICAgICAgICAgICAgICAgICBuID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHAgPSAwLFxuICAgICAgICAgICAgICAgICAgICBxID0gMCxcbiAgICAgICAgICAgICAgICAgICAgciA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHMgPSAwLFxuICAgICAgICAgICAgICAgICAgICB0ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdSA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGNbKGEgKyAxNikgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGcgPSBjWyhhICsgMjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBoID0gY1soKGNbKGEgKyA0KSA+PiAyXSB8IDApICsgNCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGkgPSBjW2NbKGEgKyA0KSA+PiAyXSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaiA9IGNbKGYgKyAxMDY4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgayA9IGNbKChjWyhhICsgNCkgPj4gMl0gfCAwKSArIDg4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgbCA9IGNbKGEgKyAyMTYpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBtID0gaCA8PCAxO1xuICAgICAgICAgICAgICAgIG4gPSBpIDw8IDE7XG4gICAgICAgICAgICAgICAgbyA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChkIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcCA9IChlIHwgMCkgPD0gKGkgfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHAgPSAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICghcCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcSA9ICgoKCgoaSAtIGUpIHwgMCkgLyAoZyB8IDApKSB8IDApICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKHEgfCAwKSA+IChkIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBkO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgocSB8IDApID4gKGwgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcSA9IGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gMTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGwgPSAobCAtIHEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBkID0gKGQgLSBxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByID0gcTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAociAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgociB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHMgPSBiWyhrICsgKChlID4+IDEyKSA8PCAxKSkgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgdCA9IGJbKGsgKyAoKChlID4+IDEyKSArIDEpIDw8IDEpKSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICByID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgIGogPSAociArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJbciA+PiAxXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgocyA8PCAxNikgPj4gMTYpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChfKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgodCA8PCAxNikgPj4gMTYpIC0gKChzIDw8IDE2KSA+PiAxNikpIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgJiA0MDk1XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPj4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMikpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA2NTUzNTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAoZSArIGcpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKG8gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gY1soYSArIDIxMikgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IGNHKGYsIGEsIDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG8gPSAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGg7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB1ID0gaTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBxID0gKCgoKCh1IC0gZSkgfCAwKSAvIChnIHwgMCkpIHwgMCkgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgocSB8IDApID4gKGQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChxIHwgMCkgPiAobCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBxID0gbDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG8gPSAxO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgbCA9IChsIC0gcSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGQgPSAoZCAtIHEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBxO1xuICAgICAgICAgICAgICAgICAgICAgICAgcSA9IChwIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChwIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgcyA9IGJbKGsgKyAoKGUgPj4gMTIpIDw8IDEpKSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ID0gYlsoayArICgoKGUgPj4gMTIpICsgMSkgPDwgMSkpID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgaiA9IChwICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgYltwID4+IDFdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChzIDw8IDE2KSA+PiAxNikgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKF8oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKCh0IDw8IDE2KSA+PiAxNikgLSAoKHMgPDwgMTYpID4+IDE2KSkgfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZSAmIDQwOTVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyKSkgJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDY1NTM1O1xuICAgICAgICAgICAgICAgICAgICAgICAgZSA9IChlICsgZykgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgobyB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBjWyhhICsgMjEyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBnID0gY0coZiwgYSwgKChnIHwgMCkgPCAwKSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG8gPSAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZSB8IDApID49IChoIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAobSAtIGUpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGcgPSAoZyAqIC0xKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGUgfCAwKSA8PSAoaSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA9IChuIC0gZSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPSAoZyAqIC0xKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1soYSArIDIxNikgPj4gMl0gPSBsO1xuICAgICAgICAgICAgICAgIGNbKGEgKyAyMCkgPj4gMl0gPSBnO1xuICAgICAgICAgICAgICAgIGNbKGEgKyAxNikgPj4gMl0gPSBlO1xuICAgICAgICAgICAgICAgIHJldHVybiBjWyhmICsgMTA2OCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY0EoYSwgZCwgZSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwLFxuICAgICAgICAgICAgICAgICAgICBvID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcCA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGNbKGEgKyAxNikgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGcgPSBjWyhhICsgMjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBoID0gY1soKGNbKGEgKyA0KSA+PiAyXSB8IDApICsgNCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGkgPSAoaCAtIChjW2NbKGEgKyA0KSA+PiAyXSA+PiAyXSB8IDApKSB8IDA7XG4gICAgICAgICAgICAgICAgaiA9IGNbKGYgKyAxMDY4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgayA9IGNbKChjWyhhICsgNCkgPj4gMl0gfCAwKSArIDg4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgbCA9IGNbKGEgKyAyMTYpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBtID0gMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGQgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGUgfCAwKSA+PSAoaCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gKGUgLSBpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbiA9ICgoKCgoaCAtIGUpIHwgMCkgLyAoZyB8IDApKSB8IDApICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKG4gfCAwKSA+IChkIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSBkO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgobiB8IDApID4gKGwgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbiA9IGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBtID0gMTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGwgPSAobCAtIG4pIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBkID0gKGQgLSBuKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gbjtcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSAobyAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobyB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIG8gPSBiWyhrICsgKChlID4+IDEyKSA8PCAxKSkgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgcCA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICBqID0gKHAgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBiW3AgPj4gMV0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKG8gPDwgMTYpID4+IDE2KSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoXyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoYlsoayArICgoKGUgPj4gMTIpICsgMSkgPDwgMSkpID4+IDFdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAtXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChvIDw8IDE2KSA+PiAxNikpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZSAmIDQwOTVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyKSkgJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDY1NTM1O1xuICAgICAgICAgICAgICAgICAgICAgICAgZSA9IChlICsgZykgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgobSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBjWyhhICsgMjEyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBnID0gY0coZiwgYSwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgbSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1soYSArIDIxNikgPj4gMl0gPSBsO1xuICAgICAgICAgICAgICAgIGNbKGEgKyAyMCkgPj4gMl0gPSBnO1xuICAgICAgICAgICAgICAgIGNbKGEgKyAxNikgPj4gMl0gPSBlO1xuICAgICAgICAgICAgICAgIHJldHVybiBjWyhmICsgMTA2OCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY0IoZCwgZSwgZikge1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IGYgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBnID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGkgPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMCxcbiAgICAgICAgICAgICAgICAgICAgayA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGwgPSAwLFxuICAgICAgICAgICAgICAgICAgICBtID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG8gPSAwLFxuICAgICAgICAgICAgICAgICAgICBwID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBzID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHUgPSAwLFxuICAgICAgICAgICAgICAgICAgICB2ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHggPSAwLFxuICAgICAgICAgICAgICAgICAgICB5ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgeiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEEgPSAwLFxuICAgICAgICAgICAgICAgICAgICBCID0gMDtcbiAgICAgICAgICAgICAgICBnID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZjtcbiAgICAgICAgICAgICAgICBmID0gKGcgKyAxNzI0ICsgKChlICogMjM2KSB8IDApKSB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGNbKGcgKyAxMDY4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaCA9IGNbKChjWyhmICsgNCkgPj4gMl0gfCAwKSArIDg4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaSA9IGNbKChjWyhmICsgNCkgPj4gMl0gfCAwKSArIDgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBqID0gY1soZiArIDE2KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgayA9IGNbKGYgKyAyMCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGwgPSBjW2QgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIG0gPSBjWyhmICsgMjE2KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGsgPSAtayB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgbiA9IGw7XG4gICAgICAgICAgICAgICAgICAgIGwgPSAobiAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChuIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbyA9IDEzMjI7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBuID0gbTtcbiAgICAgICAgICAgICAgICAgICAgbSA9IChuIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKG4gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtID0gY1soZiArIDIxMikgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgayA9IGNHKGcsIGYsIDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBuID0gYlsoaCArICgoaiA+PiAxMikgPDwgMSkpID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgcCA9IGU7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAocCArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYltwID4+IDFdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICgoKG4gPDwgMTYpID4+IDE2KSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChfKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGJbKGggKyAoKChqID4+IDEyKSArIDEpIDw8IDEpKSA+PiAxXSB8IDApIC1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgobiA8PCAxNikgPj4gMTYpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqICYgNDA5NVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIpKSAmXG4gICAgICAgICAgICAgICAgICAgICAgICA2NTUzNTtcbiAgICAgICAgICAgICAgICAgICAgaiA9IChqICsgaykgfCAwO1xuICAgICAgICAgICAgICAgIH0gd2hpbGUgKChqIHwgMCkgPCAoaSB8IDApKTtcbiAgICAgICAgICAgICAgICBpZiAoKG8gfCAwKSA9PSAxMzIyKSB7XG4gICAgICAgICAgICAgICAgICAgIHEgPSBtO1xuICAgICAgICAgICAgICAgICAgICByID0gZjtcbiAgICAgICAgICAgICAgICAgICAgcyA9IChyICsgMjE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbcyA+PiAyXSA9IHE7XG4gICAgICAgICAgICAgICAgICAgIHQgPSBrO1xuICAgICAgICAgICAgICAgICAgICB1ID0gZjtcbiAgICAgICAgICAgICAgICAgICAgdiA9ICh1ICsgMjApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1t2ID4+IDJdID0gdDtcbiAgICAgICAgICAgICAgICAgICAgdyA9IGo7XG4gICAgICAgICAgICAgICAgICAgIHggPSBmO1xuICAgICAgICAgICAgICAgICAgICB5ID0gKHggKyAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBjW3kgPj4gMl0gPSB3O1xuICAgICAgICAgICAgICAgICAgICB6ID0gZztcbiAgICAgICAgICAgICAgICAgICAgQSA9ICh6ICsgMTA2OCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBCID0gY1tBID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEIgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKGogfCAwKSA9PSAoaSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBlO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGkgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGJbaSA+PiAxXSA9IGJbKGggKyAoKGogPj4gMTIpIDw8IDEpKSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGFbZiB8IDBdID0gMDtcbiAgICAgICAgICAgICAgICBoID0gZDtcbiAgICAgICAgICAgICAgICBjW2ggPj4gMl0gPSAoY1toID4+IDJdIHwgMCkgLSAobCArIDEpO1xuICAgICAgICAgICAgICAgIHEgPSBtO1xuICAgICAgICAgICAgICAgIHIgPSBmO1xuICAgICAgICAgICAgICAgIHMgPSAociArIDIxNikgfCAwO1xuICAgICAgICAgICAgICAgIGNbcyA+PiAyXSA9IHE7XG4gICAgICAgICAgICAgICAgdCA9IGs7XG4gICAgICAgICAgICAgICAgdSA9IGY7XG4gICAgICAgICAgICAgICAgdiA9ICh1ICsgMjApIHwgMDtcbiAgICAgICAgICAgICAgICBjW3YgPj4gMl0gPSB0O1xuICAgICAgICAgICAgICAgIHcgPSBqO1xuICAgICAgICAgICAgICAgIHggPSBmO1xuICAgICAgICAgICAgICAgIHkgPSAoeCArIDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgY1t5ID4+IDJdID0gdztcbiAgICAgICAgICAgICAgICB6ID0gZztcbiAgICAgICAgICAgICAgICBBID0gKHogKyAxMDY4KSB8IDA7XG4gICAgICAgICAgICAgICAgQiA9IGNbQSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEIgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY0MoYSwgZCwgZSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwLFxuICAgICAgICAgICAgICAgICAgICBvID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHEgPSAwLFxuICAgICAgICAgICAgICAgICAgICByID0gMDtcbiAgICAgICAgICAgICAgICBmID0gYTtcbiAgICAgICAgICAgICAgICBhID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZTtcbiAgICAgICAgICAgICAgICBlID0gY1soYSArIDE2KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgZyA9IGNbKGEgKyAyMCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGggPSBjWygoY1soYSArIDQpID4+IDJdIHwgMCkgKyA0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaSA9IGNbY1soYSArIDQpID4+IDJdID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBqID0gY1soZiArIDEwNjgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBrID0gY1soKGNbKGEgKyA0KSA+PiAyXSB8IDApICsgODgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBsID0gaCA8PCAxO1xuICAgICAgICAgICAgICAgIG0gPSBpIDw8IDE7XG4gICAgICAgICAgICAgICAgaWYgKChlIHwgMCkgPD0gKGkgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICBuID0gKCgoKChpIC0gZSkgfCAwKSAvIChnIHwgMCkpIHwgMCkgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgobiB8IDApID4gKGQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbiA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gMDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZCAtIG4pIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbyA9IG47XG4gICAgICAgICAgICAgICAgICAgICAgICBuID0gKG8gLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG8gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBwID0gYlsoayArICgoZSA+PiAxMikgPDwgMSkpID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBiWyhrICsgKCgoZSA+PiAxMikgKyAxKSA8PCAxKSkgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgbyA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICBqID0gKG8gKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBiW28gPj4gMV0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKHAgPDwgMTYpID4+IDE2KSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoXyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKHEgPDwgMTYpID4+IDE2KSAtICgocCA8PCAxNikgPj4gMTYpKSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlICYgNDA5NVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIpKSAmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgNjU1MzU7XG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gKGUgKyBnKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChkIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByID0gaDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIG4gPSAoKCgoKHIgLSBlKSB8IDApIC8gKGcgfCAwKSkgfCAwKSArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChuIHwgMCkgPiAoZCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAwO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChkIC0gbikgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gbjtcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSAobyAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobyB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBiWyhrICsgKChlID4+IDEyKSA8PCAxKSkgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgcSA9IGJbKGsgKyAoKChlID4+IDEyKSArIDEpIDw8IDEpKSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgIGogPSAobyArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJbbyA+PiAxXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgocCA8PCAxNikgPj4gMTYpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChfKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgocSA8PCAxNikgPj4gMTYpIC0gKChwIDw8IDE2KSA+PiAxNikpIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgJiA0MDk1XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPj4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMikpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA2NTUzNTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAoZSArIGcpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGUgfCAwKSA+PSAoaCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gKGwgLSBlKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBnID0gKGcgKiAtMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChlIHwgMCkgPD0gKGkgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAobSAtIGUpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gKGcgKiAtMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNbKGEgKyAyMCkgPj4gMl0gPSBnO1xuICAgICAgICAgICAgICAgIGNbKGEgKyAxNikgPj4gMl0gPSBlO1xuICAgICAgICAgICAgICAgIHJldHVybiBjWyhmICsgMTA2OCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY0QoYSwgZCwgZSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwO1xuICAgICAgICAgICAgICAgIGYgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBkO1xuICAgICAgICAgICAgICAgIGQgPSBlO1xuICAgICAgICAgICAgICAgIGUgPSBjWyhhICsgMTYpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gY1soYSArIDIwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaCA9IGNbKChjWyhhICsgNCkgPj4gMl0gfCAwKSArIDQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBpID0gKGggLSAoY1tjWyhhICsgNCkgPj4gMl0gPj4gMl0gfCAwKSkgfCAwO1xuICAgICAgICAgICAgICAgIGogPSBjWyhmICsgMTA2OCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGsgPSBjWygoY1soYSArIDQpID4+IDJdIHwgMCkgKyA4OCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZSB8IDApID49IChoIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAoZSAtIGkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBsID0gKCgoKChoIC0gZSkgfCAwKSAvIChnIHwgMCkpIHwgMCkgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgobCB8IDApID4gKGQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbCA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gMDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZCAtIGwpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gKG0gLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBtID0gYlsoayArICgoZSA+PiAxMikgPDwgMSkpID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gPSBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgaiA9IChuICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgYltuID4+IDFdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChtIDw8IDE2KSA+PiAxNikgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKF8oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGJbKGsgKyAoKChlID4+IDEyKSArIDEpIDw8IDEpKSA+PiAxXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgLVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgobSA8PCAxNikgPj4gMTYpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgJiA0MDk1XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPj4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMikpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA2NTUzNTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAoZSArIGcpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjWyhhICsgMTYpID4+IDJdID0gZTtcbiAgICAgICAgICAgICAgICByZXR1cm4gY1soZiArIDEwNjgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNFKGQsIGUsIGYpIHtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwLFxuICAgICAgICAgICAgICAgICAgICBvID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHEgPSAwLFxuICAgICAgICAgICAgICAgICAgICByID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHQgPSAwLFxuICAgICAgICAgICAgICAgICAgICB1ID0gMDtcbiAgICAgICAgICAgICAgICBnID0gZDtcbiAgICAgICAgICAgICAgICBkID0gZjtcbiAgICAgICAgICAgICAgICBmID0gKGcgKyAxNzI0ICsgKChlICogMjM2KSB8IDApKSB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGNbKGcgKyAxMDY4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaCA9IGNbKChjWyhmICsgNCkgPj4gMl0gfCAwKSArIDg4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaSA9IGNbKGYgKyAxNikgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGogPSBjWyhmICsgMjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBrID0gY1soKGNbKGYgKyA0KSA+PiAyXSB8IDApICsgOCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGwgPSBjW2QgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoaiB8IDApIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICBqID0gLWogfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBtID0gKCgoKChrIC0gaSkgfCAwKSAvIChqIHwgMCkpIHwgMCkgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKChtIHwgMCkgPiAobCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgIG0gPSBsO1xuICAgICAgICAgICAgICAgICAgICBsID0gMDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBsID0gKGwgLSBtKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBtO1xuICAgICAgICAgICAgICAgICAgICBtID0gKG4gLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgobiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIG4gPSBiWyhoICsgKChpID4+IDEyKSA8PCAxKSkgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBvID0gZTtcbiAgICAgICAgICAgICAgICAgICAgZSA9IChvICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBiW28gPj4gMV0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgKCgobiA8PCAxNikgPj4gMTYpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKF8oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoYlsoaCArICgoKGkgPj4gMTIpICsgMSkgPDwgMSkpID4+IDFdIHwgMCkgLVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChuIDw8IDE2KSA+PiAxNikpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgJiA0MDk1XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMikpICZcbiAgICAgICAgICAgICAgICAgICAgICAgIDY1NTM1O1xuICAgICAgICAgICAgICAgICAgICBpID0gKGkgKyBqKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoaSB8IDApIDwgKGsgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICBwID0gaTtcbiAgICAgICAgICAgICAgICAgICAgcSA9IGY7XG4gICAgICAgICAgICAgICAgICAgIHIgPSAocSArIDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbciA+PiAyXSA9IHA7XG4gICAgICAgICAgICAgICAgICAgIHMgPSBnO1xuICAgICAgICAgICAgICAgICAgICB0ID0gKHMgKyAxMDY4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHUgPSBjW3QgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoaSB8IDApID09IChrIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgayA9IGU7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoayArIDIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYltrID4+IDFdID0gYlsoaCArICgoaSA+PiAxMikgPDwgMSkpID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYVtmIHwgMF0gPSAwO1xuICAgICAgICAgICAgICAgIGggPSBkO1xuICAgICAgICAgICAgICAgIGNbaCA+PiAyXSA9IChjW2ggPj4gMl0gfCAwKSAtIChsICsgMSk7XG4gICAgICAgICAgICAgICAgcCA9IGk7XG4gICAgICAgICAgICAgICAgcSA9IGY7XG4gICAgICAgICAgICAgICAgciA9IChxICsgMTYpIHwgMDtcbiAgICAgICAgICAgICAgICBjW3IgPj4gMl0gPSBwO1xuICAgICAgICAgICAgICAgIHMgPSBnO1xuICAgICAgICAgICAgICAgIHQgPSAocyArIDEwNjgpIHwgMDtcbiAgICAgICAgICAgICAgICB1ID0gY1t0ID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICByZXR1cm4gdSB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjRihlLCBmKSB7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMC4wLFxuICAgICAgICAgICAgICAgICAgICBqID0gMCxcbiAgICAgICAgICAgICAgICAgICAgayA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGwgPSAwLFxuICAgICAgICAgICAgICAgICAgICBtID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG8gPSAwLFxuICAgICAgICAgICAgICAgICAgICBwID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBzID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdCA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgdSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHYgPSAwLFxuICAgICAgICAgICAgICAgICAgICB3ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgeCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHkgPSAwLFxuICAgICAgICAgICAgICAgICAgICB6ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgQSA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgQiA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgQyA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgRCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBGID0gMCxcbiAgICAgICAgICAgICAgICAgICAgRyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEggPSAwLFxuICAgICAgICAgICAgICAgICAgICBJID0gMCxcbiAgICAgICAgICAgICAgICAgICAgSiA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgSyA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgTCA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgTSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIE4gPSAwLFxuICAgICAgICAgICAgICAgICAgICBPID0gMCxcbiAgICAgICAgICAgICAgICAgICAgUCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIFEgPSAwLFxuICAgICAgICAgICAgICAgICAgICBSID0gMCxcbiAgICAgICAgICAgICAgICAgICAgUyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIFQgPSAwLFxuICAgICAgICAgICAgICAgICAgICBVID0gMCxcbiAgICAgICAgICAgICAgICAgICAgViA9IDAsXG4gICAgICAgICAgICAgICAgICAgIFcgPSAwLFxuICAgICAgICAgICAgICAgICAgICBYID0gMDtcbiAgICAgICAgICAgICAgICBnID0gZjtcbiAgICAgICAgICAgICAgICBmID0gY1soZyArIDg4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaCA9ICgxMDU2ICsgKGFbKGcgKyAxMTIpIHwgMF0gPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICBpID1cbiAgICAgICAgICAgICAgICAgICAgKCsoY1soZyArIDEyKSA+PiAyXSB8IDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICsoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZFtoXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGggKyAxKSB8IDBdIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoaCArIDIpIHwgMF0gPDwgMTYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoaCArIDMpIHwgMF0gPDwgMjQpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICApKSAvXG4gICAgICAgICAgICAgICAgICAgICgrKGNbKGcgKyAzMikgPj4gMl0gfCAwKSAqICsoY1soZSArIDQpID4+IDJdIHwgMCkpO1xuICAgICAgICAgICAgICAgIGUgPSB+figrKGNbKGcgKyA4KSA+PiAyXSB8IDApIC8gaSk7XG4gICAgICAgICAgICAgICAgaCA9IGJpKGUgPj4gMTEpIHwgMDtcbiAgICAgICAgICAgICAgICBqID0gaDtcbiAgICAgICAgICAgICAgICBrID0gaDtcbiAgICAgICAgICAgICAgICBoID0gKChlID4+IDEyKSAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICBsID0gKCgoKGNbKGcgKyA4KSA+PiAyXSB8IDApIC0gNDA5NikgfCAwKSAvIChoIHwgMCkpIHwgMDtcbiAgICAgICAgICAgICAgICBtID0gbDtcbiAgICAgICAgICAgICAgICBuID0gbDtcbiAgICAgICAgICAgICAgICBsID0gKGggLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgaCA9IGw7XG4gICAgICAgICAgICAgICAgaWYgKChsIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBsID0gaztcbiAgICAgICAgICAgICAgICAgICAgayA9IChsICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBiW2wgPj4gMV0gPSBiW2YgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBsID0gKGggLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGggPSBsO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBsID0gKGYgKyAoKG4gPj4gMTIpIDw8IDEpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmIChsID4+PiAwID4gZiA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbyA9IGJbKGwgLSAyKSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBwID0gbyAmIDY1NTM1O1xuICAgICAgICAgICAgICAgICAgICBxID0gYltsID4+IDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgciA9IGJbKGwgKyAyKSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHMgPSBiWyhsICsgNCkgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICB0ID0gKygoKG4gJiA0MDk1KSA+Pj4gMCkgPj4+IDApICogMC4wMDAyNDQxNDA2MjU7XG4gICAgICAgICAgICAgICAgICAgIGwgPSBrO1xuICAgICAgICAgICAgICAgICAgICBrID0gKGwgKyAyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGJbbCA+PiAxXSA9IH5+KFxuICAgICAgICAgICAgICAgICAgICAgICAgKygoKHEgPDwgMTYpID4+IDE2KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICh0IC8gNi4wKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKCsoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKCgocCA8PCAxNikgPj4gMTYpICogLTIpIHwgMCkgLVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoKHEgPDwgMTYpID4+IDE2KSAqIDMpIHwgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoKHIgPDwgMTYpID4+IDE2KSAqIDYpIHwgMCkgLVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChzIDw8IDE2KSA+PiAxNikpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgrKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKCgocCA8PCAxNikgPj4gMTYpIC1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgocSA8PCAxNikgPj4gMTYpIDw8IDEpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChyIDw8IDE2KSA+PiAxNikpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdCAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKC0oKHAgPDwgMTYpID4+IDE2KSB8IDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKCgoKChxIDw8IDE2KSA+PiAxNikgLVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHIgPDwgMTYpID4+IDE2KSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocyA8PCAxNikgPj4gMTYpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkpKVxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICBuID0gKG4gKyBtKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoKG4gJiA0MDk1KSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgcCA9IGJbKGYgKyAoKG4gPj4gMTIpIDw8IDEpKSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHEgPSBiWyhmICsgKCgobiA+PiAxMikgKyAxKSA8PCAxKSkgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBtID0gaztcbiAgICAgICAgICAgICAgICAgICAgayA9IChtICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBiW20gPj4gMV0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgKCgocCA8PCAxNikgPj4gMTYpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKF8oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKHEgPDwgMTYpID4+IDE2KSAtICgocCA8PCAxNikgPj4gMTYpKSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG4gJiA0MDk1XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMikpICZcbiAgICAgICAgICAgICAgICAgICAgICAgIDY1NTM1O1xuICAgICAgICAgICAgICAgICAgICB1ID0gZTtcbiAgICAgICAgICAgICAgICAgICAgdiA9IGc7XG4gICAgICAgICAgICAgICAgICAgIHcgPSAodiArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1t3ID4+IDJdID0gdTtcbiAgICAgICAgICAgICAgICAgICAgeCA9IGc7XG4gICAgICAgICAgICAgICAgICAgIHkgPSB4IHwgMDtcbiAgICAgICAgICAgICAgICAgICAgeiA9IGNbeSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIEEgPSArKHogfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgQiA9IGk7XG4gICAgICAgICAgICAgICAgICAgIEMgPSBBIC8gQjtcbiAgICAgICAgICAgICAgICAgICAgRCA9IH5+QztcbiAgICAgICAgICAgICAgICAgICAgRSA9IGc7XG4gICAgICAgICAgICAgICAgICAgIEYgPSBFIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tGID4+IDJdID0gRDtcbiAgICAgICAgICAgICAgICAgICAgRyA9IGc7XG4gICAgICAgICAgICAgICAgICAgIEggPSAoRyArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgSSA9IGNbSCA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIEogPSArKEkgfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgSyA9IGk7XG4gICAgICAgICAgICAgICAgICAgIEwgPSBKIC8gSztcbiAgICAgICAgICAgICAgICAgICAgTSA9IH5+TDtcbiAgICAgICAgICAgICAgICAgICAgTiA9IGc7XG4gICAgICAgICAgICAgICAgICAgIE8gPSAoTiArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tPID4+IDJdID0gTTtcbiAgICAgICAgICAgICAgICAgICAgUCA9IGc7XG4gICAgICAgICAgICAgICAgICAgIFEgPSAoUCArIDg4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIFIgPSBjW1EgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBTID0gUjtcbiAgICAgICAgICAgICAgICAgICAgYzAoUyk7XG4gICAgICAgICAgICAgICAgICAgIFQgPSBqO1xuICAgICAgICAgICAgICAgICAgICBVID0gZztcbiAgICAgICAgICAgICAgICAgICAgViA9IChVICsgODgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tWID4+IDJdID0gVDtcbiAgICAgICAgICAgICAgICAgICAgVyA9IGc7XG4gICAgICAgICAgICAgICAgICAgIFggPSAoVyArIDEyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbWCA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwID0gaztcbiAgICAgICAgICAgICAgICAgICAgayA9IChwICsgMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICBiW3AgPj4gMV0gPSBiWyhmICsgKChuID4+IDEyKSA8PCAxKSkgPj4gMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICB1ID0gZTtcbiAgICAgICAgICAgICAgICAgICAgdiA9IGc7XG4gICAgICAgICAgICAgICAgICAgIHcgPSAodiArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1t3ID4+IDJdID0gdTtcbiAgICAgICAgICAgICAgICAgICAgeCA9IGc7XG4gICAgICAgICAgICAgICAgICAgIHkgPSB4IHwgMDtcbiAgICAgICAgICAgICAgICAgICAgeiA9IGNbeSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIEEgPSArKHogfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgQiA9IGk7XG4gICAgICAgICAgICAgICAgICAgIEMgPSBBIC8gQjtcbiAgICAgICAgICAgICAgICAgICAgRCA9IH5+QztcbiAgICAgICAgICAgICAgICAgICAgRSA9IGc7XG4gICAgICAgICAgICAgICAgICAgIEYgPSBFIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tGID4+IDJdID0gRDtcbiAgICAgICAgICAgICAgICAgICAgRyA9IGc7XG4gICAgICAgICAgICAgICAgICAgIEggPSAoRyArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgSSA9IGNbSCA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIEogPSArKEkgfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgSyA9IGk7XG4gICAgICAgICAgICAgICAgICAgIEwgPSBKIC8gSztcbiAgICAgICAgICAgICAgICAgICAgTSA9IH5+TDtcbiAgICAgICAgICAgICAgICAgICAgTiA9IGc7XG4gICAgICAgICAgICAgICAgICAgIE8gPSAoTiArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tPID4+IDJdID0gTTtcbiAgICAgICAgICAgICAgICAgICAgUCA9IGc7XG4gICAgICAgICAgICAgICAgICAgIFEgPSAoUCArIDg4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIFIgPSBjW1EgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBTID0gUjtcbiAgICAgICAgICAgICAgICAgICAgYzAoUyk7XG4gICAgICAgICAgICAgICAgICAgIFQgPSBqO1xuICAgICAgICAgICAgICAgICAgICBVID0gZztcbiAgICAgICAgICAgICAgICAgICAgViA9IChVICsgODgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tWID4+IDJdID0gVDtcbiAgICAgICAgICAgICAgICAgICAgVyA9IGc7XG4gICAgICAgICAgICAgICAgICAgIFggPSAoVyArIDEyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbWCA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjRyhhLCBiLCBlKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgbiA9IDAuMDtcbiAgICAgICAgICAgICAgICBmID0gYTtcbiAgICAgICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICAgICAgICBiID0gZTtcbiAgICAgICAgICAgICAgICBlID0gKGEgKyAyMDgpIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gY1tlID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBjW2UgPj4gMl0gPSBnICsgMTtcbiAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSA+PSA2Mykge1xuICAgICAgICAgICAgICAgICAgICBjWyhhICsgMjA4KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGcgPSBjSChjWyhhICsgMjA4KSA+PiAyXSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKGNbKGEgKyA4MCArIChnIDw8IDIpKSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IC0oY1soYSArIDgwICsgKGcgPDwgMikpID4+IDJdIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaiA9IGk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaiB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gY1soYSArIDgwICsgKGcgPDwgMikpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGogPSBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGogfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGUgPSAoZFsoKGNbKGEgKyA0KSA+PiAyXSB8IDApICsgMTA5KSB8IDBdIHwgMCkgPDwgNztcbiAgICAgICAgICAgICAgICBpZiAoKGNbKGEgKyA1MikgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGwgPSAoYSArIDU2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbbCA+PiAyXSA9IChjW2wgPj4gMl0gfCAwKSArIChjWyhhICsgNTIpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soYSArIDU2KSA+PiAyXSB8IDApID49IDY1NTM2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhhICsgNTIpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPSBfKGUsIGNbKGEgKyA1NikgPj4gMl0gfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gZSA+PiAxNjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBtID1cbiAgICAgICAgICAgICAgICAgICAgKCgrKGNbKChjWyhhICsgNCkgPj4gMl0gfCAwKSArIDEyKSA+PiAyXSB8IDApICpcbiAgICAgICAgICAgICAgICAgICAgICAgICsoY1soYSArIDEyKSA+PiAyXSB8IDApKSAvXG4gICAgICAgICAgICAgICAgICAgICAgICAoKyhjWygoY1soYSArIDQpID4+IDJdIHwgMCkgKyAzMikgPj4gMl0gfCAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKyhjWyhmICsgNCkgPj4gMl0gfCAwKSkpICpcbiAgICAgICAgICAgICAgICAgICAgNDA5Ni4wO1xuICAgICAgICAgICAgICAgIGYgPSB+fihcbiAgICAgICAgICAgICAgICAgICAgK1IoXG4gICAgICAgICAgICAgICAgICAgICAgICArKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICsoKGNbKGEgKyAyMDgpID4+IDJdIDw8IDQpIHwgMCkgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDA2MTM1OTIzMTUxNTQyNTY1XG4gICAgICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgICkgKlxuICAgICAgICAgICAgICAgICAgICArKGUgfCAwKSAqXG4gICAgICAgICAgICAgICAgICAgIDEuMFxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPSAtZiB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoMTcwNCArICgoKGYgPj4gNSkgJiAyNTUpIDw8IDMpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIG4gPVxuICAgICAgICAgICAgICAgICAgICAgICAgKChjW2sgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRbZV0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgMSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAyKSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAzKSB8IDBdIDw8IDI0KSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDQpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkWyhlICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyA1KSB8IDBdIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDYpIHwgMF0gPDwgMTYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDcpIHwgMF0gPDwgMjQpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICtoW2sgPj4gM10pO1xuICAgICAgICAgICAgICAgICAgICBlID0gKDM3NTIgKyAoKGYgPj4gMTMpIDw8IDMpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIG0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgbSAvXG4gICAgICAgICAgICAgICAgICAgICAgICAobiAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW2sgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkW2VdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAxKSB8IDBdIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAyKSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgMykgfCAwXSA8PCAyNCkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgNCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkWyhlICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgNSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgNikgfCAwXSA8PCAxNikgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDcpIHwgMF0gPDwgMjQpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAraFtrID4+IDNdKSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZSA9ICgxNzA0ICsgKCgoZiA+PiA1KSAmIDI1NSkgPDwgMykpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgbiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAoKGNbayA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZFtlXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAxKSB8IDBdIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDIpIHwgMF0gPDwgMTYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDMpIHwgMF0gPDwgMjQpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgNCkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRbKGUgKyA0KSB8IDBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDUpIHwgMF0gPDwgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgNikgfCAwXSA8PCAxNikgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgNykgfCAwXSA8PCAyNCkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgK2hbayA+PiAzXSk7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoMzc1MiArICgoZiA+PiAxMykgPDwgMykpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgbSA9XG4gICAgICAgICAgICAgICAgICAgICAgICBtICpcbiAgICAgICAgICAgICAgICAgICAgICAgIG4gKlxuICAgICAgICAgICAgICAgICAgICAgICAgKChjW2sgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRbZV0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkWyhlICsgMSkgfCAwXSA8PCA4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAyKSB8IDBdIDw8IDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyAzKSB8IDBdIDw8IDI0KSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDQpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkWyhlICsgNCkgfCAwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbKGUgKyA1KSB8IDBdIDw8IDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDYpIHwgMF0gPDwgMTYpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZFsoZSArIDcpIHwgMF0gPDwgMjQpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICtoW2sgPj4gM10pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKGNbKGEgKyA1MikgPj4gMl0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGNbKGEgKyA4MCArIChnIDw8IDIpKSA+PiAyXSA9IH5+bTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBtID0gLTAuMCAtIG07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGkgPSB+fm07XG4gICAgICAgICAgICAgICAgaiA9IGk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGogfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY0goYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgYiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGMgPSAwO1xuICAgICAgICAgICAgICAgIGIgPSBhO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgPCAxNikge1xuICAgICAgICAgICAgICAgICAgICAgICAgYyA9ICgxNSAtIGIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYiB8IDApID49IDQ4KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYyA9ICg3OSAtIGIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYyA9IChiIC0gMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIHJldHVybiBjIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNJKGEsIGIsIGQsIGUpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGFuKGIgfCAwLCBkIHwgMCwgZSB8IDAsIGNbYSA+PiAyXSB8IDApIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNKKGEpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBkID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZSA9IDA7XG4gICAgICAgICAgICAgICAgYiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IDA7XG4gICAgICAgICAgICAgICAgaWYgKChjWyhiICsgNCkgPj4gMl0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGQgPSBiO1xuICAgICAgICAgICAgICAgICAgICBjMChkKTtcbiAgICAgICAgICAgICAgICAgICAgZSA9IGE7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBlIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYSA9IGFvKGNbYiA+PiAyXSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gYjtcbiAgICAgICAgICAgICAgICBjMChkKTtcbiAgICAgICAgICAgICAgICBlID0gYTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZSB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjSyhhLCBiLCBkLCBlKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IGQ7XG4gICAgICAgICAgICAgICAgZCA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGU7XG4gICAgICAgICAgICAgICAgZSA9IGNbKGQgKyA0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgZyA9IChlICsgKF8oYSwgZikgfCAwKSkgfCAwO1xuICAgICAgICAgICAgICAgIGlmIChnID4+PiAwID4gKGNbKGQgKyA4KSA+PiAyXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGEgPVxuICAgICAgICAgICAgICAgICAgICAgICAgKCgoKChjWyhkICsgOCkgPj4gMl0gfCAwKSAtIChjWyhkICsgNCkgPj4gMl0gfCAwKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApIC9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiA+Pj4gMCkpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGcgPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBjWyhkICsgNCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBfKGEsIGYpIHwgMDtcbiAgICAgICAgICAgICAgICBjNihnIHwgMCwgYiB8IDAsIGUpIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gXyhhLCBmKSB8IDA7XG4gICAgICAgICAgICAgICAgZiA9IChkICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgIGNbZiA+PiAyXSA9IChjW2YgPj4gMl0gfCAwKSArIGU7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGEgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY0woYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgYiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGQgPSAwO1xuICAgICAgICAgICAgICAgIGIgPSBhO1xuICAgICAgICAgICAgICAgIGlmICgoY1soYiArIDEyKSA+PiAyXSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZCA9IGI7XG4gICAgICAgICAgICAgICAgICAgIGMwKGQpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYzAoY1tiID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgZCA9IGI7XG4gICAgICAgICAgICAgICAgYzAoZCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjTShhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgZCA9IGJpKDEyKSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKChkIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBlID0gMDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZyA9IGJpKDgpIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGMwKGQpO1xuICAgICAgICAgICAgICAgICAgICBlID0gMDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBjW2cgPj4gMl0gPSBhO1xuICAgICAgICAgICAgICAgICAgICBjWyhnICsgNCkgPj4gMl0gPSBiO1xuICAgICAgICAgICAgICAgICAgICBjWyhkICsgOCkgPj4gMl0gPSBnO1xuICAgICAgICAgICAgICAgICAgICBjW2QgPj4gMl0gPSAyO1xuICAgICAgICAgICAgICAgICAgICBjWyhkICsgNCkgPj4gMl0gPSA0O1xuICAgICAgICAgICAgICAgICAgICBlID0gZDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGU7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjTihhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBiID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGQgPSAwO1xuICAgICAgICAgICAgICAgIGIgPSBhdihhIHwgMCwgNjU0NCkgfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoYiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgYyA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGQgPSBjO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZCB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYyA9IGNNKGIsIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZCA9IGM7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBkIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjTyhhLCBiLCBkKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwO1xuICAgICAgICAgICAgICAgIGUgPSBhO1xuICAgICAgICAgICAgICAgIGEgPSBiaSgxMikgfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoYSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZiA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGcgPSBmO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZyB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGggPSBiaSgxNikgfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoaCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgYzAoYSk7XG4gICAgICAgICAgICAgICAgICAgIGYgPSAwO1xuICAgICAgICAgICAgICAgICAgICBnID0gZjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGcgfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGNbaCA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyA0KSA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyA4KSA+PiAyXSA9IGUgKyBiO1xuICAgICAgICAgICAgICAgICAgICBjWyhoICsgMTIpID4+IDJdID0gZDtcbiAgICAgICAgICAgICAgICAgICAgY1soYSArIDgpID4+IDJdID0gaDtcbiAgICAgICAgICAgICAgICAgICAgY1thID4+IDJdID0gNDtcbiAgICAgICAgICAgICAgICAgICAgY1soYSArIDQpID4+IDJdID0gMjtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGE7XG4gICAgICAgICAgICAgICAgICAgIGcgPSBmO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZyB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY1AoYSwgYiwgZCwgZSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgZCA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIGUgPSBlIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZiA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IGE7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGFZW2NbZiA+PiAyXSAmIDddKGNbKGYgKyA4KSA+PiAyXSB8IDAsIGIsIGQsIGUpIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNRKGEsIGIpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBjID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwO1xuICAgICAgICAgICAgICAgIGMgPSBpO1xuICAgICAgICAgICAgICAgIGkgPSAoaSArIDEwMjQpIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gYyB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGI7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGEgPj4+IDAgPD0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYiA9IGE7XG4gICAgICAgICAgICAgICAgICAgIGlmIChiID4+PiAwID4gMTAyNCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYiA9IDEwMjQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYSA9IChhIC0gYikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAoYiB8IDApICE9IChjUChlLCBkIHwgMCwgMSwgYikgfCAwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaSA9IGM7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY1IoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgYiA9IDA7XG4gICAgICAgICAgICAgICAgYiA9IGE7XG4gICAgICAgICAgICAgICAgYSA9IGFXW2NbKGIgKyA0KSA+PiAyXSAmIDddKGNbKGIgKyA4KSA+PiAyXSB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICBjMChiKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gYSB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjUygpIHtcbiAgICAgICAgICAgICAgICB2YXIgYSA9IDA7XG4gICAgICAgICAgICAgICAgY1sxNjc2XSA9IGJpKDUxNikgfCAwO1xuICAgICAgICAgICAgICAgIGM1KGNbMTY3Nl0gfCAwLCAwLCA1MTYpO1xuICAgICAgICAgICAgICAgIGEgPSBiaSgzNTg0KSB8IDA7XG4gICAgICAgICAgICAgICAgY1tjWzE2NzZdID4+IDJdID0gYTtcbiAgICAgICAgICAgICAgICBjNShjW2NbMTY3Nl0gPj4gMl0gfCAwLCAwLCAzNTg0KTtcbiAgICAgICAgICAgICAgICBjWzE4MDRdID0gYmkoNTE2KSB8IDA7XG4gICAgICAgICAgICAgICAgYzUoY1sxODA0XSB8IDAsIDAsIDUxNik7XG4gICAgICAgICAgICAgICAgYSA9IGJpKDM1ODQpIHwgMDtcbiAgICAgICAgICAgICAgICBjW2NbMTgwNF0gPj4gMl0gPSBhO1xuICAgICAgICAgICAgICAgIGM1KGNbY1sxODA0XSA+PiAyXSB8IDAsIDAsIDM1ODQpO1xuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY1QoYikge1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMDtcbiAgICAgICAgICAgICAgICBkID0gaTtcbiAgICAgICAgICAgICAgICBpID0gKGkgKyAxMDI0KSB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSBiO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjMShmIHwgMCkgfCAwKSA+Pj4gMCA+PSAxMDI0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBiID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBnID0gZjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGMyKGIgfCAwLCBnIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IGFFKGYgfCAwLCA0NykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFbKGUgKyAoZyAtIGYpKSB8IDBdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gY1ttID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA2NDgwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGcgPSBpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDgpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW2cgPj4gMl0gPSBiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZykgfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmooZSB8IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgY1MoKSB8IDA7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFbZl0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBoID0gZjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGogPSBjVShoKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBqIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIGYgPSA2NTIwO1xuICAgICAgICAgICAgICAgIGggPSBmO1xuICAgICAgICAgICAgICAgIGogPSBjVShoKSB8IDA7XG4gICAgICAgICAgICAgICAgaSA9IGQ7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGogfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gY1UoYikge1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBqID0gMCxcbiAgICAgICAgICAgICAgICAgICAgayA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGwgPSAwLFxuICAgICAgICAgICAgICAgICAgICBuID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHAgPSAwLFxuICAgICAgICAgICAgICAgICAgICBxID0gMCxcbiAgICAgICAgICAgICAgICAgICAgciA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHMgPSAwLFxuICAgICAgICAgICAgICAgICAgICB0ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHYgPSAwLFxuICAgICAgICAgICAgICAgICAgICB3ID0gMDtcbiAgICAgICAgICAgICAgICBkID0gaTtcbiAgICAgICAgICAgICAgICBpID0gKGkgKyAxMDY0KSB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGQgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSAoZCArIDEwMjQpIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gYjtcbiAgICAgICAgICAgICAgICBiID0gMDtcbiAgICAgICAgICAgICAgICBoID0gMDtcbiAgICAgICAgICAgICAgICBpZiAoKGNbMTY2MF0gfCAwKSA+IDUwKSB7XG4gICAgICAgICAgICAgICAgICAgIGogPSBjW20gPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgIGogfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgNTc5MixcbiAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDEpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgNykgJiAtOCksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gMCksXG4gICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICBsID0gLTE7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBqID0gYmgoZykgfCAwO1xuICAgICAgICAgICAgICAgIG8gPSBqO1xuICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgaiA9IGNbbSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHAgPSBnO1xuICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgIGogfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgNTM5MixcbiAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLCAoaSA9IChpICsgOCkgfCAwKSwgKGNbayA+PiAyXSA9IHApLCBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICBsID0gLTE7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBMMTg4MTogd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChjXyhlIHwgMCwgMTAyNCwgbykgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBxID0gMTY0NjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGggPSAoaCArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgcCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbZiA+PiAyXSA9IGF5KGUgfCAwLCA1MDk2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1tmID4+IDJdIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhVihjW2YgPj4gMl0gfCAwLCA0ODQwKSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYVtjW2YgPj4gMl0gfCAwXSB8IDApID09IDM1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhmICsgKHAgPDwgMikpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFbY1soZiArIChwIDw8IDIpKSA+PiAyXSB8IDBdIHwgMCkgPT0gMzUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IChwIHwgMCkgPCAxMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaiA9IChwICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgcCA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgKGogPDwgMikpID4+IDJdID0gYXkoMCwgNTA5NikgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYVYoY1tmID4+IDJdIHwgMCwgNDgzMikgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhVihjW2YgPj4gMl0gfCAwLCA0ODE2KSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1MDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFWKGNbZiA+PiAyXSB8IDAsIDQ4MDApIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTUwNDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYVYoY1tmID4+IDJdIHwgMCwgNjU1MikgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTA0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhVihjW2YgPj4gMl0gfCAwLCA2NTM2KSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1MDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFWKGNbZiA+PiAyXSB8IDAsIDY1MDQpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFWKGNbZiA+PiAyXSB8IDAsIDY0MTYpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKGNbZiA+PiAyXSB8IDAsIDY0MDApIHwgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTUwOTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKGNbZiA+PiAyXSB8IDAsIDYzNDQpIHwgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVYoY1tmID4+IDJdIHwgMCwgNjI4MCkgfCAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhVihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbZiA+PiAyXSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA2MTc2XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVYoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tmID4+IDJdIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA2MTM2XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTE2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbZiA+PiAyXSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjA3MlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW2YgPj4gMl0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjAwOFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTk1MlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1ODgwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVYoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDU3ODRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhVihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZiA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTcyMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1NjE2XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApIDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTU2MjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTg4MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTYyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZiA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1N1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1NjI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhTChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1NjU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTI3XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTU2NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTg4MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYiB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1Njc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChzICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMwKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocyAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJpKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGMxKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChzICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjMihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0IHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChzICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocyAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IC0xO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHMgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSAtMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChzICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocyAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocyAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gMjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1IHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID49XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYUgoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHUgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTczO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTg4MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdCA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVYoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHUgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTI3MlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1IDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTIwOFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1IDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1MTUyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVYoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHUgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTAwOFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1IDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDk0NFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTYyNTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhVihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1ZTNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhVihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0OTkyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVYoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDkzNlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE2MjE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocyAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHMgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI4KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocyAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVYoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNWUzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVYoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDk5MlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNjExO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHMgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHMgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjApID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhVihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1MTQ0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVYoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTExMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFWKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDUxMDRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoKCgoYUwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAwKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTU3KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHYgPSAxMjc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHYgPSA2NDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodiB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE2MDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2IHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTI3XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNjA0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTg4MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodiB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0NVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ4XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTYwNDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTg4MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNjA0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChzICpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSB2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYUwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHYgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1ODY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHYgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTI3XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTU4NjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTg4MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTg2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1N1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1ODY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocyAqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0KSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gdjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHYgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYUwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHYgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApIDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTU3OTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2IHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4MDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTU3OTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApIDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ4XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1Nzk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTg4MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1N1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTc5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHMgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSB2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHUgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTUyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYUwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1NTU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTI3XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTU1NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTg4MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDY3MDQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNjcwNCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocyA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDUxNlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjNShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICg2NzA0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocyA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTE2XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmkoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzNTg0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNjcwNCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYzUoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICg2NzA0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDM1ODRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDY3MDQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHAgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApIDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTU0MztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwxODgxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYUwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocyB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTQ2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyN1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTQ2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDcyMTYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocyA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNzIxNiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChzIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmkoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDUxNlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjNShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNzIxNiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocyA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTE2XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmkoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDM1ODRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNzIxNiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocyA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjNShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDcyMTYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChzIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzU4NFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDcyMTYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocyA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHAgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTUzOTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjNyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNzcyOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNTVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhWzc5ODNdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApIDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTUzMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMTg4MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPj1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHAgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTY2MF0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1sxNjYwXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1UoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE2NjBdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbMTY2MF0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgLVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTIzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDE4ODE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmooXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHMgPDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChzICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0IHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTk2MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGkgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDcpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC04KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID4+IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBjW20gPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdCB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjAxNixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGsgPSBpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpICsgMSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpICsgNykgJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtOCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbayA+PiAyXSA9IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAxNTE2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChxIHwgMCkgPT0gMTUxNikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBjW20gPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgPSBjW2YgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0IHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjA4OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyA4KSB8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gdyksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdyA9IGNbbSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3IHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA2MTkyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyAxKSB8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyA3KSAmIC04KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaykgfCAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdyA9IGNbbSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdyB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA2Mjk2LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgMSkgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyA3KSAmIC04KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW2sgPj4gMl0gPSAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMTUwOTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgocSB8IDApID09IDE1MDkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdyA9IGNbbSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gY1tmID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDYzNTIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDgpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbayA+PiAyXSA9IHQpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBjW20gPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjQzMixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDEpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgNykgJiAtOCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDE1MDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICBpZiAoKHEgfCAwKSA9PSAxNTA0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBxID0gMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKHEgfCAwKSA9PSAxNTIzKSB7XG4gICAgICAgICAgICAgICAgICAgIHMgPSBjW20gPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBiID0gZztcbiAgICAgICAgICAgICAgICAgICAgdiA9IGg7XG4gICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgcyB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICA1OTEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgMTYpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gYiksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDgpID4+IDJdID0gdiksXG4gICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICBsID0gLTI7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHEgfCAwKSA9PSAxNTU1KSB7XG4gICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIDU1MjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGsgPSBpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyAxNikgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjW2sgPj4gMl0gPSBnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgOCkgPj4gMl0gPSBoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGs7XG4gICAgICAgICAgICAgICAgICAgIGwgPSAtMjtcbiAgICAgICAgICAgICAgICAgICAgbiA9IGw7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgocSB8IDApID09IDE1NjIpIHtcbiAgICAgICAgICAgICAgICAgICAgYXIoXG4gICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgNTQ4MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDE2KSB8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbayA+PiAyXSA9IGcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyA4KSA+PiAyXSA9IGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgaykgfCAwXG4gICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpID0gaztcbiAgICAgICAgICAgICAgICAgICAgbCA9IC0yO1xuICAgICAgICAgICAgICAgICAgICBuID0gbDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChxIHwgMCkgPT0gMTU2NSkge1xuICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbbSA+PiAyXSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICA1NDMyLFxuICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgMTYpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gZyksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDgpID4+IDJdID0gaCksXG4gICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICBsID0gLTI7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHEgfCAwKSA9PSAxNTY3KSB7XG4gICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIDUzMjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGsgPSBpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyAxNikgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjW2sgPj4gMl0gPSBnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgOCkgPj4gMl0gPSBoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGs7XG4gICAgICAgICAgICAgICAgICAgIGwgPSAtMjtcbiAgICAgICAgICAgICAgICAgICAgbiA9IGw7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgocSB8IDApID09IDE1MzkpIHtcbiAgICAgICAgICAgICAgICAgICAgYXIoXG4gICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgNTcyOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDE2KSB8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbayA+PiAyXSA9IGcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyA4KSA+PiAyXSA9IGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgaykgfCAwXG4gICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpID0gaztcbiAgICAgICAgICAgICAgICAgICAgbCA9IC0yO1xuICAgICAgICAgICAgICAgICAgICBuID0gbDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChxIHwgMCkgPT0gMTUzMSkge1xuICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbbSA+PiAyXSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICA1ODQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgMTYpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gZyksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDgpID4+IDJdID0gaCksXG4gICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICBsID0gLTI7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHEgfCAwKSA9PSAxNTUyKSB7XG4gICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIDU1NzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGsgPSBpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyAxNikgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjW2sgPj4gMl0gPSBnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgOCkgPj4gMl0gPSBoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGs7XG4gICAgICAgICAgICAgICAgICAgIGwgPSAtMjtcbiAgICAgICAgICAgICAgICAgICAgbiA9IGw7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgocSB8IDApID09IDE1NzkpIHtcbiAgICAgICAgICAgICAgICAgICAgYXIoXG4gICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgNTIxNixcbiAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDI0KSB8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbayA+PiAyXSA9IGcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyA4KSA+PiAyXSA9IGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyAxNikgPj4gMl0gPSA4MDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgaykgfCAwXG4gICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpID0gaztcbiAgICAgICAgICAgICAgICAgICAgbCA9IC0yO1xuICAgICAgICAgICAgICAgICAgICBuID0gbDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChxIHwgMCkgPT0gMTU4Nikge1xuICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbbSA+PiAyXSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICA1MTYwLFxuICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgMTYpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gZyksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDgpID4+IDJdID0gaCksXG4gICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICBsID0gLTI7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHEgfCAwKSA9PSAxNjExKSB7XG4gICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIDQ5NTIsXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGsgPSBpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyAxNikgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjW2sgPj4gMl0gPSBnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgOCkgPj4gMl0gPSBoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGs7XG4gICAgICAgICAgICAgICAgICAgIGwgPSAtMjtcbiAgICAgICAgICAgICAgICAgICAgbiA9IGw7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgocSB8IDApID09IDE2MjEpIHtcbiAgICAgICAgICAgICAgICAgICAgYXIoXG4gICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgNDg4OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDE2KSB8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbayA+PiAyXSA9IGcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyA4KSA+PiAyXSA9IGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgaykgfCAwXG4gICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpID0gaztcbiAgICAgICAgICAgICAgICAgICAgbCA9IC0yO1xuICAgICAgICAgICAgICAgICAgICBuID0gbDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChxIHwgMCkgPT0gMTYyNSkge1xuICAgICAgICAgICAgICAgICAgICB2ID0gY1soZiArICh1IDw8IDIpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIDUyODAsXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGsgPSBpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyAyNCkgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjW2sgPj4gMl0gPSBnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgOCkgPj4gMl0gPSBoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgMTYpID4+IDJdID0gdiksXG4gICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICBsID0gLTI7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHEgfCAwKSA9PSAxNTQ2KSB7XG4gICAgICAgICAgICAgICAgICAgIGFyKFxuICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdIHwgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIDU2MjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGsgPSBpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyAxNikgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjW2sgPj4gMl0gPSBnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjWyhrICsgOCkgPj4gMl0gPSBoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGs7XG4gICAgICAgICAgICAgICAgICAgIGwgPSAtMjtcbiAgICAgICAgICAgICAgICAgICAgbiA9IGw7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgocSB8IDApID09IDE1NDMpIHtcbiAgICAgICAgICAgICAgICAgICAgYXIoXG4gICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgNTY4MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDE2KSB8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbayA+PiAyXSA9IGcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyA4KSA+PiAyXSA9IGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgaykgfCAwXG4gICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgICAgICBpID0gaztcbiAgICAgICAgICAgICAgICAgICAgbCA9IC0yO1xuICAgICAgICAgICAgICAgICAgICBuID0gbDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChxIHwgMCkgPT0gMTYwNCkge1xuICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbbSA+PiAyXSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICA1MDE2LFxuICAgICAgICAgICAgICAgICAgICAgICAgKChrID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgMTYpIHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1trID4+IDJdID0gZyksXG4gICAgICAgICAgICAgICAgICAgICAgICAoY1soayArIDgpID4+IDJdID0gaCksXG4gICAgICAgICAgICAgICAgICAgICAgICBrKSB8IDBcbiAgICAgICAgICAgICAgICAgICAgKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBrO1xuICAgICAgICAgICAgICAgICAgICBsID0gLTI7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHEgfCAwKSA9PSAxNTczKSB7XG4gICAgICAgICAgICAgICAgICAgIHYgPSBjWyhmICsgKHUgPDwgMikpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgYXIoXG4gICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gfCAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgNTI4MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICgoayA9IGkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGkgPSAoaSArIDI0KSB8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbayA+PiAyXSA9IGcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyA4KSA+PiAyXSA9IGgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKGNbKGsgKyAxNikgPj4gMl0gPSB2KSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGspIHwgMFxuICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGs7XG4gICAgICAgICAgICAgICAgICAgIGwgPSAtMjtcbiAgICAgICAgICAgICAgICAgICAgbiA9IGw7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBkO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgocSB8IDApID09IDE2NDYpIHtcbiAgICAgICAgICAgICAgICAgICAgYW8obyB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgbCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gZDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNWKGQsIGUsIGYsIGcpIHtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGUgfCAwO1xuICAgICAgICAgICAgICAgIGYgPSBmIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gZyB8IDA7XG4gICAgICAgICAgICAgICAgY1sxNjcyXSA9IGQ7XG4gICAgICAgICAgICAgICAgYlszMzQ2XSA9IGU7XG4gICAgICAgICAgICAgICAgYVs2Njk0XSA9IGY7XG4gICAgICAgICAgICAgICAgYlszMzQ4XSA9IGc7XG4gICAgICAgICAgICAgICAgcmV0dXJuIDY2ODg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjVyhmLCBnLCBoKSB7XG4gICAgICAgICAgICAgICAgZiA9IGYgfCAwO1xuICAgICAgICAgICAgICAgIGcgPSBnIHwgMDtcbiAgICAgICAgICAgICAgICBoID0gaCB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBrID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwO1xuICAgICAgICAgICAgICAgIGogPSBpO1xuICAgICAgICAgICAgICAgIGsgPSBmO1xuICAgICAgICAgICAgICAgIGYgPSBoO1xuICAgICAgICAgICAgICAgIGlmICgoayB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgbCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgICAgICBpID0gajtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBoID0gYmkoMTQxNjQpIHwgMDtcbiAgICAgICAgICAgICAgICBjNShoIHwgMCwgMCwgMTQxNjQpO1xuICAgICAgICAgICAgICAgIGNbKGggKyAyNCkgPj4gMl0gPSBnO1xuICAgICAgICAgICAgICAgIGcgPSAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApID49IDEyOCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChjWyg2NzA0ICsgKGcgPDwgMikpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY1soaCArIDI4ICsgKGcgPDwgMikpID4+IDJdID0gYmkoNTE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjNShjWyhoICsgMjggKyAoZyA8PCAyKSkgPj4gMl0gfCAwLCAwLCA1MTYpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tjWyhoICsgMjggKyAoZyA8PCAyKSkgPj4gMl0gPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbY1soNjcwNCArIChnIDw8IDIpKSA+PiAyXSA+PiAyXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKDcyMTYgKyAoZyA8PCAyKSkgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhoICsgNTQwICsgKGcgPDwgMikpID4+IDJdID0gYmkoNTE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjNShjWyhoICsgNTQwICsgKGcgPDwgMikpID4+IDJdIHwgMCwgMCwgNTE2KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbY1soaCArIDU0MCArIChnIDw8IDIpKSA+PiAyXSA+PiAyXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tjWyg3MjE2ICsgKGcgPDwgMikpID4+IDJdID4+IDJdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGcgPSAoZyArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1soaCArIDIwKSA+PiAyXSA9IDcwO1xuICAgICAgICAgICAgICAgIGNbKGggKyAxMzA1MikgPj4gMl0gPSAzMjtcbiAgICAgICAgICAgICAgICBjWyhoICsgMTMwNTYpID4+IDJdID0gMzMyODA7XG4gICAgICAgICAgICAgICAgY1soaCArIDQpID4+IDJdID0gY1tmID4+IDJdO1xuICAgICAgICAgICAgICAgIGNbKGggKyA4KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgaWYgKCgoYlsoZiArIDQpID4+IDFdICYgMjU1KSB8IDApID09IDE2KSB7XG4gICAgICAgICAgICAgICAgICAgIGcgPSAoaCArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tnID4+IDJdID0gY1tnID4+IDJdIHwgNDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCgoYlsoZiArIDQpID4+IDFdICYgMzI3NjgpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBnID0gKGggKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGNbZyA+PiAyXSA9IGNbZyA+PiAyXSB8IDI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgoZFsoZiArIDYpIHwgMF0gfCAwKSA9PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIGcgPSAoaCArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1tnID4+IDJdID0gY1tnID4+IDJdIHwgMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZyA9IGVbKGYgKyA0KSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPT0gMzY4ODApIHtcbiAgICAgICAgICAgICAgICAgICAgY1soaCArIDEwNjApID4+IDJdID0gNDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChnIHwgMCkgPT0gMTYpIHtcbiAgICAgICAgICAgICAgICAgICAgY1soaCArIDEwNjApID4+IDJdID0gNjtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChnIHwgMCkgPT0gMzI3NzYpIHtcbiAgICAgICAgICAgICAgICAgICAgY1soaCArIDEwNjApID4+IDJdID0gMTA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoZyB8IDApID09IDgpIHtcbiAgICAgICAgICAgICAgICAgICAgY1soaCArIDEwNjApID4+IDJdID0gODtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChnIHwgMCkgPT0gMzI3ODQpIHtcbiAgICAgICAgICAgICAgICAgICAgY1soaCArIDEwNjApID4+IDJdID0gMjtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBhcihcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbbSA+PiAyXSB8IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICA2MTQ0LFxuICAgICAgICAgICAgICAgICAgICAgICAgKChnID0gaSksXG4gICAgICAgICAgICAgICAgICAgICAgICAoaSA9IChpICsgMSkgfCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChpID0gKGkgKyA3KSAmIC04KSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChjW2cgPj4gMl0gPSAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGcpIHwgMFxuICAgICAgICAgICAgICAgICAgICApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGc7XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyAxMDYwKSA+PiAyXSA9IDY7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNbKGggKyAxMDY0KSA+PiAyXSA9IGVbKGYgKyA4KSA+PiAxXSB8IDA7XG4gICAgICAgICAgICAgICAgY1soaCArIDEwNjgpID4+IDJdID0gYmkoZVsoZiArIDgpID4+IDFdIDw8IDEpIHwgMDtcbiAgICAgICAgICAgICAgICBjWyhoICsgMTA3MikgPj4gMl0gPSBiaSgoZVsoZiArIDgpID4+IDFdIDw8IDEpIDw8IDIpIHwgMDtcbiAgICAgICAgICAgICAgICBjWyhoICsgMTIpID4+IDJdID1cbiAgICAgICAgICAgICAgICAgICAgXyhcbiAgICAgICAgICAgICAgICAgICAgICAgICgoY1soaCArIDgpID4+IDJdICYgMSkgfCAwKSAhPSAwID8gMSA6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAoKGNbKGggKyA4KSA+PiAyXSAmIDQpIHwgMCkgIT0gMCA/IDIgOiAxXG4gICAgICAgICAgICAgICAgICAgICkgfCAwO1xuICAgICAgICAgICAgICAgIGNbKGggKyAxMzA2MCkgPj4gMl0gPSAoKGNbZiA+PiAyXSB8IDApIC8gMWUzKSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKChjWyhoICsgMTMwNjApID4+IDJdIHwgMCkgPCAxKSB7XG4gICAgICAgICAgICAgICAgICAgIGNbKGggKyAxMzA2MCkgPj4gMl0gPSAxO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soaCArIDEzMDYwKSA+PiAyXSB8IDApID4gMjU1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhoICsgMTMwNjApID4+IDJdID0gMjU1O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNbKGggKyAxMzA2NCkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGNbKGggKyAxMzA2OCkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGNbKGggKyAxMzA3NikgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICBjcShrLCBoLCAoaCArIDEzMTAwKSB8IDAsIChoICsgMTMwNzIpIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoY1soaCArIDEzMDc2KSA+PiAyXSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgYzAoaCk7XG4gICAgICAgICAgICAgICAgICAgIGwgPSAwO1xuICAgICAgICAgICAgICAgICAgICBuID0gbDtcbiAgICAgICAgICAgICAgICAgICAgaSA9IGo7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY1soaCArIDEwNTIpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICBjWyhoICsgMTA1NikgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGlmICgoYVs3NzI4XSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgayA9IGg7XG4gICAgICAgICAgICAgICAgICAgIGJ6KGssIDc3MjgpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYnYoaCkgfCAwO1xuICAgICAgICAgICAgICAgIGwgPSBoO1xuICAgICAgICAgICAgICAgIG4gPSBsO1xuICAgICAgICAgICAgICAgIGkgPSBqO1xuICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNYKGEsIGIpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHJldHVybiBjVyhhLCAwLCBiKSB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjWShhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBiID0gMDtcbiAgICAgICAgICAgICAgICBiID0gYTtcbiAgICAgICAgICAgICAgICBieChiKTtcbiAgICAgICAgICAgICAgICBhID0gMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGEgfCAwKSA+PSAxMjgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soYiArIDI4ICsgKGEgPDwgMikpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYzAoY1soYiArIDI4ICsgKGEgPDwgMikpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhiICsgNTQwICsgKGEgPDwgMikpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYzAoY1soYiArIDU0MCArIChhIDw8IDIpKSA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGEgPSAoYSArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYzAoY1soYiArIDEwNzIpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgYzAoY1soYiArIDEwNjgpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgYzAoY1soYiArIDEzMDc2KSA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgIGEgPSAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhID4+PiAwID49IDgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soYiArIDEzMTA0ICsgKGEgPDwgMikpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYzAoY1soYiArIDEzMTA0ICsgKGEgPDwgMikpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYSA9IChhICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjMChiKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjWigpIHtcbiAgICAgICAgICAgICAgICB2YXIgYSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBkID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZSA9IDA7XG4gICAgICAgICAgICAgICAgYSA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChhIHwgMCkgPj0gMTI4KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKDY3MDQgKyAoYSA8PCAyKSkgPj4gMl0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBiID0gY1tjWyg2NzA0ICsgKGEgPDwgMikpID4+IDJdID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYiB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGQgfCAwKSA+PSAxMjgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soYiArICgoZCAqIDI4KSB8IDApKSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMwKGNbKGIgKyAoKGQgKiAyOCkgfCAwKSkgPj4gMl0gfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gKGQgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMwKGIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYzAoY1soNjcwNCArIChhIDw8IDIpKSA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY1soNzIxNiArIChhIDw8IDIpKSA+PiAyXSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPSBjW2NbKDcyMTYgKyAoYSA8PCAyKSkgPj4gMl0gPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChlIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApID49IDEyOCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjWyhlICsgKChkICogMjgpIHwgMCkpID4+IDJdIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYzAoY1soZSArICgoZCAqIDI4KSB8IDApKSA+PiAyXSB8IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZCArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYzAoZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjMChjWyg3MjE2ICsgKGEgPDwgMikpID4+IDJdIHwgMCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYSA9IChhICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBiaygpO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNfKGIsIGMsIGQpIHtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgYyA9IGMgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGkgPSAwO1xuICAgICAgICAgICAgICAgIGUgPSBiO1xuICAgICAgICAgICAgICAgIGIgPSBjO1xuICAgICAgICAgICAgICAgIGMgPSBkO1xuICAgICAgICAgICAgICAgIGQgPSAwO1xuICAgICAgICAgICAgICAgIGYgPSAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApIDwgKGIgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9ICgoZiB8IDApICE9IDApIF4gMTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGcgPSAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICghZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChhbigoZSArIGQpIHwgMCwgMSwgMSwgYyB8IDApIHwgMCkgIT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaCA9IDE3NTI7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKGFbKGUgKyBkKSB8IDBdIHwgMCkgPT0gMTApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGggPSAxNzU1O1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhWyhlICsgZCkgfCAwXSB8IDApID09IDEzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA9IDE3NTU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKChoIHwgMCkgPT0gMTc1NSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaCA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBhWyhlICsgZCkgfCAwXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBkID0gKGQgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGFbKGUgKyBkKSB8IDBdID0gMDtcbiAgICAgICAgICAgICAgICBpZiAoKGQgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGkgPSBlO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaSB8IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjJChhKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBiID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGggPSAwLFxuICAgICAgICAgICAgICAgICAgICBpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG4gPSAwLFxuICAgICAgICAgICAgICAgICAgICBvID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHEgPSAwLFxuICAgICAgICAgICAgICAgICAgICByID0gMCxcbiAgICAgICAgICAgICAgICAgICAgcyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHQgPSAwLFxuICAgICAgICAgICAgICAgICAgICB1ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHcgPSAwLFxuICAgICAgICAgICAgICAgICAgICB4ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgeSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHogPSAwLFxuICAgICAgICAgICAgICAgICAgICBBID0gMCxcbiAgICAgICAgICAgICAgICAgICAgQiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEMgPSAwLFxuICAgICAgICAgICAgICAgICAgICBEID0gMCxcbiAgICAgICAgICAgICAgICAgICAgRSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBHID0gMCxcbiAgICAgICAgICAgICAgICAgICAgSCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEkgPSAwLFxuICAgICAgICAgICAgICAgICAgICBKID0gMCxcbiAgICAgICAgICAgICAgICAgICAgSyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEwgPSAwLFxuICAgICAgICAgICAgICAgICAgICBNID0gMCxcbiAgICAgICAgICAgICAgICAgICAgTiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIE8gPSAwLFxuICAgICAgICAgICAgICAgICAgICBQID0gMCxcbiAgICAgICAgICAgICAgICAgICAgUSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIFIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBTID0gMCxcbiAgICAgICAgICAgICAgICAgICAgVCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIFUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBWID0gMCxcbiAgICAgICAgICAgICAgICAgICAgVyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIFggPSAwLFxuICAgICAgICAgICAgICAgICAgICBZID0gMCxcbiAgICAgICAgICAgICAgICAgICAgWiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIF8gPSAwLFxuICAgICAgICAgICAgICAgICAgICAkID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYWEgPSAwLFxuICAgICAgICAgICAgICAgICAgICBhYiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGFjID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYWQgPSAwLFxuICAgICAgICAgICAgICAgICAgICBhZSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGFmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYWcgPSAwLFxuICAgICAgICAgICAgICAgICAgICBhaCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGFpID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYWogPSAwLFxuICAgICAgICAgICAgICAgICAgICBhayA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGFsID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYW4gPSAwLFxuICAgICAgICAgICAgICAgICAgICBhbyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGFwID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYXIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBhcyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGF0ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYXUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBhdiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGF3ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYXggPSAwLFxuICAgICAgICAgICAgICAgICAgICBheSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGF6ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYUEgPSAwLFxuICAgICAgICAgICAgICAgICAgICBhQiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGFDID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYUQgPSAwLFxuICAgICAgICAgICAgICAgICAgICBhRSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGFGID0gMCxcbiAgICAgICAgICAgICAgICAgICAgYUcgPSAwLFxuICAgICAgICAgICAgICAgICAgICBhSCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGFJID0gMDtcbiAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhID4+PiAwIDwgMjQ1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYSA+Pj4gMCA8IDExKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9IDE2O1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID0gKGEgKyAxMSkgJiAtODtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSBiID4+PiAzO1xuICAgICAgICAgICAgICAgICAgICAgICAgZSA9IGNbMTk5Nl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZiA9IGUgPj4+IChkID4+PiAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKGYgJiAzKSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gKCgoZiAmIDEpIF4gMSkgKyBkKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA9IGcgPDwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gKDgwMjQgKyAoaCA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSAoODAyNCArICgoaCArIDIpIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA9IGNbaiA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgayA9IChoICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBjW2sgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChpIHwgMCkgPT0gKGwgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk2XSA9IGUgJiB+KDEgPDwgZyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobCA+Pj4gMCA8IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gKGwgKyAxMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjW20gPj4gMl0gfCAwKSA9PSAoaCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW2ogPj4gMl0gPSBsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IGcgPDwgMztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhoICsgNCkgPj4gMl0gPSBsIHwgMztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gKGggKyAobCB8IDQpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tqID4+IDJdID0gY1tqID4+IDJdIHwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYiA+Pj4gMCA8PSAoY1sxOTk4XSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IGI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IDIgPDwgZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gKGYgPDwgZCkgJiAoaiB8IC1qKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gKChsICYgLWwpIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSAoaiA+Pj4gMTIpICYgMTY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGogPj4+IChsID4+PiAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gKGkgPj4+IDUpICYgODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gaSA+Pj4gKGogPj4+IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSAobSA+Pj4gMikgJiA0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBtID4+PiAoaSA+Pj4gMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IChwID4+PiAxKSAmIDI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IHAgPj4+IChtID4+PiAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwID0gKHEgPj4+IDEpICYgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gKChqIHwgbCB8IGkgfCBtIHwgcCkgKyAocSA+Pj4gKHAgPj4+IDApKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSByIDw8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9ICg4MDI0ICsgKHAgPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gKDgwMjQgKyAoKHAgKyAyKSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBjW20gPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSAocCArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gY1tpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgocSB8IDApID09IChsIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5Nl0gPSBlICYgfigxIDw8IHIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGwgPj4+IDAgPCAoY1syZTNdIHwgMCkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IChsICsgMTIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1tqID4+IDJdIHwgMCkgPT0gKHAgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbaiA+PiAyXSA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdID0gbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSByIDw8IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IChsIC0gYikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHAgKyA0KSA+PiAyXSA9IGIgfCAzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAocSArIGIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgKGIgfCA0KSkgPj4gMl0gPSBtIHwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgbCkgPj4gMl0gPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBjWzE5OThdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBjWzIwMDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IGwgPj4+IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBkIDw8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAoODAyNCArIChsIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBjWzE5OTZdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA9IDEgPDwgZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoayAmIGgpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5Nl0gPSBrIHwgaDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzID0gZjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gKDgwMjQgKyAoKGwgKyAyKSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gKDgwMjQgKyAoKGwgKyAyKSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPSBjW2QgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChnID4+PiAwID49IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdCA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1t0ID4+IDJdID0gcTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socyArIDEyKSA+PiAyXSA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyA4KSA+PiAyXSA9IHM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAxMikgPj4gMl0gPSBmO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE5OThdID0gbTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzIwMDFdID0gZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gY1sxOTk3XSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGwgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IGI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBoID0gKChsICYgLWwpIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgbCA9IChoID4+PiAxMikgJiAxNjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBoID4+PiAobCA+Pj4gMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBoID0gKGsgPj4+IDUpICYgODtcbiAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBrID4+PiAoaCA+Pj4gMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBrID0gKHAgPj4+IDIpICYgNDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBwID4+PiAoayA+Pj4gMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBwID0gKHIgPj4+IDEpICYgMjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSByID4+PiAocCA+Pj4gMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICByID0gKGQgPj4+IDEpICYgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGcgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICg4Mjg4ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGggfCBsIHwgayB8IHAgfCByKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGQgPj4+IChyID4+PiAwKSkpIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICByID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSBnO1xuICAgICAgICAgICAgICAgICAgICAgICAgcCA9ICgoY1soZyArIDQpID4+IDJdICYgLTgpIC0gYikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gY1sociArIDE2KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gY1sociArIDIwKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoayB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZyA9ICgoY1sodSArIDQpID4+IDJdICYgLTgpIC0gYikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBnID4+PiAwIDwgcCA+Pj4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gdTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gayA/IHUgOiBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSBrID8gZyA6IHA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBjWzJlM10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHIgPj4+IDAgPCBpID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAociArIGIpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHIgPj4+IDAgPj0gZSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gY1soZCArIDI0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gY1soZCArIDEyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgPT0gKGQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gKGQgKyAyMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gY1txID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgayA9IChkICsgMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBjW2sgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChsIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHYgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgPSBnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAodyArIDIwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gY1txID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gcTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAodyArIDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gY1txID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdyA9IGc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHggPj4+IDAgPCBpID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW3ggPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdiA9IHc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBjWyhkICsgOCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocSA+Pj4gMCA8IGkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gKHEgKyAxMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbZyA+PiAyXSB8IDApICE9IChkIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gKGYgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1trID4+IDJdIHwgMCkgPT0gKGQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tnID4+IDJdID0gZjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbayA+PiAyXSA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gZjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBMMjMwNDogZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZiA9IChkICsgMjgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9ICg4Mjg4ICsgKGNbZiA+PiAyXSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGQgfCAwKSA9PSAoY1tpID4+IDJdIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW2kgPj4gMl0gPSB2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodiB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5N10gPSBjWzE5OTddICYgfigxIDw8IGNbZiA+PiAyXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDIzMDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gKGUgKyAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1txID4+IDJdIHwgMCkgPT0gKGQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW3EgPj4gMl0gPSB2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGUgKyAyMCkgPj4gMl0gPSB2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwyMzA0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2ID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sodiArIDI0KSA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSBjWyhkICsgMTYpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChmIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHYgKyAxNikgPj4gMl0gPSBmO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgMjQpID4+IDJdID0gdjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZiA9IGNbKGQgKyAyMCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZiA+Pj4gMCA8IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sodiArIDIwKSA+PiAyXSA9IGY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhmICsgMjQpID4+IDJdID0gdjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocCA+Pj4gMCA8IDE2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA9IChwICsgYikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGQgKyA0KSA+PiAyXSA9IGUgfCAzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAociArIChlICsgNCkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW2YgPj4gMl0gPSBjW2YgPj4gMl0gfCAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhkICsgNCkgPj4gMl0gPSBiIHwgMztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhyICsgKGIgfCA0KSkgPj4gMl0gPSBwIHwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhyICsgKHAgKyBiKSkgPj4gMl0gPSBwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSBjWzE5OThdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGYgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgPSBjWzIwMDFdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGYgPj4+IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSBpIDw8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSAoODAyNCArIChmIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBjWzE5OTZdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZyA9IDEgPDwgaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoayAmIGcpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5Nl0gPSBrIHwgZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5ID0gcTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ID0gKDgwMjQgKyAoKGYgKyAyKSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gKDgwMjQgKyAoKGYgKyAyKSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBjW2kgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsID4+PiAwID49IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5ID0gbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeiA9IGk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1t6ID4+IDJdID0gZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soeSArIDEyKSA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGUgKyA4KSA+PiAyXSA9IHk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGUgKyAxMikgPj4gMl0gPSBxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE5OThdID0gcDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzIwMDFdID0gbTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAoZCArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvID0gYjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbiA9IGY7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYSA+Pj4gMCA+IDQyOTQ5NjcyMzEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gKGEgKyAxMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZyA9IGYgJiAtODtcbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBjWzE5OTddIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoayB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHIgPSAtZyB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gZiA+Pj4gODtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEEgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChnID4+PiAwID4gMTY3NzcyMTUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEEgPSAzMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAoKChpICsgMTA0ODMyMCkgfCAwKSA+Pj4gMTYpICYgODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IGkgPDwgZjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA9ICgoKGwgKyA1MjAxOTIpIHwgMCkgPj4+IDE2KSAmIDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSBsIDw8IGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSAoKChqICsgMjQ1NzYwKSB8IDApID4+PiAxNikgJiAyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCID0gKDE0IC0gKGggfCBmIHwgbCkgKyAoKGogPDwgbCkgPj4+IDE1KSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZyA+Pj4gKCgoQiArIDcpIHwgMCkgPj4+IDApKSAmIDEpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChCIDw8IDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGNbKDgyODggKyAoQSA8PCAyKSkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgTDIzNTI6IGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChBIHwgMCkgPT0gMzEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEYgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRiA9ICgyNSAtIChBID4+PiAxKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IGk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBnIDw8IEY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQiA9IGNbKHAgKyA0KSA+PiAyXSAmIC04O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IChCIC0gZykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGwgPj4+IDAgPCBtID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChCIHwgMCkgPT0gKGcgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDID0gcDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IGw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEUgPSBwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMjM1MjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHID0gcDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSCA9IGw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIID0gbTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBjWyhwICsgMjApID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEIgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHAgKyAxNiArICgocSA+Pj4gMzEpIDw8IDIpKSA+PiAyXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgobCB8IDApID09IDApIHwgKChsIHwgMCkgPT0gKEIgfCAwKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoQiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDID0gRztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEID0gSDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IEc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IEg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IEI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IHEgPDwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoRSB8IDApID09IDApICYgKChDIHwgMCkgPT0gMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gMiA8PCBBO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBrICYgKGkgfCAtaSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChyIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSAoKHIgJiAtcikgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IChpID4+PiAxMikgJiAxNjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlID0gaSA+Pj4gKHIgPj4+IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSAoZSA+Pj4gNSkgJiA4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBlID4+PiAoaSA+Pj4gMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA9IChxID4+PiAyKSAmIDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IHEgPj4+IChlID4+PiAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gKHAgPj4+IDEpICYgMjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gcCA+Pj4gKHEgPj4+IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSAobSA+Pj4gMSkgJiAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEkgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDgyODggK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGkgfCByIHwgZSB8IHEgfCBwKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtID4+PiAocCA+Pj4gMCkpKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBJID0gRTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoSSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBKID0gRDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBLID0gQztcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IEk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IEQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IEM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA9ICgoY1socCArIDQpID4+IDJdICYgLTgpIC0gZykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gZSA+Pj4gMCA8IG0gPj4+IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSByID8gZSA6IG07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgPSByID8gcCA6IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBjWyhwICsgMTYpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChyIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IHI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IGNbKHAgKyAyMCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHIgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBKID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEsgPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwID0gcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEsgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IGc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoSiA+Pj4gMCA+PSAoKChjWzE5OThdIHwgMCkgLSBnKSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IGc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBxID0gSztcbiAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBjWzJlM10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHEgPj4+IDAgPCBtID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHAgPSAocSArIGcpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGsgPSBwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHEgPj4+IDAgPj0gcCA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gY1soSyArIDI0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gY1soSyArIDEyKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChpIHwgMCkgPT0gKEsgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gKEsgKyAyMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gY1tyID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChkIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IChLICsgMTYpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEIgPSBjW2ogPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChCIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEwgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNID0gQjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE0gPSBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTiA9IHI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSAoTSArIDIwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gY1tyID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOID0gcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSAoTSArIDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gY1tyID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTiA9IHI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKE4gPj4+IDAgPCBtID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW04gPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTCA9IE07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBjWyhLICsgOCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAociA+Pj4gMCA8IG0gPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gKHIgKyAxMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbZCA+PiAyXSB8IDApICE9IChLIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gKGkgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1tqID4+IDJdIHwgMCkgPT0gKEsgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tkID4+IDJdID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbaiA+PiAyXSA9IHI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBMMjQwMjogZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IChLICsgMjgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9ICg4Mjg4ICsgKGNbaSA+PiAyXSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEsgfCAwKSA9PSAoY1ttID4+IDJdIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW20gPj4gMl0gPSBMO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoTCB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5N10gPSBjWzE5OTddICYgfigxIDw8IGNbaSA+PiAyXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDI0MDI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gKGUgKyAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1tyID4+IDJdIHwgMCkgPT0gKEsgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW3IgPj4gMl0gPSBMO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGUgKyAyMCkgPj4gMl0gPSBMO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEwgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwyNDAyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChMID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soTCArIDI0KSA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBjWyhLICsgMTYpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKEwgKyAxNikgPj4gMl0gPSBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhpICsgMjQpID4+IDJdID0gTDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGNbKEsgKyAyMCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA+Pj4gMCA8IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soTCArIDIwKSA+PiAyXSA9IGk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhpICsgMjQpID4+IDJdID0gTDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEogPj4+IDAgPCAxNikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlID0gKEogKyBnKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKEsgKyA0KSA+PiAyXSA9IGUgfCAzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gKHEgKyAoZSArIDQpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbaSA+PiAyXSA9IGNbaSA+PiAyXSB8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soSyArIDQpID4+IDJdID0gZyB8IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAoZyB8IDQpKSA+PiAyXSA9IEogfCAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgKEogKyBnKSkgPj4gMl0gPSBKO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gSiA+Pj4gMztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEogPj4+IDAgPCAyNTYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgPSBpIDw8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gKDgwMjQgKyAoZSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IGNbMTk5Nl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IDEgPDwgaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChyICYgaikgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5Nl0gPSByIHwgajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTyA9IG07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFAgPSAoODAyNCArICgoZSArIDIpIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9ICg4MDI0ICsgKChlICsgMikgPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IGNbaSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkID4+PiAwID49IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTyA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tQID4+IDJdID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKE8gKyAxMikgPj4gMl0gPSBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIChnICsgOCkpID4+IDJdID0gTztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAoZyArIDEyKSkgPj4gMl0gPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA9IHA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogPSBKID4+PiA4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGogfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChKID4+PiAwID4gMTY3NzcyMTUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9IDMxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9ICgoKGogKyAxMDQ4MzIwKSB8IDApID4+PiAxNikgJiA4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBqIDw8IHI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9ICgoKGkgKyA1MjAxOTIpIHwgMCkgPj4+IDE2KSAmIDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQiA9IGkgPDwgZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gKCgoQiArIDI0NTc2MCkgfCAwKSA+Pj4gMTYpICYgMjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDE0IC1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkIHwgciB8IGkpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoQiA8PCBpKSA+Pj4gMTUpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoSiA+Pj4gKCgobCArIDcpIHwgMCkgPj4+IDApKSAmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsIDw8IDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9ICg4Mjg4ICsgKFEgPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIChnICsgMjgpKSA+PiAyXSA9IFE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAoZyArIDIwKSkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgKGcgKyAxNikpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGNbMTk5N10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsID0gMSA8PCBRO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChtICYgbCkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE5OTddID0gbSB8IGw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW2ogPj4gMl0gPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIChnICsgMjQpKSA+PiAyXSA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgKGcgKyAxMikpID4+IDJdID0gZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAoZyArIDgpKSA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKFEgfCAwKSA9PSAzMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUiA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSID0gKDI1IC0gKFEgPj4+IDEpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IEogPDwgUjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGNbaiA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhtICsgNCkgPj4gMl0gJiAtOCkgfCAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChKIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUyA9IChtICsgMTYgKyAoKGwgPj4+IDMxKSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IGNbUyA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGogfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVCA9IDE5MTM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGwgPSBsIDw8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChUIHwgMCkgPT0gMTkxMykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFMgPj4+IDAgPCAoY1syZTNdIHwgMCkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1MgPj4gMl0gPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAoZyArIDI0KSkgPj4gMl0gPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAoZyArIDEyKSkgPj4gMl0gPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAoZyArIDgpKSA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbCA9IChtICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gY1tsID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGNbMmUzXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtID4+PiAwIDwgaSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChqID4+PiAwIDwgaSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soaiArIDEyKSA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW2wgPj4gMl0gPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIChnICsgOCkpID4+IDJdID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAoZyArIDEyKSkgPj4gMl0gPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIChnICsgMjQpKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgcSA9IChLICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChxIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8gPSBnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuID0gcTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIEsgPSBjWzE5OThdIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAobyA+Pj4gMCA8PSBLID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIFMgPSAoSyAtIG8pIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgSiA9IGNbMjAwMV0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAoUyA+Pj4gMCA+IDE1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBSID0gSjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbMjAwMV0gPSBSICsgbztcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5OF0gPSBTO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1soUiArIChvICsgNCkpID4+IDJdID0gUyB8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhSICsgSykgPj4gMl0gPSBTO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1soSiArIDQpID4+IDJdID0gbyB8IDM7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWzE5OThdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbMjAwMV0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1soSiArIDQpID4+IDJdID0gSyB8IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICBTID0gKEogKyAoSyArIDQpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjW1MgPj4gMl0gPSBjW1MgPj4gMl0gfCAxO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIG4gPSAoSiArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBKID0gY1sxOTk5XSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKG8gPj4+IDAgPCBKID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIFMgPSAoSiAtIG8pIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgY1sxOTk5XSA9IFM7XG4gICAgICAgICAgICAgICAgICAgIEogPSBjWzIwMDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgSyA9IEo7XG4gICAgICAgICAgICAgICAgICAgIGNbMjAwMl0gPSBLICsgbztcbiAgICAgICAgICAgICAgICAgICAgY1soSyArIChvICsgNCkpID4+IDJdID0gUyB8IDE7XG4gICAgICAgICAgICAgICAgICAgIGNbKEogKyA0KSA+PiAyXSA9IG8gfCAzO1xuICAgICAgICAgICAgICAgICAgICBuID0gKEogKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKGNbMTY2Nl0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBKID0gYW0oMzApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKChKIC0gMSkgJiBKKSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE2NjhdID0gSjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE2NjddID0gSjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE2NjldID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxNjcwXSA9IC0xO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTY3MV0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMjEwN10gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTY2Nl0gPSAoKGFKKDApIHwgMCkgJiAtMTYpIF4gMTQzMTY1NTc2ODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIEogPSAobyArIDQ4KSB8IDA7XG4gICAgICAgICAgICAgICAgUyA9IGNbMTY2OF0gfCAwO1xuICAgICAgICAgICAgICAgIEsgPSAobyArIDQ3KSB8IDA7XG4gICAgICAgICAgICAgICAgUiA9IChTICsgSykgfCAwO1xuICAgICAgICAgICAgICAgIFEgPSAtUyB8IDA7XG4gICAgICAgICAgICAgICAgUyA9IFIgJiBRO1xuICAgICAgICAgICAgICAgIGlmIChTID4+PiAwIDw9IG8gPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgbiA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgTyA9IGNbMjEwNl0gfCAwO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChPIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgUCA9IGNbMjEwNF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgTCA9IChQICsgUykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChMID4+PiAwIDw9IFAgPj4+IDApIHwgKEwgPj4+IDAgPiBPID4+PiAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG4gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBuIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIEwyNDk0OiBkbyB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoKGNbMjEwN10gJiA0KSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIE8gPSBjWzIwMDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIEwyNDk2OiBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChPIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUID0gMTk0MztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMID0gTztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUCA9IDg0MzI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVID0gUCB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNID0gY1tVID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChNID4+PiAwIDw9IEwgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWID0gKFAgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKE0gKyAoY1tWID4+IDJdIHwgMCkpIHwgMCkgPj4+IDAgPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMID4+PiAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE0gPSBjWyhQICsgOCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChNIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFQgPSAxOTQzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwyNDk2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQID0gTTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKFAgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUID0gMTk0MztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEwgPSAoUiAtIChjWzE5OTldIHwgMCkpICYgUTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEwgPj4+IDAgPj0gMjE0NzQ4MzY0Nykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVyA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gYVMoTCB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobSB8IDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChjW1UgPj4gMl0gfCAwKSArIChjW1YgPj4gMl0gfCAwKSkgfCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWCA9IGUgPyBtIDogLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFkgPSBlID8gTCA6IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFogPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfID0gTDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVCA9IDE5NTI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChUIHwgMCkgPT0gMTk0Mykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPID0gYVMoMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKE8gfCAwKSA9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVyA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gTztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTCA9IGNbMTY2N10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gKEwgLSAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKG0gJiBnKSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQgPSBTO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJCA9IChTIC0gZyArICgobSArIGcpICYgLUwpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTCA9IGNbMjEwNF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gKEwgKyAkKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICEoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCQgPj4+IDAgPiBvID4+PiAwKSAmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCQgPj4+IDAgPCAyMTQ3NDgzNjQ3KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFcgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGNbMjEwNl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG0gfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGcgPj4+IDAgPD0gTCA+Pj4gMCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChnID4+PiAwID4gbSA+Pj4gMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFcgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBhUygkIHwgMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gKG0gfCAwKSA9PSAoTyB8IDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBYID0gZyA/IE8gOiAtMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWSA9IGcgPyAkIDogMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWiA9IG07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8gPSAkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUID0gMTk1MjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIEwyNTE2OiBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChUIHwgMCkgPT0gMTk1Mikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gLV8gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKFggfCAwKSAhPSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWEgPSBZO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWIgPSBYO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVCA9IDE5NjM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMjQ5NDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChaIHwgMCkgIT0gLTEpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoXyA+Pj4gMCA8IDIxNDc0ODM2NDcpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoXyA+Pj4gMCA8IEogPj4+IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gY1sxNjY4XSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTyA9IChLIC0gXyArIGcpICYgLWc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKE8gPj4+IDAgPj0gMjE0NzQ4MzY0Nykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYyA9IF87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFTKE8gfCAwKSB8IDApID09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFTKG0gfCAwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFcgPSBZO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMjUxNjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYyA9IChPICsgXykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjID0gXztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoWiB8IDApID09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXID0gWTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFhID0gYWM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYiA9IFo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUID0gMTk2MztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwyNDk0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWzIxMDddID0gY1syMTA3XSB8IDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBhZCA9IFc7XG4gICAgICAgICAgICAgICAgICAgICAgICBUID0gMTk2MDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFkID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIFQgPSAxOTYwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKFQgfCAwKSA9PSAxOTYwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoUyA+Pj4gMCA+PSAyMTQ3NDgzNjQ3KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBXID0gYVMoUyB8IDApIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIFogPSBhUygwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChaIHwgMCkgIT0gLTEpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChXIHwgMCkgIT0gLTEpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFcgPj4+IDAgPCBaID4+PiAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYWMgPSAoWiAtIFcpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIFogPSBhYyA+Pj4gMCA+ICgobyArIDQwKSB8IDApID4+PiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgWSA9IFogPyBXIDogLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKFkgfCAwKSAhPSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFhID0gWiA/IGFjIDogYWQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWIgPSBZO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFQgPSAxOTYzO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKFQgfCAwKSA9PSAxOTYzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhZCA9ICgoY1syMTA0XSB8IDApICsgYWEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbMjEwNF0gPSBhZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhZCA+Pj4gMCA+IChjWzIxMDVdIHwgMCkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzIxMDVdID0gYWQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBhZCA9IGNbMjAwMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgTDI1MzY6IGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFkIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTID0gY1syZTNdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoUyB8IDApID09IDApIHwgKGFiID4+PiAwIDwgUyA+Pj4gMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMmUzXSA9IGFiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMjEwOF0gPSBhYjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMTA5XSA9IGFhO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzIxMTFdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMDA1XSA9IGNbMTY2Nl07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMjAwNF0gPSAtMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUyA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFkgPSBTIDw8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYyA9ICg4MDI0ICsgKFkgPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKDgwMjQgKyAoKFkgKyAzKSA8PCAyKSkgPj4gMl0gPSBhYztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKDgwMjQgKyAoKFkgKyAyKSA8PCAyKSkgPj4gMl0gPSBhYztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFMgPSAoUyArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoUyA+Pj4gMCA8IDMyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUyA9IChhYiArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoUyAmIDcpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWUgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWUgPSAtUyAmIDc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUyA9IChhYSAtIDQwIC0gYWUpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMDAyXSA9IGFiICsgYWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5OV0gPSBTO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYiArIChhZSArIDQpKSA+PiAyXSA9IFMgfCAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYiArIChhYSAtIDM2KSkgPj4gMl0gPSA0MDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMDAzXSA9IGNbMTY3MF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUyA9IDg0MzI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZiA9IGNbUyA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZyA9IChTICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWggPSBjW2FnID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYWIgfCAwKSA9PSAoKGFmICsgYWgpIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUID0gMTk3NTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjID0gY1soUyArIDgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYWMgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFMgPSBhYztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKFQgfCAwKSA9PSAxOTc1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoY1soUyArIDEyKSA+PiAyXSAmIDgpIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWMgPSBhZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICEoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWMgPj4+IDAgPj0gYWYgPj4+IDApICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYyA+Pj4gMCA8IGFiID4+PiAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW2FnID4+IDJdID0gYWggKyBhYTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYyA9IGNbMjAwMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFkgPSAoKGNbMTk5OV0gfCAwKSArIGFhKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWiA9IGFjO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFcgPSAoYWMgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoVyAmIDcpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhaSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWkgPSAtVyAmIDc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFcgPSAoWSAtIGFpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMDAyXSA9IFogKyBhaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE5OTldID0gVztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhaICsgKGFpICsgNCkpID4+IDJdID0gVyB8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soWiArIChZICsgNCkpID4+IDJdID0gNDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMDAzXSA9IGNbMTY3MF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDI1MzY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWIgPj4+IDAgPCAoY1syZTNdIHwgMCkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMmUzXSA9IGFiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFMgPSAoYWIgKyBhYSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBZID0gODQzMjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFqID0gWSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbYWogPj4gMl0gfCAwKSA9PSAoUyB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVCA9IDE5ODU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBaID0gY1soWSArIDgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoWiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWSA9IFo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChUIHwgMCkgPT0gMTk4NSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKGNbKFkgKyAxMikgPj4gMl0gJiA4KSB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbYWogPj4gMl0gPSBhYjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTID0gKFkgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tTID4+IDJdID0gKGNbUyA+PiAyXSB8IDApICsgYWE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUyA9IChhYiArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChTICYgNykgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFrID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhayA9IC1TICYgNztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUyA9IChhYiArIChhYSArIDgpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoUyAmIDcpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbCA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWwgPSAtUyAmIDc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFMgPSAoYWIgKyAoYWwgKyBhYSkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBaID0gUztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXID0gKGFrICsgbykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjID0gKGFiICsgVykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBhYztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBLID0gKFMgLSAoYWIgKyBhaykgLSBvKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWIgKyAoYWsgKyA0KSkgPj4gMl0gPSBvIHwgMztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoWiB8IDApID09IChjWzIwMDJdIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEogPSAoKGNbMTk5OV0gfCAwKSArIEspIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5OV0gPSBKO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMDAyXSA9IF87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYiArIChXICsgNCkpID4+IDJdID0gSiB8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKFogfCAwKSA9PSAoY1syMDAxXSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSiA9ICgoY1sxOTk4XSB8IDApICsgSykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5OF0gPSBKO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMjAwMV0gPSBfO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGFiICsgKFcgKyA0KSkgPj4gMl0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBKIHwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYiArIChKICsgVykpID4+IDJdID0gSjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEogPSAoYWEgKyA0KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBYID0gY1soYWIgKyAoSiArIGFsKSkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoWCAmIDMpIHwgMCkgPT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQgPSBYICYgLTg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgViA9IFggPj4+IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTDI1NzE6IGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFggPj4+IDAgPCAyNTYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFUgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGFsIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4KSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWEpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFiICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsKSkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFIgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICg4MDI0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChWIDw8IDEpIDw8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoVSB8IDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChSIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWzJlM10gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFUgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMikgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChaIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUSB8IDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFUgfCAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk2XSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5Nl0gJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB+KDEgPDwgVik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUSB8IDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChSIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW4gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFEgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDgpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWzJlM10gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFogfCAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuID0gbTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoVSArIDEyKSA+PiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gUTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbYW4gPj4gMl0gPSBVO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUiA9IFM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWIgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChhbCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjQpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYSkpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWIgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFhICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWwpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFAgfCAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUiB8IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE8gPSBhbCB8IDE2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEogK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChPICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFhKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTyB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW8gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcCA9IE87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXIgPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXAgPSBMO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXIgPSBnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYXAgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTCB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXAgPSBMO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhcCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEwgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXAgPSBMO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhciA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWzJlM10gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW8gPSBhcDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZyA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoYWwgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWEpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZyA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWzJlM10gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEwgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgIT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChSIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUCArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFIgfCAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTCA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gUDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFvID0gUDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKG0gfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWIgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWEgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjggK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWwpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFUgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICg4Mjg4ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQID4+IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFIgfCAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1tVID4+IDJdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVID4+IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IGFvO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYW8gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApICE9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk3XSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE5OTddICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH4oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFAgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMjU3MTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgPFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbMmUzXSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPj4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBRID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNikgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFIgfCAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gYW87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjApID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSBhbztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYW8gfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID09XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDI1NzE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbyA+Pj4gMCA8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNbMmUzXSB8IDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYW8gKyAyNCkgPj4gMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IG07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSID0gYWwgfCAxNjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFAgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWEpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFAgfCAwKSAhPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFAgPj4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1syZTNdIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYW8gK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNikgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IFA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChQICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjQpID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSBhbztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWIgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEogK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFIpKSA+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChQIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFAgPj4+IDAgPFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWzJlM10gfCAwKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFvICsgMjApID4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSA9IFA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFAgKyAyNCkgPj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gYW87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcyA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYiArICgoJCB8IGFsKSArIGFhKSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0ID0gKCQgKyBLKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFzID0gWjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdCA9IEs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBKID0gKGFzICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tKID4+IDJdID0gY1tKID4+IDJdICYgLTI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYiArIChXICsgNCkpID4+IDJdID0gYXQgfCAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWIgKyAoYXQgKyBXKSkgPj4gMl0gPSBhdDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEogPSBhdCA+Pj4gMztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhdCA+Pj4gMCA8IDI1Nikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFYgPSBKIDw8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWCA9ICg4MDI0ICsgKFYgPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQID0gY1sxOTk2XSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IDEgPDwgSjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoUCAmIG0pIHwgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE5OTZdID0gUCB8IG07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdSA9IFg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDgwMjQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKFYgKyAyKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDgwMjQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKFYgKyAyKSA8PFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMikpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVSA9IGNbSiA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVSA+Pj4gMCA+PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjWzJlM10gfCAwKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXUgPSBVO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF2ID0gSjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbYXYgPj4gMl0gPSBfO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGF1ICsgMTIpID4+IDJdID0gXztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYiArIChXICsgOCkpID4+IDJdID0gYXU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWIgKyAoVyArIDEyKSkgPj4gMl0gPSBYO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgViA9IGFjO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGF0ID4+PiA4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXcgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0ID4+PiAwID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2Nzc3MjE1XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXcgPSAzMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFAgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgobSArIDEwNDgzMjApIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNikgJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJCA9IG0gPDwgUDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKCgkICsgNTIwMTkyKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPj4+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFUgPSAkIDw8IEo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoVSArIDI0NTc2MCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2KSAmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBRID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgxNCAtXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEogfCBQIHwgJCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoVSA8PCAkKSA+Pj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTUpKSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdyA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGF0ID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKFEgKyA3KSB8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApID4+PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKSkgJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChRIDw8IDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9ICg4Mjg4ICsgKGF3IDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYiArIChXICsgMjgpKSA+PiAyXSA9IGF3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWIgKyAoVyArIDIwKSkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWIgKyAoVyArIDE2KSkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWCA9IGNbMTk5N10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9IDEgPDwgYXc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChYICYgUSkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk3XSA9IFggfCBRO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbbSA+PiAyXSA9IFY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWIgKyAoVyArIDI0KSkgPj4gMl0gPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGFiICsgKFcgKyAxMikpID4+IDJdID0gVjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYiArIChXICsgOCkpID4+IDJdID0gVjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYXcgfCAwKSA9PSAzMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF4ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXggPSAoMjUgLSAoYXcgPj4+IDEpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBRID0gYXQgPDwgYXg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBYID0gY1ttID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGNbKFggKyA0KSA+PiAyXSAmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtOCkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCkgPT1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGF0IHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF5ID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFggK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChRID4+PiAzMSkgPDwgMikpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gY1theSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChtIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUID0gMjA1ODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9IFEgPDwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWCA9IG07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChUIHwgMCkgPT0gMjA1OCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXkgPj4+IDAgPFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY1syZTNdIHwgMCkgPj4+IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1theSA+PiAyXSA9IFY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWIgKyAoVyArIDI0KSkgPj4gMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gWDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYiArIChXICsgMTIpKSA+PiAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0gPSBWO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFiICsgKFcgKyA4KSkgPj4gMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdID0gVjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9IChYICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGNbUSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkID0gY1syZTNdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChYID4+PiAwIDwgJCA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobSA+Pj4gMCA8ICQgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhtICsgMTIpID4+IDJdID0gVjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1EgPj4gMl0gPSBWO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGFiICsgKFcgKyA4KSkgPj4gMl0gPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGFiICsgKFcgKyAxMikpID4+IDJdID0gWDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYiArIChXICsgMjQpKSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuID0gKGFiICsgKGFrIHwgOCkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbiB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBZID0gYWQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFcgPSA4NDMyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXogPSBjW1cgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGF6ID4+PiAwIDw9IFkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhQSA9IGNbKFcgKyA0KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYUIgPSAoYXogKyBhQSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhQiA+Pj4gMCA+IFkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVyA9IGNbKFcgKyA4KSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVyA9IChheiArIChhQSAtIDM5KSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChXICYgNykgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhQyA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhQyA9IC1XICYgNztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXID0gKGF6ICsgKGFBIC0gNDcgKyBhQykpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWMgPSBXID4+PiAwIDwgKChhZCArIDE2KSB8IDApID4+PiAwID8gWSA6IFc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFcgPSAoYWMgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8gPSAoYWIgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKF8gJiA3KSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFEID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFEID0gLV8gJiA3O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8gPSAoYWEgLSA0MCAtIGFEKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMjAwMl0gPSBhYiArIGFEO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE5OTldID0gXztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWIgKyAoYUQgKyA0KSkgPj4gMl0gPSBfIHwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWIgKyAoYWEgLSAzNikpID4+IDJdID0gNDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMjAwM10gPSBjWzE2NzBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhYyArIDQpID4+IDJdID0gMjc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbVyA+PiAyXSA9IGNbMjEwOF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKFcgKyA0KSA+PiAyXSA9IGNbMjEwOV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKFcgKyA4KSA+PiAyXSA9IGNbMjExMF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKFcgKyAxMikgPj4gMl0gPSBjWzIxMTFdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzIxMDhdID0gYWI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMjEwOV0gPSBhYTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMTExXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMjExMF0gPSBXO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXID0gKGFjICsgMjgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tXID4+IDJdID0gNztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoYWMgKyAzMikgfCAwKSA+Pj4gMCA8IGFCID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfID0gVztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVyA9IChfICsgNCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbVyA+PiAyXSA9IDc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoXyArIDgpIHwgMCkgPj4+IDAgPCBhQiA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfID0gVztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhYyB8IDApID09IChZIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8gPSAoYWMgLSBhZCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXID0gKFkgKyAoXyArIDQpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbVyA+PiAyXSA9IGNbVyA+PiAyXSAmIC0yO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhZCArIDQpID4+IDJdID0gXyB8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKFkgKyBfKSA+PiAyXSA9IF87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFcgPSBfID4+PiAzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXyA+Pj4gMCA8IDI1Nikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSyA9IFcgPDwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFogPSAoODAyNCArIChLIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTID0gY1sxOTk2XSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gMSA8PCBXO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKFMgJiBtKSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk2XSA9IFMgfCBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhRSA9IFo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFGID0gKDgwMjQgKyAoKEsgKyAyKSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFcgPSAoODAyNCArICgoSyArIDIpIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFEgPSBjW1cgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoUSA+Pj4gMCA+PSAoY1syZTNdIHwgMCkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFFID0gUTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFGID0gVztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1thRiA+PiAyXSA9IGFkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYUUgKyAxMikgPj4gMl0gPSBhZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGFkICsgOCkgPj4gMl0gPSBhRTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGFkICsgMTIpID4+IDJdID0gWjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEsgPSBhZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IF8gPj4+IDg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhRyA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfID4+PiAwID4gMTY3NzcyMTUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYUcgPSAzMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFMgPSAoKChtICsgMTA0ODMyMCkgfCAwKSA+Pj4gMTYpICYgODtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBZID0gbSA8PCBTO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjID0gKCgoWSArIDUyMDE5MikgfCAwKSA+Pj4gMTYpICYgNDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXID0gWSA8PCBhYztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBZID0gKCgoVyArIDI0NTc2MCkgfCAwKSA+Pj4gMTYpICYgMjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBRID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDE0IC1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhYyB8IFMgfCBZKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKFcgPDwgWSkgPj4+IDE1KSkgfFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFHID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChfID4+PiAoKChRICsgNykgfCAwKSA+Pj4gMCkpICZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEpIHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFEgPDwgMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gKDgyODggKyAoYUcgPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWQgKyAyOCkgPj4gMl0gPSBhRztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWQgKyAyMCkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhZCArIDE2KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFogPSBjWzE5OTddIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9IDEgPDwgYUc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKFogJiBRKSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5N10gPSBaIHwgUTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbbSA+PiAyXSA9IEs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhZCArIDI0KSA+PiAyXSA9IG07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhZCArIDEyKSA+PiAyXSA9IGFkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWQgKyA4KSA+PiAyXSA9IGFkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhRyB8IDApID09IDMxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhSCA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhSCA9ICgyNSAtIChhRyA+Pj4gMSkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBRID0gXyA8PCBhSDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWiA9IGNbbSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChjWyhaICsgNCkgPj4gMl0gJiAtOCkgfCAwKSA9PVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChfIHwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYUkgPSAoWiArIDE2ICsgKChRID4+PiAzMSkgPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSBjW2FJID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUID0gMjA5MztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9IFEgPDwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBaID0gbTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKFQgfCAwKSA9PSAyMDkzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYUkgPj4+IDAgPCAoY1syZTNdIHwgMCkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW2FJID4+IDJdID0gSztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhZCArIDI0KSA+PiAyXSA9IFo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWQgKyAxMikgPj4gMl0gPSBhZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhZCArIDgpID4+IDJdID0gYWQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUSA9IChaICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfID0gY1tRID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSA9IGNbMmUzXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChaID4+PiAwIDwgbSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfID4+PiAwIDwgbSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soXyArIDEyKSA+PiAyXSA9IEs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW1EgPj4gMl0gPSBLO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYWQgKyA4KSA+PiAyXSA9IF87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhZCArIDEyKSA+PiAyXSA9IFo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhhZCArIDI0KSA+PiAyXSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgYWQgPSBjWzE5OTldIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhZCA+Pj4gMCA8PSBvID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBfID0gKGFkIC0gbykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk5XSA9IF87XG4gICAgICAgICAgICAgICAgICAgICAgICBhZCA9IGNbMjAwMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgUSA9IGFkO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1syMDAyXSA9IFEgKyBvO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1soUSArIChvICsgNCkpID4+IDJdID0gXyB8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhhZCArIDQpID4+IDJdID0gbyB8IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICBuID0gKGFkICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgY1soYVEoKSB8IDApID4+IDJdID0gMTI7XG4gICAgICAgICAgICAgICAgbiA9IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG4gfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gYzAoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgYiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGQgPSAwLFxuICAgICAgICAgICAgICAgICAgICBlID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGcgPSAwLFxuICAgICAgICAgICAgICAgICAgICBoID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGogPSAwLFxuICAgICAgICAgICAgICAgICAgICBrID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIG0gPSAwLFxuICAgICAgICAgICAgICAgICAgICBuID0gMCxcbiAgICAgICAgICAgICAgICAgICAgbyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHAgPSAwLFxuICAgICAgICAgICAgICAgICAgICBxID0gMCxcbiAgICAgICAgICAgICAgICAgICAgciA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHMgPSAwLFxuICAgICAgICAgICAgICAgICAgICB0ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgdSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHYgPSAwLFxuICAgICAgICAgICAgICAgICAgICB3ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgeCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIHkgPSAwLFxuICAgICAgICAgICAgICAgICAgICB6ID0gMCxcbiAgICAgICAgICAgICAgICAgICAgQSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEIgPSAwLFxuICAgICAgICAgICAgICAgICAgICBDID0gMCxcbiAgICAgICAgICAgICAgICAgICAgRCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBGID0gMCxcbiAgICAgICAgICAgICAgICAgICAgRyA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEggPSAwLFxuICAgICAgICAgICAgICAgICAgICBJID0gMCxcbiAgICAgICAgICAgICAgICAgICAgSiA9IDAsXG4gICAgICAgICAgICAgICAgICAgIEsgPSAwLFxuICAgICAgICAgICAgICAgICAgICBMID0gMCxcbiAgICAgICAgICAgICAgICAgICAgTSA9IDAsXG4gICAgICAgICAgICAgICAgICAgIE4gPSAwLFxuICAgICAgICAgICAgICAgICAgICBPID0gMDtcbiAgICAgICAgICAgICAgICBpZiAoKGEgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYiA9IChhIC0gOCkgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBiO1xuICAgICAgICAgICAgICAgIGUgPSBjWzJlM10gfCAwO1xuICAgICAgICAgICAgICAgIGlmIChiID4+PiAwIDwgZSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBmID0gY1soYSAtIDQpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICBnID0gZiAmIDM7XG4gICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPT0gMSkge1xuICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBoID0gZiAmIC04O1xuICAgICAgICAgICAgICAgIGkgPSAoYSArIChoIC0gOCkpIHwgMDtcbiAgICAgICAgICAgICAgICBqID0gaTtcbiAgICAgICAgICAgICAgICBMMjc1MzogZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKChmICYgMSkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBrID0gY1tiID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZyB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBsID0gKC04IC0gaykgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgbSA9IChhICsgbCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgbiA9IG07XG4gICAgICAgICAgICAgICAgICAgICAgICBvID0gKGsgKyBoKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobSA+Pj4gMCA8IGUgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChuIHwgMCkgPT0gKGNbMjAwMV0gfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSAoYSArIChoIC0gNCkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChjW3AgPj4gMl0gJiAzKSB8IDApICE9IDMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IG47XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBvO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk4XSA9IG87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1twID4+IDJdID0gY1twID4+IDJdICYgLTI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soYSArIChsICsgNCkpID4+IDJdID0gbyB8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tpID4+IDJdID0gbztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBwID0gayA+Pj4gMztcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChrID4+PiAwIDwgMjU2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgayA9IGNbKGEgKyAobCArIDgpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9IGNbKGEgKyAobCArIDEyKSkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAoODAyNCArICgocCA8PCAxKSA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChrIHwgMCkgIT0gKHQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGsgPj4+IDAgPCBlID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1soayArIDEyKSA+PiAyXSB8IDApID09IChuIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHMgfCAwKSA9PSAoayB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5Nl0gPSBjWzE5OTZdICYgfigxIDw8IHApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gbjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IG87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgocyB8IDApID09ICh0IHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSAocyArIDgpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzID4+PiAwIDwgZSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gKHMgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbdiA+PiAyXSB8IDApID09IChuIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gdjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhrICsgMTIpID4+IDJdID0gcztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW3UgPj4gMl0gPSBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBuO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBvO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdCA9IG07XG4gICAgICAgICAgICAgICAgICAgICAgICBwID0gY1soYSArIChsICsgMjQpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB2ID0gY1soYSArIChsICsgMTIpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh2IHwgMCkgPT0gKHQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gKGEgKyAobCArIDIwKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gY1t3ID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh4IHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeSA9IChhICsgKGwgKyAxNikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHogPSBjW3kgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh6IHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEEgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCID0gejtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDID0geTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEIgPSB4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQyA9IHc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgPSAoQiArIDIwKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gY1t3ID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoeCB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCID0geDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDID0gdztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgPSAoQiArIDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gY1t3ID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoeCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQiA9IHg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQyA9IHc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEMgPj4+IDAgPCBlID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tDID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEEgPSBCO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gY1soYSArIChsICsgOCkpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHcgPj4+IDAgPCBlID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggPSAodyArIDEyKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1t4ID4+IDJdIHwgMCkgIT0gKHQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5ID0gKHYgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1t5ID4+IDJdIHwgMCkgPT0gKHQgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1t4ID4+IDJdID0gdjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbeSA+PiAyXSA9IHc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBID0gdjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChwIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHEgPSBuO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBvO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdiA9IChhICsgKGwgKyAyOCkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG0gPSAoODI4OCArIChjW3YgPj4gMl0gPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHQgfCAwKSA9PSAoY1ttID4+IDJdIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1ttID4+IDJdID0gQTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChBIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk3XSA9IGNbMTk5N10gJiB+KDEgPDwgY1t2ID4+IDJdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IG47XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBvO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhayBMMjc1MztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocCA+Pj4gMCA8IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrID0gKHAgKyAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbayA+PiAyXSB8IDApID09ICh0IHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbayA+PiAyXSA9IEE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhwICsgMjApID4+IDJdID0gQTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEEgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gbjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBvO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgTDI3NTM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKEEgKyAyNCkgPj4gMl0gPSBwO1xuICAgICAgICAgICAgICAgICAgICAgICAgdCA9IGNbKGEgKyAobCArIDE2KSkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodCB8IDApICE9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHQgPj4+IDAgPCAoY1syZTNdIHwgMCkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhBICsgMTYpID4+IDJdID0gdDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHQgKyAyNCkgPj4gMl0gPSBBO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBjWyhhICsgKGwgKyAyMCkpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodCB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gbjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByID0gbztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0ID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soQSArIDIwKSA+PiAyXSA9IHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sodCArIDI0KSA+PiAyXSA9IEE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IG47XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgciA9IG87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBxID0gZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBoO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgZCA9IHE7XG4gICAgICAgICAgICAgICAgaWYgKGQgPj4+IDAgPj0gaSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBBID0gKGEgKyAoaCAtIDQpKSB8IDA7XG4gICAgICAgICAgICAgICAgZSA9IGNbQSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgaWYgKCgoZSAmIDEpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoKGUgJiAyKSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IChjWzIwMDJdIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCID0gKChjWzE5OTldIHwgMCkgKyByKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk5XSA9IEI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMDAyXSA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIDQpID4+IDJdID0gQiB8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChxIHwgMCkgIT0gKGNbMjAwMV0gfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMjAwMV0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbMTk5OF0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoaiB8IDApID09IChjWzIwMDFdIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCID0gKChjWzE5OThdIHwgMCkgKyByKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk4XSA9IEI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1syMDAxXSA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIDQpID4+IDJdID0gQiB8IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soZCArIEIpID4+IDJdID0gQjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBCID0gKChlICYgLTgpICsgcikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgQyA9IGUgPj4+IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICBMMjg1NjogZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlID4+PiAwIDwgMjU2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBjWyhhICsgaCkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gY1soYSArIChoIHwgNCkpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9ICg4MDI0ICsgKChDIDw8IDEpIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodSB8IDApICE9IChiIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodSA+Pj4gMCA8IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNbKHUgKyAxMikgPj4gMl0gfCAwKSA9PSAoaiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChnIHwgMCkgPT0gKHUgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk2XSA9IGNbMTk5Nl0gJiB+KDEgPDwgQyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGcgfCAwKSA9PSAoYiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IChnICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZyA+Pj4gMCA8IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmID0gKGcgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjW2YgPj4gMl0gfCAwKSA9PSAoaiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEQgPSBmO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHUgKyAxMikgPj4gMl0gPSBnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW0QgPj4gMl0gPSB1O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgPSBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmID0gY1soYSArIChoICsgMTYpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBjWyhhICsgKGggfCA0KSkgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHQgfCAwKSA9PSAoYiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCA9IChhICsgKGggKyAxMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gY1twID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG0gPSAoYSArIChoICsgOCkpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgayA9IGNbbSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoayB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEUgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEcgPSBtO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRiA9IHY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEcgPSBwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwID0gKEYgKyAyMCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gY1twID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh2IHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRiA9IHY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHID0gcDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPSAoRiArIDE2KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHYgPSBjW3AgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHYgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEYgPSB2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRyA9IHA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEcgPj4+IDAgPCAoY1syZTNdIHwgMCkgPj4+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW0cgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFID0gRjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwID0gY1soYSArIGgpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocCA+Pj4gMCA8IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gKHAgKyAxMikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1t2ID4+IDJdIHwgMCkgIT0gKGIgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gKHQgKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjW20gPj4gMl0gfCAwKSA9PSAoYiB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbdiA+PiAyXSA9IHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbbSA+PiAyXSA9IHA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEUgPSB0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAoYSArIChoICsgMjApKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSAoODI4OCArIChjW3QgPj4gMl0gPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgPT0gKGNbdSA+PiAyXSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1t1ID4+IDJdID0gRTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEUgfCAwKSAhPSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWzE5OTddID0gY1sxOTk3XSAmIH4oMSA8PCBjW3QgPj4gMl0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwyODU2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZiA+Pj4gMCA8IChjWzJlM10gfCAwKSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gKGYgKyAxNikgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoY1tnID4+IDJdIHwgMCkgPT0gKGIgfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjW2cgPj4gMl0gPSBFO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGYgKyAyMCkgPj4gMl0gPSBFO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEUgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIEwyODU2O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChFID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKEUgKyAyNCkgPj4gMl0gPSBmO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID0gY1soYSArIChoICsgOCkpID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChiIHwgMCkgIT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChiID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soRSArIDE2KSA+PiAyXSA9IGI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKGIgKyAyNCkgPj4gMl0gPSBFO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiID0gY1soYSArIChoICsgMTIpKSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYiB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChiID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1soRSArIDIwKSA+PiAyXSA9IGI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhiICsgMjQpID4+IDJdID0gRTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgNCkgPj4gMl0gPSBCIHwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKGQgKyBCKSA+PiAyXSA9IEI7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHEgfCAwKSAhPSAoY1syMDAxXSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgSCA9IEI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjWzE5OThdID0gQjtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbQSA+PiAyXSA9IGUgJiAtMjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyA0KSA+PiAyXSA9IHIgfCAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1soZCArIHIpID4+IDJdID0gcjtcbiAgICAgICAgICAgICAgICAgICAgICAgIEggPSByO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoMCk7XG4gICAgICAgICAgICAgICAgciA9IEggPj4+IDM7XG4gICAgICAgICAgICAgICAgaWYgKEggPj4+IDAgPCAyNTYpIHtcbiAgICAgICAgICAgICAgICAgICAgZCA9IHIgPDwgMTtcbiAgICAgICAgICAgICAgICAgICAgZSA9ICg4MDI0ICsgKGQgPDwgMikpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgQSA9IGNbMTk5Nl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBFID0gMSA8PCByO1xuICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChBICYgRSkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk2XSA9IEEgfCBFO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEkgPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEogPSAoODAyNCArICgoZCArIDIpIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSAoODAyNCArICgoZCArIDIpIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCA9IGNbciA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGggPj4+IDAgPj0gKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEkgPSBoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBKID0gcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgICAgICBjW0ogPj4gMl0gPSBxO1xuICAgICAgICAgICAgICAgICAgICBjWyhJICsgMTIpID4+IDJdID0gcTtcbiAgICAgICAgICAgICAgICAgICAgY1socSArIDgpID4+IDJdID0gSTtcbiAgICAgICAgICAgICAgICAgICAgY1socSArIDEyKSA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZSA9IHE7XG4gICAgICAgICAgICAgICAgSSA9IEggPj4+IDg7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKEkgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBLID0gMDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChIID4+PiAwID4gMTY3NzcyMTUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBLID0gMzE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBKID0gKCgoSSArIDEwNDgzMjApIHwgMCkgPj4+IDE2KSAmIDg7XG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gSSA8PCBKO1xuICAgICAgICAgICAgICAgICAgICAgICAgRSA9ICgoKGQgKyA1MjAxOTIpIHwgMCkgPj4+IDE2KSAmIDQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBBID0gZCA8PCBFO1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9ICgoKEEgKyAyNDU3NjApIHwgMCkgPj4+IDE2KSAmIDI7XG4gICAgICAgICAgICAgICAgICAgICAgICByID0gKDE0IC0gKEUgfCBKIHwgZCkgKyAoKEEgPDwgZCkgPj4+IDE1KSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgSyA9ICgoSCA+Pj4gKCgociArIDcpIHwgMCkgPj4+IDApKSAmIDEpIHwgKHIgPDwgMSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IHdoaWxlICgwKTtcbiAgICAgICAgICAgICAgICBJID0gKDgyODggKyAoSyA8PCAyKSkgfCAwO1xuICAgICAgICAgICAgICAgIGNbKHEgKyAyOCkgPj4gMl0gPSBLO1xuICAgICAgICAgICAgICAgIGNbKHEgKyAyMCkgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIGNbKHEgKyAxNikgPj4gMl0gPSAwO1xuICAgICAgICAgICAgICAgIHIgPSBjWzE5OTddIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gMSA8PCBLO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCgociAmIGQpIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY1sxOTk3XSA9IHIgfCBkO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tJID4+IDJdID0gZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAyNCkgPj4gMl0gPSBJO1xuICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIDEyKSA+PiAyXSA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgOCkgPj4gMl0gPSBxO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChLIHwgMCkgPT0gMzEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBMID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgTCA9ICgyNSAtIChLID4+PiAxKSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgQSA9IEggPDwgTDtcbiAgICAgICAgICAgICAgICAgICAgICAgIEogPSBjW0kgPj4gMl0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChjWyhKICsgNCkgPj4gMl0gJiAtOCkgfCAwKSA9PSAoSCB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBNID0gKEogKyAxNiArICgoQSA+Pj4gMzEpIDw8IDIpKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRSA9IGNbTSA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChFIHwgMCkgPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOID0gMjI3MDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQSA9IEEgPDwgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSiA9IEU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChOIHwgMCkgPT0gMjI3MCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChNID4+PiAwIDwgKGNbMmUzXSB8IDApID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1tNID4+IDJdID0gZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIDI0KSA+PiAyXSA9IEo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKHEgKyAxMikgPj4gMl0gPSBxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgOCkgPj4gMl0gPSBxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBBID0gKEogKyA4KSB8IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBCID0gY1tBID4+IDJdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIEUgPSBjWzJlM10gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEogPj4+IDAgPCBFID4+PiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXEoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChCID4+PiAwIDwgRSA+Pj4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFxKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbKEIgKyAxMikgPj4gMl0gPSBlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNbQSA+PiAyXSA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY1socSArIDgpID4+IDJdID0gQjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgMTIpID4+IDJdID0gSjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjWyhxICsgMjQpID4+IDJdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKDApO1xuICAgICAgICAgICAgICAgIHEgPSAoKGNbMjAwNF0gfCAwKSAtIDEpIHwgMDtcbiAgICAgICAgICAgICAgICBjWzIwMDRdID0gcTtcbiAgICAgICAgICAgICAgICBpZiAoKHEgfCAwKSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIE8gPSA4NDQwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgd2hpbGUgKDEpIHtcbiAgICAgICAgICAgICAgICAgICAgcSA9IGNbTyA+PiAyXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgocSB8IDApID09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgTyA9IChxICsgOCkgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNbMjAwNF0gPSAtMTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjMShiKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIHZhciBjID0gMDtcbiAgICAgICAgICAgICAgICBjID0gYjtcbiAgICAgICAgICAgICAgICB3aGlsZSAoYVtjXSB8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgYyA9IChjICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gKGMgLSBiKSB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjMihiLCBjKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGMgPSBjIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZCA9IDA7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBhWyhiICsgZCkgfCAwXSA9IGFbKGMgKyBkKSB8IDBdO1xuICAgICAgICAgICAgICAgICAgICBkID0gKGQgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoYVsoYyArIChkIC0gMSkpIHwgMF0gfCAwKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gYiB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjMyhiLCBjKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGMgPSBjIHwgMDtcbiAgICAgICAgICAgICAgICB2YXIgZCA9IDAsXG4gICAgICAgICAgICAgICAgICAgIGUgPSAwO1xuICAgICAgICAgICAgICAgIGQgPSAoYiArIChjMShiKSB8IDApKSB8IDA7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBhWyhkICsgZSkgfCAwXSA9IGFbKGMgKyBlKSB8IDBdO1xuICAgICAgICAgICAgICAgICAgICBlID0gKGUgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoYVsoYyArIChlIC0gMSkpIHwgMF0gfCAwKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gYiB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjNChhLCBiLCBjKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBjID0gYyB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMCxcbiAgICAgICAgICAgICAgICAgICAgZyA9IDA7XG4gICAgICAgICAgICAgICAgd2hpbGUgKChlIHwgMCkgPCAoYyB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgIGYgPSBkWyhhICsgZSkgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGcgPSBkWyhiICsgZSkgfCAwXSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoZiB8IDApICE9IChnIHwgMCkpXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKChmIHwgMCkgPiAoZyB8IDApID8gMSA6IC0xKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGUgPSAoZSArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjNShiLCBkLCBlKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwLFxuICAgICAgICAgICAgICAgICAgICBnID0gMCxcbiAgICAgICAgICAgICAgICAgICAgaCA9IDA7XG4gICAgICAgICAgICAgICAgZiA9IChiICsgZSkgfCAwO1xuICAgICAgICAgICAgICAgIGlmICgoZSB8IDApID49IDIwKSB7XG4gICAgICAgICAgICAgICAgICAgIGQgPSBkICYgMjU1O1xuICAgICAgICAgICAgICAgICAgICBlID0gYiAmIDM7XG4gICAgICAgICAgICAgICAgICAgIGcgPSBkIHwgKGQgPDwgOCkgfCAoZCA8PCAxNikgfCAoZCA8PCAyNCk7XG4gICAgICAgICAgICAgICAgICAgIGggPSBmICYgfjM7XG4gICAgICAgICAgICAgICAgICAgIGlmIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlID0gKGIgKyA0IC0gZSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKChiIHwgMCkgPCAoZSB8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYVtiXSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9IChiICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICgoYiB8IDApIDwgKGggfCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY1tiID4+IDJdID0gZztcbiAgICAgICAgICAgICAgICAgICAgICAgIGIgPSAoYiArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB3aGlsZSAoKGIgfCAwKSA8IChmIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgYVtiXSA9IGQ7XG4gICAgICAgICAgICAgICAgICAgIGIgPSAoYiArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjNihiLCBkLCBlKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSAwO1xuICAgICAgICAgICAgICAgIGYgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBpZiAoKGIgJiAzKSA9PSAoZCAmIDMpKSB7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlIChiICYgMykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChlIHwgMCkgPT0gMCkgcmV0dXJuIGYgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgYVtiXSA9IGFbZF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgYiA9IChiICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZCA9IChkICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZSA9IChlIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICgoZSB8IDApID49IDQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNbYiA+PiAyXSA9IGNbZCA+PiAyXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGIgPSAoYiArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoZCArIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGUgPSAoZSAtIDQpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB3aGlsZSAoKGUgfCAwKSA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgYVtiXSA9IGFbZF0gfCAwO1xuICAgICAgICAgICAgICAgICAgICBiID0gKGIgKyAxKSB8IDA7XG4gICAgICAgICAgICAgICAgICAgIGQgPSAoZCArIDEpIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZSA9IChlIC0gMSkgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gZiB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjNyhiLCBjLCBkKSB7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGMgPSBjIHwgMDtcbiAgICAgICAgICAgICAgICBkID0gZCB8IDA7XG4gICAgICAgICAgICAgICAgdmFyIGUgPSAwLFxuICAgICAgICAgICAgICAgICAgICBmID0gMDtcbiAgICAgICAgICAgICAgICB3aGlsZSAoKGUgfCAwKSA8IChkIHwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgYVsoYiArIGUpIHwgMF0gPSBmID8gMCA6IGFbKGMgKyBlKSB8IDBdIHwgMDtcbiAgICAgICAgICAgICAgICAgICAgZiA9IGYgPyAxIDogKGFbKGMgKyBlKSB8IDBdIHwgMCkgPT0gMDtcbiAgICAgICAgICAgICAgICAgICAgZSA9IChlICsgMSkgfCAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gYiB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjOChhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICByZXR1cm4gYVdbYSAmIDddKGIgfCAwKSB8IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBjOShhLCBiKSB7XG4gICAgICAgICAgICAgICAgYSA9IGEgfCAwO1xuICAgICAgICAgICAgICAgIGIgPSBiIHwgMDtcbiAgICAgICAgICAgICAgICBhWFthICYgMV0oYiB8IDApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gZGEoYSwgYiwgYywgZCwgZSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgYyA9IGMgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBlID0gZSB8IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGFZW2EgJiA3XShiIHwgMCwgYyB8IDAsIGQgfCAwLCBlIHwgMCkgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gZGIoYSwgYiwgYywgZCkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgYyA9IGMgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICBhWlthICYgMTVdKGIgfCAwLCBjIHwgMCwgZCB8IDApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gZGMoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBhX1thICYgMV0oKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGRkKGEsIGIsIGMpIHtcbiAgICAgICAgICAgICAgICBhID0gYSB8IDA7XG4gICAgICAgICAgICAgICAgYiA9IGIgfCAwO1xuICAgICAgICAgICAgICAgIGMgPSBjIHwgMDtcbiAgICAgICAgICAgICAgICByZXR1cm4gYSRbYSAmIDFdKGIgfCAwLCBjIHwgMCkgfCAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gZGUoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICAkKDApO1xuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gZGYoYSkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICAkKDEpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gZGcoYSwgYiwgYywgZCkge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgYyA9IGMgfCAwO1xuICAgICAgICAgICAgICAgIGQgPSBkIHwgMDtcbiAgICAgICAgICAgICAgICAkKDIpO1xuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gZGgoYSwgYiwgYykge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgYyA9IGMgfCAwO1xuICAgICAgICAgICAgICAgICQoMyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiBkaSgpIHtcbiAgICAgICAgICAgICAgICAkKDQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gZGooYSwgYikge1xuICAgICAgICAgICAgICAgIGEgPSBhIHwgMDtcbiAgICAgICAgICAgICAgICBiID0gYiB8IDA7XG4gICAgICAgICAgICAgICAgJCg1KTtcbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gRU1TQ1JJUFRFTl9FTkRfRlVOQ1NcblxuICAgICAgICAgICAgdmFyIGFXID0gW2RlLCBkZSwgY0wsIGRlLCBjSiwgZGUsIGRlLCBkZV07XG4gICAgICAgICAgICB2YXIgYVggPSBbZGYsIGRmXTtcbiAgICAgICAgICAgIHZhciBhWSA9IFtkZywgZGcsIGNJLCBkZywgY0ssIGRnLCBkZywgZGddO1xuICAgICAgICAgICAgdmFyIGFaID0gW1xuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGJaLFxuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGIkLFxuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGJfLFxuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGJZLFxuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGJYLFxuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGRoLFxuICAgICAgICAgICAgICAgIGRoXG4gICAgICAgICAgICBdO1xuICAgICAgICAgICAgdmFyIGFfID0gW2RpLCBkaV07XG4gICAgICAgICAgICB2YXIgYSQgPSBbZGosIGRqXTtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgX3N0cmxlbjogYzEsXG4gICAgICAgICAgICAgICAgX3N0cmNhdDogYzMsXG4gICAgICAgICAgICAgICAgX21pZF9jcmVhdGVfb3B0aW9uczogY1YsXG4gICAgICAgICAgICAgICAgX21pZF9pc3RyZWFtX29wZW5fbWVtOiBjTyxcbiAgICAgICAgICAgICAgICBfbWlkX2lzdHJlYW1fb3Blbl9maWxlOiBjTixcbiAgICAgICAgICAgICAgICBfbWlkX3NvbmdfcmVhZF93YXZlOiBiNixcbiAgICAgICAgICAgICAgICBfbWlkX2V4aXQ6IGNaLFxuICAgICAgICAgICAgICAgIF9taWRfc29uZ19ub3RlX29uOiBiMCxcbiAgICAgICAgICAgICAgICBfc3RybmNweTogYzcsXG4gICAgICAgICAgICAgICAgX21lbXNldDogYzUsXG4gICAgICAgICAgICAgICAgX21lbWNweTogYzYsXG4gICAgICAgICAgICAgICAgX21pZF9zb25nX2dldF9taXNzaW5nX2luc3RydW1lbnQ6IGJ1LFxuICAgICAgICAgICAgICAgIF9taWRfaXN0cmVhbV9jbG9zZTogY1IsXG4gICAgICAgICAgICAgICAgX21pZF9zb25nX2ZyZWU6IGNZLFxuICAgICAgICAgICAgICAgIF9taWRfaW5pdDogY1QsXG4gICAgICAgICAgICAgICAgX21pZF9zb25nX2xvYWQ6IGNYLFxuICAgICAgICAgICAgICAgIF9taWRfc29uZ19zdGFydDogYjMsXG4gICAgICAgICAgICAgICAgX21pZF9zb25nX2dldF9udW1fbWlzc2luZ19pbnN0cnVtZW50czogYnQsXG4gICAgICAgICAgICAgICAgX21lbWNtcDogYzQsXG4gICAgICAgICAgICAgICAgX2ZyZWU6IGMwLFxuICAgICAgICAgICAgICAgIF9tYWxsb2M6IGMkLFxuICAgICAgICAgICAgICAgIF9zdHJjcHk6IGMyLFxuICAgICAgICAgICAgICAgIHJ1blBvc3RTZXRzOiBiZyxcbiAgICAgICAgICAgICAgICBzdGFja0FsbG9jOiBhMCxcbiAgICAgICAgICAgICAgICBzdGFja1NhdmU6IGExLFxuICAgICAgICAgICAgICAgIHN0YWNrUmVzdG9yZTogYTIsXG4gICAgICAgICAgICAgICAgc2V0VGhyZXc6IGEzLFxuICAgICAgICAgICAgICAgIHNldFRlbXBSZXQwOiBhNixcbiAgICAgICAgICAgICAgICBzZXRUZW1wUmV0MTogYTcsXG4gICAgICAgICAgICAgICAgc2V0VGVtcFJldDI6IGE4LFxuICAgICAgICAgICAgICAgIHNldFRlbXBSZXQzOiBhOSxcbiAgICAgICAgICAgICAgICBzZXRUZW1wUmV0NDogYmEsXG4gICAgICAgICAgICAgICAgc2V0VGVtcFJldDU6IGJiLFxuICAgICAgICAgICAgICAgIHNldFRlbXBSZXQ2OiBiYyxcbiAgICAgICAgICAgICAgICBzZXRUZW1wUmV0NzogYmQsXG4gICAgICAgICAgICAgICAgc2V0VGVtcFJldDg6IGJlLFxuICAgICAgICAgICAgICAgIHNldFRlbXBSZXQ5OiBiZixcbiAgICAgICAgICAgICAgICBkeW5DYWxsX2lpOiBjOCxcbiAgICAgICAgICAgICAgICBkeW5DYWxsX3ZpOiBjOSxcbiAgICAgICAgICAgICAgICBkeW5DYWxsX2lpaWlpOiBkYSxcbiAgICAgICAgICAgICAgICBkeW5DYWxsX3ZpaWk6IGRiLFxuICAgICAgICAgICAgICAgIGR5bkNhbGxfdjogZGMsXG4gICAgICAgICAgICAgICAgZHluQ2FsbF9paWk6IGRkXG4gICAgICAgICAgICB9O1xuICAgICAgICB9KShcbiAgICAgICAgICAgIC8vIEVNU0NSSVBURU5fRU5EX0FTTVxuXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgTWF0aDogTWF0aCxcbiAgICAgICAgICAgICAgICBJbnQ4QXJyYXk6IEludDhBcnJheSxcbiAgICAgICAgICAgICAgICBJbnQxNkFycmF5OiBJbnQxNkFycmF5LFxuICAgICAgICAgICAgICAgIEludDMyQXJyYXk6IEludDMyQXJyYXksXG4gICAgICAgICAgICAgICAgVWludDhBcnJheTogVWludDhBcnJheSxcbiAgICAgICAgICAgICAgICBVaW50MTZBcnJheTogVWludDE2QXJyYXksXG4gICAgICAgICAgICAgICAgVWludDMyQXJyYXk6IFVpbnQzMkFycmF5LFxuICAgICAgICAgICAgICAgIEZsb2F0MzJBcnJheTogRmxvYXQzMkFycmF5LFxuICAgICAgICAgICAgICAgIEZsb2F0NjRBcnJheTogRmxvYXQ2NEFycmF5XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGFib3J0OiBhYm9ydCxcbiAgICAgICAgICAgICAgICBhc3NlcnQ6IGFzc2VydCxcbiAgICAgICAgICAgICAgICBhc21QcmludEludDogYXNtUHJpbnRJbnQsXG4gICAgICAgICAgICAgICAgYXNtUHJpbnRGbG9hdDogYXNtUHJpbnRGbG9hdCxcbiAgICAgICAgICAgICAgICBtaW46IE1hdGhfbWluLFxuICAgICAgICAgICAgICAgIGludm9rZV9paTogaW52b2tlX2lpLFxuICAgICAgICAgICAgICAgIGludm9rZV92aTogaW52b2tlX3ZpLFxuICAgICAgICAgICAgICAgIGludm9rZV9paWlpaTogaW52b2tlX2lpaWlpLFxuICAgICAgICAgICAgICAgIGludm9rZV92aWlpOiBpbnZva2VfdmlpaSxcbiAgICAgICAgICAgICAgICBpbnZva2VfdjogaW52b2tlX3YsXG4gICAgICAgICAgICAgICAgaW52b2tlX2lpaTogaW52b2tlX2lpaSxcbiAgICAgICAgICAgICAgICBfc3RybmNtcDogX3N0cm5jbXAsXG4gICAgICAgICAgICAgICAgX2xzZWVrOiBfbHNlZWssXG4gICAgICAgICAgICAgICAgX3N5c2NvbmY6IF9zeXNjb25mLFxuICAgICAgICAgICAgICAgIF9mcmVhZDogX2ZyZWFkLFxuICAgICAgICAgICAgICAgIF9mY2xvc2U6IF9mY2xvc2UsXG4gICAgICAgICAgICAgICAgX3N0cnRva19yOiBfc3RydG9rX3IsXG4gICAgICAgICAgICAgICAgX2Fib3J0OiBfYWJvcnQsXG4gICAgICAgICAgICAgICAgX2ZwcmludGY6IF9mcHJpbnRmLFxuICAgICAgICAgICAgICAgIF9jbG9zZTogX2Nsb3NlLFxuICAgICAgICAgICAgICAgIF9wcmVhZDogX3ByZWFkLFxuICAgICAgICAgICAgICAgIF9mZmx1c2g6IF9mZmx1c2gsXG4gICAgICAgICAgICAgICAgX2ZvcGVuOiBfZm9wZW4sXG4gICAgICAgICAgICAgICAgX29wZW46IF9vcGVuLFxuICAgICAgICAgICAgICAgIF9zdHJ0b2w6IF9zdHJ0b2wsXG4gICAgICAgICAgICAgICAgX3N0cnRvazogX3N0cnRvayxcbiAgICAgICAgICAgICAgICBfX19zZXRFcnJObzogX19fc2V0RXJyTm8sXG4gICAgICAgICAgICAgICAgX19yZWFsbHlOZWdhdGl2ZTogX19yZWFsbHlOZWdhdGl2ZSxcbiAgICAgICAgICAgICAgICBfZnNlZWs6IF9mc2VlayxcbiAgICAgICAgICAgICAgICBfc2VuZDogX3NlbmQsXG4gICAgICAgICAgICAgICAgX3dyaXRlOiBfd3JpdGUsXG4gICAgICAgICAgICAgICAgX3N0cnJjaHI6IF9zdHJyY2hyLFxuICAgICAgICAgICAgICAgIF9zaW46IF9zaW4sXG4gICAgICAgICAgICAgICAgX3ByaW50ZjogX3ByaW50ZixcbiAgICAgICAgICAgICAgICBfc3RyY2hyOiBfc3RyY2hyLFxuICAgICAgICAgICAgICAgIF9yZWFkOiBfcmVhZCxcbiAgICAgICAgICAgICAgICBfdGltZTogX3RpbWUsXG4gICAgICAgICAgICAgICAgX19mb3JtYXRTdHJpbmc6IF9fZm9ybWF0U3RyaW5nLFxuICAgICAgICAgICAgICAgIF9hdG9pOiBfYXRvaSxcbiAgICAgICAgICAgICAgICBfcmVjdjogX3JlY3YsXG4gICAgICAgICAgICAgICAgX3B3cml0ZTogX3B3cml0ZSxcbiAgICAgICAgICAgICAgICBfbGx2bV9wb3dfZjY0OiBfbGx2bV9wb3dfZjY0LFxuICAgICAgICAgICAgICAgIF9mc3luYzogX2ZzeW5jLFxuICAgICAgICAgICAgICAgIF9fX2Vycm5vX2xvY2F0aW9uOiBfX19lcnJub19sb2NhdGlvbixcbiAgICAgICAgICAgICAgICBfaXNzcGFjZTogX2lzc3BhY2UsXG4gICAgICAgICAgICAgICAgX3Nicms6IF9zYnJrLFxuICAgICAgICAgICAgICAgIF9fcGFyc2VJbnQ6IF9fcGFyc2VJbnQsXG4gICAgICAgICAgICAgICAgX2Z3cml0ZTogX2Z3cml0ZSxcbiAgICAgICAgICAgICAgICBfc3RyY21wOiBfc3RyY21wLFxuICAgICAgICAgICAgICAgIFNUQUNLVE9QOiBTVEFDS1RPUCxcbiAgICAgICAgICAgICAgICBTVEFDS19NQVg6IFNUQUNLX01BWCxcbiAgICAgICAgICAgICAgICB0ZW1wRG91YmxlUHRyOiB0ZW1wRG91YmxlUHRyLFxuICAgICAgICAgICAgICAgIEFCT1JUOiBBQk9SVCxcbiAgICAgICAgICAgICAgICBOYU46IE5hTixcbiAgICAgICAgICAgICAgICBJbmZpbml0eTogSW5maW5pdHksXG4gICAgICAgICAgICAgICAgX3N0ZGVycjogX3N0ZGVyclxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGJ1ZmZlclxuICAgICAgICApO1xuICAgICAgICB2YXIgX3N0cmxlbiA9IChNb2R1bGVbJ19zdHJsZW4nXSA9IGFzbVsnX3N0cmxlbiddKTtcbiAgICAgICAgdmFyIF9zdHJjYXQgPSAoTW9kdWxlWydfc3RyY2F0J10gPSBhc21bJ19zdHJjYXQnXSk7XG4gICAgICAgIHZhciBfbWlkX2NyZWF0ZV9vcHRpb25zID0gKE1vZHVsZVsnX21pZF9jcmVhdGVfb3B0aW9ucyddID1cbiAgICAgICAgICAgIGFzbVsnX21pZF9jcmVhdGVfb3B0aW9ucyddKTtcbiAgICAgICAgdmFyIF9taWRfaXN0cmVhbV9vcGVuX21lbSA9IChNb2R1bGVbJ19taWRfaXN0cmVhbV9vcGVuX21lbSddID1cbiAgICAgICAgICAgIGFzbVsnX21pZF9pc3RyZWFtX29wZW5fbWVtJ10pO1xuICAgICAgICB2YXIgX21pZF9pc3RyZWFtX29wZW5fZmlsZSA9IChNb2R1bGVbJ19taWRfaXN0cmVhbV9vcGVuX2ZpbGUnXSA9XG4gICAgICAgICAgICBhc21bJ19taWRfaXN0cmVhbV9vcGVuX2ZpbGUnXSk7XG4gICAgICAgIHZhciBfbWlkX3NvbmdfcmVhZF93YXZlID0gKE1vZHVsZVsnX21pZF9zb25nX3JlYWRfd2F2ZSddID1cbiAgICAgICAgICAgIGFzbVsnX21pZF9zb25nX3JlYWRfd2F2ZSddKTtcbiAgICAgICAgdmFyIF9taWRfZXhpdCA9IChNb2R1bGVbJ19taWRfZXhpdCddID0gYXNtWydfbWlkX2V4aXQnXSk7XG4gICAgICAgIHZhciBfbWlkX3Nvbmdfbm90ZV9vbiA9IChNb2R1bGVbJ19taWRfc29uZ19ub3RlX29uJ10gPVxuICAgICAgICAgICAgYXNtWydfbWlkX3Nvbmdfbm90ZV9vbiddKTtcbiAgICAgICAgdmFyIF9zdHJuY3B5ID0gKE1vZHVsZVsnX3N0cm5jcHknXSA9IGFzbVsnX3N0cm5jcHknXSk7XG4gICAgICAgIHZhciBfbWVtc2V0ID0gKE1vZHVsZVsnX21lbXNldCddID0gYXNtWydfbWVtc2V0J10pO1xuICAgICAgICB2YXIgX21lbWNweSA9IChNb2R1bGVbJ19tZW1jcHknXSA9IGFzbVsnX21lbWNweSddKTtcbiAgICAgICAgdmFyIF9taWRfc29uZ19nZXRfbWlzc2luZ19pbnN0cnVtZW50ID0gKE1vZHVsZVtcbiAgICAgICAgICAgICdfbWlkX3NvbmdfZ2V0X21pc3NpbmdfaW5zdHJ1bWVudCdcbiAgICAgICAgXSA9IGFzbVsnX21pZF9zb25nX2dldF9taXNzaW5nX2luc3RydW1lbnQnXSk7XG4gICAgICAgIHZhciBfbWlkX2lzdHJlYW1fY2xvc2UgPSAoTW9kdWxlWydfbWlkX2lzdHJlYW1fY2xvc2UnXSA9XG4gICAgICAgICAgICBhc21bJ19taWRfaXN0cmVhbV9jbG9zZSddKTtcbiAgICAgICAgdmFyIF9taWRfc29uZ19mcmVlID0gKE1vZHVsZVsnX21pZF9zb25nX2ZyZWUnXSA9IGFzbVsnX21pZF9zb25nX2ZyZWUnXSk7XG4gICAgICAgIHZhciBfbWlkX2luaXQgPSAoTW9kdWxlWydfbWlkX2luaXQnXSA9IGFzbVsnX21pZF9pbml0J10pO1xuICAgICAgICB2YXIgX21pZF9zb25nX2xvYWQgPSAoTW9kdWxlWydfbWlkX3NvbmdfbG9hZCddID0gYXNtWydfbWlkX3NvbmdfbG9hZCddKTtcbiAgICAgICAgdmFyIF9taWRfc29uZ19zdGFydCA9IChNb2R1bGVbJ19taWRfc29uZ19zdGFydCddID1cbiAgICAgICAgICAgIGFzbVsnX21pZF9zb25nX3N0YXJ0J10pO1xuICAgICAgICB2YXIgX21pZF9zb25nX2dldF9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E1vZHVsZS5jYWxsTWFpbiA9IGZ1bmN0aW9uIGNhbGxNYWluKGFyZ3MpIHtcbiAgICAgICAgICAgIGFzc2VydChcbiAgICAgICAgICAgICAgICBydW5EZXBlbmRlbmNpZXMgPT0gMCxcbiAgICAgICAgICAgICAgICAnY2Fubm90IGNhbGwgbWFpbiB3aGVuIGFzeW5jIGRlcGVuZGVuY2llcyByZW1haW4hIChsaXN0ZW4gb24gX19BVE1BSU5fXyknXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgYXNzZXJ0KFxuICAgICAgICAgICAgICAgIF9fQVRQUkVSVU5fXy5sZW5ndGggPT0gMCxcbiAgICAgICAgICAgICAgICAnY2Fubm90IGNhbGwgbWFpbiB3aGVuIHByZVJ1biBmdW5jdGlvbnMgcmVtYWluIHRvIGJlIGNhbGxlZCdcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBhcmdzID0gYXJncyB8fCBbXTtcbiAgICAgICAgICAgIGlmIChwcmVsb2FkU3RhcnRUaW1lICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgICAgICAgICAgICAncHJlbG9hZCB0aW1lOiAnICsgKERhdGUubm93KCkgLSBwcmVsb2FkU3RhcnRUaW1lKSArICcgbXMnXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVuc3VyZUluaXRSdW50aW1lKCk7XG4gICAgICAgICAgICB2YXIgYXJnYyA9IGFyZ3MubGVuZ3RoICsgMTtcbiAgICAgICAgICAgIGZ1bmN0aW9uIHBhZCgpIHtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDQgLSAxOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgYXJndi5wdXNoKDApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBhcmd2ID0gW1xuICAgICAgICAgICAgICAgIGFsbG9jYXRlKFxuICAgICAgICAgICAgICAgICAgICBpbnRBcnJheUZyb21TdHJpbmcoJy9iaW4vdGhpcy5wcm9ncmFtJyksXG4gICAgICAgICAgICAgICAgICAgICdpOCcsXG4gICAgICAgICAgICAgICAgICAgIEFMTE9DX05PUk1BTFxuICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgIF07XG4gICAgICAgICAgICBwYWQoKTtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXJnYyAtIDE7IGkgPSBpICsgMSkge1xuICAgICAgICAgICAgICAgIGFyZ3YucHVzaChcbiAgICAgICAgICAgICAgICAgICAgYWxsb2NhdGUoaW50QXJyYXlGcm9tU3RyaW5nKGFyZ3NbaV0pLCAnaTgnLCBBTExPQ19OT1JNQUwpXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICBwYWQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGFyZ3YucHVzaCgwKTtcbiAgICAgICAgICAgIGFyZ3YgPSBhbGxvY2F0ZShhcmd2LCAnaTMyJywgQUxMT0NfTk9STUFMKTtcbiAgICAgICAgICAgIGluaXRpYWxTdGFja1RvcCA9IFNUQUNLVE9QO1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICB2YXIgcmV0ID0gTW9kdWxlWydfbWFpbiddKGFyZ2MsIGFyZ3YsIDApO1xuICAgICAgICAgICAgICAgIC8vIGlmIHdlJ3JlIG5vdCBydW5uaW5nIGFuIGV2ZW50ZWQgbWFpbiBsb29wLCBpdCdzIHRpbWUgdG8gZXhpdFxuICAgICAgICAgICAgICAgIGlmICghTW9kdWxlWydub0V4aXRSdW50aW1lJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgZXhpdChyZXQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICBpZiAoZSBpbnN0YW5jZW9mIEV4aXRTdGF0dXMpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gZXhpdCgpIHRocm93cyB0aGlzIG9uY2UgaXQncyBkb25lIHRvIG1ha2Ugc3VyZSBleGVjdXRpb25cbiAgICAgICAgICAgICAgICAgICAgLy8gaGFzIGJlZW4gc3RvcHBlZCBjb21wbGV0ZWx5XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGUgPT0gJ1NpbXVsYXRlSW5maW5pdGVMb29wJykge1xuICAgICAgICAgICAgICAgICAgICAvLyBydW5uaW5nIGFuIGV2ZW50ZWQgbWFpbiBsb29wLCBkb24ndCBpbW1lZGlhdGVseSBleGl0XG4gICAgICAgICAgICAgICAgICAgIE1vZHVsZVsnbm9FeGl0UnVudGltZSddID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIGZ1bmN0aW9uIHJ1bihhcmdzKSB7XG4gICAgICAgICAgICBhcmdzID0gYXJncyB8fCBNb2R1bGVbJ2FyZ3VtZW50cyddO1xuICAgICAgICAgICAgaWYgKHByZWxvYWRTdGFydFRpbWUgPT09IG51bGwpIHByZWxvYWRTdGFydFRpbWUgPSBEYXRlLm5vdygpO1xuICAgICAgICAgICAgaWYgKHJ1bkRlcGVuZGVuY2llcyA+IDApIHtcbiAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgICAgICAgICAgICdydW4oKSBjYWxsZWQsIGJ1dCBkZXBlbmRlbmNpZXMgcmVtYWluLCBzbyBub3QgcnVubmluZydcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIHJldHVybiBGUztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHByZVJ1bigpO1xuICAgICAgICAgICAgaWYgKHJ1bkRlcGVuZGVuY2llcyA+IDApIHtcbiAgICAgICAgICAgICAgICAvLyBhIHByZVJ1biBhZGRlZCBhIGRlcGVuZGVuY3ksIHJ1biB3aWxsIGJlIGNhbGxlZCBsYXRlclxuICAgICAgICAgICAgICAgIHJldHVybiBGUztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIGRvUnVuKCkge1xuICAgICAgICAgICAgICAgIGVuc3VyZUluaXRSdW50aW1lKCk7XG4gICAgICAgICAgICAgICAgcHJlTWFpbigpO1xuICAgICAgICAgICAgICAgIGNhbGxlZFJ1biA9IHRydWU7XG4gICAgICAgICAgICAgICAgaWYgKE1vZHVsZVsnX21haW4nXSAmJiBzaG91bGRSdW5Ob3cpIHtcbiAgICAgICAgICAgICAgICAgICAgTW9kdWxlWydjYWxsTWFpbiddKGFyZ3MpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBwb3N0UnVuKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoTW9kdWxlWydzZXRTdGF0dXMnXSkge1xuICAgICAgICAgICAgICAgIE1vZHVsZVsnc2V0U3RhdHVzJ10oJ1J1bm5pbmcuLi4nKTtcbiAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgTW9kdWxlWydzZXRTdGF0dXMnXSgnJyk7XG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIUFCT1JUKSBkb1J1bigpO1xuICAgICAgICAgICAgICAgIH0sIDEpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBkb1J1bigpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gRlM7XG4gICAgICAgIH1cblxuICAgICAgICBNb2R1bGUucnVuID0gcnVuO1xuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBJbml0aWFsaXplcyB0aGUgbGlicmFyeS5cbiAgICAgICAgICogQGZ1bmN0aW9uIGluaXRcbiAgICAgICAgICogQG1lbWJlcm9mIExpYlRpTWlkaXR5XG4gICAgICAgICAqIEBwYXJhbSB7Ym9vbGVhbn0gW3Rocm93RXJyb3IgPSB0cnVlXSBUaHJvdyBhbiBlcnJvciBpZiBmaWxlL2ZvbGRlciBjcmVhdGlvbiBmYWlsZWQuXG4gICAgICAgICAqIEBpbnN0YW5jZVxuICAgICAgICAgKi9cbiAgICAgICAgTW9kdWxlLmluaXQgPSBmdW5jdGlvbih0aHJvd0Vycm9yID0gdHJ1ZSkge1xuICAgICAgICAgICAgLy8gY3JlYXRlcyBmb2xkZXJzIGZvciBpbnN0cnVtZW50IHBhdGNoZXNcbiAgICAgICAgICAgIE1vZHVsZS5jcmVhdGVQYXRoKCcvJywgTElCVElNSURJVFlfUEFUQ0hfRElSRUNUT1JZLCB0aHJvd0Vycm9yKTtcbiAgICAgICAgICAgIE1vZHVsZS5jcmVhdGVQYXRoKFxuICAgICAgICAgICAgICAgIGAvJHtMSUJUSU1JRElUWV9QQVRDSF9ESVJFQ1RPUll9YCxcbiAgICAgICAgICAgICAgICBMSUJUSU1JRElUWV9QQVRDSF9EUlVNX0RJUkVDVE9SWSxcbiAgICAgICAgICAgICAgICB0aHJvd0Vycm9yXG4gICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAvLyBjcmVhdGVzIGNvbmZpZyBmaWxlXG4gICAgICAgICAgICBNb2R1bGUuY3JlYXRlRGF0YUZpbGUoXG4gICAgICAgICAgICAgICAgJy8nLFxuICAgICAgICAgICAgICAgIExJQlRJTUlESVRZX0NPTkZJR19GSUxFLFxuICAgICAgICAgICAgICAgIExJQlRJTUlESVRZX0NPTkZJR19EQVRBLFxuICAgICAgICAgICAgICAgIHRydWUsXG4gICAgICAgICAgICAgICAgdH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0FBS0E7QUFDQTtBQW1CQTtBQUNBO0FBQ0E7QUFvQkE7QUFxREE7QUFJQTtBQVdBO0FBSUE7QUEyRUE7QUEwREE7QUFJQTtBQUlBO0FBMkdBO0FBMjBCQTtBQUlBO0FBbStWQTtBQXVFQTtBQTRIQTtBQUlBO0FBdUJBO0FBRUE7QUE0Q0E7QUFNQTtBQUNBO0FBR0E7QUFvQkE7Ozs7OztBQW1DQTtBQUVBO0FBUUE7QUFhQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///1\n")},function(module,exports){eval("function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS9oZWxwZXJzL2RlZmluZVByb3BlcnR5LmpzPzk1MjMiXSwic291cmNlc0NvbnRlbnQiOlsiZnVuY3Rpb24gX2RlZmluZVByb3BlcnR5KG9iaiwga2V5LCB2YWx1ZSkge1xuICBpZiAoa2V5IGluIG9iaikge1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShvYmosIGtleSwge1xuICAgICAgdmFsdWU6IHZhbHVlLFxuICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZSxcbiAgICAgIHdyaXRhYmxlOiB0cnVlXG4gICAgfSk7XG4gIH0gZWxzZSB7XG4gICAgb2JqW2tleV0gPSB2YWx1ZTtcbiAgfVxuXG4gIHJldHVybiBvYmo7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gX2RlZmluZVByb3BlcnR5OyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///2\n")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(9);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS9yZWdlbmVyYXRvci9pbmRleC5qcz9hMzRhIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZShcInJlZ2VuZXJhdG9yLXJ1bnRpbWVcIik7XG4iXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///3\n")},function(module,exports){eval('function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError("Cannot call a class as a function");\n }\n}\n\nmodule.exports = _classCallCheck;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS9oZWxwZXJzL2NsYXNzQ2FsbENoZWNrLmpzPzk3MGIiXSwic291cmNlc0NvbnRlbnQiOlsiZnVuY3Rpb24gX2NsYXNzQ2FsbENoZWNrKGluc3RhbmNlLCBDb25zdHJ1Y3Rvcikge1xuICBpZiAoIShpbnN0YW5jZSBpbnN0YW5jZW9mIENvbnN0cnVjdG9yKSkge1xuICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJDYW5ub3QgY2FsbCBhIGNsYXNzIGFzIGEgZnVuY3Rpb25cIik7XG4gIH1cbn1cblxubW9kdWxlLmV4cG9ydHMgPSBfY2xhc3NDYWxsQ2hlY2s7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///4\n')},function(module,exports){eval('function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nmodule.exports = _asyncToGenerator;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS9oZWxwZXJzL2FzeW5jVG9HZW5lcmF0b3IuanM/Yzk3MyJdLCJzb3VyY2VzQ29udGVudCI6WyJmdW5jdGlvbiBhc3luY0dlbmVyYXRvclN0ZXAoZ2VuLCByZXNvbHZlLCByZWplY3QsIF9uZXh0LCBfdGhyb3csIGtleSwgYXJnKSB7XG4gIHRyeSB7XG4gICAgdmFyIGluZm8gPSBnZW5ba2V5XShhcmcpO1xuICAgIHZhciB2YWx1ZSA9IGluZm8udmFsdWU7XG4gIH0gY2F0Y2ggK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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///5\n')},function(module,exports){eval('function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ("value" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS9oZWxwZXJzL2NyZWF0ZUNsYXNzLmpzPzViYzMiXSwic291cmNlc0NvbnRlbnQiOlsiZnVuY3Rpb24gX2RlZmluZVByb3BlcnRpZXModGFyZ2V0LCBwcm9wcykge1xuICBmb3IgKHZhciBpID0gMDsgaSA8IHByb3BzLmxlbmd0aDsgaSsrKSB7XG4gICAgdmFyIGRlc2NyaXB0b3IgPSBwcm9wc1tpXTtcbiAgICBkZXNjcmlwdG9yLmVudW1lcmFibGUgPSBkZXNjcmlwdG9yLmVudW1lcmFibGUgfHwgZmFsc2U7XG4gICAgZGVzY3JpcHRvci5jb25maWd1cmFibGUgPSB0cnVlO1xuICAgIGlmIChcInZhbHVlXCIgaW4gZGVzY3JpcHRvcikgZGVzY3JpcHRvci53cml0YWJsZSA9IHRydWU7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHRhcmdldCwgZGVzY3JpcHRvci5rZXksIGRlc2NyaXB0b3IpO1xuICB9XG59XG5cbmZ1bmN0aW9uIF9jcmVhdGVDbGFzcyhDb25zdHJ1Y3RvciwgcHJvdG9Qcm9wcywgc3RhdGljUHJvcHMpIHtcbiAgaWYgKHByb3RvUHJvcHMpIF9kZWZpbmVQcm9wZXJ0aWVzKENvbnN0cnVjdG9yLnByb3RvdHlwZSwgcHJvdG9Qcm9wcyk7XG4gIGlmIChzdGF0aWNQcm9wcykgX2RlZmluZVByb3BlcnRpZXMoQ29uc3RydWN0b3IsIHN0YXRpY1Byb3BzKTtcbiAgcmV0dXJuIENvbnN0cnVjdG9yO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IF9jcmVhdGVDbGFzczsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///6\n')},function(module,exports){eval('function _typeof(obj) {\n "@babel/helpers - typeof";\n\n if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL25vZGVfbW9kdWxlcy9AYmFiZWwvcnVudGltZS9oZWxwZXJzL3R5cGVvZi5qcz83MDM3Il0sInNvdXJjZXNDb250ZW50IjpbImZ1bmN0aW9uIF90eXBlb2Yob2JqKSB7XG4gIFwiQGJhYmVsL2hlbHBlcnMgLSB0eXBlb2ZcIjtcblxuICBpZiAodHlwZW9mIFN5bWJvbCA9PT0gXCJmdW5jdGlvblwiICYmIHR5cGVvZiBTeW1ib2wuaXRlcmF0b3IgPT09IFwic3ltYm9sXCIpIHtcbiAgICBtb2R1bGUuZXhwb3J0cyA9IF90eXBlb2YgPSBmdW5jdGlvbiBfdHlwZW9mKG9iaikge1xuICAgICAgcmV0dXJuIHR5cGVvZiBvYmo7XG4gICAgfTtcbiAgfSBlbHNlIHtcbiAgICBtb2R1bGUuZXhwb3J0cyA9IF90eXBlb2YgPSBmdW5jdGlvbiBfdHlwZW9mKG9iaikge1xuICAgICAgcmV0dXJuIG9iaiAmJiB0eXBlb2YgU3ltYm9sID09PSBcImZ1bmN0aW9uXCIgJiYgb2JqLmNvbnN0cnVjdG9yID09PSBTeW1ib2wgJiYgb2JqICE9PSBTeW1ib2wucHJvdG90eXBlID8gXCJzeW1ib2xcIiA6IHR5cGVvZiBvYmo7XG4gICAgfTtcbiAgfVxuXG4gIHJldHVybiBfdHlwZW9mKG9iaik7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gX3R5cGVvZjsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///7\n')},function(module,exports,__webpack_require__){eval("var rng = __webpack_require__(10);\nvar bytesToUuid = __webpack_require__(11);\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL25vZGVfbW9kdWxlcy91dWlkL3Y0LmpzP2M2NGUiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHJuZyA9IHJlcXVpcmUoJy4vbGliL3JuZycpO1xudmFyIGJ5dGVzVG9VdWlkID0gcmVxdWlyZSgnLi9saWIvYnl0ZXNUb1V1aWQnKTtcblxuZnVuY3Rpb24gdjQob3B0aW9ucywgYnVmLCBvZmZzZXQpIHtcbiAgdmFyIGkgPSBidWYgJiYgb2Zmc2V0IHx8IDA7XG5cbiAgaWYgKHR5cGVvZihvcHRpb25zKSA9PSAnc3RyaW5nJykge1xuICAgIGJ1ZiA9IG9wdGlvbnMgPT09ICdiaW5hcnknID8gbmV3IEFycmF5KDE2KSA6IG51bGw7XG4gICAgb3B0aW9ucyA9IG51bGw7XG4gIH1cbiAgb3B0aW9ucyA9IG9wdGlvbnMgfHwge307XG5cbiAgdmFyIHJuZHMgPSBvcHRpb25zLnJhbmRvbSB8fCAob3B0aW9ucy5ybmcgfHwgcm5nKSgpO1xuXG4gIC8vIFBlciA0LjQsIHNldCBiaXRzIGZvciB2ZXJzaW9uIGFuZCBgY2xvY2tfc2VxX2hpX2FuZF9yZXNlcnZlZGBcbiAgcm5kc1s2XSA9IChybmRzWzZdICYgMHgwZikgfCAweDQwO1xuICBybmRzWzhdID0gKHJuZHNbOF0gJiAweDNmKSB8IDB4ODA7XG5cbiAgLy8gQ29weSBieXRlcyB0byBidWZmZXIsIGlmIHByb3ZpZGVkXG4gIGlmIChidWYpIHtcbiAgICBmb3IgKHZhciBpaSA9IDA7IGlpIDwgMTY7ICsraWkpIHtcbiAgICAgIGJ1ZltpICsgaWldID0gcm5kc1tpaV07XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIGJ1ZiB8fCBieXRlc1RvVXVpZChybmRzKTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSB2NDtcbiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///8\n")},function(module,exports,__webpack_require__){eval('/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n "use strict";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === "function" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || "@@iterator";\n var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";\n var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there\'s no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don\'t have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: "normal", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: "throw", arg: err };\n }\n }\n\n var GenStateSuspendedStart = "suspendedStart";\n var GenStateSuspendedYield = "suspendedYield";\n var GenStateExecuting = "executing";\n var GenStateCompleted = "completed";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don\'t natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = "GeneratorFunction";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n ["next", "throw", "return"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === "function" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === "GeneratorFunction"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = "GeneratorFunction";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, "__await")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === "throw") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === "object" &&\n hasOwn.call(value, "__await")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke("next", value, resolve, reject);\n }, function(err) {\n invoke("throw", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke("throw", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error("Generator is already running");\n }\n\n if (state === GenStateCompleted) {\n if (method === "throw") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === "next") {\n // Setting context._sent for legacy support of Babel\'s\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === "throw") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === "return") {\n context.abrupt("return", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === "normal") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === "throw") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = "throw";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === "throw") {\n // Note: ["return"] must be used for ES3 parsing compatibility.\n if (delegate.iterator["return"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = "return";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === "throw") {\n // If maybeInvokeDelegate(context) changed context.method from\n // "return" to "throw", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = "throw";\n context.arg = new TypeError(\n "The iterator does not provide a \'throw\' method");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === "throw") {\n context.method = "throw";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = "throw";\n context.arg = new TypeError("iterator result is not an object");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was "throw" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was "next", forget context.arg since it has been\n // "consumed" by the delegate iterator. If context.method was\n // "return", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== "return") {\n context.method = "next";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = "Generator";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers\' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn\'t happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return "[object Generator]";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = "normal";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: "root" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === "function") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel\'s\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = "next";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === "t" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === "throw") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = "throw";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = "next";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === "root") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle("end");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, "catchLoc");\n var hasFinally = hasOwn.call(entry, "finallyLoc");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error("try statement without catch or finally");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, "finallyLoc") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === "break" ||\n type === "continue") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = "next";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === "throw") {\n throw record.arg;\n }\n\n if (record.type === "break" ||\n record.type === "continue") {\n this.next = record.arg;\n } else if (record.type === "return") {\n this.rval = this.arg = record.arg;\n this.method = "return";\n this.next = "end";\n } else if (record.type === "normal" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n "catch": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === "throw") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error("illegal catch attempt");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === "next") {\n // Deliberately forget the last sent value so that we don\'t\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n true ? module.exports : undefined\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you\'ve misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you\'re not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function("r", "regeneratorRuntime = r")(runtime);\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL25vZGVfbW9kdWxlcy9yZWdlbmVyYXRvci1ydW50aW1lL3J1bnRpbWUuanM/OTZjZiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAoYykgMjAxNC1wcmVzZW50LCBGYWNlYm9vaywgSW5jLlxuICpcbiAqIFRoaXMgc291cmNlIGNvZGUgaXMgbGljZW5zZWQgdW5kZXIgdGhlIE1JVCBsaWNlbnNlIGZvdW5kIGluIHRoZVxuICogTElDRU5TRSBmaWxlIGluIHRoZSByb290IGRpcmVjdG9yeSBvZiB0aGlzIHNvdXJjZSB0cmVlLlxuICovXG5cbnZhciBydW50aW1lID0gKGZ1bmN0aW9uIChleHBvcnRzKSB7XG4gIFwidXNlIHN0cmljdFwiO1xuXG4gIHZhciBPcCA9IE9iamVjdC5wcm90b3R5cGU7XG4gIHZhciBoYXNPd24gPSBPcC5oYXNPd25Qcm9wZXJ0eTtcbiAgdmFyIHVuZGVmaW5lZDsgLy8gTW9yZSBjb21wcmVzc2libGUgdGhhbiB2b2lkIDAuXG4gIHZhciAkU3ltYm9sID0gdHlwZW9mIFN5bWJvbCA9PT0gXCJmdW5jdGlvblwiID8gU3ltYm9sIDoge307XG4gIHZhciBpdGVyYXRvclN5bWJvbCA9ICRTeW1ib2wuaXRlcmF0b3IgfHwgXCJAQGl0ZXJhdG9yXCI7XG4gIHZhciBhc3luY0l0ZXJhdG9yU3ltYm9sID0gJFN5bWJvbC5hc3luY0l0ZXJhdG9yIHx8IFwiQEBhc3luY0l0ZXJhdG9yXCI7XG4gIHZhciB0b1N0cmluZ1RhZ1N5bWJvbCA9ICRTeW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B9IGVsc2UgaWYgKGNvbnRleHQubWV0aG9kID09PSBcInJldHVyblwiKSB7XG4gICAgICAgICAgY29udGV4dC5hYnJ1cHQoXCJyZXR1cm5cIiwgY29udGV4dC5hcmcpO1xuICAgICAgICB9XG5cbiAgICAgICAgc3RhdGUgPSBHZW5TdGF0ZUV4ZWN1dGluZztcblxuICAgICAgICB2YXIgcmVjb3JkID0gdHJ5Q2F0Y2goaW5uZXJGbiwgc2VsZiwgY29udGV4dCk7XG4gICAgICAgIGlmIChyZWNvcmQudHlwZSA9PT0gXCJub3JtYWxcIikge1xuICAgICAgICAgIC8vIElmIGFuIGV4Y2VwdGlvbiBpcyB0aHJvd24gZnJvbSBpbm5lckZuLCB3ZSBsZWF2ZSBzdGF0ZSA9PT1cbiAgICAgICAgICAvLyBHZW5TdGF0ZUV4ZWN1dGluZyBhbmQgbG9vcCBiYWNrIGZvciBhbm90aGVyIGludm9jYXRpb24uXG4gICAgICAgICAgc3RhdGUgPSBjb250ZXh0LmRvbmVcbiAgICAgICAgICAgID8gR2VuU3RhdGVDb21wbGV0ZWRcbiAgICAgICAgICAgIDogR2VuU3RhdGVTdXNwZW5kZWRZaWVsZDtcblxuICAgICAgICAgIGlmIChyZWNvcmQuYXJnID09PSBDb250aW51ZVNlbnRpbmVsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdmFsdWU6IHJlY29yZC5hcmcsXG4gICAgICAgICAgICBkb25lOiBjb250ZXh0LmRvbmVcbiAgICAgICAgICB9O1xuXG4gICAgICAgIH0gZWxzZSBpZiAocmVjb3JkLnR5cGUgPT09IFwidGhyb3dcIikge1xuICAgICAgICAgIHN0YXRlID0gR2VuU3RhdGVDb21wbGV0ZWQ7XG4gICAgICAgICAgLy8gRGlzcGF0Y2ggdGhlIGV4Y2VwdGlvbiBieSBsb29waW5nIGJhY2sgYXJvdW5kIHRvIHRoZVxuICAgICAgIC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gICByZXR1cm4gaXRlcmFibGU7XG4gICAgICB9XG5cbiAgICAgIGlmICghaXNOYU4oaXRlcmFibGUubGVuZ3RoKSkge1xuICAgICAgICB2YXIgaSA9IC0xLCBuZXh0ID0gZnVuY3Rpb24gbmV4dCgpIHtcbiAgICAgICAgICB3aGlsZSAoKytpIDwgaXRlcmFibGUubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAoaGFzT3duLmNhbGwoaXRlcmFibGUsIGkpKSB7XG4gICAgICAgICAgICAgIG5leHQudmFsdWUgPSBpdGVyYWJsZVtpXTtcbiAgICAgICAgICAgICAgbmV4dC5kb25lID0gZmFsc2U7XG4gICAgICAgICAgICAgIHJldHVybiBuZXh0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIG5leHQudmFsdWUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgbmV4dC5kb25lID0gdHJ1ZTtcblxuICAgICAgICAgIHJldHVybiBuZXh0O1xuICAgICAgICB9O1xuXG4gICAgICAgIHJldHVybiBuZXh0Lm5leHQgPSBuZXh0O1xuICAgICAgfVxuICAgIH1cblxuICAgIC8vIFJldHVybiBhbiBpdGVyYXRvciB3aXRoIG5vIHZhbHVlcy5cbiAgICByZXR1cm4geyBuZXh0OiBkb25lUmVzdWx0IH07XG4gIH1cbiAgZXhwb3J0cy52YWx1ZXMgPSB2YWx1ZXM7XG5cbiAgZnVuY3Rpb24gZG9uZVJlc3VsdCgpIHtcbiAgICByZXR1cm4geyB2YWx1ZTogdW5kZWZpbmVkLCBkb25lOiB0cnVlIH07XG4gIH1cblxuICBDb250ZXh0LnByb3RvdHlwZSA9IHtcbiAgICBjb25zdHJ1Y3RvcjogQ29udGV4dCxcblxuICAgIHJlc2V0OiBmdW5jdGlvbihza2lwVGVtcFJlc2V0KSB7XG4gICAgICB0aGlzLnByZXYgPSAwO1xuICAgICAgdGhpcy5uZXh0ID0gMDtcbiAgICAgIC8vIFJlc2V0dGluZyBjb250ZXh0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Gx5TG9jKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoYW5kbGUoZW50cnkuZmluYWxseUxvYyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwidHJ5IHN0YXRlbWVudCB3aXRob3V0IGNhdGNoIG9yIGZpbmFsbHlcIik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcblxuICAgIGFicnVwdDogZnVuY3Rpb24odHlwZSwgYXJnKSB7XG4gICAgICBmb3IgKHZhciBpID0gdGhpcy50cnlFbnRyaWVzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBlbnRyeSA9IHRoaXMudHJ5RW50cmllc1tpXTtcbiAgICAgICAgaWYgKGVudHJ5LnRyeUxvYyA8PSB0aGlzLnByZXYgJiZcbiAgICAgICAgICAgIGhhc093bi5jYWxsKGVudHJ5LCBcImZpbmFsbHlMb2NcIikgJiZcbiAgICAgICAgICAgIHRoaXMucHJldiA8IGVudHJ5LmZpbmFsbHlMb2MpIHtcbiAgICAgICAgICB2YXIgZmluYWxseUVudHJ5ID0gZW50cnk7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKGZpbmFsbHlFbnRyeSAmJlxuICAgICAgICAgICh0eXBlID09PSBcImJyZWFrXCIgfHxcbiAgICAgICAgICAgdHlwZSA9PT0gXCJjb250aW51ZVwiKSAmJlxuICAgICAgICAgIGZpbmFsbHlFbnRyeS50cnlMb2MgPD0gYXJnICYmXG4gICAgICAgICAgYXJnIDw9IGZpbmFsbHlFbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgIC8vIElnbm9yZSB0aGUgZmluYWxseSBlbnRyeSBpZiBjb250cm9sIGlzIG5vdCBqdW1waW5nIHRvIGFcbiAgICAgICAgLy8gbG9jYXRpb24gb3V0c2lkZSB0aGUgdHJ5L2NhdGNoIGJsb2NrLlxuICAgICAgICBmaW5hbGx5RW50cnkgPSBudWxsO1xuICAgICAgfVxuXG4gICAgICB2YXIgcmVjb3JkID0gZmluYWxseUVudHJ5ID8gZmluYWxseUVudHJ5LmNvbXBsZXRpb24gOiB7fTtcbiAgICAgIHJlY29yZC50eXBlID0gdHlwZTtcbiAgICAgIHJlY29yZC5hcmcgPSBhcmc7XG5cbiAgICAgIGlmIChmaW5hbGx5RW50cnkpIHtcbiAgICAgICAgdGhpcy5tZXRob2QgPSBcIm5leHRcIjtcbiAgICAgICAgdGhpcy5uZXh0ID0gZmluYWxseUVudHJ5LmZpbmFsbHlMb2M7XG4gICAgICAgIHJldHVybiBDb250aW51ZVNlbnRpbmVsO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gdGhpcy5jb21wbGV0ZShyZWNvcmQpO1xuICAgIH0sXG5cbiAgICBjb21wbGV0ZTogZnVuY3Rpb24ocmVjb3JkLCBhZnRlckxvYykge1xuICAgICAgaWYgKHJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgICAgdGhyb3cgcmVjb3JkLmFyZztcbiAgICAgIH1cblxuICAgICAgaWYgKHJlY29yZC50eXBlID09PSBcImJyZWFrXCIgfHxcbiAgICAgICAgICByZWNvcmQudHlwZSA9PT0gXCJjb250aW51ZVwiKSB7XG4gICAgICAgIHRoaXMubmV4dCA9IHJlY29yZC5hcmc7XG4gICAgICB9IGVsc2UgaWYgKHJlY29yZC50eXBlID09PSBcInJldHVyblwiKSB7XG4gICAgICAgIHRoaXMucnZhbCA9IHRoaXMuYXJnID0gcmVjb3JkLmFyZztcbiAgICAgICAgdGhpcy5tZXRob2QgPSBcInJldHVyblwiO1xuICAgICAgICB0aGlzLm5leHQgPSBcImVuZFwiO1xuICAgICAgfSBlbHNlIGlmIChyZWNvcmQudHlwZSA9PT0gXCJub3JtYWxcIiAmJiBhZnRlckxvYykge1xuICAgICAgICB0aGlzLm5leHQgPSBhZnRlckxvYztcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIENvbnRpbnVlU2VudGluZWw7XG4gICAgfSxcblxuICAgIGZpbmlzaDogZnVuY3Rpb24oZmluYWxseUxvYykge1xuICAgICAgZm9yICh2YXIgaSA9IHRoaXMudHJ5RW50cmllcy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICB2YXIgZW50cnkgPSB0aGlzLnRyeUVudHJpZXNbaV07XG4gICAgICAgIGlmIChlbnRyeS5maW5hbGx5TG9jID09PSBmaW5hbGx5TG9jKSB7XG4gICAgICAgICAgdGhpcy5jb21wbGV0ZShlbnRyeS5jb21wbGV0aW9uLCBlbnRyeS5hZnRlckxvYyk7XG4gICAgICAgICAgcmVzZXRUcnlFbnRyeShlbnRyeSk7XG4gICAgICAgICAgcmV0dXJuIENvbnRpbnVlU2VudGluZWw7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuXG4gICAgXCJjYXRjaFwiOiBmdW5jdGlvbih0cnlMb2MpIHtcbiAgICAgIGZvciAodmFyIGkgPSB0aGlzLnRyeUVudHJpZXMubGVuZ3RoIC0gMTsgaSA+PSAwOyAtLWkpIHtcbiAgICAgICAgdmFyIGVudHJ5ID0gdGhpcy50cnlFbnRyaWVzW2ldO1xuICAgICAgICBpZiAoZW50cnkudHJ5TG9jID09PSB0cnlMb2MpIHtcbiAgICAgICAgICB2YXIgcmVjb3JkID0gZW50cnkuY29tcGxldGlvbjtcbiAgICAgICAgICBpZiAocmVjb3JkLnR5cGUgPT09IFwidGhyb3dcIikge1xuICAgICAgICAgICAgdmFyIHRocm93biA9IHJlY29yZC5hcmc7XG4gICAgICAgICAgICByZXNldFRyeUVudHJ5KGVudHJ5KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIHRocm93bjtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvLyBUaGUgY29udGV4dC5jYXRjaCBtZXRob2QgbXVzdCBvbmx5IGJlIGNhbGxlZ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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///9\n')},function(module,exports){eval("// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93ZWItbWlkaS1wbGF5ZXIvLi9ub2RlX21vZHVsZXMvdXVpZC9saWIvcm5nLWJyb3dzZXIuanM/ZTFmNCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBVbmlxdWUgSUQgY3JlYXRpb24gcmVxdWlyZXMgYSBoaWdoIHF1YWxpdHkgcmFuZG9tICMgZ2VuZXJhdG9yLiAgSW4gdGhlXG4vLyBicm93c2VyIHRoaXMgaXMgYSBsaXR0bGUgY29tcGxpY2F0ZWQgZHVlIHRvIHVua25vd24gcXVhbGl0eSBvZiBNYXRoLnJhbmRvbSgpXG4vLyBhbmQgaW5jb25zaXN0ZW50IHN1cHBvcnQgZm9yIHRoZSBgY3J5cHRvYCBBUEkuICBXZSBkbyB0aGUgYmVzdCB3ZSBjYW4gdmlhXG4vLyBmZWF0dXJlLWRldGVjdGlvblxuXG4vLyBnZXRSYW5kb21WYWx1ZXMgbmVlZHMgdG8gYmUgaW52b2tlZCBpbiBhIGNvbnRleHQgd2hlcmUgXCJ0aGlzXCIgaXMgYSBDcnlwdG9cbi8vIGltcGxlbWVudGF0aW9uLiBBbHNvLCBmaW5kIHRoZSBjb21wbGV0ZSBpbXBsZW1lbnRhdGlvbiBvZiBjcnlwdG8gb24gSUUxMS5cbnZhciBnZXRSYW5kb21WYWx1ZXMgPSAodHlwZW9mKGNyeXB0bykgIT0gJ3VuZGVmaW5lZCcgJiYgY3J5cHRvLmdldFJhbmRvbVZhbHVlcyAmJiBjc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blxuICAgIHJldHVybiBybmRzO1xuICB9O1xufVxuIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///10\n")},function(module,exports){eval("/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93ZWItbWlkaS1wbGF5ZXIvLi9ub2RlX21vZHVsZXMvdXVpZC9saWIvYnl0ZXNUb1V1aWQuanM/MjM2NiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvb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FBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///11\n")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(global) {/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n\n\nvar base64 = __webpack_require__(14)\nvar ieee754 = __webpack_require__(15)\nvar isArray = __webpack_require__(16)\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(13)))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93ZWItbWlkaS1wbGF5ZXIvLi9ub2RlX21vZHVsZXMvYnVmZmVyL2luZGV4LmpzP2I2MzkiXSwic291cmNlc0NvbnRlbnQiOlsiLyohXG4gKiBUaGUgYnVmZmVyIG1vZHVsZSBmcm9tIG5vZGUuanMsIGZvciB0aGUgYnJvd3Nlci5cbiAqXG4gKiBAYXV0aG9yIC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BQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///12\n")},function(module,exports){eval('var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function("return this")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === "object") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it\'s\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93ZWItbWlkaS1wbGF5ZXIvKHdlYnBhY2spL2J1aWxkaW4vZ2xvYmFsLmpzP2NkMDAiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGc7XG5cbi8vIFRoaXMgd29ya3MgaW4gbm9uLXN0cmljdCBtb2RlXG5nID0gKGZ1bmN0aW9uKCkge1xuXHRyZXR1cm4gdGhpcztcbn0pKCk7XG5cbnRyeSB7XG5cdC8vIFRoaXMgd29ya3MgaWYgZXZhbCBpcyBhbGxvd2VkIChzZWUgQ1NQKVxuXHRnID0gZyB8fCBuZXcgRnVuY3Rpb24oXCJyZXR1cm4gdGhpc1wiKSgpO1xufSBjYXRjaCAoZSkge1xuXHQvLyBUaGlzIHdvcmtzIGlmIHRoZSB3aW5kb3cgcmVmZXJlbmNlIGlzIGF2YWlsYWJsZVxuXHRpZiAodHlwZW9mIHdpbmRvdyA9PT0gXCJvYmplY3RcIikgZyA9IHdpbmRvdztcbn1cblxuLy8gZyBjYW4gc3RpbGwgYmUgdW5kZWZpbmVkLCBidXQgbm90aGluZyB0byBkbyBhYm91dCBpdC4uLlxuLy8gV2UgcmV0dXJuIHVuZGVmaW5lZCwgaW5zdGVhZCBvZiBub3RoaW5nIGhlcmUsIHNvIGl0J3Ncbi8vIGVhc2llciB0byBoYW5kbGUgdGhpcyBjYXNlLiBpZighZ2xvYmFsKSB7IC4uLn1cblxubW9kdWxlLmV4cG9ydHMgPSBnO1xuIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///13\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93ZWItbWlkaS1wbGF5ZXIvLi9ub2RlX21vZHVsZXMvYmFzZTY0LWpzL2luZ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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///14\n")},function(module,exports){eval("exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93ZWItbWlkaS1wbGF5ZXIvLi9ub2RlX21vZHVsZXMvaWVlZTc1NC9pbmRleC5qcz85MTUyIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydHMucmVhZCA9IGZ1bmN0aW9uIChidWZmZXIsIG9mZnNldCwgaXNMRSwgbUxlbiwgbkJ5dGVzKSB7XG4gIHZhciBlLCBtXG4gIHZhciBlTGVuID0gKG5CeXRlcyAqIDgpIC0gbUxlbiAtIDFcbiAgdmFyIGVNYXggPSAoMSA8PCBlTGVuKSAtIDFcbiAgdmFyIGVCaWFzID0gZU1heCA+PiAxXG4gIHZhciBuQml0cyA9IC03XG4gIHZhciBpID0gaXNMRSA/IChuQnl0ZXMgLSAxKSA6IDBcbiAgdmFyIGQgPSBpc0xFID8gLTEgOiAxXG4gIHZhciBzID0gYnVmZmVyW29mZnNldCArIGldXG5cbiAgaSArPSBkXG5cbiAgZSA9IHMgJiAoKDEgPDwgKC1uQml0cykpIC0gMSlcbiAgcyA+Pj0gKC1uQml0cylcbiAgbkJpdHMgKz0gZUxlblxuICBmb3IgKDsgbkJpdH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GVuXG4gIGZvciAoOyBlTGVuID4gMDsgYnVmZmVyW29mZnNldCArIGldID0gZSAmIDB4ZmYsIGkgKz0gZCwgZSAvPSAyNTYsIGVMZW4gLT0gOCkge31cblxuICBidWZmZXJbb2Zmc2V0ICsgaSAtIGRdIHw9IHMgKiAxMjhcbn1cbiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///15\n")},function(module,exports){eval("var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93ZWItbWlkaS1wbGF5ZXIvLi9ub2RlX21vZHVsZXMvaXNhcnJheS9pbmRleC5qcz9lM2RiIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB0b1N0cmluZyA9IHt9LnRvU3RyaW5nO1xuXG5tb2R1bGUuZXhwb3J0cyA9IEFycmF5LmlzQXJyYXkgfHwgZnVuY3Rpb24gKGFycikge1xuICByZXR1cm4gdG9TdHJpbmcuY2FsbChhcnIpID09ICdbb2JqZWN0IEFycmF5XSc7XG59O1xuIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///16\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = function() {\n throw new Error(\n 'ws does not work in the browser. Browser clients must use the native ' +\n 'WebSocket object'\n );\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93ZWItbWlkaS1wbGF5ZXIvLi9ub2RlX21vZHVsZXMvd3MvYnJvd3Nlci5qcz83ZjczIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbigpIHtcbiAgdGhyb3cgbmV3IEVycm9yKFxuICAgICd3cyBkb2VzIG5vdCB3b3JrIGluIHRoZSBicm93c2VyLiBCcm93c2VyIGNsaWVudHMgbXVzdCB1c2UgdGhlIG5hdGl2ZSAnICtcbiAgICAgICdXZWJTb2NrZXQgb2JqZWN0J1xuICApO1xufTtcbiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///17\n")},function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n\n// EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js\nvar regenerator = __webpack_require__(3);\nvar regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);\n\n// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js\nvar asyncToGenerator = __webpack_require__(5);\nvar asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);\n\n// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/classCallCheck.js\nvar classCallCheck = __webpack_require__(4);\nvar classCallCheck_default = /*#__PURE__*/__webpack_require__.n(classCallCheck);\n\n// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/createClass.js\nvar createClass = __webpack_require__(6);\nvar createClass_default = /*#__PURE__*/__webpack_require__.n(createClass);\n\n// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js\nvar defineProperty = __webpack_require__(2);\nvar defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);\n\n// EXTERNAL MODULE: ./node_modules/uuid/v4.js\nvar v4 = __webpack_require__(8);\nvar v4_default = /*#__PURE__*/__webpack_require__.n(v4);\n\n// EXTERNAL MODULE: ./src/constants.js\nvar constants = __webpack_require__(0);\n\n// CONCATENATED MODULE: ./src/events.js\nvar MIDI_INIT = 'MIDI_INIT';\nvar MIDI_ERROR = 'MIDI_ERROR';\nvar MIDI_STATUS = 'MIDI_STATUS';\nvar MIDI_PRELOAD = 'MIDI_PRELOAD';\nvar MIDI_LOAD_FILE = 'MIDI_LOAD_FILE';\nvar MIDI_LOAD_PATCH = 'MIDI_LOAD_PATCH';\nvar MIDI_PLAY = 'MIDI_PLAY';\nvar MIDI_PAUSE = 'MIDI_PAUSE';\nvar MIDI_RESUME = 'MIDI_RESUME';\nvar MIDI_STOP = 'MIDI_STOP';\nvar MIDI_END = 'MIDI_END';\n// EXTERNAL MODULE: ./src/LibTiMidity.js\nvar LibTiMidity = __webpack_require__(1);\n\n// CONCATENATED MODULE: ./src/EventHandler.js\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n\n\nvar EventHandler_EventHandler =\n/*#__PURE__*/\nfunction () {\n /**\n * @class EventHandler\n * @param {object} [configuration]\n * @param {string} [configuration.playerId = undefined] The ID of the Midi Player that sends events.\n * @param {function} [configuration.eventLogger = undefined] The function that receives event payloads.\n * @param {boolean} [configuration.logging = false] Turns ON or OFF logging to the console.\n * @return {object} An `EventHandler` instance.\n */\n function EventHandler(_ref) {\n var _this = this;\n\n var _ref$eventLogger = _ref.eventLogger,\n eventLogger = _ref$eventLogger === void 0 ? undefined : _ref$eventLogger,\n _ref$logging = _ref.logging,\n logging = _ref$logging === void 0 ? false : _ref$logging,\n _ref$playerId = _ref.playerId,\n playerId = _ref$playerId === void 0 ? undefined : _ref$playerId;\n\n classCallCheck_default()(this, EventHandler);\n\n defineProperty_default()(this, \"emitEvent\", function (payload) {\n var payloadWithId = _objectSpread({}, payload, {\n playerId: _this.playerId\n });\n\n if (_this.eventLogger) {\n _this.eventLogger(payloadWithId);\n } else if (_this.logging) {\n if (payloadWithId.event === MIDI_ERROR) {\n console.error(payloadWithId);\n } else {\n console.log(payloadWithId);\n }\n }\n });\n\n this.playerId = playerId;\n this.logging = logging;\n this.eventLogger = eventLogger;\n }\n /**\n * Emits an event that indicates that the MIDI player is initialized.\n * @function\n * @param {undefined}\n */\n\n\n createClass_default()(EventHandler, [{\n key: \"emitInit\",\n value: function emitInit() {\n this.emitEvent({\n event: MIDI_INIT,\n message: 'MIDI player initialized.'\n });\n }\n /**\n * Send payloads to the event logger.\n * @function\n * @param {object} payload\n * @param {string} [payload.event] The name of the event.\n * @param {string} [payload.message] A message that described the event.\n */\n\n }]);\n\n return EventHandler;\n}();\n\n\n// CONCATENATED MODULE: ./src/MidiPlayer.js\n\n\n\n\n\n\nfunction MidiPlayer_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction MidiPlayer_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { MidiPlayer_ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { MidiPlayer_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n\n\n\n\n\nvar isFirstInstance = true;\n\nvar MidiPlayer_MidiPlayer =\n/*#__PURE__*/\nfunction () {\n /**\n * @class MidiPlayer\n * @param {object} [configuration]\n * @param {function} [configuration.eventLogger = undefined] The function that receives event payloads.\n * @param {boolean} [configuration.logging = false] Turns ON or OFF logging to the console.\n * @param {string} [configuration.patchUrl = https://cdn.jsdelivr.net/npm/midi-instrument-patches@latest/] The public path where MIDI instrument patches can be found.\n * @param {object} [configuration.audioContext = undefined] An instance of the Web Audio API AudioContext interface.\n * @property {string} playerId ID of this instance of Midi Player.\n * @property {object} context The AudioContext instance.\n * @property {function} eventLogger The function that is called to emit events.\n * @property {boolean} logging Whether console logging is ON or OFF.\n * @property {arrayBuffer} midiFileArray A typed array that represents the content of the MIDI.\n * @property {*} midiFileBuffer The buffer with the MIDI data.\n * @property {string} patchUrl The URL used to load MIDI instrument patches.\n * @property {object} source The source that plays the audio signal.\n * @property {number} startTime The time when MIDI playback started.\n * @property {number} stream The MIDI stream.\n * @property {*} waveBuffer The buffer with the MIDI data converted to WAV.\n * @property {boolean} isFirstInstance Whether this is the first instance of the Midi Player or not.\n *\n * @return {object} A `MidiPlayer` instance.\n * @example\n * import MidiPlayer from 'web-midi-player';\n *\n * const eventLogger = (payload) => {\n * console.log('Received event:', payload.event)\n * }\n *\n * const midiPlayer = new MidiPlayer({ eventLogger, logging: true });\n */\n function MidiPlayer() {\n var _this = this;\n\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$eventLogger = _ref.eventLogger,\n eventLogger = _ref$eventLogger === void 0 ? undefined : _ref$eventLogger,\n _ref$logging = _ref.logging,\n logging = _ref$logging === void 0 ? false : _ref$logging,\n _ref$patchUrl = _ref.patchUrl,\n patchUrl = _ref$patchUrl === void 0 ? constants[\"j\" /* MIDI_DEFAULT_PATCH_URL */] : _ref$patchUrl,\n audioContext = _ref.audioContext;\n\n classCallCheck_default()(this, MidiPlayer);\n\n defineProperty_default()(this, \"initPlayback\", function () {\n LibTiMidity[\"a\" /* default */].call('mid_song_start', 'void', ['number'], [_this.song]);\n\n _this.connectSource();\n\n _this.waveBuffer = LibTiMidity[\"a\" /* default */]._malloc(constants[\"h\" /* MIDI_AUDIO_BUFFER_SIZE */] * 2);\n\n var gainNode = _this.context.createGain();\n\n gainNode.gain.value = 1;\n _this.startTime = _this.context.currentTime;\n\n _this.emitEvent({\n event: MIDI_PLAY,\n time: 0\n });\n });\n\n defineProperty_default()(this, \"connectSource\", function () {\n // Warning! This feature has been marked as deprecated: https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createScriptProcessor\n // See issue: https://github.com/yvesgurcan/web-midi-player/issues/29\n _this.source = _this.context.createScriptProcessor(constants[\"h\" /* MIDI_AUDIO_BUFFER_SIZE */], 0, 1); // event handler for next buffer full of audio data\n\n _this.source.onaudioprocess = function (event) {\n return _this.handleOutput(event);\n }; // connects the source to the context's destination (the speakers)\n\n\n _this.source.connect(_this.context.destination);\n });\n\n defineProperty_default()(this, \"disconnectSource\", function () {\n _this.source.disconnect();\n\n _this.source = null;\n });\n\n defineProperty_default()(this, \"emitEvent\", function (payload) {\n var payloadWithId = MidiPlayer_objectSpread({}, payload, {\n playerId: _this.playerId\n });\n\n if (_this.eventLogger) {\n _this.eventLogger(payloadWithId);\n } else if (_this.logging) {\n if (payloadWithId.event === MIDI_ERROR) {\n console.error(payloadWithId);\n } else {\n console.log(payloadWithId);\n }\n }\n });\n\n try {\n var playerId = v4_default()();\n this.playerId = playerId;\n this.eventHandler = new EventHandler_EventHandler({\n eventLogger: eventLogger,\n logging: logging,\n playerId: playerId\n });\n } catch (error) {\n console.error('Fatal error. Could not initialize event handler.');\n return;\n }\n\n try {\n this.eventLogger = eventLogger;\n this.logging = logging;\n this.patchUrl = patchUrl;\n this.startTime = 0;\n\n if (audioContext) {\n this.context = audioContext;\n }\n\n LibTiMidity[\"a\" /* default */].init(isFirstInstance);\n this.isFirstInstance = isFirstInstance;\n\n if (isFirstInstance) {\n isFirstInstance = false;\n }\n\n this.eventHandler.emitInit();\n } catch (error) {\n this.emitEvent({\n event: MIDI_ERROR,\n message: 'Could not initialize AudioContext.',\n error: error\n });\n }\n }\n\n createClass_default()(MidiPlayer, [{\n key: \"play\",\n\n /**\n * Starts playback of MIDI input.\n *\n * Please note that you can not use `input.arrayBuffer` and `input.url` concurrently.\n * @param {object} input\n * @param {arrayBuffer} [input.arrayBuffer] An array buffer containing MIDI data to play.\n * @param {string} [input.url] The URL where the MIDI file to play is located.\n * @param {string} [input.name] A human-friendly name for the song.\n * @param {object} [input.audioContext] An instance of the Web Audio API AudioContext interface.\n * @return {boolean} Whether playback was successfully initiated or not.\n * @example\n * const name1 = 'My MIDI file from URL';\n * const url = 'media/file.midi';\n * midiPlayer.play({ url, name: name1 });\n *\n * const name2 = 'My MIDI file from ArrayBuffer';\n * const arrayBuffer = new ArrayBuffer();\n * midiPlayer.play({ arrayBuffer, name: name2 });\n */\n value: function () {\n var _play = asyncToGenerator_default()(\n /*#__PURE__*/\n regenerator_default.a.mark(function _callee() {\n var _ref2,\n arrayBuffer,\n url,\n name,\n audioContext,\n data,\n response,\n _args = arguments;\n\n return regenerator_default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _ref2 = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, arrayBuffer = _ref2.arrayBuffer, url = _ref2.url, name = _ref2.name, audioContext = _ref2.audioContext;\n this.stop();\n\n if (!(!arrayBuffer && !url)) {\n _context.next = 5;\n break;\n }\n\n this.emitEvent({\n event: MIDI_ERROR,\n message: \"Unknown source. URL or array buffer can't be both undefined to start playback.\"\n });\n return _context.abrupt(\"return\", false);\n\n case 5:\n if (!(arrayBuffer && url)) {\n _context.next = 8;\n break;\n }\n\n this.emitEvent({\n event: MIDI_ERROR,\n message: 'Ambiguous source. MIDI data must originate either from a URL or an array buffer to start playback. Not both.'\n });\n return _context.abrupt(\"return\", false);\n\n case 8:\n this.emitEvent({\n event: MIDI_LOAD_FILE,\n message: \"Loading\".concat(MidiPlayer.formatMidiName(name), \"...\")\n });\n data = arrayBuffer;\n\n if (!url) {\n _context.next = 27;\n break;\n }\n\n _context.prev = 11;\n _context.next = 14;\n return fetch(url);\n\n case 14:\n response = _context.sent;\n\n if (!(response.status !== 200)) {\n _context.next = 18;\n break;\n }\n\n this.emitEvent({\n event: MIDI_ERROR,\n message: \"Could not retrieve MIDI\".concat(MidiPlayer.formatMidiName(name), \" (status code: \").concat(response.status, \").\")\n });\n return _context.abrupt(\"return\", false);\n\n case 18:\n _context.next = 20;\n return response.arrayBuffer();\n\n case 20:\n data = _context.sent;\n _context.next = 27;\n break;\n\n case 23:\n _context.prev = 23;\n _context.t0 = _context[\"catch\"](11);\n this.emitEvent({\n event: MIDI_ERROR,\n message: \"Could not retrieve MIDI\".concat(MidiPlayer.formatMidiName(name), \".\"),\n error: _context.t0\n });\n return _context.abrupt(\"return\", false);\n\n case 27:\n this.context = audioContext || new AudioContext();\n this.loadSong({\n arrayBuffer: data\n });\n return _context.abrupt(\"return\", true);\n\n case 30:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this, [[11, 23]]);\n }));\n\n function play() {\n return _play.apply(this, arguments);\n }\n\n return play;\n }()\n }, {\n key: \"loadSong\",\n value: function () {\n var _loadSong = asyncToGenerator_default()(\n /*#__PURE__*/\n regenerator_default.a.mark(function _callee2(_ref3) {\n var arrayBuffer, options, missingPatchCount, i, missingPatch;\n return regenerator_default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n arrayBuffer = _ref3.arrayBuffer;\n this.midiFileArray = new Int8Array(arrayBuffer);\n this.midiFileBuffer = LibTiMidity[\"a\" /* default */]._malloc(this.midiFileArray.length);\n LibTiMidity[\"a\" /* default */].writeArrayToMemory(this.midiFileArray, this.midiFileBuffer);\n LibTiMidity[\"a\" /* default */].call('mid_init', 'number', [], []);\n this.stream = LibTiMidity[\"a\" /* default */].call('mid_istream_open_mem', 'number', ['number', 'number', 'number'], [this.midiFileBuffer, this.midiFileArray.length, false]);\n options = LibTiMidity[\"a\" /* default */].call('mid_create_options', 'number', ['number', 'number', 'number', 'number'], [this.context.sampleRate, constants[\"i\" /* MIDI_AUDIO_S16LSB */], 1, constants[\"h\" /* MIDI_AUDIO_BUFFER_SIZE */] * 2]);\n this.song = LibTiMidity[\"a\" /* default */].call('mid_song_load', 'number', ['number', 'number'], [this.stream, options]);\n LibTiMidity[\"a\" /* default */].call('mid_istream_close', 'number', ['number'], [this.stream]);\n missingPatchCount = LibTiMidity[\"a\" /* default */].call('mid_song_get_num_missing_instruments', 'number', ['number'], [this.song]);\n\n if (!(missingPatchCount > 0)) {\n _context2.next = 27;\n break;\n }\n\n this.emitEvent({\n event: MIDI_LOAD_PATCH,\n message: \"Loading \".concat(missingPatchCount, \" MIDI instrument patches...\")\n });\n i = 0;\n\n case 13:\n if (!(i < missingPatchCount)) {\n _context2.next = 27;\n break;\n }\n\n missingPatch = LibTiMidity[\"a\" /* default */].call('mid_song_get_missing_instrument', 'string', ['number', 'number'], [this.song, i]);\n _context2.prev = 15;\n _context2.next = 18;\n return LibTiMidity[\"a\" /* default */].loadPatchFromUrl(this.patchUrl, missingPatch);\n\n case 18:\n _context2.next = 24;\n break;\n\n case 20:\n _context2.prev = 20;\n _context2.t0 = _context2[\"catch\"](15);\n this.emitEvent({\n event: MIDI_ERROR,\n message: \"Could not retrieve instrument patch '\".concat(missingPatch, \"'.\"),\n error: _context2.t0\n });\n return _context2.abrupt(\"return\");\n\n case 24:\n i++;\n _context2.next = 13;\n break;\n\n case 27:\n // we need to reload the MIDI once the instrument patches have been loaded\n this.stream = LibTiMidity[\"a\" /* default */].call('mid_istream_open_mem', 'number', ['number', 'number', 'number'], [this.midiFileBuffer, this.midiFileArray.length, false]);\n this.song = LibTiMidity[\"a\" /* default */].call('mid_song_load', 'number', ['number', 'number'], [this.stream, options]);\n LibTiMidity[\"a\" /* default */].call('mid_istream_close', 'number', ['number'], [this.stream]);\n this.initPlayback();\n\n case 31:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this, [[15, 20]]);\n }));\n\n function loadSong(_x) {\n return _loadSong.apply(this, arguments);\n }\n\n return loadSong;\n }()\n }, {\n key: \"handleOutput\",\n value: function handleOutput(_ref4) {\n var outputBuffer = _ref4.outputBuffer;\n\n try {\n var time = this.context.currentTime - this.startTime;\n this.emitEvent({\n event: MIDI_PLAY,\n time: time\n }); // collect new wave data from LibTiMidity into waveBuffer\n\n var readWaveBytes = LibTiMidity[\"a\" /* default */].call('mid_song_read_wave', 'number', ['number', 'number', 'number', 'number'], [this.song, this.waveBuffer, constants[\"h\" /* MIDI_AUDIO_BUFFER_SIZE */] * 2, false]);\n\n if (readWaveBytes === 0) {\n this.stop();\n this.emitEvent({\n event: MIDI_END,\n time: time\n });\n return;\n } // loop through the samples\n\n\n for (var i = 0; i < constants[\"h\" /* MIDI_AUDIO_BUFFER_SIZE */]; i++) {\n if (i < readWaveBytes) {\n // converts PCM data from sint16 in C to number in JavaScript (range: -1.0 .. +1.0)\n outputBuffer.getChannelData(0)[i] = LibTiMidity[\"a\" /* default */].getValue(this.waveBuffer + 2 * i, 'i16') / constants[\"g\" /* MAX_I16 */];\n } else {\n // fill end of buffer with zeroes, may happen at the end of a piece\n outputBuffer.getChannelData(0)[i] = 0;\n }\n }\n } catch (error) {\n this.emitEvent({\n event: MIDI_ERROR,\n message: 'Could not process audio.',\n error: error\n });\n }\n }\n /**\n * Pauses playback of MIDI input.\n * @param {undefined}\n * @return {boolean} Whether playback was successfully paused or not.\n * @example\n * midiPlayer.pause();\n */\n\n }, {\n key: \"pause\",\n value: function pause() {\n try {\n this.context.suspend();\n var time = this.context.currentTime - this.startTime;\n this.emitEvent({\n event: MIDI_PAUSE,\n time: time\n });\n return true;\n } catch (error) {\n this.emitEvent({\n event: MIDI_ERROR,\n message: 'Could not pause playback.',\n error: error\n });\n return false;\n }\n }\n /**\n * Resumes playback of MIDI input.\n * @param {undefined}\n * @return {boolean} Whether playback was successfully ressumed or not.\n * @example\n * midiPlayer.resume();\n */\n\n }, {\n key: \"resume\",\n value: function resume() {\n try {\n this.context.resume();\n var time = this.context.currentTime - this.startTime;\n this.emitEvent({\n event: MIDI_RESUME,\n time: time\n });\n return true;\n } catch (error) {\n this.emitEvent({\n event: MIDI_ERROR,\n message: 'Could not resume playback.',\n error: error\n });\n return false;\n }\n }\n /**\n * Stops playback of MIDI input.\n * @param {undefined}\n * @return {boolean} Whether playback was successfully stopped or not.\n * @example\n * midiPlayer.stop();\n */\n\n }, {\n key: \"stop\",\n value: function stop() {\n try {\n if (this.source) {\n this.disconnectSource(); // free libtimitdiy ressources\n\n LibTiMidity[\"a\" /* default */]._free(this.waveBuffer);\n\n LibTiMidity[\"a\" /* default */]._free(this.midiFileBuffer);\n\n LibTiMidity[\"a\" /* default */].call('mid_song_free', 'void', ['number'], [this.song]);\n LibTiMidity[\"a\" /* default */].call('mid_exit', 'void', [], []);\n this.song = 0;\n }\n\n this.startTime = 0;\n this.emitEvent({\n event: MIDI_STOP,\n time: 0\n });\n return true;\n } catch (error) {\n this.emitEvent({\n event: MIDI_ERROR,\n message: 'Could not stop playback.',\n error: error\n });\n return false;\n }\n } // terminate playback\n\n }], [{\n key: \"formatMidiName\",\n value: function formatMidiName(name) {\n return name ? \" '\".concat(name, \"'\") : '';\n }\n }]);\n\n return MidiPlayer;\n}();\n\n\n// CONCATENATED MODULE: ./src/index.js\n\n/* harmony default export */ var src = __webpack_exports__[\"default\"] = (MidiPlayer_MidiPlayer);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93ZWItbWlkaS1wbGF5ZXIvLi9zcmMvZXZlbnRzLmpzPzE1NjYiLCJ3ZWJwYWNrOi8vd2ViLW1pZGktcGxheWVyLy4vc3JjL0V2ZW50SGFuZGxlci5qcz9mN2QwIiwid2VicGFjazovL3dlYi1taWRpLXBsYXllci8uL3NyYy9NaWRpUGxheWVyLmpzP2YyYzUiLCJ3ZWJwYWNrOi8vd2ViLW1pZGktcGxheWVyLy4vc3JjL2luZGV4LmpzP2I2MzUiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IE1JRElfSU5JVCA9ICdNSURJX0lOSVQnO1xuXG5leHBvcnQgY29uc3QgTUlESV9FUlJPUiA9ICdNSURJX0VSUk9SJztcblxuZXhwb3J0IGNvbnN0IE1JRElfU1RBVFVTID0gJ01JRElfU1RBVFVTJztcblxuZXhwb3J0IGNvbnN0IE1JREl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BldmVudC5cbiAgICAgKi9cbiAgICBlbWl0RXZlbnQgPSBwYXlsb2FkID0+IHtcbiAgICAgICAgY29uc3QgcGF5bG9hZFdpdGhJZCA9IHtcbiAgICAgICAgICAgIC4uLnBheWxvYWQsXG4gICAgICAgICAgICBwbGF5ZXJJZDogdGhpcy5wbGF5ZXJJZFxuICAgICAgICB9O1xuXG4gICAgICAgIGlmICh0aGlzLmV2ZW50TG9nZ2VyKSB7XG4gICAgICAgICAgICB0aGlzLmV2ZW50TG9nZ2VyKHBheWxvYWRXaXRoSWQpO1xuICAgICAgICB9IGVsc2UgaWYgKHRoaXMubG9nZ2luZykge1xuICAgICAgICAgICAgaWYgKHBheWxvYWRXaXRoSWQuZXZlbnQgPT09IE1JRElfRVJST1IpIHtcbiAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKHBheWxvYWRXaXRoSWQpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhwYXlsb2FkV2l0aElkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG59XG4iLCJpbXBvcnQgdXVpZCBmcm9tICd1dWlkL3Y0JztcblxuaW1wb3J0IHtcbiAgICBNSURJX0FVRElPX0JVRkZFUl9TSVpFLFxuICAgIE1JRElfREVGQVVMVF9QQVRDSF9VUkwsXG4gICAgTUlESV9BVURJT19TMTZMU0IsXG4gICAgTUFYX0kxNlxufSBmcm9tICcuL2NvbnN0YW50cyc7XG5cbmltcG9ydCB7XG4gICAgTUlESV9FUlJPUixcbiAgICBNSURJX0xPQURfRklMRSxcbiAgICBNSURJX0xPQURfUEFUQ0gsXG4gICAgTUlESV9QTEFZLFxuICAgIE1JRElfUEFVU0UsXG4gICAgTUlESV9SRVNVTUUsXG4gICAgTUlESV9TVE9QLFxuICAgIE1JRElfRU5EXG59IGZyb20gJy4vZXZlbnRzJztcblxuaW1wb3J0IExpYlRpTWlkaXR5IGZyb20gJy4vTGliVGlNaW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lbnQgaGFuZGxlci4nKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICB0aGlzLmV2ZW50TG9nZ2VyID0gZXZlbnRMb2dnZXI7XG4gICAgICAgICAgICB0aGlzLmxvZ2dpbmcgPSBsb2dnaW5nO1xuICAgICAgICAgICAgdGhpcy5wYXRjaFVybCA9IHBhdGNoVXJsO1xuICAgICAgICAgICAgdGhpcy5zdGFydFRpbWUgPSAwO1xuXG4gICAgICAgICAgICBpZiAoYXVkaW9Db250ZXh0KSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jb250ZXh0ID0gYXVkaW9Db250ZXh0O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBMaWJUaU1pZGl0eS5pbml0KGlzRmlyc3RJbnN0YW5jZSk7XG5cbiAgICAgICAgICAgIHRoaXMuaXNGaXJzdEluc3RhbmNlID0gaXNGaXJzdEluc3RhbmNlO1xuICAgICAgICAgICAgaWYgKGlzRmlyc3RJbnN0YW5jZSkge1xuICAgICAgICAgICAgICAgIGlzRmlyc3RJbnN0YW5jZSA9IGZhbHNlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0aGlzLmV2ZW50SGFuZGxlci5lbWl0SW5pdCgpO1xuICAgICAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgdGhpcy5lbWl0RXZlbnQoe1xuICAgICAgICAgICAgICAgIGV2ZW50OiBNSURJX0VSUk9SLFxuICAgICAgICAgICAgICAgIG1lc3NhZ2U6ICdDb3VsZCBub3QgaW5pdGlhbGl6ZSBBdWRpb0NvbnRleHQuJyxcbiAgICAgICAgICAgICAgICBlcnJvclxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBzdGF0aWMgZm9ybWF0TWlkaU5hbWUobmFtZSkge1xuICAgICAgICByZXR1cm4gbmFtZSA/IGAgJyR7bmFtZX0nYCA6ICcnO1xuIC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gQXJyYXlCdWZmZXInO1xuICAgICAqIGNvbnN0IGFycmF5QnVmZmVyID0gbmV3IEFycmF5QnVmZmVyKCk7XG4gICAgICogbWlkaVBsYXllci5wbGF5KHsgYXJyYXlCdWZmZXIsIG5hbWU6IG5hbWUyIH0pO1xuICAgICAqL1xuICAgIGFzeW5jIHBsYXkoeyBhcnJheUJ1ZmZlciwgdXJsLCBuYW1lLCBhdWRpb0NvbnRleHQgfSA9IHt9KSB7XG4gICAgICAgIHRoaXMuc3RvcCgpO1xuXG4gICAgICAgIGlmICghYXJyYXlCdWZmZXIgJiYgIXVybCkge1xuICAgICAgICAgICAgdGhpcy5lbWl0RXZlbnQoe1xuICAgICAgICAgICAgICAgIGV2ZW50OiBNSURJX0VSUk9SLFxuICAgICAgICAgICAgICAgIG1lc3NhZ2U6XG4gICAgICAgICAgICAgICAgICAgIFwiVW5rbm93biBzb3VyY2UuIFVSTCBvciBhcnJheSBidWZmZXIgY2FuJ3QgYmUgYm90aCB1bmRlZmluZWQgdG8gc3RhcnQgcGxheWJhY2suXCJcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGFycmF5QnVmZmVyICYmIHVybCkge1xuICAgICAgICAgICAgdGhpcy5lbWl0RXZlbnQoe1xuICAgICAgICAgICAgICAgIGV2ZW50OiBNSURJX0VSUk9SLFxuICAgICAgICAgICAgICAgIG1lc3NhZ2U6XG4gICAgICAgICAgICAgICAgICAgICdBbWJpZ3VvdXMgc291cmNlLiBNSURJIGRhdGEgbXVzdCBvcmlnaW5hdGUgZWl0aGVyIGZyb20gYSBVUkwgb3IgYW4gYXJyYXkgYnVmZmVyIHRvIHN0YXJ0IHBsYXliYWNrLiBOb3QgYm90aC4nXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuZW1pdEV2ZW50KHtcbiAgICAgICAgICAgIGV2ZW50OiBNSURJX0xPQURfRklMRSxcbiAgICAgICAgICAgIG1lc3NhZ2U6IGBMb2FkaW5nJHtNaWRpUGxheWVyLmZvcm1hdE1pZGlOYW1lKG5hbWUpfS4uLmBcbiAgICAgICAgfSk7XG5cbiAgICAgICAgbGV0IGRhdGEgPSBhcnJheUJ1ZmZlcjtcblxuICAgICAgICBpZiAodXJsKSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHJlc3BvbnNlID0gYXdhaXQgZmV0Y2godXJsKTtcbiAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2Uuc3RhdHVzICE9PSAyMDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5lbWl0RXZlbnQoe1xuICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQ6IE1JRElfRVJST1IsXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOiBgQ291bGQgbm90IHJldHJpZXZlIE1JREkke01pZGlQbGF5ZXIuZm9ybWF0TWlkaU5hbWUoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZVxuICAgICAgICAgICAgICAgICAgICAgICAgKX0gKHN0YXR1cyBjb2RlOiAke3Jlc3BvbnNlLnN0YXR1c30pLmBcbiAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGRhdGEgPSBhd2FpdCByZXNwb25zZS5hcnJheUJ1ZmZlcigpO1xuICAgICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmVtaXRFdmVudCh7XG4gICAgICAgICAgICAgICAgICAgIGV2ZW50OiBNSURJX0VSUk9SLFxuICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOiBgQ291bGQgbm90IHJldHJpZXZlIE1JREkke01pZGlQbGF5ZXIuZm9ybWF0TWlkaU5hbWUoXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lXG4gICAgICAgICAgICAgICAgICAgICl9LmAsXG4gICAgICAgICAgICAgICAgICAgIGVycm9yXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5jb250ZXh0ID0gYXVkaW9Db250ZXh0IHx8IG5ldyBBdWRpb0NvbnRleHQoKTtcbiAgICAgICAgdGhpcy5sb2FkU29uZyh7IGFycmF5QnVmZmVyOiBkYXRhIH0pO1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9XG5cbiAgICBhc3luYyBsb2FkU29uZyh7IGFycmF5QnVmZmVyIH0pIHtcbiAgICAgICAgdGhpcy5taWRpRmlsZUFycmF5ID0gbmV3IEludDhBcnJheShhcnJheUJ1ZmZlcik7XG4gICAgICAgIHRoaXMubWlkaUZpbGVCdWZmZXIgPSBMaWJUaU1pZGl0eS5fbWFsbG9jKHRoaXMubWlkaUZpbGVBcnJheS5sZW5ndGgpO1xuICAgICAgICBMaWJUaU1pZGl0eS53cml0ZUFycmF5VG9NZW1vcnkodGhpcy5taWRpRmlsZUFycmF5LCB0aGlzLm1pZGlGaWxlQnVmZmVyKTtcbiAgICAgICAgTGliVGlNaWRpdHkuY2FsbCgnbWlkX2luaXQnLCAnbnVtYmVyJywgW10sIFtdKTtcblxuICAgICAgICB0aGlzLnN0cmVhbSA9IExpYlRpTWlkaXR5LmNhbGwoXG4gICAgICAgICAgICAnbWlkX2lzdHJlYW1fb3Blbl9tZW0nLFxuICAgICAgICAgICAgJ251bWJlcicsXG4gICAgICAgICAgICBbJ251bWJlcicsICdudW1iZXInLCAnbnVtYmVyJ10sXG4gICAgICAgICAgICBbdGhpcy5taWRpRmlsZUJ1ZmZlciwgdGhpcy5taWRpRmlsZUFycmF5Lmxlbmd0aCwgZmFsc2VdXG4gICAgICAgICk7XG5cbiAgICAgICAgY29uc3Qgb3B0aW9ucyA9IExpYlRpTWlkaXR5LmNhbGwoXG4gICAgICAgICAgICAnbWlkX2NyZWF0ZV9vcHRpb25zJyxcbiAgICAgICAgICAgICdudW1iZXInLFxuICAgICAgICAgICAgWydudW1iZXInLCAnbnVtYmVyJywgJ251bWJlcicsICdudW1iZXInXSxcbiAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICB0aGlzLmNvbnRleHQuc2FtcGxlUmF0ZSxcbiAgICAgICAgICAgICAgICBNSURJX0FVRElPX1MxNkxTQixcbiAgICAgICAgICAgICAgICAxLFxuICAgICAgICAgICAgICAgIE1JRElfQVVESU9fQlVGRkVSX1NJWkUgKiAyXG4gICAgICAgICAgICBdXG4gICAgICAgICk7XG5cbiAgICAgICAgdGhpcy5zb25nID0gTGliVGlNaWRpdHkuY2FsbChcbiAgICAgICAgICAgICdtaWRfc29uZ19sb2FkJyxcbiAgICAgICAgICAgICdudW1iZXInLFxuICAgICAgICAgICAgWydudW1iZXInLCAnbnVtYmVyJ10sXG4gICAgICAgICAgICBbdGhpcy5zdHJlYW0sIG9wdGlvbnNdXG4gICAgICAgICk7XG5cbiAgICAgICAgTGliVGlNaWRpdHkuY2FsbChcbiAgICAgICAgICAgICdtaWRfaXN0cmVhbV9jbG9zZScsXG4gICAgICAgICAgICAnbnVtYmVyJyxcbiAgICAgICAgICAgIFsnbnVtYmVyJ10sXG4gICAgICAgICAgICBbdGhpcy5zdHJlYW1dXG4gICAgICAgICk7XG5cbiAgICAgICAgY29uc3QgbWlzc2luZ1BhdGNoQ291bnQgPSBMaWJUaU1pZGl0eS5jYWxsKFxuICAgICAgICAgICAgJ21pZF9zb25nX2dldF9udW1fbWlzc2luZ19pbnN0cnVtZW50cycsXG4gICAgICAgICAgICAnbnVtYmVyJyxcbiAgICAgICAgICAgIFsnbnVtYmVyJ10sXG4gICAgICAgICAgICBbdGhpcy5zb25nXVxuICAgICAgICApO1xuXG4gICAgICAgIGlmIChtaXNzaW5nUGF0Y2hDb3VudCA+IDApIHtcbiAgICAgICAgICAgIHRoaXMuZW1pdEV2ZW50KHtcbiAgICAgICAgICAgICAgICBldmVudDogTUlESV9MT0FEX1BBVENILFxuICAgICAgICAgICAgICAgIG1lc3NhZ2U6IGBMb2FkaW5nICR7bWlzc2luZ1BhdGNoQ291bnR9IE1JREkgaW5zdHJ1bWVudCBwYXRjaGVzLi4uYFxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWlzc2luZ1BhdGNoQ291bnQ7IGkrKykge1xuICAgICAgICAgICAgICAgIGNvbnN0IG1pc3NpbmdQYXRjaCA9IExpYlRpTWlkaXR5LmNhbGwoXG4gICAgICAgICAgICAgICAgICAgICdtaWRfc29uZ19nZXRfbWlzc2luZ19pbnN0cnVtZW50JyxcbiAgICAgICAgICAgICAgICAgICAgJ3N0cmluZycsXG4gICAgICAgICAgICAgICAgICAgIFsnbnVtYmVyJywgJ251bWJlciddLFxuICAgICAgICAgICAgICAgICAgICBbdGhpcy5zb25nLCBpXVxuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBhd2FpdCBMaWJUaU1pZGl0eS5sb2FkUGF0Y2hGcm9tVXJsKFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXRjaFVybCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1pc3NpbmdQYXRjaFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZW1pdEV2ZW50KHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50OiBNSURJX0VSUk9SLFxuICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogYENvdWxkIG5vdCByZXRyaWV2ZSBpbnN0cnVtZW50IHBhdGNoICcke21pc3NpbmdQYXRjaH0nLmAsXG4gICAgICAgICAgICAgICAgICAgICAgICBlcnJvclxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHdlIG5lZWQgdG8gcmVsb2FkIHRoZSBNSURJIG9uY2UgdGhlIGluc3RydW1lbnQgcGF0Y2hlcyBoYXZlIGJlZW4gbG9hZGVkXG4gICAgICAgIHRoaXMuc3RyZWFtID0gTGliVGlNaWRpdHkuY2FsbChcbiAgICAgICAgICAgICdtaWRfaXN0cmVhbV9vcGVuX21lbScsXG4gICAgICAgICAgICAnbnVtYmVyJyxcbiAgICAgICAgICAgIFsnbnVtYmVyJywgJ251bWJlcicsICdudW1iZXInXSxcbiAgICAgICAgICAgIFt0aGlzLm1pZGlGaWxlQnVmZmVyLCB0aGlzLm1pZGlGaWxlQXJyYXkubGVuZ3RoLCBmYWxzZV1cbiAgICAgICAgKTtcblxuICAgICAgICB0aGlzLnNvbmcgPSBMaWJUaU1pZGl0eS5jYWxsKFxuICAgICAgICAgICAgJ21pZF9zb25nX2xvYWQnLFxuICAgICAgICAgICAgJ251bWJlcicsXG4gICAgICAgICAgICBbJ251bWJlcicsICdudW1iZXInXSxcbiAgICAgICAgICAgIFt0aGlzLnN0cmVhbSwgb3B0aW9uc11cbiAgICAgICAgKTtcblxuICAgICAgICBMaWJUaU1pZGl0eS5jYWxsKFxuICAgICAgICAgICAgJ21pZF9pc3RyZWFtX2Nsb3NlJyxcbiAgICAgICAgICAgICdudW1iZXInLFxuICAgICAgICAgICAgWydudW1iZXInXSxcbiAgICAgICAgICAgIFt0aGlzLnN0cmVhbV1cbiAgICAgICAgKTtcblxuICAgICAgICB0aGlzLmluaXRQbGF5YmFjaygpO1xuICAgIH1cblxuICAgIGluaXRQbGF5YmFjayA9ICgpID0+IHtcbiAgICAgICAgT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19CVUZGRVJfU0laRSxcbiAgICAgICAgICAgIDAsXG4gICAgICAgICAgICAxXG4gICAgICAgICk7XG5cbiAgICAgICAgLy8gZXZlbnQgaGFuZGxlciBmb3IgbmV4dCBidWZmZXIgZnVsbCBvZiBhdWRpbyBkYXRhXG4gICAgICAgIHRoaXMuc291cmNlLm9uYXVkaW9wcm9jZXNzID0gZXZlbnQgPT4gdGhpcy5oYW5kbGVPdXRwdXQoZXZlbnQpO1xuXG4gICAgICAgIC8vIGNvbm5lY3RzIHRoZSBzb3VyY2UgdG8gdGhlIGNvbnRleHQncyBkZXN0aW5hdGlvbiAodGhlIHNwZWFrZXJzKVxuICAgICAgICB0aGlzLnNvdXJjZS5jb25uZWN0KHRoaXMuY29udGV4dC5kZXN0aW5hdGlvbik7XG4gICAgfTtcblxuICAgIGhhbmRsZU91dHB1dCh7IG91dHB1dEJ1ZmZlciB9KSB7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICBjb25zdCB0aW1lID0gdGhpcy5jb250ZXh0LmN1cnJlbnRUaW1lIC0gdGhpcy5zdGFydFRpbWU7XG5cbiAgICAgICAgICAgIHRoaXMuZW1pdEV2ZW50KHtcbiAgICAgICAgICAgICAgICBldmVudDogTUlESV9QTEFZLFxuICAgICAgICAgICAgICAgIHRpbWVcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAvLyBjb2xsZWN0IG5ldyB3YXZlIGRhdGEgZnJvbSBMaWJUaU1pZGl0eSBpbnRvIHdhdmVCdWZmZXJcbiAgICAgICAgICAgIGNvbnN0IHJlYWRXYXZlQnl0ZXMgPSBMaWJUaU1pZGl0eS5jYWxsKFxuICAgICAgICAgICAgICAgICdtaWRfc29uZ19yZWFkX3dhdmUnLFxuICAgICAgICAgICAgICAgICdudW1iZXInLFxuICAgICAgICAgICAgICAgIFsnbnVtYmVyJywgJ251bWJlcicsICdudW1iZXInLCAnbnVtYmVyJ10sXG4gICAgICAgICAgICAgICAgW3RoaXMuc29uZywgdGhpcy53YXZlQnVmZmVyLCBNSURJX0FVRElPX0JVRkZFUl9TSVpFICogMiwgZmFsc2VdXG4gICAgICAgICAgICApO1xuXG4gICAgICAgICAgICBpZiAocmVhZFdhdmVCeXRlcyA9PT0gMCkge1xuICAgICAgICAgICAgICAgIHRoaXMuc3RvcCgpO1xuICAgICAgICAgICAgICAgIHRoaXMuZW1pdEV2ZW50KHtcbiAgICAgICAgICAgICAgICAgICAgZXZlbnQ6IE1JRElfRU5ELFxuICAgICAgICAgICAgICAgICAgICB0aW1lXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBsb29wIHRocm91Z2ggdGhlIHNhbXBsZXNcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgTUlESV9BVURJT19CVUZGRVJfU0laRTsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKGkgPCByZWFkV2F2ZUJ5dGVzKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbnZlcnRzIFBDTSBkYXRhIGZyb20gc2ludDE2IGluIEMgdG8gbnVtYmVyIGluIEphdmFTY3JpcHQgKHJhbmdlOiAtMS4wIC4uICsxLjApXG4gICAgICAgICAgICAgICAgICAgIG91dHB1dEJ1ZmZlci5nZXRDaGFubmVsRGF0YSgwKVtpXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICBMaWJUaU1pZGl0eS5nZXRWYWx1ZSh0aGlzLndhdmVCdWZmZXIgKyAyICogaSwgJ2kxNicpIC9cbiAgICAgICAgICAgICAgICAgICAgICAgIE1BWF9JMTY7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gZmlsbCBlbmQgb2YgYnVmZmVyIHdpdGggemVyb2VzLCBtYXkgaGFwcGVuIGF0IHRoZSBlbmQgb2YgYSBwaWVjZVxuICAgICAgICAgICAgICAgICAgICBvdXRwdXRCdWZmZXIuZ2V0Q2hhbm5lbERhdGEoMClbaV0gPSAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICAgIHRoaXMuZW1pdEV2ZW50KHtcbiAgICAgICAgICAgICAgICBldmVudDogTUlESV9FUlJPUixcbiAgICAgICAgICAgICAgICBtZXNzYWdlOiAnQ291bGQgbm90IHByb2Nlc3MgYXVkaW8uJyxcbiAgICAgICAgICAgICAgICBlcnJvclxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBQYXVzZXMgcGxheWJhY2sgb2YgTUlESSBpbnB1dC5cbiAgICAgKiBAcGFyYW0ge3VuZGVmaW5lZH1cbiAgICAgKiBAcmV0dXJuIHtib29sZWFufSBXaGV0aGVyIHBsYXliYWNrIHdhcyBzdWNjZXNzZnVsbHkgcGF1c2VkIG9yIG5vdC5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIG1pZGlQbGF5ZXIucGF1c2UoKTtcbiAgICAgKi9cbiAgICBwYXVzZSgpIHtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHRoaXMuY29udGV4dC5zdXNwZW5kKCk7XG4gICAgICAgICAgICBjb25zdCB0aW1lID0gdGhpcy5jb250ZXh0LmN1cnJlbnRUaW1lIC0gdGhpcy5zdGFydFRpbWU7XG4gICAgICAgICAgICB0aGlzLmVtaXRFdmVudCh7XG4gICAgICAgICAgICAgICAgZXZlbnQ6IE1JRElfUEFVU0UsXG4gICAgICAgICAgICAgICAgdGltZVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICAgIHRoaXMuZW1pdEV2ZW50KHtcbiAgICAgICAgICAgICAgICBldmVudDogTUlESV9FUlJPUixcbiAgICAgICAgICAgICAgICBtZXNzYWdlOiAnQ291bGQgbm90IHBhdXNlIHBsYXliYWNrLicsXG4gICAgICAgICAgICAgICAgZXJyb3JcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBSZXN1bWVzIHBsYXliYWNrIG9mIE1JREkgaW5wdXQuXG4gICAgICogQHBhcmFtIHt1bmRlZmluZWR9XG4gICAgICogQHJldHVybiB7Ym9vbGVhbn0gV2hldGhlciBwbGF5YmFjayB3YXMgc3VjY2Vzc2Z1bGx5IHJlc3N1bWVkIG9yIG5vdC5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIG1pZGlQbGF5ZXIucmVzdW1lKCk7XG4gICAgICovXG4gICAgcmVzdW1lKCkge1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgdGhpcy5jb250ZXh0LnJlc3VtZSgpO1xuICAgICAgICAgICAgY29uc3QgdGltZSA9IHRoaXMuY29udGV4dC5jdXJyZW50VGltZSAtIHRoaXMuc3RhcnRUaW1lO1xuICAgICAgICAgICAgdGhpcy5lbWl0RXZlbnQoe1xuICAgICAgICAgICAgICAgIGV2ZW50OiBNSURJX1JFU1VNRSxcbiAgICAgICAgICAgICAgICB0aW1lXG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICB0aGlzLmVtaXRFdmVudCh7XG4gICAgICAgICAgICAgICAgZXZlbnQ6IE1JRElfRVJST1IsXG4gICAgICAgICAgICAgICAgbWVzc2FnZTogJ0NvdWxkIG5vdCByZXN1bWUgcGxheWJhY2suJyxcbiAgICAgICAgICAgICAgICBlcnJvclxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFN0b3BzIHBsYXliYWNrIG9mIE1JREkgaW5wdXQuXG4gICAgICogQHBhcmFtIHt1bmRlZmluZWR9XG4gICAgICogQHJldHVybiB7Ym9vbGVhbn0gV2hldGhlciBwbGF5YmFjayB3YXMgc3VjY2Vzc2Z1bGx5IHN0b3BwZWQgb3Igbm90LlxuICAgICAqIEBleGFtcGxlXG4gICAgICogbWlkaVBsYXllci5zdG9wKCk7XG4gICAgICovXG4gICAgc3RvcCgpIHtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIGlmICh0aGlzLnNvdXJjZSkge1xuICAgICAgICAgICAgICAgIHRoaXMuZGlzY29ubmVjdFNvdXJjZSgpO1xuXG4gICAgICAgICAgICAgICAgLy8gZnJlZSBsaWJ0aW1pdGRpeSByZXNzb3VyY2VzXG4gICAgICAgICAgICAgICAgTGliVGlNaWRpdHkuX2ZyZWUodGhpcy53YXZlQnVmZmVyKTtcbiAgICAgICAgICAgICAgICBMaWJUaU1pZGl0eS5fZnJlZSh0aGlzLm1pZGlGaWxlQnVmZmVyKTtcblxuICAgICAgICAgICAgICAgIExpYlRpTWlkaXR5LmNhbGwoXG4gICAgICAgICAgICAgICAgICAgICdtaWRfc29uZ19mcmVlJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ZvaWQnLFxuICAgICAgICAgICAgICAgICAgICBbJ251bWJlciddLFxuICAgICAgICAgICAgICAgICAgICBbdGhpcy5zb25nXVxuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICBMaWJUaU1pZGl0eS5jYWxsKCdtaWRfZXhpdCcsICd2b2lkJywgW10sIFtdKTtcblxuICAgICAgICAgICAgICAgIHRoaXMuc29uZyA9IDA7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRoaXMuc3RhcnRUaW1lID0gMDtcblxuICAgICAgICAgICAgdGhpcy5lbWl0RXZlbnQoe1xuICAgICAgICAgICAgICAgIGV2ZW50OiBNSURJX1NUT1AsXG4gICAgICAgICAgICAgICAgdGltZTogMFxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgdGhpcy5lbWl0RXZlbnQoe1xuICAgICAgICAgICAgICAgIGV2ZW50OiBNSURJX0VSUk9SLFxuICAgICAgICAgICAgICAgIG1lc3NhZ2U6ICdDb3VsZCBub3Qgc3RvcCBwbGF5YmFjay4nLFxuICAgICAgICAgICAgICAgIGVycm9yXG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gdGVybWluYXRlIHBsYXliYWNrXG4gICAgZGlzY29ubmVjdFNvdXJjZSA9ICgpID0+IHtcbiAgICAgICAgdGhpcy5zb3VyY2UuZGlzY29ubmVjdCgpO1xuICAgICAgICB0aGlzLnNvdXJjZSA9IG51bGw7XG4gICAgfTtcblxuICAgIC8qKlxuICAgICAqIFNlbmQgY3VzdG9tIHBheWxvYWRzIHRvIHRoZSBldmVudCBsb2dnZXIuXG4gICAgICogQGZ1bmN0aW9uXG4gICAgICogQHBhcmFtIHtvYmplY3R9IHBheWxvYWRcbiAgICAgKiBAcGFyYW0ge3N0cmluZ30gW3BheWxvYWQuZXZlbnRdIFRoZSBuYW1lIG9mIHRoZSBldmVudC5cbiAgICAgKiBAcGFyYW0ge3N0cmluZ30gW3BheWxvYWQubWVzc2FnZV0gQSBtZXNzYWdlIHRoYXQgZGVzY3JpYmVkIHRoZSBldmVudC5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIGNvbnN0IGV2ZW50ID0gJ0NVU1RPTV9FVkVOVCc7XG4gICAgICogY29uc3QgbWVzc2FnZSA9ICdTb21ldGhpbmcgaGFwcGVuZWQuJztcbiAgICAgKiBtaWRpUGxheWVyLmVtaXRFdmVudCh7IGV2ZW50LCBtZXNzYWdlIH0pO1xuICAgICAqL1xuICAgIGVtaXRFdmVudCA9IH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FLQTtBQUNBO0FBRUE7Ozs7Ozs7Ozs7QUFPQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBSEE7QUFNQTtBQUNBO0FBQ0E7QUFFQTs7Ozs7Ozs7OztBQU9BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRkE7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFIQTtBQU1BO0FBQ0E7QUFDQTtBQUVBOzs7Ozs7Ozs7O0FBT0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFPQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBRkE7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFIQTtBQU1BO0FBQ0E7QUFDQTtBQUNBOzs7QUExV0E7QUFDQTtBQUNBOzs7Ozs7OztBQ3hHQTtBQUVBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///18\n")}])})); \ No newline at end of file From 5c0aa4f3c373e7aa88dde04ab307171bec03e514 Mon Sep 17 00:00:00 2001 From: yvesgurcan Date: Sun, 2 Feb 2020 20:49:39 -0800 Subject: [PATCH 3/5] 1.1.20 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 918b5cd..e03db77 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "web-midi-player", - "version": "1.1.19", + "version": "1.1.20", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b2d9531..5011067 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "web-midi-player", - "version": "1.1.19", + "version": "1.1.20", "description": "🎹 Event-driven JavaScript library to enable MIDI playback in the browser.", "keywords": [ "midi", From 9055483d6da230bc46b14f1e8e664417e6bc389c Mon Sep 17 00:00:00 2001 From: yvesgurcan Date: Sun, 2 Feb 2020 20:49:53 -0800 Subject: [PATCH 4/5] 1.1.21 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index e03db77..e0aa585 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "web-midi-player", - "version": "1.1.20", + "version": "1.1.21", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5011067..5fcb215 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "web-midi-player", - "version": "1.1.20", + "version": "1.1.21", "description": "🎹 Event-driven JavaScript library to enable MIDI playback in the browser.", "keywords": [ "midi", From fa109540fc32e5eadd7855bcd8dc0821de9ead0a Mon Sep 17 00:00:00 2001 From: yvesgurcan Date: Mon, 3 Feb 2020 04:52:32 +0000 Subject: [PATCH 5/5] New build --- doc/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/index.html b/doc/index.html index 6f041b2..839d1a8 100644 --- a/doc/index.html +++ b/doc/index.html @@ -2,7 +2,7 @@ - web-midi-player 1.1.20 | Documentation + web-midi-player 1.1.21 | Documentation @@ -15,7 +15,7 @@

web-midi-player

-
1.1.20
+
1.1.21