All Downloads are FREE. Search and download functionalities are using the official Maven repository.

view.lib.cginput.js Maven / Gradle / Ivy

Go to download

Runner / Testbed to locally run Games created using the CodinGame engine toolkit.

There is a newer version: 4.5.0
Show newest version
!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.cginput=t():n.cginput=t()}(window,(function(){return function(n){var t={};function e(i){if(t[i])return t[i].exports;var u=t[i]={i:i,l:!1,exports:{}};return n[i].call(u.exports,u,u.exports,e),u.l=!0,u.exports}return e.m=n,e.c=t,e.d=function(n,t,i){e.o(n,t)||Object.defineProperty(n,t,{enumerable:!0,get:i})},e.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},e.t=function(n,t){if(1&t&&(n=e(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var i=Object.create(null);if(e.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var u in n)e.d(i,u,function(t){return n[t]}.bind(null,u));return i},e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,"a",t),t},e.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},e.p="",e(e.s=32)}([function(n,t,e){var i,u,p,r;
/*!
 * mustache.js - Logic-less {{mustache}} templates with JavaScript
 * http://github.com/janl/mustache.js
 */r=function(n){var t=Object.prototype.toString,e=Array.isArray||function(n){return"[object Array]"===t.call(n)};function i(n){return"function"==typeof n}function u(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function p(n,t){return null!=n&&"object"==typeof n&&t in n}var r=RegExp.prototype.test,a=/\S/;function o(n){return!function(n,t){return r.call(n,t)}(a,n)}var s={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},h=/\s*/,l=/\s+/,d=/\s*=/,c=/\s*\}/,f=/#|\^|\/|>|\{|&|=|!/;function m(n){this.string=n,this.tail=n,this.pos=0}function A(n,t){this.view=n,this.cache={".":this.view},this.parent=t}function y(){this.cache={}}m.prototype.eos=function(){return""===this.tail},m.prototype.scan=function(n){var t=this.tail.match(n);if(!t||0!==t.index)return"";var e=t[0];return this.tail=this.tail.substring(e.length),this.pos+=e.length,e},m.prototype.scanUntil=function(n){var t,e=this.tail.search(n);switch(e){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,e),this.tail=this.tail.substring(e)}return this.pos+=t.length,t},A.prototype.push=function(n){return new A(n,this)},A.prototype.lookup=function(n){var t,e,u,r=this.cache;if(r.hasOwnProperty(n))t=r[n];else{for(var a,o,s,h=this,l=!1;h;){if(n.indexOf(".")>0)for(a=h.view,o=n.split("."),s=0;null!=a&&s0?u[u.length-1][4]:e;break;default:i.push(t)}return e}(function(n){for(var t,e,i=[],u=0,p=n.length;u"===r?a=this.renderPartial(p,t,e,u):"&"===r?a=this.unescapedValue(p,t):"name"===r?a=this.escapedValue(p,t):"text"===r&&(a=this.rawValue(p)),void 0!==a&&(o+=a);return o},y.prototype.renderSection=function(n,t,u,p){var r=this,a="",o=t.lookup(n[1]);if(o){if(e(o))for(var s=0,h=o.length;s0||!e)&&(u[p]=i+u[p]);return u.join("\n")},y.prototype.renderPartial=function(n,t,e,u){if(e){var p=i(e)?e(n[1]):e[n[1]];if(null!=p){var r=n[6],a=n[5],o=n[4],s=p;return 0==a&&o&&(s=this.indentPartial(p,o,r)),this.renderTokens(this.parse(s,u),t,e,s)}}},y.prototype.unescapedValue=function(n,t){var e=t.lookup(n[1]);if(null!=e)return e},y.prototype.escapedValue=function(t,e){var i=e.lookup(t[1]);if(null!=i)return n.escape(i)},y.prototype.rawValue=function(n){return n[1]},n.name="mustache.js",n.version="3.1.0",n.tags=["{{","}}"];var g=new y;return n.clearCache=function(){return g.clearCache()},n.parse=function(n,t){return g.parse(n,t)},n.render=function(n,t,i,u){if("string"!=typeof n)throw new TypeError('Invalid template! Template should be a "string" but "'+(e(p=n)?"array":typeof p)+'" was given as the first argument for mustache#render(template, view, partials)');var p;return g.render(n,t,i,u)},n.to_html=function(t,e,u,p){var r=n.render(t,e,u);if(!i(p))return r;p(r)},n.escape=function(n){return String(n).replace(/[&<>"'`=\/]/g,(function(n){return s[n]}))},n.Scanner=m,n.Context=A,n.Writer=y,n},t&&"string"!=typeof t.nodeName?r(t):(u=[t],void 0===(p="function"==typeof(i=r)?i.apply(t,u):i)||(n.exports=p))},function(n,t,e){var i=e(3),u=e(17),p=e(18),r=e(19);n.exports=function(n,t,e){if(null==n)return"";return e="string"!=typeof e?" ":e,n=String(n).replace(p,"$1 $2").replace(r,"$1 $2").replace(u,(function(n,t,i){return 0===t||t===i.length-n.length?"":e})),i(n,t)}},function(n,t){var e={tr:{regexp:/[\u0069]/g,map:{i:"İ"}},az:{regexp:/[\u0069]/g,map:{i:"İ"}},lt:{regexp:/[\u0069\u006A\u012F]\u0307|\u0069\u0307[\u0300\u0301\u0303]/g,map:{"i̇":"I","j̇":"J","į̇":"Į","i̇̀":"Ì","i̇́":"Í","i̇̃":"Ĩ"}}};n.exports=function(n,t){var i=e[t];return n=null==n?"":String(n),i&&(n=n.replace(i.regexp,(function(n){return i.map[n]}))),n.toUpperCase()}},function(n,t){var e={tr:{regexp:/\u0130|\u0049|\u0049\u0307/g,map:{"İ":"i",I:"ı","İ":"i"}},az:{regexp:/[\u0130]/g,map:{"İ":"i",I:"ı","İ":"i"}},lt:{regexp:/[\u0049\u004A\u012E\u00CC\u00CD\u0128]/g,map:{I:"i̇",J:"j̇","Į":"į̇","Ì":"i̇̀","Í":"i̇́","Ĩ":"i̇̃"}}};n.exports=function(n,t){var i=e[t];return n=null==n?"":String(n),i&&(n=n.replace(i.regexp,(function(n){return i.map[n]}))),n.toLowerCase()}},function(n,t){function e(t,i){return n.exports=e=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n},e(t,i)}n.exports=e},function(n,t,e){var i=e(2);n.exports=function(n,t){return null==n?"":(n=String(n),i(n.charAt(0),t)+n.substr(1))}},function(n,t){function e(n){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function i(t){return"function"==typeof Symbol&&"symbol"===e(Symbol.iterator)?n.exports=i=function(n){return e(n)}:n.exports=i=function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":e(n)},i(t)}n.exports=i},function(n,t,e){t.no=t.noCase=e(1),t.dot=t.dotCase=e(20),t.swap=t.swapCase=e(21),t.path=t.pathCase=e(22),t.upper=t.upperCase=e(2),t.lower=t.lowerCase=e(3),t.camel=t.camelCase=e(9),t.snake=t.snakeCase=e(10),t.title=t.titleCase=e(23),t.param=t.paramCase=e(24),t.kebab=t.kebabCase=t.paramCase,t.hyphen=t.hyphenCase=t.paramCase,t.header=t.headerCase=e(25),t.pascal=t.pascalCase=e(26),t.constant=t.constantCase=e(27),t.sentence=t.sentenceCase=e(28),t.isUpper=t.isUpperCase=e(29),t.isLower=t.isLowerCase=e(30),t.ucFirst=t.upperCaseFirst=e(5),t.lcFirst=t.lowerCaseFirst=e(31)},function(n,t){function e(t){return n.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},e(t)}n.exports=e},function(n,t,e){var i=e(2),u=e(1);n.exports=function(n,t,e){var p=u(n,t);return e||(p=p.replace(/ (?=\d)/g,"_")),p.replace(/ (.)/g,(function(n,e){return i(e,t)}))}},function(n,t,e){var i=e(1);n.exports=function(n,t){return i(n,t,"_")}},function(n,t,e){var i=e(4);n.exports=function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),t&&i(n,t)}},function(n,t,e){var i=e(8),u=e(4),p=e(15),r=e(16);function a(t){var e="function"==typeof Map?new Map:void 0;return n.exports=a=function(n){if(null===n||!p(n))return n;if("function"!=typeof n)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(n))return e.get(n);e.set(n,t)}function t(){return r(n,arguments,i(this).constructor)}return t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),u(t,n)},a(t)}n.exports=a},function(n,t,e){var i=e(6),u=e(14);n.exports=function(n,t){return!t||"object"!==i(t)&&"function"!=typeof t?u(n):t}},function(n,t){n.exports=function(n){if(void 0===n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}},function(n,t){n.exports=function(n){return-1!==Function.toString.call(n).indexOf("[native code]")}},function(n,t,e){var i=e(4);function u(t,e,p){return!function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(n){return!1}}()?n.exports=u=function(n,t,e){var u=[null];u.push.apply(u,t);var p=new(Function.bind.apply(n,u));return e&&i(p,e.prototype),p}:n.exports=u=Reflect.construct,u.apply(null,arguments)}n.exports=u},function(n,t){n.exports=/[^A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]+/g},function(n,t){n.exports=/([a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19])([A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AD\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A])/g},function(n,t){n.exports=/([A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AD\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A])([A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AD\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A][a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A])/g},function(n,t,e){var i=e(1);n.exports=function(n,t){return i(n,t,".")}},function(n,t,e){var i=e(2),u=e(3);n.exports=function(n,t){if(null==n)return"";for(var e="",p=0;p0},n.prototype.hasString=function(){return this.containsVarString},n}();function c(n,t){c=function(n,t){return new r(n,void 0,t)};var e=s()(RegExp),i=RegExp.prototype,u=new WeakMap;function r(n,t,i){var p=e.call(this,n,t);return u.set(p,i||u.get(n)),p}function o(n,t){var e=u.get(t);return Object.keys(e).reduce((function(t,i){return t[i]=n[e[i]],t}),Object.create(null))}return a()(r,e),r.prototype.exec=function(n){var t=i.exec.call(this,n);return t&&(t.groups=o(t,this)),t},r.prototype[Symbol.replace]=function(n,t){if("string"==typeof t){var e=u.get(this);return i[Symbol.replace].call(this,n,t.replace(/\$<([^>]+)>/g,(function(n,t){return"$"+e[t]})))}if("function"==typeof t){var r=this;return i[Symbol.replace].call(this,n,(function(){var n=[];return n.push.apply(n,arguments),"object"!==p()(n[n.length-1])&&n.push(o(n,r)),t.apply(this,n)}))}return i[Symbol.replace].call(this,n,t)},c.apply(this,arguments)}function f(n,t){this.message=n+": "+JSON.stringify(t),this.name=n,this.params=t}var m,A=function(){function n(){this.cursor=0,this.allowType=["int","long","float","string","word","bool","array"]}return n.prototype.getCodeName=function(n,t){for(var e=0;n[t+"@>"+e];)e++;return t+"@>"+e},n.prototype.getFirstCodeName=function(n){return n+"@>0"},n.prototype.parse=function(n,t){try{this.write=[],this.vars={},this.code=n;var e=new d;for(e.turnBased=t;this.hasNext();)this.parseTree(e.root,e,0);return e}finally{this.write=null,this.code=null,this.cursor=0}},n.prototype.read=function(n,t){for(var e=0,i=this.nextLine().split(" ");e1&&t.children.some((function(n){return"string"===n.name})))throw new Error("InvalidStringRead")},n.prototype.call=function(n,t){var e=this.nextLine(),i=c(/(?:([\0-\x08\x0E-\x1F!-'\*-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uFEFE\uFF00-\uFFFF]+):([\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uFEFE\uFF00-\uFFFF]+) )?([\0-\x08\x0E-\x1F!-'\*-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uFEFE\uFF00-\uFFFF]+)(\(([\0-'\*-\uFFFF]*)\))/,{res:1,restype:2,name:3,dim:5}).exec(e);if(null==i)throw new f("InvalidCallArguments",{arguments:e,line:this.getLineNumber()});var u=i.groups.res,p=i.groups.restype,r=i.groups.name,a=i.groups.dim.trim().split(/\s*,\s*/);if(!/^[$a-zA-Z_][0-9a-zA-Z_$]*$/.test(r))throw new f("InvalidFunction",{function:r,line:this.getLineNumber()});var o=new l(r,t);if(o.param={ret:u},o=new l(p,o),/^array\[[a-z]+(\(([a-zA-Z0-9](,\s*)?)*\))?\]\(([a-zA-Z0-9]*(,\s*)?)*\)$/.test(p))this.createArrayNode(n,o,r,p);else if(p&&!this.allowType.includes(p))throw new f("InvalidReturnType",{function:r,type:p,line:this.getLineNumber()});for(var s=0,h=a;s0&&this.write.forEach((function(n){n.comment||(n.comment=D.join("\n"))}));break;case"STATEMENT":A=[];for(this.hasNext()&&this.nextLine();this.hasNext();){var S;if(0===(S=this.nextLine()).length)break;A.push(S,"\n")}A.length>0&&(A.pop(),t.statement=A.join(""));break;default:throw new f("InvalidKeyword",{param:u,line:this.getLineNumber()})}}},n.prototype.next=function(){for(;this.hasNext()&&(" "===this.code.charAt(this.cursor)||"\n"===this.code.charAt(this.cursor));)this.cursor++;for(var n=this.cursor;this.hasNext()&&" "!==this.code.charAt(this.cursor)&&"\n"!==this.code.charAt(this.cursor);)this.cursor++;return this.code.substring(n,this.cursor).trim()},n.prototype.nextLine=function(){for(var n=this.cursor;this.hasNext()&&"\n"!==this.code.charAt(this.cursor);)this.cursor++;return this.code.substring(n,this.cursor++).trim()},n.prototype.hasNext=function(){return this.cursor0&&this.code.push(" ".repeat(t)),this},n.prototype.indentString=function(n,t){var e=" ".repeat(t*this.indentSize);return n.split("\n").map((function(n){return/^{{?[a-zA-Z0-9&{}]*}}$/.test(n)?n:e+n})).join("\n")},n.prototype.nl=function(){return this.code.push("\n"),this},n.prototype.formatVarNames=function(){var n=this.caseConversion,t=this.input.vars||{};for(var e in t)t[e].name=n(t[e].original);for(var i=0,u=this.input.loops||[];i1?n.length+"*":"")+String.fromCharCode(this.loop-1)+(0===u?"":"+"+u)+"))",r=n[u].name;this.nl().indent().append(r+"=${myArray["+p+"]}")}},t.prototype.handleLoopLine=function(n){this.nl().indent().append("read -r -a myArray"),this.handleLoop(n)},t.prototype.handleLoop=function(n){var t=String.fromCharCode(this.loop),e=isNaN(n.param)?"$"+n.param:n.param;this.nl().indent().append("for (( "+t+"=0; "+t+"<"+e+"; "+t+"++ )); do"),this.incIndent(),this.loop++,this.write(n.children[0]),this.loop--,this.decIndent(),this.nl().indent().append("done")},t.prototype.handleGameLoop=function(n){this.nl(),this.nl().indent().append("# game loop").nl(),this.indent().append("while true; do"),this.incIndent();for(var t=0,e=n;t&2').nl(),this.nl(),this.doMarkup&&this.append("").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u0?'"'+t+'"':"").replace(/""/g,"")),null==e||i||this.append(" # ").append(e);else{var a=n.split("\n");if(a.length>1||a[0].length>0){this.indent().append('echo "').append(a[0]).append('"'),null==e||i||this.append(" # ").append(e);for(var o=1;o")},t}(g),v=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),F=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.loop="i".charCodeAt(0),t.indentSize=2,t.toClose=0,t.inRead=!1,t}return v(t,n),t.prototype.begin=function(){if(this.append("(ns ").append(this.input.turnBased?"Player":"Solution"),this.incIndent(),this.nl().append("(:gen-class))"),this.decIndent(),this.nl(),this.input.hasStatement()){var n=this.input.statement.replace(/\n/g,"\n; ");this.nl().append("; ").append(n),this.nl()}this.nl().append("(defn -main [& args]"),this.incIndent(),this.toClose++},t.prototype.nl=function(){return this.code.push("\n"),this.indent(),this},t.prototype.end=function(){this.append(")".repeat(this.toClose))},t.prototype.getNext=function(n){var t=n.parent.children,e=t.indexOf(n);return t[e+1]},t.prototype.handleRead=function(n,t){var e=this.getNext(t);this.inRead||(this.inRead=!0,this.comments=[],this.nl().append("(let ["),this.last=null,this.newLineNeeded=!1);for(var i=t.children.length,u=0;u "+t+" 0)"),this.incIndent(),this.write(n.children[0]),this.loop--,this.decIndent(),this.nl().append("(recur (dec "+t+"))))"),"read"!==n.children[0].name&&"readline"!==n.children[0].name||(this.append(")"),this.toClose--),this.decIndent(),this.decIndent()},t.prototype.handleGameLoop=function(n){this.nl().append("(while true"),this.incIndent();for(var t=0,e=n;t"),null!=e)for(var u=0,p=e.split("\n");u0&&i.nl().append('(print "'+t+'")'),i.nl().append("(print "),n.type){case"VAR":i.append(n.node.children[0].name);break;case"CONST":i.append('"'+n.value+'"')}i.append(")")})),this.nl().append('(println "")');else{var a=n.split("\n");if(a.length>1||a[0].length>0)for(var o=0,s=a;o").nl()},t}(g),D=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),S=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return D(t,n),t.prototype.begin=function(){this.append('.name "zork"\n.comment "just a basic living prog"\n.extend\n\nl2: sti r1,%:live,%0x1\n\tand r1,%0,r1\nlive: live %1\n\tzjmp %:live\n\n.code 42 DE AD C0 DE 12 34 61 34 61 23 61\n')},t}(g),L=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),O=function(){return(O=Object.assign||function(n){for(var t,e=1,i=arguments.length;e").nl(),this.append("#include ").nl(),this.append("#include ").nl(),this.append("#include ").nl(),this.input.needSolveFunction&&this.append("#include ").nl(),this.nl(),this.append("using namespace std;").nl().nl(),this.input.hasStatement()){this.append("/**").nl();for(var n=0,t=this.input.statement.split("\n");n").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u0?' << "'+t+'" << ':" << ").replace(/" << "/g,"")),this.append(" << endl;"),null==e||i||this.append(" // ").append(e);else{var a=n.split("\n");if(a.length>1||a[0].length>0){this.indent().append('cout << "').append(a[0]).append('" << endl;'),null==e||i||this.append(" // ").append(e);for(var o=1;o")},t.prototype.handleDump=function(n){if("string"==typeof n)this.nl().indent().append(this.rawOutput(n));else if(n.type.name===this.ARRAY){for(var t=n.name,e=this.loopTpl,u=n.type.dimensions.length,p=0;p> "+n.name+";"},t.prototype.variableOutput=function(n){return"cout << "+this.formattedVarName(n.name)+" << endl;"},t.prototype.rawOutput=function(n){return"cout << "+n+" << endl;"},t.prototype.appendReadStatement=function(n){this.nl().indent().append("cin"),this.append(" >> ").append(n.join(" >> ")).append("; cin.ignore();")},t.prototype.functionReturnType=function(n){return n.type.name?n.type.name===this.ARRAY?i.render(this.typeMapping[n.type.name],{dim:n.type.dimensions,type:this.typeMapping[n.type.innerType.name]}):i.render(this.typeMapping[n.type.name],{}):this.voidReturnType},t.prototype.functionSignatureSimple=function(n,t){return n+"("+t+")"},t.prototype.functionSignatureFull=function(n,t,e){return t+" "+this.functionSignatureSimple(n,e)},t.prototype.functionDeclaration=function(n,t,e,i){return"\n"+this.functionSignatureFull(n,t,e)+'\n{\n    // Write your code here\n    // To debug: cerr << "Debug messages..." << endl;\n    '+i+"\n}\n"},t.prototype.defaultReturnStatement=function(n){var t,e=((t={})[this.INT]="0",t[this.LONG]="0",t[this.FLOAT]="0.0",t[this.WORD]='""',t[this.STRING]='""',t[this.ARRAY]=this.typeDeclaration(n)+"()",t);return n.name?"\n    return "+e[n.name]+";":""},t.prototype.functionCall=function(n,t,e,u){return i.render("int std_out_fd = dup(1);\ndup2(2, 1);\n{{#type}}{{{type}}} {{{res}}} = {{/type}}{{{name}}}({{{params}}});\ndup2(std_out_fd, 1);",{name:n,type:t,res:e,params:u})},t.prototype.buildReadLoop=function(n,t,e,u){var p=n.type.dimensions.length;if(0===u)return t;var r=p-u,a="";if(1===u){var o={name:n.name+"_tmp",type:{name:n.type.innerType.name,dimensions:n.type.innerType.dimensions}};a=this.variableDefinitionStatement(o)+"\n",a+=this.variableRead(o)+"\n",a+=e+".push_back("+o.name+");"}else{var s=O(O({},n.type),{dimensions:n.type.dimensions.slice(0,-(r+1))});a=e+(".push_back("+this.typeDeclaration(s)+"());\n")+this.loopTpl}var h=i.render(t,{counter:this.sletters[r],start:0,end:n.type.dimensions[r],body:this.indentString(a,r+1)});return this.buildReadLoop(n,h,e+"["+this.sletters[r]+"]",u-1)},t.prototype.buildStatementData=function(n,t,e){var i=this,u=t.map((function(n){return i.variableDefinition(n)})).join(", "),p=t.map((function(n){return n.name})).join(", "),r=this.functionReturnType(e);return{functionNomenclature:"function",arrayNomenclature:"vector",null:"NULL",parameters:t.map((function(n){return{name:n.name,label:i.formattedVarName(n.name),type:i.typeDeclaration(n.type)}})),functionName:n,functionSimple:this.functionSignatureSimple(n,p),functionFull:this.functionSignatureFull(n,r,u),returnType:r}},t}(g),R=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),N=function(n){function t(){var t,e,i=null!==n&&n.apply(this,arguments)||this;return i.loop="i".charCodeAt(0),i.typeMapping=((t={})[i.FLOAT]="float",t[i.INT]="int",t[i.LONG]="long",t[i.STRING]="string",t[i.WORD]="string",t[i.BOOL]="bool",t[i.ARRAY]="{{&type}}[{{&dim}}]",t),i.readMapping=((e={})[i.INT]="int.Parse(%s)",e[i.LONG]="long.Parse(%s)",e[i.WORD]="%s",e[i.STRING]="%s",e[i.FLOAT]="float.Parse(%s)",e[i.BOOL]='%s != "0"',e[i.ARRAY]="new {{&type}}[{{&dim}}]",e),i.MAGIC_TOKEN="@@ C# is evil @@",i.EVIL_TOKEN="@@ C# is magic @@",i.evilIndentation=0,i.needWizard=0,i.loopLine=!1,i.caseConversion=g.CASE_CONVERSIONS.CAMEL,i.methodCaseConversion=g.CASE_CONVERSIONS.PASCAL,i.loopTpl="for (int {{&counter}} = {{&start}}; {{&counter}} < {{&end}}; {{&counter}}++)\n{\n{{&body}}\n}",i.voidReturnType="void",i}return R(t,n),t.prototype.begin=function(){if(this.append("using System;").nl(),this.append("using System.Linq;").nl(),this.append("using System.IO;").nl(),this.append("using System.Text;").nl(),this.append("using System.Collections;").nl(),this.append("using System.Collections.Generic;").nl(),this.nl(),this.input.hasStatement()){this.append("/**").nl();for(var n=0,t=this.input.statement.split("\n");n1?"\n        string[] inputs;":"")).replace(this.EVIL_TOKEN,1===this.needWizard?"string[] ":""),this.code=[n]},t.prototype.handleRead=function(n){if(this.nl().indent(),n.length>1){0===this.needWizard?(this.evilIndentation=this.level,this.append(this.EVIL_TOKEN).append("inputs = Console.ReadLine().Split(' ');")):this.append("inputs = Console.ReadLine().Split(' ');"),this.needWizard++;for(var t=0,e=0,i=n;e1?n.length+"*":"")+String.fromCharCode(this.loop-1)+(0===t?"":"+"+t),u=this.format(this.readMapping[e.type.name],["inputs["+i+"]"]);this.nl().indent().append(this.typeDeclaration(e.type)+" ").append(e.name).append(" = ").append(u).append(";"),null!=e.comment&&this.append("// ").append(e.comment)}},t.prototype.handleLoop=function(n){var t=String.fromCharCode(this.loop);this.nl().indent().append("for (int "+t+" = 0; "+t+" < "+n.param+"; "+t+"++)").nl().indent().append("{"),this.incIndent(),this.loop++,this.write(n.children[0]),this.loop--,this.decIndent(),this.nl().indent().append("}")},t.prototype.handleLoopLine=function(n){0===this.needWizard?(this.evilIndentation=this.level,this.nl().indent().append(this.EVIL_TOKEN).append("inputs = Console.ReadLine().Split(' ');")):this.nl().indent().append("inputs = Console.ReadLine().Split(' ');"),this.needWizard++,this.handleLoop(n)},t.prototype.handleGameLoop=function(n){this.nl(),this.nl().indent().append("// game loop").nl(),this.indent().append("while (true)").nl().indent().append("{"),this.incIndent();for(var t=0,e=n;t").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u0?' + "'+t+'" + ':" + ").replace(/" \+ "/g,"")),this.append(");"),null==e||i||this.append(" // ").append(e);else{var a=n.split("\n");if(a.length>1||a[0].length>0){this.indent().append('Console.WriteLine("').append(a[0]).append('");'),null==e||i||this.append(" // ").append(e).nl();for(var o=1;o")},t.prototype.handleDump=function(n){if("string"==typeof n)this.nl().indent().append(this.variableOutput(n));else if(n.type.name===this.ARRAY){var t=n.type.dimensions.length,e=this.buildDumpLoop(n,n.name,t);this.nl().append(this.indentString(e,this.level))}else{var i=this.formattedVarName(n.name);this.nl().indent().append(this.variableOutput(i))}},t.prototype.handleCall=function(n,t,e){var i=this,u=t.map((function(n){return i.typeDeclaration(n.type)+" "+i.formattedVarName(n.name)})).join(", "),p=t.map((function(n){return i.formattedVarName(n.name)})).join(", "),r=this.code.findIndex((function(n){return"{{{solve}}}"===n}));this.code[r]=this.functionDeclaration(n,u,this.typeDeclaration(e.type),this.defaultReturnStatement(e.type));var a=this.functionCall(n,e.type.name!==this.voidReturnType?this.typeDeclaration(e.type):"",e.name,p);this.nl().append(this.indentString(a,this.level))},t.prototype.buildReadLoop=function(n,t,e,u){var p=n.type.dimensions.length,r="";if(r=0===this.needWizard?this.EVIL_TOKEN+"inputs = Console.ReadLine().Split(' ');\n":"inputs = Console.ReadLine().Split(' ');\n",this.needWizard++,0===u)return t;var a=p-u,o="",s=e;s+=u===p?"["+this.sletters[a]:","+this.sletters[a],1===u?o=n.type.innerType.name===this.STRING?s+"] = Console.ReadLine();":s+"] = "+this.format(this.readMapping[n.type.innerType.name],["inputs["+this.sletters[a]+"]"])+";":(2===u&&n.type.innerType.name!==this.STRING&&(o=r),o+=this.loopTpl);var h="";return 1===p&&n.type.innerType.name!==this.STRING&&(h=r),h+=i.render(t,{counter:this.sletters[a],start:0,end:this.formattedVarName(n.type.dimensions[a]),body:this.indentString(o,a+1)}),this.buildReadLoop(n,h,s,u-1)},t.prototype.buildDumpLoop=function(n,t,e){var u=n.type.dimensions.length,p=u-e,r="",a=t;return e===u&&(a+="["),1===e?(a+=this.sletters[p]+"]",r=this.variableOutput(a)):(a+=this.sletters[p]+",",r=this.buildDumpLoop(n,a,e-1)),i.render(this.loopTpl,{counter:this.sletters[p],start:0,end:n.type.dimensions[p]?this.formattedVarName(n.type.dimensions[p]):this.formattedVarName(n.name)+".GetLength("+p+")",body:this.indentString(r,1)})},t.prototype.variableOutput=function(n){return"Console.WriteLine("+n+");"},t.prototype.functionSignatureSimple=function(n,t){return n+"("+t+")"},t.prototype.functionSignatureFull=function(n,t,e){return e+" "+this.functionSignatureSimple(n,t)},t.prototype.functionDeclaration=function(n,t,e,i){return"\n    public static "+this.functionSignatureFull(n,t,e)+'\n    {\n        // Write your code here\n        // To debug: Console.Error.WriteLine("Debug messages...");\n        '+i+"\n    }\n\n"},t.prototype.defaultReturnStatement=function(n){return n.name?"\n        return default("+this.typeDeclaration(n)+");":""},t.prototype.functionCall=function(n,t,e,u){return i.render("var stdtoutWriter = Console.Out;\nConsole.SetOut(Console.Error);\n{{#type}}{{&type}} {{&res}} = {{/type}}{{&name}}({{¶ms}});\nConsole.SetOut(stdtoutWriter);",{name:n,type:t,res:e,params:u})},t.prototype.typeDeclaration=function(n){if(n.name){var t=this.typeMapping[n.name];return n.name===this.ARRAY?i.render(t,{dim:",".repeat(n.dimensions.length-1),type:this.typeMapping[n.innerType.name]}):i.render(t,{})}return this.voidReturnType},t.prototype.variableDefinition=function(n){var t=this.typeDeclaration(n.type)+" "+n.name;return n.type.name===this.ARRAY?t+" = "+i.render(this.readMapping[this.ARRAY],{dim:n.type.dimensions.join(","),type:this.typeMapping[n.type.innerType.name]}):t},t.prototype.variableDefinitionStatement=function(n){return this.variableDefinition(n)+";"},t.prototype.buildStatementData=function(n,t,e){var i=this,u=t.map((function(n){return i.typeDeclaration(n.type)+" "+i.formattedVarName(n.name)})).join(", "),p=t.map((function(n){return i.formattedVarName(n.name)})).join(", "),r=this.typeDeclaration(e.type);return{functionNomenclature:"method",arrayNomenclature:"array",null:"null",parameters:t.map((function(n){return{name:n.name,label:i.formattedVarName(n.name),type:i.typeDeclaration(n.type)}})),functionName:n,functionSimple:this.functionSignatureSimple(n,p),functionFull:this.functionSignatureFull(n,u,r),returnType:r}},t}(g),b=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),T=function(){return(T=Object.assign||function(n){for(var t,e=1,i=arguments.length;e","#include ","#include ","#include "],i}return b(t,n),t.prototype.begin=function(){var n=this;if((this.input.needSolveFunction?I(this.headers,["#include "]):this.headers).forEach((function(t){n.append(t).nl()})),this.nl(),this.input.hasStatement()){this.append("/**").nl();for(var t=0,e=this.input.statement.split("\n");t0&&(e.appendReadStatement(u,p,r),r=[],u=[],p=[])},o=0,s=n;o").nl();var u=null!=e&&(e.length>50||e.split("\n").length>1);if(u){for(var p=0,r=e.split("\n");p1||o[0].length>0){this.indent().append('printf("').append(o[0]).append('\\n");'),null==e||u||this.append(" // ").append(e);for(var s=1;s")},t.prototype.handleDump=function(n){if("string"==typeof n)this.nl().indent().append(this.rawOutput(n));else if(n.type.name===this.ARRAY){var t=n.type.dimensions.length,e=this.buildDumpLoop(n,n.name,t);this.nl().append(this.indentString(e,this.level))}else this.nl().indent().append(this.variableOutput(n))},t.prototype.handleCall=function(n,t,e){this.returnVariableName=e.name;var i=this.createFunctionArguments(t,e),u=i.args,p=i.params;this.declareReturnVariableDimensionVariables(e);var r=this.code.findIndex((function(n){return"{{{solve}}}"===n}));this.code[r]=this.functionDeclaration(n,u.join(", "),e.type.name?this.returnTypeDefinition(e):this.voidReturnType,this.defaultReturnStatement(e.type.name));var a=this.functionCall(n,e.name?this.returnTypeDefinition(e):"",e.name,p.join(", "));this.nl().append(this.indentString(a,this.level))},t.prototype.computeDimension=function(n){var t=parseInt(n,10);return Number.isNaN(t)?n+" + 1":t+1},t.prototype.declareReturnVariableDimensionVariables=function(n){if(n.name&&n.type.name===this.ARRAY){var t=n.type.dimensions.length;if(1===t){var e=n.name+"_count";this.nl().indent().append("int "+e+";")}else for(var i=0;i1?p:"")+"_count":this.formattedVarName(n.type.dimensions[p]);return i.render(this.loopTpl,{counter:this.sletters[p],start:0,end:o,body:this.indentString(r,1)})},t.prototype.variableOutput=function(n){return'printf("'+this.typeSpecifiers[n.type.name!==this.ARRAY?n.type.name:n.type.innerType.name]+'\\n", '+this.formattedVarName(n.name)+");"},t.prototype.rawOutput=function(n){return"printf("+n+");"},t.prototype.functionSignatureSimple=function(n,t){return n+"("+t+")"},t.prototype.functionSignatureFull=function(n,t,e){return e+" "+this.functionSignatureSimple(n,t)},t.prototype.functionDeclaration=function(n,t,e,i){return"\n"+this.functionSignatureFull(n,t,e)+'\n{\n    // Write your code here\n    // To debug: fprintf(stderr, "Debug messages...\\n");\'\n    '+i+"\n}\n"},t.prototype.defaultReturnStatement=function(n){var t,e=((t={})[this.INT]="0",t[this.LONG]="0",t[this.FLOAT]="0.0",t[this.WORD]='""',t[this.STRING]='""',t[this.ARRAY]="NULL",t);return n?"\n    return "+e[n]+";":""},t.prototype.functionCall=function(n,t,e,u){return i.render("int std_out_fd = dup(1);\ndup2(2, 1);\n{{#type}}{{&type}} {{&res}} = {{/type}}{{&name}}({{¶ms}});\ndup2(std_out_fd, 1);",{name:n,type:t,res:e,params:u})},t.prototype.variableDefinition=function(n,t){var e=this;if([this.ARRAY,this.STRING,this.WORD].includes(n.type.name)){var u=n.type.innerType&&n.type.innerType.dimensions?[this.computeDimension(n.type.innerType.dimensions)]:[],p=n.type.name===this.ARRAY?n.type.dimensions:[this.computeDimension(n.type.dimensions)],r=I(p,u).map((function(n){return e.formattedVarName(String(n))})),a=n.type.name===this.ARRAY?n.type.innerType.name:n.type.name;return i.render(this.typeMapping[this.ARRAY],{name:t?this.formattedVarName(n.name):"",dim:r,type:this.typeMapping[a]})}return this.typeMapping[n.type.name]+(t?" "+this.formattedVarName(n.name):"")},t.prototype.returnTypeDefinition=function(n){if([this.STRING,this.WORD,this.ARRAY].includes(n.type.name)){var t=this.arrayPointersTemplate,e=n.type.name===this.ARRAY?n.type.innerType.name:n.type.name,u=n.type.innerType&&n.type.innerType.dimensions?[this.computeDimension(n.type.innerType.dimensions)]:[],p=n.type.name===this.ARRAY?n.type.dimensions:[this.computeDimension(n.type.dimensions)],r=I(p,u);return i.render(t,{type:this.typeMapping[e],dim:r})}return this.variableDefinition(n,!1)},t.prototype.buildStatementData=function(n,t,e){var i=this,u=this.createFunctionArguments(t,e),p=u.args,r=u.params,a=e.type.name?this.returnTypeDefinition(e):this.voidReturnType;return{functionNomenclature:"function",arrayNomenclature:"array",null:"NULL",parameters:t.map((function(n){return{name:n.name,label:i.formattedVarName(n.name),type:i.variableDefinition(n,!1)}})),functionName:n,functionSimple:this.functionSignatureSimple(n,r.join(", ")),functionFull:this.functionSignatureFull(n,p.join(", "),a),returnType:a}},t}(g),w=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),x=function(n){function t(){var t,e=null!==n&&n.apply(this,arguments)||this;return e.loop="i".charCodeAt(0),e.typeMapping=((t={})[e.INT]="int",t[e.LONG]="long",t[e.STRING]="string",t[e.WORD]="string",t[e.FLOAT]="float",t),e.typeSpecifiers={int:"%d",long:"%d",float:"%f",string:"%s",word:"%s"},e.methodCaseConversion=g.CASE_CONVERSIONS.CAMEL,e.caseConversion=g.CASE_CONVERSIONS.CAMEL,e.inputsCounter=0,e}return w(t,n),t.prototype.begin=function(){if(this.append("import std;").nl(),this.nl(),this.input.hasStatement()){this.append("/**").nl();for(var n=0,t=this.input.statement.split("\n");n1&&(this.inputsCounter++,t="inputs"+(this.inputsCounter>1?this.inputsCounter:""),this.nl().indent().append("auto "+t+" = readln.split;"));for(var e=0;e1?t+"["+e+"]":"readln.strip";this.nl().indent().append(this.variableDefinition(i,!0)+" = "+this.cast(u,i.type.name)+";"),null!=i.comment&&this.append(" // "+i.comment)}},t.prototype.handleLoop=function(n){var t=String.fromCharCode(this.loop);this.nl().indent().append("for (int "+t+" = 0; "+t+" < "+n.param+"; "+t+"++) {"),this.incIndent(),this.loop++,this.write(n.children[0]),this.loop--,this.decIndent(),this.nl().indent().append("}")},t.prototype.handleLoopLine=function(n){this.inputsCounter++;var t="inputs"+(this.inputsCounter>1?this.inputsCounter:"");this.nl().indent().append("auto "+t+" = readln.split;"),this.handleLoop(n)},t.prototype.handleReadLine=function(n){for(var t=0;t1?this.inputsCounter:"")+"["+((n.length>1?n.length+"*":"")+String.fromCharCode(this.loop-1)+(0===t?"":"+"+t))+"]";this.nl().indent().append(this.variableDefinition(e,!0)+" = "+this.cast(i,e.type.name)+";"),null!=e.comment&&this.append(" // "+e.comment)}},t.prototype.handleGameLoop=function(n){this.nl(),this.nl().indent().append("// game loop").nl(),this.indent().append("while (1) {"),this.incIndent();for(var t=0,e=n;t").nl();var u=null!=e&&(e.length>50||e.split("\n").length>1);if(u){for(var p=0,r=e.split("\n");p1||h[0].length>0){this.indent().append('writeln("'+h[0]+'");'),null==e||u||this.append(" // ").append(e);for(var l=1;l")},t.prototype.handleDump=function(n){"string"==typeof n?this.nl().indent().append(this.rawOutput(n)):this.nl().indent().append(this.variableOutput(n))},t.prototype.variableOutput=function(n){return"writeln("+this.formattedVarName(n.name)+");"},t.prototype.rawOutput=function(n){return"writeln("+n+");"},t.prototype.variableDefinition=function(n,t){return this.typeMapping[n.type.name]+(t?" "+this.formattedVarName(n.name):"")},t.prototype.cast=function(n,t){return[this.INT,this.LONG,this.FLOAT].includes(t)?n+".to!"+t:n},t}(g),M=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),V=function(n){function t(){var t,e,i=null!==n&&n.apply(this,arguments)||this;return i.loop="i".charCodeAt(0),i.typeMapping=((t={})[i.FLOAT]="double",t[i.INT]="int",t[i.LONG]="int",t[i.STRING]="String",t[i.WORD]="String",t),i.readMapping=((e={})[i.INT]="int.parse(%s)",e[i.LONG]="int.parse(%s)",e[i.WORD]="%s",e[i.STRING]="%s",e[i.FLOAT]="double.parse(%s)",e),i.PLACEHOLDER_INPUTS="--- PLACEHOLDER INPUTS ---",i.needInputsDeclaration=!1,i}return M(t,n),t.prototype.begin=function(){if(this.append("import 'dart:io';").nl(),this.append("import 'dart:math';").nl(),this.nl(),this.input.hasStatement()){this.append("/**").nl();for(var n=0,t=this.input.statement.split("\n");n1){this.needInputsDeclaration=!0,this.append("inputs = stdin.readLineSync().split(' ');");for(var t=0,e=0,i=n;e1?t.children.length+"*":"")+String.fromCharCode(this.loop-1)+(0===e?"":"+"+e),r=this.format(this.readMapping[i.name],["inputs["+p+"]"]);this.nl().indent().append(this.typeMapping[i.name]+" "+u.name+" = "+r+";"),null!=u.comment&&this.append(" // "+u.comment)}},t.prototype.handleLoopLine=function(n){this.nl().indent(),this.append("inputs = stdin.readLineSync().split(' ');"),this.handleLoop(n)},t.prototype.handleLoop=function(n){var t=String.fromCharCode(this.loop);this.nl().indent().append("for (int "+t+" = 0; "+t+" < "+n.param+"; "+t+"++) {"),this.incIndent(),this.loop++,this.write(n.children[0]),this.loop--,this.decIndent(),this.nl().indent().append("}")},t.prototype.handleGameLoop=function(n){this.nl(),this.nl().indent().append("// game loop").nl(),this.indent().append("while (true) {"),this.incIndent();for(var t=0,e=n;t").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u1||a[0].length>0){this.indent().append("print('").append(a[0]).append("');"),null==e||i||this.append(" // ").append(e);for(var o=1;o")},t}(g),j=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),W=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.loop="i".charCodeAt(0),t.looplineUsed=!1,t.tempVariable="token",t.tempVariableCount=0,t}return j(t,n),t.prototype.begin=function(){if(this.input.hasStatement())for(var n=0,t=this.input.statement.split("\n");n1){for(var e=0,i=t.children;e1?n.length+" * ":"")+String.fromCharCode(this.loop-1)+(0===i?"":" + "+i);"word"===p.name?this.nl().indent().append("let "+u.name+" = words.["+r+"]"):this.nl().indent().append("let "+u.name+" = "+p.name+"(words.["+r+"])")}},t.prototype.handleLoop=function(n){var t=String.fromCharCode(this.loop);this.nl().indent().append("for "+t+" in 0 .. "+n.param+" - 1 do"),this.incIndent(),this.loop++,this.write(n.children[0]),this.loop--,this.nl().indent().append("()"),this.decIndent(),this.nl()},t.prototype.handleLoopLine=function(n){var t=this.looplineUsed?"":"let ";this.looplineUsed=!0,this.nl().indent().append(t+"words = (Console.In.ReadLine()).Split [|' '|]"),this.handleLoop(n)},t.prototype.handleGameLoop=function(n){this.nl(),this.nl().indent().append("(* game loop *)").nl(),this.indent().append("while true do"),this.incIndent();for(var t=0,e=n;t").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u1||a[0].length>0){this.indent().append('printfn "').append(a[0]).append('"'),null==e||i||this.append(" (* ").append(e).append(" *)");for(var o=1;o")},t}(g),G=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),k=function(n){function t(){var t,e=null!==n&&n.apply(this,arguments)||this;return e.loop="i".charCodeAt(0),e.typeMapping=((t={})[e.INT]="int",t[e.FLOAT]="float64",t[e.LONG]="int",t[e.WORD]="string",t[e.STRING]="string",t[e.BOOL]="bool",t),e.needScanner=!1,e.useSplit=!1,e.useConv=!1,e.useStrings=!1,e.needFmt=!1,e.looplineUsed=!1,e.isInLoop=!1,e.DECLARE_TOKEN="{{scanner := bufio.NewScanner(os.Stdin)}}",e.caseConversion=g.CASE_CONVERSIONS.CAMEL,e.methodCaseConversion=g.CASE_CONVERSIONS.PASCAL,e.loopTpl="for {{&counter}} := {{&start}}; {{&counter}} < {{&end}}; {{&counter}}++ {\n{{&body}}\n}",e.voidReturnType="void",e}return G(t,n),t.prototype.begin=function(){if(this.input.hasStatement()){this.append("/**").nl();for(var n=0,t=this.input.statement.split("\n");n1?n.length+"*":"")+String.fromCharCode(this.loop-1)+(0===e?"":"+"+e)+"]"),e++,a.type.name===this.INT||a.type.name===this.LONG?(this.append(",10,32)"),this.nl().append("_ = "+a.name)):a.type.name===this.FLOAT&&(this.append(",10,64)"),this.nl().append("_ = "+a.name))}},t.prototype.handleLoop=function(n){this.isInLoop=!0;var t=String.fromCharCode(this.loop);this.nl().append("for "+t+" := 0; "+t+" < "+n.param+"; "+t+"++ {"),this.incIndent(),this.loop++,this.write(n.children[0]),this.loop--,this.decIndent(),this.nl().append("}")},t.prototype.handleLoopLine=function(n){this.needScanner=!0,this.useSplit=!0;var t=this.looplineUsed?"inputs = ":"inputs := ";this.nl().append("scanner.Scan()"),this.useStrings=!0,this.nl().append(t+'strings.Split(scanner.Text()," ")'),this.looplineUsed=!0,this.handleLoop(n)},t.prototype.handleGameLoop=function(n){this.nl().append("for {"),this.incIndent();for(var t=0,e=n;t").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u1||a[0].length>0){this.append('fmt.Println("'+a[0]+'")'),i||(null!=e?this.append(" // ").append(e):this.append(this.input.turnBased?"// Write action to stdout":"// Write answer to stdout"));for(var o=1;o")},t.prototype.handleDump=function(n){if(this.needFmt=!0,"string"==typeof n)this.nl().append(this.variableOutput(n));else if(n.type.name===this.ARRAY){var t=n.type.dimensions.length,e=this.buildDumpLoop(n,n.name,t);this.code.push("\n"),this.append(this.indentString(e,this.level))}else{var i=this.formattedVarName(n.name);this.nl().append(this.variableOutput(i))}},t.prototype.handleCall=function(n,t,e){var i=this,u=t.map((function(n){return i.formattedVarName(n.name)+" "+i.functionArgumentType(n.type)})).join(", "),p=t.map((function(n){return i.formattedVarName(n.name)})).join(", "),r=this.functionDeclaration(n,u,this.functionArgumentType(e.type),this.defaultReturnStatement(e.type)),a=this.code.findIndex((function(n){return"{{{solve}}}"===n}));this.code[a]=r;var o=this.functionCall(n,e.type.name!==this.voidReturnType?e.type.name:"",e.name,p);this.append("\n").append(this.indentString(o,this.level))},t.prototype.buildReadStringLoop=function(n,t,e,u){var p=n.type.dimensions.length;if(0===u)return t;var r=p-u,a="",o=e+"["+this.sletters[r]+"]";a=1===u?"scanner.Scan()\n"+o+" = scanner.Text()":this.buildArrayMakingStatement(o,"=",this.typeMapping[n.type.innerType.name],u-1,n.type.dimensions[r])+this.loopTpl;var s=0===r?this.buildArrayMakingStatement(e,":=",this.typeMapping[n.type.innerType.name],u,n.type.dimensions[r])+t:t,h=i.render(s,{counter:this.sletters[r],start:0,end:this.formattedVarName(n.type.dimensions[r]),body:this.indentString(a,r+1)});return this.buildReadStringLoop(n,h,o,u-1)},t.prototype.buildReadNonStringLoop=function(n,t,e){var u=n.type.dimensions.length,p=u-e;this.useStrings=!0;var r="",a=t+"["+this.sletters[p]+"]";if(0===e)return n.type.innerType.name!==this.WORD?(this.useConv=!0,n.type.innerType.name===this.INT?t+",_ = strconv.Atoi(inputs["+this.sletters[p-1]+"])":t+",_ = strconv.ParseFloat(inputs["+this.sletters[p-1]+"],64)"):t+" = inputs["+this.sletters[p-1]+"]";r=this.buildReadNonStringLoop(n,a,e-1);var o=e===u?":=":"=",s=this.buildArrayMakingStatement(t,o,this.typeMapping[n.type.innerType.name],e,n.type.dimensions[p])+this.loopTpl;return 1===n.type.dimensions.length&&(this.useStrings=!0,s='scanner.Scan()\ninputs := strings.Split(scanner.Text(), " ")\n'+s),i.render(s,{counter:this.sletters[p],start:0,end:this.formattedVarName(n.type.dimensions[p]),body:this.indentString((2===e?'scanner.Scan()\ninputs := strings.Split(scanner.Text(), " ")\n':"")+r,1)})},t.prototype.buildDumpLoop=function(n,t,e){var u=n.type.dimensions.length-e,p="";return p=1===e?this.variableOutput(t+"["+this.sletters[u]+"]"):this.buildDumpLoop(n,t+"["+this.sletters[u]+"]",e-1),i.render(this.loopTpl,{counter:this.sletters[u],start:0,end:n.type.dimensions[u]?this.formattedVarName(n.type.dimensions[u]):"len("+t+")",body:this.indentString(p,1)})},t.prototype.variableOutput=function(n){return"fmt.Println("+n+")"},t.prototype.functionSignatureSimple=function(n,t){return n+"("+t+")"},t.prototype.functionSignatureFull=function(n,t,e){return this.functionSignatureSimple(n,t)+(e?" "+e:"")},t.prototype.functionDeclaration=function(n,t,e,i){return"\nfunc "+this.functionSignatureFull(n,t,e)+' {\n    // Write your code here\n    // fmt.Fprintln(os.Stderr, "Debug messages...")\n    '+i+"\n}\n"},t.prototype.defaultReturnStatement=function(n){var t,e=this,i=((t={})[this.BOOL]=function(){return"false"},t[this.INT]=function(){return"0"},t[this.LONG]=function(){return"0"},t[this.FLOAT]=function(){return"0.0"},t[this.WORD]=function(){return'""'},t[this.STRING]=function(){return'""'},t[this.ARRAY]=function(n){return"[]".repeat(n.dimensions.length)+e.typeMapping[n.innerType.name]+"{}"},t);return n.name?"\n    return "+i[n.name](n):""},t.prototype.functionCall=function(n,t,e,u){return i.render("stdoutWriter := os.Stdout\nos.Stdout = os.Stderr\n{{#type}}{{&res}} := {{/type}}{{&name}}({{¶ms}})\nos.Stdout = stdoutWriter",{name:n,type:t,res:e,params:u})},t.prototype.functionArgumentType=function(n){return n.name===this.voidReturnType?"":n.name===this.ARRAY?"[]".repeat(n.dimensions.length)+this.typeMapping[n.innerType.name]:this.typeMapping[n.name]},t.prototype.typeDeclaration=function(n){return n.name===this.voidReturnType?"":n.name===this.ARRAY?"["+n.dimensions.join("][")+"]"+this.typeMapping[n.innerType.name]:this.typeMapping[n.name]},t.prototype.buildArrayMakingStatement=function(n,t,e,i,u){return n+" "+t+" make("+"[]".repeat(i)+e+", "+u+")\n"},t.prototype.buildStatementData=function(n,t,e){var i=this,u=t.map((function(n){return i.formattedVarName(n.name)+" "+i.functionArgumentType(n.type)})).join(", "),p=t.map((function(n){return i.formattedVarName(n.name)})).join(", "),r=this.functionArgumentType(e.type);return{functionNomenclature:"function",arrayNomenclature:"array",null:"nil",parameters:t.map((function(n){return{name:n.name,label:i.formattedVarName(n.name),type:i.functionArgumentType(n.type)}})),functionName:n,functionSimple:this.functionSignatureSimple(n,p),functionFull:this.functionSignatureFull(n,u,r),returnType:r}},t.prototype.groupVariablesByType=function(n){return n.reduce((function(n,t){return n.length>0&&n[n.length-1][0].type.name===t.type.name?n[n.length-1].push(t):n.push([t]),n}),[])},t}(g),P=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),$=function(n){function t(){var t,e=null!==n&&n.apply(this,arguments)||this;return e.loop="i".charCodeAt(0),e.readMapping=((t={})[e.INT]="input.nextInt()",t[e.LONG]="input.nextLong()",t[e.FLOAT]="input.nextFloat()",t[e.STRING]="input.nextLine()",t[e.WORD]="input.next()",t),e}return P(t,n),t.prototype.begin=function(){if(this.append("input = new Scanner(System.in);").nl(),this.nl(),this.input.hasStatement()){this.append("/**").nl();for(var n=0,t=this.input.statement.split("\n");n").nl();var u=null!=e&&(e.length>50||e.split("\n").length>1);if(u){for(var p=0,r=e.split("\n");p0?' + "'+t+'" + ':" + ").replace(/" \+ "/g,"")),null==e||u||this.append(" // ").append(e);else{var o=n.split("\n");if(o.length>1||o[0].length>0){this.indent().append('println "').append(o[0]).append('"'),null==e||u||this.append(" // ").append(e);for(var s=1;s")},t}(g),Y=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),U=function(n){function t(){var t,e=null!==n&&n.apply(this,arguments)||this;return e.typeMapping=((t={})[e.INT]="Int",t[e.LONG]="Int",t[e.FLOAT]="Float",t[e.STRING]="String",t[e.WORD]="String",t),e.loop="i".charCodeAt(0),e.inRead=!1,e.gameLoopParams=[],e.varsOutOfLoop=[],e.inGameLoop=!1,e.caseConversion=g.CASE_CONVERSIONS.LOWER,e}return Y(t,n),t.prototype.begin=function(){if(this.append("import System.IO").nl(),this.append("import Control.Monad").nl(),this.nl(),this.append("main :: IO ()").nl(),this.append("main = do"),this.incIndent(),this.nl().append("hSetBuffering stdout NoBuffering -- DO NOT REMOVE"),this.nl(),this.input.hasStatement()){for(var n=0,t=this.input.statement.split("\n");n1){this.nl().append("let input = words input_line");for(var t=0;t1?n.length+"*":"")+String.fromCharCode(this.loop-1)+(0===t?"":"+"+t)])):this.nl().append(this.format("let %s = read (input!!(%s)) :: %s",[u,(n.length>1?n.length+"*":"")+String.fromCharCode(this.loop-1)+(0===t?"":"+"+t),this.typeMapping[i.name]])),e.comment&&this.append(" -- ").append(e.comment),this.inGameLoop||this.varsOutOfLoop.push(u)}},t.prototype.handleLoop=function(n){var t=n.param.toLowerCase();this.inGameLoop&&-1===this.gameLoopParams.indexOf(t)&&-1!==this.varsOutOfLoop.indexOf(t)&&parseInt(t,10).toString()!==t&&this.gameLoopParams.push(t),this.nl().nl().append("replicateM "+t+" $ do"),this.incIndent(),this.write(n.children[0]),this.nl().append("return ()"),this.decIndent()},t.prototype.handleLoopLine=function(n){var t=String.fromCharCode(this.loop);this.loop++,this.nl().append("input_line <- getLine"),this.nl().append("let input = words input_line");var e=n.param.toLowerCase();this.inGameLoop&&-1===this.gameLoopParams.indexOf(e)&&-1!==this.varsOutOfLoop.indexOf(e)&&parseInt(e,10).toString()!==e&&this.gameLoopParams.push(e),this.nl().nl().append("forM [0..("+e+"-1)] $ \\"+t+" -> do"),this.incIndent(),this.write(n.children[0]),this.nl().append("return ()"),this.loop--,this.decIndent()},t.prototype.handleGameLoop=function(n){this.inGameLoop=!0,this.nl(),this.nl().append("-- game loop"),this.nl().append("forever $ do"),this.incIndent();for(var t=0,e=n;t").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u0?' ++ "'+t+'" ++ ':" ++ ").replace(/" \++ "/g,"")),this.append(")");else{var a=n.split("\n");if(a.length>1||a[0].length>0){i||(null!=e?this.nl().append("-- ").append(e):this.nl().append(this.input.turnBased?"-- Write action to stdout":"-- Write answer to stdout"));for(var o=0,s=a;o")},t}(g),z=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),K=function(n){function t(){var t,e,i=null!==n&&n.apply(this,arguments)||this;return i.loop="i".charCodeAt(0),i.typeMapping=((t={})[i.BOOL]="boolean",t[i.INT]="number",t[i.FLOAT]="number",t[i.LONG]="number",t[i.WORD]="string",t[i.STRING]="string",t[i.ARRAY]="{{&type}}{{#dim}}[]{{/dim}}",t),i.readMapping=((e={})[i.INT]="parseInt(%s)",e[i.LONG]="parseInt(%s)",e[i.FLOAT]="parseFloat(%s)",e[i.BOOL]="%s !== '0'",e[i.WORD]="%s",e[i.STRING]="%s",e),i.methodCaseConversion=g.CASE_CONVERSIONS.CAMEL,i.caseConversion=g.CASE_CONVERSIONS.CAMEL,i.loopTpl="for (let {{&counter}} = {{&start}}; {{&counter}} < {{&end}}; {{&counter}}++) {\n{{&body}}\n}",i.voidReturnType="",i}return z(t,n),t.prototype.begin=function(){if(this.input.hasStatement()){this.append("/**").nl();for(var n=0,t=this.input.statement.split("\n");n1){this.append("var inputs = readline().split(' ');");for(var t=0,e=0,i=n;e1||a.type.innerType.name===this.STRING?(this.append("const "+a.name+" = "+"[".repeat(o)+"]".repeat(o)+";"),this.nl().append(this.indentString(s,this.level))):this.append("const "+s)}}},t.prototype.handleReadLine=function(n){for(var t=0;t1?n.length+"*":"")+String.fromCharCode(this.loop-1)+(0===t?"":"+"+t)+"]"]);this.nl().indent().append("const ").append(e.name).append(" = ").append(i).append(";"),null!=e.comment&&this.append("// ").append(e.comment)}},t.prototype.handleLoop=function(n){var t=String.fromCharCode(this.loop);this.nl().indent().append("for (let "+t+" = 0; "+t+" < "+n.param+"; "+t+"++) {"),this.incIndent(),this.loop++,this.write(n.children[0]),this.loop--,this.decIndent(),this.nl().indent().append("}")},t.prototype.handleLoopLine=function(n){this.nl().indent(),this.append("var inputs = readline().split(' ');"),this.handleLoop(n)},t.prototype.handleGameLoop=function(n){this.nl(),this.nl().indent().append("// game loop").nl(),this.indent().append("while (true) {"),this.incIndent();for(var t=0,e=n;t").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u0?" + '"+t+"' + ":" + ").replace(/' \+ '/g,"")),this.append(");"),null==e||i||this.append(" // ").append(e);else{var a=n.split("\n");if(a.length>1||a[0].length>0){this.indent().append("console.log('").append(a[0]).append("');"),null==e||i||this.indent().append(" // ").append(e).nl();for(var o=1;o")},t.prototype.handleDump=function(n){if("string"==typeof n)this.nl().indent().append(this.variableOutput(n));else if(n.type.name===this.ARRAY){var t=n.type.dimensions.length,e=this.buildDumpLoop(n,n.name,t);this.nl().append(this.indentString(e,this.level))}else{var i=this.formattedVarName(n.name);this.nl().indent().append(this.variableOutput(i))}},t.prototype.handleCall=function(n,t,e){var i=this,u=t.map((function(n){return i.formattedVarName(n.name)})).join(", "),p=t.map((function(n){return i.formattedVarName(n.name)})).join(", "),r=this.code.findIndex((function(n){return"{{{solve}}}"===n}));this.code[r]=this.functionDeclaration(n,u,this.defaultReturnStatement(e.type));var a=this.functionCall(n,e.type.name!==this.voidReturnType?e.type.name:"",e.name,p);this.nl().append(this.indentString(a,this.level))},t.prototype.buildReadStringLoop=function(n,t,e,u){var p=n.type.dimensions.length;if(0===u)return t;var r=p-u,a="",o=e+"["+this.sletters[r]+"]";a=1===u?o+" = readline();":this.loopTpl;var s=i.render(t,{counter:this.sletters[r],start:0,end:this.formattedVarName(n.type.dimensions[r]),body:this.indentString(a,r+1)});return this.buildReadStringLoop(n,s,o,u-1)},t.prototype.buildReadNonStringLoop=function(n,t,e){var u=n.type.dimensions.length-e,p="readline().split(' ')"+(n.type.innerType.name!==this.WORD?".map("+this.sletters[u+1]+" => "+this.format(this.readMapping[n.type.innerType.name],[this.sletters[u+1]])+")":"")+";",r="",a=t+"["+this.sletters[u]+"]";return 1===e?t+" = "+p:(r=this.buildReadNonStringLoop(n,a,e-1),i.render(this.loopTpl,{counter:this.sletters[u],start:0,end:this.formattedVarName(n.type.dimensions[u]),body:this.indentString(r,1)}))},t.prototype.buildDumpLoop=function(n,t,e){var u=n.type.dimensions.length-e,p="";return p=1===e?this.variableOutput(t+"["+this.sletters[u]+"]"):this.buildDumpLoop(n,t+"["+this.sletters[u]+"]",e-1),i.render(this.loopTpl,{counter:this.sletters[u],start:0,end:n.type.dimensions[u]?this.formattedVarName(n.type.dimensions[u]):t+".length",body:this.indentString(p,1)})},t.prototype.variableOutput=function(n){return"console.log("+n+");"},t.prototype.functionSignatureSimple=function(n,t){return n+" ("+t+")"},t.prototype.functionDeclaration=function(n,t,e){return"\nfunction "+this.functionSignatureSimple(n,t)+" {\n  // Write your code here\n  // To debug: console.error('Debug messages...');\n  "+e+"\n}\n"},t.prototype.defaultReturnStatement=function(n){var t,e=((t={})[this.BOOL]=function(){return"false"},t[this.INT]=function(){return"0"},t[this.LONG]=function(){return"0"},t[this.FLOAT]=function(){return"0.0"},t[this.STRING]=function(){return"''"},t[this.WORD]=function(){return"''"},t[this.ARRAY]=function(n){return"[".repeat(n.dimensions.length)+"]".repeat(n.dimensions.length)},t);return n.name?"\n  return "+e[n.name](n):""},t.prototype.functionCall=function(n,t,e,u){return i.render("const oldWrite = process.stdout.write;\nprocess.stdout.write = chunk => console.error(chunk);\n{{#type}}var {{&res}} = {{/type}}{{&name}}({{¶ms}});\nprocess.stdout.write = oldWrite;",{name:n,type:t,res:e,params:u})},t.prototype.buildStatementData=function(n,t,e){var i=this,u=t.map((function(n){return i.formattedVarName(n.name)})).join(", ");return{functionNomenclature:"function",arrayNomenclature:"array",null:"null",parameters:t.map((function(n){return{name:n.name,label:i.formattedVarName(n.name),type:i.formatType(n.type)}})),functionName:n,functionSimple:this.functionSignatureSimple(n,u),functionFull:this.functionSignatureSimple(n,u),returnType:this.formatType(e.type)}},t}(g),Z=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),H=function(n){function t(){var t,e,i=null!==n&&n.apply(this,arguments)||this;return i.loop="i".charCodeAt(0),i.typeMapping=((t={})[i.INT]="int",t[i.LONG]="long",t[i.STRING]="String",t[i.WORD]="String",t[i.FLOAT]="float",t[i.BOOL]="boolean",t[i.ARRAY]="{{&type}}{{#dim}}[]{{/dim}}",t),i.readMapping=((e={})[i.FLOAT]="in.nextFloat();",e[i.INT]="in.nextInt();",e[i.LONG]="in.nextLong();",e[i.STRING]="in.nextLine();",e[i.WORD]="in.next();",e[i.BOOL]="in.nextInt() != 0;",e[i.ARRAY]="new {{&type}}{{#dim}}[{{.}}]{{/dim}};",e),i.caseConversion=g.CASE_CONVERSIONS.CAMEL,i.methodCaseConversion=g.CASE_CONVERSIONS.CAMEL,i.loopTpl="for (int {{&counter}} = {{&start}}; {{&counter}} < {{&end}}; {{&counter}}++) {\n{{&body}}\n}",i.voidReturnType="void",i}return Z(t,n),t.prototype.begin=function(){if(this.append("import java.util.*;").nl(),this.append("import java.io.*;").nl(),this.append("import java.math.*;").nl(),this.nl(),this.input.hasStatement()){this.append("/**").nl();for(var n=0,t=this.input.statement.split("\n");n").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u0?' + "'+t+'" + ':" + ").replace(/" \+ "/g,"")),this.append(");"),null==e||i||this.append(" // ").append(e);else{var a=n.split("\n");if(a.length>1||a[0].length>0){this.indent().append('System.out.println("').append(a[0]).append('");'),null==e||i||this.append(" // ").append(e);for(var o=1;o")},t.prototype.handleDump=function(n){if("string"==typeof n)this.nl().indent().append(this.variableOutput(n));else if(n.type.name===this.ARRAY){var t=n.type.dimensions.length,e=this.buildDumpLoop(n,n.name,t);this.nl().append(this.indentString(e,this.level))}else{var i=this.formattedVarName(n.name);this.nl().indent().append(this.variableOutput(i))}},t.prototype.handleCall=function(n,t,e){var i=this,u=t.map((function(n){return i.typeDeclaration(n.type)+" "+i.formattedVarName(n.name)})).join(", "),p=t.map((function(n){return i.formattedVarName(n.name)})).join(", "),r=this.code.findIndex((function(n){return"{{{solve}}}"===n}));this.code[r]=this.functionDeclaration(n,u,e.type.name?this.typeDeclaration(e.type):this.voidReturnType,this.defaultReturnStatement(e.type));var a=this.functionCall(n,e.name?this.typeDeclaration(e.type):"",e.name,p);this.nl().append(this.indentString(a,this.level))},t.prototype.buildReadLoop=function(n,t,e){var u=n.type.dimensions.length-e,p="";return p=1===e?t+"["+this.sletters[u]+"] = "+this.readMapping[n.type.innerType.name]:this.buildReadLoop(n,t+"["+this.sletters[u]+"]",e-1),i.render(this.loopTpl,{counter:this.sletters[u],start:0,end:this.formattedVarName(n.type.dimensions[u]),body:this.indentString(p,1)})},t.prototype.buildDumpLoop=function(n,t,e){var u=n.type.dimensions.length-e,p="";return p=1===e?this.variableOutput(t+"["+this.sletters[u]+"]"):this.buildDumpLoop(n,t+"["+this.sletters[u]+"]",e-1),i.render(this.loopTpl,{counter:this.sletters[u],start:0,end:n.type.dimensions[u]?this.formattedVarName(n.type.dimensions[u]):t+".length",body:this.indentString(p,1)})},t.prototype.variableOutput=function(n){return"System.out.println("+n+");"},t.prototype.functionSignatureSimple=function(n,t){return n+"("+t+")"},t.prototype.functionSignatureFull=function(n,t,e){return e+" "+this.functionSignatureSimple(n,t)},t.prototype.functionDeclaration=function(n,t,e,i){return"\n    public static "+this.functionSignatureFull(n,t,e)+' {\n        // Write your code here\n        // To debug: System.err.println("Debug messages...");\n        '+i+"\n    }\n"},t.prototype.defaultReturnStatement=function(n){var t,e=this,u=((t={})[this.BOOL]=function(){return"false"},t[this.INT]=function(){return"0"},t[this.LONG]=function(){return"0"},t[this.FLOAT]=function(){return"0.0"},t[this.WORD]=function(){return'""'},t[this.STRING]=function(){return'""'},t[this.ARRAY]=function(n){return i.render(e.readMapping[e.ARRAY],{dim:n.dimensions,type:e.typeMapping[n.innerType.name]}).slice(0,-1)},t);return n.name?"\n        return "+u[n.name](n)+";":""},t.prototype.functionCall=function(n,t,e,u){return i.render("PrintStream outStream = System.out;\nSystem.setOut(System.err);\n{{#type}}{{&type}} {{&res}} = {{/type}}{{&name}}({{¶ms}});\nSystem.setOut(outStream);",{name:n,type:t,res:e,params:u})},t.prototype.typeDeclaration=function(n){var t=this.typeMapping[n.name];return n.name===this.ARRAY?i.render(t,{dim:n.dimensions,type:this.typeMapping[n.innerType.name]}):i.render(t,{})},t.prototype.variableDefinition=function(n){var t=this.typeDeclaration(n.type)+" "+n.name;return n.type.name===this.ARRAY?t+" = "+i.render(this.readMapping[this.ARRAY],{dim:n.type.dimensions,type:this.typeMapping[n.type.innerType.name]}):t+" = "+this.readMapping[n.type.name]},t.prototype.buildStatementData=function(n,t,e){var i=this,u=t.map((function(n){return i.typeDeclaration(n.type)+" "+i.formattedVarName(n.name)})).join(", "),p=t.map((function(n){return i.formattedVarName(n.name)})).join(", "),r=e.type.name?this.typeDeclaration(e.type):this.voidReturnType;return{functionNomenclature:"method",arrayNomenclature:"array",null:"null",parameters:t.map((function(n){return{name:n.name,label:i.formattedVarName(n.name),type:i.typeDeclaration(n.type)}})),functionName:n,functionSimple:this.functionSignatureSimple(n,p),functionFull:this.functionSignatureFull(n,u,r),returnType:r}},t}(g),q=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),J=function(n){function t(){var t,e,i,u=null!==n&&n.apply(this,arguments)||this;return u.loop="i".charCodeAt(0),u.typeMapping=((t={})[u.BOOL]="Boolean",t[u.INT]="Int",t[u.LONG]="Long",t[u.STRING]="String",t[u.WORD]="String",t[u.FLOAT]="Float",t[u.ARRAY]="{{#dim}}Array<{{/dim}}{{{type}}}{{#dim}}>{{/dim}}",t),u.readMapping=((e={})[u.FLOAT]="input.nextFloat()",e[u.INT]="input.nextInt()",e[u.LONG]="input.nextLong()",e[u.STRING]="input.nextLine()",e[u.WORD]="input.next()",e[u.BOOL]="input.nextInt() != 0",e),u.defaultReturnMapping=((i={})[u.BOOL]=function(){return"false"},i[u.INT]=function(){return"0"},i[u.LONG]=function(){return"0"},i[u.FLOAT]=function(){return"0.0"},i[u.STRING]=function(){return'""'},i[u.WORD]=function(){return'""'},i[u.ARRAY]=function(n){return"arrayOf<"+u.formatType(n.innerType)+">()"},i),u.methodCaseConversion=g.CASE_CONVERSIONS.CAMEL,u.caseConversion=g.CASE_CONVERSIONS.CAMEL,u}return q(t,n),t.prototype.begin=function(){if(this.append("import java.util.*").nl(),this.append("import java.io.*").nl(),this.append("import java.math.*").nl(),this.nl(),this.input.hasStatement()){this.append("/**").nl();for(var n=0,t=this.input.statement.split("\n");n) {").nl(),this.incIndent(),this.indent().append("val input = Scanner(System.`in`)")},t.prototype.end=function(){this.decIndent(),this.nl().indent().append("}")},t.prototype.handleRead=function(n,t){for(var e=null,i=0,u=n;i").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u0?t:"")),this.append('")'),null==e||i||this.append(" // ").append(e);else{var a=n.split("\n");if(a.length>1||a[0].length>0){this.indent().append('println("').append(a[0]).append('")'),null==e||i||this.append(" // ").append(e);for(var o=1;o")},t.prototype.handleDump=function(n){if("string"==typeof n)this.nl().indent().append(this.variableOutput(n));else if(n.type.name===this.ARRAY){var t=n.type.dimensions.length,e=this.buildArrayDumpLoop(n,t);this.nl().append(this.indentString(e,this.level))}else{var i=this.formattedVarName(n.name);this.nl().indent().append(this.variableOutput(i))}},t.prototype.variableOutput=function(n){return"println("+n+")"},t.prototype.buildArrayDumpLoop=function(n,t){return 0===t?this.variableOutput("it"):(n.type.dimensions.length===t?n.name:"it")+".forEach { "+this.buildArrayDumpLoop(n,t-1)+" }"},t.prototype.handleCall=function(n,t,e){var i=this.functionDeclaration(n,t,e.type),u=this.functionCall(n,t,e),p=this.code.findIndex((function(n){return"{{{solve}}}"===n}));this.code[p]=i,this.nl().append(this.indentString(u,this.level))},t.prototype.functionCall=function(n,t,e){var i=this,u=t.map((function(n){return i.formattedVarName(n.name)})).join(", ");return"val outStream = System.out\nSystem.setOut(System.err)\nval "+this.variableDefinition(e)+" = "+n+"("+u+")\nSystem.setOut(outStream)"},t.prototype.functionDeclaration=function(n,t,e){return"fun "+this.functionSignatureFull(n,t,e)+' {\n    // Write your code here\n    // To debug: System.err.println("Debug messages...");\n\n    return '+this.defaultReturnMapping[e.name](e)+"\n}\n"},t.prototype.functionSignatureSimple=function(n,t,e){var i=this;return n+" ("+t.map((function(n){return i.formattedVarName(n.name)})).join(", ")+")"},t.prototype.functionSignatureFull=function(n,t,e){var i=this;return n+" ("+t.map((function(n){return i.variableDefinition(n)})).join(", ")+"): "+this.formatType(e)},t.prototype.variableDefinition=function(n){return this.formattedVarName(n.name)+": "+this.formatType(n.type)},t.prototype.buildStatementData=function(n,t,e){var i=this;return{functionNomenclature:"function",arrayNomenclature:"array",null:"null",parameters:t.map((function(n){return{name:n.name,label:i.formattedVarName(n.name),type:i.formatType(n.type)}})),functionName:n,functionSimple:this.functionSignatureSimple(n,t,e.type),functionFull:this.functionSignatureFull(n,t,e.type),returnType:this.formatType(e.type)}},t}(g),Q=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),X=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.loop="i".charCodeAt(0),t}return Q(t,n),t.prototype.begin=function(){if(this.input.hasStatement())for(var n=0,t=this.input.statement.split("\n");n1){for(var t=0,e=n;t").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u0?' .. "'+t+'" .. ':" .. ").replace(/" \.. "/g,"")),this.append(");"),null==e||i||this.append(" -- ").append(e);else{var a=n.split("\n");if(a.length>1||a[0].length>0){this.indent().append('print("').append(a[0]).append('")'),null==e||i||this.append(" -- ").append(e);for(var o=1;o")},t}(g),nn=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),tn=function(n){function t(){var t,e,i=null!==n&&n.apply(this,arguments)||this;return i.loop="i".charCodeAt(0),i.typeMapping=((t={})[i.INT]="int %s;",t[i.LONG]="long long %s;",t[i.STRING]="char %s[%s];",t[i.WORD]="char %s[%s];",t[i.FLOAT]="float %s;",t),i.readMapping=((e={})[i.INT]="%d",e[i.FLOAT]="%f",e[i.LONG]="%lld",e[i.WORD]="%s",e),i}return nn(t,n),t.prototype.begin=function(){if(this.append("#include ").nl().nl(),this.input.hasStatement()){this.append("/**").nl();for(var n=0,t=this.input.statement.split("\n");n").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u1||a[0].length>0){this.indent().append('printf([@"').append(a[0]).append('\\n" UTF8String]);'),null==e||i||this.append(" // ").append(e);for(var o=1;o")},t}(g),en=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),un={int:"%d",long:"%ld",float:"%f",word:"%s",string:"%s"},pn=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.loop="i".charCodeAt(0),t.caseConversion=g.CASE_CONVERSIONS.LOWER,t}return en(t,n),t.prototype.begin=function(){var n=this;this.input.hasStatement()&&this.input.statement.split("\n").forEach((function(t){n.append("(* "+t+" *)").nl()}))},t.prototype.handleRead=function(n){var t=this;if(n.length>1){n.forEach((function(n){null!=n.comment&&t.nl().indent().append("(* "+n.name.toLowerCase()+": "+n.comment+" *)")}));var e=n.map((function(n){return n.name.toLowerCase()})),i=n.map((function(n){return un[n.type.name]}));this.nl(),this.nl().indent().append("let line = input_line stdin in"),this.nl().indent().append("let "+e.join(", ")+' = Scanf.sscanf line "'+i.join(" ")+'" (fun '+e.join(" ")+" -> ("+e.join(", ")+")) in")}else{var u=n[0];switch(this.nl().indent().append("let "+u.name.toLowerCase()+" = "),u.type.name){case this.INT:case this.LONG:this.append("int_of_string (input_line stdin) in");break;case this.FLOAT:this.append("float_of_string (input_line stdin) in");break;default:this.append("input_line stdin in")}u.comment&&this.append(" (* "+u.comment+" *)")}},t.prototype.handleReadLine=function(n){var t=this;n.forEach((function(n){null!=n.comment&&t.nl().indent().append("(* "+n.name.toLowerCase()+": "+n.comment+" *)")}));var e=n.map((function(n){return n.name.toLowerCase()})),i=n.map((function(n){return un[n.type.name]}));this.nl().indent().append("let "+e.join(", ")+' = Scanf.sscanf line "'+i.join(" ")+'" (fun '+e.join(" ")+" -> ("+e.join(", ")+")) in")},t.prototype.handleLoop=function(n){var t=this,e=String.fromCharCode(this.loop),i=parseInt(n.param,10);if(isNaN(i)?i=n.param.toLowerCase()+" - 1":i--,this.nl().indent().append("for "+e.toLowerCase()+" = 0 to "+i+" do"),this.incIndent(),this.loop++,n.name!==this.LOOPLINE)this.write(n.children[0]);else{var u=n.children[0],p=u.children.map((function(n){return n.children[0]}));p.forEach((function(n){null!=n.comment&&t.nl().indent().append("(* "+n.name.toLowerCase()+": "+n.comment+" *)")}));var r=p.map((function(n){return n.name.toLowerCase()})),a=u.children.map((function(n){return un[n.name]}));this.nl().indent().append("let "+r.join(", ")+' = Scanf.scanf " '+a.join("  ")+'" (fun '+r.join(" ")+" -> ("+r.join(", ")+")) in")}this.loop--,this.nl().indent().append("();"),this.decIndent(),this.nl().indent().append("done;"),this.nl()},t.prototype.handleGameLoop=function(n){this.nl(),this.nl().indent().append("(* game loop *)").nl(),this.indent().append("while true do"),this.incIndent();for(var t=0,e=n;t").nl();var u=null!=e&&(e.length>50||e.split("\n").length>1);u&&(e.split("\n").forEach((function(n){i.nl().indent().append("(* "+n+" *)")})),this.nl());if(Array.isArray(n))this.indent().append('Printf.printf "'),this.append(n.map((function(n){return"VAR"===n.type?un[n.node.name]:n.value})).join(t)),this.append('" '),this.append(n.filter((function(n){return"VAR"===n.type})).map((function(n){return n.node.children[0].name})).join(" ")),this.append(";"),null==e||u||this.append(" (* "+e+" *)"),this.nl().indent().append('print_endline "";');else{var p=n.split("\n");if(p.length>1||p[0].length>0){this.indent().append('print_endline "'+p[0]+'";'),null==e||u||this.append(" (* "+e+" *)");for(var r=1;r")},t}(g),rn=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),an=function(n){function t(){var t,e,i=null!==n&&n.apply(this,arguments)||this;return i.loop="i".charCodeAt(0),i.typeMapping=((t={})[i.INT]="Int32",t[i.LONG]="Int64",t[i.STRING]="String",t[i.WORD]="String",t[i.FLOAT]="Extended",t),i.readMapping=((e={})[i.FLOAT]="StrToFloat(Inputs[%s]);",e[i.INT]="StrToInt(Inputs[%s]);",e[i.LONG]="StrToInt64(Inputs[%s]);",e[i.STRING]="readln();",e[i.WORD]="Inputs[%s];",e),i}return rn(t,n),t.prototype.begin=function(){var n=this.input;if(this.input.hasStatement())for(var t=0,e=this.input.statement.split("\n");t1?t.children.length+"*":"")+String.fromCharCode(this.loop-1)+(0===e?"":"+"+e)]);this.nl().indent().append(u.name).append(" := ").append(p)}},t.prototype.handleLoop=function(n){var t=String.fromCharCode(this.loop),e=parseInt(n.param,10);isNaN(e)?e=n.param+"-1":e--,this.nl().indent().append("for "+t+" := 0 to "+e+" do"),this.nl().indent().append("begin"),this.incIndent(),this.loop++,this.write(n.children[0]),this.loop--,this.decIndent(),this.nl().indent().append("end;")},t.prototype.handleLoopLine=function(n){this.nl().indent().append("ParseIn(Inputs);"),this.handleLoop(n)},t.prototype.handleGameLoop=function(n){this.nl(),this.nl().indent().append("// game loop").nl(),this.indent().append("while true do"),this.nl().indent().append("begin"),this.incIndent();for(var t=0,e=n;t").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u1||a[0].length>0){this.indent().append("writeln('").append(a[0]).append("');"),null==e||i||this.append(" // ").append(e);for(var o=1;o"),this.nl().indent().append("flush(StdErr); flush(output); // DO NOT REMOVE")},t}(g),on=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),sn=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.loop="i".charCodeAt(0),t.caseConversion=g.CASE_CONVERSIONS.SNAKE,t.tokensUsed=!1,t}return on(t,n),t.prototype.begin=function(){if(this.append("use strict;\nuse warnings;\n#use diagnostics;\nuse 5.20.1;\n\nselect(STDOUT); $| = 1; # DO NOT REMOVE").nl(),this.nl(),this.input.hasStatement())for(var n=0,t=this.input.statement.split("\n");n1){for(var t=0,e=n;t);"),this.tokensUsed=!0;var i=n.map((function(n){return"$"+n.name})).join(", ");this.nl().indent().append("my ("+i+") = split(/ /,$tokens);")}else{var u=n[0];this.nl().indent().append("chomp(my $"+u.name+" = );"),u.comment&&this.append(" # "+u.comment)}},t.prototype.handleReadLine=function(n){for(var t=0,e=n;t1?n.length+"*":"")+"$"+p+(0===i?"":"+"+i);this.nl().indent().append("my $"+u.name+" = $inputs["+r+"];")}},t.prototype.handleLoop=function(n){var t=String.fromCharCode(this.loop),e=isNaN(n.param)?"$"+n.param+"-1":n.param-1;this.nl().indent().append("for my $"+t+" (0.."+e+") {"),this.incIndent(),this.loop++,this.write(n.children[0]),this.loop--,this.decIndent(),this.nl().indent().append("}")},t.prototype.handleLoopLine=function(n){this.tokensUsed?this.nl().indent().append("chomp($tokens=);"):(this.nl().indent().append("chomp(my $tokens=);"),this.tokensUsed=!0),this.nl().indent().append("my @inputs = split(/ /,$tokens);");var t=n.children[0].children;if(1===t.length)return this.nl().indent().append("for my $"+t[0].children[0].name+" (@inputs) {"),this.incIndent(),this.loop++,this.nl().indent(),this.loop--,this.decIndent(),void this.nl().indent().append("}");this.handleLoop(n)},t.prototype.handleGameLoop=function(n){this.nl(),this.nl().indent().append("# game loop").nl(),this.indent().append("while (1) {"),this.incIndent();for(var t=0,e=n;t").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u0?".'"+t+"'.":".").replace(/'\.'/g,"")),this.append(";"),null==e||i||this.append(" # ").append(e);else{var a=n.split("\n");if(a.length>1||a[0].length>0){this.nl().indent().append('print "').append(a[0]).append('\\n";'),null==e||i||this.append(" # ").append(e);for(var o=1;o")},t}(g),hn=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),ln=function(n){function t(){var t,e,i=null!==n&&n.apply(this,arguments)||this;return i.loop="i".charCodeAt(0),i.typeMapping=((t={})[i.BOOL]="boolean",t[i.INT]="integer",t[i.FLOAT]="float",t[i.LONG]="integer",t[i.WORD]="string",t[i.STRING]="string",t[i.ARRAY]="{{#dim}}array({{/dim}}{{&type}}{{#dim}}){{/dim}}",t),i.readMapping=((e={})[i.BOOL]="%d",e[i.INT]="%d",e[i.LONG]="%d",e[i.FLOAT]="%f",e[i.WORD]="%s",e),i.caseConversion=g.CASE_CONVERSIONS.CAMEL,i.methodCaseConversion=g.CASE_CONVERSIONS.CAMEL,i.loopTpl="{{&beforeLoop}}for ({{&counter}} = {{&start}}; {{&counter}} < {{&end}}; {{&counter}}++) {\n{{&body}}\n}",i.voidReturnType="void",i}return hn(t,n),t.prototype.cast=function(n,t){return this.INT===n||this.LONG===n?"intval("+t+")":this.FLOAT===n?"floatval("+t+")":t},t.prototype.begin=function(){if(this.append("")},t.prototype.handleRead=function(n){var t=this;if(this.STRING!==n[0].type.name&&this.ARRAY!==n[0].type.name){for(var e=0,i=n;e=1&&this.nl().indent().append("$"+o.name+" = array();");var a=this.buildReadLoop(o,this.loopTpl,o.name,r);this.nl().append(this.indentString(a,this.level))}else{var o=n[0],s=Number.isNaN(parseInt(o.type.dimensions,10))?"$":"";this.nl().indent().append("$"+o.name+" = stream_get_line(STDIN, "+s+o.type.dimensions+' + 1, "\\n");'),null!=o.comment&&this.append("// "+o.comment)}},t.prototype.handleReadLine=function(n){for(var t=0;t1?n.length+"*":"")+"$"+String.fromCharCode(this.loop-1)+(0===t?"":"+"+t)]);this.nl().indent().append("$").append(n[t].name).append(" = "),this.INT===n[t].type.name||this.LONG===n[t].type.name?this.append("intval"):this.FLOAT===n[t].type.name&&this.append("floatval"),this.append(e),null!=n[t].comment&&this.append(" // ").append(n[t].comment)}},t.prototype.handleLoop=function(n){var t=String.fromCharCode(this.loop),e=isNaN(n.param)?"$"+n.param:n.param;this.nl().indent().append("for ($"+t+" = 0; $"+t+" < "+e+"; $"+t+"++)"),this.nl().indent().append("{"),this.incIndent(),this.loop++,this.write(n.children[0]),this.loop--,this.decIndent(),this.nl().indent().append("}")},t.prototype.handleLoopLine=function(n){this.nl().indent().append('$inputs = explode(" ", fgets(STDIN));'),this.handleLoop(n)},t.prototype.handleGameLoop=function(n){this.nl(),this.nl().indent().append("// game loop"),this.nl().indent().append("while (TRUE)"),this.nl().indent().append("{"),this.incIndent();for(var t=0,e=n;t").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u0?' . "'+t+'" . ':" . ")+' . "\\n"').replace(/" \. "/g,"")),this.append(");"),null==e||i||this.append(" // ").append(e);else{var a=n.split("\n");if(a.length>1||a[0].length>0){this.indent().append('echo("').append(a[0]).append('\\n");'),null==e||i||this.append(" // ").append(e);for(var o=1;o")},t.prototype.handleDump=function(n){if("string"==typeof n)this.nl().indent().append(this.rawOutput(n));else if(n.type.name===this.ARRAY){var t=n.type.dimensions.length,e=this.buildDumpLoop(n,n.name,t);this.nl().append(this.indentString(e,this.level))}else this.nl().indent().append(this.variableOutput(n))},t.prototype.handleCall=function(n,t,e){var i=this,u=t.map((function(n){return(n.type.name===i.ARRAY?"array $":"$")+i.formattedVarName(n.name)})).join(", "),p=t.map((function(n){return"$"+i.formattedVarName(n.name)})).join(", "),r=this.code.findIndex((function(n){return"{{{solve}}}"===n}));this.code[r]=this.functionDeclaration(n,u,this.defaultReturnStatement(e.type));var a=this.functionCall(n,e.type.name!==this.voidReturnType?e.type.name:"","$"+e.name,p);this.nl().append(this.indentString(a,this.level))},t.prototype.buildReadLoop=function(n,t,e,u){var p=n.type.dimensions.length;if(0===u)return t;var r=p-u,a=null,o=null,s=e+"[$"+this.sletters[r]+"]";if(1===u)if(this.STRING===n.type.innerType.name)o="$"+s+" = fgets(STDIN);";else{var h="$inputs[$"+this.sletters[r]+"]";a='$inputs = explode(" ", fgets(STDIN));',o="$"+s+" = "+this.cast(n.type.innerType.name,h)+";"}else o=this.loopTpl;var l=i.render(t,{beforeLoop:null!=a?a+"\n"+this.indentString("",r):"",counter:"$"+this.sletters[r],start:0,end:(isNaN(n.type.dimensions[r])?"$":"")+this.formattedVarName(n.type.dimensions[r]),body:this.indentString(o,r+1)});return this.buildReadLoop(n,l,s,u-1)},t.prototype.buildDumpLoop=function(n,t,e){var u=n.type.dimensions.length-e,p="",r=t+"[$"+this.sletters[u]+"]";return p=1===e?this.rawOutput("$"+r):this.buildDumpLoop(n,r,e-1),i.render(this.loopTpl,{counter:"$"+this.sletters[u],start:0,end:n.type.dimensions[u]?(isNaN(n.type.dimensions[u])?"$":"")+this.formattedVarName(n.type.dimensions[u]):"count($"+t+")",body:this.indentString(p,1)})},t.prototype.variableOutput=function(n){return'echo "$'+this.formattedVarName(n.name)+'\n";'},t.prototype.rawOutput=function(n){return"echo "+n+' . "\\n";'},t.prototype.functionSignatureSimple=function(n,t){return n+"("+t+")"},t.prototype.functionDeclaration=function(n,t,e){return"\nfunction "+this.functionSignatureSimple(n,t)+" {\n  // Write your code here\n  // To debug (equivalent to var_dump): error_log(var_export($var, true));\n  "+e+"\n}\n"},t.prototype.defaultReturnStatement=function(n){var t,e=((t={})[this.INT]=function(){return"0"},t[this.LONG]=function(){return"0"},t[this.FLOAT]=function(){return"0.0"},t[this.WORD]=function(){return'""'},t[this.STRING]=function(){return'""'},t[this.ARRAY]=function(n){return"[".repeat(n.dimensions.length)+"]".repeat(n.dimensions.length)},t);return n.name?"\n  return "+e[n.name](n)+";":""},t.prototype.functionCall=function(n,t,e,u){return i.render("$oldStdout = fopen('php://stdout', 'wb');\neio_dup2(STDERR, STDOUT);\neio_event_loop();\n{{#type}}{{&res}} = {{/type}}{{&name}}({{¶ms}});\neio_dup2($oldStdout, STDOUT);\neio_event_loop();",{name:n,type:t,res:e,params:u})},t.prototype.buildStatementData=function(n,t,e){var i=this,u=t.map((function(n){return(n.type.name===i.ARRAY?"array $":"$")+i.formattedVarName(n.name)})).join(", "),p=t.map((function(n){return"$"+i.formattedVarName(n.name)})).join(", "),r=e.type.name?this.formatType(e.type):this.voidReturnType;return{functionNomenclature:"function",arrayNomenclature:"array",null:"NULL",parameters:t.map((function(n){return{name:n.name,label:i.formattedVarName(n.name),type:i.formatType(n.type)}})),functionName:n,functionSimple:this.functionSignatureSimple(n,p),functionFull:this.functionSignatureSimple(n,u),returnType:r}},t}(g),dn=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),cn=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.loop="i".charCodeAt(0),t.keyWords={en:{read:"read {var}",for:"for {var}={begin} to {end}",endfor:"end for",while:"while {var}",endwhile:"end while",true:"true",false:"false"},fr:{read:"lire {var}",for:"pour {var} de {begin} jusqu'à {end}",endfor:"end pour",while:"tant que {var}",endwhile:"fin tant que",true:"vrai",false:"faux"}},t}return dn(t,n),t.prototype.handleRead=function(n){for(var t=0,e=n;t1){for(var e=0,i=n;e1||s.type.innerType.name===this.STRING&&c>=1)&&this.nl().indent().append(s.name+" = []"),s.comment&&this.append("  # ").append(s.comment);var f=void 0;f=s.type.innerType.name===this.STRING?this.buildReadStringLoop(s,this.loopTpl,s.name,c):this.buildReadNonStringLoop(s,s.name,c),this.nl().append(this.indentString(f,this.level))}}},t.prototype.handleReadLine=function(n){for(var t=0,e=n;t1?n.length+"*":"")+p+(0===i?"":"+"+i))+"]";this.nl().indent().append(u.name+" = "+this.format(this.readMapping[u.type.name],[r]))}},t.prototype.handleLoop=function(n){var t=String.fromCharCode(this.loop);this.nl().indent().append("for "+t+" in range("+n.param+"):"),this.incIndent(),this.loop++,this.write(n.children[0]),this.loop--,this.decIndent()},t.prototype.handleLoopLine=function(n){if(1===n.children[0].children.length){var t=String.fromCharCode(this.loop),e=n.children[0].children[0],i=e.children[0];e.name===this.WORD?this.nl().indent().append("for "+i.name+" in input().split():"):this.nl().indent().append("for "+t+" in input().split():"),this.incIndent(),null!=i.comment&&this.nl().indent().append("# "+i.name+": "+i.comment),e.name===this.WORD?this.nl().indent().append("pass"):this.nl().indent().append(i.name+" = "+this.format(this.readMapping[e.name],[t])),this.decIndent()}else this.nl().indent().append("inputs = input().split()"),this.handleLoop(n)},t.prototype.handleGameLoop=function(n){this.nl(),this.nl().indent().append("# game loop").nl(),this.indent().append("while True:"),this.incIndent();for(var t=0,e=n;t").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u0?' + "'+t+'" + ':" + ").replace(/" \+ "/g,"")),this.append(")");else{var a=n.split("\n");if(a.length>1||a[0].length>0){null==e||i||this.indent().append("# ").append(e).nl(),this.indent().append('print("').append(a[0]).append('")');for(var o=1;o")},t.prototype.handleDump=function(n){if("string"==typeof n)this.nl().indent().append(this.variableOutput(n));else if(n.type.name===this.ARRAY){var t=n.type.dimensions.length,e=this.buildDumpLoop(n,n.name,t);this.nl().append(this.indentString(e,this.level))}else{var i=this.formattedVarName(n.name);this.nl().indent().append(this.variableOutput(i))}},t.prototype.handleCall=function(n,t,e){var i=this,u=t.map((function(n){return i.formattedVarName(n.name)})).join(", "),p=t.map((function(n){return i.formattedVarName(n.name)})).join(", "),r=this.code.findIndex((function(n){return"{{{solve}}}"===n}));this.code[r]=this.functionDeclaration(n,u,this.defaultReturnStatement(e.type));var a=this.functionCall(n,e.type.name!==this.voidReturnType?e.name:"",e.name,p);this.nl().append(this.indentString(a,this.level))},t.prototype.buildReadStringLoop=function(n,t,e,u){var p=n.type.dimensions.length;if(0===u)return t;var r=p-u,a="";1===u?a=e+".append(input())":a=e+".append([])\n"+this.loopTpl;var o=i.render(t,{counter:this.sletters[r],start:0,end:this.formattedVarName(n.type.dimensions[r]),body:this.indentString(a,r+1)});return this.buildReadStringLoop(n,o,e+"["+this.sletters[r]+"]",u-1)},t.prototype.buildReadNonStringLoop=function(n,t,e){var u=n.type.dimensions.length-e,p="["+this.format(this.readMapping[n.type.innerType.name],[this.sletters[u]])+" for "+this.sletters[u]+" in input().split()]",r="";return 1===e?1===n.type.dimensions.length?t+" = "+p:t+".append("+p+")":(r=e>2?t+".append([])\n"+this.buildReadNonStringLoop(n,t+"["+this.sletters[u]+"]",e-1):this.buildReadNonStringLoop(n,t,e-1),i.render(this.loopTpl,{counter:this.sletters[u],start:0,end:this.formattedVarName(n.type.dimensions[u]),body:this.indentString(r,1)}))},t.prototype.buildDumpLoop=function(n,t,e){var u=n.type.dimensions.length-e,p="";return p=1===e?this.variableOutput(t+"["+this.sletters[u]+"]"):this.buildDumpLoop(n,t+"["+this.sletters[u]+"]",e-1),i.render(this.loopTpl,{counter:this.sletters[u],start:0,end:n.type.dimensions[u]?this.formattedVarName(n.type.dimensions[u]):"len("+t+")",body:this.indentString(p,1)})},t.prototype.variableOutput=function(n){return"print("+n+")"},t.prototype.functionSignatureSimple=function(n,t){return n+"("+t+")"},t.prototype.functionDeclaration=function(n,t,e){return"\ndef "+this.functionSignatureSimple(n,t)+':\n    # Write your code here\n    # To debug: print("Debug messages...", file=sys.stderr)\n    '+e+"\n"},t.prototype.defaultReturnStatement=function(n){var t,e=((t={})[this.INT]=function(){return"0"},t[this.LONG]=function(){return"0"},t[this.FLOAT]=function(){return"0.0"},t[this.STRING]=function(){return"''"},t[this.WORD]=function(){return"''"},t[this.BOOL]=function(){return"False"},t[this.ARRAY]=function(n){return"[".repeat(n.dimensions.length)+"]".repeat(n.dimensions.length)},t);return n.name?"return "+e[n.name](n):"pass"},t.prototype.functionCall=function(n,t,e,u){return i.render("with redirect_stdout(sys.stderr):\n    {{#type}}{{&res}} = {{/type}}{{&name}}({{¶ms}})",{name:n,type:t,res:e,params:u})},t.prototype.buildStatementData=function(n,t,e){var i=this,u=t.map((function(n){return i.formattedVarName(n.name)})).join(", "),p=t.map((function(n){return i.formattedVarName(n.name)})).join(", "),r=e.type.name?this.formatType(e.type):this.voidReturnType;return{functionNomenclature:"function",arrayNomenclature:"list",null:"None",parameters:t.map((function(n){return{name:n.name,label:i.formattedVarName(n.name),type:i.formatType(n.type)}})),functionName:n,functionSimple:this.functionSignatureSimple(n,p),functionFull:this.functionSignatureSimple(n,u),returnType:r}},t}(g),An=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),yn=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.loop="i".charCodeAt(0),t.caseConversion=g.CASE_CONVERSIONS.SNAKE,t}return An(t,n),t.prototype.begin=function(){if(this.input.turnBased&&(this.append("STDOUT.sync = true # DO NOT REMOVE"),this.nl()),this.input.hasStatement())for(var n=0,t=this.input.statement.split("\n");n1){for(var e=0,i=n;e1?n.length+"*":"")+String.fromCharCode(this.loop-1)+(0===u?"":"+"+u)+"]"),p.type.name===this.FLOAT?this.append(".to_f"):p.type.name!==this.INT&&p.type.name!==this.LONG||this.append(".to_i")}},t.prototype.handleLoop=function(n){var t=n.param;this.nl().indent().append(t+".times do"),this.incIndent(),this.loop++,this.write(n.children[0]),this.loop--,this.decIndent(),this.nl().indent().append("end")},t.prototype.handleLoopLine=function(n){this.nl().indent().append('inputs = gets.split(" ")');var t=String.fromCharCode(this.loop),e=n.param;this.nl().indent().append("for "+t+" in 0..("+e+"-1)"),this.incIndent(),this.loop++,this.write(n.children[0]),this.loop--,this.decIndent(),this.nl().indent().append("end")},t.prototype.handleGameLoop=function(n){this.nl(),this.nl().indent().append("# game loop").nl(),this.indent().append("loop do"),this.incIndent();for(var t=0,e=n;t").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u1||a[0].length>0){this.indent().append('puts "').append(a[0]).append('"'),null==e||i||this.append(" # ").append(e);for(var o=1;o")},t}(g),gn=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),En=function(n){function t(){var t,e=null!==n&&n.apply(this,arguments)||this;return e.loop="i".charCodeAt(0),e.readMapping=((t={})[e.INT]="parse_input!(%s, i32)",t[e.LONG]="parse_input!(%s, i64)",t[e.FLOAT]="parse_input!(%s, f64)",t[e.WORD]="%s.trim().to_string()",t[e.STRING]="%s.trim_end().to_string()",t),e.caseConversion=g.CASE_CONVERSIONS.SNAKE,e}return gn(t,n),t.prototype.begin=function(){if(this.append("use std::io;").nl().nl(),this.append("macro_rules! parse_input {").nl().incIndent(),this.indent().append("($x:expr, $t:ident) => ($x.trim().parse::<$t>().unwrap())").nl().decIndent(),this.indent().append("}").nl().nl(),this.input.hasStatement()){this.append("/**").nl();for(var n=0,t=this.input.statement.split("\n");n1){this.append("let mut input_line = String::new();").nl().indent(),this.append("io::stdin().read_line(&mut input_line).unwrap();").nl().indent(),this.append('let inputs = input_line.split(" ").collect::>();');for(var t=0,e=0,i=n;e1?n.length+"*":"")+String.fromCharCode(this.loop-1)+(0===t?"":"+"+t)+"]";this.nl().indent().append("let ").append(e.name+" = "+this.format(this.readMapping[e.type.name],[i])+";"),null!=e.comment&&this.append(" // ").append(e.comment)}},t.prototype.handleLoop=function(n){var t=String.fromCharCode(this.loop);this.nl().indent().append("for "+t+" in 0.."+n.param+" as usize {"),this.incIndent(),this.loop++,this.write(n.children[0]),this.loop--,this.decIndent(),this.nl().indent().append("}")},t.prototype.handleLoopLine=function(n){if(this.nl().indent(),1===n.children[0].children.length){this.append("let mut inputs = String::new();"),this.nl().indent(),this.append("io::stdin().read_line(&mut inputs).unwrap();");var t=String.fromCharCode(this.loop),e=n.children[0].children[0],i=e.children[0];return e.name===this.WORD?this.nl().indent().append("for ").append(i.name).append(" in inputs.split_whitespace() {"):this.nl().indent().append("for ").append(t).append(" in inputs.split_whitespace() {"),this.incIndent(),e.name!==this.WORD&&this.nl().indent().append("let "+i.name+" = "+this.format(this.readMapping[e.name],[t])+";"),this.decIndent(),void this.nl().indent().append("}")}this.append("let mut input_line = String::new();").nl().indent(),this.append("io::stdin().read_line(&mut input_line).unwrap();").nl().indent(),this.append("let inputs = input_line.split_whitespace().collect::>();"),this.handleLoop(n)},t.prototype.handleGameLoop=function(n){this.nl(),this.nl().indent().append("// game loop").nl(),this.indent().append("loop {"),this.incIndent();for(var t=0,e=n;t").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u1||a[0].length>0){this.indent().append('println!("').append(a[0]).append('");'),null==e||i||this.append(" // ").append(e);for(var o=1;o")},t}(g),Cn=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),vn=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.loop="i".charCodeAt(0),t.looplineUsed=!1,t.caseConversion=g.CASE_CONVERSIONS.LOWER,t}return Cn(t,n),t.prototype.begin=function(){if(this.append("import math._").nl(),this.append("import scala.util._").nl(),this.append("import scala.io.StdIn._").nl(),this.nl(),this.input.hasStatement()){this.append("/**").nl();for(var n=0,t=this.input.statement.split("\n");n1){for(var e=0,i=n;e1?n.length+"*":"")+String.fromCharCode(this.loop-1)+(0===u?"":"+"+u)+")"),this.INT===r.name?this.append(".toInt"):this.LONG===r.name?this.append(".toLong"):this.FLOAT===r.name&&this.append(".toFloat")}}this.nl().indent()},t.prototype.handleLoop=function(n){var t=String.fromCharCode(this.loop);this.nl().indent().append("for("+t+" <- 0 until "+n.param.toLowerCase()+") {"),this.incIndent(),this.loop++,this.write(n.children[0]),this.loop--,this.decIndent(),this.nl().indent().append("}")},t.prototype.handleLoopLine=function(n){var t=this.looplineUsed?"":"var ";this.looplineUsed=!0,this.nl().indent().append(t+'inputs = readLine split " "'),this.handleLoop(n)},t.prototype.handleGameLoop=function(n){this.nl(),this.nl().indent().append("// game loop").nl(),this.indent().append("while(true) {"),this.incIndent();for(var t=0,e=n;t").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u0?' + "'+t+'" + ':" + ").replace(/" \+ "/g,"")),this.append(")"),null==e||i||this.append(" // ").append(e);else{var a=n.split("\n");if(a.length>1||a[0].length>0){this.indent().append('println("').append(a[0]).append('")'),null==e||i||this.append(" // ").append(e);for(var o=1;o")},t}(g),Fn=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),Dn=function(n){function t(){var t,e,i=null!==n&&n.apply(this,arguments)||this;return i.loop="i".charCodeAt(0),i.typeMapping=((t={})[i.INT]="Int",t[i.FLOAT]="Float",t[i.LONG]="Long",t[i.WORD]="String",t[i.BOOL]="Bool",t[i.STRING]="String",t),i.readMapping=((e={})[i.INT]="Int(%s)!",e[i.LONG]="Int(%s)!",e[i.FLOAT]="Float(%s)!",e[i.BOOL]='%s != "0"',e[i.WORD]="%s",e[i.STRING]="%s",e),i.caseConversion=g.CASE_CONVERSIONS.CAMEL,i.methodCaseConversion=g.CASE_CONVERSIONS.CAMEL,i.loopTpl="for {{&counter}} in {{&start}}..<{{&end}} {\n{{&body}}\n}",i.inputsCounter=0,i.voidReturnType="Void",i}return Fn(t,n),t.prototype.begin=function(){if(this.append("import Glibc").nl(),this.append("import Foundation").nl().nl(),this.append("public struct StderrOutputStream: TextOutputStream {").nl().incIndent(),this.indent().append("public mutating func write(_ string: String) { fputs(string, stderr) }").nl().decIndent(),this.append("}").nl(),this.append("public var errStream = StderrOutputStream()").nl().nl(),this.input.hasStatement()){this.append("/**").nl();for(var n=0,t=this.input.statement.split("\n");n1){var t="inputs"+(++this.inputsCounter>1?this.inputsCounter:"");this.append("let "+t+' = (readLine()!).split(separator: " ").map(String.init)');for(var e=0,i=0,u=n;i=1&&this.append(this.variableDefinition(o));var h="";h=o.type.innerType.name===this.STRING?this.buildReadStringLoop(o,this.loopTpl,o.name,s):this.buildReadNonStringLoop(o,o.name,s),this.nl().append(this.indentString(h,this.level))}}},t.prototype.handleReadLine=function(n){for(var t=0;t1?n.length+"*":"")+String.fromCharCode(this.loop-1)+(0===t?"":"+"+t)+"]"]);this.nl().indent().append("let ").append(e.name).append(" = ").append(i),null!=e.comment&&this.append(" // ").append(e.comment)}},t.prototype.handleLoop=function(n){var t=String.fromCharCode(this.loop),e=!1,i=parseInt(n.param,10);isNaN(i)?(i="("+n.param+"-1)",this.nl().indent().append("if "+n.param+" > 0 {"),this.incIndent(),e=!0):i--,this.nl().indent().append("for "+t+" in 0..."+i+" {"),this.incIndent(),this.loop++;var u=this.inputsCounter;this.inputsCounter=0,this.write(n.children[0]),this.inputsCounter=u,this.loop--,this.decIndent(),this.nl().indent().append("}"),e&&(this.decIndent(),this.nl().indent().append("}"))},t.prototype.handleLoopLine=function(n){if(this.nl().indent(),1===n.children[0].children.length){var t=String.fromCharCode(this.loop),e=n.children[0].children[0],i=e.children[0];e.name===this.WORD?(this.append("for "+i.name+' in ((readLine()!).split(separator: " ").map(String.init)) {'),this.nl().indent().append("}")):(this.append("for "+t+' in ((readLine()!).split(separator: " ").map(String.init)) {').incIndent(),this.nl().indent().append("let "+i.name+" = "+this.format(this.readMapping[e.name],[t])).decIndent(),this.nl().indent().append("}"))}else this.append('let inputs = (readLine()!).split(separator: " ").map(String.init)'),this.handleLoop(n)},t.prototype.handleGameLoop=function(n){this.nl(),this.nl().indent().append("// game loop").nl(),this.indent().append("while true {"),this.incIndent();var t=this.inputsCounter;this.inputsCounter=0;for(var e=0,i=n;e").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u1||a[0].length>0){this.indent().append('print("').append(a[0]).append('");'),null==e||i||this.indent().append(" // ").append(e).nl();for(var o=1;o")},t.prototype.handleDump=function(n){if("string"==typeof n)this.nl().indent().append(this.variableOutput(n));else if(n.type.name===this.ARRAY){var t=n.type.dimensions.length,e=this.buildDumpLoop(n,n.name,t);this.nl().append(this.indentString(e,this.level))}else{var i=this.formattedVarName(n.name);this.nl().indent().append(this.variableOutput(i))}},t.prototype.handleCall=function(n,t,e){var i=this,u=t.map((function(n){return"_ "+i.formattedVarName(n.name)+": "+i.typeDeclaration(n.type)})).join(", "),p=t.map((function(n){return i.formattedVarName(n.name)})).join(", "),r=this.code.findIndex((function(n){return"{{{solve}}}"===n}));this.code[r]=this.functionDeclaration(n,u,e.name?this.typeDeclaration(e.type):this.voidReturnType);var a=this.functionCall(n,e.type.name!==this.voidReturnType?e.type.name:"",e.name,p);this.nl().append(this.indentString(a,this.level))},t.prototype.buildReadStringLoop=function(n,t,e,u){var p=n.type.dimensions.length;if(0===u)return t;var r=p-u,a="",o=e+"["+this.sletters[r]+"]";a=1===u?o+" = readLine()!":this.loopTpl;var s=i.render(t,{counter:this.sletters[r],start:0,end:this.formattedVarName(n.type.dimensions[r]),body:this.indentString(a,r+1)});return this.buildReadStringLoop(n,s,o,u-1)},t.prototype.buildReadNonStringLoop=function(n,t,e){var u=n.type.dimensions.length-e,p='(readLine()!).split(separator: " ").map(String.init)';n.type.innerType.name!==this.WORD&&(p='(readLine()!).split(separator: " ").map{'+this.typeMapping[n.type.innerType.name]+"(String($0))!}");var r="",a=t+"["+this.sletters[u]+"]";return 1===e?(n.type.dimensions.length,t+" = "+p):(r=this.buildReadNonStringLoop(n,a,e-1),i.render(this.loopTpl,{counter:this.sletters[u],start:0,end:this.formattedVarName(n.type.dimensions[u]),body:this.indentString(r,1)}))},t.prototype.buildDumpLoop=function(n,t,e){var u=n.type.dimensions.length-e,p="";return p=1===e?this.variableOutput(t+"["+this.sletters[u]+"]"):this.buildDumpLoop(n,t+"["+this.sletters[u]+"]",e-1),i.render(this.loopTpl,{counter:this.sletters[u],start:0,end:n.type.dimensions[u]?this.formattedVarName(n.type.dimensions[u]):t+".count",body:this.indentString(p,1)})},t.prototype.variableOutput=function(n){return"print("+n+")"},t.prototype.functionSignatureSimple=function(n,t){return n+"("+t+")"},t.prototype.functionSignatureFull=function(n,t,e){return this.functionSignatureSimple(n,t)+" -> "+e},t.prototype.functionDeclaration=function(n,t,e){return"\nfunc "+this.functionSignatureFull(n,t,e)+' {\n    // Write your code here\n    // To debug: print("Debug messages...", to: &errStream)\n\n    return '+e+"()\n}\n"},t.prototype.functionCall=function(n,t,e,u){return i.render("var stdoutRescue = stdout\nstdout = stderr\n{{#type}}let {{&res}} = {{/type}}{{&name}}({{¶ms}})\nstdout = stdoutRescue",{name:n,type:t,res:e,params:u})},t.prototype.typeDeclaration=function(n){return n.name===this.ARRAY?"[".repeat(n.dimensions.length)+this.typeMapping[n.innerType.name]+"]".repeat(n.dimensions.length):this.typeMapping[n.name]},t.prototype.variableDefinition=function(n){return(n.type.name===this.ARRAY?"var ":"let ")+n.name+" = "+this.typeDeclaration(n.type)+"()"},t.prototype.buildStatementData=function(n,t,e){var i=this,u=t.map((function(n){return i.formattedVarName(n.name)+": "+i.typeDeclaration(n.type)})).join(", "),p=t.map((function(n){return i.formattedVarName(n.name)})).join(", "),r=e.name?this.typeDeclaration(e.type):this.voidReturnType;return{functionNomenclature:"function",arrayNomenclature:"array",null:"nil",parameters:t.map((function(n){return{name:n.name,label:i.formattedVarName(n.name),type:i.typeDeclaration(n.type)}})),functionName:n,functionSimple:this.functionSignatureSimple(n,p),functionFull:this.functionSignatureFull(n,u,r),returnType:r}},t}(g),Sn=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),Ln=function(n){function t(){var t,e,i,u=null!==n&&n.apply(this,arguments)||this;return u.loop="i".charCodeAt(0),u.typeMapping=((t={})[u.BOOL]="boolean",t[u.INT]="number",t[u.FLOAT]="number",t[u.LONG]="number",t[u.WORD]="string",t[u.STRING]="string",t[u.ARRAY]="{{&type}}{{#dim}}[]{{/dim}}",t),u.readMapping=((e={})[u.INT]="parseInt(%s)",e[u.LONG]="parseInt(%s)",e[u.FLOAT]="parseFloat(%s)",e[u.BOOL]="%s !== '0'",e[u.WORD]="%s",e[u.STRING]="%s",e),u.defaultReturnMapping=((i={})[u.BOOL]=function(){return"false"},i[u.INT]=function(){return"0"},i[u.LONG]=function(){return"0"},i[u.FLOAT]=function(){return"0.0"},i[u.STRING]=function(){return"''"},i[u.WORD]=function(){return"''"},i[u.ARRAY]=function(n){return"[".repeat(n.dimensions.length)+"]".repeat(n.dimensions.length)},i),u.methodCaseConversion=g.CASE_CONVERSIONS.CAMEL,u.caseConversion=g.CASE_CONVERSIONS.CAMEL,u.loopTpl="for (let {{&counter}} = {{&start}}; {{&counter}} < {{&end}}; {{&counter}}++) {\n{{&body}}\n}",u.voidReturnType="",u}return Sn(t,n),t.prototype.begin=function(){if(this.input.hasStatement()){this.append("/**").nl();for(var n=0,t=this.input.statement.split("\n");n1){this.append("var inputs: string[] = readline().split(' ');");for(var t=0,e=0,i=n;e1||a.type.innerType.name===this.STRING?(this.append("const "+this.variableDefinition(a)+" = "+"[".repeat(o)+"]".repeat(o)+";"),this.nl().append(this.indentString(s,this.level))):this.append("const "+s)}}},t.prototype.handleReadLine=function(n){for(var t=0;t1?n.length+"*":"")+i+(0===t?"":"+"+t),p=this.format(this.readMapping[e.type.name],["inputs["+u+"]"]),r=this.variableDefinition(e);this.nl().indent().append("const "+r+" = "+p+";"),null!=e.comment&&this.append("// ").append(e.comment)}},t.prototype.handleLoop=function(n){var t=String.fromCharCode(this.loop);this.nl().indent().append("for (let "+t+" = 0; "+t+" < "+n.param+"; "+t+"++) {"),this.incIndent(),this.loop++,this.write(n.children[0]),this.loop--,this.decIndent(),this.nl().indent().append("}")},t.prototype.handleLoopLine=function(n){this.nl().indent(),this.append("var inputs: string[] = readline().split(' ');"),this.handleLoop(n)},t.prototype.handleGameLoop=function(n){this.nl(),this.nl().indent().append("// game loop").nl(),this.indent().append("while (true) {"),this.incIndent();for(var t=0,e=n;t").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u0?" + '"+t+"' + ":" + ").replace(/' \+ '/g,"")),this.append(");"),null==e||i||this.append(" // ").append(e);else{var a=n.split("\n");if(a.length>1||a[0].length>0){this.indent().append("console.log('").append(a[0]).append("');"),null==e||i||this.indent().append(" // ").append(e).nl();for(var o=1;o")},t.prototype.handleDump=function(n){if("string"==typeof n)this.nl().indent().append(this.variableOutput(n));else if(n.type.name===this.ARRAY){var t=n.type.dimensions.length,e=this.buildDumpLoop(n,n.name,t);this.nl().append(this.indentString(e,this.level))}else{var i=this.formattedVarName(n.name);this.nl().indent().append(this.variableOutput(i))}},t.prototype.handleCall=function(n,t,e){var i=this.functionDeclaration(n,t,e.type),u=this.functionCall(n,t,e),p=this.code.findIndex((function(n){return"{{{solve}}}"===n}));this.code[p]=i,this.nl().append(this.indentString(u,this.level))},t.prototype.buildReadStringLoop=function(n,t,e,u){var p=n.type.dimensions.length;if(0===u)return t;var r=p-u,a="",o=e+"["+this.sletters[r]+"]";a=1===u?o+" = readline();":this.loopTpl;var s=i.render(t,{counter:this.sletters[r],start:0,end:this.formattedVarName(n.type.dimensions[r]),body:this.indentString(a,r+1)});return this.buildReadStringLoop(n,s,o,u-1)},t.prototype.buildReadNonStringLoop=function(n,t,e){var u=n.type.dimensions.length-e,p=n.type.innerType.name!==this.WORD?".map("+this.sletters[u+1]+" => "+this.format(this.readMapping[n.type.innerType.name],[this.sletters[u+1]])+")":"",r="";if(1===e){var a="readline().split(' ')"+p+";";if(e===t)return this.variableDefinition(n)+" = "+a;for(var o="",s=0;s console.error(chunk);\nconst "+this.variableDefinition(e)+" = "+n+"("+u+");\nprocess.stdout.write = oldWrite;"},t.prototype.variableDefinition=function(n){return this.formattedVarName(n.name)+": "+this.formatType(n.type)},t.prototype.buildStatementData=function(n,t,e){var i=this;return{functionNomenclature:"function",arrayNomenclature:"array",null:"null",parameters:t.map((function(n){return{name:n.name,label:i.formattedVarName(n.name),type:i.formatType(n.type)}})),functionName:n,functionSimple:this.functionSignatureSimple(n,t,e.type),functionFull:this.functionSignatureSimple(n,t,e.type),returnType:this.formatType(e.type)}},t}(g),On=function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),Bn=function(n){function t(){var t,e=null!==n&&n.apply(this,arguments)||this;return e.loop="i".charCodeAt(0),e.typeMapping=((t={})[e.INT]="Integer",t[e.LONG]="Long",t[e.STRING]="String",t[e.WORD]="String",t[e.FLOAT]="Double",t),e.SPLITLINE_TOKEN="{{Dim inputs as String()}}",e.EVIL_TOKEN="@@ VB.NET is magic @@",e.evilIndentation=0,e.needSplitline=0,e}return On(t,n),t.prototype.begin=function(){if(this.append("Module ").append(this.input.turnBased?"Player":"Solution").nl(),this.input.hasStatement())for(var n=0,t=this.input.statement.split("\n");n1?"Dim inputs as String()":"");var t=new Array(this.evilIndentation*this.indentSize+1).join(" ");n=n.replace(this.EVIL_TOKEN,1===this.needSplitline?t+"Dim inputs as String()":""),this.code=[n]},t.prototype.handleRead=function(n){if(n.length>1){0===this.needSplitline&&(this.evilIndentation=this.level,this.nl().append(this.EVIL_TOKEN)),this.needSplitline++;for(var t=0,e=n;t1?n.length+"*":"")+String.fromCharCode(this.loop-1)+(0===u?"":"+"+u)).append(")")}},t.prototype.handleLoop=function(n){var t=String.fromCharCode(this.loop),e=parseInt(n.param,10);isNaN(e)?e=n.param+"-1":e--,this.nl().indent().append("For "+t+" as Integer = 0 To "+e),this.incIndent(),this.loop++,this.write(n.children[0]),this.loop--,this.decIndent(),this.nl().indent().append("Next"),this.nl()},t.prototype.handleLoopLine=function(n){0===this.needSplitline&&(this.evilIndentation=this.level,this.nl().append(this.EVIL_TOKEN)),this.nl().indent().append('inputs = Console.ReadLine().Split(" ")'),this.needSplitline++,this.handleLoop(n)},t.prototype.handleGameLoop=function(n){this.nl().indent().append("' game loop").nl(),this.indent().append("While True"),this.incIndent();for(var t=0,e=n;t").nl();var i=null!=e&&(e.length>50||e.split("\n").length>1);if(i){for(var u=0,p=e.split("\n");u0?' & "'+t+'" & ':" & ").replace(/" & "/g,"")),this.append(")"),null==e||i||this.append(" ' ").append(e);else{var a=n.split("\n");if(a.length>1||a[0].length>0){this.indent().append('Console.WriteLine("').append(a[0]).append('")'),null==e||i||this.append(" ' ").append(e);for(var o=1;o")},t}(g);e.d(t,"generateStub",(function(){return Tn})),e.d(t,"generateStatementData",(function(){return In})),e.d(t,"generateStubAndStatementData",(function(){return wn})),e.d(t,"parseStubInput",(function(){return xn})),e.d(t,"generateStatement",(function(){return Vn}));var Rn=function(){return(Rn=Object.assign||function(n){for(var t,e=1,i=arguments.length;e




© 2015 - 2025 Weber Informatics LLC | Privacy Policy