From 04303c37f847f189a266c0ba9b5169e4e808a3e6 Mon Sep 17 00:00:00 2001 From: Colin Combe Date: Wed, 18 May 2016 11:42:05 +0100 Subject: [PATCH 1/3] 1.0.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3c36379..44bb763 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "complexviewer", - "version": "1.0.4", + "version": "1.0.5", "description": "A network visualisation that displays molecular interaction data, including detailed residue-level information such as binding sites. v1 is used in EBI's Complex Portal. The aim for v2 is a general purpose viewer for PSI-MI XML data", "author": { "name": "Colin Combe", From f44f76df65b78cc37ee378754596f3c0ac6ec421 Mon Sep 17 00:00:00 2001 From: Colin Combe Date: Wed, 18 May 2016 11:45:17 +0100 Subject: [PATCH 2/3] now a bioJS component, incremented version number --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index d96521d..b8ab09e 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "complexviewer", - "version": "1.0.4", + "version": "1.0.5", "homepage": "https://github.com/MICommunity/interaction-viewer", "license": "Apache v2.0", "ignore": [ From 8497efa7eb678cd595d20f9014f6dc0a8d17217d Mon Sep 17 00:00:00 2001 From: Colin Combe Date: Wed, 18 May 2016 11:47:48 +0100 Subject: [PATCH 3/3] forgot to build, now rebuilt --- build/complexviewer.js | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/build/complexviewer.js b/build/complexviewer.js index 4ba6cfb..34f873c 100644 --- a/build/complexviewer.js +++ b/build/complexviewer.js @@ -313,7 +313,7 @@ var colorbrewer = {YlGn: { },{}],2:[function(require,module,exports){ !function() { var d3 = { - version: "3.5.14" + version: "3.5.17" }; var d3_arraySlice = [].slice, d3_array = function(list) { return d3_arraySlice.call(list); @@ -533,20 +533,20 @@ var colorbrewer = {YlGn: { while (i < n) pairs[i] = [ p0 = p1, p1 = array[++i] ]; return pairs; }; - d3.zip = function() { - if (!(n = arguments.length)) return []; - for (var i = -1, m = d3.min(arguments, d3_zipLength), zips = new Array(m); ++i < m; ) { - for (var j = -1, n, zip = zips[i] = new Array(n); ++j < n; ) { - zip[j] = arguments[j][i]; + d3.transpose = function(matrix) { + if (!(n = matrix.length)) return []; + for (var i = -1, m = d3.min(matrix, d3_transposeLength), transpose = new Array(m); ++i < m; ) { + for (var j = -1, n, row = transpose[i] = new Array(n); ++j < n; ) { + row[j] = matrix[j][i]; } } - return zips; + return transpose; }; - function d3_zipLength(d) { + function d3_transposeLength(d) { return d.length; } - d3.transpose = function(matrix) { - return d3.zip.apply(d3, matrix); + d3.zip = function() { + return d3.transpose(arguments); }; d3.keys = function(map) { var keys = []; @@ -933,9 +933,10 @@ var colorbrewer = {YlGn: { return d3_selectAll(selector, this); }; } + var d3_nsXhtml = "http://www.w3.org/1999/xhtml"; var d3_nsPrefix = { svg: "http://www.w3.org/2000/svg", - xhtml: "http://www.w3.org/1999/xhtml", + xhtml: d3_nsXhtml, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" @@ -1118,7 +1119,7 @@ var colorbrewer = {YlGn: { function d3_selection_creator(name) { function create() { var document = this.ownerDocument, namespace = this.namespaceURI; - return namespace && namespace !== document.documentElement.namespaceURI ? document.createElementNS(namespace, name) : document.createElement(name); + return namespace === d3_nsXhtml && document.documentElement.namespaceURI === d3_nsXhtml ? document.createElement(name) : document.createElementNS(namespace, name); } function createNS() { return this.ownerDocument.createElementNS(name.space, name.local); @@ -1517,7 +1518,7 @@ var colorbrewer = {YlGn: { } function dragstart(id, position, subject, move, end) { return function() { - var that = this, target = d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = ".drag" + (dragId == null ? "" : "-" + dragId), dragOffset, dragSubject = d3.select(subject(target)).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(target), position0 = position(parent, dragId); + var that = this, target = d3.event.target.correspondingElement || d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = ".drag" + (dragId == null ? "" : "-" + dragId), dragOffset, dragSubject = d3.select(subject(target)).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(target), position0 = position(parent, dragId); if (origin) { dragOffset = origin.apply(that, arguments); dragOffset = [ dragOffset.x - position0[0], dragOffset.y - position0[1] ]; @@ -3837,7 +3838,7 @@ var colorbrewer = {YlGn: { λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ, point0 = point; } } - return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < 0) ^ winding & 1; + return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < -ε) ^ winding & 1; } function d3_geo_clipCircle(radius) { var cr = Math.cos(radius), smallRadius = cr > 0, notHemisphere = abs(cr) > ε, interpolate = d3_geo_circleInterpolate(radius, 6 * d3_radians); @@ -16342,4 +16343,4 @@ module.exports = UnaryLink; },{"../../controller/Config":5,"./Link":20,"./SequenceLink":23}]},{},[6])(6) }); -//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJib3dlcl9jb21wb25lbnRzL2NvbG9yYnJld2VyL2NvbG9yYnJld2VyLmpzIiwiYm93ZXJfY29tcG9uZW50cy9kMy9kMy5qcyIsIm5vZGVfbW9kdWxlcy9pbnRlcnNlY3Rpb25qcy9pbnRlcnNlY3Rpb24uanMiLCJub2RlX21vZHVsZXMvcG9pbnQyZC9pbmRleC5qcyIsInNyYy9jb250cm9sbGVyL0NvbmZpZy5qcyIsInNyYy9jb250cm9sbGVyL0NvbnRyb2xsZXIuanMiLCJzcmMvY29udHJvbGxlci9FeHBhbmQuanMiLCJzcmMvY29udHJvbGxlci94aU5FVF9TdG9yYW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KSAhPSBudWxsICYmIGIgPiBhKSBhID0gYjtcbiAgICB9IGVsc2Uge1xuICAgICAgd2hpbGUgKCsraSA8IG4pIGlmICgoYiA9IGYuY2FsbChhcnJheSwgYXJyYXlbaV0sIGkpKSAhPSBudWxsICYmIGIgPj0gYikge1xuICAgICAgICBhID0gYjtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICB3aGlsZSAoKytpIDwgbikgaWYgKChiID0gZi5jYWxsKGFycmF5LCBhcnJheVtpXSwgaSkpICE9IG51bGwgJiYgYiA+IGEpIGEgPSBiO1xuICAgIH1cbiAgICByZXR1cm4gYTtcbiAgfTtcbiAgZDMuZXh0ZW50ID0gZnVuY3Rpb24oYXJyYXksIGYpIHtcbiAgICB2YXIgaSA9IC0xLCBuID0gYXJyYXkubGVuZ3RoLCBhLCBiLCBjO1xuICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAxKSB7XG4gICAgICB3aGlsZSAoKytpIDwgbikgaWYgKChiID0gYXJyYXlbaV0pICE9IG51bGwgJiYgYiA+PSBiKSB7XG4gICAgICAgIGEgPSBjID0gYjtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICB3aGlsZSAoKytpIDwgbikgaWYgKChiID0gYXJyYXlbaV0pICE9IG51bGwpIHtcbiAgICAgICAgaWYgKGEgPiBiKSBhID0gYjtcbiAgICAgICAgaWYgKGMgPCBiKSBjID0gYjtcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgd2hpbGUgKCsraSA8IG4pIGlmICgoYiA9IGYuY2FsbChhcnJheSwgYXJyYXlbaV0sIGkpKSAhPSBudWxsICYmIGIgPj0gYikge1xuICAgICAgICBhID0gYyA9IGI7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgICAgd2hpbGUgKCsraSA8IG4pIGlmICgoYiA9IGYuY2FsbChhcnJheSwgYXJyYXlbaV0sIGkpKSAhPSBudWxsKSB7XG4gICAgICAgIGlmIChhID4gYikg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LmNhbGwoZ3JvdXBEYXRhLCBub2RlRGF0YSA9IGdyb3VwRGF0YVtpXSwgaSkpKSkge1xuICAgICAgICAgICAgZW50ZXJOb2Rlc1tpXSA9IGQzX3NlbGVjdGlvbl9kYXRhTm9kZShub2RlRGF0YSk7XG4gICAgICAgICAgfSBlbHNlIGlmIChub2RlICE9PSB0cnVlKSB7XG4gICAgICAgICAgICB1cGRhdGVOb2Rlc1tpXSA9IG5vZGU7XG4gICAgICAgICAgICBub2RlLl9fZGF0YV9fID0gbm9kZURhdGE7XG4gICAgICAgICAgfVxuICAgICAgICAgIG5vZGVCeUtleVZhbHVlLnNldChrZXlWYWx1ZSwgdHJ1ZSk7XG4gICAgICAgIH1cbiAgICAgICAgZm9yIChpID0gLTE7ICsraSA8IG47ICkge1xuICAgICAgICAgIGlmIChpIGluIGtleVZhbHVlcyAmJiBub2RlQnlLZXlWYWx1ZS5nZXQoa2V5VmFsdWVzW2ldKSAhPT0gdHJ1ZSkge1xuICAgICAgICAgICAgZXhpdE5vZGVzW2ldID0gZ3JvdXBbaV07XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBmb3IgKGkgPSAtMTsgKytpIDwgbjA7ICkge1xuICAgICAgICAgIG5vZGUgPSBncm91cFtpXTtcbiAgICAgICAgICBub2RlRGF0YSA9IGdyb3VwRGF0YVtpXTtcbiAgICAgICAgICBpZiAobm9kZSkge1xuICAgICAgICAgICAgbm9kZS5fX2RhdGFfXyA9IG5vZGVEYXRhO1xuICAgICAgICAgICAgdXBkYXRlTm9kZXNbaV0gPSBub2RlO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBlbnRlck5vZGVzW2ldID0gZDNfc2VsZWN0aW9uX2RhdGFOb2RlKG5vZGVEYXRhKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZm9yICg7aSA8IG07ICsraSkge1xuICAgICAgICAgIGVudGVyTm9kZXNbaV0gPSB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1bmN0aW9uKCkge1xuICAgICAgICAgICAgdmFyIGR4ID0gc2l6ZVswXSwgZHkgPSBzaXplWzFdLCBjeCA9IGNlbnRlcjAgPyBjZW50ZXIwWzBdIDogZHggLyAyLCBjeSA9IGNlbnRlcjAgPyBjZW50ZXIwWzFdIDogZHkgLyAyLCBpID0gZDMuaW50ZXJwb2xhdGVab29tKFsgKGN4IC0gdmlldy54KSAvIHZpZXcuaywgKGN5IC0gdmlldy55KSAvIHZpZXcuaywgZHggLyB2aWV3LmsgXSwgWyAoY3ggLSB2aWV3MS54KSAvIHZpZXcxLmssIChjeSAtIHZpZXcxLnkpIC8gdmlldzEuaywgZHggLyB2aWV3MS5rIF0pO1xuICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHQpIHtcbiAgICAgICAgICAgICAgdmFyIGwgPSBpKHQpLCBrID0gZHggLyBsWzJdO1xuICAgICAgICAgICAgICB0aGlzLl9fY2hhcnRfXyA9IHZpZXcgPSB7XG4gICAgICAgICAgICAgICAgeDogY3ggLSBsWzBdICogayxcbiAgICAgICAgICAgICAgICB5OiBjeSAtIGxbMV0gKiBrLFxuICAgICAgICAgICAgICAgIGs6IGtcbiAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgem9vbWVkKGRpc3BhdGNoKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfSkuZWFjaChcImludGVycnVwdC56b29tXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgem9vbWVuZGVkKGRpc3BhdGNoKTtcbiAgICAgICAgICB9KS5lYWNoKFwiZW5kLnpvb21cIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB6b29tZW5kZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRoaXMuX19jaGFydF9fID0gdmlldztcbiAgICAgICAgICB6b29tc3RhcnRlZChkaXNwYXRjaCk7XG4gICAgICAgICAgem9vbWVkKGRpc3BhdGNoKTtcbiAgICAgICAgICB6b29tZW5kZWQoZGlzcGF0Y2gpO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9O1xuICAgIHpvb20udHJhbnNsYXRlID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gWyB2aWV3LngsIHZpZXcueSBdO1xuICAgICAgdmlldyA9IHtcbiAgICAgICAgeDogK19bMF0sXG4gICAgICAgIHk6ICtfWzFdLFxuICAgICAgICBrOiB2aWV3LmtcbiAgICAgIH07XG4gICAgICByZXNjYWxlKCk7XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uc2NhbGUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB2aWV3Lms7XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiB2aWV3LngsXG4gICAgICAgIHk6IHZpZXcueSxcbiAgICAgICAgazogbnVsbFxuICAgICAgfTtcbiAgICAgIHNjYWxlVG8oK18pO1xuICAgICAgcmVzY2FsZSgpO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnNjYWxlRXh0ZW50ID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2NhbGVFeHRlbnQ7XG4gICAgICBzY2FsZUV4dGVudCA9IF8gPT0gbnVsbCA/IGQzX2JlaGF2aW9yX3pvb21JbmZpbml0eSA6IFsgK19bMF0sICtfWzFdIF07XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uY2VudGVyID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY2VudGVyO1xuICAgICAgY2VudGVyID0gXyAmJiBbICtfWzBdLCArX1sxXSBdO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnNpemUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaXplO1xuICAgICAgc2l6ZSA9IF8gJiYgWyArX1swXSwgK19bMV0gXTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS5kdXJhdGlvbiA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGR1cmF0aW9uO1xuICAgICAgZHVyYXRpb24gPSArXztcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS54ID0gZnVuY3Rpb24oeikge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geDE7XG4gICAgICB4MSA9IHo7XG4gICAgICB4MCA9IHouY29weSgpO1xuICAgICAgdmlldyA9IHtcbiAgICAgICAgeDogMCxcbiAgICAgICAgeTogMCxcbiAgICAgICAgazogMVxuICAgICAgfTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS55ID0gZnVuY3Rpb24oeikge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geTE7XG4gICAgICB5MSA9IHo7XG4gICAgICB5MCA9IHouY29weSgpO1xuICAgICAgdmlldyA9IHtcbiAgICAgICAgeDogMCxcbiAgICAgICAgeTogMCxcbiAgICAgICAgazogMVxuICAgICAgfTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgZnVuY3Rpb24gbG9jYXRpb24ocCkge1xuICAgICAgcmV0dXJuIFsgKHBbMF0gLSB2aWV3LngpIC8gdmlldy5rLCAocFsxXSAtIHZpZXcueSkgLyB2aWV3LmsgXTtcbiAgICB9XG4gICAgZnVuY3Rpb24gcG9pbnQobCkge1xuICAgICAgcmV0dXJuIFsgbFswXSAqIHZpZXcuayArIHZpZXcueCwgbFsxXSAqIHZpZXcuayArIHZp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biAgICAgICAgICB9XG4gICAgICAgICAgSSA9IGkgKyAyO1xuICAgICAgICAgIHZhciBjID0gdGV4dC5jaGFyQ29kZUF0KGkgKyAxKTtcbiAgICAgICAgICBpZiAoYyA9PT0gMTMpIHtcbiAgICAgICAgICAgIGVvbCA9IHRydWU7XG4gICAgICAgICAgICBpZiAodGV4dC5jaGFyQ29kZUF0KGkgKyAyKSA9PT0gMTApICsrSTtcbiAgICAgICAgICB9IGVsc2UgaWYgKGMgPT09IDEwKSB7XG4gICAgICAgICAgICBlb2wgPSB0cnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gdGV4dC5zbGljZShqICsgMSwgaSkucmVwbGFjZSgvXCJcIi9nLCAnXCInKTtcbiAgICAgICAgfVxuICAgICAgICB3aGlsZSAoSSA8IE4pIHtcbiAgICAgICAgICB2YXIgYyA9IHRleHQuY2hhckNvZGVBdChJKyspLCBrID0gMTtcbiAgICAgICAgICBpZiAoYyA9PT0gMTApIGVvbCA9IHRydWU7IGVsc2UgaWYgKGMgPT09IDEzKSB7XG4gICAgICAgICAgICBlb2wgPSB0cnVlO1xuICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChJKSA9PT0gMTApICsrSSwgKytrO1xuICAgICAgICAgIH0gZWxzZSBpZiAoYyAhPT0gZGVsaW1pdGVyQ29kZSkgY29udGludWU7XG4gICAgICAgICAgcmV0dXJuIHRleHQuc2xpY2UoaiwgSSAtIGspO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0ZXh0LnNsaWNlKGopO1xuICAgICAgfVxuICAgICAgd2hpbGUgKCh0ID0gdG9rZW4oKSkgIT09IEVPRikge1xuICAgICAgICB2YXIgYSA9IFtdO1xuICAgICAgICB3aGlsZSAodCAhPT0gRU9MICYmIHQgIT09IEVPRikge1xuICAgICAgICAgIGEucHVzaCh0KTtcbiAgICAgICAgICB0ID0gdG9rZW4oKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZiAmJiAoYSA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9mb3JtYXQodGVtcGxhdGUpIHtcbiAgICAgIHZhciBuID0gdGVtcGxhdGUubGVuZ3RoO1xuICAgICAgZnVuY3Rpb24gZm9ybWF0KGRhdGUpIHtcbiAgICAgICAgdmFyIHN0cmluZyA9IFtdLCBpID0gLTEsIGogPSAwLCBjLCBwLCBmO1xuICAgICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICAgIGlmICh0ZW1wbGF0ZS5jaGFyQ29kZUF0KGkpID09PSAzNykge1xuICAgICAgICAgICAgc3RyaW5nLnB1c2godGVtcGxhdGUuc2xpY2UoaiwgaSkpO1xuICAgICAgICAgICAgaWYgKChwID0gZDNfdGltZV9mb3JtYXRQYWRzW2MgPSB0ZW1wbGF0ZS5jaGFyQXQoKytpKV0pICE9IG51bGwpIGMgPSB0ZW1wbGF0ZS5jaGFyQXQoKytpKTtcbiAgICAgICAgICAgIGlmIChmID0gZDNfdGltZV9mb3JtYXRzW2NdKSBjID0gZihkYXRlLCBwID09IG51bGwgPyBjID09PSBcImVcIiA/IFwiIFwiIDogXCIwXCIgOiBwKTtcbiAgICAgICAgICAgIHN0cmluZy5wdXNoKGMpO1xuICAgICAgICAgICAgaiA9IGkgKyAxO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBzdHJpbmcucHVzaCh0ZW1wbGF0ZS5zbGljZShqLCBpKSk7XG4gICAgICAgIHJldHVybiBzdHJpbmcuam9pbihcIlwiKTtcbiAgICAgIH1cbiAgICAgIGZvcm1hdC5wYXJzZSA9IGZ1bmN0aW9uKHN0cmluZykge1xuICAgICAgICB2YXIgZCA9IHtcbiAgICAgICAgICB5OiAxOTAwLFxuICAgICAgICAgIG06IDAsXG4gICAgICAgICAgZDogMSxcbiAgICAgICAgICBIOiAwLFxuICAgICAgICAgIE06IDAsXG4gICAgICAgICAgUzogMCxcbiAgICAgICAgICBMOiAwLFxuICAgICAgICAgIFo6IG51bGxcbiAgICAgICAgfSwgaSA9IGQzX3RpbWVfcGFyc2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ICAgICB9LFxuICAgICAgdzogZnVuY3Rpb24oZCkge1xuICAgICAgICByZXR1cm4gZC5nZXREYXkoKTtcbiAgICAgIH0sXG4gICAgICBXOiBmdW5jdGlvbihkLCBwKSB7XG4gICAgICAgIHJldHVybiBkM190aW1lX2Zvcm1hdFBhZChkM190aW1lLm1vbmRheU9mWWVhcihkKSwgcCwgMik7XG4gICAgICB9LFxuICAgICAgeDogZDNfdGltZV9mb3JtYXQobG9jYWxlX2RhdGUpLFxuICAgICAgWDogZDNfdGltZV9mb3JtYXQobG9jYWxlX3RpbWUpLFxuICAgICAgeTogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfdGltZV9mb3JtYXRQYWQoZC5nZXRGdWxsWWVhcigpICUgMTAwLCBwLCAyKTtcbiAgICAgIH0sXG4gICAgICBZOiBmdW5jdGlvbihkLCBwKSB7XG4gICAgICAgIHJldHVybiBkM190aW1lX2Zvcm1hdFBhZChkLmdldEZ1bGxZZWFyKCkgJSAxZTQsIHAsIDQpO1xuICAgICAgfSxcbiAgICAgIFo6IGQzX3RpbWVfem9uZSxcbiAgICAgIFwiJVwiOiBmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIFwiJVwiO1xuICAgICAgfVxuICAgIH07XG4gICAgdmFyIGQzX3RpbWVfcGFyc2VycyA9IHtcbiAgICAgIGE6IGQzX3RpbWVfcGFyc2VXZWVrZGF5QWJicmV2LFxuICAgICAgQTogZDNfdGltZV9wYXJzZVdlZWtkYXksXG4gICAgICBiOiBkM190aW1lX3BhcnNlTW9udGhBYmJyZXYsXG4gICAgICBCOiBkM190aW1lX3BhcnNlTW9udGgsXG4gICAgICBjOiBkM190aW1lX3BhcnNlTG9jYWxlRnVsbCxcbiAgICAgIGQ6IGQzX3RpbWVfcGFyc2VEYXksXG4gICAgICBlOiBkM190aW1lX3BhcnNlRGF5LFxuICAgICAgSDogZDNfdGltZV9wYXJzZUhvdXIyNCxcbiAgICAgIEk6IGQzX3Rp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lZXM7XG4gICAgICAgICAgaWYgKM+GaSA+IM+GMSkgz4YxID0gz4ZpO1xuICAgICAgICB9IGVsc2UgaWYgKM67aSA9ICjOu2kgKyAzNjApICUgMzYwIC0gMTgwLCBhbnRpbWVyaWRpYW4gXiAocyAqIM67XyA8IM67aSAmJiDOu2kgPCBzICogzrspKSB7XG4gICAgICAgICAgdmFyIM+GaSA9IC1pbmZsZWN0aW9uWzFdICogZDNfZGVncmVlcztcbiAgICAgICAgICBpZiAoz4ZpIDwgz4YwKSDPhjAgPSDPhmk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKM+GIDwgz4YwKSDPhjAgPSDPhjtcbiAgICAgICAgICBpZiAoz4YgPiDPhjEpIM+GMSA9IM+GO1xuICAgICAgICB9XG4gICAgICAgIGlmIChhbnRpbWVyaWRpYW4pIHtcbiAgICAgICAgICBpZiAozrsgPCDOu18pIHtcbiAgICAgICAgICAgIGlmIChhbmdsZSjOuzAsIM67KSA+IGFuZ2xlKM67MCwgzrsxKSkgzrsxID0gzrs7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChhbmdsZSjOuywgzrsxKSA+IGFuZ2xlKM67MCwgzrsxKSkgzrswID0gzrs7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICjOuzEgPj0gzrswKSB7XG4gICAgICAgICAgICBpZiAozrsgPCDOuzApIM67MCA9IM67O1xuICAgICAgICAgICAgaWYgKM67ID4gzrsxKSDOuzEgPSDOuztcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKM67ID4gzrtfKSB7XG4gICAgICAgICAgICAgIGlmIChhbmdsZSjOuzAsIM67KSA+IGFuZ2xlKM67MCwgzrsxKSkgzrsxID0gzrs7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBpZiAoYW5nbGUozrssIM67MSkgPiBhbmdsZSjOuzAsIM67MSkpIM67MCA9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M67LCDPhikge1xuICAgICAgzrsgKj0gZDNfcmFkaWFucztcbiAgICAgIHZhciBjb3PPhiA9IE1hdGguY29zKM+GICo9IGQzX3JhZGlhbnMpO1xuICAgICAgeDAgPSBjb3PPhiAqIE1hdGguY29zKM67KTtcbiAgICAgIHkwID0gY29zz4YgKiBNYXRoLnNpbijOuyk7XG4gICAgICB6MCA9IE1hdGguc2luKM+GKTtcbiAgICAgIGQzX2dlb19jZW50cm9pZC5wb2ludCA9IG5leHRQb2ludDtcbiAgICAgIGQzX2dlb19jZW50cm9pZFBvaW50WFlaKHgwLCB5MCwgejApO1xuICAgIH07XG4gICAgZnVuY3Rpb24gbmV4dFBvaW50KM67LCDPhikge1xuICAgICAgzrsgKj0gZDNfcmFkaWFucztcbiAgICAgIHZhciBjb3PPhiA9IE1hdGguY29zKM+GICo9IGQzX3JhZGlhbnMpLCB4ID0gY29zz4YgKiBNYXRoLmNvcyjOuyksIHkgPSBjb3PPhiAqIE1hdGguc2luKM67KSwgeiA9IE1hdGguc2luKM+GKSwgdyA9IE1hdGguYXRhbjIoTWF0aC5zcXJ0KCh3ID0geTAgKiB6IC0gejAgKiB5KSAqIHcgKyAodyA9IHowICogeCAtIHgwICogeikgKiB3ICsgKHcgPSB4MCAqIHkgLSB5MCAqIHgpICogdyksIHgwICogeCArIHkwICogeSArIHowICogeik7XG4gICAgICBkM19nZW9fY2VudHJvaWRXMSArPSB3O1xuICAgICAgZDNfZ2VvX2NlbnRyb2lkWDEgKz0gdyAqICh4MCArICh4MCA9IHgpKTtcbiAgICAgIGQzX2dlb19jZW50cm9pZFkxICs9IHcgKiAoeTAgKyAoeTAgPSB5KSk7XG4gICAgICBkM19nZW9fY2VudHJvaWRaMSArPSB3ICogKHowICsgKHowID0geikpO1xuICAgICAgZDNfZ2VvX2NlbnRyb2lkUG9pbnRYWVooeDAsIHkwLCB6MCk7XG4gICAgfVxuICB9XG4gIGZ1bmN0aW9uIGQzX2dlb19jZW50cm9pZExpbmVFbmQoKS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gICAgICAgICAgaW50ZXJwb2xhdGUoY3VycmVudC54LCBjdXJyZW50Lm4ueCwgMSwgbGlzdGVuZXIpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjdXJyZW50ID0gY3VycmVudC5uO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmIChpc1N1YmplY3QpIHtcbiAgICAgICAgICAgIHBvaW50cyA9IGN1cnJlbnQucC56O1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IHBvaW50cy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkgbGlzdGVuZXIucG9pbnQoKHBvaW50ID0gcG9pbnRzW2ldKVswXSwgcG9pbnRbMV0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpbnRlcnBvbGF0ZShjdXJyZW50LngsIGN1cnJlbnQucC54LCAtMSwgbGlzdGVuZXIpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjdXJyZW50ID0gY3VycmVudC5wO1xuICAgICAgICB9XG4gICAgICAgIGN1cnJlbnQgPSBjdXJyZW50Lm87XG4gICAgICAgIHBvaW50cyA9IGN1cnJlbnQuejtcbiAgICAgICAgaXNTdWJqZWN0ID0gIWlzU3ViamVjdDtcbiAgICAgIH0gd2hpbGUgKCFjdXJyZW50LnYpO1xuICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgIH1cbiAgfVxuICBmdW5jdGlvbiBkM19nZW9fY2xpcFBvbHlnb25MaW5rQ2lyY3VsYXIoYXJyYXkpIHtcbiAgICBpZiAoIShuID0gYXJyYXkubGVuZ3RoKSkgcmV0dXJuO1xuICAgIHZhciBuLCBpID0gMCwgYSA9IGFycmF5WzBdLCBiO1xuICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICBhLm4gPSBiID0gYXJyYXlbaV07XG4gICAgICBiLnAgPSBhO1xuICAgICAgYSA9IGI7XG4gICAgfVxuICAgIGEubiA9IGIgPSBhcnJheVswXTtcbiAgICBiLnAgPSBhO1xuICB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YgXSk7XG4gICAgICAgIHZhciBwb2ludCA9IHJvdGF0ZSjOuywgz4YpO1xuICAgICAgICByaW5nTGlzdGVuZXIucG9pbnQocG9pbnRbMF0sIHBvaW50WzFdKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHJpbmdTdGFydCgpIHtcbiAgICAgICAgcmluZ0xpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICByaW5nID0gW107XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiByaW5nRW5kKCkge1xuICAgICAgICBwb2ludFJpbmcocmluZ1swXVswXSwgcmluZ1swXVsxXSk7XG4gICAgICAgIHJpbmdMaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgIHZhciBjbGVhbiA9IHJpbmdMaXN0ZW5lci5jbGVhbigpLCByaW5nU2VnbWVudHMgPSBidWZmZXIuYnVmZmVyKCksIHNlZ21lbnQsIG4gPSByaW5nU2VnbWVudHMubGVuZ3RoO1xuICAgICAgICByaW5nLnBvcCgpO1xuICAgICAgICBwb2x5Z29uLnB1c2gocmluZyk7XG4gICAgICAgIHJpbmcgPSBudWxsO1xuICAgICAgICBpZiAoIW4pIHJldHVybjtcbiAgICAgICAgaWYgKGNsZWFuICYgMSkge1xuICAgICAgICAgIHNlZ21lbnQgPSByaW5nU2VnbWVudHNbMF07XG4gICAgICAgICAgdmFyIG4gPSBzZWdtZW50Lmxlbmd0aCAtIDEsIGkgPSAtMSwgcG9pbnQ7XG4gICAgICAgICAgaWYgKG4gPiAwKSB7XG4gICAgICAgICAgICBpZiAoIXBvbHlnb25TdGFydGVkKSBsaXN0ZW5lci5wb2x5Z29uU3RhcnQoKSwgcG9seWdvblN0YXJ0ZWQgPSB0cnVlO1xuICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICB3aGlsZSAoKytpIDwgbikgbGlzdGVuZXIucG9pbnQoKHBvaW50ID0gc2VnbWVudFtpXSlbMF0sIHBvaW50WzFdKTtcb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XG4gICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHPOuzEsIM+GMCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQozrsxLCDPhjApO1xuICAgICAgICAgIGNsZWFuID0gMDtcbiAgICAgICAgfSBlbHNlIGlmIChzzrswICE9PSBzzrsxICYmIGTOuyA+PSDPgCkge1xuICAgICAgICAgIGlmIChhYnMozrswIC0gc867MCkgPCDOtSkgzrswIC09IHPOuzAgKiDOtTtcbiAgICAgICAgICBpZiAoYWJzKM67MSAtIHPOuzEpIDwgzrUpIM67MSAtPSBzzrsxICogzrU7XG4gICAgICAgICAgz4YwID0gZDNfZ2VvX2NsaXBBbnRpbWVyaWRpYW5JbnRlcnNlY3QozrswLCDPhjAsIM67MSwgz4YxKTtcbiAgICAgICAgICBsaXN0ZW5lci5wb2ludChzzrswLCDPhjApO1xuICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICBsaXN0ZW5lci5wb2ludChzzrsxLCDPhjApO1xuICAgICAgICAgIGNsZWFuID0gMDtcbiAgICAgICAgfVxuICAgICAgICBsaXN0ZW5lci5wb2ludCjOuzAgPSDOuzEsIM+GMCA9IM+GMSk7XG4gICAgICAgIHPOuzAgPSBzzrsxO1xuICAgICAgfSxcbiAgICAgIGxpbmVFbmQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgIM67MCA9IM+GMCA9IE5hTjtcbiAgICAgIH0sXG4gICAgICBjbGVhbjogZnVuY3Rpb24oKSB7XG4gICAgICAgIHJldHVybiAyIC0gY2xlYW47XG4gICAgICB9XG4gICAgfTtcbiAgfVxuICBmdW5jdGlvbiBkM19nZW9fY2xpcEFudGltZXJpZGlhbk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FxuICAgICAgICBwb2ludDogZnVuY3Rpb24ozrssIM+GKSB7XG4gICAgICAgICAgdmFyIHBvaW50MSA9IFsgzrssIM+GIF0sIHBvaW50MiwgdiA9IHZpc2libGUozrssIM+GKSwgYyA9IHNtYWxsUmFkaXVzID8gdiA/IDAgOiBjb2RlKM67LCDPhikgOiB2ID8gY29kZSjOuyArICjOuyA8IDAgPyDPgCA6IC3PgCksIM+GKSA6IDA7XG4gICAgICAgICAgaWYgKCFwb2ludDAgJiYgKHYwMCA9IHYwID0gdikpIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgIGlmICh2ICE9PSB2MCkge1xuICAgICAgICAgICAgcG9pbnQyID0gaW50ZXJzZWN0KHBvaW50MCwgcG9pbnQxKTtcbiAgICAgICAgICAgIGlmIChkM19nZW9fc3BoZXJpY2FsRXF1YWwocG9pbnQwLCBwb2ludDIpIHx8IGQzX2dlb19zcGhlcmljYWxFcXVhbChwb2ludDEsIHBvaW50MikpIHtcbiAgICAgICAgICAgICAgcG9pbnQxWzBdICs9IM61O1xuICAgICAgICAgICAgICBwb2ludDFbMV0gKz0gzrU7XG4gICAgICAgICAgICAgIHYgPSB2aXNpYmxlKHBvaW50MVswXSwgcG9pbnQxWzFdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHYgIT09IHYwKSB7XG4gICAgICAgICAgICBjbGVhbiA9IDA7XG4gICAgICAgICAgICBpZiAodikge1xuICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgcG9pbnQyID0gaW50ZXJzZWN0KHBvaW50MSwgcG9pbnQwKTtcbiAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQocG9pbnQyWzBdLCBwb2ludDJbMV0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcG9pbnQyID0gaW50ZXJzZWN0KHBvaW50MCwgcG9pbnQxKTtcbiAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQocG9pbnQyWzBdLCBwb2ludDJbMV0pO1xuICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBwb2ludDAgPSBwb2ludDI7XG4gICAgICAgICAgfSBlbHNlIGlmIChub3RIZW1pc3BoZXJlICYmIHBvaW50MCAmJiBzbWFsbFJhZGl1cyBeIHYpIHtcbiAgICAgICAgICAgIHZhciB0O1xuICAgICAgICAgICAgaWYgKCEoYyAmIGMwKSAmJiAodCA9IGludGVyc2VjdChwb2ludDEsIHBvaW50MCwgdHJ1ZSkpKSB7XG4gICAgICAgICAgICAgIGNsZWFuID0gMDtcbiAgICAgICAgICAgICAgaWYgKHNtYWxsUmFkaXVzKSB7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQodFswXVswXSwgdFswXVsxXSk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQodFsxXVswXSwgdFsxXVsxXSk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHRbMV1bMF0sIHRbMV1bMV0pO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh0WzBdWzBdLCB0WzBdWzFdKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAodiAmJiAoIXBvaW50MCB8fCAhZDNfZ2VvX3NwaGVyaWNhbEVxdWFsKHBvaW50MCwgcG9pbnQxKSkpIHtcbiAgICAgICAgICAgIGxpc3Rl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pO1xuICAgICAgICBkM19nZW9fY2FydGVzaWFuQWRkKHExLCBBKTtcbiAgICAgICAgcmV0dXJuIFsgcSwgZDNfZ2VvX3NwaGVyaWNhbChxMSkgXTtcbiAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gY29kZSjOuywgz4YpIHtcbiAgICAgIHZhciByID0gc21hbGxSYWRpdXMgPyByYWRpdXMgOiDPgCAtIHJhZGl1cywgY29kZSA9IDA7XG4gICAgICBpZiAozrsgPCAtcikgY29kZSB8PSAxOyBlbHNlIGlmICjOuyA+IHIpIGNvZGUgfD0gMjtcbiAgICAgIGlmICjPhiA8IC1yKSBjb2RlIHw9IDQ7IGVsc2UgaWYgKM+GID4gcikgY29kZSB8PSA4O1xuICAgICAgcmV0dXJuIGNvZGU7XG4gICAgfVxuICB9XG4gIGZ1bmN0aW9uIGQzX2dlb21fY2xpcExpbmUoeDAsIHkwLCB4MSwgeTEpIHtcbiAgICByZXR1cm4gZnVuY3Rpb24obGluZSkge1xuICAgICAgdmFyIGEgPSBsaW5lLmEsIGIgPSBsaW5lLmIsIGF4ID0gYS54LCBheSA9IGEueSwgYnggPSBiLngsIGJ5ID0gYi55LCB0MCA9IDAsIHQxID0gMSwgZHggPSBieCAtIGF4LCBkeSA9IGJ5IC0gYXksIHI7XG4gICAgICByID0geDAgLSBheDtcbiAgICAgIGlmICghZHggJiYgciA+IDApIHJldHVybjtcbiAgICAgIHIgLz0gZHg7XG4gICAgICBpZiAoZHggPCAwKSB7XG4gICAgICAgIGlmIChyIDwgdDApIHJldHVybjtcbiAgICAgICAgaWYgKHIgPCB0MSkgdDEgPSByO1xuICAgICAgfSBlbHNlIGlmIChkeCA+IDApIHtcbiAgICAgICAgaWYgKHIgPiB0MSkgcmV0dXJuO1xuICAgICAgICBpZiAociA+IHQwKSB0MCA9IHI7XG4gICAgICB9XG4gICAgICByID0geDEgLSBheDtcbiAgICAgIGlmICghZHggJiYgciA8IDApIHJldHVybjtcbiAgICAgIHIgLz0gZHg7XG4gICAgICBpZiAoZHggPCAwKSB7XG4gICAgICAgIGlmIChyID4gdDEpIHJldHVybjtcbiAgICAgICAgaWYgKHIgPiB0MCkgdDAgPSByO1xuICAgICAgfSBlbHNlIGlmIChkeCA+IDApIHtcbiAgICAgICAgaWYgKHIgPCB0MCkgcmV0dXJuO1xuICAgICAgICBpZiAociA8IHQxKSB0MSA9IHI7XG4gICAgICB9XG4gICAgICByID0geTAgLSBheTtcbiAgICAgIGlmICghZHkgJiYgciA+IDApIHJldHVybjtcbiAgICAgIHIgLz0gZHk7XG4gICAgICBpZiAoZHkgPCAwKSB7XG4gICAgICAgIGlmIChyIDwgdDApIHJldHVybjtcbiAgICAgICAgaWYgKHIgPCB0MSkgdDEgPSByO1xuICAgICAgfSBlbHNlIGlmIChkeSA+IDApIHtcbiAgICAgICAgaWYgKHIgPiB0MSkgcmV0dXJuO1xuICAgICAgICBpZiAociA+IHQwKSB0MCA9IHI7XG4gICAgICB9XG4gICAgICByID0geTEgLSBheTtcbiAgICAgIGlmICghZHkgJiYgciA8IDApIHJldHVybjtcbiAgICAgIHIgLz0gZHk7XG4gICAgICBpZiAoZHkgPCAwKSB7XG4gICAgICAgIGlmIChyID4gdDEpIHJldHVybjtcbiAgICAgICAgaWYgKHIgPiB0MCkgdDAgPSByO1xuICAgICAgfSBlbHNlIGlmIChkeSA+IDApIHtcbiAgICAgICAgaWYgKHIgPCB0MCkgcmV0dXJuO1xuICAgICAgICBpZiAociA8IHQxKSB0MSA9IHI7XG4gICAgICB9XG4gICAgICBpZiAodDAgPiAwKSBsaW5lLmEgPSB7XG4gICAgICAgIHg6IGF4ICsgdDAgKiBkeCxcbiAgICAgICAgeTogYXkgKyB0MCAqIGR5XG4gICAgICB9O1xuICAgICAgaWYgKHQxIDwgMSkgbGluZS5iID0ge1xuICAgICAgICB4OiBheCArIHQxICogZHgsXG4gICAgICAgIHk6IGF5ICsgdDEgKiBkeVxuICAgICAgfTtcbiAgICAgIHJldHVybiBsaW5lO1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AgICAgICAgICAgaWYgKHZpc2libGUpIHtcbiAgICAgICAgICAgICAgZDNfZ2VvX2NsaXBQb2x5Z29uKHNlZ21lbnRzLCBjb21wYXJlLCBjbGlwU3RhcnRJbnNpZGUsIGludGVycG9sYXRlLCBsaXN0ZW5lcik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsaXN0ZW5lci5wb2x5Z29uRW5kKCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHNlZ21lbnRzID0gcG9seWdvbiA9IHJpbmcgPSBudWxsO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgICAgZnVuY3Rpb24gaW5zaWRlUG9seWdvbihwKSB7XG4gICAgICAgIHZhciB3biA9IDAsIG4gPSBwb2x5Z29uLmxlbmd0aCwgeSA9IHBbMV07XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbjsgKytpKSB7XG4gICAgICAgICAgZm9yICh2YXIgaiA9IDEsIHYgPSBwb2x5Z29uW2ldLCBtID0gdi5sZW5ndGgsIGEgPSB2WzBdLCBiOyBqIDwgbTsgKytqKSB7XG4gICAgICAgICAgICBiID0gdltqXTtcbiAgICAgICAgICAgIGlmIChhWzFdIDw9IHkpIHtcbiAgICAgICAgICAgICAgaWYgKGJbMV0gPiB5ICYmIGQzX2Nyb3NzMmQoYSwgYiwgcCkgPiAwKSArK3duO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgaWYgKGJbMV0gPD0geSAmJiBkM19jcm9zczJkKGEsIGIsIHApIDwgMCkgLS13bjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGEgPSBiO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gd24gIT09IDA7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBpbnRlcnBvbGF0ZShmcm9tLCB0bywgZGlyZWN0aW9uLCBsaXN0ZW5lcikge1xuICAgICAgICB2YXIgYSA9IDAsIGExID0gMDtcbiAgICAgICAgaW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gICAgaWYgKHNlZ21lbnRzKSB7XG4gICAgICAgICAgbGluZVBvaW50KHhfXywgeV9fKTtcbiAgICAgICAgICBpZiAodl9fICYmIHZfKSBidWZmZXJMaXN0ZW5lci5yZWpvaW4oKTtcbiAgICAgICAgICBzZWdtZW50cy5wdXNoKGJ1ZmZlckxpc3RlbmVyLmJ1ZmZlcigpKTtcbiAgICAgICAgfVxuICAgICAgICBjbGlwLnBvaW50ID0gcG9pbnQ7XG4gICAgICAgIGlmICh2XykgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gbGluZVBvaW50KHgsIHkpIHtcbiAgICAgICAgeCA9IE1hdGgubWF4KC1kM19nZW9fY2xpcEV4dGVudE1BWCwgTWF0aC5taW4oZDNfZ2VvX2NsaXBFeHRlbnRNQVgsIHgpKTtcbiAgICAgICAgeSA9IE1hdGgubWF4KC1kM19nZW9fY2xpcEV4dGVudE1BWCwgTWF0aC5taW4oZDNfZ2VvX2NsaXBFeHRlbnRNQVgsIHkpKTtcbiAgICAgICAgdmFyIHYgPSBwb2ludFZpc2libGUoeCwgeSk7XG4gICAgICAgIGlmIChwb2x5Z29uKSByaW5nLnB1c2goWyB4LCB5IF0pO1xuICAgICAgICBpZiAoZmlyc3QpIHtcbiAgICAgICAgICB4X18gPSB4LCB5X18gPSB5LCB2X18gPSB2O1xuICAgICAgICAgIGZpcnN0ID0gZmFsc2U7XG4gICAgICAgICAgaWYgKHYpIHtcbiAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQoeCwgeSk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICh2ICYmIHZfKSBsaXN0ZW5lci5wb2ludCh4LCB5KTsgZWxzZSB7XG4gICAgICAgICAgICB2YXIgbCA9IHtcbiAgICAgICAgICAgICAgYToge1xuICAgICAgICAgICAgICAgIHg6IHhfLFxuICAgICAgICAgICAgICAgIHk6IHlfXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGI6IHtcbiAgICAgICAgICAgICAgICB4OiB4LFxuICAgICAgICAgICAgICAgIHk6IHlcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmIChjbGlwTGluZShsKSkge1xuICAgICAgICAgICAgICBpZiAoIXZfKSB7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQobC5hLngsIGwuYS55KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludChsLmIueCwgbC5iLnkpO1xuICAgICAgICAgICAgICBpZiAoIXYpIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgICAgY2xlYW4gPSBmYWxzZTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodikge1xuICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQoeCwgeSk7XG4gICAgICAgICAgICAgIGNsZWFuID0gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHhfID0geCwgeV8gPSB5LCB2XyA9IHY7XG4gICAgICB9XG4gICAgICByZXR1cm4gY2xpcDtcbiAgICB9O1xuICAgIGZ1bmN0aW9uIGNvcm5lcihwLCBkaXJlY3Rpb24pIHtcbiAgICAgIHJldHVybiBhYnMocFswXSAtIHgwKSA8IM61ID8gZGlyZWN0aW9uID4gMCA/IDAgOiAzIDogYWJzKHBbMF0gLSB4MSkgPCDOtSA/IGRpcmVjdGlvbiA+IDAgPyAyIDogMSA6IGFicyhwWzFdIC0geTApIDwgzrUgPyBkaXJlY3Rpb24gPiAwID8gMSA6IDAgOiBkaXJlY3Rpb24gPiAwID8gMyA6IDI7X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AgICAgICAgaWYgKCF2YSkgdmEgPSB7XG4gICAgICAgICAgICB4OiAoeTAgLSBmYikgLyBmbSxcbiAgICAgICAgICAgIHk6IHkwXG4gICAgICAgICAgfTsgZWxzZSBpZiAodmEueSA+PSB5MSkgcmV0dXJuO1xuICAgICAgICAgIHZiID0ge1xuICAgICAgICAgICAgeDogKHkxIC0gZmIpIC8gZm0sXG4gICAgICAgICAgICB5OiB5MVxuICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKCF2YSkgdmEgPSB7XG4gICAgICAgICAgICB4OiAoeTEgLSBmYikgLyBmbSxcbiAgICAgICAgICAgIHk6IHkxXG4gICAgICAgICAgfTsgZWxzZSBpZiAodmEueSA8IHkwKSByZXR1cm47XG4gICAgICAgICAgdmIgPSB7XG4gICAgICAgICAgICB4OiAoeTAgLSBmYikgLyBmbSxcbiAgICAgICAgICAgIHk6IHkwXG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKGx5IDwgcnkpIHtcbiAgICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICAgIHg6IHgwLFxuICAgICAgICAgICAgeTogZm0gKiB4MCArIGZiXG4gICAgICAgICAgfTsgZWxzZSBpZiAodmEueCA+PSB4MSkgcmV0dXJuO1xuICAgICAgICAgIHZiID0ge1xuICAgICAgICAgICAgeDogeDEsXG4gICAgICAgICAgICB5OiBmbSAqIHgxICsgZmJcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICghdmEpIHZhID0ge1xuICAgICAgICAgICAgeDogeDEsXG4gICAgICAgICAgICB5OiBmbSAqIHgxICsgZmJcbiAgICAgICAgICB9OyBlbHNlIGlmICh2YS54IDwgeDApIHJldHVybjtcbiAgICAgICAgICB2YiA9IHtcbiAgICAgICAgICAgIHg6IHgwLFxuICAgICAgICAgICAgeTogZm0gKiB4MCArIGZiXG4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IHBhcmVudCA9IGFmdGVyLlU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBwYXJlbnQuQyA9IGZhbHNlO1xuICAgICAgICAgICAgZ3JhbmRwYS5DID0gdHJ1ZTtcbiAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlUmlnaHQodGhpcywgZ3JhbmRwYSk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHVuY2xlID0gZ3JhbmRwYS5MO1xuICAgICAgICAgIGlmICh1bmNsZSAmJiB1bmNsZS5DKSB7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHVuY2xlLkMgPSBmYWxzZTtcbiAgICAgICAgICAgIGdyYW5kcGEuQyA9IHRydWU7XG4gICAgICAgICAgICBhZnRlciA9IGdyYW5kcGE7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChhZnRlciA9PT0gcGFyZW50LkwpIHtcbiAgICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVSaWdodCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgICAgICBhZnRlciA9IHBhcmVudDtcbiAgICAgICAgICAgICAgcGFyZW50ID0gYWZ0ZXIuVTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBhcmVudC5DID0gZmFsc2U7XG4gICAgICAgICAgICBncmFuZHBhLkMgPSB0cnVlO1xuICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVMZWZ0KHRoaXMsIGdyYW5kcGEpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBwYXJlbnQgPSBhZnRlci5VO1xuICAgICAgfVxuICAgICAgdGhpcy5fLkMgPSBmYWxzZTtcbiAgICB9LFxuICAgIHJlbW92ZTogZnVuY3Rpb24obm9kZSkge1xuICAgICAgaWYgKG5vZGUuTikgbm9kZS5OLlAgPSBub2RlLlA7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fSBlbHNlIHtcbiAgICAgICAgcmVkID0gbm9kZS5DO1xuICAgICAgICBub2RlID0gbmV4dDtcbiAgICAgIH1cbiAgICAgIGlmIChub2RlKSBub2RlLlUgPSBwYXJlbnQ7XG4gICAgICBpZiAocmVkKSByZXR1cm47XG4gICAgICBpZiAobm9kZSAmJiBub2RlLkMpIHtcbiAgICAgICAgbm9kZS5DID0gZmFsc2U7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cbiAgICAgIGRvIHtcbiAgICAgICAgaWYgKG5vZGUgPT09IHRoaXMuXykgYnJlYWs7XG4gICAgICAgIGlmIChub2RlID09PSBwYXJlbnQuTCkge1xuICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuUjtcbiAgICAgICAgICBpZiAoc2libGluZy5DKSB7XG4gICAgICAgICAgICBzaWJsaW5nLkMgPSBmYWxzZTtcbiAgICAgICAgICAgIHBhcmVudC5DID0gdHJ1ZTtcbiAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlTGVmdCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgICAgc2libGluZyA9IHBhcmVudC5SO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoc2libGluZy5MICYmIHNpYmxpbmcuTC5DIHx8IHNpYmxpbmcuUiAmJiBzaWJsaW5nLlIuQykge1xuICAgICAgICAgICAgaWYgKCFzaWJsaW5nLlIgfHwgIXNpYmxpbmcuUi5DKSB7XG4gICAgICAgICAgICAgIHNpYmxpbmcuTC5DID0gZmFsc2U7XG4gICAgICAgICAgICAgIHNpYmxpbmcuQyA9IHRydWU7XG4gICAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlUmlnaHQodGhpcywgc2libGluZyk7XG4gICAgICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuUjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHNpYmxpbmcuQyA9IHBhcmVudC5DO1xuICAgICAgICAgICAgcGFyZW50LkMgPSBzaWJsaW5nLlIuQyA9IGZhbHNlO1xuICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVMZWZ0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICBub2RlID0gdGhpcy5fO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuTDtcbiAgICAgICAgICBpZiAoc2libGluZy5DKSB7XG4gICAgICAgICAgICBzaWJsaW5nLkMgPSBmYWxzZTtcbiAgICAgICAgICAgIHBhcmVudC5DID0gdHJ1ZTtcbiAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlUmlnaHQodGhpcywgcGFyZW50KTtcbiAgICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuTDtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHNpYmxpbmcuTCAmJiBzaWJsaW5nLkwuQyB8fCBzaWJsaW5nLlIgJiYgc2libGluZy5SLkMpIHtcbiAgICAgICAgICAgIGlmICghc2libGluZy5MIHx8ICFzaWJsaW5nLkwuQykge1xuICAgICAgICAgICAgICBzaWJsaW5nLlIuQyA9IGZhbHNlO1xuICAgICAgICAgICAgICBzaWJsaW5nLkMgPSB0cnVlO1xuICAgICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZUxlZnQodGhpcywgc2libGluZyk7XG4gICAgICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuTDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHNpYmxpbmcuQyA9IHBhcmVudC5DO1xuICAgICAgICAgICAgcGFyZW50LkMgPSBzaWJsaW5nLkwuQyA9IGZhbHNlO1xuICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVSaWdodCh0aGlzLCBwYXJlbnQ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Ml8sIHkyXztcbiAgICAgIGlmICh4MSAhPSBudWxsKSB7XG4gICAgICAgIHgxXyA9IHgxLCB5MV8gPSB5MSwgeDJfID0geDIsIHkyXyA9IHkyO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgeDJfID0geTJfID0gLSh4MV8gPSB5MV8gPSBJbmZpbml0eSk7XG4gICAgICAgIHhzID0gW10sIHlzID0gW107XG4gICAgICAgIG4gPSBkYXRhLmxlbmd0aDtcbiAgICAgICAgaWYgKGNvbXBhdCkgZm9yIChpID0gMDsgaSA8IG47ICsraSkge1xuICAgICAgICAgIGQgPSBkYXRhW2ldO1xuICAgICAgICAgIGlmIChkLnggPCB4MV8pIHgxXyA9IGQueDtcbiAgICAgICAgICBpZiAoZC55IDwgeTFfKSB5MV8gPSBkLnk7XG4gICAgICAgICAgaWYgKGQueCA+IHgyXykgeDJfID0gZC54O1xuICAgICAgICAgIGlmIChkLnkgPiB5Ml8pIHkyXyA9IGQueTtcbiAgICAgICAgICB4cy5wdXNoKGQueCk7XG4gICAgICAgICAgeXMucHVzaChkLnkpO1xuICAgICAgICB9IGVsc2UgZm9yIChpID0gMDsgaSA8IG47ICsraSkge1xuICAgICAgICAgIHZhciB4XyA9ICtmeChkID0gZGF0YVtpXSwgaSksIHlfID0gK2Z5KGQsIGkpO1xuICAgICAgICAgIGlmICh4XyA8IHgxXykgeDFfID0geF87XG4gICAgICAgICAgaWYgKHlfIDwgeTFfKSB5MV8gPSB5XztcbiAgICAgICAgICBpZiAoeF8gPiB4Ml8pIHgyXyA9IHhfO1xuICAgICAgICAgIGlmICh5XyA+IHkyXykgeTJfID0geV87XG4gICAgICAgICAgeHMucHVzaCh4Xyk7XG4gICAgICAgICAgeXMucHVzaCh5Xyk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHZhciBkeCA9IHgyXyAtIHgxXywgZHkgPSB5Ml8gLSB5MV87XG4gICAgICBpZiAoZHggPiBkeSkgeTJfID0geTFfICsgZHg7IGVsc2UgeDJfID0geDFfICsgZHk7XG4gICAgICBmdW5jdGlvbiBpbnNlcnQobiwgZCwgeCwgeSwgeDEsIHkxLCB4MiwgeTIpIHtcbiAgICAgICAgaWYgKGlzTmFOKHgpIHx8IGlzTmFOKHkpKSByZXR1cm47XG4gICAgICAgIGlmIChuLmxlYWYpIHtcbiAgICAgICAgICB2YXIgbnggPSBuLngsIG55ID0gbi55O1xuICAgICAgICAgIGlmIChueCAhPSBudWxsKSB7XG4gICAgICAgICAgICBpZiAoYWJzKG54IC0geCkgKyBhYnMobnkgLSB5KSA8IC4wMSkge1xuICAgICAgICAgICAgICBpbnNlcnRDaGlsZChuLCBkLCB4LCB5LCB4MSwgeTEsIHgyLCB5Mik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB2YXIgblBvaW50ID0gbi5wb2ludDtcbiAgICAgICAgICAgICAgbi54ID0gbi55ID0gbi5wb2ludCA9IG51bGw7XG4gICAgICAgICAgICAgIGluc2VydENoaWxkKG4sIG5Qb2ludCwgbngsIG55LCB4MSwgeTEsIHgyLCB5Mik7XG4gICAgICAgICAgICAgIGluc2VydENoaWxkKG4sIGQsIHgsIHksIHgxLCB5MSwgeDIsIHkyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbi54ID0geCwgbi55ID0geSwgbi5wb2ludCA9IGQ7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGluc2VydENoaWxkKG4sIGQsIHgsIHksIHgxLCB5MSwgeDIsIHkyKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gaW5zZXJ0Q2hpbGQobiwgZCwgeCwgeSwgeDEsIHkxLCB4MiwgeTIpIHtcbiAgICAgICAgdmFyIHhtID0gKHgxICsgeDIpICogLjUsIHltID0gKHkxICsgeTIpICogLjUsIHJpZ2h0ID0geCA+PSB4bSwgYmVsb3cgPSB5ID49IHltLCBpID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W5jdGlvbihkLCBpKSB7XG4gICAgICAgICAgZC5zb3J0KGZ1bmN0aW9uKGEsIGIpIHtcbiAgICAgICAgICAgIHJldHVybiBzb3J0U3ViZ3JvdXBzKG1hdHJpeFtpXVthXSwgbWF0cml4W2ldW2JdKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgICBrID0gKM+EIC0gcGFkZGluZyAqIG4pIC8gaztcbiAgICAgIHggPSAwLCBpID0gLTE7XG4gICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICB4MCA9IHgsIGogPSAtMTtcbiAgICAgICAgd2hpbGUgKCsraiA8IG4pIHtcbiAgICAgICAgICB2YXIgZGkgPSBncm91cEluZGV4W2ldLCBkaiA9IHN1Ymdyb3VwSW5kZXhbZGldW2pdLCB2ID0gbWF0cml4W2RpXVtkal0sIGEwID0geCwgYTEgPSB4ICs9IHYgKiBrO1xuICAgICAgICAgIHN1Ymdyb3Vwc1tkaSArIFwiLVwiICsgZGpdID0ge1xuICAgICAgICAgICAgaW5kZXg6IGRpLFxuICAgICAgICAgICAgc3ViaW5kZXg6IGRqLFxuICAgICAgICAgICAgc3RhcnRBbmdsZTogYTAsXG4gICAgICAgICAgICBlbmRBbmdsZTogYTEsXG4gICAgICAgICAgICB2YWx1ZTogdlxuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgZ3JvdXBzW2RpXSA9IHtcbiAgICAgICAgICBpbmRleDogZGksXG4gICAgICAgICAgc3RhcnRBbmdsZTogeDAsXG4gICAgICAgICAgZW5kQW5nbGU6IHgsXG4gICAgICAgICAgdmFsdWU6IGdyb3VwU3Vtc1tkaV1cbiAgICAgICAgfTtcbiAgICAgICAgeCArPSBwYWRkaW5nO1xuICAgICAgfVxuICAgICAgaSA9IC0xO1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgaiA9IGkgLSAxO1xuICAgICAgICB3aGlsZSAoKytqIDwgbikge1xuICAgICAgICAgIHZhciBzb3VyY2UgPSBzdWJncm91cHNbaSArIFwiLVwiICsgal0sIHRhcmdldCA9IHN1Ymdyb3Vwc1tqICsgXCItXCIgKyBpXTtcbiAgICAgICAgICBpZiAoc291cmNlLnZhbHVlIHx8IHRhcmdldC52YWx1ZSkge1xuICAgICAgICAgICAgY2hvcmRzLnB1c2goc291cmNlLnZhbHVlIDwgdGFyZ2V0LnZhbHVlID8ge1xuICAgICAgICAgICAgICBzb3VyY2U6IHRhcmdldCxcbiAgICAgICAgICAgICAgdGFyZ2V0OiBzb3VyY2VcbiAgICAgICAgICAgIH0gOiB7XG4gICAgICAgICAgICAgIHNvdXJjZTogc291cmNlLFxuICAgICAgICAgICAgICB0YXJnZXQ6IHRhcmdldFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAoc29ydENob3JkcykgcmVzb3J0KCk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJlc29ydCgpIHtcbiAgICAgIGNob3Jkcy5zb3J0KGZ1bmN0aW9uKGEsIGIpIHtcbiAgICAgICAgcmV0dXJuIHNvcnRDaG9yZHMoKGEuc291cmNlLnZhbHVlICsgYS50YXJnZXQudmFsdWUpIC8gMiwgKGIuc291cmNlLnZhbHVlICsgYi50YXJnZXQudmFsdWUpIC8gMik7XG4gICAgICB9KTtcbiAgICB9XG4gICAgY2hvcmQubWF0cml4ID0gZnVuY3Rpb24oeCkge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbWF0cml4O1xuICAgICAgbiA9IChtYXRyaXggPSB4KSAmJiBtYXRyaXgubGVuZ3RoO1xuICAgICAgY2hvcmRzID0gZ3JvdXBzID0gbnVsbDtcbiAgICAgIHJldHVybiBjaG9yZDtcbiAgICB9O1xuICAgIGNob3JkLnBhZGRpbmcgPSBmdW5jdGlvbih4KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybi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gICAgfVxuICAgICAgICAgIGlmIChxdWFkLnBvaW50ICYmIGRuICYmIGRuIDwgY2hhcmdlRGlzdGFuY2UyKSB7XG4gICAgICAgICAgICB2YXIgayA9IHF1YWQucG9pbnRDaGFyZ2UgLyBkbjtcbiAgICAgICAgICAgIG5vZGUucHggLT0gZHggKiBrO1xuICAgICAgICAgICAgbm9kZS5weSAtPSBkeSAqIGs7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiAhcXVhZC5jaGFyZ2U7XG4gICAgICB9O1xuICAgIH1cbiAgICBmb3JjZS50aWNrID0gZnVuY3Rpb24oKSB7XG4gICAgICBpZiAoKGFscGhhICo9IC45OSkgPCAuMDA1KSB7XG4gICAgICAgIHRpbWVyID0gbnVsbDtcbiAgICAgICAgZXZlbnQuZW5kKHtcbiAgICAgICAgICB0eXBlOiBcImVuZFwiLFxuICAgICAgICAgIGFscGhhOiBhbHBoYSA9IDBcbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgICAgdmFyIG4gPSBub2Rlcy5sZW5ndGgsIG0gPSBsaW5rcy5sZW5ndGgsIHEsIGksIG8sIHMsIHQsIGwsIGssIHgsIHk7XG4gICAgICBmb3IgKGkgPSAwOyBpIDwgbTsgKytpKSB7XG4gICAgICAgIG8gPSBsaW5rc1tpXTtcbiAgICAgICAgcyA9IG8uc291cmNlO1xuICAgICAgICB0ID0gby50YXJnZXQ7XG4gICAgICAgIHggPSB0LnggLSBzLng7XG4gICAgICAgIHkgPSB0LnkgLSBzLnk7XG4gICAgICAgIGlmIChsID0geCAqIHggKyB5ICogeSkge1xuICAgICAgICAgIGwgPSBhbHBoYSAqIHN0cmVuZ3Roc1tpXSAqICgobCA9IE1hdGguc3FydChsKSkgLSBkaXN0YW5jZXNbaV0pIC8gbDtcbiAgICAgICAgICB4ICo9IGw7XG4gICAgICAgICAgeSAqPSBsO1xuICAgICAgICAgIHQueCAtPSB4ICogKGsgPSBzLndlaWdodCArIHQud2VpZ2h0ID8gcy53ZWlnaHQgLyAocy53ZWlnaHQgKyB0LndlaWdodCkgOiAuNSk7XG4gICAgICAgICAgdC55IC09IHkgKiBrO1xuICAgICAgICAgIHMueCArPSB4ICogKGsgPSAxIC0gayk7XG4gICAgICAgICAgcy55ICs9IHkgKiBrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAoayA9IGFscGhhICogZ3Jhdml0eSkge1xuICAgICAgICB4ID0gc2l6ZVswXSAvIDI7XG4gICAgICAgIHkgPSBzaXplWzFdIC8gMjtcbiAgICAgICAgaSA9IC0xO1xuICAgICAgICBpZiAoaykgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgICBvID0gbm9kZXNbaV07XG4gICAgICAgICAgby54ICs9ICh4IC0gby54KSAqIGs7XG4gICAgICAgICAgby55ICs9ICh5IC0gby55KSAqIGs7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGlmIChjaGFyZ2UpIHtcbiAgICAgICAgZDNfbGF5b3V0X2ZvcmNlQWNjdW11bGF0ZShxID0gZDMuZ2VvbS5xdWFkdHJlZShub2RlcyksIGFscGhhLCBjaGFyZ2VzKTtcbiAgICAgICAgaSA9IC0xO1xuICAgICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICAgIGlmICghKG8gPSBub2Rlc1tpXSkuZml4ZWQpIHtcbiAgICAgICAgICAgIHEudmlzaXQocmVwdWxzZShvKSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpID0gLTE7XG4gICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICBvID0gbm9kZXNbaV07XG4gICAgICAgIGlmIChvLmZpeGVkKSB7XG4gICAgICAgICAgby54ID0gby5weDtcbiAgICAgICAgICBvLnkgPSBvLnB5O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG8ueCAtPSAoby5weCAtIChvLnB4ID0gby54KSkgKiBmcmljdGlvbjtc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gICAgfTtcbiAgICBmb3JjZS5hbHBoYSA9IGZ1bmN0aW9uKHgpIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGFscGhhO1xuICAgICAgeCA9ICt4O1xuICAgICAgaWYgKGFscGhhKSB7XG4gICAgICAgIGlmICh4ID4gMCkge1xuICAgICAgICAgIGFscGhhID0geDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0aW1lci5jID0gbnVsbCwgdGltZXIudCA9IE5hTiwgdGltZXIgPSBudWxsO1xuICAgICAgICAgIGV2ZW50LmVuZCh7XG4gICAgICAgICAgICB0eXBlOiBcImVuZFwiLFxuICAgICAgICAgICAgYWxwaGE6IGFscGhhID0gMFxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9IGVsc2UgaWYgKHggPiAwKSB7XG4gICAgICAgIGV2ZW50LnN0YXJ0KHtcbiAgICAgICAgICB0eXBlOiBcInN0YXJ0XCIsXG4gICAgICAgICAgYWxwaGE6IGFscGhhID0geFxuICAgICAgICB9KTtcbiAgICAgICAgdGltZXIgPSBkM190aW1lcihmb3JjZS50aWNrKTtcbiAgICAgIH1cbiAgICAgIHJldHVybiBmb3JjZTtcbiAgICB9O1xuICAgIGZvcmNlLnN0YXJ0ID0gZnVuY3Rpb24oKSB7XG4gICAgICB2YXIgaSwgbiA9IG5vZGVzLmxlbmd0aCwgbSA9IGxpbmtzLmxlbmd0aCwgdyA9IHNpemVbMF0sIGggPSBzaXplWzFdLCBuZWlnaGJvcnMsIG87XG4gICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKSB7XG4gICAgICAgIChvID0gbm9kZXNbaV0pLmluZGV4ID0gaTtcbiAgICAgICAgby53ZWlnaHQgPSAwO1xuICAgICAgfVxuICAgICAgZm9yIChpID0gMDsgaSA8IG07ICsraSkge1xuICAgICAgICBvID0gbGlua3NbaV07XG4gICAgICAgIGlmICh0eXBlb2Ygby5zb3VyY2UgPT0gXCJudW1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0gbztcbiAgICAgICAgc3Vtcy5wdXNoKG8pO1xuICAgICAgfVxuICAgICAgZm9yIChqID0gMDsgaiA8IG07ICsraikge1xuICAgICAgICB5MFtqXSA9IChtYXggLSBzdW1zW2pdKSAvIDI7XG4gICAgICB9XG4gICAgICByZXR1cm4geTA7XG4gICAgfSxcbiAgICB3aWdnbGU6IGZ1bmN0aW9uKGRhdGEpIHtcbiAgICAgIHZhciBuID0gZGF0YS5sZW5ndGgsIHggPSBkYXRhWzBdLCBtID0geC5sZW5ndGgsIGksIGosIGssIHMxLCBzMiwgczMsIGR4LCBvLCBvMCwgeTAgPSBbXTtcbiAgICAgIHkwWzBdID0gbyA9IG8wID0gMDtcbiAgICAgIGZvciAoaiA9IDE7IGogPCBtOyArK2opIHtcbiAgICAgICAgZm9yIChpID0gMCwgczEgPSAwOyBpIDwgbjsgKytpKSBzMSArPSBkYXRhW2ldW2pdWzFdO1xuICAgICAgICBmb3IgKGkgPSAwLCBzMiA9IDAsIGR4ID0geFtqXVswXSAtIHhbaiAtIDFdWzBdOyBpIDwgbjsgKytpKSB7XG4gICAgICAgICAgZm9yIChrID0gMCwgczMgPSAoZGF0YVtpXVtqXVsxXSAtIGRhdGFbaV1baiAtIDFdWzFdKSAvICgyICogZHgpOyBrIDwgaTsgKytrKSB7XG4gICAgICAgICAgICBzMyArPSAoZGF0YVtrXVtqXVsxXSAtIGRhdGFba11baiAtIDFdWzFdKSAvIGR4O1xuICAgICAgICAgIH1cbiAgICAgICAgICBzMiArPSBzMyAqIGRhdGFbaV1bal1bMV07XG4gICAgICAgIH1cbiAgICAgICAgeTBbal0gPSBvIC09IHMxID8gczIgLyBzMSAqIGR4IDogMDtcbiAgICAgICAgaWYgKG8gPCBvMCkgbzAgPSBvO1xuICAgICAgfVxuICAgICAgZm9yIChqID0gMDsgaiA8IG07ICsraikgeTBbal0gLT0gbzA7XG4gICAgICByZXR1cm4geTA7XG4gICAgfSxcbiAgICBleHBhbmQ6IGZ1bmN0aW9uKGR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kZXNbMl07XG4gICAgICAgIGQzX2xheW91dF9wYWNrUGxhY2UoYSwgYiwgYyk7XG4gICAgICAgIGJvdW5kKGMpO1xuICAgICAgICBkM19sYXlvdXRfcGFja0luc2VydChhLCBjKTtcbiAgICAgICAgYS5fcGFja19wcmV2ID0gYztcbiAgICAgICAgZDNfbGF5b3V0X3BhY2tJbnNlcnQoYywgYik7XG4gICAgICAgIGIgPSBhLl9wYWNrX25leHQ7XG4gICAgICAgIGZvciAoaSA9IDM7IGkgPCBuOyBpKyspIHtcbiAgICAgICAgICBkM19sYXlvdXRfcGFja1BsYWNlKGEsIGIsIGMgPSBub2Rlc1tpXSk7XG4gICAgICAgICAgdmFyIGlzZWN0ID0gMCwgczEgPSAxLCBzMiA9IDE7XG4gICAgICAgICAgZm9yIChqID0gYi5fcGFja19uZXh0OyBqICE9PSBiOyBqID0gai5fcGFja19uZXh0LCBzMSsrKSB7XG4gICAgICAgICAgICBpZiAoZDNfbGF5b3V0X3BhY2tJbnRlcnNlY3RzKGosIGMpKSB7XG4gICAgICAgICAgICAgIGlzZWN0ID0gMTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChpc2VjdCA9PSAxKSB7XG4gICAgICAgICAgICBmb3IgKGsgPSBhLl9wYWNrX3ByZXY7IGsgIT09IGouX3BhY2tfcHJldjsgayA9IGsuX3BhY2tfcHJldiwgczIrKykge1xuICAgICAgICAgICAgICBpZiAoZDNfbGF5b3V0X3BhY2tJbnRlcnNlY3RzKGssIGMpKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGlzZWN0KSB7XG4gICAgICAgICAgICBpZiAoczEgPCBzMiB8fCBzMSA9PSBzMiAmJiBiLnIgPCBhLnIpIGQzX2xheW91dF9wYWNrU3BsaWNlKGEsIGIgPSBqKT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PSAobm9kZS54ICsgdHgpICoga3g7XG4gICAgICAgICAgbm9kZS55ID0gbm9kZS5kZXB0aCAqIGt5O1xuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICAgIHJldHVybiBub2RlcztcbiAgICB9XG4gICAgZnVuY3Rpb24gd3JhcFRyZWUocm9vdDApIHtcbiAgICAgIHZhciByb290MSA9IHtcbiAgICAgICAgQTogbnVsbCxcbiAgICAgICAgY2hpbGRyZW46IFsgcm9vdDAgXVxuICAgICAgfSwgcXVldWUgPSBbIHJvb3QxIF0sIG5vZGUxO1xuICAgICAgd2hpbGUgKChub2RlMSA9IHF1ZXVlLnBvcCgpKSAhPSBudWxsKSB7XG4gICAgICAgIGZvciAodmFyIGNoaWxkcmVuID0gbm9kZTEuY2hpbGRyZW4sIGNoaWxkLCBpID0gMCwgbiA9IGNoaWxkcmVuLmxlbmd0aDsgaSA8IG47ICsraSkge1xuICAgICAgICAgIHF1ZXVlLnB1c2goKGNoaWxkcmVuW2ldID0gY2hpbGQgPSB7XG4gICAgICAgICAgICBfOiBjaGlsZHJlbltpXSxcbiAgICAgICAgICAgIHBhcmVudDogbm9kZTEsXG4gICAgICAgICAgICBjaGlsZHJlbjogKGNoaWxkID0gY2hpbGRyZW5baV0uY2hpbGRyZW4pICYmIGNoaWxkLnNsaWNlKCkgfHwgW10sXG4gICAgICAgICAgICBBOiBudWxsLFxuICAgICAgICAgICAgYTogbnVsbCxcbiAgICAgICAgICAgIHo6IDAsXG4gICAgICAgICAgICBtOiAwLFxuICAgICAgICAgICAgYzogMCxcbiAgICAgICAgICAgIHM6IDAsXG4gICAgICAgICAgICB0OiBudWxsLFxuICAgICAgICAgICAgaTogaVxuICAgICAgICAgIH0pLmEgPSBjaGlsZCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiByb290MS5jaGlsZHJlblswXTtcbiAgICB9XG4gICAgZnVuY3Rpb24gZmlyc3RXYWxrKHYpIHtcbiAgICAgIHZhciBjaGlsZHJl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lZVJpZ2h0KHZpbSksIHZpcCA9IGQzX2xheW91dF90cmVlTGVmdCh2aXApLCB2aW0gJiYgdmlwKSB7XG4gICAgICAgICAgdm9tID0gZDNfbGF5b3V0X3RyZWVMZWZ0KHZvbSk7XG4gICAgICAgICAgdm9wID0gZDNfbGF5b3V0X3RyZWVSaWdodCh2b3ApO1xuICAgICAgICAgIHZvcC5hID0gdjtcbiAgICAgICAgICBzaGlmdCA9IHZpbS56ICsgc2ltIC0gdmlwLnogLSBzaXAgKyBzZXBhcmF0aW9uKHZpbS5fLCB2aXAuXyk7XG4gICAgICAgICAgaWYgKHNoaWZ0ID4gMCkge1xuICAgICAgICAgICAgZDNfbGF5b3V0X3RyZWVNb3ZlKGQzX2xheW91dF90cmVlQW5jZXN0b3IodmltLCB2LCBhbmNlc3RvciksIHYsIHNoaWZ0KTtcbiAgICAgICAgICAgIHNpcCArPSBzaGlmdDtcbiAgICAgICAgICAgIHNvcCArPSBzaGlmdDtcbiAgICAgICAgICB9XG4gICAgICAgICAgc2ltICs9IHZpbS5tO1xuICAgICAgICAgIHNpcCArPSB2aXAubTtcbiAgICAgICAgICBzb20gKz0gdm9tLm07XG4gICAgICAgICAgc29wICs9IHZvcC5tO1xuICAgICAgICB9XG4gICAgICAgIGlmICh2aW0gJiYgIWQzX2xheW91dF90cmVlUmlnaHQodm9wKSkge1xuICAgICAgICAgIHZvcC50ID0gdmltO1xuICAgICAgICAgIHZvcC5tICs9IHNpbSAtIHNvcDtcbiAgICAgICAgfVxuICAgICAgICBpZiAodmlwICYmICFkM19sYXlvdXRfdHJlZUxlZnQodm9tKSkge1xuICAgICAgICAgIHZvbS50ID0gdmlwO1xuICAgICAgICAgIHZvbS5tICs9IHNpcCAtIHNvbTtcbiAgICAgICAgICBhbmNlc3RvciA9IHY7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiBhbmNlc3RvcjtcbiAgICB9XG4gICAgZnVuY3Rpb24gc2l6ZU5vZGUobm9kZSkge1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dGVyKHJvb3QsIG5vZGVTaXplID8gZnVuY3Rpb24obm9kZSkge1xuICAgICAgICBub2RlLnggPSAobm9kZS54IC0gcm9vdC54KSAqIHNpemVbMF07XG4gICAgICAgIG5vZGUueSA9IChyb290LnkgLSBub2RlLnkpICogc2l6ZVsxXTtcbiAgICAgIH0gOiBmdW5jdGlvbihub2RlKSB7XG4gICAgICAgIG5vZGUueCA9IChub2RlLnggLSB4MCkgLyAoeDEgLSB4MCkgKiBzaXplWzBdO1xuICAgICAgICBub2RlLnkgPSAoMSAtIChyb290LnkgPyBub2RlLnkgLyByb290LnkgOiAxKSkgKiBzaXplWzFdO1xuICAgICAgfSk7XG4gICAgICByZXR1cm4gbm9kZXM7XG4gICAgfVxuICAgIGNsdXN0ZXIuc2VwYXJhdGlvbiA9IGZ1bmN0aW9uKHgpIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNlcGFyYXRpb247XG4gICAgICBzZXBhcmF0aW9uID0geDtcbiAgICAgIHJldHVybiBjbHVzdGVyO1xuICAgIH07XG4gICAgY2x1c3Rlci5zaXplID0gZnVuY3Rpb24oeCkge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbm9kZVNpemUgPyBudWxsIDogc2l6ZTtcbiAgICAgIG5vZGVTaXplID0gKHNpemUgPSB4KSA9PSBudWxsO1xuICAgICAgcmV0dXJuIGNsdXN0ZXI7XG4gICAgfTtcbiAgICBjbHVzdGVyLm5vZGVTaXplID0gZnVuY3Rpb24oeCkge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbm9kZVNpemUgPyBzaXplIDogbnVsbDtcbiAgICAgIG5vZGVTaXplID0gKHNpemUgPSB4KSAhPSBudWxsO1xuICAgICAgcmV0dXJuIGNsdXN0ZXI7XG4gICAgfTtcbiAgICByZXR1cm4gZDNfbGF5b3V0X2hpZXJhcmNoeVJlYmluZChjbHVzdGVyLCBoaWV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xuICAgICAgICAgIHJvdy5wdXNoKGNoaWxkID0gcmVtYWluaW5nW24gLSAxXSk7XG4gICAgICAgICAgcm93LmFyZWEgKz0gY2hpbGQuYXJlYTtcbiAgICAgICAgICBpZiAobW9kZSAhPT0gXCJzcXVhcmlmeVwiIHx8IChzY29yZSA9IHdvcnN0KHJvdywgdSkpIDw9IGJlc3QpIHtcbiAgICAgICAgICAgIHJlbWFpbmluZy5wb3AoKTtcbiAgICAgICAgICAgIGJlc3QgPSBzY29yZTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcm93LmFyZWEgLT0gcm93LnBvcCgpLmFyZWE7XG4gICAgICAgICAgICBwb3NpdGlvbihyb3csIHUsIHJlY3QsIGZhbHNlKTtcbiAgICAgICAgICAgIHUgPSBNYXRoLm1pbihyZWN0LmR4LCByZWN0LmR5KTtcbiAgICAgICAgICAgIHJvdy5sZW5ndGggPSByb3cuYXJlYSA9IDA7XG4gICAgICAgICAgICBiZXN0ID0gSW5maW5pdHk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChyb3cubGVuZ3RoKSB7XG4gICAgICAgICAgcG9zaXRpb24ocm93LCB1LCByZWN0LCB0cnVlKTtcbiAgICAgICAgICByb3cubGVuZ3RoID0gcm93LmFyZWEgPSAwO1xuICAgICAgICB9XG4gICAgICAgIGNoaWxkcmVuLmZvckVhY2goc3F1YXJpZnkpO1xuICAgICAgfVxuICAgIH1cbiAgICBmdW5jdGlvbiBzdGlja2lmeShub2RlKSB7XG4gICAgICB2YXIgY2hpbGRyZW4gPSBub2RlLmNoaWxkcmVuO1xuICAgICAgaWYgKGNoaWxkcmVuICYmIGNoaWxkcmVuLmxlbmd0aCkge1xuICAgICAgICB2YXIgcmVjdCA9IHBhZChub2RlKSwgcmVtYWluaW5nID0gY2hpbGRyZW4uc2xpY2UoKSwgY2hpbGQsIHJvdyA9IFtdO1xuICAgICAgICBzY2FsZShyZW1haW5pbmcsIHJlY3QuZHggKiByZWN0LmR5IC8gbm9kZS52YWx1ZSk7XG4gICAgICAgIHJvdy5hcmVhID0gMDtcbiAgICAgICAgd2hpbGUgKGNoaWxkID0gcmVtYWluaW5nLnBvcCgpKSB7XG4gICAgICAgICAgcm93LnB1c2goY2hpbGQpO1xuICAgICAgICAgIHJvdy5hcmVhICs9IGNoaWxkLmFyZWE7XG4gICAgICAgICAgaWYgKGNoaWxkLnogIT0gbnVsbCkge1xuICAgICAgICAgICAgcG9zaXRpb24ocm93LCBjaGlsZC56ID8gcmVjdC5keCA6IHJlY3QuZHksIHJlY3QsICFyZW1haW5pbmcubGVuZ3RoKTtcbiAgICAgICAgICAgIHJvdy5sZW5ndGggPSByb3cuYXJlYSA9IDA7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGNoaWxkcmVuLmZvckVhY2goc3RpY2tpZnkpO1xuICAgICAgfVxuICAgIH1cbiAgICBmdW5jdGlvbiB3b3JzdChyb3csIHUpIHtcbiAgICAgIHZhciBzID0gcm93LmFyZWEsIHIsIHJtYXggPSAwLCBybWluID0gSW5maW5pdHksIGkgPSAtMSwgbiA9IHJvdy5sZW5ndGg7XG4gICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICBpZiAoIShyID0gcm93W2ldLmFyZWEpKSBjb250aW51ZTtcbiAgICAgICAgaWYgKHIgPCBybWluKSBybWluID0gcjtcbiAgICAgICAgaWYgKHIgPiBybWF4KSBybWF4ID0gcjtcbiAgICAgIH1cbiAgICAgIHMgKj0gcztcbiAgICAgIHUgKj0gdTtcbiAgICAgIHJldHVybiBzID8gTWF0aC5tYXgodSAqIHJtYXggKiByYXRpbyAvIHMsIHMgLyAodSAqIHJtaW4gKiByYXRpbykpIDogSW5maW5pdHk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHBvc2l0aW9uKHJvdywgdSwgcmVjdCwgZmx1c2gpIHtcbiAgICAgIHZhciBpID0gLTEsIG4gPSByb3cubGVuZ3RoLCB4ID0gcmVjdC54LCB5ID0gcmVjdC55LCB2ID0gdSA/IHJvdW5kKHJvdy5hcmVhIC8gdSkgOiAwLCBvO1xuICAgICAgaWYgKHUgPT0gcmVjdC5keCkge1xuICAgICAgICBpZiAoZmx1c2ggfHwgdiA+IHJlY3QuZHkpIHYgPSByZWN0LmR5O1xuICAgICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICAgIG8gPSByb3dbaV07XG4gICAgICAgICAgby54ID0geDtcbiAgICAgICAgICBvLnkgPSB5O1xuICAgICAgICAgIG8uZHkgPSB2O1xuICAgICAgICAgIHggKz0gby5keCA9IE1hdGgubWluKHJlY3QueCArIHJlY3QuZHggLSB4LCB2ID8gcm91bmQoby5hcmVhIC8gdikgOiAwKTtcbiAgICAgICAgfVxuICAgICAgICBvLnogPSB0cnVlO1xuICAgICAgICBvLmR4ICs9IHJlY3QueCArIHJlY3QuZHggLSB4O1xuICAgICAgICByZWN0LnkgKz0gdjtcbiAgICAgICAgcmVjdC5keSAtPSB2O1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKGZsdXNoIHx8IHYgPiByZWN0LmR4KSB2ID0gcmVjdC5keDtcbiAgICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgICBvID0gcm93W2ldO1xuICAgICAgICAgIG8ueCA9IHg7XG4gICAgICAgICAgby55ID0geTtcbiAgICAgICAgICBvLmR4ID0gdjtcbiAgICAgICAgICB5ICs9IG8uZHkgPSBNYXRoLm1pbihyZWN0LnkgKyByZWN0LmR5IC0geSwgdiA/IHJvdW5kKG8uYXJlYSAvIHYpIDogMCk7XG4gICAgICAgIH1cbiAgICAgICAgby56ID0gZmFsc2U7XG4gICAgICAgIG8uZHkgKz0gcmVjdC55ICsgcmVjdC5keSAtIHk7XG4gICAgICAgIHJlY3QueCArPSB2O1xuICAgICAgICByZWN0LmR4IC09IHY7XG4gICAgICB9XG4gICAgfVxuICAgIGZ1bmN0aW9uIHRyZWVtYXAoZCkge1xuICAgICAgdm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ICAgICB2YXIgeCwgeSwgcjtcbiAgICAgICAgZG8ge1xuICAgICAgICAgIHggPSBNYXRoLnJhbmRvbSgpICogMiAtIDE7XG4gICAgICAgICAgeSA9IE1hdGgucmFuZG9tKCkgKiAyIC0gMTtcbiAgICAgICAgICByID0geCAqIHggKyB5ICogeTtcbiAgICAgICAgfSB3aGlsZSAoIXIgfHwgciA+IDEpO1xuICAgICAgICByZXR1cm4gwrUgKyDPgyAqIHggKiBNYXRoLnNxcnQoLTIgKiBNYXRoLmxvZyhyKSAvIHIpO1xuICAgICAgfTtcbiAgICB9LFxuICAgIGxvZ05vcm1hbDogZnVuY3Rpb24oKSB7XG4gICAgICB2YXIgcmFuZG9tID0gZDMucmFuZG9tLm5vcm1hbC5hcHBseShkMywgYXJndW1lbnRzKTtcbiAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIE1hdGguZXhwKHJhbmRvbSgpKTtcbiAgICAgIH07XG4gICAgfSxcbiAgICBiYXRlczogZnVuY3Rpb24obSkge1xuICAgICAgdmFyIHJhbmRvbSA9IGQzLnJhbmRvbS5pcndpbkhhbGwobSk7XG4gICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgIHJldHVybiByYW5kb20oKSAvIG07XG4gICAgICB9O1xuICAgIH0sXG4gICAgaXJ3aW5IYWxsOiBmdW5jdGlvbihtKSB7XG4gICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgIGZvciAodmFyIHMgPSAwLCBqID0gMDsgaiA8IG07IGorKykgcyArPSBNYXRoLnJhbmRvbSgpO1xuICAgICAgICByZXR1cm4gcztcbiAgICAgIH07XG4gICAgfVxuICB9O1xuICBkMy5zY2FsZSA9IHt9O1xuICBmdW5jdGlvbiBkM19zY2FsZUV4dGVudChkb21haW4pIHtcbiAgICB2YXIgc3RhcnQgPSBkb21haW5bMF0sIHN0b3AgPSBkb21haW5bZG9tYWluLmxlbmd0aCAtIDFdO1xuICAgIHJ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Chsb2cpKTtcbiAgICAgIHJldHVybiBzY2FsZTtcbiAgICB9O1xuICAgIHNjYWxlLm5pY2UgPSBmdW5jdGlvbigpIHtcbiAgICAgIHZhciBuaWNlZCA9IGQzX3NjYWxlX25pY2UoZG9tYWluLm1hcChsb2cpLCBwb3NpdGl2ZSA/IE1hdGggOiBkM19zY2FsZV9sb2dOaWNlTmVnYXRpdmUpO1xuICAgICAgbGluZWFyLmRvbWFpbihuaWNlZCk7XG4gICAgICBkb21haW4gPSBuaWNlZC5tYXAocG93KTtcbiAgICAgIHJldHVybiBzY2FsZTtcbiAgICB9O1xuICAgIHNjYWxlLnRpY2tzID0gZnVuY3Rpb24oKSB7XG4gICAgICB2YXIgZXh0ZW50ID0gZDNfc2NhbGVFeHRlbnQoZG9tYWluKSwgdGlja3MgPSBbXSwgdSA9IGV4dGVudFswXSwgdiA9IGV4dGVudFsxXSwgaSA9IE1hdGguZmxvb3IobG9nKHUpKSwgaiA9IE1hdGguY2VpbChsb2codikpLCBuID0gYmFzZSAlIDEgPyAyIDogYmFzZTtcbiAgICAgIGlmIChpc0Zpbml0ZShqIC0gaSkpIHtcbiAgICAgICAgaWYgKHBvc2l0aXZlKSB7XG4gICAgICAgICAgZm9yICg7aSA8IGo7IGkrKykgZm9yICh2YXIgayA9IDE7IGsgPCBuOyBrKyspIHRpY2tzLnB1c2gocG93KGkpICogayk7XG4gICAgICAgICAgdGlja3MucHVzaChwb3coaSkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRpY2tzLnB1c2gocG93KGkpKTtcbiAgICAgICAgICBmb3IgKDtpKysgPCBqOyApIGZvciAodmFyIGsgPSBuIC0gMTsgayA+IDA7IGstLSkgdGlja3MucHVzaChwb3coaSkgKiBrKTtcbiAgICAgICAgfVxuICAgICAgICBmb3IgKGkgPSAwOyB0aWNrc1tpXSA8IHU7IGkrKykge31cbiAgICAgICAgZm9yIChqID0gdGlja3MubGVuZ3RoOyB0aWNrc1tqIC0gMV0gPiB2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Z3VtZW50cykgfHwgMCkgLyAyKSB7XG4gICAgICAgIHJwID0gcGFkUmFkaXVzID09PSBkM19zdmdfYXJjQXV0byA/IE1hdGguc3FydChyMCAqIHIwICsgcjEgKiByMSkgOiArcGFkUmFkaXVzLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG4gICAgICAgIGlmICghY3cpIHAxICo9IC0xO1xuICAgICAgICBpZiAocjEpIHAxID0gZDNfYXNpbihycCAvIHIxICogTWF0aC5zaW4oYXApKTtcbiAgICAgICAgaWYgKHIwKSBwMCA9IGQzX2FzaW4ocnAgLyByMCAqIE1hdGguc2luKGFwKSk7XG4gICAgICB9XG4gICAgICBpZiAocjEpIHtcbiAgICAgICAgeDAgPSByMSAqIE1hdGguY29zKGEwICsgcDEpO1xuICAgICAgICB5MCA9IHIxICogTWF0aC5zaW4oYTAgKyBwMSk7XG4gICAgICAgIHgxID0gcjEgKiBNYXRoLmNvcyhhMSAtIHAxKTtcbiAgICAgICAgeTEgPSByMSAqIE1hdGguc2luKGExIC0gcDEpO1xuICAgICAgICB2YXIgbDEgPSBNYXRoLmFicyhhMSAtIGEwIC0gMiAqIHAxKSA8PSDPgCA/IDAgOiAxO1xuICAgICAgICBpZiAocDEgJiYgZDNfc3ZnX2FyY1N3ZWVwKHgwLCB5MCwgeDEsIHkxKSA9PT0gY3cgXiBsMSkge1xuICAgICAgICAgIHZhciBoMSA9IChhMCArIGExKSAvIDI7XG4gICAgICAgICAgeDAgPSByMSAqIE1hdGguY29zKGgxKTtcbiAgICAgICAgICB5MCA9IHIxICogTWF0aC5zaW4oaDEpO1xuICAgICAgICAgIHgxID0geTEgPSBudWxsO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB4MCA9IHkwID0gMDtcbiAgICAgIH1cbiAgICAgIGlmIChyMCkge1xuICAgICAgICB4MiA9IHIwICogTWF0aC5jb3MoYTEgLSBwMCk7XG4gICAgICAgIHkyID0gcjAgKiBNYXRoLnNpbihhMSAtIHAwKTtcbiAgICAgICAgeDMgPSByMCAqIE1hdGguY29zKGEwICsgcDApO1xuICAgICAgICB5MyA9IHIwICogTWF0aC5zaW4oYTAgKyBwMCk7XG4gICAgICAgIHZhciBsMCA9IE1hdGguYWJzKGEwIC0gYTEgKyAyICogcDApIDw9IM+AID8gMCA6IDE7XG4gICAgICAgIGlmIChwMCAmJiBkM19zdmdfYXJjU3dlZXAoeDIsIHkyLCB4MywgeTMpID09PSAxIC0gY3cgXiBsMCkge1xuICAgICAgICAgIHZhciBoMCA9IChhMCArIGExKSAvIDI7XG4gICAgICAgICAgeDIgPSByMCAqIE1hdGguY29zKGgwKTtcbiAgICAgICAgICB5MiA9IHIwICogTWF0aC5zaW4oaDApO1xuICAgICAgICAgIHgzID0geTMgPSBudWxsO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB4MiA9IHkyID0gMDtcbiAgICAgIH1cbiAgICAgIGlmIChkYSA+IM61ICYmIChyYyA9IE1hdGgubWluKE1hdGguYWJzKHIxIC0gcjApIC8gMiwgK2Nvcm5lclJhZGl1cy5hcHBseSh0aGlzLCBhcmd1bWVudHMpKSkgPiAuMDAxKSB7XG4gICAgICAgIGNyID0gcjAgPCByMSBeIGN3ID8gMCA6IDE7XG4gICAgICAgIHZhciByYzEgPSByYywgcmMwID0gcmM7XG4gICAgICAgIGlmIChkYSA8IM+AKSB7XG4gICAgICAgICAgdmFyIG9jID0geDMgPT0gbnVsbCA/IFsgeDIsIHkyIF0gOiB4MSA9PSBudWxsID8gWyB4MCwgeTAgXSA6IGQzX2dlb21fcG9seWdvbkludGVyc2VjdChbIHgwLCB5MCBdLCBbIHgzLCB5MyBdLCBbIHgxLCB5MSBdLCBbIHgyLCB5MiBdKSwgYXggPSB4MCAtIG9jWzBdLCBheSA9IHkwIC0gb2NbMV0sIGJ4ID0geDEgLSBvY1swXSwgYnkgPSB5MSAtIG9jWzFdLCBrYyA9IDEgLyBNYXRoLnNpbihNYXRoLmFjb3M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W4oXCJcIikgOiBudWxsO1xuICAgIH1cbiAgICBhcmVhLnggPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB4MTtcbiAgICAgIHgwID0geDEgPSBfO1xuICAgICAgcmV0dXJuIGFyZWE7XG4gICAgfTtcbiAgICBhcmVhLngwID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geDA7XG4gICAgICB4MCA9IF87XG4gICAgICByZXR1cm4gYXJlYTtcbiAgICB9O1xuICAgIGFyZWEueDEgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB4MTtcbiAgICAgIHgxID0gXztcbiAgICAgIHJldHVybiBhcmVhO1xuICAgIH07XG4gICAgYXJlYS55ID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geTE7XG4gICAgICB5MCA9IHkxID0gXztcbiAgICAgIHJldHVybiBhcmVhO1xuICAgIH07XG4gICAgYXJlYS55MCA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHkwO1xuICAgICAgeTAgPSBfO1xuICAgICAgcmV0dXJuIGFyZWE7XG4gICAgfTtcbiAgICBhcmVhLnkxID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geTE7XG4gICAgICB5MSA9IF87XG4gICAgICByZXR1cm4gYXJlYTtcbiAgICB9O1xuICAgIGFyZWEuZGVmaW5lZCA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGRlZmluZWQ7XG4gICAgICBkZWZpbmVkID0gXztcbiAgICAgIHJldHVybiBhcmVhO1xuICAgIH07XG4gICAgYXJlYS5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RpdmUudGltZXIudCA9IE5hTjtcbiAgICAgICAgLS1sb2NrLmNvdW50O1xuICAgICAgICBkZWxldGUgbG9ja1thY3RpdmVJZF07XG4gICAgICAgIGFjdGl2ZS5ldmVudCAmJiBhY3RpdmUuZXZlbnQuaW50ZXJydXB0LmNhbGwobm9kZSwgbm9kZS5fX2RhdGFfXywgYWN0aXZlLmluZGV4KTtcbiAgICAgIH1cbiAgICAgIGZvciAodmFyIGNhbmNlbElkIGluIGxvY2spIHtcbiAgICAgICAgaWYgKCtjYW5jZWxJZCA8IGlkKSB7XG4gICAgICAgICAgdmFyIGNhbmNlbCA9IGxvY2tbY2FuY2VsSWRdO1xuICAgICAgICAgIGNhbmNlbC50aW1lci5jID0gbnVsbDtcbiAgICAgICAgICBjYW5jZWwudGltZXIudCA9IE5hTjtcbiAgICAgICAgICAtLWxvY2suY291bnQ7XG4gICAgICAgICAgZGVsZXRlIGxvY2tbY2FuY2VsSWRdO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICB0aW1lci5jID0gdGljaztcbiAgICAgIGQzX3RpbWVyKGZ1bmN0aW9uKCkge1xuICAgICAgICBpZiAodGltZXIuYyAmJiB0aWNrKGVsYXBzZWQgfHwgMSkpIHtcbiAgICAgICAgICB0aW1lci5jID0gbnVsbDtcbiAgICAgICAgICB0aW1lci50ID0gTmFOO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiAxO1xuICAgICAgfSwgMCwgdGltZSk7XG4gICAgICBsb2NrLmFjdGl2ZSA9IGlkO1xuICAgICAgdHJhbnNpdGlvbi5ldmVudCAmJiB0cmFuc2l0aW9uLmV2ZW50LnN0YXJ0LmNhbGwobm9kZSwgbm9kZS5fX2RhdGFfXywgaSk7XG4gICAgICB0d2VlbnMgPSBbXTtcbiAgICAgIHRyYW5zaXRpb24udHdlZW4uZm9yRWFjaChmdW5jdGlvbihrZXksIHZhbHVlKSB7XG4gICAgICAgIGlmICh2YWx1ZSA9IHZhbHVlLmNhbGwobm9kZSwgb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kMy5zZWxlY3QodGhpcykudHJhbnNpdGlvbigpLmVhY2goXCJzdGFydC5icnVzaFwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHhFeHRlbnREb21haW4gPSBleHRlbnQwLmk7XG4gICAgICAgICAgICB5RXh0ZW50RG9tYWluID0gZXh0ZW50MC5qO1xuICAgICAgICAgICAgeEV4dGVudCA9IGV4dGVudDAueDtcbiAgICAgICAgICAgIHlFeHRlbnQgPSBleHRlbnQwLnk7XG4gICAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgICB0eXBlOiBcImJydXNoc3RhcnRcIlxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSkudHdlZW4oXCJicnVzaDpicnVzaFwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHZhciB4aSA9IGQzX2ludGVycG9sYXRlQXJyYXkoeEV4dGVudCwgZXh0ZW50MS54KSwgeWkgPSBkM19pbnRlcnBvbGF0ZUFycmF5KHlFeHRlbnQsIGV4dGVudDEueSk7XG4gICAgICAgICAgICB4RXh0ZW50RG9tYWluID0geUV4dGVudERvbWFpbiA9IG51bGw7XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24odCkge1xuICAgICAgICAgICAgICB4RXh0ZW50ID0gZXh0ZW50MS54ID0geGkodCk7XG4gICAgICAgICAgICAgIHlFeHRlbnQgPSBleHRlbnQxLnkgPSB5aSh0KTtcbiAgICAgICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBcImJydXNoXCIsXG4gICAgICAgICAgICAgICAgbW9kZTogXCJyZXNpemVcIlxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfSkuZWFjaChcImVuZC5icnVzaFwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHhFeHRlbnREb21haW4gPSBleHRlbnQxLmk7XG4gICAgICAgICAgICB5RXh0ZW50RG9tYWluID0gZXh0ZW50MS5qO1xuICAg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ICAgIGJydXNobW92ZSgpO1xuICAgICAgZnVuY3Rpb24ga2V5ZG93bigpIHtcbiAgICAgICAgaWYgKGQzLmV2ZW50LmtleUNvZGUgPT0gMzIpIHtcbiAgICAgICAgICBpZiAoIWRyYWdnaW5nKSB7XG4gICAgICAgICAgICBjZW50ZXIgPSBudWxsO1xuICAgICAgICAgICAgb3JpZ2luWzBdIC09IHhFeHRlbnRbMV07XG4gICAgICAgICAgICBvcmlnaW5bMV0gLT0geUV4dGVudFsxXTtcbiAgICAgICAgICAgIGRyYWdnaW5nID0gMjtcbiAgICAgICAgICB9XG4gICAgICAgICAgZDNfZXZlbnRQcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBrZXl1cCgpIHtcbiAgICAgICAgaWYgKGQzLmV2ZW50LmtleUNvZGUgPT0gMzIgJiYgZHJhZ2dpbmcgPT0gMikge1xuICAgICAgICAgIG9yaWdpblswXSArPSB4RXh0ZW50WzFdO1xuICAgICAgICAgIG9yaWdpblsxXSArPSB5RXh0ZW50WzFdO1xuICAgICAgICAgIGRyYWdnaW5nID0gMDtcbiAgICAgICAgICBkM19ldmVudFByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGJydXNobW92ZSgpIHtcbiAgICAgICAgdmFyIHBvaW50ID0gZDMubW91c2UodGFyZ2V0KSwgbW92ZWQgPSBmYWxzZTtcbiAgICAgICAgaWYgKG9mZnNldCkge1xuICAgICAgICAgIHBvaW50WzBdICs9IG9mZnNldFswXTtcbiAgICAgICAgICBwb2ludFsxXSArPSBvZmZzZXRbMV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFkcmFnZ2luZykge1xuICAgICAgICAgIGlmIChkMy5ldmVudC5hbHRLZXkpIHtcbiAgICAgICAgICAgIGlmICghY2VudGVyKSBjZW50ZXIgPSBbICh4RXh0ZW50WzBdICsgeEV4dGVudFsxXSkgLyAyLCAoeUV4dGVudFswXSArIHlFeHRlbnRbMV0pIC8gMiBdO1xuICAgICAgICAgICAgb3JpZ2luWzBdID0geEV4dGVudFsrKHBvaW50WzBdIDwgY2VudGVyWzBdKV07XG4gICAgICAgICAgICBvcmlnaW5bMV0gPSB5RXh0ZW50WysocG9pbnRbMV0gPCBjZW50ZXJbMV0pXTtcbiAgICAgICAgICB9IGVsc2UgY2VudGVyID0gbnVsbDtcbiAgICAgICAgfVxuICAgICAgICBpZiAocmVzaXppbmdYICYmIG1vdmUxKHBvaW50LCB4LCAwKSkge1xuICAgICAgICAgIHJlZHJhd1goZyk7XG4gICAgICAgICAgbW92ZWQgPSB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIGlmIChyZXNpemluZ1kgJiYgbW92ZTEocG9pbnQsIHksIDEpKSB7XG4gICAgICAgICAgcmVkcmF3WShnKTtcbiAgICAgICAgICBtb3ZlZCA9IHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1vdmVkKSB7XG4gICAgICAgICAgcmVkcmF3KGcpO1xuICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICB0eXBlOiBcImJydXNoXCIsXG4gICAgICAgICAgICBtb2RlOiBkcmFnZ2luZyA/IFwibW92ZVwiIDogXCJyZXNpemVcIlxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBtb3ZlMShwb2ludCwgc2NhbGUsIGkpIHtcbiAgICAgICAgdmFyIHJhbmdlID0gZDNfc2NhbGVSYW5nZShzY2FsZSksIHIwID0gcmFuZ2VbMF0sIHIxID0gcmFuZ2VbMV0sIHBvc2l0aW9uID0gb3JpZ2luW2ldLCBleHRlbnQgPSBpID8geUV4dGVudCA6IHhFeHRlbnQsIHNpemUgPSBleHRlbnRbMV0gLSBleHRlbnRbMF0sIG1pbiwgbWF4O1xuICAgICAgICBpZiAoZHJhZ2dpbmcpIHtcbiAgICAgICAgICByMCAtPSBwb3NpdGlvbjtcbiAgICAgICAgICByMSAtPSBzaXplICsgcG9zaXRpb247XG4gICAgICAgIH1cbiAgICAgICAgbWluID0gKGkgPyB5Q2xhbXAgOiB4Q2xhbXApID8gTWF0aC5tYXgocjAsIE1hdGgubWluKHIxLCBwb2ludFtpXSkpIDogcG9pbnRbaV07XG4gICAgICAgIGlmIChkcmFnZ2luZykge1xuICAgICAgICAgIG1heCA9IChtaW4gKz0gcG9zaXRpb24pICsgc2l6ZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoY2VudGVyKSBwb3NpdGlvbiA9IE1hdGgubWF4KHIwLCBNYXRoLm1pbihyMSwgMiAqIGNlbnRlcltpXSAtIG1pbikpO1xuICAgICAgICAgIGlmIChwb3NpdGlvbiA8IG1pbikge1xuICAgICAgICAgICAgbWF4ID0gbWluO1xuICAgICAgICAgICAgbWluID0gcG9zaXRpb247XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG1heCA9IHBvc2l0aW9uO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoZXh0ZW50WzBdICE9IG1pbiB8fCBleHRlbnRbMV0gIT0gbWF4KSB7XG4gICAgICAgICAgaWYgKGkpIHlFeHRlbnREb21haW4gPSBudWxsOyBlbHNlIHhFeHRlbnREb21haW4gPSBudWxsO1xuICAgICAgICAgIGV4dGVudFswXSA9IG1pbjtcbiAgICAgICAgICBleHRlbnRbMV0gPSBtYXg7XG4gICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGJydXNoZW5kKCkge1xuICAgICAgICBicnVzaG1vdmUoKTtcbiAgICAgICAgZy5zdHlsZShcInBvaW50ZXItZXZlbnRzXCIsIFwiYWxsXCIpLnNlbGVjdEFsbChcIi5yZXNpemVcIikuc3R5bGUoXCJkaXNwbGF5XCIsIGJydXNoLmVtcHR5KCkgPyBcIm5vbmVcIiA6IG51bGwp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xhbXAgPSAhIXpbMV07IGVsc2UgaWYgKHgpIHhDbGFtcCA9ICEhejsgZWxzZSBpZiAoeSkgeUNsYW1wID0gISF6O1xuICAgICAgcmV0dXJuIGJydXNoO1xuICAgIH07XG4gICAgYnJ1c2guZXh0ZW50ID0gZnVuY3Rpb24oeikge1xuICAgICAgdmFyIHgwLCB4MSwgeTAsIHkxLCB0O1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7XG4gICAgICAgIGlmICh4KSB7XG4gICAgICAgICAgaWYgKHhFeHRlbnREb21haW4pIHtcbiAgICAgICAgICAgIHgwID0geEV4dGVudERvbWFpblswXSwgeDEgPSB4RXh0ZW50RG9tYWluWzFdO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB4MCA9IHhFeHRlbnRbMF0sIHgxID0geEV4dGVudFsxXTtcbiAgICAgICAgICAgIGlmICh4LmludmVydCkgeDAgPSB4LmludmVydCh4MCksIHgxID0geC5pbnZlcnQoeDEpO1xuICAgICAgICAgICAgaWYgKHgxIDwgeDApIHQgPSB4MCwgeDAgPSB4MSwgeDEgPSB0O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoeSkge1xuICAgICAgICAgIGlmICh5RXh0ZW50RG9tYWluKSB7XG4gICAgICAgICAgICB5MCA9IHlFeHRlbnREb21haW5bMF0sIHkxID0geUV4dGVudERvbWFpblsxXTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgeTAgPSB5RXh0ZW50WzBdLCB5MSA9IHlFeHRlbnRbMV07XG4gICAgICAgICAgICBpZiAoeS5pbnZlcnQpIHkwID0geS5pbnZlcnQoeTApLCB5MSA9IHkuaW52ZXJ0KHkxKTtcbiAgICAgICAgICAgIGlmICh5MSA8IHkwKSB0ID0geTAsIHkwID0geTEsIHkxID0gdDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHggJiYgeSA/IFsgWyB4MCwgeTAgXSwgWyB4MSwgeTEgXSBdIDogeCA/IFsgeDAsIHgxIF0gOiB5ICYmIFsgeTAsIHkxIF07XG4gICAgICB9XG4gICAgICBpZiAoeCkge1xuICAgICAgICB4MCA9IHpbMF0sIHgxID0gelsxXTtcbiAgICAgICAgaWYgKHkpIHgwID0geDBbMF0sIHgxID0geDFbMF07XG4gICAgICAgIHhFeHRlbnREb21haW4gPSBbIHgwLCB4MSBdO1xuICAgICAgICBpZiAoeC5pbnZlcnQpIHgwID0geCh4MCksIHgxID0geCh4MSk7XG4gICAgICAgIGlmICh4MSA8IHgwKSB0ID0geDAsIHgwID0geDEsIHgxID0gdDtcbiAgICAgICAgaWYgKHgwICE9IHhFeHRlbnRbMF0gfHwgeDEgIT0geEV4dGVudFsxXSkgeEV4dGVudCA9IFsgeDAsIHgxIF07XG4gICAgICB9XG4gICAgICBpZiAoeSkge1xuICAgICAgICB5MCA9IHpbMF0sIHkxID0gelsxXTtcbiAgICAgICAgaWYgKHgpIHkwID0geTBbMV0sIHkxID0geTFbMV07XG4gICAgICAgIHlFeHRlbnREb21haW4gPSBbIHkwLCB5MSBdO1xuICAgICAgICBpZiAoeS5pbnZlcnQpIHkwID0geSh5MCksIHkxID0geSh5MSk7XG4gICAgICAgIGlmICh5MSA8IHkwKSB0ID0geTAsIHkwID0geTEsIHkxID0gdDtcbiAgICAgICAgaWYgKHkwICE9IHlFeHRlbnRbMF0gfHwgeTEgIT0geUV4dGVudFsxXSkgeUV4dGVudCA9IFsgeTAsIHkxIF07XG4gICAgICB9XG4gICAgICByZXR1cm4gYnJ1c2g7XG4gICAgfTtcbiAgICBicnVzaC5jbGVhciA9IGZ1bmN0aW9uKCkge1xuICAgICAgaWYgKCFicnVzaC5lbXB0eSgpKSB7XG4gICAgICAgIHhFeHRlbnQgPSBbIDAsIDAgXSwgeUV4dGVudCA9IFsgMCwgMCBdO1xuICAgICAgICB4RXh0ZW50RG9tYWluID0geUV4dGVudERvbWFpbiA9IG51bGw7XG4gICAg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c3VsdCA9IG5ldyBJbnRlcnNlY3Rpb24oXCJObyBJbnRlcnNlY3Rpb25cIik7XG4gICAgdmFyIHBvbHk7XG5cbiAgICBhID0gYTIubXVsdGlwbHkoLTIpO1xuICAgIGMxMiA9IGExLmFkZChhLmFkZChhMykpO1xuXG4gICAgYSA9IGExLm11bHRpcGx5KC0yKTtcbiAgICBiID0gYTIubXVsdGlwbHkoMik7XG4gICAgYzExID0gYS5hZGQoYik7XG5cbiAgICBjMTAgPSBuZXcgUG9pbnQyRChhMS54LCBhMS55KTtcblxuICAgIGEgPSBiMi5tdWx0aXBseSgtMik7XG4gICAgYzIyID0gYjEuYWRkKGEuYWRkKGIzKSk7XG5cbiAgICBhID0gYjEubXVsdGlwbHkoLTIpO1xuICAgIGIgPSBiMi5tdWx0aXBseSgyKTtcbiAgICBjMjEgPSBhLmFkZChiKTtcblxuICAgIGMyMCA9IG5ldyBQb2ludDJEKGIxLngsIGIxLnkpO1xuICAgIFxuICAgIGlmICggYzEyLnkgPT0gMCApIHtcbiAgICAgICAgdmFyIHYwID0gYzEyLngqKGMxMC55IC0gYzIwLnkpO1xuICAgICAgICB2YXIgdjEgPSB2MCAtIGMxMS54KmMxMS55O1xuICAgICAgICB2YXIgdjIgPSB2MCArIHYxO1xuICAgICAgICB2YXIgdjMgPSBjMTEueSpjMTEueTtcblxuICAgICAgICBwb2x5ID0gbmV3IFBvbHlub21pYWwoXG4gICAgICAgICAgICBjMTIueCpjMjIueSpjMjIueSxcbiAgICAgICAgICAgIDIqYzEyLngqYzIxLnkqYzIyLnksXG4gICAgICAgICAgICBjMTIueCpjMjEueSpjMjEueSAtIGMyMi54KnYzIC0gYzIyLnkqdjAgLSBjMjIueSp2MSxcbiAgICAgICAgICAgIC1jMjEueCp2MyAtIGMyMS55KnYwIC0gYzIxLnkqdjEsXG4gICAgICAgICAgICAoYzEwLnggLSBjMjAueCkqdjMgKyAoYzEwLnkgLSBjMjAueSkqdjFcbiAgICAgICAgKTtcbiAgICB9IGVsc2Uge1xuICAgICAgICB2YXIgdjAgPSBjMTIueCpjMjIueSAtIGMxMi55KmMyMi54O1xuICAgICAgICB2YXIgdjEgPSBjMTIueCpjMjEueSAtIGMyMS54KmMxMi55O1xuICAgICAgICB2YXIgdjIgPSBjMTEueCpjMTIueSAtIGMxMS55KmMxMi54O1xuICAgICAgICB2YXIgdjMgPSBjMTAueSAtIGMyMC55O1xuICAgICAgICB2YXIgdjQgPSBjMTIueSooYzEwLnggLSBjMjAueCkgLSBjMTIueCp2MztcbiAgICAgICAgdmFyIHY1ID0gLWMxMS55KnYyICsgYzEyLnkqdjQ7XG4gICAgICAgIHZhciB2NiA9IHYyKnYyO1xuXG4gICAgICAgIHBvbHkgPSBuZXcgUG9seW5vbWlhbChcbiAgICAgICAgICAgIHYwKnYwLFxuICAgICAgICAgICAgMip2MCp2MSxcbiAgICAgICAgICAgICgtYzIyLnkqdjYgKyBjMTIueSp2MSp2MSArIGMxMi55KnYwKnY0ICsgdjAqdjUpIC8gYzEyLnksXG4gICAgICAgICAgICAoLWMyMS55KnY2ICsgYzEyLnkqdjEqdjQgKyB2MSp2NSkgLyBjMTIueSxcbiAgICAgICAgICAgICh2Myp2NiArIHY0KnY1KSAvIGMxMi55XG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgdmFyIHJvb3RzID0gcG9seS5nZXRSb290cygpO1xuICAgIGZvciAoIHZhciBpID0gMDsgaSA8IHJvb3RzLmxlbmd0aDsgaSsrICkge1xuICAgICAgICB2YXIgcyA9IHJvb3RzW2ldO1xuXG4gICAgICAgIGlmICggMCA8PSBzICYmIHMgPD0gMSApIHtcbiAgICAgICAgICAgIHZhciB4Um9vdHMgPSBuZXcgUG9seW5vbWlhbChcbiAgICAgICAgICAgICAgICBjMTIueCxcbiAgICAgICAgICAgICAgICBjMTEueCxcbiAgICAgICAgICAgICAgICBjMTAueCAtIGMyMC54IC0gcypjMjEueCAtIHMqcypjMjIueFxuICAgICAgICAgICAgKS5nZXRSb290cygpO1xuICAgICAgICAgICAgdmFyIHlSb290cyA9IG5ldyBQb2x5bm9taWFsKFxuICAgICAgICAgICAgICAgIGMxMi55LFxuICAgICAgICAgICAgICAgIGMxMS55LFxuICAgICAgICAgICAgICAgIGMxMC55IC0gYzIwLnkgLSBzKmMyMS55IC0gcypzKmMyMi55XG4gICAgICAgICAgICApLmdldFJvb3RzKCk7XG5cbiAgICAgICAgICAgIGlmICggeFJvb3RzLmxlbmd0aCA+IDAgJiYgeVJvb3RzLmxlbmd0aCA+IDAgKSB7XG4gICAgICAgICAgICAgICAgdmFyIFRPTEVSQU5DRSA9IDFlLTQ7XG5cbiAgICAgICAgICAgICAgICBjaGVja1Jvb3RzOlxuICAgICAgICAgICAgICAgIGZvciAoIHZhciBqID0gMDsgaiA8IHhSb290cy5sZW5ndGg7IGorKyApIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHhSb290ID0geFJvb3RzW2pdO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICggMCA8PSB4Um9vdCAmJiB4Um9vdCA8PSAxICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICggdmFyIGsgPSAwOyBrIDwgeVJvb3RzLmxlbmd0aDsgaysrICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICggTWF0aC5hYnMoIHhSb290IC0geVJvb3RzW2tdICkgPCBUT0xFUkFOQ0UgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wb2ludHMucHVzaCggYzIyLm11bHRpcGx5KHMqcykuYWRkKGMyMS5tdWx0aXBseShzKS5hZGQoYzIwKSkgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgY2hlY2tSb290cztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cb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YzIzLnggLSAyKmMxMi54KmMxMi55KmMyMi54KmMyMi55ICtcbiAgICAgICAgICAgIDIqYzIxLngqYzEyeTIqYzIzLnggKyBjMTJ5MipjMjJ4MiArIGMxMngyKigyKmMyMS55KmMyMy55ICsgYzIyeTIpLFxuICAgICAgICAyKmMxMC54KmMxMi54KmMxMi55KmMyMy55ICsgMipjMTAueSpjMTIueCpjMTIueSpjMjMueCArIGMxMS54KmMxMS55KmMxMi54KmMyMy55ICtcbiAgICAgICAgICAgIGMxMS54KmMxMS55KmMxMi55KmMyMy54IC0gMipjMjAueCpjMTIueCpjMTIueSpjMjMueSAtIDIqYzEyLngqYzIwLnkqYzEyLnkqYzIzLnggLVxuICAgICAgICAgICAgMipjMTIueCpjMjEueCpjMTIueSpjMjIueSAtIDIqYzEyLngqYzEyLnkqYzIxLnkqYzIyLnggLSAyKmMxMC54KmMxMnkyKmMyMy54IC1cbiAgICAgICAgICAgIDIqYzEwLnkqYzEyeDIqYzIzLnkgKyAyKmMyMC54KmMxMnkyKmMyMy54ICsgMipjMjEueCpjMTJ5MipjMjIueCAtXG4gICAgICAgICAgICBjMTF5MipjMTIueCpjMjMueCAtIGMxMXgyKmMxMi55KmMyMy55ICsgYzEyeDIqKDIqYzIwLnkqYzIzLnkgKyAyKmMyMS55KmMyMi55KSxcbiAgICAgICAgMipjMTAueCpjMTIueCpjMTIueSpjMjIueSArIDIqYzEwLnkqYzEyLngqYzEyLnkqYzIyLnggKyBjMTEueCpjMTEueSpjMTIueCpjMjIueSArXG4gICAgICAgICAgICBjMTEueCpjMTEueSpjMTIueSpjMjIueCAtIDIqYzIwLngqYzEyLngqYzEyLnkqYzIyLnkgLSAyKmMxMi54KmMyMC55KmMxMi55KmMyMi54IC1cbiAgICAgICAgICAgIDIqYzEyLngqYzIxLngqYzEyLnkqYzIxLnkgLSAyKmMxMC54KmMxMnkyKmMyMi54IC0gMipjMTAueSpjMTJ4MipjMjIueSArXG4gICAgICAgICAgICAyKmMyMC54KmMxMnkyKmMyMi54IC0gYzExeTIqYzEyLngqYzIyLnggLSBjMTF4MipjMTIueSpjMjIueSArIGMyMXgyKmMxMnkyICtcbiAgICAgICAgICAgIGMxMngyKigyKmMyMC55KmMyMi55ICsgYzIxeTIpLFxuICAgICAgICAyKmMxMC54KmMxMi54KmMxMi55KmMyMS55ICsgMipjMTAueSpjMTIueCpjMjEueCpjMTIueSArIGMxMS54KmMxMS55KmMxMi54KmMyMS55ICtcbiAgICAgICAgICAgIGMxMS54KmMxMS55KmMyMS54KmMxMi55IC0gMipjMjAueCpjMTIueCpjMTIueSpjMjEueSAtIDIqYzEyLngqYzIwLnkqYzIxLngqYzEyLnkgLVxuICAgICAgICAgICAgMipjMTAueCpjMjEueCpjMTJ5MiAtIDIqYzEwLnkqYzEyeDIqYzIxLnkgKyAyKmMyMC54KmMyMS54KmMxMnkyIC1cbiAgICAgICAgICAgIGMxMXkyKmMxMi54KmMyMS54IC0gYzExeDIqYzEyLnkqYzIxLnkgKyAyKmMxMngyKmMyMC55KmMyMS55LFxuICAgICAgICAtMipjMTAueCpjMTAueSpjMTIueCpjMTIueSAtIGMxMC54KmMxMS54KmMxMS55KmMxMi55IC0gYzEwLnkqYzExLngqYzExLnkqYzEyLnggK1xuICAgICAgICAgICAgMipjMTAueCpjMTIueCpjMjAueSpjMTIueSArIDIqYzEwLnkqYzIwLngqYzEyLngqYzEyLnkgKyBjMTEueCpjMjAueCpjMTEueSpjMTIueSArXG4gICAgICAgICAgICBjMTEueCpjMTEueSpjMTIueCpjMjAueSAtIDIqYzIwLngqYzEyLngqYzIwLnkqYzEyLnkgLSAyKmMxMC54KmMyMC54KmMxMnkyICtcbiAgICAgICAgICAgIGMxMC54KmMxMXkyKmMxMi54ICsgYzEwLnkqYzExeDIqYzEyLnkgLSAyKmMxMC55KmMxMngyKmMyMC55IC1cbiAgICAgICAgICAgIGMyMC54KmMxMXkyKmMxMi54IC0gYzExeDIqYzIwLnkqYzEyLnkgKyBjMTB4MipjMTJ5MiArIGMxMHkyKmMxMngyICtcbiAgICAgICAgICAgIGMyMHgyKmMxMnkyICsgYzEyeDIqYzIweTJcbiAgICApO1xuICAgIHZhciByb290cyA9IHBvbHkuZ2V0Um9vdHNJbkludGVydmFsKDAsMSk7XG5cbiAgICBmb3IgKCB2YXIgaSA9IDA7IGkgPCByb290cy5sZW5ndGg7IGkrKyApIHtcbiAgICAgICAgdmFyIHMgPSByb290c1tpXTtcbiAgICAgICAgdmFyIHhSb290cyA9IG5ldyBQb2x5bm9taWFsKFxuICAgICAgICAgICAgYzEyLngsXG4gICAgICAgICAgICBjMTEueCxcbiAgICAgICAgICAgIGMxMC54IC0gYzIwLnggLSBzKmMyMS54IC0gcypzKmMyMi54IC0gcypzKnMqYzIzLnhcbiAgICAgICAgKS5nZXRSb290cygpO1xuICAgICAgICB2YXIgeVJvb3RzID0gbmV3IFBvbHlub21pYWwoXG4gICAgICAgICAgICBjMTIueSxcbiAgICAgICAgICAgIGMxMS55LFxuICAgICAgICAgICAgYzEwLnkgLSBjMjAueSAtIHMqYzIxLnkgLSBzKnMqYzIyLnkgLSBzKnMqcypjMjMueVxuICAgICAgICApLmdldFJvb3RzKCk7XG5cbiAgICAgICAgaWYgKCB4Um9vdHMubGVuZ3RoID4gMCAmJiB5Um9vdHMubGVuZ3RoID4gMCApIHtcbiAgICAgICAgICAgIHZhciBUT0xFUkFOQ0UgPSAxZS00O1xuXG4gICAgICAgICAgICBjaGVja1Jvb3RzOlxuICAgICAgICAgICAgZm9yICggdmFyIGogPSAwOyBqIDwgeFJvb3RzLmxlbmd0aDsgaisrICkge1xuICAgICAgICAgICAgICAgIHZhciB4Um9vdCA9IHhSb290c1tqXTtcbiAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICBpZiAoIDAgPD0geFJvb3QgJiYgeFJvb3QgPD0gMSApIHtcbiAgICAgICAgICAgICAgICAgICAgZm9yICggdmFyIGsgPSAwOyBrIDwgeVJvb3RzLmxlbmd0aDsgaysrICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCBNYXRoLmFicyggeFJvb3QgLSB5Um9vdHNba10gKSA8IFRPTEVSQU5DRSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucG9pbnRzLnB1c2goXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMyMy5tdWx0aXBseShzKnMqcykuYWRkKGMyMi5tdWx0aXBseShzKnMpLmFkZChjMjEubXVsdGlwbHkocykuYWRkKGMyMCkpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgY2hlY2tSb290cztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlmICggcmVzdWx0LnBvaW50cy5sZW5ndGggPiAwICkgcmVzdWx0LnN0YXR1cyA9IFwiSW50ZXJzZWN0aW9uXCI7XG5cbiAgICByZXR1cm4gcmVzdWx0O1xuXG59O1xuXG5cbi8qKioqKlxuKlxuKiAgIGludGVyc2VjdEJlemllcjJDaXJjbGVcbipcbioqKioqL1xuSW50ZXJzZWN0aW9uLmludGVyc2VjdEJlemllcjJDaXJjbGUgPSBmdW5jdGlvbihwMSwgcDIsIHAzLCBjLCByKSB7XG4gICAgcmV0dXJuIEludGVyc2VjdGlvbi5pbnRlcnNlY3RCZXppZXIyRWxsaXBzZShwMSwgcDIsIHAzLCBjLCByLCByKTtcbn07XG5cblxuLyoqKioqXG4qXG4qICAgaW50ZXJzZWN0QmV6aWVyMkVsbGlwc2VcbipcbioqKioqL1xuSW50ZXJzZWN0aW9uLmludGVyc2VjdEJlemllcjJFbGxpcHNlID0gZnVuY3Rpb24ocDEsIHAyLCBwMywgZWMsIHJ4LCByeSkge1xuICAgIHZhciBhLCBiOyAgICAgICAvLyB0ZW1wb3JhcnkgdmFyaWFibGVzXG4gICAgdmFyIGMyLCBjMSwgYzA7IC8vIGNvZWZmaWNpZW50cyBvZiBxdWFkcmF0aWNcbiAgICB2YXIgcmVzdWx0ID0gbmV3IEludGVyc2VjdGlvbihcIk5vIEludGVyc2VjdGlvblwiKTtcblxuICAgIGEgPSBwMi5tdWx0aXBseSgtMik7XG4gICAgYzIgPSBwMS5hZGQoYS5hZGQocDMpKTtcblxuICAgIGEgPSBwMS5tdWx0aXBseSgtMik7XG4gICAgYiA9IHAyLm11bHRpcGx5KDIpO1xuICAgIGMxID0gYS5hZGQoYik7XG5cbiAgICBjMCA9IG5ldyBQb2ludDJEKHAxLngsIHAxLnkpO1xuXG4gICAgdmFyIHJ4cnggID0gcngqcng7XG4gICAgdmFyIHJ5cnkgID0gcnkqcnk7XG4gICAgdmFyIHJvb3RzID0gbmV3IFBvbHlub21pYWwoXG4gICAgICAgIHJ5cnkqYzIueCpjMi54ICsgcnhyeCpjMi55KmMyLnksXG4gICAgICAgIDIqKHJ5cnkqYzIueCpjMS54ICsgcnhyeCpjMi55KmMxLnkpLFxuICAgICAgICByeXJ5KigyKmMyLngqYzAueCArIGMxLngqYzEueCkgKyByeHJ4KigyKmMyLnkqYzAueStjMS55KmMxLnkpIC1cbiAgICAgICAgICAgIDIqKHJ5cnkqZWMueCpjMi54ICsgcnhyeCplYy55KmMyLnkpLFxuICAgICAgICAyKihyeXJ5KmMxLngqKGMwLngtZWMueCkgKyByeHJ4KmMxLnkqKGMwLnktZWMueSkpLFxuICAgICAgICByeXJ5KihjMC54KmMwLngrZWMueCplYy54KSArIHJ4cngqKGMwLnkqYzAueSArIGVjLnkqZWMueSkgLVxuICAgICAgICAgICAgMioocnlyeSplYy54KmMwLnggKyByeHJ4KmVjLnkqYzAueSkgLSByeHJ4KnJ5cnlcbiAgICApLmdldFJvb3RzKCk7XG5cbiAgICBmb3IgKCB2YXIgaSA9IDA7IGkgPCByb290cy5sZW5ndGg7IGkrKyApIHtcbiAgICAgICAgdmF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XG4gICAgICAgIHZhciB0ID0gcm9vdHNbaV07XG5cbiAgICAgICAgaWYgKCAwIDw9IHQgJiYgdCA8PSAxICkge1xuICAgICAgICAgICAgLy8gV2UncmUgd2l0aGluIHRoZSBCZXppZXIgY3VydmVcbiAgICAgICAgICAgIC8vIEZpbmQgcG9pbnQgb24gQmV6aWVyXG4gICAgICAgICAgICB2YXIgcDQgPSBwMS5sZXJwKHAyLCB0KTtcbiAgICAgICAgICAgIHZhciBwNSA9IHAyLmxlcnAocDMsIHQpO1xuXG4gICAgICAgICAgICB2YXIgcDYgPSBwNC5sZXJwKHA1LCB0KTtcblxuICAgICAgICAgICAgLy8gU2VlIGlmIHBvaW50IGlzIG9uIGxpbmUgc2VnbWVudFxuICAgICAgICAgICAgLy8gSGFkIHRvIG1ha2Ugc3BlY2lhbCBjYXNlcyBmb3IgdmVydGljYWwgYW5kIGhvcml6b250YWwgbGluZXMgZHVlXG4gICAgICAgICAgICAvLyB0byBzbGlnaHQgZXJyb3JzIGluIGNhbGN1bGF0aW9uIG9mIHA2XG4gICAgICAgICAgICBpZiAoIGExLnggPT0gYTIueCApIHtcbiAgICAgICAgICAgICAgICBpZiAoIG1pbi55IDw9IHA2LnkgJiYgcDYueSA8PSBtYXgueSApIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnN0YXR1cyA9IFwiSW50ZXJzZWN0aW9uXCI7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdC5hcHBlbmRQb2ludCggcDYgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBhMS55ID09IGEyLnkgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBtaW4ueCA8PSBwNi54ICYmIHA2LnggPD0gbWF4LnggKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdC5zdGF0dXMgPSBcIkludGVyc2VjdGlvblwiO1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQuYXBwZW5kUG9pbnQoIHA2IC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zeTIqYzIzLngqYzIzLnkgKyA2KmMxM3gyKmMxMy55KmMyMi55KmMyMy54KmMyMy55ICsgMypjMjIueCpjMTN5MypjMjN4MiAtXG4gICAgICAgICAgICAzKmMxM3gzKmMyMi55KmMyM3kyIC0gMypjMTMueCpjMTN5MipjMjIueSpjMjN4MiArIDMqYzEzeDIqYzIyLngqYzEzLnkqYzIzeTIsXG4gICAgICAgIC02KmMyMS54KmMxMy54KmMxM3kyKmMyMy54KmMyMy55IC0gNipjMTMueCpjMjIueCpjMTN5MipjMjIueSpjMjMueCArIDYqYzEzeDIqYzIyLngqYzEzLnkqYzIyLnkqYzIzLnkgK1xuICAgICAgICAgICAgMypjMjEueCpjMTN5MypjMjN4MiArIDMqYzIyeDIqYzEzeTMqYzIzLnggKyAzKmMyMS54KmMxM3gyKmMxMy55KmMyM3kyIC0gMypjMTMueCpjMjEueSpjMTN5MipjMjN4MiAtXG4gICAgICAgICAgICAzKmMxMy54KmMyMngyKmMxM3kyKmMyMy55ICsgYzEzeDIqYzEzLnkqYzIzLngqKDYqYzIxLnkqYzIzLnkgKyAzKmMyMnkyKSArIGMxM3gzKigtYzIxLnkqYzIzeTIgLVxuICAgICAgICAgICAgMipjMjJ5MipjMjMueSAtIGMyMy55KigyKmMyMS55KmMyMy55ICsgYzIyeTIpKSxcbiAgICAgICAgYzExLngqYzEyLnkqYzEzLngqYzEzLnkqYzIzLngqYzIzLnkgLSBjMTEueSpjMTIueCpjMTMueCpjMTMueSpjMjMueCpjMjMueSArIDYqYzIxLngqYzIyLngqYzEzeTMqYzIzLnggK1xuICAgICAgICAgICAgMypjMTEueCpjMTIueCpjMTMueCpjMTMueSpjMjN5MiArIDYqYzEwLngqYzEzLngqYzEzeTIqYzIzLngqYzIzLnkgLSAzKmMxMS54KmMxMi54KmMxM3kyKmMyMy54KmMyMy55IC1cbiAgICAgICAgICAgIDMqYzExLnkqYzEyLnkqYzEzLngqYzEzLnkqYzIzeDIgLSA2KmMxMC55KmMxM3gyKmMxMy55KmMyMy54KmMyMy55IC0gNipjMjAueCpjMTMueCpjMTN5MipjMjMueCpjMjMueSArXG4gICAgICAgICAgICAzKmMxMS55KmMxMi55KmMxM3gyKmMyMy54KmMyMy55IC0gMipjMTIueCpjMTJ5MipjMTMueCpjMjMueCpjMjMueSAtIDYqYzIxLngqYzEzLngqYzIyLngqYzEzeTIqYzIzLnkgLVxuICAgICAgICAgICAgNipjMjEueCpjMTMueCpjMTN5MipjMjIueSpjMjMueCAtIDYqYzEzLngqYzIxLnkqYzIyLngqYzEzeTIqYzIzLnggKyA2KmMyMS54KmMxM3gyKmMxMy55KmMyMi55KmMyMy55ICtcbiAgICAgICAgICAgIDIqYzEyeDIqYzEyLnkqYzEzLnkqYzIzLngqYzIzLnkgKyBjMjJ4MypjMTN5MyAtIDMqYzEwLngqYzEzeTMqYzIzeDIgKyAzKmMxMC55KmMxM3gzKmMyM3kyICtcbiAgICAgICAgICAgIDMqYzIwLngqYzEzeTMqYzIzeDIgKyBjMTJ5MypjMTMueCpjMjN4MiAtIGMxMngzKmMxMy55KmMyM3kyIC0gMypjMTAueCpjMTN4MipjMTMueSpjMjN5MiArXG4gICAgICAgICAgICAzKmMxMC55KmMxMy54KmMxM3kyKmMyM3gyIC0gMipjMTEueCpjMTIueSpjMTN4MipjMjN5MiArIGMxMS54KmMxMi55KmMxM3kyKmMyM3gyIC0gYzExLnkqYzEyLngqYzEzeDIqYzIzeTIgK1xuICAgICAgICAgICAgMipjMTEueSpjMTIueCpjMTN5MipjMjN4MiArIDMqYzIwLngqYzEzeDIqYzEzLnkqYzIzeTIgLSBjMTIueCpjMTJ5MipjMTMueSpjMjN4MiAtXG4gICAgICAgICAgICAzKmMyMC55KmMxMy54KmMxM3kyKmMyM3gyICsgYzEyeDIqYzEyLnkqYzEzLngqYzIzeTIgLSAzKmMxMy54KmMyMngyKmMxM3kyKmMyMi55ICtcbiAgICAgICAgICAgIGMxM3gyKmMxMy55KmMyMy54Kig2KmMyMC55KmMyMy55ICsgNipjMjEueSpjMjIueSkgKyBjMTN4MipjMjIueCpjMTMueSooNipjMjEueSpjMjMueSArIDMqYzIyeTIpICtcbiAgICAgICAgICAgIGMxM3gzKigtMipjMjEueSpjMjIueSpjMjMueSAtIGMyMC55KmMyM3kyIC0gYzIyLnkqKDIqYzIxLnkqYzIzLnkgKyBjMjJ5MikgLSBjMjMueSooMipjMjAueSpjMjMueSArIDIqYzIxLnkqYzIyLnkpKSxcbiAgICAgICAgNipjMTEueCpjMTIueCpjMTMueCpjMTMueSpjMjIueSpjMjMueSArIGMxMS54KmMxMi55KmMxMy54KmMyMi54KmMxMy55KmMyMy55ICsgYzExLngqYzEyLnkqYzEzLngqYzEzLnkqYzIyLnkqYzIzLnggLVxuICAgICAgICAgICAgYzExLnkqYzEyLngqYzEzLngqYzIyLngqYzEzLnkqYzIzLnkgLSBjMTEueSpjMTIueCpjMTMueCpjMTMueSpjMjIueSpjMjMueCAtIDYqYzExLnkqYzEyLnkqYzEzLngqYzIyLngqYzEzLnkqYzIzLnggLVxuICAgICAgICAgICAgNipjMTAueCpjMjIueCpjMTN5MypjMjMueCArIDYqYzIwLngqYzIyLngqYzEzeTMqYzIzLnggKyA2KmMxMC55KmMxM3gzKmMyMi55KmMyMy55ICsgMipjMTJ5MypjMTMueCpjMjIueCpjMjMueCAtXG4gICAgICAgICAgICAyKmMxMngzKmMxMy55KmMyMi55KmMyMy55ICsgNipjMTAueCpjMTMueCpjMjIueCpjMTN5MipjMjMueSArIDYqYzEwLngqYzEzLngqYzEzeTIqYzIyLnkqYzIzLnggK1xuICAgICAgICAgICAgNipjMTAueSpjMTMueCpjMjIueCpjMTN5MipjMjMueCAtIDMqYzExLngqYzEyLngqYzIyLngqYzEzeTIqYzIzLnkgLSAzKmMxMS54KmMxMi54KmMxM3kyKmMyMi55KmMyMy54ICtcbiAgICAgICAgICAgIDIqYzExLngqYzEyLnkqYzIyLngqYzEzeTIqYzIzLnggKyA0KmMxMS55KmMxMi54KmMyMi54KmMxM3kyKmMyMy54IC0gNipjMTAueCpjMTN4MipjMTMueSpjMjIueSpjMjMueSAtXG4gICAgICAgICAgICA2KmMxMC55KmMxM3gyKmMyMi54KmMxMy55KmMyMy55IC0gNipjMTAueSpjMTN4MipjMTMueSpjMjIueSpjMjMueCAtIDQqYzExLngqYzEyLnkqYzEzeDIqYzIyLnkqYzIzLnkgLVxuICAgICAgICAgICAgNipjMjAueCpjMTMueCpjMjIueCpjMTN5MipjMjMueSAtIDYqYzIwLngqYzEzLngqYzEzeTIqYzIyLnkqYzIzLnggLSAyKmMxMS55KmMxMi54KmMxM3gyKmMyMi55KmMyMy55ICtcbiAgICAgICAgICAgIDMqYzExLnkqYzEyLnkqYzEzeDIqYzIyLngqYzIzLnkgKyAzKmMxMS55KmMxMi55KmMxM3gyKmMyMi55KmMyMy54IC0gMipjMTIueCpjMTJ5MipjMTMueCpjMjIueCpjMjMueSAtXG4gICAgICAgICAgICAyKmMxMi54KmMxMnkyKmMxMy54KmMyMi55KmMyMy54IC0gMipjMTIueCpjMTJ5MipjMjIueCpjMTMueSpjMjMueCAtIDYqYzIwLnkqYzEzLngqYzIyLngqYzEzeTIqYzIzLnggLVxuICAgICAgICAgICAgNipjMjEueCpjMTMueCpjMjEueSpjMTN5MipjMjMueCAtIDYqYzIxLngqYzEzLngqYzIyLngqYzEzeTIqYzIyLnkgKyA2KmMyMC54KmMxM3gyKmMxMy55KmMyMi55KmMyMy55ICtcbiAgICAgICAgICAgIDIqYzEyeDIqYzEyLnkqYzEzLngqYzIyLnkqYzIzLnkgKyAyKmMxMngyKmMxMi55KmMyMi54KmMxMy55KmMyMy55ICsgMipjMTJ4MipjMTIueSpjMTMueSpjMjIueSpjMjMueCArXG4gICAgICAgICAgICAzKmMyMS54KmMyMngyKmMxM3kzICsgMypjMjF4MipjMTN5MypjMjMueCAtIDMqYzEzLngqYzIxLnkqYzIyeDIqYzEzeTIgLSAzKmMyMXgyKmMxMy54KmMxM3kyKmMyMy55ICtcbiAgICAgICAgICAgIGMxM3gyKmMyMi54KmMxMy55Kig2KmMyMC55KmMyMy55ICsgNipjMjEueSpjMjIueSkgKyBjMTN4MipjMTMueSpjMjMueCooNipjMjAueSpjMjIueSArIDMqYzIxeTIpICtcbiAgICAgICAgICAgIGMyMS54KmMxM3gyKmMxMy55Kig2KmMyMS55KmMyMy55ICsgMypjMjJ5MikgKyBjMTN4MyooLTIqYzIwLnkqYzIyLnkqYzIzLnkgLSBjMjMueSooMipjMjAueSpjMjIueSArIGMyMXkyKSAtXG4gICAgICAgICAgICBjMjEueSooMipjMjEueSpjMjMueSArIGMyMnkyKSAtIGMyMi55KigyKmMyMC55KmMyMy55ICsgMipjMjEueSpjMjIueSkpLFxuICAgICAgICBjMTEueCpjMjEueCpjMTIueSpjMTMueCpjMTMueSpjMjMueSArIGMxMS54KmMxMi55KmMxMy54KmMyMS55KmMxMy55KmMyMy54ICsgYzExLngqYzEyLnkqYzEzLngqYzIyLngqYzEzLnkqYzIyLnkgLVxuICAgICAgICAgICAgYzExLnkqYzEyLngqYzIxLngqYzEzLngqYzEzLnkqYzIzLnkgLSBjMTEueSpjMTIueCpjMTMueCpjMjEueSpjMTMueSpjMjMueCAtIGMxMS55KmMxMi54KmMxMy54KmMyMi54KmMxMy55KmMyMi55IC1cbiAgICAgICAgICAgIDYqYzExLnkqYzIxLngqYzEyLnkqYzEzLngqYzEzLnkqYzIzLnggLSA2KmMxMC54KmMyMS54KmMxM3kzKmMyMy54ICsgNipjMjAueCpjMjEueCpjMTN5MypjMjMueCArXG4gICAgICAgICAgICAyKmMyMS54KmMxMnkzKmMxMy54KmMyMy54ICsgNipjMTAueCpjMjEueCpjMTMueCpjMTN5MipjMjMueSArIDYqYzEwLngqYzEzLngqYzIxLnkqYzEzeTIqYzIzLnggK1xuICAgICAgICAgICAgNipjMTAueCpjMTMueCpjMjIueCpjMTN5MipjMjIueSArIDYqYzEwLnkqYzIxLngqYzEzLngqYzEzeTIqYzIzLnggLSAzKmMxMS54KmMxMi54KmMyMS54KmMxM3kyKmMyMy55IC1cbiAgICAgICAgICAgIDMqYzExLngqYzEyLngqYzIxLnkqYzEzeTIqYzIzLnggLSAzKmMxMS54KmMxMi54KmMyMi54KmMxM3kyKmMyMi55ICsgMipjMTEueCpjMjEueCpjMTIueSpjMTN5MipjMjMueCArXG4gICAgICAgICAgICA0KmMxMS55KmMxMi54KmMyMS54KmMxM3kyKmMyMy54IC0gNipjMTAueSpjMjEueCpjMTN4MipjMTMueSpjMjMueSAtIDYqYzEwLnkqYzEzeDIqYzIxLnkqYzEzLnkqYzIzLnggLVxuICAgICAgICAgICAgNipjMTAueSpjMTN4MipjMjIueCpjMTMueSpjMjIueSAtIDYqYzIwLngqYzIxLngqYzEzLngqYzEzeTIqYzIzLnkgLSA2KmMyMC54KmMxMy54KmMyMS55KmMxM3kyKmMyMy54IC1cbiAgICAgICAgICAgIDYqYzIwLngqYzEzLngqYzIyLngqYzEzeTIqYzIyLnkgKyAzKmMxMS55KmMyMS54KmMxMi55KmMxM3gyKmMyMy55IC0gMypjMTEueSpjMTIueSpjMTMueCpjMjJ4MipjMTMueSArXG4gICAgICAgICAgICAzKmMxMS55KmMxMi55KmMxM3gyKmMyMS55KmMyMy54ICsgMypjMTEueSpjMTIueSpjMTN4MipjMjIueCpjMjIueSAtIDIqYzEyLngqYzIxLngqYzEyeTIqYzEzLngqYzIzLnkgLVxuICAgICAgICAgICAgMipjMTIueCpjMjEueCpjMTJ5MipjMTMueSpjMjMueCAtIDIqYzEyLngqYzEyeTIqYzEzLngqYzIxLnkqYzIzLnggLSAyKmMxMi54KmMxMnkyKmMxMy54KmMyMi54KmMyMi55IC1cbiAgICAgICAgICAgIDYqYzIwLnkqYzIxLngqYzEzLngqYzEzeTIqYzIzLnggLSA2KmMyMS54KmMxMy54KmMyMS55KmMyMi54KmMxM3kyICsgNipjMjAueSpjMTN4MipjMjEueSpjMTMueSpjMjMueCArXG4gICAgICAgICAgICAyKmMxMngyKmMyMS54KmMxMi55KmMxMy55KmMyMy55ICsgMipjMTJ4MipjMTIueSpjMjEueSpjMTMueSpjMjMueCArIDIqYzEyeDIqYzEyLnkqYzIyLngqYzEzLnkqYzIyLnkgLVxuICAgICAgICAgICAgMypjMTAueCpjMjJ4MipjMTN5MyArIDMqYzIwLngqYzIyeDIqYzEzeTMgKyAzKmMyMXgyKmMyMi54KmMxM3kzICsgYzEyeTMqYzEzLngqYzIyeDIgK1xuICAgICAgICAgICAgMypjMTAueSpjMTMueCpjMjJ4MipjMTN5MiArIGMxMS54KmMxMi55KmMyMngyKmMxM3kyICsgMipjMTEueSpjMTIueCpjMjJ4MipjMTN5MiAtXG4gICAgICAgICAgICBjMTIueCpjMTJ5MipjMjJ4MipjMTMueSAtIDMqYzIwLnkqYzEzLngqYzIyeDIqYzEzeTIgLSAzKmMyMXgyKmMxMy54KmMxM3kyKmMyMi55ICtcbiAgICAgICAgICAgIGMxMngyKmMxMi55KmMxMy54KigyKmMyMS55KmMyMy55ICsgYzIyeTIpICsgYzExLngqYzEyLngqYzEzLngqYzEzLnkqKDYqYzIxLnkqYzIzLnkgKyAzKmMyMnkyKSArXG4gICAgICAgICAgICBjMjEueCpjMTN4MipjMTMueSooNipjMjAueSpjMjMueSArIDYqYzIxLnkqYzIyLnkpICsgYzEyeDMqYzEzLnkqKC0yKmMyMS55KmMyMy55IC0gYzIyeTIpICtcbiAgICAgICAgICAgIGMxMC55KmMxM3gzKig2KmMyMS55KmMyMy55ICsgMypjMjJ5MikgKyBjMTEueSpjMTIueCpjMTN4MiooLTIqYzIxLnkqYzIzLnkgLSBjMjJ5MikgK1xuICAgICAgICAgICAgYzExLngqYzEyLnkqYzEzeDIqKC00KmMyMS55KmMyMy55IC0gMipjMjJ5MikgKyBjMTAueCpjMTN4MipjMTMueSooLTYqYzIxLnkqYzIzLnkgLSAzKmMyMnkyKSArXG4gICAgICAgICAgICBjMTN4MipjMjIueCpjMTMueSooNipjMjAueSpjMjIueSArIDMqYzIxeTIpICsgYzIwLngqYzEzeDIqYzEzLnkqKDYqYzIxLnkqYzIzLnkgKyAzKmMyMnkyKSArXG4gICAgICAgICAgICBjMTN4MyooLTIqYzIwLnkqYzIxLnkqYzIzLnkgLSBjMjIueSooMipjMjAueSpjMjIueSArIGMyMXkyKSAtIGMyMC55KigyKmMyMS55KmMyMy55ICsgYzIyeTIpIC1cbiAgICAgICAgICAgIGMyMS55KigyKmMyMC55KmMyMy55ICsgMipjMjEueSpjMjIueSkpLFxuICAgICAgICAtYzEwLngqYzExLngqYzEyLnkqYzEzLngqYzEzLnkqYzIzLnkgKyBjMTAueCpjMTEueSpjMTIueCpjMTMueCpjMTMueSpjMjMueSArIDYqYzEwLngqYzExLnkqYzEyLnkqYzEzLngqYzEzLnkqYzIzLnggLVxuICAgICAgICAgICAgNipjMTAueSpjMTEueCpjMTIueCpjMTMueCpjMTMueSpjMjMueSAtIGMxMC55KmMxMS54KmMxMi55KmMxMy54KmMxMy55KmMyMy54ICsgYzEwLnkqYzExLnkqYzEyLngqYzEzLngqYzEzLnkqYzIzLnggK1xuICAgICAgICAgICAgYzExLngqYzExLnkqYzEyLngqYzEyLnkqYzEzLngqYzIzLnkgLSBjMTEueCpjMTEueSpjMTIueCpjMTIueSpjMTMueSpjMjMueCArIGMxMS54KmMyMC54KmMxMi55KmMxMy54KmMxMy55KmMyMy55ICtcbiAgICAgICAgICAgIGMxMS54KmMyMC55KmMxMi55KmMxMy54KmMxMy55KmMyMy54ICsgYzExLngqYzIxLngqYzEyLnkqYzEzLngqYzEzLnkqYzIyLnkgKyBjMTEueCpjMTIueSpjMTMueCpjMjEueSpjMjIueCpjMTMueSAtXG4gICAgICAgICAgICBjMjAueCpjMTEueSpjMTIueCpjMTMueCpjMTMueSpjMjMueSAtIDYqYzIwLngqYzExLnkqYzEyLnkqYzEzLngqYzEzLnkqYzIzLnggLSBjMTEueSpjMTIueCpjMjAueSpjMTMueCpjMTMueSpjMjMueCAtXG4gICAgICAgICAgICBjMTEueSpjMTIueCpjMjEueCpjMTMueCpjMTMueSpjMjIueSAtIGMxMS55KmMxMi54KmMxMy54KmMyMS55KmMyMi54KmMxMy55IC0gNipjMTEueSpjMjEueCpjMTIueSpjMTMueCpjMjIueCpjMTMueSAtXG4gICAgICAgICAgICA2KmMxMC54KmMyMC54KmMxM3kzKmMyMy54IC0gNipjMTAueCpjMjEueCpjMjIueCpjMTN5MyAtIDIqYzEwLngqYzEyeTMqYzEzLngqYzIzLnggKyA2KmMyMC54KmMyMS54KmMyMi54KmMxM3kzICtcbiAgICAgICAgICAgIDIqYzIwLngqYzEyeTMqYzEzLngqYzIzLnggKyAyKmMyMS54KmMxMnkzKmMxMy54KmMyMi54ICsgMipjMTAueSpjMTJ4MypjMTMueSpjMjMueSAtIDYqYzEwLngqYzEwLnkqYzEzLngqYzEzeTIqYzIzLnggK1xuICAgICAgICAgICAgMypjMTAueCpjMTEueCpjMTIueCpjMTN5MipjMjMueSAtIDIqYzEwLngqYzExLngqYzEyLnkqYzEzeTIqYzIzLnggLSA0KmMxMC54KmMxMS55KmMxMi54KmMxM3kyKmMyMy54ICtcbiAgICAgICAgICAgIDMqYzEwLnkqYzExLngqYzEyLngqYzEzeTIqYzIzLnggKyA2KmMxMC54KmMxMC55KmMxM3gyKmMxMy55KmMyMy55ICsgNipjMTAueCpjMjAueCpjMTMueCpjMTN5MipjMjMueSAtXG4gICAgICAgICAgICAzKmMxMC54KmMxMS55KmMxMi55KmMxM3gyKmMyMy55ICsgMipjMTAueCpjMTIueCpjMTJ5MipjMTMueCpjMjMueSArIDIqYzEwLngqYzEyLngqYzEyeTIqYzEzLnkqYzIzLnggK1xuICAgICAgICAgICAgNipjMTAueCpjMjAueSpjMTMueCpjMTN5MipjMjMueCArIDYqYzEwLngqYzIxLngqYzEzLngqYzEzeTIqYzIyLnkgKyA2KmMxMC54KmMxMy54KmMyMS55KmMyMi54KmMxM3kyICtcbiAgICAgICAgICAgIDQqYzEwLnkqYzExLngqYzEyLnkqYzEzeDIqYzIzLnkgKyA2KmMxMC55KmMyMC54KmMxMy54KmMxM3kyKmMyMy54ICsgMipjMTAueSpjMTEueSpjMTIueCpjMTN4MipjMjMueSAtXG4gICAgICAgICAgICAzKmMxMC55KmMxMS55KmMxMi55KmMxM3gyKmMyMy54ICsgMipjMTAueSpjMTIueCpjMTJ5MipjMTMueCpjMjMueCArIDYqYzEwLnkqYzIxLngqYzEzLngqYzIyLngqYzEzeTIgLVxuICAgICAgICAgICAgMypjMTEueCpjMjAueCpjMTIueCpjMTN5MipjMjMueSArIDIqYzExLngqYzIwLngqYzEyLnkqYzEzeTIqYzIzLnggKyBjMTEueCpjMTEueSpjMTJ5MipjMTMueCpjMjMueCAtXG4gICAgICAgICAgICAzKmMxMS54KmMxMi54KmMyMC55KmMxM3kyKmMyMy54IC0gMypjMTEueCpjMTIueCpjMjEueCpjMTN5MipjMjIueSAtIDMqYzExLngqYzEyLngqYzIxLnkqYzIyLngqYzEzeTIgK1xuICAgICAgICAgICAgMipjMTEueCpjMjEueCpjMTIueSpjMjIueCpjMTN5MiArIDQqYzIwLngqYzExLnkqYzEyLngqYzEzeTIqYzIzLnggKyA0KmMxMS55KmMxMi54KmMyMS54KmMyMi54KmMxM3kyIC1cbiAgICAgICAgICAgIDIqYzEwLngqYzEyeDIqYzEyLnkqYzEzLnkqYzIzLnkgLSA2KmMxMC55KmMyMC54KmMxM3gyKmMxMy55KmMyMy55IC0gNipjMTAueSpjMjAueSpjMTN4MipjMTMueSpjMjMueCAtXG4gICAgICAgICAgICA2KmMxMC55KmMyMS54KmMxM3gyKmMxMy55KmMyMi55IC0gMipjMTAueSpjMTJ4MipjMTIueSpjMTMueCpjMjMueSAtIDIqYzEwLnkqYzEyeDIqYzEyLnkqYzEzLnkqYzIzLnggLVxuICAgICAgICAgICAgNipjMTAueSpjMTN4MipjMjEueSpjMjIueCpjMTMueSAtIGMxMS54KmMxMS55KmMxMngyKmMxMy55KmMyMy55IC0gMipjMTEueCpjMTF5MipjMTMueCpjMTMueSpjMjMueCArXG4gICAgICAgICAgICAzKmMyMC54KmMxMS55KmMxMi55KmMxM3gyKmMyMy55IC0gMipjMjAueCpjMTIueCpjMTJ5MipjMTMueCpjMjMueSAtIDIqYzIwLngqYzEyLngqYzEyeTIqYzEzLnkqYzIzLnggLVxuICAgICAgICAgICAgNipjMjAueCpjMjAueSpjMTMueCpjMTN5MipjMjMueCAtIDYqYzIwLngqYzIxLngqYzEzLngqYzEzeTIqYzIyLnkgLSA2KmMyMC54KmMxMy54KmMyMS55KmMyMi54KmMxM3kyICtcbiAgICAgICAgICAgIDMqYzExLnkqYzIwLnkqYzEyLnkqYzEzeDIqYzIzLnggKyAzKmMxMS55KmMyMS54KmMxMi55KmMxM3gyKmMyMi55ICsgMypjMTEueSpjMTIueSpjMTN4MipjMjEueSpjMjIueCAtXG4gICAgICAgICAgICAyKmMxMi54KmMyMC55KmMxMnkyKmMxMy54KmMyMy54IC0gMipjMTIueCpjMjEueCpjMTJ5MipjMTMueCpjMjIueSAtIDIqYzEyLngqYzIxLngqYzEyeTIqYzIyLngqYzEzLnkgLVxuICAgICAgICAgICAgMipjMTIueCpjMTJ5MipjMTMueCpjMjEueSpjMjIueCAtIDYqYzIwLnkqYzIxLngqYzEzLngqYzIyLngqYzEzeTIgLSBjMTF5MipjMTIueCpjMTIueSpjMTMueCpjMjMueCArXG4gICAgICAgICAgICAyKmMyMC54KmMxMngyKmMxMi55KmMxMy55KmMyMy55ICsgNipjMjAueSpjMTN4MipjMjEueSpjMjIueCpjMTMueSArIDIqYzExeDIqYzExLnkqYzEzLngqYzEzLnkqYzIzLnkgK1xuICAgICAgICAgICAgYzExeDIqYzEyLngqYzEyLnkqYzEzLnkqYzIzLnkgKyAyKmMxMngyKmMyMC55KmMxMi55KmMxMy55KmMyMy54ICsgMipjMTJ4MipjMjEueCpjMTIueSpjMTMueSpjMjIueSArXG4gICAgICAgICAgICAyKmMxMngyKmMxMi55KmMyMS55KmMyMi54KmMxMy55ICsgYzIxeDMqYzEzeTMgKyAzKmMxMHgyKmMxM3kzKmMyMy54IC0gMypjMTB5MipjMTN4MypjMjMueSArXG4gICAgICAgICAgICAzKmMyMHgyKmMxM3kzKmMyMy54ICsgYzExeTMqYzEzeDIqYzIzLnggLSBjMTF4MypjMTN5MipjMjMueSAtIGMxMS54KmMxMXkyKmMxM3gyKmMyMy55ICtcbiAgICAgICAgICAgIGMxMXgyKmMxMS55KmMxM3kyKmMyMy54IC0gMypjMTB4MipjMTMueCpjMTN5MipjMjMueSArIDMqYzEweTIqYzEzeDIqYzEzLnkqYzIzLnggLSBjMTF4MipjMTJ5MipjMTMueCpjMjMueSArXG4gICAgICAgICAgICBjMTF5MipjMTJ4MipjMTMueSpjMjMueCAtIDMqYzIxeDIqYzEzLngqYzIxLnkqYzEzeTIgLSAzKmMyMHgyKmMxMy54KmMxM3kyKmMyMy55ICsgMypjMjB5MipjMTN4MipjMTMueSpjMjMueCArXG4gICAgICAgICAgICBjMTEueCpjMTIueCpjMTMueCpjMTMueSooNipjMjAueSpjMjMueSArIDYqYzIxLnkqYzIyLnkpICsgYzEyeDMqYzEzLnkqKC0yKmMyMC55KmMyMy55IC0gMipjMjEueSpjMjIueSkgK1xuICAgICAgICAgICAgYzEwLnkqYzEzeDMqKDYqYzIwLnkqYzIzLnkgKyA2KmMyMS55KmMyMi55KSArIGMxMS55KmMxMi54KmMxM3gyKigtMipjMjAueSpjMjMueSAtIDIqYzIxLnkqYzIyLnkpICtcbiAgICAgICAgICAgIGMxMngyKmMxMi55KmMxMy54KigyKmMyMC55KmMyMy55ICsgMipjMjEueSpjMjIueSkgKyBjMTEueCpjMTIueSpjMTN4MiooLTQqYzIwLnkqYzIzLnkgLSA0KmMyMS55KmMyMi55KSArXG4gICAgICAgICAgICBjMTAueCpjMTN4MipjMTMueSooLTYqYzIwLnkqYzIzLnkgLSA2KmMyMS55KmMyMi55KSArIGMyMC54KmMxM3gyKmMxMy55Kig2KmMyMC55KmMyMy55ICsgNipjMjEueSpjMjIueSkgK1xuICAgICAgICAgICAgYzIxLngqYzEzeDIqYzEzLnkqKDYqYzIwLnkqYzIyLnkgKyAzKmMyMXkyKSArIGMxM3gzKigtMipjMjAueSpjMjEueSpjMjIueSAtIGMyMHkyKmMyMy55IC1cbiAgICAgICAgICAgIGMyMS55KigyKmMyMC55KmMyMi55ICsgYzIxeTIpIC0gYzIwLnkqKDIqYzIwLnkqYzIzLnkgKyAyKmMyMS55KmMyMi55KSksXG4gICAgICAgIC1jMTAueCpjMTEueCpjMTIueSpjMTMueCpjMTMueSpjMjIueSArIGMxMC54KmMxMS55KmMxMi54KmMxMy54KmMxMy55KmMyMi55ICsgNipjMTAueCpjMTEueSpjMTIueSpjMTMueCpjMjIueCpjMTMueSAtXG4gICAgICAgICAgICA2KmMxMC55KmMxMS54KmMxMi54KmMxMy54KmMxMy55KmMyMi55IC0gYzEwLnkqYzExLngqYzEyLnkqYzEzLngqYzIyLngqYzEzLnkgKyBjMTAueSpjMTEueSpjMTIueCpjMTMueCpjMjIueCpjMTMueSArXG4gICAgICAgICAgICBjMTEueCpjMTEueSpjMTIueCpjMTIueSpjMTMueCpjMjIueSAtIGMxMS54KmMxMS55KmMxMi54KmMxMi55KmMyMi54KmMxMy55ICsgYzExLngqYzIwLngqYzEyLnkqYzEzLngqYzEzLnkqYzIyLnkgK1xuICAgICAgICAgICAgYzExLngqYzIwLnkqYzEyLnkqYzEzLngqYzIyLngqYzEzLnkgKyBjMTEueCpjMjEueCpjMTIueSpjMTMueCpjMjEueSpjMTMueSAtIGMyMC54KmMxMS55KmMxMi54KmMxMy54KmMxMy55KmMyMi55IC1cbiAgICAgICAgICAgIDYqYzIwLngqYzExLnkqYzEyLnkqYzEzLngqYzIyLngqYzEzLnkgLSBjMTEueSpjMTIueCpjMjAueSpjMTMueCpjMjIueCpjMTMueSAtIGMxMS55KmMxMi54KmMyMS54KmMxMy54KmMyMS55KmMxMy55IC1cbiAgICAgICAgICAgIDYqYzEwLngqYzIwLngqYzIyLngqYzEzeTMgLSAyKmMxMC54KmMxMnkzKmMxMy54KmMyMi54ICsgMipjMjAueCpjMTJ5MypjMTMueCpjMjIueCArIDIqYzEwLnkqYzEyeDMqYzEzLnkqYzIyLnkgLVxuICAgICAgICAgICAgNipjMTAueCpjMTAueSpjMTMueCpjMjIueCpjMTN5MiArIDMqYzEwLngqYzExLngqYzEyLngqYzEzeTIqYzIyLnkgLSAyKmMxMC54KmMxMS54KmMxMi55KmMyMi54KmMxM3kyIC1cbiAgICAgICAgICAgIDQqYzEwLngqYzExLnkqYzEyLngqYzIyLngqYzEzeTIgKyAzKmMxMC55KmMxMS54KmMxMi54KmMyMi54KmMxM3kyICsgNipjMTAueCpjMTAueSpjMTN4MipjMTMueSpjMjIueSArXG4gICAgICAgICAgICA2KmMxMC54KmMyMC54KmMxMy54KmMxM3kyKmMyMi55IC0gMypjMTAueCpjMTEueSpjMTIueSpjMTN4MipjMjIueSArIDIqYzEwLngqYzEyLngqYzEyeTIqYzEzLngqYzIyLnkgK1xuICAgICAgICAgICAgMipjMTAueCpjMTIueCpjMTJ5MipjMjIueCpjMTMueSArIDYqYzEwLngqYzIwLnkqYzEzLngqYzIyLngqYzEzeTIgKyA2KmMxMC54KmMyMS54KmMxMy54KmMyMS55KmMxM3kyICtcbiAgICAgICAgICAgIDQqYzEwLnkqYzExLngqYzEyLnkqYzEzeDIqYzIyLnkgKyA2KmMxMC55KmMyMC54KmMxMy54KmMyMi54KmMxM3kyICsgMipjMTAueSpjMTEueSpjMTIueCpjMTN4MipjMjIueSAtXG4gICAgICAgICAgICAzKmMxMC55KmMxMS55KmMxMi55KmMxM3gyKmMyMi54ICsgMipjMTAueSpjMTIueCpjMTJ5MipjMTMueCpjMjIueCAtIDMqYzExLngqYzIwLngqYzEyLngqYzEzeTIqYzIyLnkgK1xuICAgICAgICAgICAgMipjMTEueCpjMjAueCpjMTIueSpjMjIueCpjMTN5MiArIGMxMS54KmMxMS55KmMxMnkyKmMxMy54KmMyMi54IC0gMypjMTEueCpjMTIueCpjMjAueSpjMjIueCpjMTN5MiAtXG4gICAgICAgICAgICAzKmMxMS54KmMxMi54KmMyMS54KmMyMS55KmMxM3kyICsgNCpjMjAueCpjMTEueSpjMTIueCpjMjIueCpjMTN5MiAtIDIqYzEwLngqYzEyeDIqYzEyLnkqYzEzLnkqYzIyLnkgLVxuICAgICAgICAgICAgNipjMTAueSpjMjAueCpjMTN4MipjMTMueSpjMjIueSAtIDYqYzEwLnkqYzIwLnkqYzEzeDIqYzIyLngqYzEzLnkgLSA2KmMxMC55KmMyMS54KmMxM3gyKmMyMS55KmMxMy55IC1cbiAgICAgICAgICAgIDIqYzEwLnkqYzEyeDIqYzEyLnkqYzEzLngqYzIyLnkgLSAyKmMxMC55KmMxMngyKmMxMi55KmMyMi54KmMxMy55IC0gYzExLngqYzExLnkqYzEyeDIqYzEzLnkqYzIyLnkgLVxuICAgICAgICAgICAgMipjMTEueCpjMTF5MipjMTMueCpjMjIueCpjMTMueSArIDMqYzIwLngqYzExLnkqYzEyLnkqYzEzeDIqYzIyLnkgLSAyKmMyMC54KmMxMi54KmMxMnkyKmMxMy54KmMyMi55IC1cbiAgICAgICAgICAgIDIqYzIwLngqYzEyLngqYzEyeTIqYzIyLngqYzEzLnkgLSA2KmMyMC54KmMyMC55KmMxMy54KmMyMi54KmMxM3kyIC0gNipjMjAueCpjMjEueCpjMTMueCpjMjEueSpjMTN5MiArXG4gICAgICAgICAgICAzKmMxMS55KmMyMC55KmMxMi55KmMxM3gyKmMyMi54ICsgMypjMTEueSpjMjEueCpjMTIueSpjMTN4MipjMjEueSAtIDIqYzEyLngqYzIwLnkqYzEyeTIqYzEzLngqYzIyLnggLVxuICAgICAgICAgICAgMipjMTIueCpjMjEueCpjMTJ5MipjMTMueCpjMjEueSAtIGMxMXkyKmMxMi54KmMxMi55KmMxMy54KmMyMi54ICsgMipjMjAueCpjMTJ4MipjMTIueSpjMTMueSpjMjIueSAtXG4gICAgICAgICAgICAzKmMxMS55KmMyMXgyKmMxMi55KmMxMy54KmMxMy55ICsgNipjMjAueSpjMjEueCpjMTN4MipjMjEueSpjMTMueSArIDIqYzExeDIqYzExLnkqYzEzLngqYzEzLnkqYzIyLnkgK1xuICAgICAgICAgICAgYzExeDIqYzEyLngqYzEyLnkqYzEzLnkqYzIyLnkgKyAyKmMxMngyKmMyMC55KmMxMi55KmMyMi54KmMxMy55ICsgMipjMTJ4MipjMjEueCpjMTIueSpjMjEueSpjMTMueSAtXG4gICAgICAgICAgICAzKmMxMC54KmMyMXgyKmMxM3kzICsgMypjMjAueCpjMjF4MipjMTN5MyArIDMqYzEweDIqYzIyLngqYzEzeTMgLSAzKmMxMHkyKmMxM3gzKmMyMi55ICsgMypjMjB4MipjMjIueCpjMTN5MyArXG4gICAgICAgICAgICBjMjF4MipjMTJ5MypjMTMueCArIGMxMXkzKmMxM3gyKmMyMi54IC0gYzExeDMqYzEzeTIqYzIyLnkgKyAzKmMxMC55KmMyMXgyKmMxMy54KmMxM3kyIC1cbiAgICAgICAgICAgIGMxMS54KmMxMXkyKmMxM3gyKmMyMi55ICsgYzExLngqYzIxeDIqYzEyLnkqYzEzeTIgKyAyKmMxMS55KmMxMi54KmMyMXgyKmMxM3kyICsgYzExeDIqYzExLnkqYzIyLngqYzEzeTIgLVxuICAgICAgICAgICAgYzEyLngqYzIxeDIqYzEyeTIqYzEzLnkgLSAzKmMyMC55KmMyMXgyKmMxMy54KmMxM3kyIC0gMypjMTB4MipjMTMueCpjMTN5MipjMjIueSArIDMqYzEweTIqYzEzeDIqYzIyLngqYzEzLnkgLVxuICAgICAgICAgICAgYzExeDIqYzEyeTIqYzEzLngqYzIyLnkgKyBjMTF5MipjMTJ4MipjMjIueCpjMTMueSAtIDMqYzIweDIqYzEzLngqYzEzeTIqYzIyLnkgKyAzKmMyMHkyKmMxM3gyKmMyMi54KmMxMy55ICtcbiAgICAgICAgICAgIGMxMngyKmMxMi55KmMxMy54KigyKmMyMC55KmMyMi55ICsgYzIxeTIpICsgYzExLngqYzEyLngqYzEzLngqYzEzLnkqKDYqYzIwLnkqYzIyLnkgKyAzKmMyMXkyKSArXG4gICAgICAgICAgICBjMTJ4MypjMTMueSooLTIqYzIwLnkqYzIyLnkgLSBjMjF5MikgKyBjMTAueSpjMTN4MyooNipjMjAueSpjMjIueSArIDMqYzIxeTIpICtcbiAgICAgICAgICAgIGMxMS55KmMxMi54KmMxM3gyKigtMipjMjAueSpjMjIueSAtIGMyMXkyKSArIGMxMS54KmMxMi55KmMxM3gyKigtNCpjMjAueSpjMjIueSAtIDIqYzIxeTIpICtcbiAgICAgICAgICAgIGMxMC54KmMxM3gyKmMxMy55KigtNipjMjAueSpjMjIueSAtIDMqYzIxeTIpICsgYzIwLngqYzEzeDIqYzEzLnkqKDYqYzIwLnkqYzIyLnkgKyAzKmMyMXkyKSArXG4gICAgICAgICAgICBjMTN4MyooLTIqYzIwLnkqYzIxeTIgLSBjMjB5MipjMjIueSAtIGMyMC55KigyKmMyMC55KmMyMi55ICsgYzIxeTIpKSxcbiAgICAgICAgLWMxMC54KmMxMS54KmMxMi55KmMxMy54KmMyMS55KmMxMy55ICsgYzEwLngqYzExLnkqYzEyLngqYzEzLngqYzIxLnkqYzEzLnkgKyA2KmMxMC54KmMxMS55KmMyMS54KmMxMi55KmMxMy54KmMxMy55IC1cbiAgICAgICAgICAgIDYqYzEwLnkqYzExLngqYzEyLngqYzEzLngqYzIxLnkqYzEzLnkgLSBjMTAueSpjMTEueCpjMjEueCpjMTIueSpjMTMueCpjMTMueSArIGMxMC55KmMxMS55KmMxMi54KmMyMS54KmMxMy54KmMxMy55IC1cbiAgICAgICAgICAgIGMxMS54KmMxMS55KmMxMi54KmMyMS54KmMxMi55KmMxMy55ICsgYzExLngqYzExLnkqYzEyLngqYzEyLnkqYzEzLngqYzIxLnkgKyBjMTEueCpjMjAueCpjMTIueSpjMTMueCpjMjEueSpjMTMueSArXG4gICAgICAgICAgICA2KmMxMS54KmMxMi54KmMyMC55KmMxMy54KmMyMS55KmMxMy55ICsgYzExLngqYzIwLnkqYzIxLngqYzEyLnkqYzEzLngqYzEzLnkgLSBjMjAueCpjMTEueSpjMTIueCpjMTMueCpjMjEueSpjMTMueSAtXG4gICAgICAgICAgICA2KmMyMC54KmMxMS55KmMyMS54KmMxMi55KmMxMy54KmMxMy55IC0gYzExLnkqYzEyLngqYzIwLnkqYzIxLngqYzEzLngqYzEzLnkgLSA2KmMxMC54KmMyMC54KmMyMS54KmMxM3kzIC1cbiAgICAgICAgICAgIDIqYzEwLngqYzIxLngqYzEyeTMqYzEzLnggKyA2KmMxMC55KmMyMC55KmMxM3gzKmMyMS55ICsgMipjMjAueCpjMjEueCpjMTJ5MypjMTMueCArIDIqYzEwLnkqYzEyeDMqYzIxLnkqYzEzLnkgLVxuICAgICAgICAgICAgMipjMTJ4MypjMjAueSpjMjEueSpjMTMueSAtIDYqYzEwLngqYzEwLnkqYzIxLngqYzEzLngqYzEzeTIgKyAzKmMxMC54KmMxMS54KmMxMi54KmMyMS55KmMxM3kyIC1cbiAgICAgICAgICAgIDIqYzEwLngqYzExLngqYzIxLngqYzEyLnkqYzEzeTIgLSA0KmMxMC54KmMxMS55KmMxMi54KmMyMS54KmMxM3kyICsgMypjMTAueSpjMTEueCpjMTIueCpjMjEueCpjMTN5MiArXG4gICAgICAgICAgICA2KmMxMC54KmMxMC55KmMxM3gyKmMyMS55KmMxMy55ICsgNipjMTAueCpjMjAueCpjMTMueCpjMjEueSpjMTN5MiAtIDMqYzEwLngqYzExLnkqYzEyLnkqYzEzeDIqYzIxLnkgK1xuICAgICAgICAgICAgMipjMTAueCpjMTIueCpjMjEueCpjMTJ5MipjMTMueSArIDIqYzEwLngqYzEyLngqYzEyeTIqYzEzLngqYzIxLnkgKyA2KmMxMC54KmMyMC55KmMyMS54KmMxMy54KmMxM3kyICtcbiAgICAgICAgICAgIDQqYzEwLnkqYzExLngqYzEyLnkqYzEzeDIqYzIxLnkgKyA2KmMxMC55KmMyMC54KmMyMS54KmMxMy54KmMxM3kyICsgMipjMTAueSpjMTEueSpjMTIueCpjMTN4MipjMjEueSAtXG4gICAgICAgICAgICAzKmMxMC55KmMxMS55KmMyMS54KmMxMi55KmMxM3gyICsgMipjMTAueSpjMTIueCpjMjEueCpjMTJ5MipjMTMueCAtIDMqYzExLngqYzIwLngqYzEyLngqYzIxLnkqYzEzeTIgK1xuICAgICAgICAgICAgMipjMTEueCpjMjAueCpjMjEueCpjMTIueSpjMTN5MiArIGMxMS54KmMxMS55KmMyMS54KmMxMnkyKmMxMy54IC0gMypjMTEueCpjMTIueCpjMjAueSpjMjEueCpjMTN5MiArXG4gICAgICAgICAgICA0KmMyMC54KmMxMS55KmMxMi54KmMyMS54KmMxM3kyIC0gNipjMTAueCpjMjAueSpjMTN4MipjMjEueSpjMTMueSAtIDIqYzEwLngqYzEyeDIqYzEyLnkqYzIxLnkqYzEzLnkgLVxuICAgICAgICAgICAgNipjMTAueSpjMjAueCpjMTN4MipjMjEueSpjMTMueSAtIDYqYzEwLnkqYzIwLnkqYzIxLngqYzEzeDIqYzEzLnkgLSAyKmMxMC55KmMxMngyKmMyMS54KmMxMi55KmMxMy55IC1cbiAgICAgICAgICAgIDIqYzEwLnkqYzEyeDIqYzEyLnkqYzEzLngqYzIxLnkgLSBjMTEueCpjMTEueSpjMTJ4MipjMjEueSpjMTMueSAtIDQqYzExLngqYzIwLnkqYzEyLnkqYzEzeDIqYzIxLnkgLVxuICAgICAgICAgICAgMipjMTEueCpjMTF5MipjMjEueCpjMTMueCpjMTMueSArIDMqYzIwLngqYzExLnkqYzEyLnkqYzEzeDIqYzIxLnkgLSAyKmMyMC54KmMxMi54KmMyMS54KmMxMnkyKmMxMy55IC1cbiAgICAgICAgICAgIDIqYzIwLngqYzEyLngqYzEyeTIqYzEzLngqYzIxLnkgLSA2KmMyMC54KmMyMC55KmMyMS54KmMxMy54KmMxM3kyIC0gMipjMTEueSpjMTIueCpjMjAueSpjMTN4MipjMjEueSArXG4gICAgICAgICAgICAzKmMxMS55KmMyMC55KmMyMS54KmMxMi55KmMxM3gyIC0gMipjMTIueCpjMjAueSpjMjEueCpjMTJ5MipjMTMueCAtIGMxMXkyKmMxMi54KmMyMS54KmMxMi55KmMxMy54ICtcbiAgICAgICAgICAgIDYqYzIwLngqYzIwLnkqYzEzeDIqYzIxLnkqYzEzLnkgKyAyKmMyMC54KmMxMngyKmMxMi55KmMyMS55KmMxMy55ICsgMipjMTF4MipjMTEueSpjMTMueCpjMjEueSpjMTMueSArXG4gICAgICAgICAgICBjMTF4MipjMTIueCpjMTIueSpjMjEueSpjMTMueSArIDIqYzEyeDIqYzIwLnkqYzIxLngqYzEyLnkqYzEzLnkgKyAyKmMxMngyKmMyMC55KmMxMi55KmMxMy54KmMyMS55ICtcbiAgICAgICAgICAgIDMqYzEweDIqYzIxLngqYzEzeTMgLSAzKmMxMHkyKmMxM3gzKmMyMS55ICsgMypjMjB4MipjMjEueCpjMTN5MyArIGMxMXkzKmMyMS54KmMxM3gyIC0gYzExeDMqYzIxLnkqYzEzeTIgLVxuICAgICAgICAgICAgMypjMjB5MipjMTN4MypjMjEueSAtIGMxMS54KmMxMXkyKmMxM3gyKmMyMS55ICsgYzExeDIqYzExLnkqYzIxLngqYzEzeTIgLSAzKmMxMHgyKmMxMy54KmMyMS55KmMxM3kyICtcbiAgICAgICAgICAgIDMqYzEweTIqYzIxLngqYzEzeDIqYzEzLnkgLSBjMTF4MipjMTJ5MipjMTMueCpjMjEueSArIGMxMXkyKmMxMngyKmMyMS54KmMxMy55IC0gMypjMjB4MipjMTMueCpjMjEueSpjMTN5MiArXG4gICAgICAgICAgICAzKmMyMHkyKmMyMS54KmMxM3gyKmMxMy55LFxuICAgICAgICBjMTAueCpjMTAueSpjMTEueCpjMTIueSpjMTMueCpjMTMueSAtIGMxMC54KmMxMC55KmMxMS55KmMxMi54KmMxMy54KmMxMy55ICsgYzEwLngqYzExLngqYzExLnkqYzEyLngqYzEyLnkqYzEzLnkgLVxuICAgICAgICAgICAgYzEwLnkqYzExLngqYzExLnkqYzEyLngqYzEyLnkqYzEzLnggLSBjMTAueCpjMTEueCpjMjAueSpjMTIueSpjMTMueCpjMTMueSArIDYqYzEwLngqYzIwLngqYzExLnkqYzEyLnkqYzEzLngqYzEzLnkgK1xuICAgICAgICAgICAgYzEwLngqYzExLnkqYzEyLngqYzIwLnkqYzEzLngqYzEzLnkgLSBjMTAueSpjMTEueCpjMjAueCpjMTIueSpjMTMueCpjMTMueSAtIDYqYzEwLnkqYzExLngqYzEyLngqYzIwLnkqYzEzLngqYzEzLnkgK1xuICAgICAgICAgICAgYzEwLnkqYzIwLngqYzExLnkqYzEyLngqYzEzLngqYzEzLnkgLSBjMTEueCpjMjAueCpjMTEueSpjMTIueCpjMTIueSpjMTMueSArIGMxMS54KmMxMS55KmMxMi54KmMyMC55KmMxMi55KmMxMy54ICtcbiAgICAgICAgICAgIGMxMS54KmMyMC54KmMyMC55KmMxMi55KmMxMy54KmMxMy55IC0gYzIwLngqYzExLnkqYzEyLngqYzIwLnkqYzEzLngqYzEzLnkgLSAyKmMxMC54KmMyMC54KmMxMnkzKmMxMy54ICtcbiAgICAgICAgICAgIDIqYzEwLnkqYzEyeDMqYzIwLnkqYzEzLnkgLSAzKmMxMC54KmMxMC55KmMxMS54KmMxMi54KmMxM3kyIC0gNipjMTAueCpjMTAueSpjMjAueCpjMTMueCpjMTN5MiArXG4gICAgICAgICAgICAzKmMxMC54KmMxMC55KmMxMS55KmMxMi55KmMxM3gyIC0gMipjMTAueCpjMTAueSpjMTIueCpjMTJ5MipjMTMueCAtIDIqYzEwLngqYzExLngqYzIwLngqYzEyLnkqYzEzeTIgLVxuICAgICAgICAgICAgYzEwLngqYzExLngqYzExLnkqYzEyeTIqYzEzLnggKyAzKmMxMC54KmMxMS54KmMxMi54KmMyMC55KmMxM3kyIC0gNCpjMTAueCpjMjAueCpjMTEueSpjMTIueCpjMTN5MiArXG4gICAgICAgICAgICAzKmMxMC55KmMxMS54KmMyMC54KmMxMi54KmMxM3kyICsgNipjMTAueCpjMTAueSpjMjAueSpjMTN4MipjMTMueSArIDIqYzEwLngqYzEwLnkqYzEyeDIqYzEyLnkqYzEzLnkgK1xuICAgICAgICAgICAgMipjMTAueCpjMTEueCpjMTF5MipjMTMueCpjMTMueSArIDIqYzEwLngqYzIwLngqYzEyLngqYzEyeTIqYzEzLnkgKyA2KmMxMC54KmMyMC54KmMyMC55KmMxMy54KmMxM3kyIC1cbiAgICAgICAgICAgIDMqYzEwLngqYzExLnkqYzIwLnkqYzEyLnkqYzEzeDIgKyAyKmMxMC54KmMxMi54KmMyMC55KmMxMnkyKmMxMy54ICsgYzEwLngqYzExeTIqYzEyLngqYzEyLnkqYzEzLnggK1xuICAgICAgICAgICAgYzEwLnkqYzExLngqYzExLnkqYzEyeDIqYzEzLnkgKyA0KmMxMC55KmMxMS54KmMyMC55KmMxMi55KmMxM3gyIC0gMypjMTAueSpjMjAueCpjMTEueSpjMTIueSpjMTN4MiArXG4gICAgICAgICAgICAyKmMxMC55KmMyMC54KmMxMi54KmMxMnkyKmMxMy54ICsgMipjMTAueSpjMTEueSpjMTIueCpjMjAueSpjMTN4MiArIGMxMS54KmMyMC54KmMxMS55KmMxMnkyKmMxMy54IC1cbiAgICAgICAgICAgIDMqYzExLngqYzIwLngqYzEyLngqYzIwLnkqYzEzeTIgLSAyKmMxMC54KmMxMngyKmMyMC55KmMxMi55KmMxMy55IC0gNipjMTAueSpjMjAueCpjMjAueSpjMTN4MipjMTMueSAtXG4gICAgICAgICAgICAyKmMxMC55KmMyMC54KmMxMngyKmMxMi55KmMxMy55IC0gMipjMTAueSpjMTF4MipjMTEueSpjMTMueCpjMTMueSAtIGMxMC55KmMxMXgyKmMxMi54KmMxMi55KmMxMy55IC1cbiAgICAgICAgICAgIDIqYzEwLnkqYzEyeDIqYzIwLnkqYzEyLnkqYzEzLnggLSAyKmMxMS54KmMyMC54KmMxMXkyKmMxMy54KmMxMy55IC0gYzExLngqYzExLnkqYzEyeDIqYzIwLnkqYzEzLnkgK1xuICAgICAgICAgICAgMypjMjAueCpjMTEueSpjMjAueSpjMTIueSpjMTN4MiAtIDIqYzIwLngqYzEyLngqYzIwLnkqYzEyeTIqYzEzLnggLSBjMjAueCpjMTF5MipjMTIueCpjMTIueSpjMTMueCArXG4gICAgICAgICAgICAzKmMxMHkyKmMxMS54KmMxMi54KmMxMy54KmMxMy55ICsgMypjMTEueCpjMTIueCpjMjB5MipjMTMueCpjMTMueSArIDIqYzIwLngqYzEyeDIqYzIwLnkqYzEyLnkqYzEzLnkgLVxuICAgICAgICAgICAgMypjMTB4MipjMTEueSpjMTIueSpjMTMueCpjMTMueSArIDIqYzExeDIqYzExLnkqYzIwLnkqYzEzLngqYzEzLnkgKyBjMTF4MipjMTIueCpjMjAueSpjMTIueSpjMTMueSAtXG4gICAgICAgICAgICAzKmMyMHgyKmMxMS55KmMxMi55KmMxMy54KmMxMy55IC0gYzEweDMqYzEzeTMgKyBjMTB5MypjMTN4MyArIGMyMHgzKmMxM3kzIC0gYzIweTMqYzEzeDMgLVxuICAgICAgICAgICAgMypjMTAueCpjMjB4MipjMTN5MyAtIGMxMC54KmMxMXkzKmMxM3gyICsgMypjMTB4MipjMjAueCpjMTN5MyArIGMxMC55KmMxMXgzKmMxM3kyICtcbiAgICAgICAgICAgIDMqYzEwLnkqYzIweTIqYzEzeDMgKyBjMjAueCpjMTF5MypjMTN4MiArIGMxMHgyKmMxMnkzKmMxMy54IC0gMypjMTB5MipjMjAueSpjMTN4MyAtIGMxMHkyKmMxMngzKmMxMy55ICtcbiAgICAgICAgICAgIGMyMHgyKmMxMnkzKmMxMy54IC0gYzExeDMqYzIwLnkqYzEzeTIgLSBjMTJ4MypjMjB5MipjMTMueSAtIGMxMC54KmMxMXgyKmMxMS55KmMxM3kyICtcbiAgICAgICAgICAgIGMxMC55KmMxMS54KmMxMXkyKmMxM3gyIC0gMypjMTAueCpjMTB5MipjMTN4MipjMTMueSAtIGMxMC54KmMxMXkyKmMxMngyKmMxMy55ICsgYzEwLnkqYzExeDIqYzEyeTIqYzEzLnggLVxuICAgICAgICAgICAgYzExLngqYzExeTIqYzIwLnkqYzEzeDIgKyAzKmMxMHgyKmMxMC55KmMxMy54KmMxM3kyICsgYzEweDIqYzExLngqYzEyLnkqYzEzeTIgK1xuICAgICAgICAgICAgMipjMTB4MipjMTEueSpjMTIueCpjMTN5MiAtIDIqYzEweTIqYzExLngqYzEyLnkqYzEzeDIgLSBjMTB5MipjMTEueSpjMTIueCpjMTN4MiArIGMxMXgyKmMyMC54KmMxMS55KmMxM3kyIC1cbiAgICAgICAgICAgIDMqYzEwLngqYzIweTIqYzEzeDIqYzEzLnkgKyAzKmMxMC55KmMyMHgyKmMxMy54KmMxM3kyICsgYzExLngqYzIweDIqYzEyLnkqYzEzeTIgLSAyKmMxMS54KmMyMHkyKmMxMi55KmMxM3gyICtcbiAgICAgICAgICAgIGMyMC54KmMxMXkyKmMxMngyKmMxMy55IC0gYzExLnkqYzEyLngqYzIweTIqYzEzeDIgLSBjMTB4MipjMTIueCpjMTJ5MipjMTMueSAtIDMqYzEweDIqYzIwLnkqYzEzLngqYzEzeTIgK1xuICAgICAgICAgICAgMypjMTB5MipjMjAueCpjMTN4MipjMTMueSArIGMxMHkyKmMxMngyKmMxMi55KmMxMy54IC0gYzExeDIqYzIwLnkqYzEyeTIqYzEzLnggKyAyKmMyMHgyKmMxMS55KmMxMi54KmMxM3kyICtcbiAgICAgICAgICAgIDMqYzIwLngqYzIweTIqYzEzeDIqYzEzLnkgLSBjMjB4MipjMTIueCpjMTJ5MipjMTMueSAtIDMqYzIweDIqYzIwLnkqYzEzLngqYzEzeTIgKyBjMTJ4MipjMjB5MipjMTIueSpjMTMueFxuICAgICk7XG4gICAgdmFyIHJvb3RzID0gcG9seS5nZXRSb290c0luSW50ZXJ2YWwoMCwxKTtcblxuICAgIGZvciAoIHZhciBpID0gMDsgaSA8IHJvb3RzLmxlbmd0aDsgaSsrICkge1xuICAgICAgICB2YXIgcyA9IHJvb3RzW2ldO1xuICAgICAgICB2YXIgeFJvb3RzID0gbmV3IFBvbHlub21pYWwoXG4gICAgICAgICAgICBjMTMueCxcbiAgICAgICAgICAgIGMxMi54LFxuICAgICAgICAgICAgYzExLngsXG4gICAgICAgICAgICBjMTAueCAtIGMyMC54IC0gcypjMjEueCAtIHMqcypjMjIueCAtIHMqcypzKmMyMy54XG4gICAgICAgICkuZ2V0Um9vdHMoKTtcbiAgICAgICAgdmFyIHlSb290cyA9IG5ldyBQb2x5bm9taWFsKFxuICAgICAgICAgICAgYzEzLnksXG4gICAgICAgICAgICBjMTIueSxcbiAgICAgICAgICAgIGMxMS55LFxuICAgICAgICAgICAgYzEwLnkgLSBjMjAueSAtIHMqYzIxLnkgLSBzKnMqYzIyLnkgLSBzKnMqcypjMjMueVxuICAgICAgICApLmdldFJvb3RzKCk7XG5cbiAgICAgICAgaWYgKCB4Um9vdHMubGVuZ3RoID4gMCAmJiB5Um9vdHMubGVuZ3RoID4gMCApIHtcbiAgICAgICAgICAgIHZhciBUT0xFUkFOQ0UgPSAxZS00O1xuXG4gICAgICAgICAgICBjaGVja1Jvb3RzOlxuICAgICAgICAgICAgZm9yICggdmFyIGogPSAwOyBqIDwgeFJvb3RzLmxlbmd0aDsgaisrICkge1xuICAgICAgICAgICAgICAgIHZhciB4Um9vdCA9IHhSb290c1tqXTtcbiAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICBpZiAoIDAgPD0geFJvb3QgJiYgeFJvb3QgPD0gMSApIHtcbiAgICAgICAgICAgICAgICAgICAgZm9yICggdmFyIGsgPSAwOyBrIDwgeVJvb3RzLmxlbmd0aDsgaysrICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCBNYXRoLmFicyggeFJvb3QgLSB5Um9vdHNba10gKSA8IFRPTEVSQU5DRSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucG9pbnRzLnB1c2goXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMyMy5tdWx0aXBseShzKnMqcykuYWRkKGMyMi5tdWx0aXBseShzKnMpLmFkZChjMjEubXVsdGlwbHkocykuYWRkKGMyMCkpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsgY2hlY2tSb290cztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlmICggcmVzdWx0LnBvaW50cy5sZW5ndGggPiAwICkgcmVzdWx0LnN0YXR1cyA9IFwiSW50ZXJzZWN0aW9uXCI7XG5cbiAgICByZXR1cm4gcmVzdWx0O1xufTtcblxuXG4vKioqKipcbipcbiogICBpbnRlcnNlY3RCZXppZXIzQ2lyY2xlXG4qXG4qKioqKi9cbkludGVyc2VjdGlvbi5pbnRlcnNlY3RCZXppZXIzQ2lyY2xlID0gZnVuY3Rpb24ocDEsIHAyLCBwMywgcDQsIGMsIHIpIHtcbiAgICByZXR1cm4gSW50ZXJzZWN0aW9uLmludGVyc2VjdEJlemllcjNFbGxpcHNlKHAxLCBwMiwgcDMsIHA0LCBjLCByLCByKTtcbn07XG5cblxuLyoqKioqXG4qXG4qICAgaW50ZXJzZWN0QmV6aWVyM0VsbGlwc2VcbipcbioqKioqL1xuSW50ZXJzZWN0aW9uLmludGVyc2VjdEJlemllcjNFbGxpcHNlID0gZnVuY3Rpb24ocDEsIHAyLCBwMywgcDQsIGVjLCByeCwgcnkpIHtcbiAgICB2YXIgYSwgYiwgYywgZDsgICAgICAgLy8gdGVtcG9yYXJ5IHZhcmlhYmxlc1xuICAgIHZhciBjMywgYzIsIGMxLCBjMDsgICAvLyBjb2VmZmljaWVudHMgb2YgY3ViaWNcbiAgICB2YXIgcmVzdWx0ID0gbmV3IEludGVyc2VjdGlvbihcIk5vIEludGVyc2VjdGlvblwiKTtcblxuICAgIC8vIENhbGN1bGF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9ucyBvZiBvcmlnaW5hbCBCZXppZXJcbiAgICAvLyBjb250cm9scy4gIFRoaXMgZW5kcyB1cCB3aXRoIGEgdmVjdG9yIGN1YmljIGluIHQ6XG4gICAgLy8gICAgICgtUDErM1AyLTNQMytQNCl0XjMgKyAoM1AxLTZQMiszUDMpdF4yICsgKC0zUDErM1AyKXQgKyBQMVxuICAgIC8vICAgICAgICAgICAgIC9cXCAgICAgICAgICAgICAgICAgIC9cXCAgICAgICAgICAgICAgICAvXFwgICAgICAgL1xcXG4gICAgLy8gICAgICAgICAgICAgfHwgICAgICAgICAgICAgICAgICB8fCAgICAgICAgICAgICAgICB8fCAgICAgICB8fFxuICAgIC8vICAgICAgICAgICAgIGMzICAgICAgICAgICAgICAgICAgYzIgICAgICAgICAgICAgICAgYzEgICAgICAgYzBcbiAgICBcbiAgICAvLyBDYWxjdWxhdGUgdGhlIGNvZWZmaWNpZW50c1xuICAgIGEgPSBwMS5tdWx0aXBseSgtMSk7XG4gICAgYiA9IHAyLm11bHRpcGx5KDMpO1xuICAgIGMgPSBwMy5tdWx0aXBseSgtMyk7XG4gICAgZCA9IGEuYWRkKGIuYWRkKGMuYWRkKHA0KSkpO1xuICAgIGMzID0gbmV3IFZlY3RvcjJEKGQueCwgZC55KTtcblxuICAgIGEgPSBwMS5tdWx0aXBseSgzKTtcbiAgICBiID0gcDIubXVsdGlwbHkoLTYpO1xuICAgIGMgPSBwMy5tdWx0aXBseSgzKTtcbiAgICBkID0gYS5hZGQoYi5hZGQoYykpO1xuICAgIGMyID0gbmV3IFZlY3RvcjJEKGQueCwgZC55KTtcblxuICAgIGEgPSBwMS5tdWx0aXBseSgtMyk7XG4gICAgYiA9IHAyLm11bHRpcGx5KDMpO1xuICAgIGMgPSBhLmFkZChiKTtcbiAgICBjMSA9IG5ldyBWZWN0b3IyRChjLngsIGMueSk7XG5cbiAgICBjMCA9IG5ldyBWZWN0b3IyRChwMS54LCBwMS55KTtcbiAgICBcbiAgICAvLyBDb252ZXJ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aW5kIHBvaW50IG9uIEJlemllclxuICAgICAgICAgICAgdmFyIHA1ID0gcDEubGVycChwMiwgdCk7XG4gICAgICAgICAgICB2YXIgcDYgPSBwMi5sZXJwKHAzLCB0KTtcbiAgICAgICAgICAgIHZhciBwNyA9IHAzLmxlcnAocDQsIHQpO1xuXG4gICAgICAgICAgICB2YXIgcDggPSBwNS5sZXJwKHA2LCB0KTtcbiAgICAgICAgICAgIHZhciBwOSA9IHA2LmxlcnAocDcsIHQpO1xuXG4gICAgICAgICAgICB2YXIgcDEwID0gcDgubGVycChwOSwgdCk7XG5cbiAgICAgICAgICAgIC8vIFNlZSBpZiBwb2ludCBpcyBvbiBsaW5lIHNlZ21lbnRcbiAgICAgICAgICAgIC8vIEhhZCB0byBtYWtlIHNwZWNpYWwgY2FzZXMgZm9yIHZlcnRpY2FsIGFuZCBob3Jpem9udGFsIGxpbmVzIGR1ZVxuICAgICAgICAgICAgLy8gdG8gc2xpZ2h0IGVycm9ycyBpbiBjYWxjdWxhdGlvbiBvZiBwMTBcbiAgICAgICAgICAgIGlmICggYTEueCA9PSBhMi54ICkge1xuICAgICAgICAgICAgICAgIGlmICggbWluLnkgPD0gcDEwLnkgJiYgcDEwLnkgPD0gbWF4LnkgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdC5zdGF0dXMgPSBcIkludGVyc2VjdGlvblwiO1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQuYXBwZW5kUG9pbnQoIHAxMCApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIGExLnkgPT0gYTIueSApIHtcbiAgICAgICAgICAgICAgICBpZiAoIG1pbi54IDw9IHAxMC54ICYmIHAxMC54IDw9IG1heC54ICkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQuc3RhdHVzID0gXCJJbnRlcnNlY3Rpb25cIjtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZFBvaW50KCBwMTAgKTtcbiA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AgICAgICB2YXIgcCA9IGMxLmxlcnAoYzIsIGEvY19kaXN0KTtcbiAgICAgICAgdmFyIGIgPSBoIC8gY19kaXN0O1xuXG4gICAgICAgIHJlc3VsdC5wb2ludHMucHVzaChcbiAgICAgICAgICAgIG5ldyBQb2ludDJEKFxuICAgICAgICAgICAgICAgIHAueCAtIGIgKiAoYzIueSAtIGMxLnkpLFxuICAgICAgICAgICAgICAgIHAueSArIGIgKiAoYzIueCAtIGMxLngpXG4gICAgICAgICAgICApXG4gICAgICAgICk7XG4gICAgICAgIHJlc3VsdC5wb2ludHMucHVzaChcbiAgICAgICAgICAgIG5ldyBQb2ludDJEKFxuICAgICAgICAgICAgICAgIHAueCArIGIgKiAoYzIueSAtIGMxLnkpLFxuICAgICAgICAgICAgICAgIHAueSAtIGIgKiAoYzIueCAtIGMxLngpXG4gICAgICAgICAgICApXG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgcmV0dXJuIHJlc3VsdDtcbn07XG5cblxuLyoqKioqXG4qXG4qICAgaW50ZXJzZWN0Q2lyY2xlRWxsaXBzZVxuKlxuKioqKiovXG5JbnRlcnNlY3Rpb24uaW50ZXJzZWN0Q2lyY2xlRWxsaXBzZSA9IGZ1bmN0aW9uKGNjLCByLCBlYywgcngsIHJ5KSB7XG4gICAgcmV0dXJuIEludGVyc2VjdGlvbi5pbnRlcnNlY3RFbGxpcHNlRWxsaXBzZShjYywgciwgciwgZWMsIHJ4LCByeSk7XG59O1xuXG5cbi8qKioqKlxuKlxuKiAgIGludGVyc2VjdENpcmNsZUxpbmVcbipcbioqKioqL1xuSW50ZXJzZWN0aW9uLmludGVyc2VjdENpcmNsZUxpbmUgPSBmdW5jdGlvbihjLCByLCBhMSwgYTIpIHtcbiAgICB2YXIgcmVzdWx0O1xuICAgIHZhciBhICA9IChhMi54IC0gYTEueCkgKiAoYTIueCAtIGExLngpICtcbiAgICAgICAgICAgICAoYTIueSAtIGExLnkpICogKGEyLnkgLSBhMS55KTtcbiAgICB2YXIgYiAgPSAyICogKCAoYTIueCAtIGExLngpICogKGExLnggLSBjLngpICtcbiAgICAgICAgICAgICAgICAgICAoYTIueSAtIGExLnkpICogKGExLnkgLSBjLnkpICAgKTtcbiAgICB2YXIgY2MgPSBjLngqYy54ICsgYy55KmMueSArIGExLngqYTEueCArIGExLnkqYTEueSAtXG4gICAgICAgICAgICAgMiAqIChjLnggKiBhMS54ICsgYy55ICogYTEueSkgLSByKnI7XG4gICAgdmFyIGRldGVyID0gYipiIC0gNCphKmNjO1xuXG4gICAgaWYgKCBkZXRlciA8IDAgKSB7XG4gICAgICAgIHJlc3VsdCA9IG5ldyBJbnRlcnNlY3Rpb24oXCJPdXRzaWRlXCIpO1xuICAgIH0gZWxzZSBpZiAoIGRldGVyID09IDAgKSB7XG4gICAgICAgIHJlc3VsdCA9IG5ldyBJbnRlcnNlY3Rpb24oXCJUYW5nZW50XCIpO1xuICAgICAgICAvLyBOT1RFOiBzaG91bGQgY2FsY3VsYXRlIHRoaXMgcG9pbnRcbiAgICB9IGVsc2Uge1xuICAgICAgICB2YXIgZSAgPSBNYXRoLnNxcnQoZGV0ZXIpO1xuICAgICAgICB2YXIgdTEgPSAoIC1iICsgZSApIC8gKCAyKmEgKTtcbiAgICAgICAgdmFyIHUyID0gKCAtYiAtIGUgKSAvICggMiphICk7XG5cbiAgICAgICAgaWYgKCAodTEgPCAwIHx8IHUxID4gMSkgJiYgKHUyIDwgMCB8fCB1MiA+IDEpICkge1xuICAgICAgICAgICAgaWYgKCAodTEgPCAwICYmIHUyIDwgMCkgfHwgKHUxID4gMSAmJiB1MiA+IDEpICkge1xuICAgICAgICAgICAgICAgIHJlc3VsdCA9IG5ldyBJbnRlcnNlY3Rpb24oXCJPdXRzaWRlXCIpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiSW5zaWRlXCIpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVs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IqcnkyKmMyLngsIC0yKnJ4MipyeDIqYzIueSxcbiAgICAgICAgcnkyKnJ5MipjMi54KmMyLnggKyByeDIqcngyKmMyLnkqYzIueSAtIHJ4MipyeDIqcnkyKnJ5MlxuICAgIF07XG5cbiAgICB2YXIgeVBvbHkgICA9IEludGVyc2VjdGlvbi5iZXpvdXQoYSwgYik7XG4gICAgdmFyIHlSb290cyAgPSB5UG9seS5nZXRSb290cygpO1xuICAgIHZhciBlcHNpbG9uID0gMWUtMztcbiAgICB2YXIgbm9ybTAgICA9ICggYVswXSphWzBdICsgMiphWzFdKmFbMV0gKyBhWzJdKmFbMl0gKSAqIGVwc2lsb247XG4gICAgdmFyIG5vcm0xICAgPSAoIGJbMF0qYlswXSArIDIqYlsxXSpiWzFdICsgYlsyXSpiWzJdICkgKiBlcHNpbG9uO1xuICAgIHZhciByZXN1bHQgID0gbmV3IEludGVyc2VjdGlvbihcIk5vIEludGVyc2VjdGlvblwiKTtcblxuICAgIGZvciAoIHZhciB5ID0gMDsgeSA8IHlSb290cy5sZW5ndGg7IHkrKyApIHtcbiAgICAgICAgdmFyIHhQb2x5ID0gbmV3IFBvbHlub21pYWwoXG4gICAgICAgICAgICBhWzBdLFxuICAgICAgICAgICAgYVszXSArIHlSb290c1t5XSAqIGFbMV0sXG4gICAgICAgICAgICBhWzVdICsgeVJvb3RzW3ldICogKGFbNF0gKyB5Um9vdHNbeV0qYVsyXSlcbiAgICAgICAgKTtcbiAgICAgICAgdmFyIHhSb290cyA9IHhQb2x5LmdldFJvb3RzKCk7XG5cbiAgICAgICAgZm9yICggdmFyIHggPSAwOyB4IDwgeFJvb3RzLmxlbmd0aDsgeCsrICkge1xuICAgICAgICAgICAgdmFyIHRlc3QgPVxuICAgICAgICAgICAgICAgICggYVswXSp4Um9vdHNbeF0gKyBhWzFdKnlSb290c1t5XSArIGFbM10gKSAqIHhSb290c1t4XSArIFxuICAgICAgICAgICAgICAgICggYVsyXSp5Um9vdHNbeV0gKyBhWzRdICkg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V9iO1xuXG4gICAgICAgIGlmICggMCA8PSB1YSAmJiB1YSA8PSAxICYmIDAgPD0gdWIgJiYgdWIgPD0gMSApIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IG5ldyBJbnRlcnNlY3Rpb24oXCJJbnRlcnNlY3Rpb25cIik7XG4gICAgICAgICAgICByZXN1bHQucG9pbnRzLnB1c2goXG4gICAgICAgICAgICAgICAgbmV3IFBvaW50MkQoXG4gICAgICAgICAgICAgICAgICAgIGExLnggKyB1YSAqIChhMi54IC0gYTEueCksXG4gICAgICAgICAgICAgICAgICAgIGExLnkgKyB1YSAqIChhMi55IC0gYTEueSlcbiAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICApO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmVzdWx0ID0gbmV3IEludGVyc2VjdGlvbihcIk5vIEludGVyc2VjdGlvblwiKTtcbiAgICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAgIGlmICggdWFfdCA9PSAwIHx8IHViX3QgPT0gMCApIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IG5ldyBJbnRlcnNlY3Rpb24oXCJDb2luY2lkZW50XCIpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmVzdWx0ID0gbmV3IEludGVyc2VjdGlvbihcIlBhcmFsbGVsXCIpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIHJlc3VsdDtcbn07XG5cblxuLyoqKioqXG4qXG4qICAgaW50ZXJzZWN0TGluZVBvbHlnb25cbipcbioqKioqL1xuSW50ZXJzZWN0aW9uLmludGVyc2VjdExpbmVQb2x5Z29uID0gZnVuY3Rpb24oYTEsIGEyLCBwb2ludHMpIHtcbiAgICB2YXIgcmVzdWx0ID0gbmV3IEludGVyc2VjdGlvbihcIk5vIEludGVyc2VjdGlvblwiKTtcbiAgICB2YXIgbGVuZ3RoID0gcG9pbnRzLmxlbmd0aDtcblxuICAgIGZvciAoIHZhciBpID0gMD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9pbnRzKGludGVyMS5wb2ludHMpO1xuICAgIHJlc3VsdC5hcHBlbmRQb2ludHMoaW50ZXIyLnBvaW50cyk7XG4gICAgcmVzdWx0LmFwcGVuZFBvaW50cyhpbnRlcjMucG9pbnRzKTtcbiAgICByZXN1bHQuYXBwZW5kUG9pbnRzKGludGVyNC5wb2ludHMpO1xuXG4gICAgaWYgKCByZXN1bHQucG9pbnRzLmxlbmd0aCA+IDAgKVxuICAgICAgICByZXN1bHQuc3RhdHVzID0gXCJJbnRlcnNlY3Rpb25cIjtcblxuICAgIHJldHVybiByZXN1bHQ7XG59O1xuXG5cbi8qKioqKlxuKlxuKiAgIGludGVyc2VjdFJheVJheVxuKlxuKioqKiovXG5JbnRlcnNlY3Rpb24uaW50ZXJzZWN0UmF5UmF5ID0gZnVuY3Rpb24oYTEsIGEyLCBiMSwgYjIpIHtcbiAgICB2YXIgcmVzdWx0O1xuICAgIFxuICAgIHZhciB1YV90ID0gKGIyLnggLSBiMS54KSAqIChhMS55IC0gYjEueSkgLSAoYjIueSAtIGIxLnkpICogKGExLnggLSBiMS54KTtcbiAgICB2YXIgdWJfdCA9IChhMi54IC0gYTEueCkgKiAoYTEueSAtIGIxLnkpIC0gKGEyLnkgLSBhMS55KSAqIChhMS54IC0gYjEueCk7XG4gICAgdmFyIHVfYiAgPSAoYjIueSAtIGIxLnkpICogKGEyLnggLSBhMS54KSAtIChiMi54IC0gYjEueCkgKiAoYTIueSAtIGExLnkpO1xuXG4gICAgaWYgKCB1X2IgIT0gMCApIHtcbiAgICAgICAgdmFyIHVhID0gdWFfdCAvIHVfYjtcblxuICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiSW50ZXJzZWN0aW9uXCIpO1xuICAgICAgICByZXN1bHQucG9pbnRzLnB1c2goXG4gICAgICAgICAgICBuZXcgUG9pbnQyRChcbiAgICAgICAgICAgICAgICBhMS54ICsgdWEgKiAoYTIueCAtIGExLngpLFxuICAgICAgICAgICAgICAgIGEx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W50Q29kZXMuRFJBR0dJTkcpIHtcbiAgICAgICAgICAgICAgICAvLyB3ZSBhcmUgY3VycmVudGx5IGRyYWdnaW5nIHRoaW5ncyBhcm91bmRcbiAgICAgICAgICAgICAgICB2YXIgb3gsIG95LCBueCwgbnk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB0aGlzLmRyYWdFbGVtZW50LnggPT09ICd1bmRlZmluZWQnKSB7IC8vIGlmIG5vdCBhbiBNb2xlY3VsZVxuICAgICAgICAgICAgICAgICAgICB2YXIgbm9kZXMgPSB0aGlzLmRyYWdFbGVtZW50LmludGVyYWN0b3JzO1xuICAgICAgICAgICAgICAgICAgICB2YXIgbm9kZUNvdW50ID0gbm9kZXMubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG5vZGVDb3VudDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHJvdGVpbiA9IG5vZGVzW2ldO1xuICAgICAgICAgICAgICAgICAgICAgICAgb3ggPSBwcm90ZWluLng7XG4gICAgICAgICAgICAgICAgICAgICAgICBveSA9IHByb3RlaW4ueTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG54ID0gb3ggLSBkeDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG55ID0gb3kgLSBkeTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb3RlaW4uc2V0UG9zaXRpb24obngsIG55KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb3RlaW4uc2V0QWxsTGlua0Nvb3JkaW5hdGVzKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IG5vZGVDb3VudDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBub2Rlc1tpXS5zZXRBbGxMaW5rQ29vcmRpbmF0ZXMoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vaXRzIGEgcHJvdGVpbiAtIGRyYWcgaXQgVE9ETzogRFJBRyBTRUxFQ1RFRFxuICAgICAgICAgICAgICAgICAgICBveCA9IHRoaXMuZHJhZ0VsZW1lbnQueDtcbiAgICAgICAgICAgICAgICAgICAgb3kgPSB0aGlzLmRyYWdFbGVtZW50Lnk7XG4gICAgICAgICAgICAgICAgICAgIG54ID0gb3ggLSBkeDtcbiAgICAgICAgICAgICAgICAgICAgbnkgPSBveSAtIGR5O1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmRyYWdFbGVtZW50LnNldFBvc2l0aW9uKG54LCBueSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZHJhZ0VsZW1lbnQuc2V0QWxsTGlua0Nvb3JkaW5hdGVzKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMuZHJhZ1N0YXJ0ID0gYztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZWxzZSBpZiAodGhpcy5zdGF0ZSA9PT0gTW91c2VFdmVudENvZGVzLlJPVEFUSU5HKSB7XG4gICAgICAgICAgICAgICAgLy8gRGlzdGFuY2UgZnJvbSBtb3VzZSB4IGFuZCBjZW50ZXIgb2Ygc3RpY2suXG4gICAgICAgICAgICAgICAgdmFyIF9keCA9IGMueCAtIHRoaXMuZHJhZ0VsZW1lbnQueFxuICAgICAgICAgICAgICAgIC8vIERpc3RhbmNlIGZyb20gbW91c2UgeSBhbmQgY2VudGVyIG9mIHN0aWNrLlxuICAgICAgICAgICAgICAgIHZhciBfZHkgPSBjLnkgLSB0aGlzLmRyYWdFbGVtZW50Lnk7XG4gICAgICAgICAgICAgICAgLy9zZWUgaHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9BdGFuMiNNb3RpdmF0aW9uXG4gICAgICAgICAgICAgICAgdmFyIGNlbnRyZVRvTW91c2VBbmdsZVJhZHMgPSBNYXRoLmF0YW4yK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MCAqIDAuNzsgLy8gc2VlIFJvdGF0b3IuanNcblBvbHltZXIubWluWERpc3QgPSAzMDtcblBvbHltZXIucHJvdG90eXBlLnN3aXRjaFN0aWNrU2NhbGUgPSBmdW5jdGlvbihzdmdQKSB7XG4gICAgaWYgKHRoaXMuaXNQYXJrZWQpIHtcbiAgICAgICAgdGhpcy50b2dnbGVQYXJrZWQoKTtcbiAgICB9XG4gICAgaWYgKHRoaXMuZm9ybSA9PT0gMCkge1xuICAgICAgICB0aGlzLnRvU3RpY2soKTtcbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICAgIHZhciBwaXhQZXJSZXMgPSBQb2x5bWVyLlVOSVRTX1BFUl9SRVNJRFVFICogdGhpcy5zdGlja1pvb207IC8vIC8gdGhpcy5jb250cm9sbGVyLno7XG4gICAgICAgIGlmIChwaXhQZXJSZXMgPiA4KSB7XG4gICAgICAgICAgICB0aGlzLnN0aWNrWm9vbSA9IDAuNTsvL3RoaXMgbG9va3MgbGlrZSBhIGhhY2tcbiAgICAgICAgICAgIHRoaXMuc2V0UG9zaXRpb24oc3ZnUC54LCBzdmdQLnkpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5zdGlja1pvb20gPSB0aGlzLnN0aWNrWm9vbSAqIDM7XG4gICAgICAgICAgICAvL21vdmUgc3RpY2sgc28gc2FtZSByZXNpZHVlIGlzIHVuZGVyIG1vdXNlXG4gICAgICAgICAgICB2YXIgZHggPSB0aGlzLnggLSAoc3ZnUC54KTtcbiAgICAgICAgICAgIHZhciBkeSA9IHRoaXMueSAtIChzdmdQLnkpO1xuICAgICAgICAgICAgaWYgKHRoaXMucm90YXRpb24gPT09IDAgfHwgdGhpcy5yb3RhdGlvbiA9PT0gMTgwKSB7XG4gICAgICAgICAgICAgICAgZHkgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gICAgICAgICAgICBjb25zb2xlLmxvZyhkeCArICcsJyArIGR5KTtcbi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2Utd2lkdGhcIiwgXCIxMFwiKTtcclxuICAgICAgICB0aGlzLmhpZ2hsaWdodEdseXBoLnNldEF0dHJpYnV0ZShcInN0cm9rZS1vcGFjaXR5XCIsIFwiMFwiKTtcclxuICAgICAgICBpZiAodHlwZW9mIHRoaXMuY29sb3VyICE9PSAndW5kZWZpbmVkJykge1xyXG4gICAgICAgICAgICB0aGlzLmdseXBoLnNldEF0dHJpYnV0ZShcImZpbGxcIiwgdGhpcy5jb2xvdXIudG9TdHJpbmcoKSk7XHJcbiAgICAgICAgfVxyXG5cclxuXHRcdC8vc2V0IHRoZSBldmVudHMgZm9yIGl0XHJcbiAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xyXG4gICAgICAgIHRoaXMudW5jZXJ0YWluR2x5cGgub25tb3VzZWRvd24gPSBmdW5jdGlvbihldnQpIHtcclxuICAgICAgICAgICAgc2VsZi5tb3VzZURvd24oZXZ0KTtcclxuICAgICAgICB9O1xyXG4gICAgICAgIHRoaXMudW5jZXJ0YWluR2x5cGgub25tb3VzZW92ZXIgPSBmdW5jdGlvbihldnQpIHtcclxuICAgICAgICAgICAgc2VsZi5tb3VzZU92ZXIoZXZ0KTtcclxuICAgICAgICB9O1xyXG4gICAgICAgIHRoaXMudW5jZXJ0YWluR2x5cGgub25tb3VzZW91dCA9IGZ1bmN0aW9uKGV2dCkge1xyXG4gICAgICAgICAgICBzZWxmLm1vdXNlT3V0KGV2dCk7XHJcbiAgICAgICAgfTtcclxuICAgICAgICB0aGlzLmdseXBoLm9ubW91c2Vkb3duID0gZnVuY3Rpb24oZXZ0KSB7XHJcbiAgICAgICAgICAgIHNlbGYubW91c2VEb3duKGV2dCk7XHJcbiAgICAgICAgfTtcclxuICAgICAgICB0aGlzLmdseXBoLm9ubW91c2VvdmVyID0gZnVuY3Rpb24oZXZ0KSB7XHJcbiAgICAgICAgICAgIHNlbGYubW91c2VPdmVyKGV2dCk7XHJcbiAgICAgICAgfTtcclxuICAgICAgICB0aGlzLmdseX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29vcmRpbmF0ZXMoc3RhcnRSZXMsIHlPZmZzZXQpO1xyXG4gICAgICAgICAgICAgICAgZW5kUG9pbnQgPSBpbnRlcmFjdG9yLmdldFJlc2lkdWVDb29yZGluYXRlcyhlbmRSZXMsIHlPZmZzZXQpO1xyXG5cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICByZXR1cm4gJyBRJyArIGNvbnRyb2xQb2ludFswXSArICcsJyArIGNvbnRyb2xQb2ludFsxXSArICcgJyArIHN0YXJ0UG9pbnRbMF0gKyAnLCcgKyBzdGFydFBvaW50WzFdICtcclxuICAgICAgICAgICAgICAgICAgICAnIEwnICsgZW5kUG9pbnRbMF0gKyAnLCcgKyBlbmRQb2ludFsxXSArXHJcbiAgICAgICAgICAgICAgICAgICAgJyBRJyArIGNvbnRyb2xQb2ludFswXSArICcsJyArIGNvbnRyb2xQb2ludFsxXSArICcgJyArIG1pZFBvaW50WzBdICsgJywnICsgbWlkUG9pbnRbMV07XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBmdW5jdGlvbiBzZXF1ZW5jZURhdGFNaWRQb2ludChzZXF1ZW5jZURhdGEsIGludGVyYWN0b3IpIHtcclxuXHRcdC8vZ2V0IHRoZSBzbWFsbGVzdCBzdGFydCBhbmQgdGhlIGJpZ2dlc3QgZW5kXHJcbiAgICAgICAgICAgIHZhciBsb3dlc3RMaW5rZWRSZXMgPSBudWxsLCBoaWdoZXN0TGlua2VkUmVzID0gbnVsbDtcclxuICAgICAgICAgICAgdmFyIHNkQ291bnQgPSBzZXF1ZW5jZURhdGEubGVuZ3RoO1xyXG4gICAgICAgICAgICBmb3IgKHZhciBzID0gMDsgcyA8IHNkQ291bnQ7IHMrKykge1xyXG4gICAgICAgICAgICAgICAgdmFyIHNlcURhdHVtID0gc2VxdWVuY2VEYXRhW3NdO1xyXG4gICAgICAgICAgICAgICAgaWYgKCFpc05hTihwYXJzZUZsb2F0KHNlcURhdHVtLnN0YXJ0KSkgJiYgaXNGaW5pdGUoc2VxRGF0dW0uc3RhcnQpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdmFyIHN0YXJ0ID0gc2VxRGF0dW0uc3RhcnQgKiAxO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChsb3dlc3RMaW5rZWRSZXMgPT09IG51bGwgfHwgc3RhcnQgPCBsb3dlc3RMaW5rZWRSZXMpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbG93ZXN0TGlua2VkUmVzID0gc3RhcnQ7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKCFpc05hTihwYXJzZUZsb2F0KHNlcURhdHVtLnVuY2VydGFpblN0YXJ0KSkgJiYgaXNGaW5pdGUoc2VxRGF0dW0udW5jZXJ0YWluU3RhcnQpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdmFyIHVuY2VydGFpblN0YXJ0ID0gc2VxRGF0dW0udW5jZXJ0YWluU3RhcnQgKiAxO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChsb3dlc3RMaW5rZWRSZXMgPT09IG51bGwgfHwgdW5jZXJ0YWluU3RhcnQgPCBsb3dlc3RMaW5rZWRSZXMpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbG93ZXN0TGlua2VkUmVzID0gdW5jZXJ0YWluU3RhcnQ7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKCFpc05hTihwYXJzZUZsb2F0KHNlcURhdHVtLmVuZCkpICYmIGlzRmluaXRlKHNlcURhdHVtLmVuZCkpIHtcclxuICAgICAgICAgICAgICAgICAgICB2YXIgZW5kID0gc2VxRGF0dW0uZW5kICogMTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoaGlnaGVzdExpbmtlZFJlcyA9PT0gbnVsbCB8fCBlbmQgPiBoaWdoZXN0TGlua2VkUmVzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGhpZ2hlc3RMaW5rZWRSZXMgPSBlbmQ7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKCFpc05hTihwYXJzZUZsb2F0KHNlcURhdHVtLnVuY2VydGFpbkVuZCkpICYmIGlzRmluaXRlKHNlcURhdHVtLnVuY2VydGFpbkVuZCkpIHtcclxuICAgICAgICAgICAgICAgICAgICB2YXIgdW5jZXJ0YWluRW5kID0gc2VxRGF0dW0udW5jZXJ0YWluRW5kICogMTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoaGlnaGVzdExpbmtlZFJlcyA9PT0gbnVsbCB8fCB1bmNlcnRhaW5FbmQgPiBoaWdoZXN0TGlua2VkUmVzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGhpZ2hlc3RMaW5rZWRSZXMgPSB1bmNlcnRhaW5FbmQ7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHJldHVybiBpbnRlcmFjdG9yLmdldFJlc2lkdWVDb29yZGluYXRlcygobG93ZXN0TGlua2VkUmVzICsgaGlnaGVzdExpbmtlZFJlcykgLyAyLCAwKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgdmFyIGZyb21Nb2xlY3VsZSA9IHRoaXMuZnJvbVNlcXVlbmNlRGF0YVswXS5ub2RlO1xyXG4gICAgICAgIHZhciB0b01vbGVjdWxlID0gdGhpcy50b1NlcXVlbmNlRGF0YVswXS5ub2RlO1xyXG4gICAgICAgIC8vY2FsY3VsYXRlIG1pZCBwb2ludHMgb2YgZnJvbSBhbmQgdG8gc2VxdWVuY2UgZGF0YVxyXG4gICAgICAgIHZhciBmTWlkLCB0TWlkO1xyXG4gICAgICAgIGlmIChmcm9tTW9sZWN1bGUuZm9ybSA9PT0gMCkge1xyXG4g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xuXHJcblx0XHQvL291dCBpcyB2YWx1ZSB3ZSB1c2UgdG8gZGVjaWRlIHdoaWNoIHNpZGUgb2YgYmFyIHRoZSBsaW5rIGdseXBoIGlzIGRyYXduXHJcblx0XHQvL2ZpcnN0IGZvciAnZnJvbScgaW50ZXJhY3RvclxyXG4gICAgICAgIHZhciBvdXQgPSAoYWJtcERlZyAtIGZyb21Nb2xlY3VsZS5yb3RhdGlvbik7XHJcbiAgICAgICAgaWYgKG91dCA8IDApIHtcclxuICAgICAgICAgICAgb3V0ICs9IDM2MDtcclxuICAgICAgICB9XHJcbiAgICAgICAgdmFyIGZ5T2Zmc2V0ID0gMTA7XHJcbiAgICAgICAgaWYgKG91dCA8IDE4MCkge1xyXG4gICAgICAgICAgICBmeU9mZnNldCA9IC0xMDtcclxuICAgICAgICB9XHJcbiAgICAgICAgdmFyIGZSb3RSYWQgPSAoZnJvbU1vbGVjdWxlLnJvdGF0aW9uIC8gMzYwKSAqIE1hdGguUEkgKiAyO1xyXG4gICAgICAgIGlmIChvdXQgPiAxODApIHtcclxuICAgICAgICAgICAgZlJvdFJhZCA9IGZSb3RSYWQgLSBNYXRoLlBJO1xyXG4gICAgICAgIH1cclxuXHRcdC8vbm93IGZvciAndG8nIGludGVyYWN0b3JcclxuICAgICAgICBvdXQgPSAoYWJtcERlZyAtIHRvTW9sZWN1bGUucm90YXRpb24pO1xyXG4gICAgICAgIGlmIChvdXQgPCAwKSB7XHJcbiAgICAgICAgICAgIG91dCArPSAzNjA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHZhciB0eU9mZnNldCA9IDEwO1xyXG4gICAgICAgIGlmIChvdXQgPiAxODApIHtcclxuICAgICAgICAgICAgdHlPZmZzZXQgPSAtMTA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHZhciB0Um90UmFkID0gKHRvTW9sZWN1bGUucm90YXRpb24gLyAzNjApICogTWF0aC5QSSAqIDI7XHJcbiAgICAgICAgaWYgKG91dCA8IDE4MCkge1xyXG4gICAgICAgICAgICB0Um90UmFkID0gdFJvdFJhZCAtIE1hdGguUEk7XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICB2YXIgZnRNaWQgPSBbZk1pZFswXSArICgzMCAqIE1hdGguc2luKGZSb3RSYWQpICogdGhpcy5jb250cm9sbGVyLnopLFxyXG4gICAgICAgICAgICBmTWlkWzFdIC0gKDMwICogTWF0aC5jb3MoZlJvdFJhZCkgKiB0aGlzLmNvbnRyb2xsZXIueildO1xyXG4gICAgICAgIGlmIChmcm9tTW9sZWN1bGUuZm9ybSA9PT0gMCkge1xyXG4gICAgICAgICAgICBmdE1pZCA9IGZNaWQ7XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICB2YXIgdHRNaWQgPSBbdE1pZFswXSArICgzMCAqIE1hdGguc2luKHRSb3RSYWQpICogdGhpcy5jb250cm9sbGVyLnopLFxyXG4gICAgICAgICAgICB0TWlkWzFdIC0gKDMwICogTWF0aC5jb3ModFJvdFJhZCkgKiB0aGlzLmNvbnRyb2xsZXIueildO1xyXG4gICAgICAgIGlmICh0b01vbGVjdWxlLmZvcm0gPT09IDApIHtcclxuICAgICAgICAgICAgdHRNaWQgPSB0TWlkO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgdmFyIHRyaVBvaW50TWlkID0gWyhmdE1pZFswXSArIHR0TWlkWzBdKSAvIDIsIChmdE1pZFsxXSArIHR0TWlkWzFdKSAvIDJdO1xyXG4gICAgICAgIHZhciBmU0RDb3VudCA9IHRoaXMuZnJvbVNlcXVlbmNlRGF0YS5sZW5ndGg7XHJcbiAgICAgICAgdmFyIHRTRENvdW50ID0gdGhpcy50b1NlcXVlbmNlRGF0YS5sZW5ndGg7XHJcbiAgICAgICAgdmFyIHNlcURhdHVtLCBoaWdobGlnaHRTdGFydFJlcywgaGlnaGxpZ2h0RW5kUmVzO1xyXG4gICAgICAgIHZhciBnbHlwaFBhdGggPSAnTScgKyB0cmlQb2ludE1pZFswXSArICcsJyArIHRy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gJ3VuZGVmaW5lZCcpIHtcclxuXHRcdHRoaXMudGhpY2tMaW5lLnNldEF0dHJpYnV0ZShcInRyYW5zZm9ybVwiLCBcInRyYW5zbGF0ZShcIiArIGludGVyYWN0b3IueFxyXG5cdFx0XHRcdCsgXCIgXCIgKyBpbnRlcmFjdG9yLnkgKyBcIilcIiArIFwiIHNjYWxlKFwiICsgKHRoaXMuY29udHJvbGxlci56KSArIFwiKVwiKTtcclxuXHR9XHJcblx0dGhpcy5saW5lLnNldEF0dHJpYnV0ZShcInRyYW5zZm9ybVwiLCBcInRyYW5zbGF0ZShcIiArIGludGVyYWN0b3IueFxyXG5cdFx0XHQrIFwiIFwiICsgaW50ZXJhY3Rvci55ICsgXCIpXCIgKyBcIiBzY2FsZShcIiArICh0aGlzLmNvbnRyb2xsZXIueikgKyBcIilcIik7XHJcblx0dGhpcy5oaWdobGlnaHRMaW5lLnNldEF0dHJpYnV0ZShcInRyYW5zZm9ybVwiLCBcInRyYW5zbGF0ZShcIiArIGludGVyYWN0b3IueFxyXG5cdFx0XHQrIFwiIFwiICsgaW50ZXJhY3Rvci55ICsgXCIpXCIgKyBcIiBzY2FsZShcIiArICh0aGlzLmNvbnRyb2xsZXIueikgKyBcIilcIik7XHJcbn07XHJcblxyXG5tb2R1bGUuZXhwb3J0cyA9IFVuYXJ5TGluaztcclxuIl19 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9ncnVudC1icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJib3dlcl9jb21wb25lbnRzL2NvbG9yYnJld2VyL2NvbG9yYnJld2VyLmpzIiwiYm93ZXJfY29tcG9uZW50cy9kMy9kMy5qcyIsIm5vZGVfbW9kdWxlcy9pbnRlcnNlY3Rpb25qcy9pbnRlcnNlY3Rpb24uan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ICAgICBleGl0Tm9kZXNbaV0gPSBub2RlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgbm9kZUJ5S2V5VmFsdWUuc2V0KGtleVZhbHVlLCBub2RlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGtleVZhbHVlc1tpXSA9IGtleVZhbHVlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBmb3IgKGkgPSAtMTsgKytpIDwgbTsgKSB7XG4gICAgICAgICAgaWYgKCEobm9kZSA9IG5vZGVCeUtleVZhbHVlLmdldChrZXlWYWx1ZSA9IGtleS5jYWxsKGdyb3VwRGF0YSwgbm9kZURhdGEgPSBncm91cERhdGFbaV0sIGkpKSkpIHtcbiAgICAgICAgICAgIGVudGVyTm9kZXNbaV0gPSBkM19zZWxlY3Rpb25fZGF0YU5vZGUobm9kZURhdGEpO1xuICAgICAgICAgIH0gZWxzZSBpZiAobm9kZSAhPT0gdHJ1ZSkge1xuICAgICAgICAgICAgdXBkYXRlTm9kZXNbaV0gPSBub2RlO1xuICAgICAgICAgICAgbm9kZS5fX2RhdGFfXyA9IG5vZGVEYXRhO1xuICAgICAgICAgIH1cbiAgICAgICAgICBub2RlQnlLZXlWYWx1ZS5zZXQoa2V5VmFsdWUsIHRydWUpO1xuICAgICAgICB9XG4gICAgICAgIGZvciAoaSA9IC0xOyArK2kgPCBuOyApIHtcbiAgICAgICAgICBpZiAoaSBpbiBrZXlWYWx1ZXMgJiYgbm9kZUJ5S2V5VmFsdWUuZ2V0KGtleVZhbHVlc1tpXSkgIT09IHRydWUpIHtcbiAgICAgICAgICAgIGV4aXROb2Rlc1tpXSA9IGdyb3VwW2ldO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgZm9yIChpID0gLTE7ICsraSA8IG4wOyApIHtcbiAgICAgICAgICBub2RlID0gZ3JvdXBbaV07XG4gICAgICAgICAgbm9kZURhdGEgPSBncm91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zLCBhcmd1bWVudHMpLCB2aWV3MSA9IHZpZXc7XG4gICAgICAgIGlmIChkM190cmFuc2l0aW9uSW5oZXJpdElkKSB7XG4gICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLnRyYW5zaXRpb24oKS5lYWNoKFwic3RhcnQuem9vbVwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHZpZXcgPSB0aGlzLl9fY2hhcnRfXyB8fCB7XG4gICAgICAgICAgICAgIHg6IDAsXG4gICAgICAgICAgICAgIHk6IDAsXG4gICAgICAgICAgICAgIGs6IDFcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICB6b29tc3RhcnRlZChkaXNwYXRjaCk7XG4gICAgICAgICAgfSkudHdlZW4oXCJ6b29tOnpvb21cIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgZHggPSBzaXplWzBdLCBkeSA9IHNpemVbMV0sIGN4ID0gY2VudGVyMCA/IGNlbnRlcjBbMF0gOiBkeCAvIDIsIGN5ID0gY2VudGVyMCA/IGNlbnRlcjBbMV0gOiBkeSAvIDIsIGkgPSBkMy5pbnRlcnBvbGF0ZVpvb20oWyAoY3ggLSB2aWV3LngpIC8gdmlldy5rLCAoY3kgLSB2aWV3LnkpIC8gdmlldy5rLCBkeCAvIHZpZXcuayBdLCBbIChjeCAtIHZpZXcxLngpIC8gdmlldzEuaywgKGN5IC0gdmlldzEueSkgLyB2aWV3MS5rLCBkeCAvIHZpZXcxLmsgXSk7XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24odCkge1xuICAgICAgICAgICAgICB2YXIgbCA9IGkodCksIGsgPSBkeCAvIGxbMl07XG4gICAgICAgICAgICAgIHRoaXMuX19jaGFydF9fID0gdmlldyA9IHtcbiAgICAgICAgICAgICAgICB4OiBjeCAtIGxbMF0gKiBrLFxuICAgICAgICAgICAgICAgIHk6IGN5IC0gbFsxXSAqIGssXG4gICAgICAgICAgICAgICAgazoga1xuICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICB6b29tZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9KS5lYWNoKFwiaW50ZXJydXB0Lnpvb21cIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB6b29tZW5kZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIH0pLmVhY2goXCJlbmQuem9vbVwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHpvb21lbmRlZChkaXNwYXRjaCk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdGhpcy5fX2NoYXJ0X18gPSB2aWV3O1xuICAgICAgICAgIHpvb21zdGFydGVkKGRpc3BhdGNoKTtcbiAgICAgICAgICB6b29tZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIHpvb21lbmRlZChkaXNwYXRjaCk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuICAgIH07XG4gICAgem9vbS50cmFuc2xhdGUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBbIHZpZXcueCwgdmlldy55IF07XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiArX1swXSxcbiAgICAgICAgeTogK19bMV0sXG4gICAgICAgIGs6IHZpZXcua1xuICAgICAgfTtcbiAgICAgIHJlc2NhbGUoKTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS5zY2FsZSA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHZpZXcuaztcbiAgICAgIHZpZXcgPSB7XG4gICAgICAgIHg6IHZpZXcueCxcbiAgICAgICAgeTogdmlldy55LFxuICAgICAgICBrOiBudWxsXG4gICAgICB9O1xuICAgICAgc2NhbGVUbygrXyk7XG4gICAgICByZXNjYWxlKCk7XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uc2NhbGVFeHRlbnQgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzY2FsZUV4dGVudDtcbiAgICAgIHNjYWxlRXh0ZW50ID0gXyA9PSBudWxsID8gZDNfYmVoYXZpb3Jfem9vbUluZmluaXR5IDogWyArX1swXSwgK19bMV0gXTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS5jZW50ZXIgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjZW50ZXI7XG4gICAgICBjZW50ZXIgPSBfICYmIFsgK19bMF0sICtfWzFdIF07XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uc2l6ZSA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNpemU7XG4gICAgICBzaXplID0gXyAmJiBbICtfWzBdLCArX1sxXSBdO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLmR1cmF0aW9uID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZHVyYXRpb247XG4gICAgICBkdXJhdGlvbiA9ICtfO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnggPSBmdW5jdGlvbih6KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB4MTtcbiAgICAgIHgxID0gejtcbiAgICAgIHgwID0gei5jb3B5KCk7XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiAwLFxuICAgICAgICB5OiAwLFxuICAgICAgICBrOiAxXG4gICAgICB9O1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnkgPSBmdW5jdGlvbih6KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5MTtcbiAgICAgIHkxID0gejtcbiAgICAgIHkwID0gei5jb3B5KCk7XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiAwLFxuICAgICAgICB5OiAwLFxuICAgICAgICBrOiAxXG4gICAgICB9O1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICBmdW5jdGlvbiBsb2NhdGlvbihwKSB7XG4gICAgICByZXR1cm4gWyAocFswXSAtIHZpZXcueCkgLyB2aWV3LmssIChwWzFdIC0gdmlldy55KSAvIHZpZXcuayBdO1xuICAgIH1cbiAgICBmdW5jdGlvbiBwb2ludChsKSB7XG4gICAgICByZXR1cm4gWyBsWzBdICogdmlldy5rICsgdmlldy54LCBsWzFdICogdmlldy5rICsgdmlldy55IF07XG4gICAgfVxuICAgIGZ1bmN0aW9uIHNjYWxlVG8ocykge1xuICAgICAgdmlldy5rID0gTWF0aC5tYXgoc2NhbGVFeHRlbnRbMF0sIE1hdGgubWluKHNjYWxlRXh0ZW50WzFdLCBzKSk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHRyYW5zbGF0ZVRvKHAsIGwpIHtcbiAgICAgIGwgPSBwb2ludChsKTtcbiAgICAgIHZpZXcueCArPSBwWzBdIC0gbFswXTtcbiAgICAgIHZpZXcueSArPSBwWzFdIC0gbFsxXTtcbiAgICB9XG4gICAgZnVuY3Rpb24gem9vbVRvKHRoYXQsIHAsIGwsIGspIHtcbiAgICAgIHRoYXQuX19jaGFydF9fID0ge1xuICAgICAgICB4OiB2aWV3LngsXG4gICAgICAgIHk6IHZpZXcueSxcbiAgICAgICAgazogdmlldy5rXG4gICAgICB9O1xuICAgICAgc2NhbGVUbyhNYXRoLnBvdygyLCBrKSk7XG4gICAgICB0cmFuc2xhdGVUbyhjZW50ZXIwID0gcCwgbCk7XG4gICAgICB0aGF0ID0gZDMuc2VsZWN0KHRoYXQpO1xuICAgICAgaWYgKGR1cmF0aW9uID4gMCkgdGhh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9XG4gICAgaWYgKGZvcm1hdCAhPSBudWxsICYmIGZvcm1hdC5jaGFyQXQoMCkgPT09IFwiI1wiICYmICFpc05hTihjb2xvciA9IHBhcnNlSW50KGZvcm1hdC5zbGljZSgxKSwgMTYpKSkge1xuICAgICAgaWYgKGZvcm1hdC5sZW5ndGggPT09IDQpIHtcbiAgICAgICAgciA9IChjb2xvciAmIDM4NDApID4+IDQ7XG4gICAgICAgIHIgPSByID4+IDQgfCByO1xuICAgICAgICBnID0gY29sb3IgJiAyNDA7XG4gICAgICAgIGcgPSBnID4+IDQgfCBnO1xuICAgICAgICBiID0gY29sb3IgJiAxNTtcbiAgICAgICAgYiA9IGIgPDwgNCB8IGI7XG4gICAgICB9IGVsc2UgaWYgKGZvcm1hdC5sZW5ndGggPT09IDcpIHtcbiAgICAgICAgciA9IChjb2xvciAmIDE2NzExNjgwKSA+PiAxNjtcbiAgICAgICAgZyA9IChjb2xvciAmIDY1MjgwKSA+PiA4O1xuICAgICAgICBiID0gY29sb3IgJiAyNTU7XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiByZ2IociwgZywgYik7XG4gIH1cbiAgZnVuY3Rpb24gZDNfcmdiX2hzbChyLCBnLCBiKSB7XG4gICAgdmFyIG1pbiA9IE1hdGgubWluKHIgLz0gMjU1LCBnIC89IDI1NSwgYiAvPSAyNTUpLCBtYXggPSBNYXRoLm1heChyLCBnLCBiKSwgZCA9IG1heCAtIG1pbiwgaCwgcywgbCA9IChtYXggKyBtaW4pIC8gMjtcbiAgICBpZiAoZCkge1xuICAgICAgcyA9IGwgPCAuNSA/IGQgLyAobWF4ICsgbWluKSA6IGQgLyAoMiAtIG1heCAtIG1pbik7XG4gICAgICBpZiAociA9PSBtYXgpIGggPSAoZyAtIGIpIC8gZCArIChnIDwgYiA/IDYgOiAwKTsgZWxzZSBpZiAoZyA9PSBtYXgpIGggPSAoYiAtIHIpIC8gZCArIDI7IGVsc2UgaCA9IChyIC0gZykgLyBkICsgNDtcbiAgICA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ICAgIGZ1bmN0aW9uIHRva2VuKCkge1xuICAgICAgICBpZiAoSSA+PSBOKSByZXR1cm4gRU9GO1xuICAgICAgICBpZiAoZW9sKSByZXR1cm4gZW9sID0gZmFsc2UsIEVPTDtcbiAgICAgICAgdmFyIGogPSBJO1xuICAgICAgICBpZiAodGV4dC5jaGFyQ29kZUF0KGopID09PSAzNCkge1xuICAgICAgICAgIHZhciBpID0gajtcbiAgICAgICAgICB3aGlsZSAoaSsrIDwgTikge1xuICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChpKSA9PT0gMzQpIHtcbiAgICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChpICsgMSkgIT09IDM0KSBicmVhaztcbiAgICAgICAgICAgICAgKytpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBJID0gaSArIDI7XG4gICAgICAgICAgdmFyIGMgPSB0ZXh0LmNoYXJDb2RlQXQoaSArIDEpO1xuICAgICAgICAgIGlmIChjID09PSAxMykge1xuICAgICAgICAgICAgZW9sID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmICh0ZXh0LmNoYXJDb2RlQXQoaSArIDIpID09PSAxMCkgKytJO1xuICAgICAgICAgIH0gZWxzZSBpZiAoYyA9PT0gMTApIHtcbiAgICAgICAgICAgIGVvbCA9IHRydWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiB0ZXh0LnNsaWNlKGogKyAxLCBpKS5yZXBsYWNlKC9cIlwiL2csICdcIicpO1xuICAgICAgICB9XG4gICAgICAgIHdoaWxlIChJIDwgTikge1xuICAgICAgICAgIHZhciBjID0gdGV4dC5jaGFyQ29kZUF0KEkrKyksIGsgPSAxO1xuICAgICAgICAgIGlmIChjID09PSAxMCkgZW9sID0gdHJ1ZTsgZWxzZSBpZiAoYyA9PT0gMTMpIHtcbiAgICAgICAgICAgIGVvbCA9IHRydWU7XG4gICAgICAgICAgICBpZiAodGV4dC5jaGFyQ29kZUF0KEkpID09PSAxMCkgKytJLCArK2s7XG4gICAgICAgICAgfSBlbHNlIGlmIChjICE9PSBkZWxpbWl0ZXJDb2RlKSBjb250aW51ZTtcbiAgICAgICAgICByZXR1cm4gdGV4dC5zbGljZShqLCBJIC0gayk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRleHQuc2xpY2Uoaik7XG4gICAgICB9XG4gICAgICB3aGlsZSAoKHQgPSB0b2tlbigpKSAhPT0gRU9GKSB7XG4gICAgICAgIHZhciBhID0gW107XG4gICAgICAgIHdoaWxlICh0ICE9PSBFT0wgJiYgdCAhPT0gRU9GKSB7XG4gICAgICAgICAgYS5wdXNoKHQpO1xuICAgICAgICAgIHQgPSB0b2tlbigpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChmICYmIChhID0gZihhLCBuKyspKSA9PSBudWxsKSBjb250aW51ZTtcbiAgICAgICAgcm93cy5wdXNoKGEpO1xuICAgICAgfVxuICAgICAgcmV0dXJuIHJvd3M7XG4gICAgfTtcbiAgICBkc3YuZm9ybWF0ID0gZnVuY3Rpb24ocm93cykge1xuICAgICAgaWYgKEFycmF5LmlzQXJyYXkocm93c1swXSkpIHJldHVybiBkc3YuZm9ybWF0Um93cyhyb3dzKTtcbiAgICAgIHZhciBmaWVsZFNldCA9IG5ldyBkM19TZXQoKSwgZmllbGRzID0gW107XG4gICAgICByb3dzLmZvckVhY2goZnVuY3Rpb24ocm93KSB7XG4gICAgICAgIGZvciAodmFyIGZpZWxkIGluIHJvdykge1xuICAgICAgICAgIGlmICghZmllbGRTZXQuaGFzKGZpZWxkKSkge1xuICAgICAgICAgICAgZmllbGRzLnB1c2goZmllbGRTZXQuYWRkKGZpZWxkKSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIHJldHVybiBbIGZpZWxkcy5tYXAoZm9ybWF0VmFsdWUpLmpvaW4oZGVsaW1pdGVyKSBdLmNvbmNhdChyb3dzLm1hcChmdW5jdGlvbihyb3cpIHt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A6IHApO1xuICAgICAgICAgICAgc3RyaW5nLnB1c2goYyk7XG4gICAgICAgICAgICBqID0gaSArIDE7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHN0cmluZy5wdXNoKHRlbXBsYXRlLnNsaWNlKGosIGkpKTtcbiAgICAgICAgcmV0dXJuIHN0cmluZy5qb2luKFwiXCIpO1xuICAgICAgfVxuICAgICAgZm9ybWF0LnBhcnNlID0gZnVuY3Rpb24oc3RyaW5nKSB7XG4gICAgICAgIHZhciBkID0ge1xuICAgICAgICAgIHk6IDE5MDAsXG4gICAgICAgICAgbTogMCxcbiAgICAgICAgICBkOiAxLFxuICAgICAgICAgIEg6IDAsXG4gICAgICAgICAgTTogMCxcbiAgICAgICAgICBTOiAwLFxuICAgICAgICAgIEw6IDAsXG4gICAgICAgICAgWjogbnVsbFxuICAgICAgICB9LCBpID0gZDNfdGltZV9wYXJzZShkLCB0ZW1wbGF0ZSwgc3RyaW5nLCAwKTtcbiAgICAgICAgaWYgKGkgIT0gc3RyaW5nLmxlbmd0aCkgcmV0dXJuIG51bGw7XG4gICAgICAgIGlmIChcInBcIiBpbiBkKSBkLkggPSBkLkggJSAxMiArIGQucCAqIDEyO1xuICAgICAgICB2YXIgbG9jYWxaID0gZC5aICE9IG51bGwgJiYgZDNfZGF0ZSAhPT0gZDNfZGF0ZV91dGMsIGRhdGUgPSBuZXcgKGxvY2FsWiA/IGQzX2RhdGVfdXRjIDogZDNfZGF0ZSkoKTtcbiAgICAgICAgaWYgKFwialwiIGluIGQpIGRhdGUuc2V0RnVsbFllYXIoZC55LCAwLCBkLmopOyBlbHNlIGlmIChcIldcIiBpbiBkIHx8IFwiVVwiIGluIGQpIHtcbiAgICAgICAgICBpZiAoIShcIndcIiBpbiBkKSkgZC53ID0gXCJXXCIgaW4gZCA/IDEgOiAwO1xuICAgICAgICAgIGRhdGUuc2V0RnVsbFllYXIoZC55LCAwLCAxKTtcbiAgICAgICAgICBkYXRlLnNldEZ1bGxZZ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nob3J0TW9udGhzW2QuZ2V0TW9udGgoKV07XG4gICAgICB9LFxuICAgICAgQjogZnVuY3Rpb24oZCkge1xuICAgICAgICByZXR1cm4gbG9jYWxlX21vbnRoc1tkLmdldE1vbnRoKCldO1xuICAgICAgfSxcbiAgICAgIGM6IGQzX3RpbWVfZm9ybWF0KGxvY2FsZV9kYXRlVGltZSksXG4gICAgICBkOiBmdW5jdGlvbihkLCBwKSB7XG4gICAgICAgIHJldHVybiBkM190aW1lX2Zvcm1hdFBhZChkLmdldERhdGUoKSwgcCwgMik7XG4gICAgICB9LFxuICAgICAgZTogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfdGltZV9mb3JtYXRQYWQoZC5nZXREYXRlKCksIHAsIDIpO1xuICAgICAgfSxcbiAgICAgIEg6IGZ1bmN0aW9uKGQsIHApIHtcbiAgICAgICAgcmV0dXJuIGQzX3RpbWVfZm9ybWF0UGFkKGQuZ2V0SG91cnMoKSwgcCwgMik7XG4gICAgICB9LFxuICAgICAgSTogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfdGltZV9mb3JtYXRQYWQoZC5nZXRIb3VycygpICUgMTIgfHwgMTIsIHAsIDIpO1xuICAgICAgfSxcbiAgICAgIGo6IGZ1bmN0aW9uKGQsIHApIHtcbiAgICAgICAgcmV0dXJuIGQzX3RpbWVfZm9ybWF0UGFkKDEgKyBkM190aW1lLmRheU9mWWVhcihkKSwgcCwgMyk7XG4gICAgICB9LFxuICAgICAgTDogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfdGltZV9mb3JtYXRQYWQoZC5nZXRNaWxsaXNlY29uZHMoKSwgcCwgMyk7XG4gICAgICB9LFxuICAgICAgbTogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfdGltZV9mb3JtYXRQYWQoZC5nZXRNb250aCgpICsgMSwgcCwgMik7XG4gICAgICB9LFxuICAgICAgTTogZnVuY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b3NzKGVxdWF0b3JpYWwsIG5vcm1hbCk7XG4gICAgICAgIGQzX2dlb19jYXJ0ZXNpYW5Ob3JtYWxpemUoaW5mbGVjdGlvbik7XG4gICAgICAgIGluZmxlY3Rpb24gPSBkM19nZW9fc3BoZXJpY2FsKGluZmxlY3Rpb24pO1xuICAgICAgICB2YXIgZM67ID0gzrsgLSDOu18sIHMgPSBkzrsgPiAwID8gMSA6IC0xLCDOu2kgPSBpbmZsZWN0aW9uWzBdICogZDNfZGVncmVlcyAqIHMsIGFudGltZXJpZGlhbiA9IGFicyhkzrspID4gMTgwO1xuICAgICAgICBpZiAoYW50aW1lcmlkaWFuIF4gKHMgKiDOu18gPCDOu2kgJiYgzrtpIDwgcyAqIM67KSkge1xuICAgICAgICAgIHZhciDPhmkgPSBpbmZsZWN0aW9uWzFdICogZDNfZGVncmVlcztcbiAgICAgICAgICBpZiAoz4ZpID4gz4YxKSDPhjEgPSDPhmk7XG4gICAgICAgIH0gZWxzZSBpZiAozrtpID0gKM67aSArIDM2MCkgJSAzNjAgLSAxODAsIGFudGltZXJpZGlhbiBeIChzICogzrtfIDwgzrtpICYmIM67aSA8IHMgKiDOuykpIHtcbiAgICAgICAgICB2YXIgz4ZpID0gLWluZmxlY3Rpb25bMV0gKiBkM19kZWdyZWVzO1xuICAgICAgICAgIGlmICjPhmkgPCDPhjApIM+GMCA9IM+GaTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoz4YgPCDPhjApIM+GMCA9IM+GO1xuICAgICAgICAgIGlmICjPhiA+IM+GMSkgz4YxID0gz4Y7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFudGltZXJpZGlhbikge1xuICAgICAgICAgIGlmICjOuyA8IM67Xykge1xuICAgICAgICAgICAgaWYgKGFuZ2xlKM67MCwgzrspID4gYW5nbGUozrswLCDOuzEpKSDOuzEgPSDOuztcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKGFuZ2xlKM67LCDOuzEpID4gYW5nbGUozrswLCDOuzEpKSDOuzAgPSDOuztcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKM67MSA+PSDOuzApIHtcbiAgICAgICAgICAgIGlmICjOuyA8IM67MCkgzrswID0gzrs7XG4gICAgICAgICAgICBpZiAozrsgPiDOuzEpIM67MSA9IM67O1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAozrsgPiDOu18pIHtcbiAgICAgICAgICAgICAgaWYgKGFuZ2xlKM67MCwgzrspID4gYW5nbGUozrswLCDOuzEpKSDOuzEgPSDOuztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGlmIChhbmdsZSjOuywgzrsxKSA+IGFuZ2xlKM67MCwgzrsxKSkgzrswID0gzrs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBwb2ludCjOuywgz4YpO1xuICAgICAgfVxuICAgICAgcDAgPSBwLCDOu18gPSDOuztcbiAgICB9XG4gICAgZnVuY3Rpb24gbGluZVN0YXJ0KCkge1xuICAgICAgYm91bmQucG9pbnQgPSBsaW5lUG9pbnQ7XG4gICAgfVxuICAgIGZ1bmN0aW9uIGxpbmVFbmQoKSB7XG4gICAgICByYW5nZVswXSA9IM67MCwgcmFuZ2VbMV0gPSDOuzE7XG4gICAgICBib3VuZC5wb2ludCA9IHBvaW50O1xuICAgICAgcDAgPSBudWxsO1xuICAgIH1cbiAgICBmdW5jdGlvbiByaW5nUG9pbnQozrssIM+GKSB7XG4gICAgICBpZiAocDApIHtcbiAgICAgICAgdmFyIGTOuyA9IM67IC0gzrtfO1xuICAgICAgICBkzrtTdW0gKz0gYWJzKGTOuykgPiAxODAgPyBkzrsgKyAoZM67ID4gMCA/IDM2MCA6IC0zNjApIDogZM67O1xuICAgICAgfSBlbHNlIM67X18gPSDOuywgz4ZfXyA9IM+GO1xuICAgIC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nQgPSBjdXJyZW50Lm4pID09PSBzdGFydCkgcmV0dXJuO1xuICAgICAgcG9pbnRzID0gY3VycmVudC56O1xuICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICBkbyB7XG4gICAgICAgIGN1cnJlbnQudiA9IGN1cnJlbnQuby52ID0gdHJ1ZTtcbiAgICAgICAgaWYgKGN1cnJlbnQuZSkge1xuICAgICAgICAgIGlmIChpc1N1YmplY3QpIHtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwLCBuID0gcG9pbnRzLmxlbmd0aDsgaSA8IG47ICsraSkgbGlzdGVuZXIucG9pbnQoKHBvaW50ID0gcG9pbnRzW2ldKVswXSwgcG9pbnRbMV0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpbnRlcnBvbGF0ZShjdXJyZW50LngsIGN1cnJlbnQubi54LCAxLCBsaXN0ZW5lcik7XG4gICAgICAgICAgfVxuICAgICAgICAgIGN1cnJlbnQgPSBjdXJyZW50Lm47XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKGlzU3ViamVjdCkge1xuICAgICAgICAgICAgcG9pbnRzID0gY3VycmVudC5wLno7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gcG9pbnRzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSBsaXN0ZW5lci5wb2ludCgocG9pbnQgPSBwb2ludHNbaV0pWzBdLCBwb2ludFsxXSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGludGVycG9sYXRlKGN1cnJlbnQueCwgY3VycmVudC5wLngsIC0xLCBsaXN0ZW5lcik7XG4gICAgICAgICAgfVxuICAgICAgICAgIGN1cnJlbnQgPSBjdXJyZW50LnA7XG4gICAgICAgIH1cbiAgICAgICAgY3VycmVudCA9IGN1cnJlbnQubztcbiAgICAgICAgcG9pbnRzID0gY3VycmVudC56O1xuICAgICAgICBpc1N1YmplY3QgPSAhaXNTdWJqZWN0O1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ZTtcbiAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgaW50ZXJwb2xhdGUobnVsbCwgbnVsbCwgMSwgbGlzdGVuZXIpO1xuICAgICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAocG9seWdvblN0YXJ0ZWQpIGxpc3RlbmVyLnBvbHlnb25FbmQoKSwgcG9seWdvblN0YXJ0ZWQgPSBmYWxzZTtcbiAgICAgICAgICBzZWdtZW50cyA9IHBvbHlnb24gPSBudWxsO1xuICAgICAgICB9LFxuICAgICAgICBzcGhlcmU6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGxpc3RlbmVyLnBvbHlnb25TdGFydCgpO1xuICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgIGludGVycG9sYXRlKG51bGwsIG51bGwsIDEsIGxpc3RlbmVyKTtcbiAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9seWdvbkVuZCgpO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgICAgZnVuY3Rpb24gcG9pbnQozrssIM+GKSB7XG4gICAgICAgIHZhciBwb2ludCA9IHJvdGF0ZSjOuywgz4YpO1xuICAgICAgICBpZiAocG9pbnRWaXNpYmxlKM67ID0gcG9pbnRbMF0sIM+GID0gcG9pbnRbMV0pKSBsaXN0ZW5lci5wb2ludCjOuywgz4YpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gcG9pbnRMaW5lKM67LCDPhikge1xuICAgICAgICB2YXIgcG9pbnQgPSByb3RhdGUozrssIM+GKTtcbiAgICAgICAgbGluZS5wb2ludChwb2ludFswXSwgcG9pbnRbMV0pO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gbGluZVN0YXJ0KCkge1xuICAgICAgICBjbGlwLnBvaW50ID0gcG9pbnRMaW5lO1xuICAgICAgICBsa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N0YXJ0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgIGNsZWFuID0gMTtcbiAgICAgIH0sXG4gICAgICBwb2ludDogZnVuY3Rpb24ozrsxLCDPhjEpIHtcbiAgICAgICAgdmFyIHPOuzEgPSDOuzEgPiAwID8gz4AgOiAtz4AsIGTOuyA9IGFicyjOuzEgLSDOuzApO1xuICAgICAgICBpZiAoYWJzKGTOuyAtIM+AKSA8IM61KSB7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQozrswLCDPhjAgPSAoz4YwICsgz4YxKSAvIDIgPiAwID8gaGFsZs+AIDogLWhhbGbPgCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQoc867MCwgz4YwKTtcbiAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQoc867MSwgz4YwKTtcbiAgICAgICAgICBsaXN0ZW5lci5wb2ludCjOuzEsIM+GMCk7XG4gICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICB9IGVsc2UgaWYgKHPOuzAgIT09IHPOuzEgJiYgZM67ID49IM+AKSB7XG4gICAgICAgICAgaWYgKGFicyjOuzAgLSBzzrswKSA8IM61KSDOuzAgLT0gc867MCAqIM61O1xuICAgICAgICAgIGlmIChhYnMozrsxIC0gc867MSkgPCDOtSkgzrsxIC09IHPOuzEgKiDOtTtcbiAgICAgICAgICDPhjAgPSBkM19nZW9fY2xpcEFudGltZXJpZGlhbkludGVyc2VjdCjOuzAsIM+GMCwgzrsxLCDPhjEpO1xuICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHPOuzAsIM+GMCk7XG4gICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgIGxpc3RlbmVyLnBva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B2ID0gdmlzaWJsZShwb2ludDFbMF0sIHBvaW50MVsxXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICh2ICE9PSB2MCkge1xuICAgICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICAgICAgaWYgKHYpIHtcbiAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDEsIHBvaW50MCk7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHBvaW50MlswXSwgcG9pbnQyWzFdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDAsIHBvaW50MSk7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHBvaW50MlswXSwgcG9pbnQyWzFdKTtcbiAgICAgICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcG9pbnQwID0gcG9pbnQyO1xuICAgICAgICAgIH0gZWxzZSBpZiAobm90SGVtaXNwaGVyZSAmJiBwb2ludDAgJiYgc21hbGxSYWRpdXMgXiB2KSB7XG4gICAgICAgICAgICB2YXIgdDtcbiAgICAgICAgICAgIGlmICghKGMgJiBjMCkgJiYgKHQgPSBpbnRlcnNlY3QocG9pbnQxLCBwb2ludDAsIHRydWUpKSkge1xuICAgICAgICAgICAgICBjbGVhbiA9IDA7XG4gICAgICAgICAgICAgIGlmIChzbWFsbFJhZGl1cykge1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHRbMF1bMF0sIHRbMF1bMV0pO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHRbMV1bMF0sIHRbMV1bMV0pO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh0WzFdWzBdLCB0WzFdWzFdKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQodFswXVswXSwgdFswXVsxXSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHYgJiYgKCFwb2ludDAgfHwgIWQzX2dlb19zcGhlcmljYWxFcXVhbChwb2ludDAsIHBvaW50MSkpKSB7XG4gICAgICAgICAgICBsaXN0ZW5lci5wb2ludChwb2ludDFbMF0sIHBvaW50MVsxXSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHBvaW50MCA9IHBvaW50MSwgdjAgPSB2LCBjMCA9IGM7XG4gICAgICAgIH0sXG4gICAgICAgIGxpbmVFbmQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGlmICh2MCkgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgIHBvaW50MCA9IG51bGw7XG4gICAgICAgIH0sXG4gICAgICAgIGNsZWFuOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gY2xlYW4gfCAodjAwICYmIHYwKSA8PCAxO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgIH1cbiAgICBmdW5jdGlvbiBpbnRlcnNlY3QoYSwgYiwgdHdvKSB7XG4gICAgICB2YXIgcGEgPSBkM19nZW9fY2FydGVzaWFuKGEpLCBwYiA9IGQzX2dlb19jYXJ0ZXNpYW4oYik7XG4gICAgICB2YXIgbjEgPSBbIDEsIDAsIDAgXSwgbjIgPSBkM19nZW9fY2FydGVzaWFuQ3Jvc3MocGEsIHBiKSwgbjJuMiA9IGQzX2dlb19jYXJ0ZX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gYnggLSBheCwgZHkgPSBieSAtIGF5LCByO1xuICAgICAgciA9IHgwIC0gYXg7XG4gICAgICBpZiAoIWR4ICYmIHIgPiAwKSByZXR1cm47XG4gICAgICByIC89IGR4O1xuICAgICAgaWYgKGR4IDwgMCkge1xuICAgICAgICBpZiAociA8IHQwKSByZXR1cm47XG4gICAgICAgIGlmIChyIDwgdDEpIHQxID0gcjtcbiAgICAgIH0gZWxzZSBpZiAoZHggPiAwKSB7XG4gICAgICAgIGlmIChyID4gdDEpIHJldHVybjtcbiAgICAgICAgaWYgKHIgPiB0MCkgdDAgPSByO1xuICAgICAgfVxuICAgICAgciA9IHgxIC0gYXg7XG4gICAgICBpZiAoIWR4ICYmIHIgPCAwKSByZXR1cm47XG4gICAgICByIC89IGR4O1xuICAgICAgaWYgKGR4IDwgMCkge1xuICAgICAgICBpZiAociA+IHQxKSByZXR1cm47XG4gICAgICAgIGlmIChyID4gdDApIHQwID0gcjtcbiAgICAgIH0gZWxzZSBpZiAoZHggPiAwKSB7XG4gICAgICAgIGlmIChyIDwgdDApIHJldHVybjtcbiAgICAgICAgaWYgKHIgPCB0MSkgdDEgPSByO1xuICAgICAgfVxuICAgICAgciA9IHkwIC0gYXk7XG4gICAgICBpZiAoIWR5ICYmIHIgPiAwKSByZXR1cm47XG4gICAgICByIC89IGR5O1xuICAgICAgaWYgKGR5IDwgMCkge1xuICAgICAgICBpZiAociA8IHQwKSByZXR1cm47XG4gICAgICAgIGlmIChyIDwgdDEpIHQxID0gcjtcbiAgICAgIH0gZWxzZSBpZiAoZHkgPiAwKSB7XG4gICAgICAgIGlmIChyID4gdDEpIHJldHVybjtcbiAgICAgICAgaWYgKHIgPiB0MCkgdDAgPSByO1xuICAgICAgfVxuICAgICAgciA9IHkxIC0gYXk7XG4gICAgICBpZiAoIWR5ICYmIHIgPCAwKSByZXR1cm47XG4gICAgICByIC89IGR5O1xuICAgICAgaWYgKGR5IDwgMCkge1xuICAgICAgICBpZiAociA+IHQxKSByZXR1cm47XG4gICAgICAgIGlmIChyID4gdDApIHQwID0gcjtcbiAgICAgIH0gZWxzZSBpZiAoZHkgPiAwKSB7XG4gICAgICAgIGlmIChyIDwgdDApIHJldHVybjtcbiAgICAgICAgaWYgKHIgPCB0MSkgdDEgPSByO1xuICAgICAgfVxuICAgICAgaWYgKHQwID4gMCkgbGluZS5hID0ge1xuICAgICAgICB4OiBheCArIHQwICogZHgsXG4gICAgICAgIHk6IGF5ICsgdDAgKiBkeVxuICAgICAgfTtcbiAgICAgIGlmICh0MSA8IDEpIGxpbmUuYiA9IHtcbiAgICAgICAgeDogYXggKyB0MSAqIGR4LFxuICAgICAgICB5OiBheSArIHQxICogZHlcbiAgICAgIH07XG4gICAgICByZXR1cm4gbGluZTtcbiAgICB9O1xuICB9XG4gIHZhciBkM19nZW9fY2xpcEV4dGVudE1BWCA9IDFlOTtcbiAgZDMuZ2VvLmNsaXBFeHRlbnQgPSBmdW5jdGlvbigpIHtcbiAgICB2YXIgeDAsIHkwLCB4MSwgeTEsIHN0cmVhbSwgY2xpcCwgY2xpcEV4dGVudCA9IHtcbiAgICAgIHN0cmVhbTogZnVuY3Rpb24ob3V0cHV0KSB7XG4gICAgICAgIGlmIChzdHJlYW0pIHN0cmVhbS52YWxpZCA9IGZhbHNlO1xuICAgICAgICBzdHJlYW0gPSBjbGlwKG91dHB1dCk7XG4gICAgICAgIHN0cmVhbS52YWxpZCA9IHRydWU7XG4gICAgICAgIHJldHVybiBzdHJlYW07XG4gICAgICB9LFxuICAgICAgZXh0ZW50OiBmdW5jdGlvbihfKSB7XG4gICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIFsgWyB4MCwgeTAgXSwgWyB4MSwgeTEgXSBdO1xuICAgICAgICBjbGlwID0gZDNfZ2VvX2NsaXBFeHRlbnQoeDAgPSArX1swXVswXSwgeTAgPSArX1swXVsxXSwgeDEgPSArX1sxXVswXSwgeTEgPSArX1sxXVsxXSk7XG4gICAgICAgIGlmIChzdH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4gJiYgY2xpcFN0YXJ0SW5zaWRlLCB2aXNpYmxlID0gc2VnbWVudHMubGVuZ3RoO1xuICAgICAgICAgIGlmIChpbnNpZGUgfHwgdmlzaWJsZSkge1xuICAgICAgICAgICAgbGlzdGVuZXIucG9seWdvblN0YXJ0KCk7XG4gICAgICAgICAgICBpZiAoaW5zaWRlKSB7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICBpbnRlcnBvbGF0ZShudWxsLCBudWxsLCAxLCBsaXN0ZW5lcik7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh2aXNpYmxlKSB7XG4gICAgICAgICAgICAgIGQzX2dlb19jbGlwUG9seWdvbihzZWdtZW50cywgY29tcGFyZSwgY2xpcFN0YXJ0SW5zaWRlLCBpbnRlcnBvbGF0ZSwgbGlzdGVuZXIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGlzdGVuZXIucG9seWdvbkVuZCgpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBzZWdtZW50cyA9IHBvbHlnb24gPSByaW5nID0gbnVsbDtcbiAgICAgICAgfVxuICAgICAgfTtcbiAgICAgIGZ1bmN0aW9uIGluc2lkZVBvbHlnb24ocCkge1xuICAgICAgICB2YXIgd24gPSAwLCBuID0gcG9seWdvbi5sZW5ndGgsIHkgPSBwWzFdO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG47ICsraSkge1xuICAgICAgICAgIGZvciAodmFyIGogPSAxLCB2ID0gcG9seWdvbltpXSwgbSA9IHYubGVuZ3RoLCBhID0gdlswXSwgYjsgaiA8IG07ICsraikge1xuICAgICAgICAgICAgYiA9IHZbal07XG4gICAgICAgICAgICBpZiAoYVsxXSA8PSB5KSB7XG4gICAgICAgICAgICAgIGlmIChiWzFdID4geSAmJiBkM19jcm9zczJkKGEsIGIsIHApID4gMCkgKyt3bjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGlmIChiWzFdIDw9IHkgJiYgZDNfY3Jvc3MyZChhLCBiLCBwKSA8IDApIC0td247XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHduICE9PSAwO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gaW50ZXJwb2xhdGUoZnJvbSwgdG8sIGRpcmVjdGlvbiwgbGlzdGVuZXIpIHtcbiAgICAgICAgdmFyIGEgPSAwLCBhMSA9IDA7XG4gICAgICAgIGlmIChmcm9tID09IG51bGwgfHwgKGEgPSBjb3JuZXIoZnJvbSwgZGlyZWN0aW9uKSkgIT09IChhMSA9IGNvcm5lcih0bywgZGlyZWN0aW9uKSkgfHwgY29tcGFyZVBvaW50cyhmcm9tLCB0bykgPCAwIF4gZGlyZWN0aW9uID4gMCkge1xuICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KGEgPT09IDAgfHwgYSA9PT0gMyA/IHgwIDogeDEsIGEgPiAxID8geTEgOiB5MCk7XG4gICAgICAgICAgfSB3aGlsZSAoKGEgPSAoYSArIGRpcmVjdGlvbiArIDQpICUgNCkgIT09IGExKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBsaXN0ZW5lci5wb2ludCh0b1swXSwgdG9bMV0pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBwb2ludFZpc2libGUoeCwgeSkge1xuICAgICAgICByZXR1cm4geDAgPD0geCAmJiB4IDw9IHgxICYmIHkwIDw9IHkgJiYgeSA8PSB5MTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHBvaW50KHgsIHkpIHtcbiAgICAgICAgaWYgKHBvaW50VmlzaWJsZSh4LCB5KSkgbGlzdGVuZXIucG9pbnQoeCwgeSk7XG4gICAgICB9XG4g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l9fID0gdjtcbiAgICAgICAgICBmaXJzdCA9IGZhbHNlO1xuICAgICAgICAgIGlmICh2KSB7XG4gICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHgsIHkpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAodiAmJiB2XykgbGlzdGVuZXIucG9pbnQoeCwgeSk7IGVsc2Uge1xuICAgICAgICAgICAgdmFyIGwgPSB7XG4gICAgICAgICAgICAgIGE6IHtcbiAgICAgICAgICAgICAgICB4OiB4XyxcbiAgICAgICAgICAgICAgICB5OiB5X1xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBiOiB7XG4gICAgICAgICAgICAgICAgeDogeCxcbiAgICAgICAgICAgICAgICB5OiB5XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoY2xpcExpbmUobCkpIHtcbiAgICAgICAgICAgICAgaWYgKCF2Xykge1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KGwuYS54LCBsLmEueSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQobC5iLngsIGwuYi55KTtcbiAgICAgICAgICAgICAgaWYgKCF2KSBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICAgIGNsZWFuID0gZmFsc2U7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHYpIHtcbiAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHgsIHkpO1xuICAgICAgICAgICAgICBjbGVhbiA9IGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB4XyA9IHgsIH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gICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gaztcbiAgICAgIGsgPSArXztcbiAgICAgIHJldHVybiByZXNldCgpO1xuICAgIH07XG4gICAgcHJvamVjdGlvbi50cmFuc2xhdGUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBbIHgsIHkgXTtcbiAgICAgIHggPSArX1swXTtcbiAgICAgIHkgPSArX1sxXTtcbiAgICAgIHJldHVybiByZXNldCgpO1xuICAgIH07XG4gICAgcHJvamVjdGlvbi5jZW50ZXIgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBbIM67ICogZDNfZGVncmVlcywgz4YgKiBkM19kZWdyZWVzIF07XG4gICAgICDOuyA9IF9bMF0gJSAzNjAgKiBkM19yYWRpYW5zO1xuICAgICAgz4YgPSBfWzFdICUgMzYwICogZDNfcmFkaWFucztcbiAgICAgIHJldHVybiByZXNldCgpO1xuICAgIH07XG4gICAgcHJvamVjdGlvbi5yb3RhdGUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBbIM60zrsgKiBkM19kZWdyZWVzLCDOtM+GICogZDNfZGVncmVlcywgzrTOsyAqIGQzX2RlZ3JlZXMgXTtcbiAgICAgIM60zrsgPSBfWzBdICUgMzYwICogZDNfcmFkaWFucztcbiAgICAgIM60z4YgPSBfWzFdICUgMzYwICogZDNfcmFkaWFucztcbiAgICAgIM60zrMgPSBfLmxlbmd0aCA+IDIgPyBfWzJdICUgMzYwICogZDNfcmFkaWFucyA6IDA7XG4gICAgICByZXR1cm4gcmVzZXQoKTtcbiAgICB9O1xuICAgIGQzLnJlYmluZChwcm9qZWN0aW9uLCBwcm9qZWN0UmVzYW1wbGUsIFwicHJlY2lzaW9uXCIpO1xuICAgIGZ1bmN0aW9uIHJlc2V0KCkge1xuIC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AgICB5OiB5MVxuICAgICAgICB9OyBlbHNlIGlmICh2YS55IDwgeTApIHJldHVybjtcbiAgICAgICAgdmIgPSB7XG4gICAgICAgICAgeDogZngsXG4gICAgICAgICAgeTogeTBcbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgZm0gPSAobHggLSByeCkgLyAocnkgLSBseSk7XG4gICAgICBmYiA9IGZ5IC0gZm0gKiBmeDtcbiAgICAgIGlmIChmbSA8IC0xIHx8IGZtID4gMSkge1xuICAgICAgICBpZiAobHggPiByeCkge1xuICAgICAgICAgIGlmICghdmEpIHZhID0ge1xuICAgICAgICAgICAgeDogKHkwIC0gZmIpIC8gZm0sXG4gICAgICAgICAgICB5OiB5MFxuICAgICAgICAgIH07IGVsc2UgaWYgKHZhLnkgPj0geTEpIHJldHVybjtcbiAgICAgICAgICB2YiA9IHtcbiAgICAgICAgICAgIHg6ICh5MSAtIGZiKSAvIGZtLFxuICAgICAgICAgICAgeTogeTFcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICghdmEpIHZhID0ge1xuICAgICAgICAgICAgeDogKHkxIC0gZmIpIC8gZm0sXG4gICAgICAgICAgICB5OiB5MVxuICAgICAgICAgIH07IGVsc2UgaWYgKHZhLnkgPCB5MCkgcmV0dXJuO1xuICAgICAgICAgIHZiID0ge1xuICAgICAgICAgICAgeDogKHkwIC0gZmIpIC8gZm0sXG4gICAgICAgICAgICB5OiB5MFxuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChseSA8IHJ5KSB7XG4gICAgICAgICAgaWYgKCF2YSkgdmEgPSB7XG4gICAgICAgICAgICB4OiB4MCxcbiAgICAgICAgICAgIHk6IGZtICogeDAgKyBmYlxuICAgICAgICAgIH07IGVsc2UgaWYgKHZhLnggPj0geDEpIHJldHVybjtcbiAgICAgICAgICB2YiA9IHtcbiAgICAgICAgICAgIHg6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QuQyA9IHVuY2xlLkMgPSBmYWxzZTtcbiAgICAgICAgICAgIGdyYW5kcGEuQyA9IHRydWU7XG4gICAgICAgICAgICBhZnRlciA9IGdyYW5kcGE7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChhZnRlciA9PT0gcGFyZW50LlIpIHtcbiAgICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVMZWZ0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICAgIGFmdGVyID0gcGFyZW50O1xuICAgICAgICAgICAgICBwYXJlbnQgPSBhZnRlci5VO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcGFyZW50LkMgPSBmYWxzZTtcbiAgICAgICAgICAgIGdyYW5kcGEuQyA9IHRydWU7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIGdyYW5kcGEpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB1bmNsZSA9IGdyYW5kcGEuTDtcbiAgICAgICAgICBpZiAodW5jbGUgJiYgdW5jbGUuQykge1xuICAgICAgICAgICAgcGFyZW50LkMgPSB1bmNsZS5DID0gZmFsc2U7XG4gICAgICAgICAgICBncmFuZHBhLkMgPSB0cnVlO1xuICAgICAgICAgICAgYWZ0ZXIgPSBncmFuZHBhO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoYWZ0ZXIgPT09IHBhcmVudC5MKSB7XG4gICAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlUmlnaHQodGhpcywgcGFyZW50KTtcbiAgICAgICAgICAgICAgYWZ0ZXIgPSBwYXJlbnQ7XG4gICAgICAgICAgICAgIHBhcmVudCA9IGFmdGVyLlU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBwYXJlbnQuQyA9IGZhbHNlO1xuICAgICAg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Xh0LlU7XG4gICAgICAgICAgbmV4dC5VID0gbm9kZS5VO1xuICAgICAgICAgIG5vZGUgPSBuZXh0LlI7XG4gICAgICAgICAgcGFyZW50LkwgPSBub2RlO1xuICAgICAgICAgIG5leHQuUiA9IHJpZ2h0O1xuICAgICAgICAgIHJpZ2h0LlUgPSBuZXh0O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG5leHQuVSA9IHBhcmVudDtcbiAgICAgICAgICBwYXJlbnQgPSBuZXh0O1xuICAgICAgICAgIG5vZGUgPSBuZXh0LlI7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHJlZCA9IG5vZGUuQztcbiAgICAgICAgbm9kZSA9IG5leHQ7XG4gICAgICB9XG4gICAgICBpZiAobm9kZSkgbm9kZS5VID0gcGFyZW50O1xuICAgICAgaWYgKHJlZCkgcmV0dXJuO1xuICAgICAgaWYgKG5vZGUgJiYgbm9kZS5DKSB7XG4gICAgICAgIG5vZGUuQyA9IGZhbHNlO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICBkbyB7XG4gICAgICAgIGlmIChub2RlID09PSB0aGlzLl8pIGJyZWFrO1xuICAgICAgICBpZiAobm9kZSA9PT0gcGFyZW50LkwpIHtcbiAgICAgICAgICBzaWJsaW5nID0gcGFyZW50LlI7XG4gICAgICAgICAgaWYgKHNpYmxpbmcuQykge1xuICAgICAgICAgICAgc2libGluZy5DID0gZmFsc2U7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHRydWU7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZUxlZnQodGhpcywgcGFyZW50KTtcbiAgICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuUjtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHNpYmxpbmcuTCAmJiBzaWJsaW5nLkwuQyB8fCBzaWJsaW5nLlIgJiYgc2libGluZy5SLkMpIHtcbiAgICAgICAgICAgIGlmICghc2libGluZy5SIHx8ICFzaWJsaW5nLlIuQykge1xuICAgICAgICAgICAgICBzaWJsaW5nLkwuQyA9IGZhbHNlO1xuICAgICAgICAgICAgICBzaWJsaW5nLkMgPSB0cnVlO1xuICAgICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIHNpYmxpbmcpO1xuICAgICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50LlI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzaWJsaW5nLkMgPSBwYXJlbnQuQztcbiAgICAgICAgICAgIHBhcmVudC5DID0gc2libGluZy5SLkMgPSBmYWxzZTtcbiAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlTGVmdCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgICAgbm9kZSA9IHRoaXMuXztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBzaWJsaW5nID0gcGFyZW50Lkw7XG4gICAgICAgICAgaWYgKHNpYmxpbmcuQykge1xuICAgICAgICAgICAgc2libGluZy5DID0gZmFsc2U7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHRydWU7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50Lkw7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzaWJsaW5nLkwgJiYgc2libGluZy5MLkMgfHwgc2libGluZy5SICYmIHNpYmxpbmcuUi5DKSB7XG4gICAgICAgICAgICBpZiAoIXNpYmxpbmcuTCB8fCAhc2libGluZy5MLkMpIHtcbiAgICAgICAgICAgICAgc2libGluZy5SLkMgPSBmYWxzZTtcbiAgICAgICAgICAgICAgc2libGluZy5DID0gdHJ1ZTtcbiAgICAgICAgIC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gICAgICAgIHgyID0geDE7XG4gICAgICAgIHkxID0geDEgPSAwO1xuICAgICAgfVxuICAgICAgcmV0dXJuIHF1YWR0cmVlKHBvaW50cyk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHF1YWR0cmVlKGRhdGEpIHtcbiAgICAgIHZhciBkLCBmeCA9IGQzX2Z1bmN0b3IoeCksIGZ5ID0gZDNfZnVuY3Rvcih5KSwgeHMsIHlzLCBpLCBuLCB4MV8sIHkxXywgeDJfLCB5Ml87XG4gICAgICBpZiAoeDEgIT0gbnVsbCkge1xuICAgICAgICB4MV8gPSB4MSwgeTFfID0geTEsIHgyXyA9IHgyLCB5Ml8gPSB5MjtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHgyXyA9IHkyXyA9IC0oeDFfID0geTFfID0gSW5maW5pdHkpO1xuICAgICAgICB4cyA9IFtdLCB5cyA9IFtdO1xuICAgICAgICBuID0gZGF0YS5sZW5ndGg7XG4gICAgICAgIGlmIChjb21wYXQpIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpIHtcbiAgICAgICAgICBkID0gZGF0YVtpXTtcbiAgICAgICAgICBpZiAoZC54IDwgeDFfKSB4MV8gPSBkLng7XG4gICAgICAgICAgaWYgKGQueSA8IHkxXykgeTFfID0gZC55O1xuICAgICAgICAgIGlmIChkLnggPiB4Ml8pIHgyXyA9IGQueDtcbiAgICAgICAgICBpZiAoZC55ID4geTJfKSB5Ml8gPSBkLnk7XG4gICAgICAgICAgeHMucHVzaChkLngpO1xuICAgICAgICAgIHlzLnB1c2goZC55KTtcbiAgICAgICAgfSBlbHNlIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpIHtcbiAgICAgICAgICB2YXIgeF8gPSArZngoZCA9IGRhdGFbaV0sIGkpLCB5XyA9ICtmeShkLCBpKTtcbiAgICAgICAgICBpZiAoeF8gPCB4MV8pIHgxXyA9IHhfO1xuICAgICAgICAgIGlmICh5XyA8IHkxXykgeTFfID0geV87XG4gICAgICAgICAgaWYgKHhfID4geDJfKSB4Ml8gPSB4XztcbiAgICAgICAgICBpZiAoeV8gPiB5Ml8pIHkyXyA9IHlfO1xuICAgICAgICAgIHhzLnB1c2goeF8pO1xuICAgICAgICAgIHlzLnB1c2goeV8pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICB2YXIgZHggPSB4Ml8gLSB4MV8sIGR5ID0geTJfIC0geTFfO1xuICAgICAgaWYgKGR4ID4gZHkpIHkyXyA9IHkxXyArIGR4OyBlbHNlIHgyXyA9IHgxXyArIGR5O1xuICAgICAgZnVuY3Rpb24gaW5zZXJ0KG4sIGQsIHgsIHksIHgxLCB5MSwgeDIsIHkyKSB7XG4gICAgICAgIGlmIChpc05hTih4KSB8fCBpc05hTih5KSkgcmV0dXJuO1xuICAgICAgICBpZiAobi5sZWFmKSB7XG4gICAgICAgICAgdmFyIG54ID0gbi54LCBueSA9IG4ueTtcbiAgICAgICAgICBpZiAobnggIT0gbnVsbCkge1xuICAgICAgICAgICAgaWYgKGFicyhueCAtIHgpICsgYWJzKG55IC0geSkgPCAuMDEpIHtcbiAgICAgICAgICAgICAgaW5zZXJ0Q2hpbGQobiwgZCwgeCwgeSwgeDEsIHkxLCB4MiwgeTIpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdmFyIG5Qb2ludCA9IG4ucG9pbnQ7XG4gICAgICAgICAgICAgIG4ueCA9IG4ueSA9IG4ucG9pbnQgPSBudWxsO1xuICAgICAgICAgICAgICBpbnNlcnRDaGlsZChuLCBuUG9pbnQsIG54LCBueSwgeDEsIHkxLCB4MiwgeTIpO1xuICAgICAgICAgICAgICBpbnNlcnRDaGlsZChuLCBkLCB4LCB5LCB4MSwgeTEsIHgyLCB5Mik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG4ueCA9IHgsIG4ueSA9IHksIG4ucG9pbnQgPSBkO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIH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nBvbGF0ZV9udW1iZXJCLmxhc3RJbmRleCA9IDAsIGFtLCBibSwgYnMsIGkgPSAtMSwgcyA9IFtdLCBxID0gW107XG4gICAgYSA9IGEgKyBcIlwiLCBiID0gYiArIFwiXCI7XG4gICAgd2hpbGUgKChhbSA9IGQzX2ludGVycG9sYXRlX251bWJlckEuZXhlYyhhKSkgJiYgKGJtID0gZDNfaW50ZXJwb2xhdGVfbnVtYmVyQi5leGVjKGIpKSkge1xuICAgICAgaWYgKChicyA9IGJtLmluZGV4KSA+IGJpKSB7XG4gICAgICAgIGJzID0gYi5zbGljZShiaSwgYnMpO1xuICAgICAgICBpZiAoc1tpXSkgc1tpXSArPSBiczsgZWxzZSBzWysraV0gPSBicztcbiAgICAgIH1cbiAgICAgIGlmICgoYW0gPSBhbVswXSkgPT09IChibSA9IGJtWzBdKSkge1xuICAgICAgICBpZiAoc1tpXSkgc1tpXSArPSBibTsgZWxzZSBzWysraV0gPSBibTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHNbKytpXSA9IG51bGw7XG4gICAgICAgIHEucHVzaCh7XG4gICAgICAgICAgaTogaSxcbiAgICAgICAgICB4OiBkM19pbnRlcnBvbGF0ZU51bWJlcihhbSwgYm0pXG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgYmkgPSBkM19pbnRlcnBvbGF0ZV9udW1iZXJCLmxhc3RJbmRleDtcbiAgICB9XG4gICAgaWYgKGJpIDwgYi5sZW5ndGgpIHtcbiAgICAgIGJzID0gYi5zbGljZShiaSk7XG4gICAgICBpZiAoc1tpXSkgc1tpXSArPSBiczsgZWxzZSBzWysraV0gPSBicztcbiAgICB9XG4gICAgcmV0dXJuIHMubGVuZ3RoIDwgMiA/IHFbMF0gPyAoYiA9IHFbMF0ueCwgZnVuY3Rpb24odCkge1xuICAgICAgcmV0dXJuIGIodCkgKyBcIlwiO1xuICAgIH0pIDogZnVuY3Rpb24oKSB7XG4gICAgICByZXR1cm4gYjtcbiAgICB9IDogKGI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AgICBncm91cEluZGV4LnNvcnQoZnVuY3Rpb24oYSwgYikge1xuICAgICAgICAgIHJldHVybiBzb3J0R3JvdXBzKGdyb3VwU3Vtc1thXSwgZ3JvdXBTdW1zW2JdKTtcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgICBpZiAoc29ydFN1Ymdyb3Vwcykge1xuICAgICAgICBzdWJncm91cEluZGV4LmZvckVhY2goZnVuY3Rpb24oZCwgaSkge1xuICAgICAgICAgIGQuc29ydChmdW5jdGlvbihhLCBiKSB7XG4gICAgICAgICAgICByZXR1cm4gc29ydFN1Ymdyb3VwcyhtYXRyaXhbaV1bYV0sIG1hdHJpeFtpXVtiXSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgayA9ICjPhCAtIHBhZGRpbmcgKiBuKSAvIGs7XG4gICAgICB4ID0gMCwgaSA9IC0xO1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgeDAgPSB4LCBqID0gLTE7XG4gICAgICAgIHdoaWxlICgrK2ogPCBuKSB7XG4gICAgICAgICAgdmFyIGRpID0gZ3JvdXBJbmRleFtpXSwgZGogPSBzdWJncm91cEluZGV4W2RpXVtqXSwgdiA9IG1hdHJpeFtkaV1bZGpdLCBhMCA9IHgsIGExID0geCArPSB2ICogaztcbiAgICAgICAgICBzdWJncm91cHNbZGkgKyBcIi1cIiArIGRqXSA9IHtcbiAgICAgICAgICAgIGluZGV4OiBkaSxcbiAgICAgICAgICAgIHN1YmluZGV4OiBkaixcbiAgICAgICAgICAgIHN0YXJ0QW5nbGU6IGEwLFxuICAgICAgICAgICAgZW5kQW5nbGU6IGExLFxuICAgICAgICAgICAgdmFsdWU6IHZcbiAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGdyb3Vwc1tkaV0gPSB7XG4gICAgICAgICAgaW5kZXg6IGRpLFxuICAgICAgICAgIHN0YXJ0QW5nbGU6IHgwLFxuICAgICAgICAgIGVuZEFuZ2xlOiB4LFxuICAgICAgICAgIHZhbHVlOiBncm91cFN1bXNbZGldXG4gICAgICAgIH07XG4gICAgICAgIHggKz0gcGFkZGluZztcbiAgICAgIH1cbiAgICAgIGkgPSAtMTtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgIGogPSBpIC0gMTtcbiAgICAgICAgd2hpbGUgKCsraiA8IG4pIHtcbiAgICAgICAgICB2YXIgc291cmNlID0gc3ViZ3JvdXBzW2kgKyBcIi1cIiArIGpdLCB0YXJnZXQgPSBzdWJncm91cHNbaiArIFwiLVwiICsgaV07XG4gICAgICAgICAgaWYgKHNvdXJjZS52YWx1ZSB8fCB0YXJnZXQudmFsdWUpIHtcbiAgICAgICAgICAgIGNob3Jkcy5wdXNoKHNvdXJjZS52YWx1ZSA8IHRhcmdldC52YWx1ZSA/IHtcbiAgICAgICAgICAgICAgc291cmNlOiB0YXJnZXQsXG4gICAgICAgICAgICAgIHRhcmdldDogc291cmNlXG4gICAgICAgICAgICB9IDoge1xuICAgICAgICAgICAgICBzb3VyY2U6IHNvdXJjZSxcbiAgICAgICAgICAgICAgdGFyZ2V0OiB0YXJnZXRcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKHNvcnRDaG9yZHMpIHJlc29ydCgpO1xuICAgIH1cbiAgICBmdW5jdGlvbiByZXNvcnQoKSB7XG4gICAgICBjaG9yZHMuc29ydChmdW5jdGlvbihhLCBiKSB7XG4gICAgICAgIHJldHVybiBzb3J0Q2hvcmRzKChhLnNvdXJjZS52YWx1ZSArIGEudGFyZ2V0LnZhbHVlKSAvIDIsIChiLnNvdXJjZS52YWx1ZSArIGIudGFyZ2V0LnZhbHVlKSAvIDIpO1xuICAgICAgfSk7XG4gICAgfVxuICAgIGNob3JkLm1hdHJpeCA9IGZ1bmN0aW9uKHgpIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJu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ChkbiA8IGNoYXJnZURpc3RhbmNlMikge1xuICAgICAgICAgICAgICB2YXIgayA9IHF1YWQuY2hhcmdlIC8gZG47XG4gICAgICAgICAgICAgIG5vZGUucHggLT0gZHggKiBrO1xuICAgICAgICAgICAgICBub2RlLnB5IC09IGR5ICogaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAocXVhZC5wb2ludCAmJiBkbiAmJiBkbiA8IGNoYXJnZURpc3RhbmNlMikge1xuICAgICAgICAgICAgdmFyIGsgPSBxdWFkLnBvaW50Q2hhcmdlIC8gZG47XG4gICAgICAgICAgICBub2RlLnB4IC09IGR4ICogaztcbiAgICAgICAgICAgIG5vZGUucHkgLT0gZHkgKiBrO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gIXF1YWQuY2hhcmdlO1xuICAgICAgfTtcbiAgICB9XG4gICAgZm9yY2UudGljayA9IGZ1bmN0aW9uKCkge1xuICAgICAgaWYgKChhbHBoYSAqPSAuOTkpIDwgLjAwNSkge1xuICAgICAgICB0aW1lciA9IG51bGw7XG4gICAgICAgIGV2ZW50LmVuZCh7XG4gICAgICAgICAgdHlwZTogXCJlbmRcIixcbiAgICAgICAgICBhbHBoYTogYWxwaGEgPSAwXG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICAgIHZhciBuID0gbm9kZXMubGVuZ3RoLCBtID0gbGlua3MubGVuZ3RoLCBxLCBpLCBvLCBzLCB0LCBsLCBrLCB4LCB5O1xuICAgICAgZm9yIChpID0gMDsgaSA8IG07ICsraSkge1xuICAgICAgICBvID0gbGlua3NbaV07XG4gICAgICAgIHMgPSBvLnNvdXJjZTtcbiAgICAgICAgdCA9IG8udGFyZ2V0O1xuICAgICAgICB4ID0gdC54IC0gcy54O1xuICAgICAgICB5ID0gdC55IC0gcy55O1xuICAgICAgICBpZiAobCA9IHggKiB4ICsgeSAqIHkpIHtcbiAgICAgICAgICBsID0gYWxwaGEgKiBzdHJlbmd0aHNbaV0gKiAoKGwgPSBNYXRoLnNxcnQobCkpIC0gZGlzdGFuY2VzW2ldKSAvIGw7XG4gICAgICAgICAgeCAqPSBsO1xuICAgICAgICAgIHkgKj0gbDtcbiAgICAgICAgICB0LnggLT0geCAqIChrID0gcy53ZWlnaHQgKyB0LndlaWdodCA/IHMud2VpZ2h0IC8gKHMud2VpZ2h0ICsgdC53ZWlnaHQpIDogLjUpO1xuICAgICAgICAgIHQueSAtPSB5ICogaztcbiAgICAgICAgICBzLnggKz0geCAqIChrID0gMSAtIGspO1xuICAgICAgICAgIHMueSArPSB5ICogaztcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKGsgPSBhbHBoYSAqIGdyYXZpdHkpIHtcbiAgICAgICAgeCA9IHNpemVbMF0gLyAyO1xuICAgICAgICB5ID0gc2l6ZVsxXSAvIDI7XG4gICAgICAgIGkgPSAtMTtcbiAgICAgICAgaWYgKGspIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgICAgbyA9IG5vZGVzW2ldO1xuICAgICAgICAgIG8ueCArPSAoeCAtIG8ueCkgKiBrO1xuICAgICAgICAgIG8ueSArPSAoeSAtIG8ueSkgKiBrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAoY2hhcmdlKSB7XG4gICAgICAgIGQzX2xheW91dF9mb3JjZUFjY3VtdWxhdGUocSA9IGQzLmdlb20ucXVhZHRyZWUobm9kZXMpLCBhbHBoYSwgY2hhcmdlcyk7XG4gICAgICAgIGkgPSAtMTtcbiAgICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgICBpZiAoIShvID0gbm9kZXNbaV0pLmZpeGVkKSB7XG4gICAgICAgICAgICBxLnZpc2l0KHJlcHVsc2UobykpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaSA9IC0xO1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgbyA9IG5vZGVzW2ldO1xuICAgICAgICBpZiAoby5maXhlZCkge1xuICAgICAgICAgIG8ueCA9IG8ucHg7XG4gICAgICAgICAgby55ID0gby5weTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBvLnggLT0gKG8ucHggLSAoby5weCA9IG8ueCkpICogZnJpY3Rpb247XG4gICAgICAgICAgby55IC09IChvLnB5IC0gKG8ucHkgPSBvLnkpKSAqIGZyaWN0aW9uO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBldmVudC50aWNrKHtcbiAgICAgICAgdHlwZTogXCJ0aWNrXCIsXG4gICAgICAgIGFscGhhOiBhbHBoYVxuICAgICAgfSk7XG4gICAgfTtcbiAgICBmb3JjZS5ub2RlcyA9IGZ1bmN0aW9uKHgpIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG5vZGVzO1xuICAgICAgbm9kZXMgPSB4O1xuICAgICAgcmV0dXJuIGZvcmNlO1xuICAgIH07XG4gICAgZm9yY2UubGlua3MgPSBmdW5jdGlvbih4KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBsaW5rcztcbiAgICAgIGxpbmtzID0geDtcbiAgICAgIHJldHVybiBmb3JjZTtcbiAgICB9O1xuICAgIGZvcmNlLnNpemUgPSBmdW5jdGlvbih4KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaXplO1xuICAgICAgc2l6ZSA9IHg7XG4gICAgICByZXR1cm4gZm9yY2U7XG4gICAgfTtcbiAgICBmb3JjZS5saW5rRGlzdGFuY2UgPSBmdW5jdGlvbih4KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBsaW5rRGlzdGFuY2U7XG4gICAgICBsaW5rRGlzdGFuY2UgPSB0eXBlb2YgeCA9PT0gXCJmdW5jdGlvbl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gcmV0dXJuIGZvcmNlO1xuICAgIH07XG4gICAgZm9yY2UudGhldGEgPSBmdW5jdGlvbih4KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBNYXRoLnNxcnQodGhldGEyKTtcbiAgICAgIHRoZXRhMiA9IHggKiB4O1xuICAgICAgcmV0dXJuIGZvcmNlO1xuICAgIH07XG4gICAgZm9yY2UuYWxwaGEgPSBmdW5jdGlvbih4KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBhbHBoYTtcbiAgICAgIHggPSAreDtcbiAgICAgIGlmIChhbHBoYSkge1xuICAgICAgICBpZiAoeCA+IDApIHtcbiAgICAgICAgICBhbHBoYSA9IHg7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdGltZXIuYyA9IG51bGwsIHRpbWVyLnQgPSBOYU4sIHRpbWVyID0gbnVsbDtcbiAgICAgICAgICBldmVudC5lbmQoe1xuICAgICAgICAgICAgdHlwZTogXCJlbmRcIixcbiAgICAgICAgICAgIGFscGhhOiBhbHBoYSA9IDBcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIGlmICh4ID4gMCkge1xuICAgICAgICBldmVudC5zdGFydCh7XG4gICAgICAgICAgdHlwZTogXCJzdGFydFwiLFxuICAgICAgICAgIGFscGhhOiBhbHBoYSA9IHhcbiAgICAgICAgfSk7XG4gICAgICAgIHRpbWVyID0gZDNfdGltZXIoZm9yY2UudGljayk7XG4gICAgICB9XG4gICAgICByZXR1cm4gZm9yY2U7XG4gICAgfTtcbiAgICBmb3JjZS5zdGFydCA9IGZ1bmN0aW9uKCkge1xuICAgICAgdmFyIGksIG4gPSBub2Rlcy5sZW5ndGgsIG0gPSBsaW5rcy5sZW5ndGgsIHcgPSBzaXplWzBdLCBoID0gc2l6ZVsxXSwgbmVpZ2hib3JzLCBvO1xuICAgICAgZm9yIChpID0gMDsgaSA8IG47ICsraSkge1x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dGFja09yZGVycyA9IGQzLm1hcCh7XG4gICAgXCJpbnNpZGUtb3V0XCI6IGZ1bmN0aW9uKGRhdGEpIHtcbiAgICAgIHZhciBuID0gZGF0YS5sZW5ndGgsIGksIGosIG1heCA9IGRhdGEubWFwKGQzX2xheW91dF9zdGFja01heEluZGV4KSwgc3VtcyA9IGRhdGEubWFwKGQzX2xheW91dF9zdGFja1JlZHVjZVN1bSksIGluZGV4ID0gZDMucmFuZ2Uobikuc29ydChmdW5jdGlvbihhLCBiKSB7XG4gICAgICAgIHJldHVybiBtYXhbYV0gLSBtYXhbYl07XG4gICAgICB9KSwgdG9wID0gMCwgYm90dG9tID0gMCwgdG9wcyA9IFtdLCBib3R0b21zID0gW107XG4gICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKSB7XG4gICAgICAgIGogPSBpbmRleFtpXTtcbiAgICAgICAgaWYgKHRvcCA8IGJvdHRvbSkge1xuICAgICAgICAgIHRvcCArPSBzdW1zW2pdO1xuICAgICAgICAgIHRvcHMucHVzaChqKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBib3R0b20gKz0gc3Vtc1tqXTtcbiAgICAgICAgICBib3R0b21zLnB1c2goaik7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiBib3R0b21zLnJldmVyc2UoKS5jb25jYXQodG9wcyk7XG4gICAgfSxcbiAgICByZXZlcnNlOiBmdW5jdGlvbihkYXRhKSB7XG4gICAgICByZXR1cm4gZDMucmFuZ2UoZGF0YS5sZW5ndGgpLnJldmVyc2UoKTtcbiAgICB9LFxuICAgIFwiZGVmYXVsdFwiOiBkM19sYXlvdXRfc3RhY2tPcmRlckRlZmF1bHRcbiAgfSk7XG4gIHZhciBkM19sYXlvdXRfc3RhY2tPZmZzZXRzID0gZDMubWFwKHtcbiAgICBzaWxob3VldHRlOiBmdW5jdGlvbihkYXRhKSB7XG4gICAgICB2YXIgbiA9IGRhdGEubGVuZ3RoLCBtID0gZGF0YVsw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rlc1swXTtcbiAgICBhLnggPSAtYS5yO1xuICAgIGEueSA9IDA7XG4gICAgYm91bmQoYSk7XG4gICAgaWYgKG4gPiAxKSB7XG4gICAgICBiID0gbm9kZXNbMV07XG4gICAgICBiLnggPSBiLnI7XG4gICAgICBiLnkgPSAwO1xuICAgICAgYm91bmQoYik7XG4gICAgICBpZiAobiA+IDIpIHtcbiAgICAgICAgYyA9IG5vZGVzWzJdO1xuICAgICAgICBkM19sYXlvdXRfcGFja1BsYWNlKGEsIGIsIGMpO1xuICAgICAgICBib3VuZChjKTtcbiAgICAgICAgZDNfbGF5b3V0X3BhY2tJbnNlcnQoYSwgYyk7XG4gICAgICAgIGEuX3BhY2tfcHJldiA9IGM7XG4gICAgICAgIGQzX2xheW91dF9wYWNrSW5zZXJ0KGMsIGIpO1xuICAgICAgICBiID0gYS5fcGFja19uZXh0O1xuICAgICAgICBmb3IgKGkgPSAzOyBpIDwgbjsgaSsrKSB7XG4gICAgICAgICAgZDNfbGF5b3V0X3BhY2tQbGFjZShhLCBiLCBjID0gbm9kZXNbaV0pO1xuICAgICAgICAgIHZhciBpc2VjdCA9IDAsIHMxID0gMSwgczIgPSAxO1xuICAgICAgICAgIGZvciAoaiA9IGIuX3BhY2tfbmV4dDsgaiAhPT0gYjsgaiA9IGouX3BhY2tfbmV4dCwgczErKykge1xuICAgICAgICAgICAgaWYgKGQzX2xheW91dF9wYWNrSW50ZXJzZWN0cyhqLCBjKSkge1xuICAgICAgICAgICAgICBpc2VjdCA9IDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoaXNlY3QgPT0gMSkge1xuICAgICAgICAgICAgZm9yIChrID0gYS5fcGFja19wcmV2OyBrICE9PSBqLl9wYWNrX3ByZXY7IGsgPSBrLl9wYWNrX3ByZXYsIHMyKyspIHtcbiAgICAgICAgICAgICAgaWYgKGQzX2xheW91dF9wYWNrSW50ZXJzZWN0cyhrLCBjKSkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChpc2VjdCkge1xuICAgICAgICAgICAgaWYgKHMxIDwgczIgfHwgczEgPT0gczIgJiYgYi5yIDwgYS5yKSBkM19sYXlvdXRfcGFja1NwbGljZShhLCBiID0gaik7IGVsc2UgZDNfbGF5b3V0X3BhY2tTcGxpY2UoYSA9IGssIGIpO1xuICAgICAgICAgICAgaS0tO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBkM19sYXlvdXRfcGFja0luc2VydChhLCBjKTtcbiAgICAgICAgICAgIGIgPSBjO1xuICAgICAgICAgICAgYm91bmQoYyk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIHZhciBjeCA9ICh4TWluICsgeE1heCkgLyAyLCBjeSA9ICh5TWluICsgeU1heCkgLyAyLCBjciA9IDA7XG4gICAgZm9yIChpID0gMDsgaSA8IG47IGkrKykge1xuICAgICAgYyA9IG5vZGVzW2ldO1xuICAgICAgYy54IC09IGN4O1xuICAgICAgYy55IC09IGN5O1xuICAgICAgY3IgPSBNYXRoLm1heChjciwgYy5yICsgTWF0aC5zcXJ0KGMueCAqIGMueCArIGMueSAqIGMueSkpO1xuICAgIH1cbiAgICBub2RlLnIgPSBjcjtcbiAgICBub2Rlcy5mb3JFYWNoKGQzX2xheW91dF9wYWNrVW5saW5rKTtcbiAgfVxuICBmdW5jdGlvbiBkM19sYXlvdXRfcGFja0xpbmsobm9kZSkge1xuICAgIG5vZGUuX3BhY2tfbmV4dCA9IG5vZGUuX3BhY2tfcHJldiA9IG5vZGU7XG4gIH1cbiAgZnVuY3Rpb24gZDNfbGF5b3V0X3BhY2tVbmxpbmsobm9kZSkge1xuICAgIGRlbGV0ZSBub2RlLl9wYWNrX25leHQ7XG4gICAgZGVsZXRlIG5vZGUuX3BhY2tfcHJldjt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G4gICAgICBpZiAodykge1xuICAgICAgICB2YXIgdmlwID0gdiwgdm9wID0gdiwgdmltID0gdywgdm9tID0gdmlwLnBhcmVudC5jaGlsZHJlblswXSwgc2lwID0gdmlwLm0sIHNvcCA9IHZvcC5tLCBzaW0gPSB2aW0ubSwgc29tID0gdm9tLm0sIHNoaWZ0O1xuICAgICAgICB3aGlsZSAodmltID0gZDNfbGF5b3V0X3RyZWVSaWdodCh2aW0pLCB2aXAgPSBkM19sYXlvdXRfdHJlZUxlZnQodmlwKSwgdmltICYmIHZpcCkge1xuICAgICAgICAgIHZvbSA9IGQzX2xheW91dF90cmVlTGVmdCh2b20pO1xuICAgICAgICAgIHZvcCA9IGQzX2xheW91dF90cmVlUmlnaHQodm9wKTtcbiAgICAgICAgICB2b3AuYSA9IHY7XG4gICAgICAgICAgc2hpZnQgPSB2aW0ueiArIHNpbSAtIHZpcC56IC0gc2lwICsgc2VwYXJhdGlvbih2aW0uXywgdmlwLl8pO1xuICAgICAgICAgIGlmIChzaGlmdCA+IDApIHtcbiAgICAgICAgICAgIGQzX2xheW91dF90cmVlTW92ZShkM19sYXlvdXRfdHJlZUFuY2VzdG9yKHZpbSwgdiwgYW5jZXN0b3IpLCB2LCBzaGlmdCk7XG4gICAgICAgICAgICBzaXAgKz0gc2hpZnQ7XG4gICAgICAgICAgICBzb3AgKz0gc2hpZnQ7XG4gICAgICAgICAgfVxuICAgICAgICAgIHNpbSArPSB2aW0ubTtcbiAgICAgICAgICBzaXAgKz0gdmlwLm07XG4gICAgICAgICAgc29tICs9IHZvbS5tO1xuICAgICAgICAgIHNvcCArPSB2b3AubTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodmltICYmICFkM19sYXlvdXRfdHJlZVJpZ2h0KHZvcCkpIHtcbiAgICAgICAgICB2b3AudCA9IHZpbTtcbiAgICAgICAgICB2b3AubSArPSBzaW0gLSBzb3A7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHZpcCAmJiAhZDNfbGF5b3V0X3R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lLmRlcHRoICYgMSA/IHJlY3QuZHkgOiByZWN0LmR4IDogTWF0aC5taW4ocmVjdC5keCwgcmVjdC5keSksIG47XG4gICAgICAgIHNjYWxlKHJlbWFpbmluZywgcmVjdC5keCAqIHJlY3QuZHkgLyBub2RlLnZhbHVlKTtcbiAgICAgICAgcm93LmFyZWEgPSAwO1xuICAgICAgICB3aGlsZSAoKG4gPSByZW1haW5pbmcubGVuZ3RoKSA+IDApIHtcbiAgICAgICAgICByb3cucHVzaChjaGlsZCA9IHJlbWFpbmluZ1tuIC0gMV0pO1xuICAgICAgICAgIHJvdy5hcmVhICs9IGNoaWxkLmFyZWE7XG4gICAgICAgICAgaWYgKG1vZGUgIT09IFwic3F1YXJpZnlcIiB8fCAoc2NvcmUgPSB3b3JzdChyb3csIHUpKSA8PSBiZXN0KSB7XG4gICAgICAgICAgICByZW1haW5pbmcucG9wKCk7XG4gICAgICAgICAgICBiZXN0ID0gc2NvcmU7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJvdy5hcmVhIC09IHJvdy5wb3AoKS5hcmVhO1xuICAgICAgICAgICAgcG9zaXRpb24ocm93LCB1LCByZWN0LCBmYWxzZSk7XG4gICAgICAgICAgICB1ID0gTWF0aC5taW4ocmVjdC5keCwgcmVjdC5keSk7XG4gICAgICAgICAgICByb3cubGVuZ3RoID0gcm93LmFyZWEgPSAwO1xuICAgICAgICAgICAgYmVzdCA9IEluZmluaXR5O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAocm93Lmxlbmd0aCkge1xuICAgICAgICAgIHBvc2l0aW9uKHJvdywgdSwgcmVjdCwgdHJ1ZSk7XG4gICAgICAgICAgcm93Lmxlbmd0aCA9IHJvdy5hcmVhID0gMDtcbiAgICAgICAgfVxuICAgICAgICBjaGlsZHJlbi5mb3JFYWNoKHNxdWFyaWZ5KTtcbiAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gc3RpY2tpZnkobm9kZSkge1xuICAgICAgdmFyIGNoaWxkcmVuID0gbm9kZS5jaGlsZHJlbjtcbiAgICAgIGlmIChjaGlsZHJlbiAmJiBjaGlsZHJlbi5sZW5ndGgpIHtcbiAgICAgICAgdmFyIHJlY3QgPSBwYWQobm9kZSksIHJlbWFpbmluZyA9IGNoaWxkcmVuLnNsaWNlKCksIGNoaWxkLCByb3cgPSBbXTtcbiAgICAgICAgc2NhbGUocmVtYWluaW5nLCByZWN0LmR4ICogcmVjdC5keSAvIG5vZGUudmFsdWUpO1xuICAgICAgICByb3cuYXJlYSA9IDA7XG4gICAgICAgIHdoaWxlIChjaGlsZCA9IHJlbWFpbmluZy5wb3AoKSkge1xuICAgICAgICAgIHJvdy5wdXNoKGNoaWxkKTtcbiAgICAgICAgICByb3cuYXJlYSArPSBjaGlsZC5hcmVhO1xuICAgICAgICAgIGlmIChjaGlsZC56ICE9IG51bGwpIHtcbiAgICAgICAgICAgIHBvc2l0aW9uKHJvdywgY2hpbGQueiA/IHJlY3QuZHggOiByZWN0LmR5LCByZWN0LCAhcmVtYWluaW5nLmxlbmd0aCk7XG4gICAgICAgICAgICByb3cubGVuZ3RoID0gcm93LmFyZWEgPSAwO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBjaGlsZHJlbi5mb3JFYWNoKHN0aWNraWZ5KTtcbiAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gd29yc3Qocm93LCB1KSB7XG4gICAgICB2YXIgcyA9IHJvdy5hcmVhLCByLCBybWF4ID0gMCwgcm1pbiA9IEluZmluaXR5LCBpID0gLTEsIG4gPSByb3cubGVuZ3RoO1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgaWYgKCEociA9IHJvd1tpXS5hcmVhKSkgY29udGludWU7XG4gICAgICAgIGlmIChyIDwgcm1pbikgcm1pbiA9IHI7XG4gICAgICAgIGlmIChyID4gcm1heCkgcm1heCA9IHI7XG4gICAgICB9XG4gICAgICBzICo9IHM7XG4gICAgICB1ICo9IHU7XG4gICAgICByZXR1cm4gcyA/IE1hdGgubWF4KHUgKiBybWF4ICogcmF0aW8gLyBzLCBzIC8gKHUgKiBybWluICogcmF0aW8pKSA6IEluZmluaXR5O1xuICAgIH1cbiAgICBmdW5jdGlvbiBwb3NpdGlvbihyb3csIHUsIHJlY3QsIGZsdXNoKSB7XG4gICAgICB2YXIgaSA9IC0xLCBuID0gcm93Lmxlbmd0aCwgeCA9IHJlY3QueCwgeSA9IHJlY3QueSwgdiA9IHUgPyByb3VuZChyb3cuYXJlYSAvIHUpIDogMCwgbztcbiAgICAgIGlmICh1ID09IHJlY3QuZHgpIHtcbiAgICAgICAgaWYgKGZsdXNoIHx8IHYgPiByZWN0LmR5KSB2ID0gcmVjdC5keTtcbiAgICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgICBvID0gcm93W2ldO1xuICAgICAgICAgIG8ueCA9IHg7XG4gICAgICAgICAgby55ID0geTtcbiAgICAgICAgICBvLmR5ID0gdjtcbiAgICAgICAgICB4ICs9IG8uZHggPSBNYXRoLm1pbihyZWN0LnggKyByZWN0LmR4IC0geCwgdiA/IHJvdW5kKG8uYXJlYSAvIHYpIDogMCk7XG4gICAgICAgIH1cbiAgICAgICAgby56ID0gdHJ1ZTtcbiAgICAgICAgby5keCArPSByZWN0LnggKyByZWN0LmR4IC0geDtcbiAgICAgICAgcmVjdC55ICs9IHY7XG4gICAgICAgIHJlY3QuZHkgLT0gdjtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChmbHVzaCB8fCB2ID4gcmVjdC5keCkgdiA9IHJlY3QuZHg7XG4gICAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgICAgbyA9IHJvd1tpXTtcbiAgICAgICAgICBvLnggPSB4O1xuICAgICAgICAgIG8ueSA9IHk7XG4gICAgICAgICAgby5keCA9IHY7XG4gICAgICAgICAgeSArPSBvLmR5ID0gTWF0aC5taW4ocmVjdC55ICsgcmVjd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FsbCh0aGlzLCBkLCBpKSBdKTtcbiAgICAgICAgfSBlbHNlIGlmIChwb2ludHMwLmxlbmd0aCkge1xuICAgICAgICAgIHNlZ21lbnQoKTtcbiAgICAgICAgICBwb2ludHMwID0gW107XG4gICAgICAgICAgcG9pbnRzMSA9IFtdO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAocG9pbnRzMC5sZW5ndGgpIHNlZ21lbnQoKTtcbiAgICAgIHJldHVybiBzZWdtZW50cy5sZW5ndGggPyBzZWdtZW50cy5qb2luKFwiXCIpIDogbnVsbDtcbiAgICB9XG4gICAgYXJlYS54ID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geDE7XG4gICAgICB4MCA9IHgxID0gXztcbiAgICAgIHJldHVybiBhcmVhO1xuICAgIH07XG4gICAgYXJlYS54MCA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHgwO1xuICAgICAgeDAgPSBfO1xuICAgICAgcmV0dXJuIGFyZWE7XG4gICAgfTtcbiAgICBhcmVhLngxID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geDE7XG4gICAgICB4MSA9IF87XG4gICAgICByZXR1cm4gYXJlYTtcbiAgICB9O1xuICAgIGFyZWEueSA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHkxO1xuICAgICAgeTAgPSB5MSA9IF87XG4gICAgICByZXR1cm4gYXJlYTtcbiAgICB9O1xuICAgIGFyZWEueTAgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5MDtcbiAgICAgIHkwID0gXztcbiAgICAgIHJldHVybiBhcmVhO1xuICAgIH07XG4gICAgYXJlYS55MSA9IGZ1bmN0aW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50MSA9IHtcbiAgICAgICAgICB4OiB4RXh0ZW50LFxuICAgICAgICAgIHk6IHlFeHRlbnQsXG4gICAgICAgICAgaTogeEV4dGVudERvbWFpbixcbiAgICAgICAgICBqOiB5RXh0ZW50RG9tYWluXG4gICAgICAgIH0sIGV4dGVudDAgPSB0aGlzLl9fY2hhcnRfXyB8fCBleHRlbnQxO1xuICAgICAgICB0aGlzLl9fY2hhcnRfXyA9IGV4dGVudDE7XG4gICAgICAgIGlmIChkM190cmFuc2l0aW9uSW5oZXJpdElkKSB7XG4gICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLnRyYW5zaXRpb24oKS5lYWNoKFwic3RhcnQuYnJ1c2hcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB4RXh0ZW50RG9tYWluID0gZXh0ZW50MC5pO1xuICAgICAgICAgICAgeUV4dGVudERvbWFpbiA9IGV4dGVudDAuajtcbiAgICAgICAgICAgIHhFeHRlbnQgPSBleHRlbnQwLng7XG4gICAgICAgICAgICB5RXh0ZW50ID0gZXh0ZW50MC55O1xuICAgICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgICAgdHlwZTogXCJicnVzaHN0YXJ0XCJcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pLnR3ZWVuKFwiYnJ1c2g6YnJ1c2hcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgeGkgPSBkM19pbnRlcnBvbGF0ZUFycmF5KHhFeHRlbnQsIGV4dGVudDEueCksIHlpID0gZDNfaW50ZXJwb2xhdGVBcnJheSh5RXh0ZW50LCBleHRlbnQxLnkpO1xuICAgICAgICAgICAgeEV4dGVudERvbWFpbiA9IHlFeHRlbnREb21haW4gPSBudWxsO1xuICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHQpIHtcbiAgICAgICAgICAgICAgeEV4dGVudCA9IGV4dGVudDEueCA9IHhpKHQpO1xuICAgICAgICAgICAgICB5RXh0ZW50ID0gZXh0ZW50MS55ID0geWkodCk7XG4gICAgICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICAgICAgdHlwZTogXCJicnVzaFwiLFxuICAgICAgICAgICAgICAgIG1vZGU6IFwicmVzaXplXCJcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH0pLmVhY2goXCJlbmQuYnJ1c2hcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB4RXh0ZW50RG9tYWluID0gZXh0ZW50MS5pO1xuICAgICAgICAgICAgeUV4dGVudERvbWFpbiA9IGV4dGVudDEuajtcbiAgICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hcIixcbiAgICAgICAgICAgICAgbW9kZTogXCJyZXNpemVcIlxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgICB0eXBlOiBcImJydXNoZW5kXCJcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICB0eXBlOiBcImJydXNoc3RhcnRcIlxuICAgICAgICAgIH0pO1xuICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICB0eXBlOiBcImJydXNoXCIsXG4gICAgICAgICAgICBtb2RlOiBcInJlc2l6ZVwiXG4gICAgICAgICAgfSk7XG4gICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hlbmRcIlxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9O1xuICAgIGZ1bmN0aW9uIHJlZHJhdyhnKSB7XG4gICAgICBnLnNlbGVjdEFsbChcIi5yZXNpemVcIikuYXR0cihcInRyYW5zZm9ybVwiLCBmdW5jdGlvbihkKSB7XG4gICAgICAgIHJldHVybiBcInRyYW5zbGF0ZShcIiArIHhFeHRlbnR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eWxlKFwicG9pbnRlci1ldmVudHNcIiwgXCJub25lXCIpLnNlbGVjdEFsbChcIi5yZXNpemVcIikuc3R5bGUoXCJkaXNwbGF5XCIsIG51bGwpO1xuICAgICAgZDMuc2VsZWN0KFwiYm9keVwiKS5zdHlsZShcImN1cnNvclwiLCBldmVudFRhcmdldC5zdHlsZShcImN1cnNvclwiKSk7XG4gICAgICBldmVudF8oe1xuICAgICAgICB0eXBlOiBcImJydXNoc3RhcnRcIlxuICAgICAgfSk7XG4gICAgICBicnVzaG1vdmUoKTtcbiAgICAgIGZ1bmN0aW9uIGtleWRvd24oKSB7XG4gICAgICAgIGlmIChkMy5ldmVudC5rZXlDb2RlID09IDMyKSB7XG4gICAgICAgICAgaWYgKCFkcmFnZ2luZykge1xuICAgICAgICAgICAgY2VudGVyID0gbnVsbDtcbiAgICAgICAgICAgIG9yaWdpblswXSAtPSB4RXh0ZW50WzFdO1xuICAgICAgICAgICAgb3JpZ2luWzFdIC09IHlFeHRlbnRbMV07XG4gICAgICAgICAgICBkcmFnZ2luZyA9IDI7XG4gICAgICAgICAgfVxuICAgICAgICAgIGQzX2V2ZW50UHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24ga2V5dXAoKSB7XG4gICAgICAgIGlmIChkMy5ldmVudC5rZXlDb2RlID09IDMyICYmIGRyYWdnaW5nID09IDIpIHtcbiAgICAgICAgICBvcmlnaW5bMF0gKz0geEV4dGVudFsxXTtcbiAgICAgICAgICBvcmlnaW5bMV0gKz0geUV4dGVudFsxXTtcbiAgICAgICAgICBkcmFnZ2luZyA9IDA7XG4gICAgICAgICAgZDNfZXZlbnRQcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBicnVzaG1vdmUoKSB7XG4gICAgICAgIHZhciBwb2ludCA9IGQzLm1vdXNlKHRhcmdldCksIG1vdmVkID0gZmFsc2U7XG4gICAgICAgIGlmIChvZmZzZXQpIHtcbiAgICAgICAgICBwb2ludFswXSArPSBvZmZzZXRbMF07XG4gICAgICAgICAgcG9pbnRbMV0gKz0gb2Zmc2V0WzFdO1xuICAgICAgICB9XG4gICAgICAgIGlmICghZHJhZ2dpbmcpIHtcbiAgICAgICAgICBpZiAoZDMuZXZlbnQuYWx0S2V5KSB7XG4gICAgICAgICAgICBpZiAoIWNlbnRlcikgY2VudGVyID0gWyAoeEV4dGVudFswXSArIHhFeHRlbnRbMV0pIC8gMiwgKHlFeHRlbnRbMF0gKyB5RXh0ZW50WzFdKSAvIDIgXTtcbiAgICAgICAgICAgIG9yaWdpblswXSA9IHhFeHRlbnRbKyhwb2ludFswXSA8IGNlbnRlclswXSldO1xuICAgICAgICAgICAgb3JpZ2luWzFdID0geUV4dGVudFsrKHBvaW50WzFdIDwgY2VudGVyWzFdKV07XG4gICAgICAgICAgfSBlbHNlIGNlbnRlciA9IG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHJlc2l6aW5nWCAmJiBtb3ZlMShwb2ludCwgeCwgMCkpIHtcbiAgICAgICAgICByZWRyYXdYKGcpO1xuICAgICAgICAgIG1vdmVkID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAocmVzaXppbmdZICYmIG1vdmUxKHBvaW50LCB5LCAxKSkge1xuICAgICAgICAgIHJlZHJhd1koZyk7XG4gICAgICAgICAgbW92ZWQgPSB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIGlmIChtb3ZlZCkge1xuICAgICAgICAgIHJlZHJhdyhnKTtcbiAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgdHlwZTogXCJicnVzaFwiLFxuICAgICAgICAgICAgbW9kZTogZHJhZ2dpbmcgPyBcIm1vdmVcIiA6IFwicmVzaXplXCJcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gbW92ZTEocG9pbnQsIHNjYWxlLCBpKSB7XG4gICAgIC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2hSZXNpemVzWyF4IDw8IDEgfCAheV07XG4gICAgICByZXR1cm4gYnJ1c2g7XG4gICAgfTtcbiAgICBicnVzaC5jbGFtcCA9IGZ1bmN0aW9uKHopIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHggJiYgeSA/IFsgeENsYW1wLCB5Q2xhbXAgXSA6IHggPyB4Q2xhbXAgOiB5ID8geUNsYW1wIDogbnVsbDtcbiAgICAgIGlmICh4ICYmIHkpIHhDbGFtcCA9ICEhelswXSwgeUNsYW1wID0gISF6WzFdOyBlbHNlIGlmICh4KSB4Q2xhbXAgPSAhIXo7IGVsc2UgaWYgKHkpIHlDbGFtcCA9ICEhejtcbiAgICAgIHJldHVybiBicnVzaDtcbiAgICB9O1xuICAgIGJydXNoLmV4dGVudCA9IGZ1bmN0aW9uKHopIHtcbiAgICAgIHZhciB4MCwgeDEsIHkwLCB5MSwgdDtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICBpZiAoeCkge1xuICAgICAgICAgIGlmICh4RXh0ZW50RG9tYWluKSB7XG4gICAgICAgICAgICB4MCA9IHhFeHRlbnREb21haW5bMF0sIHgxID0geEV4dGVudERvbWFpblsxXTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgeDAgPSB4RXh0ZW50WzBdLCB4MSA9IHhFeHRlbnRbMV07XG4gICAgICAgICAgICBpZiAoeC5pbnZlcnQpIHgwID0geC5pbnZlcnQoeDApLCB4MSA9IHguaW52ZXJ0KHgxKTtcbiAgICAgICAgICAgIGlmICh4MSA8IHgwKSB0ID0geDAsIHgwID0geDEsIHgxID0gdDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHkpIHtcbiAgICAgICAgICBpZiAoeUV4dGVudERvbWFpbikge1xuICAgICAgICAgICAgeTAgPSB5RXh0ZW50RG9tYWluWzBdLCB5MSA9IHlFeHRlbnREb21haW5bMV07XG4gICAgICA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ICAgcG9seSA9IG5ldyBQb2x5bm9taWFsKFxuICAgICAgICAgICAgYzEyLngqYzIyLnkqYzIyLnksXG4gICAgICAgICAgICAyKmMxMi54KmMyMS55KmMyMi55LFxuICAgICAgICAgICAgYzEyLngqYzIxLnkqYzIxLnkgLSBjMjIueCp2MyAtIGMyMi55KnYwIC0gYzIyLnkqdjEsXG4gICAgICAgICAgICAtYzIxLngqdjMgLSBjMjEueSp2MCAtIGMyMS55KnYxLFxuICAgICAgICAgICAgKGMxMC54IC0gYzIwLngpKnYzICsgKGMxMC55IC0gYzIwLnkpKnYxXG4gICAgICAgICk7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgdmFyIHYwID0gYzEyLngqYzIyLnkgLSBjMTIueSpjMjIueDtcbiAgICAgICAgdmFyIHYxID0gYzEyLngqYzIxLnkgLSBjMjEueCpjMTIueTtcbiAgICAgICAgdmFyIHYyID0gYzExLngqYzEyLnkgLSBjMTEueSpjMTIueDtcbiAgICAgICAgdmFyIHYzID0gYzEwLnkgLSBjMjAueTtcbiAgICAgICAgdmFyIHY0ID0gYzEyLnkqKGMxMC54IC0gYzIwLngpIC0gYzEyLngqdjM7XG4gICAgICAgIHZhciB2NSA9IC1jMTEueSp2MiArIGMxMi55KnY0O1xuICAgICAgICB2YXIgdjYgPSB2Mip2MjtcblxuICAgICAgICBwb2x5ID0gbmV3IFBvbHlub21pYWwoXG4gICAgICAgICAgICB2MCp2MCxcbiAgICAgICAgICAgIDIqdjAqdjEsXG4gICAgICAgICAgICAoLWMyMi55KnY2ICsgYzEyLnkqdjEqdjEgKyBjMTIueSp2MCp2NCArIHYwKnY1KSAvIGMxMi55LFxuICAgICAgICAgICAgKC1jMjEueSp2NiArIGMxMi55KnYxKnY0ICsgdjEqdjUpIC8gYzEyLnksXG4gICAgICAgICAgICAodjMqdjYgKyB2NCp2NSkgLyBjMTIueVxuICAgICAgICApO1xuICAgIH1cblxuICAgIHZhciByb290cyA9IHBvbHkuZ2V0Um9vdHMoKTtcbiAgICBmb3IgKCB2YXIgaSA9IDA7IGkgPCByb290cy5sZW5ndGg7IGkrKyApIHtcbiAgICAgICAgdmFyIHMgPSByb290c1tpXTtcblxuICAgICAgICBpZiAoIDAgPD0gcyAmJiBzIDw9IDEgKSB7XG4gICAgICAgICAgICB2YXIgeFJvb3RzID0gbmV3IFBvbHlub21pYWwoXG4gICAgICAgICAgICAgICAgYzEyLngsXG4gICAgICAgICAgICAgICAgYzExLngsXG4gICAgICAgICAgICAgICAgYzEwLnggLSBjMjAueCAtIHMqYzIxLnggLSBzKnMqYzIyLnhcbiAgICAgICAgICAgICkuZ2V0Um9vdHMoKTtcbiAgICAgICAgICAgIHZhciB5Um9vdHMgPSBuZXcgUG9seW5vbWlhbChcbiAgICAgICAgICAgICAgICBjMTIueSxcbiAgICAgICAgICAgICAgICBjMTEueSxcbiAgICAgICAgICAgICAgICBjMTAueSAtIGMyMC55IC0gcypjMjEueSAtIHMqcypjMjIueVxuICAgICAgICAgICAgKS5nZXRSb290cygpO1xuXG4gICAgICAgICAgICBpZiAoIHhSb290cy5sZW5ndGggPiAwICYmIHlSb290cy5sZW5ndGggPiAwICkge1xuICAgICAgICAgICAgICAgIHZhciBUT0xFUkFOQ0UgPSAxZS00O1xuXG4gICAgICAgICAgICAgICAgY2hlY2tSb290czpcbiAgICAgICAgICAgICAgICBmb3IgKCB2YXIgaiA9IDA7IGogPCB4Um9vdHMubGVuZ3RoOyBqKysgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB4Um9vdCA9IHhSb290c1tqXTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAoIDAgPD0geFJvb3QgJiYgeFJvb3QgPD0gMSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoIHZhciBrID0gMDsgayA8IHlSb290cy5sZW5ndGg7IGsrKyApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIE1hdGguYWJzKCB4Um9vdCAtIHlSb290c1trXSApIDwgVE9MRVJBTkNFICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucG9pbnRzLnB1c2goIGMyMi5tdWx0aXBseShzKnMpLmFkZChjMjEubXVsdGlwbHkocykuYWRkKGMyMCkpICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIGNoZWNrUm9vdHM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgaWYgKCByZXN1bHQucG9pbnRzLmxlbmd0aCA+IDAgKSByZXN1bHQuc3RhdHVzID0gXCJJbnRlcnNlY3Rpb25cIjtcblxuICAgIHJldHVybiByZXN1bHQ7XG59O1xuXG5cbi8qKioqKlxuKlxuKiAgIGludGVyc2VjdEJlemllcjJCZXppZXIzXG4qXG4qKioqKi9cbkludGVyc2VjdGlvbi5pbnRlcnNlY3RCZXppZXIyQmV6aWVyMyA9IGZ1bmN0aW9uKGExLCBhMiwgYTMsIGIxLCBiMiwgYjMsIGI0KSB7XG4gICAgdmFyIGEsIGIsYywgZDtcbiAgICB2YXIgYzEyLCBjMTEsIGMxMDtcbiAgICB2YXIgYzIzLCBjMjIsIGMyMSwgYzIwO1xuICAgIHZhciByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiTm8gSW50ZXJzZWN0aW9uXCIpO1xuXG4gICAgYSA9IGEyLm11bHRpcGx5KC0yKTtcbiAgICBjMTIgPSBhMS5hZGQoYS5hZGQoYTMpKTtcblxuICAgIGEgPSBhMS5tdWx0aXBseSgtMik7XG4gICAgYiA9IGEyLm11bHRpcGx5KDIpO1xuICAgIGMxMSA9IGEuYWRkKGIpO1xuXG4gICAgYzEwID0gbmV3IFBvaW50MkQoYTEueCwgYTEueSk7XG5cbiAgICBhID0gYjEubXVsdGlwbHkoLTEpO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AgICB2YXIgcG9seSA9IG5ldyBQb2x5bm9taWFsKFxuICAgICAgICAtMipjMTIueCpjMTIueSpjMjMueCpjMjMueSArIGMxMngyKmMyM3kyICsgYzEyeTIqYzIzeDIsXG4gICAgICAgIC0yKmMxMi54KmMxMi55KmMyMi54KmMyMy55IC0gMipjMTIueCpjMTIueSpjMjIueSpjMjMueCArIDIqYzEyeTIqYzIyLngqYzIzLnggK1xuICAgICAgICAgICAgMipjMTJ4MipjMjIueSpjMjMueSxcbiAgICAgICAgLTIqYzEyLngqYzIxLngqYzEyLnkqYzIzLnkgLSAyKmMxMi54KmMxMi55KmMyMS55KmMyMy54IC0gMipjMTIueCpjMTIueSpjMjIueCpjMjIueSArXG4gICAgICAgICAgICAyKmMyMS54KmMxMnkyKmMyMy54ICsgYzEyeTIqYzIyeDIgKyBjMTJ4MiooMipjMjEueSpjMjMueSArIGMyMnkyKSxcbiAgICAgICAgMipjMTAueCpjMTIueCpjMTIueSpjMjMueSArIDIqYzEwLnkqYzEyLngqYzEyLnkqYzIzLnggKyBjMTEueCpjMTEueSpjMTIueCpjMjMueSArXG4gICAgICAgICAgICBjMTEueCpjMTEueSpjMTIueSpjMjMueCAtIDIqYzIwLngqYzEyLngqYzEyLnkqYzIzLnkgLSAyKmMxMi54KmMyMC55KmMxMi55KmMyMy54IC1cbiAgICAgICAgICAgIDIqYzEyLngqYzIxLngqYzEyLnkqYzIyLnkgLSAyKmMxMi54KmMxMi55KmMyMS55KmMyMi54IC0gMipjMTAueCpjMTJ5MipjMjMueCAtXG4gICAgICAgICAgICAyKmMxMC55KmMxMngyKmMyMy55ICsgMipjMjAueCpjMTJ5MipjMjMueCArIDIqYzIxLngqYzEyeTIqYzIyLnggLVxuICAgICAgICAgICAgYzExeTIqYzEyLngqYzIzLnggLSBjMTF4MipjMTIueSpjMjMueSArIGMxMngyKigyKmMyMC55KmMyMy55ICsgMipjMjEueSpjMjIueSksXG4gICAgICAgIDIqYzEwLngqYzEyLngqYzEyLnkqYzIyLnkgKyAyKmMxMC55KmMxMi54KmMxMi55KmMyMi54ICsgYzExLngqYzExLnkqYzEyLngqYzIyLnkgK1xuICAgICAgICAgICAgYzExLngqYzExLnkqYzEyLnkqYzIyLnggLSAyKmMyMC54KmMxMi54KmMxMi55KmMyMi55IC0gMipjMTIueCpjMjAueSpjMTIueSpjMjIueCAtXG4gICAgICAgICAgICAyKmMxMi54KmMyMS54KmMxMi55KmMyMS55IC0gMipjMTAueCpjMTJ5MipjMjIueCAtIDIqYzEwLnkqYzEyeDIqYzIyLnkgK1xuICAgICAgICAgICAgMipjMjAueCpjMTJ5MipjMjIueCAtIGMxMXkyKmMxMi54KmMyMi54IC0gYzExeDIqYzEyLnkqYzIyLnkgKyBjMjF4MipjMTJ5MiArXG4gICAgICAgICAgICBjMTJ4MiooMipjMjAueSpjMjIueSArIGMyMXkyKSxcbiAgICAgICAgMipjMTAueCpjMTIueCpjMTIueSpjMjEueSArIDIqYzEwLnkqYzEyLngqYzIxLngqYzEyLnkgKyBjMTEueCpjMTEueSpjMTIueCpjMjEueSArXG4gICAgICAgICAgICBjMTEueCpjMTEueSpjMjEueCpjMTIueSAtIDIqYzIwLngqYzEyLngqYzEyLnkqYzIxLnkgLSAyKmMxMi54KmMyMC55KmMyMS54KmMxMi55IC1cbiAgICAgICAgICAgIDIqYzEwLngqYzIxLngqYzEyeTIgLSAyKmMxMC55KmMxMngyKmMyMS55ICsgMipjMjAueCpjMjEueCpjMTJ5MiAtXG4gICAgICAgICAgICBjMTF5MipjMTIueCpjMjEueCAtIGMxMXgyKmMxMi55KmMyMS55ICsgMipjMTJ4MipjMjAueSpjMjEueSxcbiAgICAgICAgLTIqYzEwLngqYzEwLnkqYzEyLngqYzEyLnkgLSBjMTAueCpjMTEueCpjMTEueSpjMTIueSAtIGMxMC55KmMxMS54KmMxMS55KmMxMi54ICtcbiAgICAgICAgICAgIDIqYzEwLngqYzEyLngqYzIwLnkqYzEyLnkgKyAyKmMxMC55KmMyMC54KmMxMi54KmMxMi55ICsgYzExLngqYzIwLngqYzExLnkqYzEyLnkgK1xuICAgICAgICAgICAgYzExLngqYzExLnkqYzEyLngqYzIwLnkgLSAyKmMyMC54KmMxMi54KmMyMC55KmMxMi55IC0gMipjMTAueCpjMjAueCpjMTJ5MiArXG4gICAgICAgICAgICBjMTAueCpjMTF5MipjMTIueCArIGMxMC55KmMxMXgyKmMxMi55IC0gMipjMTAueSpjMTJ4MipjMjAueSAtXG4gICAgICAgICAgICBjMjAueCpjMTF5MipjMTIueCAtIGMxMXgyKmMyMC55KmMxMi55ICsgYzEweDIqYzEyeTIgKyBjMTB5MipjMTJ4MiArXG4gICAgICAgICAgICBjMjB4MipjMTJ5MiArIGMxMngyKmMyMHkyXG4gICAgKTtcbiAgICB2YXIgcm9vdHMgPSBwb2x5LmdldFJvb3RzSW5JbnRlcnZhbCgwLDEpO1xuXG4gICAgZm9yICggdmFyIGkgPSAwOyBpIDwgcm9vdHMubGVuZ3RoOyBpKysgKSB7XG4gICAgICAgIHZhciBzID0gcm9vdHNbaV07XG4gICAgICAgIHZhciB4Um9vdHMgPSBuZXcgUG9seW5vbWlhbChcbiAgICAgICAgICAgIGMxMi54LFxuICAgICAgICAgICAgYzExLngsXG4gICAgICAgICAgICBjMTAueCAtIGMyMC54IC0gcypjMjEueCAtIHMqcypjMjIueCAtIHMqcypzKmMyMy54XG4gICAgICAgICkuZ2V0Um9vdHMoKTtcbiAgICAgICAgdmFyIHlSb290cyA9IG5ldyBQb2x5bm9taWFsKFxuICAgICAgICAgICAgYzEyLnksXG4gICAgICAgICAgICBjMTEueSxcbiAgICAgICAgICAgIGMxMC55IC0gYzIwLnkgLSBzKmMyMS55IC0gcypzKmMyMi55IC0gcypzKnMqYzIzLnlcbiAgICAgICAgKS5nZXRSb290cygpO1xuXG4gICAgICAgIGlmICggeFJvb3RzLmxlbmd0aCA+IDAgJiYgeVJvb3RzLmxlbmd0aCA+IDAgKSB7XG4gICAgICAgICAgICB2YXIgVE9MRVJBTkNFID0gMWUtNDtcblxuICAgICAgICAgICAgY2hlY2tSb290czpcbiAgICAgICAgICAgIGZvciAoIHZhciBqID0gMDsgaiA8IHhSb290cy5sZW5ndGg7IGorKyApIHtcbiAgICAgICAgICAgICAgICB2YXIgeFJvb3QgPSB4Um9vdHNbal07XG4gICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgaWYgKCAwIDw9IHhSb290ICYmIHhSb290IDw9IDEgKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAoIHZhciBrID0gMDsgayA8IHlSb290cy5sZW5ndGg7IGsrKyApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICggTWF0aC5hYnMoIHhSb290IC0geVJvb3RzW2tdICkgPCBUT0xFUkFOQ0UgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnBvaW50cy5wdXNoKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjMjMubXVsdGlwbHkocypzKnMpLmFkZChjMjIubXVsdGlwbHkocypzKS5hZGQoYzIxLm11bHRpcGx5KHMpLmFkZChjMjApKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIGNoZWNrUm9vdHM7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoIHJlc3VsdC5wb2ludHMubGVuZ3RoID4gMCApIHJlc3VsdC5zdGF0dXMgPSBcIkludGVyc2VjdGlvblwiO1xuXG4gICAgcmV0dXJuIHJlc3VsdDtcblxufTtcblxuXG4vKioqKipcbipcbiogICBpbnRlcnNlY3RCZXppZXIyQ2lyY2xlXG4qXG4qKioqKi9cbkludGVyc2VjdGlvbi5pbnRlcnNlY3RCZXppZXIyQ2lyY2xlID0gZnVuY3Rpb24ocDEsIHAy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vblwiO1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQuYXBwZW5kUG9pbnQoIHA2ICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmICggYTEueSA9PSBhMi55ICkge1xuICAgICAgICAgICAgICAgIGlmICggbWluLnggPD0gcDYueCAmJiBwNi54IDw9IG1heC54ICkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQuc3RhdHVzID0gXCJJbnRlcnNlY3Rpb25cIjtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZFBvaW50KCBwNiApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHA2Lmd0ZShtaW4pICYmIHA2Lmx0ZShtYXgpICkge1xuICAgICAgICAgICAgICAgIHJlc3VsdC5zdGF0dXMgPSBcIkludGVyc2VjdGlvblwiO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5hcHBlbmRQb2ludCggcDYgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiByZXN1bHQ7XG59O1xuXG5cbi8qKioqKlxuKlxuKiAgIGludGVyc2VjdEJlemllcjJQb2x5Z29uXG4qXG4qKioqKi9cbkludGVyc2VjdGlvbi5pbnRlcnNlY3RCZXppZXIyUG9seWdvbiA9IGZ1bmN0aW9uKHAxLCBwMiwgcDMsIHBvaW50cykge1xuICAgIHZhciByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiTm8gSW50ZXJzZWN0aW9uXCIpO1xuICAgIHZhciBsZW5ndGggPSBwb2ludHMubGVuZ3RoO1xuXG4gICAgZm9yICggdmFyIGkgPSAwOyBpIDwgbGVuZ3RoOyBpKysgKSB7XG4gICAgICAgIHZhciBhMSA9IHBvaW50c1tpXTtcbiAgICAgICAgdmFyIGEyID0gcG9pbnRzWyhpKzEpICUgbGVuZ3RoXTtcbiAgICAgICAgdmFyIGludGVyID0gSW50ZXJzZW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zLng7XG4gICAgdmFyIGMyM3gzID0gYzIzLngqYzIzLngqYzIzLng7XG4gICAgdmFyIGMyM3kyID0gYzIzLnkqYzIzLnk7XG4gICAgdmFyIGMyM3kzID0gYzIzLnkqYzIzLnkqYzIzLnk7XG4gICAgdmFyIHBvbHkgPSBuZXcgUG9seW5vbWlhbChcbiAgICAgICAgLWMxM3gzKmMyM3kzICsgYzEzeTMqYzIzeDMgLSAzKmMxMy54KmMxM3kyKmMyM3gyKmMyMy55ICtcbiAgICAgICAgICAgIDMqYzEzeDIqYzEzLnkqYzIzLngqYzIzeTIsXG4gICAgICAgIC02KmMxMy54KmMyMi54KmMxM3kyKmMyMy54KmMyMy55ICsgNipjMTN4MipjMTMueSpjMjIueSpjMjMueCpjMjMueSArIDMqYzIyLngqYzEzeTMqYzIzeDIgLVxuICAgICAgICAgICAgMypjMTN4MypjMjIueSpjMjN5MiAtIDMqYzEzLngqYzEzeTIqYzIyLnkqYzIzeDIgKyAzKmMxM3gyKmMyMi54KmMxMy55KmMyM3kyLFxuICAgICAgICAtNipjMjEueCpjMTMueCpjMTN5MipjMjMueCpjMjMueSAtIDYqYzEzLngqYzIyLngqYzEzeTIqYzIyLnkqYzIzLnggKyA2KmMxM3gyKmMyMi54KmMxMy55KmMyMi55KmMyMy55ICtcbiAgICAgICAgICAgIDMqYzIxLngqYzEzeTMqYzIzeDIgKyAzKmMyMngyKmMxM3kzKmMyMy54ICsgMypjMjEueCpjMTN4MipjMTMueSpjMjN5MiAtIDMqYzEzLngqYzIxLnkqYzEzeTIqYzIzeDIgLVxuICAgICAgICAgICAgMypjMTMueCpjMjJ4MipjMTN5MipjMjMueSArIGMxM3gyKmMxMy55KmMyMy54Kig2KmMyMS55KmMyMy55ICsgMypjMjJ5MikgKyBjMTN4MyooLWMyMS55KmMyM3kyIC1cbiAgICAgICAgICAgIDIqYzIyeTIqYzIzLnkgLSBjMjMueSooMipjMjEueSpjMjMueSArIGMyMnkyKSksXG4gICAgICAgIGMxMS54KmMxMi55KmMxMy54KmMxMy55KmMyMy54KmMyMy55IC0gYzExLnkqYzEyLngqYzEzLngqYzEzLnkqYzIzLngqYzIzLnkgKyA2KmMyMS54KmMyMi54KmMxM3kzKmMyMy54ICtcbiAgICAgICAgICAgIDMqYzExLngqYzEyLngqYzEzLngqYzEzLnkqYzIzeTIgKyA2KmMxMC54KmMxMy54KmMxM3kyKmMyMy54KmMyMy55IC0gMypjMTEueCpjMTIueCpjMTN5MipjMjMueCpjMjMueSAtXG4gICAgICAgICAgICAzKmMxMS55KmMxMi55KmMxMy54KmMxMy55KmMyM3gyIC0gNipjMTAueSpjMTN4MipjMTMueSpjMjMueCpjMjMueSAtIDYqYzIwLngqYzEzLngqYzEzeTIqYzIzLngqYzIzLnkgK1xuICAgICAgICAgICAgMypjMTEueSpjMTIueSpjMTN4MipjMjMueCpjMjMueSAtIDIqYzEyLngqYzEyeTIqYzEzLngqYzIzLngqYzIzLnkgLSA2KmMyMS54KmMxMy54KmMyMi54KmMxM3kyKmMyMy55IC1cbiAgICAgICAgICAgIDYqYzIxLngqYzEzLngqYzEzeTIqYzIyLnkqYzIzLnggLSA2KmMxMy54KmMyMS55KmMyMi54KmMxM3kyKmMyMy54ICsgNipjMjEueCpjMTN4MipjMTMueSpjMjIueSpjMjMueSArXG4gICAgICAgICAgICAyKmMxMngyKmMxMi55KmMxMy55KmMyMy54KmMyMy55ICsgYzIyeDMqYzEzeTMgLSAzKmMxMC54KmMxM3kzKmMyM3gyICsgMypjMTAueSpjMTN4MypjMjN5MiArXG4gICAgICAgICAgICAzKmMyMC54KmMxM3kzKmMyM3gyICsgYzEyeTMqYzEzLngqYzIzeDIgLSBjMTJ4MypjMTMueSpjMjN5MiAtIDMqYzEwLngqYzEzeDIqYzEzLnkqYzIzeTIgK1xuICAgICAgICAgICAgMypjMTAueSpjMTMueCpjMTN5MipjMjN4MiAtIDIqYzExLngqYzEyLnkqYzEzeDIqYzIzeTIgKyBjMTEueCpjMTIueSpjMTN5MipjMjN4MiAtIGMxMS55KmMxMi54KmMxM3gyKmMyM3kyICtcbiAgICAgICAgICAgIDIqYzExLnkqYzEyLngqYzEzeTIqYzIzeDIgKyAzKmMyMC54KmMxM3gyKmMxMy55KmMyM3kyIC0gYzEyLngqYzEyeTIqYzEzLnkqYzIzeDIgLVxuICAgICAgICAgICAgMypjMjAueSpjMTMueCpjMTN5MipjMjN4MiArIGMxMngyKmMxMi55KmMxMy54KmMyM3kyIC0gMypjMTMueCpjMjJ4MipjMTN5MipjMjIueSArXG4gICAgICAgICAgICBjMTN4MipjMTMueSpjMjMueCooNipjMjAueSpjMjMueSArIDYqYzIxLnkqYzIyLnkpICsgYzEzeDIqYzIyLngqYzEzLnkqKDYqYzIxLnkqYzIzLnkgKyAzKmMyMnkyKSArXG4gICAgICAgICAgICBjMTN4MyooLTIqYzIxLnkqYzIyLnkqYzIzLnkgLSBjMjAueSpjMjN5MiAtIGMyMi55KigyKmMyMS55KmMyMy55ICsgYzIyeTIpIC0gYzIzLnkqKDIqYzIwLnkqYzIzLnkgKyAyKmMyMS55KmMyMi55KSksXG4gICAgICAgIDYqYzExLngqYzEyLngqYzEzLngqYzEzLnkqYzIyLnkqYzIzLnkgKyBjMTEueCpjMTIueSpjMTMueCpjMjIueCpjMTMueSpjMjMueSArIGMxMS54KmMxMi55KmMxMy54KmMxMy55KmMyMi55KmMyMy54IC1cbiAgICAgICAgICAgIGMxMS55KmMxMi54KmMxMy54KmMyMi54KmMxMy55KmMyMy55IC0gYzExLnkqYzEyLngqYzEzLngqYzEzLnkqYzIyLnkqYzIzLnggLSA2KmMxMS55KmMxMi55KmMxMy54KmMyMi54KmMxMy55KmMyMy54IC1cbiAgICAgICAgICAgIDYqYzEwLngqYzIyLngqYzEzeTMqYzIzLnggKyA2KmMyMC54KmMyMi54KmMxM3kzKmMyMy54ICsgNipjMTAueSpjMTN4MypjMjIueSpjMjMueSArIDIqYzEyeTMqYzEzLngqYzIyLngqYzIzLnggLVxuICAgICAgICAgICAgMipjMTJ4MypjMTMueSpjMjIueSpjMjMueSArIDYqYzEwLngqYzEzLngqYzIyLngqYzEzeTIqYzIzLnkgKyA2KmMxMC54KmMxMy54KmMxM3kyKmMyMi55KmMyMy54ICtcbiAgICAgICAgICAgIDYqYzEwLnkqYzEzLngqYzIyLngqYzEzeTIqYzIzLnggLSAzKmMxMS54KmMxMi54KmMyMi54KmMxM3kyKmMyMy55IC0gMypjMTEueCpjMTIueCpjMTN5MipjMjIueSpjMjMueCArXG4gICAgICAgICAgICAyKmMxMS54KmMxMi55KmMyMi54KmMxM3kyKmMyMy54ICsgNCpjMTEueSpjMTIueCpjMjIueCpjMTN5MipjMjMueCAtIDYqYzEwLngqYzEzeDIqYzEzLnkqYzIyLnkqYzIzLnkgLVxuICAgICAgICAgICAgNipjMTAueSpjMTN4MipjMjIueCpjMTMueSpjMjMueSAtIDYqYzEwLnkqYzEzeDIqYzEzLnkqYzIyLnkqYzIzLnggLSA0KmMxMS54KmMxMi55KmMxM3gyKmMyMi55KmMyMy55IC1cbiAgICAgICAgICAgIDYqYzIwLngqYzEzLngqYzIyLngqYzEzeTIqYzIzLnkgLSA2KmMyMC54KmMxMy54KmMxM3kyKmMyMi55KmMyMy54IC0gMipjMTEueSpjMTIueCpjMTN4MipjMjIueSpjMjMueSArXG4gICAgICAgICAgICAzKmMxMS55KmMxMi55KmMxM3gyKmMyMi54KmMyMy55ICsgMypjMTEueSpjMTIueSpjMTN4MipjMjIueSpjMjMueCAtIDIqYzEyLngqYzEyeTIqYzEzLngqYzIyLngqYzIzLnkgLVxuICAgICAgICAgICAgMipjMTIueCpjMTJ5MipjMTMueCpjMjIueSpjMjMueCAtIDIqYzEyLngqYzEyeTIqYzIyLngqYzEzLnkqYzIzLnggLSA2KmMyMC55KmMxMy54KmMyMi54KmMxM3kyKmMyMy54IC1cbiAgICAgICAgICAgIDYqYzIxLngqYzEzLngqYzIxLnkqYzEzeTIqYzIzLnggLSA2KmMyMS54KmMxMy54KmMyMi54KmMxM3kyKmMyMi55ICsgNipjMjAueCpjMTN4MipjMTMueSpjMjIueSpjMjMueSArXG4gICAgICAgICAgICAyKmMxMngyKmMxMi55KmMxMy54KmMyMi55KmMyMy55ICsgMipjMTJ4MipjMTIueSpjMjIueCpjMTMueSpjMjMueSArIDIqYzEyeDIqYzEyLnkqYzEzLnkqYzIyLnkqYzIzLnggK1xuICAgICAgICAgICAgMypjMjEueCpjMjJ4MipjMTN5MyArIDMqYzIxeDIqYzEzeTMqYzIzLnggLSAzKmMxMy54KmMyMS55KmMyMngyKmMxM3kyIC0gMypjMjF4MipjMTMueCpjMTN5MipjMjMueSArXG4gICAgICAgICAgICBjMTN4MipjMjIueCpjMTMueSooNipjMjAueSpjMjMueSArIDYqYzIxLnkqYzIyLnkpICsgYzEzeDIqYzEzLnkqYzIzLngqKDYqYzIwLnkqYzIyLnkgKyAzKmMyMXkyKSArXG4gICAgICAgICAgICBjMjEueCpjMTN4MipjMTMueSooNipjMjEueSpjMjMueSArIDMqYzIyeTIpICsgYzEzeDMqKC0yKmMyMC55KmMyMi55KmMyMy55IC0gYzIzLnkqKDIqYzIwLnkqYzIyLnkgKyBjMjF5MikgLVxuICAgICAgICAgICAgYzIxLnkqKDIqYzIxLnkqYzIzLnkgKyBjMjJ5MikgLSBjMjIueSooMipjMjAueSpjMjMueSArIDIqYzIxLnkqYzIyLnkpKSxcbiAgICAgICAgYzExLngqYzIxLngqYzEyLnkqYzEzLngqYzEzLnkqYzIzLnkgKyBjMTEueCpjMTIueSpjMTMueCpjMjEueSpjMTMueSpjMjMueCArIGMxMS54KmMxMi55KmMxMy54KmMyMi54KmMxMy55KmMyMi55IC1cbiAgICAgICAgICAgIGMxMS55KmMxMi54KmMyMS54KmMxMy54KmMxMy55KmMyMy55IC0gYzExLnkqYzEyLngqYzEzLngqYzIxLnkqYzEzLnkqYzIzLnggLSBjMTEueSpjMTIueCpjMTMueCpjMjIueCpjMTMueSpjMjIueSAtXG4gICAgICAgICAgICA2KmMxMS55KmMyMS54KmMxMi55KmMxMy54KmMxMy55KmMyMy54IC0gNipjMTAueCpjMjEueCpjMTN5MypjMjMueCArIDYqYzIwLngqYzIxLngqYzEzeTMqYzIzLnggK1xuICAgICAgICAgICAgMipjMjEueCpjMTJ5MypjMTMueCpjMjMueCArIDYqYzEwLngqYzIxLngqYzEzLngqYzEzeTIqYzIzLnkgKyA2KmMxMC54KmMxMy54KmMyMS55KmMxM3kyKmMyMy54ICtcbiAgICAgICAgICAgIDYqYzEwLngqYzEzLngqYzIyLngqYzEzeTIqYzIyLnkgKyA2KmMxMC55KmMyMS54KmMxMy54KmMxM3kyKmMyMy54IC0gMypjMTEueCpjMTIueCpjMjEueCpjMTN5MipjMjMueSAtXG4gICAgICAgICAgICAzKmMxMS54KmMxMi54KmMyMS55KmMxM3kyKmMyMy54IC0gMypjMTEueCpjMTIueCpjMjIueCpjMTN5MipjMjIueSArIDIqYzExLngqYzIxLngqYzEyLnkqYzEzeTIqYzIzLnggK1xuICAgICAgICAgICAgNCpjMTEueSpjMTIueCpjMjEueCpjMTN5MipjMjMueCAtIDYqYzEwLnkqYzIxLngqYzEzeDIqYzEzLnkqYzIzLnkgLSA2KmMxMC55KmMxM3gyKmMyMS55KmMxMy55KmMyMy54IC1cbiAgICAgICAgICAgIDYqYzEwLnkqYzEzeDIqYzIyLngqYzEzLnkqYzIyLnkgLSA2KmMyMC54KmMyMS54KmMxMy54KmMxM3kyKmMyMy55IC0gNipjMjAueCpjMTMueCpjMjEueSpjMTN5MipjMjMueCAtXG4gICAgICAgICAgICA2KmMyMC54KmMxMy54KmMyMi54KmMxM3kyKmMyMi55ICsgMypjMTEueSpjMjEueCpjMTIueSpjMTN4MipjMjMueSAtIDMqYzExLnkqYzEyLnkqYzEzLngqYzIyeDIqYzEzLnkgK1xuICAgICAgICAgICAgMypjMTEueSpjMTIueSpjMTN4MipjMjEueSpjMjMueCArIDMqYzExLnkqYzEyLnkqYzEzeDIqYzIyLngqYzIyLnkgLSAyKmMxMi54KmMyMS54KmMxMnkyKmMxMy54KmMyMy55IC1cbiAgICAgICAgICAgIDIqYzEyLngqYzIxLngqYzEyeTIqYzEzLnkqYzIzLnggLSAyKmMxMi54KmMxMnkyKmMxMy54KmMyMS55KmMyMy54IC0gMipjMTIueCpjMTJ5MipjMTMueCpjMjIueCpjMjIueSAtXG4gICAgICAgICAgICA2KmMyMC55KmMyMS54KmMxMy54KmMxM3kyKmMyMy54IC0gNipjMjEueCpjMTMueCpjMjEueSpjMjIueCpjMTN5MiArIDYqYzIwLnkqYzEzeDIqYzIxLnkqYzEzLnkqYzIzLnggK1xuICAgICAgICAgICAgMipjMTJ4MipjMjEueCpjMTIueSpjMTMueSpjMjMueSArIDIqYzEyeDIqYzEyLnkqYzIxLnkqYzEzLnkqYzIzLnggKyAyKmMxMngyKmMxMi55KmMyMi54KmMxMy55KmMyMi55IC1cbiAgICAgICAgICAgIDMqYzEwLngqYzIyeDIqYzEzeTMgKyAzKmMyMC54KmMyMngyKmMxM3kzICsgMypjMjF4MipjMjIueCpjMTN5MyArIGMxMnkzKmMxMy54KmMyMngyICtcbiAgICAgICAgICAgIDMqYzEwLnkqYzEzLngqYzIyeDIqYzEzeTIgKyBjMTEueCpjMTIueSpjMjJ4MipjMTN5MiArIDIqYzExLnkqYzEyLngqYzIyeDIqYzEzeTIgLVxuICAgICAgICAgICAgYzEyLngqYzEyeTIqYzIyeDIqYzEzLnkgLSAzKmMyMC55KmMxMy54KmMyMngyKmMxM3kyIC0gMypjMjF4MipjMTMueCpjMTN5MipjMjIueSArXG4gICAgICAgICAgICBjMTJ4MipjMTIueSpjMTMueCooMipjMjEueSpjMjMueSArIGMyMnkyKSArIGMxMS54KmMxMi54KmMxMy54KmMxMy55Kig2KmMyMS55KmMyMy55ICsgMypjMjJ5MikgK1xuICAgICAgICAgICAgYzIxLngqYzEzeDIqYzEzLnkqKDYqYzIwLnkqYzIzLnkgKyA2KmMyMS55KmMyMi55KSArIGMxMngzKmMxMy55KigtMipjMjEueSpjMjMueSAtIGMyMnkyKSArXG4gICAgICAgICAgICBjMTAueSpjMTN4MyooNipjMjEueSpjMjMueSArIDMqYzIyeTIpICsgYzExLnkqYzEyLngqYzEzeDIqKC0yKmMyMS55KmMyMy55IC0gYzIyeTIpICtcbiAgICAgICAgICAgIGMxMS54KmMxMi55KmMxM3gyKigtNCpjMjEueSpjMjMueSAtIDIqYzIyeTIpICsgYzEwLngqYzEzeDIqYzEzLnkqKC02KmMyMS55KmMyMy55IC0gMypjMjJ5MikgK1xuICAgICAgICAgICAgYzEzeDIqYzIyLngqYzEzLnkqKDYqYzIwLnkqYzIyLnkgKyAzKmMyMXkyKSArIGMyMC54KmMxM3gyKmMxMy55Kig2KmMyMS55KmMyMy55ICsgMypjMjJ5MikgK1xuICAgICAgICAgICAgYzEzeDMqKC0yKmMyMC55KmMyMS55KmMyMy55IC0gYzIyLnkqKDIqYzIwLnkqYzIyLnkgKyBjMjF5MikgLSBjMjAueSooMipjMjEueSpjMjMueSArIGMyMnkyKSAtXG4gICAgICAgICAgICBjMjEueSooMipjMjAueSpjMjMueSArIDIqYzIxLnkqYzIyLnkpKSxcbiAgICAgICAgLWMxMC54KmMxMS54KmMxMi55KmMxMy54KmMxMy55KmMyMy55ICsgYzEwLngqYzExLnkqYzEyLngqYzEzLngqYzEzLnkqYzIzLnkgKyA2KmMxMC54KmMxMS55KmMxMi55KmMxMy54KmMxMy55KmMyMy54IC1cbiAgICAgICAgICAgIDYqYzEwLnkqYzExLngqYzEyLngqYzEzLngqYzEzLnkqYzIzLnkgLSBjMTAueSpjMTEueCpjMTIueSpjMTMueCpjMTMueSpjMjMueCArIGMxMC55KmMxMS55KmMxMi54KmMxMy54KmMxMy55KmMyMy54ICtcbiAgICAgICAgICAgIGMxMS54KmMxMS55KmMxMi54KmMxMi55KmMxMy54KmMyMy55IC0gYzExLngqYzExLnkqYzEyLngqYzEyLnkqYzEzLnkqYzIzLnggKyBjMTEueCpjMjAueCpjMTIueSpjMTMueCpjMTMueSpjMjMueSArXG4gICAgICAgICAgICBjMTEueCpjMjAueSpjMTIueSpjMTMueCpjMTMueSpjMjMueCArIGMxMS54KmMyMS54KmMxMi55KmMxMy54KmMxMy55KmMyMi55ICsgYzExLngqYzEyLnkqYzEzLngqYzIxLnkqYzIyLngqYzEzLnkgLVxuICAgICAgICAgICAgYzIwLngqYzExLnkqYzEyLngqYzEzLngqYzEzLnkqYzIzLnkgLSA2KmMyMC54KmMxMS55KmMxMi55KmMxMy54KmMxMy55KmMyMy54IC0gYzExLnkqYzEyLngqYzIwLnkqYzEzLngqYzEzLnkqYzIzLnggLVxuICAgICAgICAgICAgYzExLnkqYzEyLngqYzIxLngqYzEzLngqYzEzLnkqYzIyLnkgLSBjMTEueSpjMTIueCpjMTMueCpjMjEueSpjMjIueCpjMTMueSAtIDYqYzExLnkqYzIxLngqYzEyLnkqYzEzLngqYzIyLngqYzEzLnkgLVxuICAgICAgICAgICAgNipjMTAueCpjMjAueCpjMTN5MypjMjMueCAtIDYqYzEwLngqYzIxLngqYzIyLngqYzEzeTMgLSAyKmMxMC54KmMxMnkzKmMxMy54KmMyMy54ICsgNipjMjAueCpjMjEueCpjMjIueCpjMTN5MyArXG4gICAgICAgICAgICAyKmMyMC54KmMxMnkzKmMxMy54KmMyMy54ICsgMipjMjEueCpjMTJ5MypjMTMueCpjMjIueCArIDIqYzEwLnkqYzEyeDMqYzEzLnkqYzIzLnkgLSA2KmMxMC54KmMxMC55KmMxMy54KmMxM3kyKmMyMy54ICtcbiAgICAgICAgICAgIDMqYzEwLngqYzExLngqYzEyLngqYzEzeTIqYzIzLnkgLSAyKmMxMC54KmMxMS54KmMxMi55KmMxM3kyKmMyMy54IC0gNCpjMTAueCpjMTEueSpjMTIueCpjMTN5MipjMjMueCArXG4gICAgICAgICAgICAzKmMxMC55KmMxMS54KmMxMi54KmMxM3kyKmMyMy54ICsgNipjMTAueCpjMTAueSpjMTN4MipjMTMueSpjMjMueSArIDYqYzEwLngqYzIwLngqYzEzLngqYzEzeTIqYzIzLnkgLVxuICAgICAgICAgICAgMypjMTAueCpjMTEueSpjMTIueSpjMTN4MipjMjMueSArIDIqYzEwLngqYzEyLngqYzEyeTIqYzEzLngqYzIzLnkgKyAyKmMxMC54KmMxMi54KmMxMnkyKmMxMy55KmMyMy54ICtcbiAgICAgICAgICAgIDYqYzEwLngqYzIwLnkqYzEzLngqYzEzeTIqYzIzLnggKyA2KmMxMC54KmMyMS54KmMxMy54KmMxM3kyKmMyMi55ICsgNipjMTAueCpjMTMueCpjMjEueSpjMjIueCpjMTN5MiArXG4gICAgICAgICAgICA0KmMxMC55KmMxMS54KmMxMi55KmMxM3gyKmMyMy55ICsgNipjMTAueSpjMjAueCpjMTMueCpjMTN5MipjMjMueCArIDIqYzEwLnkqYzExLnkqYzEyLngqYzEzeDIqYzIzLnkgLVxuICAgICAgICAgICAgMypjMTAueSpjMTEueSpjMTIueSpjMTN4MipjMjMueCArIDIqYzEwLnkqYzEyLngqYzEyeTIqYzEzLngqYzIzLnggKyA2KmMxMC55KmMyMS54KmMxMy54KmMyMi54KmMxM3kyIC1cbiAgICAgICAgICAgIDMqYzExLngqYzIwLngqYzEyLngqYzEzeTIqYzIzLnkgKyAyKmMxMS54KmMyMC54KmMxMi55KmMxM3kyKmMyMy54ICsgYzExLngqYzExLnkqYzEyeTIqYzEzLngqYzIzLnggLVxuICAgICAgICAgICAgMypjMTEueCpjMTIueCpjMjAueSpjMTN5MipjMjMueCAtIDMqYzExLngqYzEyLngqYzIxLngqYzEzeTIqYzIyLnkgLSAzKmMxMS54KmMxMi54KmMyMS55KmMyMi54KmMxM3kyICtcbiAgICAgICAgICAgIDIqYzExLngqYzIxLngqYzEyLnkqYzIyLngqYzEzeTIgKyA0KmMyMC54KmMxMS55KmMxMi54KmMxM3kyKmMyMy54ICsgNCpjMTEueSpjMTIueCpjMjEueCpjMjIueCpjMTN5MiAtXG4gICAgICAgICAgICAyKmMxMC54KmMxMngyKmMxMi55KmMxMy55KmMyMy55IC0gNipjMTAueSpjMjAueCpjMTN4MipjMTMueSpjMjMueSAtIDYqYzEwLnkqYzIwLnkqYzEzeDIqYzEzLnkqYzIzLnggLVxuICAgICAgICAgICAgNipjMTAueSpjMjEueCpjMTN4MipjMTMueSpjMjIueSAtIDIqYzEwLnkqYzEyeDIqYzEyLnkqYzEzLngqYzIzLnkgLSAyKmMxMC55KmMxMngyKmMxMi55KmMxMy55KmMyMy54IC1cbiAgICAgICAgICAgIDYqYzEwLnkqYzEzeDIqYzIxLnkqYzIyLngqYzEzLnkgLSBjMTEueCpjMTEueSpjMTJ4MipjMTMueSpjMjMueSAtIDIqYzExLngqYzExeTIqYzEzLngqYzEzLnkqYzIzLnggK1xuICAgICAgICAgICAgMypjMjAueCpjMTEueSpjMTIueSpjMTN4MipjMjMueSAtIDIqYzIwLngqYzEyLngqYzEyeTIqYzEzLngqYzIzLnkgLSAyKmMyMC54KmMxMi54KmMxMnkyKmMxMy55KmMyMy54IC1cbiAgICAgICAgICAgIDYqYzIwLngqYzIwLnkqYzEzLngqYzEzeTIqYzIzLnggLSA2KmMyMC54KmMyMS54KmMxMy54KmMxM3kyKmMyMi55IC0gNipjMjAueCpjMTMueCpjMjEueSpjMjIueCpjMTN5MiArXG4gICAgICAgICAgICAzKmMxMS55KmMyMC55KmMxMi55KmMxM3gyKmMyMy54ICsgMypjMTEueSpjMjEueCpjMTIueSpjMTN4MipjMjIueSArIDMqYzExLnkqYzEyLnkqYzEzeDIqYzIxLnkqYzIyLnggLVxuICAgICAgICAgICAgMipjMTIueCpjMjAueSpjMTJ5MipjMTMueCpjMjMueCAtIDIqYzEyLngqYzIxLngqYzEyeTIqYzEzLngqYzIyLnkgLSAyKmMxMi54KmMyMS54KmMxMnkyKmMyMi54KmMxMy55IC1cbiAgICAgICAgICAgIDIqYzEyLngqYzEyeTIqYzEzLngqYzIxLnkqYzIyLnggLSA2KmMyMC55KmMyMS54KmMxMy54KmMyMi54KmMxM3kyIC0gYzExeTIqYzEyLngqYzEyLnkqYzEzLngqYzIzLnggK1xuICAgICAgICAgICAgMipjMjAueCpjMTJ4MipjMTIueSpjMTMueSpjMjMueSArIDYqYzIwLnkqYzEzeDIqYzIxLnkqYzIyLngqYzEzLnkgKyAyKmMxMXgyKmMxMS55KmMxMy54KmMxMy55KmMyMy55ICtcbiAgICAgICAgICAgIGMxMXgyKmMxMi54KmMxMi55KmMxMy55KmMyMy55ICsgMipjMTJ4MipjMjAueSpjMTIueSpjMTMueSpjMjMueCArIDIqYzEyeDIqYzIxLngqYzEyLnkqYzEzLnkqYzIyLnkgK1xuICAgICAgICAgICAgMipjMTJ4MipjMTIueSpjMjEueSpjMjIueCpjMTMueSArIGMyMXgzKmMxM3kzICsgMypjMTB4MipjMTN5MypjMjMueCAtIDMqYzEweTIqYzEzeDMqYzIzLnkgK1xuICAgICAgICAgICAgMypjMjB4MipjMTN5MypjMjMueCArIGMxMXkzKmMxM3gyKmMyMy54IC0gYzExeDMqYzEzeTIqYzIzLnkgLSBjMTEueCpjMTF5MipjMTN4MipjMjMueSArXG4gICAgICAgICAgICBjMTF4MipjMTEueSpjMTN5MipjMjMueCAtIDMqYzEweDIqYzEzLngqYzEzeTIqYzIzLnkgKyAzKmMxMHkyKmMxM3gyKmMxMy55KmMyMy54IC0gYzExeDIqYzEyeTIqYzEzLngqYzIzLnkgK1xuICAgICAgICAgICAgYzExeTIqYzEyeDIqYzEzLnkqYzIzLnggLSAzKmMyMXgyKmMxMy54KmMyMS55KmMxM3kyIC0gMypjMjB4MipjMTMueCpjMTN5MipjMjMueSArIDMqYzIweTIqYzEzeDIqYzEzLnkqYzIzLnggK1xuICAgICAgICAgICAgYzExLngqYzEyLngqYzEzLngqYzEzLnkqKDYqYzIwLnkqYzIzLnkgKyA2KmMyMS55KmMyMi55KSArIGMxMngzKmMxMy55KigtMipjMjAueSpjMjMueSAtIDIqYzIxLnkqYzIyLnkpICtcbiAgICAgICAgICAgIGMxMC55KmMxM3gzKig2KmMyMC55KmMyMy55ICsgNipjMjEueSpjMjIueSkgKyBjMTEueSpjMTIueCpjMTN4MiooLTIqYzIwLnkqYzIzLnkgLSAyKmMyMS55KmMyMi55KSArXG4gICAgICAgICAgICBjMTJ4MipjMTIueSpjMTMueCooMipjMjAueSpjMjMueSArIDIqYzIxLnkqYzIyLnkpICsgYzExLngqYzEyLnkqYzEzeDIqKC00KmMyMC55KmMyMy55IC0gNCpjMjEueSpjMjIueSkgK1xuICAgICAgICAgICAgYzEwLngqYzEzeDIqYzEzLnkqKC02KmMyMC55KmMyMy55IC0gNipjMjEueSpjMjIueSkgKyBjMjAueCpjMTN4MipjMTMueSooNipjMjAueSpjMjMueSArIDYqYzIxLnkqYzIyLnkpICtcbiAgICAgICAgICAgIGMyMS54KmMxM3gyKmMxMy55Kig2KmMyMC55KmMyMi55ICsgMypjMjF5MikgKyBjMTN4MyooLTIqYzIwLnkqYzIxLnkqYzIyLnkgLSBjMjB5MipjMjMueSAtXG4gICAgICAgICAgICBjMjEueSooMipjMjAueSpjMjIueSArIGMyMXkyKSAtIGMyMC55KigyKmMyMC55KmMyMy55ICsgMipjMjEueSpjMjIueSkpLFxuICAgICAgICAtYzEwLngqYzExLngqYzEyLnkqYzEzLngqYzEzLnkqYzIyLnkgKyBjMTAueCpjMTEueSpjMTIueCpjMTMueCpjMTMueSpjMjIueSArIDYqYzEwLngqYzExLnkqYzEyLnkqYzEzLngqYzIyLngqYzEzLnkgLVxuICAgICAgICAgICAgNipjMTAueSpjMTEueCpjMTIueCpjMTMueCpjMTMueSpjMjIueSAtIGMxMC55KmMxMS54KmMxMi55KmMxMy54KmMyMi54KmMxMy55ICsgYzEwLnkqYzExLnkqYzEyLngqYzEzLngqYzIyLngqYzEzLnkgK1xuICAgICAgICAgICAgYzExLngqYzExLnkqYzEyLngqYzEyLnkqYzEzLngqYzIyLnkgLSBjMTEueCpjMTEueSpjMTIueCpjMTIueSpjMjIueCpjMTMueSArIGMxMS54KmMyMC54KmMxMi55KmMxMy54KmMxMy55KmMyMi55ICtcbiAgICAgICAgICAgIGMxMS54KmMyMC55KmMxMi55KmMxMy54KmMyMi54KmMxMy55ICsgYzExLngqYzIxLngqYzEyLnkqYzEzLngqYzIxLnkqYzEzLnkgLSBjMjAueCpjMTEueSpjMTIueCpjMTMueCpjMTMueSpjMjIueSAtXG4gICAgICAgICAgICA2KmMyMC54KmMxMS55KmMxMi55KmMxMy54KmMyMi54KmMxMy55IC0gYzExLnkqYzEyLngqYzIwLnkqYzEzLngqYzIyLngqYzEzLnkgLSBjMTEueSpjMTIueCpjMjEueCpjMTMueCpjMjEueSpjMTMueSAtXG4gICAgICAgICAgICA2KmMxMC54KmMyMC54KmMyMi54KmMxM3kzIC0gMipjMTAueCpjMTJ5MypjMTMueCpjMjIueCArIDIqYzIwLngqYzEyeTMqYzEzLngqYzIyLnggKyAyKmMxMC55KmMxMngzKmMxMy55KmMyMi55IC1cbiAgICAgICAgICAgIDYqYzEwLngqYzEwLnkqYzEzLngqYzIyLngqYzEzeTIgKyAzKmMxMC54KmMxMS54KmMxMi54KmMxM3kyKmMyMi55IC0gMipjMTAueCpjMTEueCpjMTIueSpjMjIueCpjMTN5MiAtXG4gICAgICAgICAgICA0KmMxMC54KmMxMS55KmMxMi54KmMyMi54KmMxM3kyICsgMypjMTAueSpjMTEueCpjMTIueCpjMjIueCpjMTN5MiArIDYqYzEwLngqYzEwLnkqYzEzeDIqYzEzLnkqYzIyLnkgK1xuICAgICAgICAgICAgNipjMTAueCpjMjAueCpjMTMueCpjMTN5MipjMjIueSAtIDMqYzEwLngqYzExLnkqYzEyLnkqYzEzeDIqYzIyLnkgKyAyKmMxMC54KmMxMi54KmMxMnkyKmMxMy54KmMyMi55ICtcbiAgICAgICAgICAgIDIqYzEwLngqYzEyLngqYzEyeTIqYzIyLngqYzEzLnkgKyA2KmMxMC54KmMyMC55KmMxMy54KmMyMi54KmMxM3kyICsgNipjMTAueCpjMjEueCpjMTMueCpjMjEueSpjMTN5MiArXG4gICAgICAgICAgICA0KmMxMC55KmMxMS54KmMxMi55KmMxM3gyKmMyMi55ICsgNipjMTAueSpjMjAueCpjMTMueCpjMjIueCpjMTN5MiArIDIqYzEwLnkqYzExLnkqYzEyLngqYzEzeDIqYzIyLnkgLVxuICAgICAgICAgICAgMypjMTAueSpjMTEueSpjMTIueSpjMTN4MipjMjIueCArIDIqYzEwLnkqYzEyLngqYzEyeTIqYzEzLngqYzIyLnggLSAzKmMxMS54KmMyMC54KmMxMi54KmMxM3kyKmMyMi55ICtcbiAgICAgICAgICAgIDIqYzExLngqYzIwLngqYzEyLnkqYzIyLngqYzEzeTIgKyBjMTEueCpjMTEueSpjMTJ5MipjMTMueCpjMjIueCAtIDMqYzExLngqYzEyLngqYzIwLnkqYzIyLngqYzEzeTIgLVxuICAgICAgICAgICAgMypjMTEueCpjMTIueCpjMjEueCpjMjEueSpjMTN5MiArIDQqYzIwLngqYzExLnkqYzEyLngqYzIyLngqYzEzeTIgLSAyKmMxMC54KmMxMngyKmMxMi55KmMxMy55KmMyMi55IC1cbiAgICAgICAgICAgIDYqYzEwLnkqYzIwLngqYzEzeDIqYzEzLnkqYzIyLnkgLSA2KmMxMC55KmMyMC55KmMxM3gyKmMyMi54KmMxMy55IC0gNipjMTAueSpjMjEueCpjMTN4MipjMjEueSpjMTMueSAtXG4gICAgICAgICAgICAyKmMxMC55KmMxMngyKmMxMi55KmMxMy54KmMyMi55IC0gMipjMTAueSpjMTJ4MipjMTIueSpjMjIueCpjMTMueSAtIGMxMS54KmMxMS55KmMxMngyKmMxMy55KmMyMi55IC1cbiAgICAgICAgICAgIDIqYzExLngqYzExeTIqYzEzLngqYzIyLngqYzEzLnkgKyAzKmMyMC54KmMxMS55KmMxMi55KmMxM3gyKmMyMi55IC0gMipjMjAueCpjMTIueCpjMTJ5MipjMTMueCpjMjIueSAtXG4gICAgICAgICAgICAyKmMyMC54KmMxMi54KmMxMnkyKmMyMi54KmMxMy55IC0gNipjMjAueCpjMjAueSpjMTMueCpjMjIueCpjMTN5MiAtIDYqYzIwLngqYzIxLngqYzEzLngqYzIxLnkqYzEzeTIgK1xuICAgICAgICAgICAgMypjMTEueSpjMjAueSpjMTIueSpjMTN4MipjMjIueCArIDMqYzExLnkqYzIxLngqYzEyLnkqYzEzeDIqYzIxLnkgLSAyKmMxMi54KmMyMC55KmMxMnkyKmMxMy54KmMyMi54IC1cbiAgICAgICAgICAgIDIqYzEyLngqYzIxLngqYzEyeTIqYzEzLngqYzIxLnkgLSBjMTF5MipjMTIueCpjMTIueSpjMTMueCpjMjIueCArIDIqYzIwLngqYzEyeDIqYzEyLnkqYzEzLnkqYzIyLnkgLVxuICAgICAgICAgICAgMypjMTEueSpjMjF4MipjMTIueSpjMTMueCpjMTMueSArIDYqYzIwLnkqYzIxLngqYzEzeDIqYzIxLnkqYzEzLnkgKyAyKmMxMXgyKmMxMS55KmMxMy54KmMxMy55KmMyMi55ICtcbiAgICAgICAgICAgIGMxMXgyKmMxMi54KmMxMi55KmMxMy55KmMyMi55ICsgMipjMTJ4MipjMjAueSpjMTIueSpjMjIueCpjMTMueSArIDIqYzEyeDIqYzIxLngqYzEyLnkqYzIxLnkqYzEzLnkgLVxuICAgICAgICAgICAgMypjMTAueCpjMjF4MipjMTN5MyArIDMqYzIwLngqYzIxeDIqYzEzeTMgKyAzKmMxMHgyKmMyMi54KmMxM3kzIC0gMypjMTB5MipjMTN4MypjMjIueSArIDMqYzIweDIqYzIyLngqYzEzeTMgK1xuICAgICAgICAgICAgYzIxeDIqYzEyeTMqYzEzLnggKyBjMTF5MypjMTN4MipjMjIueCAtIGMxMXgzKmMxM3kyKmMyMi55ICsgMypjMTAueSpjMjF4MipjMTMueCpjMTN5MiAtXG4gICAgICAgICAgICBjMTEueCpjMTF5MipjMTN4MipjMjIueSArIGMxMS54KmMyMXgyKmMxMi55KmMxM3kyICsgMipjMTEueSpjMTIueCpjMjF4MipjMTN5MiArIGMxMXgyKmMxMS55KmMyMi54KmMxM3kyIC1cbiAgICAgICAgICAgIGMxMi54KmMyMXgyKmMxMnkyKmMxMy55IC0gMypjMjAueSpjMjF4MipjMTMueCpjMTN5MiAtIDMqYzEweDIqYzEzLngqYzEzeTIqYzIyLnkgKyAzKmMxMHkyKmMxM3gyKmMyMi54KmMxMy55IC1cbiAgICAgICAgICAgIGMxMXgyKmMxMnkyKmMxMy54KmMyMi55ICsgYzExeTIqYzEyeDIqYzIyLngqYzEzLnkgLSAzKmMyMHgyKmMxMy54KmMxM3kyKmMyMi55ICsgMypjMjB5MipjMTN4MipjMjIueCpjMTMueSArXG4gICAgICAgICAgICBjMTJ4MipjMTIueSpjMTMueCooMipjMjAueSpjMjIueSArIGMyMXkyKSArIGMxMS54KmMxMi54KmMxMy54KmMxMy55Kig2KmMyMC55KmMyMi55ICsgMypjMjF5MikgK1xuICAgICAgICAgICAgYzEyeDMqYzEzLnkqKC0yKmMyMC55KmMyMi55IC0gYzIxeTIpICsgYzEwLnkqYzEzeDMqKDYqYzIwLnkqYzIyLnkgKyAzKmMyMXkyKSArXG4gICAgICAgICAgICBjMTEueSpjMTIueCpjMTN4MiooLTIqYzIwLnkqYzIyLnkgLSBjMjF5MikgKyBjMTEueCpjMTIueSpjMTN4MiooLTQqYzIwLnkqYzIyLnkgLSAyKmMyMXkyKSArXG4gICAgICAgICAgICBjMTAueCpjMTN4MipjMTMueSooLTYqYzIwLnkqYzIyLnkgLSAzKmMyMXkyKSArIGMyMC54KmMxM3gyKmMxMy55Kig2KmMyMC55KmMyMi55ICsgMypjMjF5MikgK1xuICAgICAgICAgICAgYzEzeDMqKC0yKmMyMC55KmMyMXkyIC0gYzIweTIqYzIyLnkgLSBjMjAueSooMipjMjAueSpjMjIueSArIGMyMXkyKSksXG4gICAgICAgIC1jMTAueCpjMTEueCpjMTIueSpjMTMueCpjMjEueSpjMTMueSArIGMxMC54KmMxMS55KmMxMi54KmMxMy54KmMyMS55KmMxMy55ICsgNipjMTAueCpjMTEueSpjMjEueCpjMTIueSpjMTMueCpjMTMueSAtXG4gICAgICAgICAgICA2KmMxMC55KmMxMS54KmMxMi54KmMxMy54KmMyMS55KmMxMy55IC0gYzEwLnkqYzExLngqYzIxLngqYzEyLnkqYzEzLngqYzEzLnkgKyBjMTAueSpjMTEueSpjMTIueCpjMjEueCpjMTMueCpjMTMueSAtXG4gICAgICAgICAgICBjMTEueCpjMTEueSpjMTIueCpjMjEueCpjMTIueSpjMTMueSArIGMxMS54KmMxMS55KmMxMi54KmMxMi55KmMxMy54KmMyMS55ICsgYzExLngqYzIwLngqYzEyLnkqYzEzLngqYzIxLnkqYzEzLnkgK1xuICAgICAgICAgICAgNipjMTEueCpjMTIueCpjMjAueSpjMTMueCpjMjEueSpjMTMueSArIGMxMS54KmMyMC55KmMyMS54KmMxMi55KmMxMy54KmMxMy55IC0gYzIwLngqYzExLnkqYzEyLngqYzEzLngqYzIxLnkqYzEzLnkgLVxuICAgICAgICAgICAgNipjMjAueCpjMTEueSpjMjEueCpjMTIueSpjMTMueCpjMTMueSAtIGMxMS55KmMxMi54KmMyMC55KmMyMS54KmMxMy54KmMxMy55IC0gNipjMTAueCpjMjAueCpjMjEueCpjMTN5MyAtXG4gICAgICAgICAgICAyKmMxMC54KmMyMS54KmMxMnkzKmMxMy54ICsgNipjMTAueSpjMjAueSpjMTN4MypjMjEueSArIDIqYzIwLngqYzIxLngqYzEyeTMqYzEzLnggKyAyKmMxMC55KmMxMngzKmMyMS55KmMxMy55IC1cbiAgICAgICAgICAgIDIqYzEyeDMqYzIwLnkqYzIxLnkqYzEzLnkgLSA2KmMxMC54KmMxMC55KmMyMS54KmMxMy54KmMxM3kyICsgMypjMTAueCpjMTEueCpjMTIueCpjMjEueSpjMTN5MiAtXG4gICAgICAgICAgICAyKmMxMC54KmMxMS54KmMyMS54KmMxMi55KmMxM3kyIC0gNCpjMTAueCpjMTEueSpjMTIueCpjMjEueCpjMTN5MiArIDMqYzEwLnkqYzExLngqYzEyLngqYzIxLngqYzEzeTIgK1xuICAgICAgICAgICAgNipjMTAueCpjMTAueSpjMTN4MipjMjEueSpjMTMueSArIDYqYzEwLngqYzIwLngqYzEzLngqYzIxLnkqYzEzeTIgLSAzKmMxMC54KmMxMS55KmMxMi55KmMxM3gyKmMyMS55ICtcbiAgICAgICAgICAgIDIqYzEwLngqYzEyLngqYzIxLngqYzEyeTIqYzEzLnkgKyAyKmMxMC54KmMxMi54KmMxMnkyKmMxMy54KmMyMS55ICsgNipjMTAueCpjMjAueSpjMjEueCpjMTMueCpjMTN5MiArXG4gICAgICAgICAgICA0KmMxMC55KmMxMS54KmMxMi55KmMxM3gyKmMyMS55ICsgNipjMTAueSpjMjAueCpjMjEueCpjMTMueCpjMTN5MiArIDIqYzEwLnkqYzExLnkqYzEyLngqYzEzeDIqYzIxLnkgLVxuICAgICAgICAgICAgMypjMTAueSpjMTEueSpjMjEueCpjMTIueSpjMTN4MiArIDIqYzEwLnkqYzEyLngqYzIxLngqYzEyeTIqYzEzLnggLSAzKmMxMS54KmMyMC54KmMxMi54KmMyMS55KmMxM3kyICtcbiAgICAgICAgICAgIDIqYzExLngqYzIwLngqYzIxLngqYzEyLnkqYzEzeTIgKyBjMTEueCpjMTEueSpjMjEueCpjMTJ5MipjMTMueCAtIDMqYzExLngqYzEyLngqYzIwLnkqYzIxLngqYzEzeTIgK1xuICAgICAgICAgICAgNCpjMjAueCpjMTEueSpjMTIueCpjMjEueCpjMTN5MiAtIDYqYzEwLngqYzIwLnkqYzEzeDIqYzIxLnkqYzEzLnkgLSAyKmMxMC54KmMxMngyKmMxMi55KmMyMS55KmMxMy55IC1cbiAgICAgICAgICAgIDYqYzEwLnkqYzIwLngqYzEzeDIqYzIxLnkqYzEzLnkgLSA2KmMxMC55KmMyMC55KmMyMS54KmMxM3gyKmMxMy55IC0gMipjMTAueSpjMTJ4MipjMjEueCpjMTIueSpjMTMueSAtXG4gICAgICAgICAgICAyKmMxMC55KmMxMngyKmMxMi55KmMxMy54KmMyMS55IC0gYzExLngqYzExLnkqYzEyeDIqYzIxLnkqYzEzLnkgLSA0KmMxMS54KmMyMC55KmMxMi55KmMxM3gyKmMyMS55IC1cbiAgICAgICAgICAgIDIqYzExLngqYzExeTIqYzIxLngqYzEzLngqYzEzLnkgKyAzKmMyMC54KmMxMS55KmMxMi55KmMxM3gyKmMyMS55IC0gMipjMjAueCpjMTIueCpjMjEueCpjMTJ5MipjMTMueSAtXG4gICAgICAgICAgICAyKmMyMC54KmMxMi54KmMxMnkyKmMxMy54KmMyMS55IC0gNipjMjAueCpjMjAueSpjMjEueCpjMTMueCpjMTN5MiAtIDIqYzExLnkqYzEyLngqYzIwLnkqYzEzeDIqYzIxLnkgK1xuICAgICAgICAgICAgMypjMTEueSpjMjAueSpjMjEueCpjMTIueSpjMTN4MiAtIDIqYzEyLngqYzIwLnkqYzIxLngqYzEyeTIqYzEzLnggLSBjMTF5MipjMTIueCpjMjEueCpjMTIueSpjMTMueCArXG4gICAgICAgICAgICA2KmMyMC54KmMyMC55KmMxM3gyKmMyMS55KmMxMy55ICsgMipjMjAueCpjMTJ4MipjMTIueSpjMjEueSpjMTMueSArIDIqYzExeDIqYzExLnkqYzEzLngqYzIxLnkqYzEzLnkgK1xuICAgICAgICAgICAgYzExeDIqYzEyLngqYzEyLnkqYzIxLnkqYzEzLnkgKyAyKmMxMngyKmMyMC55KmMyMS54KmMxMi55KmMxMy55ICsgMipjMTJ4MipjMjAueSpjMTIueSpjMTMueCpjMjEueSArXG4gICAgICAgICAgICAzKmMxMHgyKmMyMS54KmMxM3kzIC0gMypjMTB5MipjMTN4MypjMjEueSArIDMqYzIweDIqYzIxLngqYzEzeTMgKyBjMTF5MypjMjEueCpjMTN4MiAtIGMxMXgzKmMyMS55KmMxM3kyIC1cbiAgICAgICAgICAgIDMqYzIweTIqYzEzeDMqYzIxLnkgLSBjMTEueCpjMTF5MipjMTN4MipjMjEueSArIGMxMXgyKmMxMS55KmMyMS54KmMxM3kyIC0gMypjMTB4MipjMTMueCpjMjEueSpjMTN5MiArXG4gICAgICAgICAgICAzKmMxMHkyKmMyMS54KmMxM3gyKmMxMy55IC0gYzExeDIqYzEyeTIqYzEzLngqYzIxLnkgKyBjMTF5MipjMTJ4MipjMjEueCpjMTMueSAtIDMqYzIweDIqYzEzLngqYzIxLnkqYzEzeTIgK1xuICAgICAgICAgICAgMypjMjB5MipjMjEueCpjMTN4MipjMTMueSxcbiAgICAgICAgYzEwLngqYzEwLnkqYzExLngqYzEyLnkqYzEzLngqYzEzLnkgLSBjMTAueCpjMTAueSpjMTEueSpjMTIueCpjMTMueCpjMTMueSArIGMxMC54KmMxMS54KmMxMS55KmMxMi54KmMxMi55KmMxMy55IC1cbiAgICAgICAgICAgIGMxMC55KmMxMS54KmMxMS55KmMxMi54KmMxMi55KmMxMy54IC0gYzEwLngqYzExLngqYzIwLnkqYzEyLnkqYzEzLngqYzEzLnkgKyA2KmMxMC54KmMyMC54KmMxMS55KmMxMi55KmMxMy54KmMxMy55ICtcbiAgICAgICAgICAgIGMxMC54KmMxMS55KmMxMi54KmMyMC55KmMxMy54KmMxMy55IC0gYzEwLnkqYzExLngqYzIwLngqYzEyLnkqYzEzLngqYzEzLnkgLSA2KmMxMC55KmMxMS54KmMxMi54KmMyMC55KmMxMy54KmMxMy55ICtcbiAgICAgICAgICAgIGMxMC55KmMyMC54KmMxMS55KmMxMi54KmMxMy54KmMxMy55IC0gYzExLngqYzIwLngqYzExLnkqYzEyLngqYzEyLnkqYzEzLnkgKyBjMTEueCpjMTEueSpjMTIueCpjMjAueSpjMTIueSpjMTMueCArXG4gICAgICAgICAgICBjMTEueCpjMjAueCpjMjAueSpjMTIueSpjMTMueCpjMTMueSAtIGMyMC54KmMxMS55KmMxMi54KmMyMC55KmMxMy54KmMxMy55IC0gMipjMTAueCpjMjAueCpjMTJ5MypjMTMueCArXG4gICAgICAgICAgICAyKmMxMC55KmMxMngzKmMyMC55KmMxMy55IC0gMypjMTAueCpjMTAueSpjMTEueCpjMTIueCpjMTN5MiAtIDYqYzEwLngqYzEwLnkqYzIwLngqYzEzLngqYzEzeTIgK1xuICAgICAgICAgICAgMypjMTAueCpjMTAueSpjMTEueSpjMTIueSpjMTN4MiAtIDIqYzEwLngqYzEwLnkqYzEyLngqYzEyeTIqYzEzLnggLSAyKmMxMC54KmMxMS54KmMyMC54KmMxMi55KmMxM3kyIC1cbiAgICAgICAgICAgIGMxMC54KmMxMS54KmMxMS55KmMxMnkyKmMxMy54ICsgMypjMTAueCpjMTEueCpjMTIueCpjMjAueSpjMTN5MiAtIDQqYzEwLngqYzIwLngqYzExLnkqYzEyLngqYzEzeTIgK1xuICAgICAgICAgICAgMypjMTAueSpjMTEueCpjMjAueCpjMTIueCpjMTN5MiArIDYqYzEwLngqYzEwLnkqYzIwLnkqYzEzeDIqYzEzLnkgKyAyKmMxMC54KmMxMC55KmMxMngyKmMxMi55KmMxMy55ICtcbiAgICAgICAgICAgIDIqYzEwLngqYzExLngqYzExeTIqYzEzLngqYzEzLnkgKyAyKmMxMC54KmMyMC54KmMxMi54KmMxMnkyKmMxMy55ICsgNipjMTAueCpjMjAueCpjMjAueSpjMTMueCpjMTN5MiAtXG4gICAgICAgICAgICAzKmMxMC54KmMxMS55KmMyMC55KmMxMi55KmMxM3gyICsgMipjMTAueCpjMTIueCpjMjAueSpjMTJ5MipjMTMueCArIGMxMC54KmMxMXkyKmMxMi54KmMxMi55KmMxMy54ICtcbiAgICAgICAgICAgIGMxMC55KmMxMS54KmMxMS55KmMxMngyKmMxMy55ICsgNCpjMTAueSpjMTEueCpjMjAueSpjMTIueSpjMTN4MiAtIDMqYzEwLnkqYzIwLngqYzExLnkqYzEyLnkqYzEzeDIgK1xuICAgICAgICAgICAgMipjMTAueSpjMjAueCpjMTIueCpjMTJ5MipjMTMueCArIDIqYzEwLnkqYzExLnkqYzEyLngqYzIwLnkqYzEzeDIgKyBjMTEueCpjMjAueCpjMTEueSpjMTJ5MipjMTMueCAtXG4gICAgICAgICAgICAzKmMxMS54KmMyMC54KmMxMi54KmMyMC55KmMxM3kyIC0gMipjMTAueCpjMTJ4MipjMjAueSpjMTIueSpjMTMueSAtIDYqYzEwLnkqYzIwLngqYzIwLnkqYzEzeDIqYzEzLnkgLVxuICAgICAgICAgICAgMipjMTAueSpjMjAueCpjMTJ4MipjMTIueSpjMTMueSAtIDIqYzEwLnkqYzExeDIqYzExLnkqYzEzLngqYzEzLnkgLSBjMTAueSpjMTF4MipjMTIueCpjMTIueSpjMTMueSAtXG4gICAgICAgICAgICAyKmMxMC55KmMxMngyKmMyMC55KmMxMi55KmMxMy54IC0gMipjMTEueCpjMjAueCpjMTF5MipjMTMueCpjMTMueSAtIGMxMS54KmMxMS55KmMxMngyKmMyMC55KmMxMy55ICtcbiAgICAgICAgICAgIDMqYzIwLngqYzExLnkqYzIwLnkqYzEyLnkqYzEzeDIgLSAyKmMyMC54KmMxMi54KmMyMC55KmMxMnkyKmMxMy54IC0gYzIwLngqYzExeTIqYzEyLngqYzEyLnkqYzEzLnggK1xuICAgICAgICAgICAgMypjMTB5MipjMTEueCpjMTIueCpjMTMueCpjMTMueSArIDMqYzExLngqYzEyLngqYzIweTIqYzEzLngqYzEzLnkgKyAyKmMyMC54KmMxMngyKmMyMC55KmMxMi55KmMxMy55IC1cbiAgICAgICAgICAgIDMqYzEweDIqYzExLnkqYzEyLnkqYzEzLngqYzEzLnkgKyAyKmMxMXgyKmMxMS55KmMyMC55KmMxMy54KmMxMy55ICsgYzExeDIqYzEyLngqYzIwLnkqYzEyLnkqYzEzLnkgLVxuICAgICAgICAgICAgMypjMjB4MipjMTEueSpjMTIueSpjMTMueCpjMTMueSAtIGMxMHgzKmMxM3kzICsgYzEweTMqYzEzeDMgKyBjMjB4MypjMTN5MyAtIGMyMHkzKmMxM3gzIC1cbiAgICAgICAgICAgIDMqYzEwLngqYzIweDIqYzEzeTMgLSBjMTAueCpjMTF5MypjMTN4MiArIDMqYzEweDIqYzIwLngqYzEzeTMgKyBjMTAueSpjMTF4MypjMTN5MiArXG4gICAgICAgICAgICAzKmMxMC55KmMyMHkyKmMxM3gzICsgYzIwLngqYzExeTMqYzEzeDIgKyBjMTB4MipjMTJ5MypjMTMueCAtIDMqYzEweTIqYzIwLnkqYzEzeDMgLSBjMTB5MipjMTJ4MypjMTMueSArXG4gICAgICAgICAgICBjMjB4MipjMTJ5MypjMTMueCAtIGMxMXgzKmMyMC55KmMxM3kyIC0gYzEyeDMqYzIweTIqYzEzLnkgLSBjMTAueCpjMTF4MipjMTEueSpjMTN5MiArXG4gICAgICAgICAgICBjMTAueSpjMTEueCpjMTF5MipjMTN4MiAtIDMqYzEwLngqYzEweTIqYzEzeDIqYzEzLnkgLSBjMTAueCpjMTF5MipjMTJ4MipjMTMueSArIGMxMC55KmMxMXgyKmMxMnkyKmMxMy54IC1cbiAgICAgICAgICAgIGMxMS54KmMxMXkyKmMyMC55KmMxM3gyICsgMypjMTB4MipjMTAueSpjMTMueCpjMTN5MiArIGMxMHgyKmMxMS54KmMxMi55KmMxM3kyICtcbiAgICAgICAgICAgIDIqYzEweDIqYzExLnkqYzEyLngqYzEzeTIgLSAyKmMxMHkyKmMxMS54KmMxMi55KmMxM3gyIC0gYzEweTIqYzExLnkqYzEyLngqYzEzeDIgKyBjMTF4MipjMjAueCpjMTEueSpjMTN5MiAtXG4gICAgICAgICAgICAzKmMxMC54KmMyMHkyKmMxM3gyKmMxMy55ICsgMypjMTAueSpjMjB4MipjMTMueCpjMTN5MiArIGMxMS54KmMyMHgyKmMxMi55KmMxM3kyIC0gMipjMTEueCpjMjB5MipjMTIueSpjMTN4MiArXG4gICAgICAgICAgICBjMjAueCpjMTF5MipjMTJ4MipjMTMueSAtIGMxMS55KmMxMi54KmMyMHkyKmMxM3gyIC0gYzEweDIqYzEyLngqYzEyeTIqYzEzLnkgLSAzKmMxMHgyKmMyMC55KmMxMy54KmMxM3kyICtcbiAgICAgICAgICAgIDMqYzEweTIqYzIwLngqYzEzeDIqYzEzLnkgKyBjMTB5MipjMTJ4MipjMTIueSpjMTMueCAtIGMxMXgyKmMyMC55KmMxMnkyKmMxMy54ICsgMipjMjB4MipjMTEueSpjMTIueCpjMTN5MiArXG4gICAgICAgICAgICAzKmMyMC54KmMyMHkyKmMxM3gyKmMxMy55IC0gYzIweDIqYzEyLngqYzEyeTIqYzEzLnkgLSAzKmMyMHgyKmMyMC55KmMxMy54KmMxM3kyICsgYzEyeDIqYzIweTIqYzEyLnkqYzEzLnhcbiAgICApO1xuICAgIHZhciByb290cyA9IHBvbHkuZ2V0Um9vdHNJbkludGVydmFsKDAsMSk7XG5cbiAgICBmb3IgKCB2YXIgaSA9IDA7IGkgPCByb290cy5sZW5ndGg7IGkrKyApIHtcbiAgICAgICAgdmFyIHMgPSByb290c1tpXTtcbiAgICAgICAgdmFyIHhSb290cyA9IG5ldyBQb2x5bm9taWFsKFxuICAgICAgICAgICAgYzEzLngsXG4gICAgICAgICAgICBjMTIueCxcbiAgICAgICAgICAgIGMxMS54LFxuICAgICAgICAgICAgYzEwLnggLSBjMjAueCAtIHMqYzIxLnggLSBzKnMqYzIyLnggLSBzKnMqcypjMjMueFxuICAgICAgICApLmdldFJvb3RzKCk7XG4gICAgICAgIHZhciB5Um9vdHMgPSBuZXcgUG9seW5vbWlhbChcbiAgICAgICAgICAgIGMxMy55LFxuICAgICAgICAgICAgYzEyLnksXG4gICAgICAgICAgICBjMTEueSxcbiAgICAgICAgICAgIGMxMC55IC0gYzIwLnkgLSBzKmMyMS55IC0gcypzKmMyMi55IC0gcypzKnMqYzIzLnlcbiAgICAgICAgKS5nZXRSb290cygpO1xuXG4gICAgICAgIGlmICggeFJvb3RzLmxlbmd0aCA+IDAgJiYgeVJvb3RzLmxlbmd0aCA+IDAgKSB7XG4gICAgICAgICAgICB2YXIgVE9MRVJBTkNFID0gMWUtNDtcblxuICAgICAgICAgICAgY2hlY2tSb290czpcbiAgICAgICAgICAgIGZvciAoIHZhciBqID0gMDsgaiA8IHhSb290cy5sZW5ndGg7IGorKyApIHtcbiAgICAgICAgICAgICAgICB2YXIgeFJvb3QgPSB4Um9vdHNbal07XG4gICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgaWYgKCAwIDw9IHhSb290ICYmIHhSb290IDw9IDEgKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAoIHZhciBrID0gMDsgayA8IHlSb290cy5sZW5ndGg7IGsrKyApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICggTWF0aC5hYnMoIHhSb290IC0geVJvb3RzW2tdICkgPCBUT0xFUkFOQ0UgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnBvaW50cy5wdXNoKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjMjMubXVsdGlwbHkocypzKnMpLmFkZChjMjIubXVsdGlwbHkocypzKS5hZGQoYzIxLm11bHRpcGx5KHMpLmFkZChjMjApKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIGNoZWNrUm9vdHM7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoIHJlc3VsdC5wb2ludHMubGVuZ3RoID4gMCApIHJlc3VsdC5zdGF0dXMgPSBcIkludGVyc2VjdGlvblwiO1xuXG4gICAgcmV0dXJuIHJlc3VsdDtcbn07XG5cblxuLyoqKioqXG4qXG4qICAgaW50ZXJzZWN0QmV6aWVyM0NpcmNsZVxuKlxuKioqKiovXG5JbnRlcnNlY3Rpb24uaW50ZXJzZWN0QmV6aWVyM0NpcmNsZSA9IGZ1bmN0aW9uKHAxLCBwMiwgcDMsIHA0LCBjLCByKSB7XG4gICAgcmV0dXJuIEludGVyc2VjdGlvbi5pbnRlcnNlY3RCZXppZXIzRWxsaXBzZShwMSwgcDIsIHAzLCBwNCwgYywgciwgcik7XG59O1xuXG5cbi8qKioqKlxuKlxuKiAgIGludGVyc2VjdEJlemllc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UG9seW5vbWlhbChcbiAgICAgICAgYzMueCpjMy54KnJ5cnkgKyBjMy55KmMzLnkqcnhyeCxcbiAgICAgICAgMiooYzMueCpjMi54KnJ5cnkgKyBjMy55KmMyLnkqcnhyeCksXG4gICAgICAgIDIqKGMzLngqYzEueCpyeXJ5ICsgYzMueSpjMS55KnJ4cngpICsgYzIueCpjMi54KnJ5cnkgKyBjMi55KmMyLnkqcnhyeCxcbiAgICAgICAgMipjMy54KnJ5cnkqKGMwLnggLSBlYy54KSArIDIqYzMueSpyeHJ4KihjMC55IC0gZWMueSkgK1xuICAgICAgICAgICAgMiooYzIueCpjMS54KnJ5cnkgKyBjMi55KmMxLnkqcnhyeCksXG4gICAgICAgIDIqYzIueCpyeXJ5KihjMC54IC0gZWMueCkgKyAyKmMyLnkqcnhyeCooYzAueSAtIGVjLnkpICtcbiAgICAgICAgICAgIGMxLngqYzEueCpyeXJ5ICsgYzEueSpjMS55KnJ4cngsXG4gICAgICAgIDIqYzEueCpyeXJ5KihjMC54IC0gZWMueCkgKyAyKmMxLnkqcnhyeCooYzAueSAtIGVjLnkpLFxuICAgICAgICBjMC54KmMwLngqcnlyeSAtIDIqYzAueSplYy55KnJ4cnggLSAyKmMwLngqZWMueCpyeXJ5ICtcbiAgICAgICAgICAgIGMwLnkqYzAueSpyeHJ4ICsgZWMueCplYy54KnJ5cnkgKyBlYy55KmVjLnkqcnhyeCAtIHJ4cngqcnlyeVxuICAgICk7XG4gICAgdmFyIHJvb3RzID0gcG9seS5nZXRSb290c0luSW50ZXJ2YWwoMCwxKTtcblxuICAgIGZvciAoIHZhciBpID0gMDsgaSA8IHJvb3RzLmxlbmd0aDsgaSsrICkge1xuICAgICAgICB2YXIgdCA9IHJvb3RzW2ldO1xuXG4gICAgICAgIHJlc3VsdC5wb2ludHMucHVzaChcbiAgICAgICAgICAgIGMzLm11bHRpcGx5KHQqdCp0KS5hZGQoYzIubXVsdGlwbHkodCp0KS5hZGQoYzEubXVsdGlwbHkodCkuYWR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gcG9pbnQgaXMgb24gbGluZSBzZWdtZW50XG4gICAgdmFyIHJlc3VsdCA9IG5ldyBJbnRlcnNlY3Rpb24oXCJObyBJbnRlcnNlY3Rpb25cIik7XG4gICAgXG4gICAgLy8gU3RhcnQgd2l0aCBCZXppZXIgdXNpbmcgQmVybnN0ZWluIHBvbHlub21pYWxzIGZvciB3ZWlnaHRpbmcgZnVuY3Rpb25zOlxuICAgIC8vICAgICAoMS10XjMpUDEgKyAzdCgxLXQpXjJQMiArIDN0XjIoMS10KVAzICsgdF4zUDRcbiAgICAvL1xuICAgIC8vIEV4cGFuZCBhbmQgY29sbGVjdCB0ZXJtcyB0byBmb3JtIGxpbmVhciBjb21iaW5hdGlvbnMgb2Ygb3JpZ2luYWwgQmV6aWVyXG4gICAgLy8gY29udHJvbHMuICBUaGlzIGVuZHMgdXAgd2l0aCBhIHZlY3RvciBjdWJpYyBpbiB0OlxuICAgIC8vICAgICAoLVAxKzNQMi0zUDMrUDQpdF4zICsgKDNQMS02UDIrM1AzKXReMiArICgtM1AxKzNQMil0ICsgUDFcbiAgICAvLyAgICAgICAgICAgICAvXFwgICAgICAgICAgICAgICAgICAvXFwgICAgICAgICAgICAgICAgL1xcICAgICAgIC9cXFxuICAgIC8vICAgICAgICAgICAgIHx8ICAgICAgICAgICAgICAgICAgfHwgICAgICAgICAgICAgICAgfHwgICAgICAgfHxcbiAgICAvLyAgICAgICAgICAgICBjMyAgICAgICAgICAgICAgICAgIGMyICAgICAgICAgICAgICAgIGMxICAgICAgIGMwXG4gICAgXG4gICAgLy8gQ2FsY3VsYXRlIHRoZSBjb2VmZmljaWVudHNcbiAgICBhID0gcDEubXVsdGlwbHkoLTEpO1xuICAgIGIgPSBwMi5tdWx0aXBseSgzKTtcbiAgICBjID0gcDMubXVsdGlwbHkoLTMpO1xuICAgIGQgPSBhLmFkZChiLmFkZChjLmFkZChwNCkpKTtcbiAgICBjMyA9IG5ldyBWZWN0b3IyRChkLngsIGQueSk7XG5cbiAgICBh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Rpb25zIG9uIEJlemllciwgYnV0XG4gICAgLy8gbWlnaHQgbm90IGJlIG9uIHRoZSBsaW5lIHNlZ21lbnQuXG4gICAgLy8gRmluZCBpbnRlcnNlY3Rpb25zIGFuZCBjYWxjdWxhdGUgcG9pbnQgY29vcmRpbmF0ZXNcbiAgICBmb3IgKCB2YXIgaSA9IDA7IGkgPCByb290cy5sZW5ndGg7IGkrKyApIHtcbiAgICAgICAgdmFyIHQgPSByb290c1tpXTtcblxuICAgICAgICBpZiAoIDAgPD0gdCAmJiB0IDw9IDEgKSB7XG4gICAgICAgICAgICAvLyBXZSdyZSB3aXRoaW4gdGhlIEJlemllciBjdXJ2ZVxuICAgICAgICAgICAgLy8gRmluZCBwb2ludCBvbiBCZXppZXJcbiAgICAgICAgICAgIHZhciBwNSA9IHAxLmxlcnAocDIsIHQpO1xuICAgICAgICAgICAgdmFyIHA2ID0gcDIubGVycChwMywgdCk7XG4gICAgICAgICAgICB2YXIgcDcgPSBwMy5sZXJwKHA0LCB0KTtcblxuICAgICAgICAgICAgdmFyIHA4ID0gcDUubGVycChwNiwgdCk7XG4gICAgICAgICAgICB2YXIgcDkgPSBwNi5sZXJwKHA3LCB0KTtcblxuICAgICAgICAgICAgdmFyIHAxMCA9IHA4LmxlcnAocDksIHQpO1xuXG4gICAgICAgICAgICAvLyBTZWUgaWYgcG9pbnQgaXMgb24gbGluZSBzZWdtZW50XG4gICAgICAgICAgICAvLyBIYWQgdG8gbWFrZSBzcGVjaWFsIGNhc2VzIGZvciB2ZXJ0aWNhbCBhbmQgaG9yaXpvbnRhbCBsaW5lcyBkdWVcbiAgICAgICAgICAgIC8vIHRvIHNsaWdodCBlcnJvcnMgaW4gY2FsY3VsYXRpb24gb2YgcDEwXG4gICAgICAgICAgICBpZiAoIGExLnggPT0gYTIueCApIHtcbiAgICAgICAgICAgICAgICBpZiAoIG1pbi55IDw9IHAxMC55ICYmIHAxMC55IDw9IG1heC55ICkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQuc3RhdHVzID0gXCJJbnRlcnNlY3Rpb25cIjtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZFBvaW50KCBwMTAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBhMS55ID09IGEyLnkgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBtaW4ueCA8PSBwMTAueCAmJiBwMTAueCA8PSBtYXgueCApIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnN0YXR1cyA9IFwiSW50ZXJzZWN0aW9uXCI7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdC5hcHBlbmRQb2ludCggcDEwICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmICggcDEwLmd0ZShtaW4pICYmIHAxMC5sdGUobWF4KSApIHtcbiAgICAgICAgICAgICAgICByZXN1bHQuc3RhdHVzID0gXCJJbnRlcnNlY3Rpb25cIjtcbiAgICAgICAgICAgICAgICByZXN1bHQuYXBwZW5kUG9pbnQoIHAxMCApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIHJlc3VsdDtcbn07XG5cblxuLyoqKioqXG4qXG4qICAgaW50ZXJzZWN0QmV6aWVyM1BvbHlnb25cbipcbioqKioqL1xuSW50ZXJzZWN0aW9uLmludGVyc2VjdEJlemllcjNQb2x5Z29uID0gZnVuY3Rpb24ocDEsIHAyLCBwMywgcDQsIHBvaW50cykge1xuICAgIHZhciByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiTm8gSW50ZXJzZWN0aW9uXCIpO1xuICAgIHZhciBsZW5ndGggPSBwb2ludHMubGVuZ3RoO1xuXG4gICAgZm9yICggdmFyIGkgPSAwOyBpIDwgbGVuZ3RoOyBpKysgKSB7XG4gICAgICAgIHZhciBhMSA9IHBvaW50c1tpXTtcbiAgICAgICAgdmFyIGEyID0gcG9pbnRzWyh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AgcmVzdWx0ID0gbmV3IEludGVyc2VjdGlvbihcIk91dHNpZGVcIik7XG4gICAgfSBlbHNlIGlmICggY19kaXN0IDwgcl9taW4gKSB7XG4gICAgICAgIHJlc3VsdCA9IG5ldyBJbnRlcnNlY3Rpb24oXCJJbnNpZGVcIik7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgcmVzdWx0ID0gbmV3IEludGVyc2VjdGlvbihcIkludGVyc2VjdGlvblwiKTtcblxuICAgICAgICB2YXIgYSA9IChyMSpyMSAtIHIyKnIyICsgY19kaXN0KmNfZGlzdCkgLyAoIDIqY19kaXN0ICk7XG4gICAgICAgIHZhciBoID0gTWF0aC5zcXJ0KHIxKnIxIC0gYSphKTtcbiAgICAgICAgdmFyIHAgPSBjMS5sZXJwKGMyLCBhL2NfZGlzdCk7XG4gICAgICAgIHZhciBiID0gaCAvIGNfZGlzdDtcblxuICAgICAgICByZXN1bHQucG9pbnRzLnB1c2goXG4gICAgICAgICAgICBuZXcgUG9pbnQyRChcbiAgICAgICAgICAgICAgICBwLnggLSBiICogKGMyLnkgLSBjMS55KSxcbiAgICAgICAgICAgICAgICBwLnkgKyBiICogKGMyLnggLSBjMS54KVxuICAgICAgICAgICAgKVxuICAgICAgICApO1xuICAgICAgICByZXN1bHQucG9pbnRzLnB1c2goXG4gICAgICAgICAgICBuZXcgUG9pbnQyRChcbiAgICAgICAgICAgICAgICBwLnggKyBiICogKGMyLnkgLSBjMS55KSxcbiAgICAgICAgICAgICAgICBwLnkgLSBiICogKGMyLnggLSBjMS54KVxuICAgICAgICAgICAgKVxuICAgICAgICApO1xuICAgIH1cblxuICAgIHJldHVybiByZXN1bHQ7XG59O1xuXG5cbi8qKioqKlxuKlxuKiAgIGludGVyc2VjdENpcmNsZUVsbGlwc2VcbipcbioqKioqL1xuSW50ZXJzZWN0aW9uLmludGVyc2VjdENpcmNsZUVsbGlwc2UgPSBmdW5jdGlvbihjYywgciwgZWMsIHJ4LCByeSkge1xuICAgIHJldHVybiBJbnRlcnNlY3Rpb24uaW50ZXJzZWN0RWxsaXBzZUVsbGlwc2UoY2MsIHIsIHIsIGVjLCByeCwgcnkpO1xufTtcblxuXG4vKioqKipcbipcbiogICBpbnRlcnNlY3RDaXJjbGVMaW5lXG4qXG4qKioqKi9cbkludGVyc2VjdGlvbi5pbnRlcnNlY3RDaXJjbGVMaW5lID0gZnVuY3Rpb24oYywgciwgYTEsIGEyKSB7XG4gICAgdmFyIHJlc3VsdDtcbiAgICB2YXIgYSAgPSAoYTIueCAtIGExLngpICogKGEyLnggLSBhMS54KSArXG4gICAgICAgICAgICAgKGEyLnkgLSBhMS55KSAqIChhMi55IC0gYTEueSk7XG4gICAgdmFyIGIgID0gMiAqICggKGEyLnggLSBhMS54KSAqIChhMS54IC0gYy54KSArXG4gICAgICAgICAgICAgICAgICAgKGEyLnkgLSBhMS55KSAqIChhMS55IC0gYy55KSAgICk7XG4gICAgdmFyIGNjID0gYy54KmMueCArIGMueSpjLnkgKyBhMS54KmExLnggKyBhMS55KmExLnkgLVxuICAgICAgICAgICAgIDIgKiAoYy54ICogYTEueCArIGMueSAqIGExLnkpIC0gcipyO1xuICAgIHZhciBkZXRlciA9IGIqYiAtIDQqYSpjYztcblxuICAgIGlmICggZGV0ZXIgPCAwICkge1xuICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiT3V0c2lkZVwiKTtcbiAgICB9IGVsc2UgaWYgKCBkZXRlciA9PSAwICkge1xuICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiVGFuZ2VudFwiKTtcbiAgICAgICAgLy8gTk9URTogc2hvdWxkIGNhbGN1bGF0ZSB0aGlzIHBvaW50XG4gICAgfSBlbHNlIHtcbiAgICAgICAgdmFyIGUgID0gTWF0aC5zcXJ0KGRldGVyKTtcbiAgICAgICAgdmFyIHUxID0gKCAtYiArIGUgKSAvICggMiphICk7XG4gICAgICAgIHZhciB1MiA9ICggLWIgLSBlICkgLyAoIDIqYSApO1xuXG4gICAgICAgIGlmICggKHUxIDwgMCB8fCB1MSA+IDEpICYmICh1MiA8IDAgfHwgdTIgPiAxKSApIHtcbiAgICAgICAgICAgIGlmICggKHUxIDwgMCAmJiB1MiA8IDApIHx8ICh1MSA+IDEgJiYgdTIgPiAxKSApIHtcbiAgICAgICAgICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiT3V0c2lkZVwiKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gbmV3IEludGVyc2VjdGlvbihcIkluc2lkZVwiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IG5ldyBJbnRlcnNlY3Rpb24oXCJJbnRlcnNlY3Rpb25cIik7XG5cbiAgICAgICAgICAgIGlmICggMCA8PSB1MSAmJiB1MSA8PSAxKVxuICAgICAgICAgICAgICAgIHJlc3VsdC5wb2ludHMucHVzaCggYTEubGVycChhMiwgdTEpICk7XG5cbiAgICAgICAgICAgIGlmICggMCA8PSB1MiAmJiB1MiA8PSAxKVxuICAgICAgICAgICAgICAgIHJlc3VsdC5wb2ludHMucHVzaCggYTEubGVycChhMiwgdTIpICk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgXG4gICAgcmV0dXJuIHJlc3VsdDtcbn07XG5cblxuLyoqKioqXG4qXG4qICAgaW50ZXJzZWN0Q2lyY2xlUG9seWdvblxuKlxuKioqKiovXG5JbnRlcnNlY3Rpb24uaW50ZXJzZWN0Q2lyY2xlUG9seWdvbiA9IGZ1bmN0aW9uKGMsIHIsIHBvaW50cykge1xuICAgIHZhciByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiTm8gSW50ZXJzZWN0aW9uXCIpO1xuICAgIHZhciBsZW5ndGggPSBwb2ludHMubGVuZ3RoO1xuICAgIHZhciBpbnRlcjtcblxuICAgIGZvciAoIHZhciBpID0gMDsgaSA8I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bM10gKyB5Um9vdHNbeV0gKiBhWzFdLFxuICAgICAgICAgICAgYVs1XSArIHlSb290c1t5XSAqIChhWzRdICsgeVJvb3RzW3ldKmFbMl0pXG4gICAgICAgICk7XG4gICAgICAgIHZhciB4Um9vdHMgPSB4UG9seS5nZXRSb290cygpO1xuXG4gICAgICAgIGZvciAoIHZhciB4ID0gMDsgeCA8IHhSb290cy5sZW5ndGg7IHgrKyApIHtcbiAgICAgICAgICAgIHZhciB0ZXN0ID1cbiAgICAgICAgICAgICAgICAoIGFbMF0qeFJvb3RzW3hdICsgYVsxXSp5Um9vdHNbeV0gKyBhWzNdICkgKiB4Um9vdHNbeF0gKyBcbiAgICAgICAgICAgICAgICAoIGFbMl0qeVJvb3RzW3ldICsgYVs0XSApICogeVJvb3RzW3ldICsgYVs1XTtcbiAgICAgICAgICAgIGlmICggTWF0aC5hYnModGVzdCkgPCBub3JtMCApIHtcbiAgICAgICAgICAgICAgICB0ZXN0ID1cbiAgICAgICAgICAgICAgICAgICAgKCBiWzBdKnhSb290c1t4XSArIGJbMV0qeVJvb3RzW3ldICsgYlszXSApICogeFJvb3RzW3hdICtcbiAgICAgICAgICAgICAgICAgICAgKCBiWzJdKnlSb290c1t5XSArIGJbNF0gKSAqIHlSb290c1t5XSArIGJbNV07XG4gICAgICAgICAgICAgICAgaWYgKCBNYXRoLmFicyh0ZXN0KSA8IG5vcm0xICkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQuYXBwZW5kUG9pbnQoIG5ldyBQb2ludDJEKCB4Um9vdHNbeF0sIHlSb290c1t5XSApICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgaWYgKCByZXN1bHQucG9pbnRzLmxlbmd0aCA+IDAgKSByZXN1bHQuc3RhdHVzID0gXCJJbnRlcnNlY3Rpb25cIjtcblxuICAgIHJldHVybiByZXN1bHQ7XG59O1xuXG5cbi8qKioqKlxuKlxuKiAgIGludGVyc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IDAgfHwgMSA8IHRfYSkgJiYgKHRfYiA8IDAgfHwgMSA8IHRfYikgKSB7XG4gICAgICAgICAgICBpZiAoICh0X2EgPCAwICYmIHRfYiA8IDApIHx8ICh0X2EgPiAxICYmIHRfYiA+IDEpIClcbiAgICAgICAgICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiT3V0c2lkZVwiKTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiSW5zaWRlXCIpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmVzdWx0ID0gbmV3IEludGVyc2VjdGlvbihcIkludGVyc2VjdGlvblwiKTtcbiAgICAgICAgICAgIGlmICggMCA8PSB0X2EgJiYgdF9hIDw9IDEgKVxuICAgICAgICAgICAgICAgIHJlc3VsdC5hcHBlbmRQb2ludCggYTEubGVycChhMiwgdF9hKSApO1xuICAgICAgICAgICAgaWYgKCAwIDw9IHRfYiAmJiB0X2IgPD0gMSApXG4gICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZFBvaW50KCBhMS5sZXJwKGEyLCB0X2IpICk7XG4gICAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgICB2YXIgdCA9IC1iL2E7XG4gICAgICAgIGlmICggMCA8PSB0ICYmIHQgPD0gMSApIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IG5ldyBJbnRlcnNlY3Rpb24oXCJJbnRlcnNlY3Rpb25cIik7XG4gICAgICAgICAgICByZXN1bHQuYXBwZW5kUG9pbnQoIGExLmxlcnAoYTIsIHQpICk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiT3V0c2lkZVwiKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBcbiAgICByZXR1cm4gcmVzdWx0O1xufTtcblxuXG4vKioqKipcbipcbiogICBpbnRlcnNl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SAqIChhMS55IC0gYjEueSkgLSAoYjIueSAtIGIxLnkpICogKGExLnggLSBiMS54KTtcbiAgICB2YXIgdWJfdCA9IChhMi54IC0gYTEueCkgKiAoYTEueSAtIGIxLnkpIC0gKGEyLnkgLSBhMS55KSAqIChhMS54IC0gYjEueCk7XG4gICAgdmFyIHVfYiAgPSAoYjIueSAtIGIxLnkpICogKGEyLnggLSBhMS54KSAtIChiMi54IC0gYjEueCkgKiAoYTIueSAtIGExLnkpO1xuXG4gICAgaWYgKCB1X2IgIT0gMCApIHtcbiAgICAgICAgdmFyIHVhID0gdWFfdCAvIHVfYjtcbiAgICAgICAgdmFyIHViID0gdWJfdCAvIHVfYjtcblxuICAgICAgICBpZiAoIDAgPD0gdWEgJiYgdWEgPD0gMSAmJiAwIDw9IHViICYmIHViIDw9IDEgKSB7XG4gICAgICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiSW50ZXJzZWN0aW9uXCIpO1xuICAgICAgICAgICAgcmVzdWx0LnBvaW50cy5wdXNoKFxuICAgICAgICAgICAgICAgIG5ldyBQb2ludDJEKFxuICAgICAgICAgICAgICAgICAgICBhMS54ICsgdWEgKiAoYTIueCAtIGExLngpLFxuICAgICAgICAgICAgICAgICAgICBhMS55ICsgdWEgKiAoYTIueSAtIGExLnkpXG4gICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IG5ldyBJbnRlcnNlY3Rpb24oXCJObyBJbnRlcnNlY3Rpb25cIik7XG4gICAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoIHVhX3QgPT0gMCB8fCB1Yl90ID09IDAgKSB7XG4gICAgICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiQ29pbmNpZGVudFwiKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IG5ldyBJbnRlc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hMi55IC0gYTEueSkgKiAoYTEueCAtIGIxLngpO1xuICAgIHZhciB1X2IgID0gKGIyLnkgLSBiMS55KSAqIChhMi54IC0gYTEueCkgLSAoYjIueCAtIGIxLngpICogKGEyLnkgLSBhMS55KTtcblxuICAgIGlmICggdV9iICE9IDAgKSB7XG4gICAgICAgIHZhciB1YSA9IHVhX3QgLyB1X2I7XG5cbiAgICAgICAgcmVzdWx0ID0gbmV3IEludGVyc2VjdGlvbihcIkludGVyc2VjdGlvblwiKTtcbiAgICAgICAgcmVzdWx0LnBvaW50cy5wdXNoKFxuICAgICAgICAgICAgbmV3IFBvaW50MkQoXG4gICAgICAgICAgICAgICAgYTEueCArIHVhICogKGEyLnggLSBhMS54KSxcbiAgICAgICAgICAgICAgICBhMS55ICsgdWEgKiAoYTIueSAtIGExLnkpXG4gICAgICAgICAgICApXG4gICAgICAgICk7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKCB1YV90ID09IDAgfHwgdWJfdCA9PSAwICkge1xuICAgICAgICAgICAgcmVzdWx0ID0gbmV3IEludGVyc2VjdGlvbihcIkNvaW5jaWRlbnRcIik7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXN1bHQgPSBuZXcgSW50ZXJzZWN0aW9uKFwiUGFyYWxsZWxcIik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gcmVzdWx0O1xufTtcblxuXG4vKioqKipcbipcbiogICBpbnRlcnNlY3RSZWN0YW5nbGVSZWN0YW5nbGVcbipcbioqKioqL1xuSW50ZXJzZWN0aW9uLmludGVyc2VjdFJlY3RhbmdsZVJlY3RhbmdsZSA9IGZ1bmN0aW9uKGExLCBhMiwgYjEsIGIyKSB7XG4gICAgdmFyIG1pbiAgICAgICAgPSBhMS5taW4oYTIpO1xuICAgIHZhciBtYXggICAgICAgID0gYTEubWF4KGEyKTtcbiAgICB2YXIgdG9wUmlnaHQgICA9IG5ldyBQb2ludDJEKCBtYXgueCwgbWluLn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naHRjbGljaywgbWlkZGxlY2xpY2s7IC8vd2hpY2ggYnV0dG9uIGhhcyBqdXN0IGJlZW4gcmFpc2VkXG4gICAgICAgIGlmIChldnQud2hpY2gpXG4gICAgICAgICAgICByaWdodGNsaWNrID0gKGV2dC53aGljaCA9PT0gMyk7XG4gICAgICAgIGVsc2UgaWYgKGV2dC5idXR0b24pXG4gICAgICAgICAgICByaWdodGNsaWNrID0gKGV2dC5idXR0b24gPT09IDIpO1xuICAgICAgICBpZiAoZXZ0LndoaWNoKVxuICAgICAgICAgICAgbWlkZGxlY2xpY2sgPSAoZXZ0LndoaWNoID09PSAyKTtcbiAgICAgICAgZWxzZSBpZiAoZXZ0LmJ1dHRvbilcbiAgICAgICAgICAgIG1pZGRsZWNsaWNrID0gKGV2dC5idXR0b24gPT09IDEpO1xuXG4gICAgICAgIHZhciBwID0gdGhpcy5nZXRFdmVudFBvaW50KGV2dCk7Ly8gc2VlbXMgdG8gYmUgY29ycmVjdCwgc2VlIGJlbG93XG4gICAgICAgIHZhciBjID0gdGhpcy5tb3VzZVRvU1ZHKHAueCwgcC55KTtcblxuICAgICAgICBpZiAodGhpcy5kcmFnRWxlbWVudCAhPSBudWxsKSB7XG4gICAgICAgICAgICBpZiAoISh0aGlzLnN0YXRlID09PSBNb3VzZUV2ZW50Q29kZXMuRFJBR0dJTkcgfHwgdGhpcy5zdGF0ZSA9PT0gTW91c2VFdmVudENvZGVzLlJPVEFUSU5HKSkgeyAvL25vdCBkcmFnZ2luZyBvciByb3RhdGluZ1xuICAgICAgICAgICAgICAgIGlmIChyaWdodGNsaWNrKSB7XG5cdFx0XHRcdFx0Ly8gUklHSFQgY2xpY2tcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAobWlkZGxlY2xpY2spIHtcbiAgICAgICAgICAgICAgICAgICAgLy9jYW4ndCBiZSB1c2VkPyBwcm9ibGVtIHdpdGggSUUgKHNjcm9sbCB0aGluZ3kpXG4gICAgICAgIC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gICAgICAgdmFyIGMgPSB0aGlzLm1vdXNlVG9TVkcocC54LCBwLnkpO1xuXG4gICAgICAgIGlmICh0aGlzLmRyYWdFbGVtZW50ICE9IG51bGwpIHsgLy9kcmFnZ2luZyBvciByb3RhdGluZ1xuICAgICAgICAgICAgdGhpcy5oaWRlVG9vbHRpcCgpO1xuICAgICAgICAgICAgdmFyIGR4ID0gdGhpcy5kcmFnU3RhcnQueCAtIGMueDtcbiAgICAgICAgICAgIHZhciBkeSA9IHRoaXMuZHJhZ1N0YXJ0LnkgLSBjLnk7XG5cbiAgICAgICAgICAgIGlmICh0aGlzLnN0YXRlID09PSAgTW91c2VFdmVudENvZGVzLkRSQUdHSU5HKSB7XG4gICAgICAgICAgICAgICAgLy8gd2UgYXJlIGN1cnJlbnRseSBkcmFnZ2luZyB0aGluZ3MgYXJvdW5kXG4gICAgICAgICAgICAgICAgdmFyIG94LCBveSwgbngsIG55O1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdGhpcy5kcmFnRWxlbWVudC54ID09PSAndW5kZWZpbmVkJykgeyAvLyBpZiBub3QgYW4gTW9sZWN1bGVcbiAgICAgICAgICAgICAgICAgICAgdmFyIG5vZGVzID0gdGhpcy5kcmFnRWxlbWVudC5pbnRlcmFjdG9ycztcbiAgICAgICAgICAgICAgICAgICAgdmFyIG5vZGVDb3VudCA9IG5vZGVzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBub2RlQ291bnQ7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHByb3RlaW4gPSBub2Rlc1tpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG94ID0gcHJvdGVpbi54O1xuICAgICAgICAgICAgICAgICAgICAgICAgb3kgPSBwcm90ZWluLnk7XG4gICAgICAgICAgICAgICAgICAgICAgICBueCA9IG94IC0gZHg7XG4gICAgICAgICAgICAgICAgICAgICAgICBueSA9IG95IC0gZHk7XG4gICAgICAgICAgICAgICAgICAgICAgICBwcm90ZWluLnNldFBvc2l0aW9uKG54LCBueSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBwcm90ZWluLnNldEFsbExpbmtDb29yZGluYXRlcygpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBub2RlQ291bnQ7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZXNbaV0uc2V0QWxsTGlua0Nvb3JkaW5hdGVzKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvL2l0cyBhIHByb3RlaW4gLSBkcmFnIGl0IFRPRE86IERSQUcgU0VMRUNURURcbiAgICAgICAgICAgICAgICAgICAgb3ggPSB0aGlzLmRyYWdFbGVtZW50Lng7XG4gICAgICAgICAgICAgICAgICAgIG95ID0gdGhpcy5kcmFnRWxlbWVudC55O1xuICAgICAgICAgICAgICAgICAgICBueCA9IG94IC0gZHg7XG4gICAgICAgICAgICAgICAgICAgIG55ID0gb3kgLSBkeTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kcmFnRWxlbWVudC5zZXRQb3NpdGlvbihueCwgbnkpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmRyYWdFbGVtZW50LnNldEFsbExpbmtDb29yZGluYXRlcygpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLmRyYWdTdGFydCA9IGM7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGVsc2UgaWYgKHRoaXMuc3RhdGUgPT09IE1vdXNlRXZlbnRDb2Rlcy5ST1RBVElORykge1xuICAgICAgICAgICAgICAgIC8vIERpc3RhbmNlIGZyb20gbW91c2UgeCBhbmQgY2VudGVyIG9mIHN0aWNrLlxuICAgICAgICAgICAgICAgIHZhciBfZHggPSBjLnggLSB0aGlzLmRyYWdFbGVtZW50LnhcbiAgICAgICAgICAgICAgICAvLyBEaXN0YW5jZSBmcm9tIG1vdXNlIHkgYW5kIGNlbnRlciBvZiBzdGljay5cbiAgICAgICAgICAgICAgICB2YXIgX2R5ID0gYy55IC0gdGhpcy5kcmFnRWxlbWVudC55O1xuICAgICAgICAgICAgICAgIC8vc2VlIGh0dHA6Ly9lbi53aWtpcGVkaWEub3JnL3dpa2kvQXRhbjIjTW90aXZhdGlvblxuICAgICAgICAgICAgICAgIHZhciBjZW50cmVUb01vdXNlQW5nbGVSYWRzID0gTWF0aC5hdGFuMihfZHksIF9keCk7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMud2hpY2hSb3RhdG9yID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGNlbnRyZVRvTW91c2VBbmdsZVJhZHMgPSBjZW50cmVUb01vdXNlQW5nbGVSYWRzICsgTWF0aC5QSTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIGNlbnRyZVRvTW91c2VBbmdsZURlZ3JlZXMgPSBjZW50cmVUb01vdXNlQW5nbGVSYWRzICogKDM2MCAvICgyICogTWF0aC5QSSkpO1xuICAgICAgICAgICAgICAgIHRoaXMuZHJhZ0VsZW1lbnQuc2V0Um90YXRpb24oY2VudHJlVG9Nb3VzZUFuZ2xlRGVncmVlcyk7XG4gICAgICAgICAgICAgICAgdGhpcy5kcmFnRWxlbWVudC5zZXRBbGxMaW5rQ29vcmRpbmF0ZXMoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgeyAvL25vdCBkcmFnZ2luZyBvciByb3RhdGluZyB5ZXQsIG1heWJlIHdlIHNob3VsZCBzdGFydFxuICAgICAgICAgICAgICAgIC8vIGRvbid0IHN0YXJ0IGRyYWdnaW5nIGp1c3Qgb24gYSBjbGljayAtIHdlIG5lZWQgdG8gbW92ZSB0aGUgbW91c2UgYSBiaXQgZmlyc3RcbiAgICAgICAgICAgICAgICBpZiAoTWF0aC5zcXJ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wKSB7XHJcbiAgICAgICAgICAgICAgICBzdGFydFBvaW50ID0gaW50ZXJhY3Rvci5nZXRQb3NpdGlvbigpO1xyXG4gICAgICAgICAgICAgICAgZW5kUG9pbnQgPSBzdGFydFBvaW50O1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgc3RhcnRQb2ludCA9IGludGVyYWN0b3IuZ2V0UmVzaWR1ZUNvb3JkaW5hdGVzKHN0YXJ0UmVzLCB5T2Zmc2V0KTtcclxuICAgICAgICAgICAgICAgIGVuZFBvaW50ID0gaW50ZXJhY3Rvci5nZXRSZXNpZHVlQ29vcmRpbmF0ZXMoZW5kUmVzLCB5T2Zmc2V0KTtcclxuXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuICcgUScgKyBjb250cm9sUG9pbnRbMF0gKyAnLCcgKyBjb250cm9sUG9pbnRbMV0gKyAnICcgKyBzdGFydFBvaW50WzBdICsgJywnICsgc3RhcnRQb2ludFsxXSArXHJcbiAgICAgICAgICAgICAgICAgICAgJyBMJyArIGVuZFBvaW50WzBdICsgJywnICsgZW5kUG9pbnRbMV0gK1xyXG4gICAgICAgICAgICAgICAgICAgICcgUScgKyBjb250cm9sUG9pbnRbMF0gKyAnLCcgKyBjb250cm9sUG9pbnRbMV0gKyAnICcgKyBtaWRQb2ludFswXSArICcsJyArIG1pZFBvaW50WzFdO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgZnVuY3Rpb24gc2VxdWVuY2VEYXRhTWlkUG9pbnQoc2VxdWVuY2VEYXRhLCBpbnRlcmFjdG9yKSB7XHJcblx0XHQvL2dldCB0aGUgc21hbGxlc3Qgc3RhcnQgYW5kIHRoZSBiaWdnZXN0IGVuZFxyXG4gICAgICAgICAgICB2YXIgbG93ZXN0TGlua2VkUmVzID0gbnVsbCwgaGlnaGVzdExpbmtlZFJlcyA9IG51bGw7XHJcbiAgICAgICAgICAgIHZhciBzZENvdW50ID0gc2VxdWVuY2VEYXRhLmxlbmd0aDtcclxuICAgICAgICAgICAgZm9yICh2YXIgcyA9IDA7IHMgPCBzZENvdW50OyBzKyspIHtcclxuICAgICAgICAgICAgICAgIHZhciBzZXFEYXR1bSA9IHNlcXVlbmNlRGF0YVtzXTtcclxuICAgICAgICAgICAgICAgIGlmICghaXNOYU4ocGFyc2VGbG9hdChzZXFEYXR1bS5zdGFydCkpICYmIGlzRmluaXRlKHNlcURhdHVtLnN0YXJ0KSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciBzdGFydCA9IHNlcURhdHVtLnN0YXJ0ICogMTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAobG93ZXN0TGlua2VkUmVzID09PSBudWxsIHx8IHN0YXJ0IDwgbG93ZXN0TGlua2VkUmVzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvd2VzdExpbmtlZFJlcyA9IHN0YXJ0O1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICghaXNOYU4ocGFyc2VGbG9hdChzZXFEYXR1bS51bmNlcnRhaW5TdGFydCkpICYmIGlzRmluaXRlKHNlcURhdHVtLnVuY2VydGFpblN0YXJ0KSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciB1bmNlcnRhaW5TdGFydCA9IHNlcURhdHVtLnVuY2VydGFpblN0YXJ0ICogMTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAobG93ZXN0TGlua2VkUmVzID09PSBudWxsIHx8IHVuY2VydGFpblN0YXJ0IDwgbG93ZXN0TGlua2VkUmVzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvd2VzdExpbmtlZFJlcyA9IHVuY2VydGFpblN0YXJ0O1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICghaXNOYU4ocGFyc2VGbG9hdChzZXFEYXR1bS5lbmQpKSAmJiBpc0Zpbml0ZShzZXFEYXR1bS5lbmQpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdmFyIGVuZCA9IHNlcURhdHVtLmVuZCAqIDE7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGhpZ2hlc3RMaW5rZWRSZXMgPT09IG51bGwgfHwgZW5kID4gaGlnaGVzdExpbmtlZFJlcykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBoaWdoZXN0TGlua2VkUmVzID0gZW5kO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICghaXNOYU4ocGFyc2VGbG9hdChzZXFEYXR1bS51bmNlcnRhaW5FbmQpKSAmJiBpc0Zpbml0ZShzZXFEYXR1bS51bmNlcnRhaW5FbmQpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdmFyIHVuY2VydGFpbkVuZCA9IHNlcURhdHVtLnVuY2VydGFpbkVuZCAqIDE7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGhpZ2hlc3RMaW5rZWRSZXMgPT09IG51bGwgfHwgdW5jZXJ0YWluRW5kID4gaGlnaGVzdExpbmtlZFJlcykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBoaWdoZXN0TGlua2VkUmVzID0gdW5jZXJ0YWluRW5kO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICByZXR1cm4gaW50ZXJhY3Rvci5nZXRSZXNpZHVlQ29vcmRpbmF0ZXMoKGxvd2VzdExpbmtlZFJlcyArIGhpZ2hlc3RMaW5rZWRSZXMpIC8gMiwgMCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHZhciBmcm9tTW9sZWN1bGUgPSB0aGlzLmZyb21TZXF1ZW5jZURhdGFbMF0ubm9kZTtcclxuICAgICAgICB2YXIgdG9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HNvIGV2ZXl0aGluZyBpcyBhbHdheXMgaW4gcmFkaWFuXHJcbiAgICAgICAgdmFyIGFibXBEZWcgPSBhbmdsZUJldHdlZW5NaWRQb2ludHMgLyAoMiAqIE1hdGguUEkpICogMzYwO1xyXG4gICAgICAgIGlmIChhYm1wRGVnIDwgMCkge1xyXG4gICAgICAgICAgICBhYm1wRGVnICs9IDM2MDtcclxuICAgICAgICB9XHJcblxyXG5cdFx0Ly9vdXQgaXMgdmFsdWUgd2UgdXNlIHRvIGRlY2lkZSB3aGljaCBzaWRlIG9mIGJhciB0aGUgbGluayBnbHlwaCBpcyBkcmF3blxyXG5cdFx0Ly9maXJzdCBmb3IgJ2Zyb20nIGludGVyYWN0b3JcclxuICAgICAgICB2YXIgb3V0ID0gKGFibXBEZWcgLSBmcm9tTW9sZWN1bGUucm90YXRpb24pO1xyXG4gICAgICAgIGlmIChvdXQgPCAwKSB7XHJcbiAgICAgICAgICAgIG91dCArPSAzNjA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHZhciBmeU9mZnNldCA9IDEwO1xyXG4gICAgICAgIGlmIChvdXQgPCAxODApIHtcclxuICAgICAgICAgICAgZnlPZmZzZXQgPSAtMTA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHZhciBmUm90UmFkID0gKGZyb21Nb2xlY3VsZS5yb3RhdGlvbiAvIDM2MCkgKiBNYXRoLlBJICogMjtcclxuICAgICAgICBpZiAob3V0ID4gMTgwKSB7XHJcbiAgICAgICAgICAgIGZSb3RSYWQgPSBmUm90UmFkIC0gTWF0aC5QSTtcclxuICAgICAgICB9XHJcblx0XHQvL25vdyBmb3IgJ3RvJyBpbnRlcmFjdG9yXHJcbiAgICAgICAgb3V0ID0gKGFibXBEZWcgLSB0b01vbGVjdWxlLnJvdGF0aW9uKTtcclxuICAgICAgICBpZiAob3V0IDwgMCkge1xyXG4gICAgICAgICAgICBvdXQgKz0gMzYwO1xyXG4gICAgICAgIH1cclxuICAgICAgICB2YXIgdHlPZmZzZXQgPSAxMDtcclxuICAgICAgICBpZiAob3V0ID4gMTgwKSB7XHJcbiAgICAgICAgICAgIHR5T2Zmc2V0ID0gLTEwO1xyXG4gICAgICAgIH1cclxuICAgICAgICB2YXIgdFJvdFJhZCA9ICh0b01vbGVjdWxlLnJvdGF0aW9uIC8gMzYwKSAqIE1hdGguUEkgKiAyO1xyXG4gICAgICAgIGlmIChvdXQgPCAxODApIHtcclxuICAgICAgICAgICAgdFJvdFJhZCA9IHRSb3RSYWQgLSBNYXRoLlBJO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgdmFyIGZ0TWlkID0gW2ZNaWRbMF0gKyAoMzAgKiBNYXRoLnNpbihmUm90UmFkKSAqIHRoaXMuY29udHJvbGxlci56KSxcclxuICAgICAgICAgICAgZk1pZFsxXSAtICgzMCAqIE1hdGguY29zKGZSb3RSYWQpICogdGhpcy5jb250cm9sbGVyLnopXTtcclxuICAgICAgICBpZiAoZnJvbU1vbGVjdWxlLmZvcm0gPT09IDApIHtcclxuICAgICAgICAgICAgZnRNaWQgPSBmTWlkO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgdmFyIHR0TWlkID0gW3RNaWRbMF0gKyAoMzAgKiBNYXRoLnNpbih0Um90UmFkKSAqIHRoaXMuY29udHJvbGxlci56KSxcclxuICAgICAgICAgICAgdE1pZFsxXSAtICgzMCAqIE1hdGguY29zKHRSb3RSYWQpICogdGhpcy5jb250cm9sbGVyLnopXTtcclxuICAgICAgICBpZiAodG9Nb2xlY3VsZS5mb3JtID09PSAwKSB7XHJcbiAgICAgICAgICAgIHR0TWlkID0gdE1pZDtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHZhciB0cmlQb2ludE1pZCA9IFsoZnRNaWRbMF0gKyB0dE1pZFswXSkgLyAyLCAoZnRNaWRbMV0gKyB0dE1pZFsxXSkgLyAyXTtcclxuICAgICAgICB2YXIgZlNEQ291bnQgPSB0aGlzLmZyb21TZXF1ZW5jZURhdG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