parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"9xaU":[function(require,module,exports) {
var t=function(e){"use strict";var r=1e7,o=7,n=9007199254740992,i=h(n),u="0123456789abcdefghijklmnopqrstuvwxyz",p="function"==typeof BigInt;function a(t,e,r,o){return void 0===t?a[0]:void 0!==e&&(10!=+e||r)?$(t,e,r,o):Q(t)}function s(t,e){this.value=t,this.sign=e,this.isSmall=!1}function l(t){this.value=t,this.sign=t<0,this.isSmall=!0}function f(t){this.value=t}function v(t){return-n<t&&t<n}function h(t){return t<1e7?[t]:t<1e14?[t%1e7,Math.floor(t/1e7)]:[t%1e7,Math.floor(t/1e7)%1e7,Math.floor(t/1e14)]}function y(t){c(t);var e=t.length;if(e<4&&P(t,i)<0)switch(e){case 0:return 0;case 1:return t[0];case 2:return t[0]+t[1]*r;default:return t[0]+(t[1]+t[2]*r)*r}return t}function c(t){for(var e=t.length;0===t[--e];);t.length=e+1}function g(t){for(var e=new Array(t),r=-1;++r<t;)e[r]=0;return e}function m(t){return t>0?Math.floor(t):Math.ceil(t)}function d(t,e){var o,n,i=t.length,u=e.length,p=new Array(i),a=0,s=r;for(n=0;n<u;n++)a=(o=t[n]+e[n]+a)>=s?1:0,p[n]=o-a*s;for(;n<i;)a=(o=t[n]+a)===s?1:0,p[n++]=o-a*s;return a>0&&p.push(a),p}function w(t,e){return t.length>=e.length?d(t,e):d(e,t)}function b(t,e){var o,n,i=t.length,u=new Array(i),p=r;for(n=0;n<i;n++)o=t[n]-p+e,e=Math.floor(o/p),u[n]=o-e*p,e+=1;for(;e>0;)u[n++]=e%p,e=Math.floor(e/p);return u}function S(t,e){var o,n,i=t.length,u=e.length,p=new Array(i),a=0,s=r;for(o=0;o<u;o++)(n=t[o]-a-e[o])<0?(n+=s,a=1):a=0,p[o]=n;for(o=u;o<i;o++){if(!((n=t[o]-a)<0)){p[o++]=n;break}n+=s,p[o]=n}for(;o<i;o++)p[o]=t[o];return c(p),p}function q(t,e,o){var n,i,u=t.length,p=new Array(u),a=-e,f=r;for(n=0;n<u;n++)i=t[n]+a,a=Math.floor(i/f),i%=f,p[n]=i<0?i+f:i;return"number"==typeof(p=y(p))?(o&&(p=-p),new l(p)):new s(p,o)}function M(t,e){var o,n,i,u,p=t.length,a=e.length,s=g(p+a),l=r;for(i=0;i<p;++i){u=t[i];for(var f=0;f<a;++f)o=u*e[f]+s[i+f],n=Math.floor(o/l),s[i+f]=o-n*l,s[i+f+1]+=n}return c(s),s}function N(t,e){var o,n,i=t.length,u=new Array(i),p=r,a=0;for(n=0;n<i;n++)o=t[n]*e+a,a=Math.floor(o/p),u[n]=o-a*p;for(;a>0;)u[n++]=a%p,a=Math.floor(a/p);return u}function E(t,e){for(var r=[];e-- >0;)r.push(0);return r.concat(t)}function O(t,e,o){return new s(t<r?N(e,t):M(e,h(t)),o)}function B(t){var e,o,n,i,u=t.length,p=g(u+u),a=r;for(n=0;n<u;n++){o=0-(i=t[n])*i;for(var s=n;s<u;s++)e=i*t[s]*2+p[n+s]+o,o=Math.floor(e/a),p[n+s]=e-o*a;p[n+u]=o}return c(p),p}function I(t,e){var o,n,i,u,p=t.length,a=g(p),s=r;for(i=0,o=p-1;o>=0;--o)i=(u=i*s+t[o])-(n=m(u/e))*e,a[o]=0|n;return[a,0|i]}function A(t,e){var o,n=Q(e);if(p)return[new f(t.value/n.value),new f(t.value%n.value)];var i,u=t.value,v=n.value;if(0===v)throw new Error("Cannot divide by zero");if(t.isSmall)return n.isSmall?[new l(m(u/v)),new l(u%v)]:[a[0],t];if(n.isSmall){if(1===v)return[t,a[0]];if(-1==v)return[t.negate(),a[0]];var d=Math.abs(v);if(d<r){i=y((o=I(u,d))[0]);var w=o[1];return t.sign&&(w=-w),"number"==typeof i?(t.sign!==n.sign&&(i=-i),[new l(i),new l(w)]):[new s(i,t.sign!==n.sign),new l(w)]}v=h(d)}var b=P(u,v);if(-1===b)return[a[0],t];if(0===b)return[a[t.sign===n.sign?1:-1],a[0]];i=(o=u.length+v.length<=200?function(t,e){var o,n,i,u,p,a,s,l=t.length,f=e.length,v=r,h=g(e.length),c=e[f-1],m=Math.ceil(v/(2*c)),d=N(t,m),w=N(e,m);for(d.length<=l&&d.push(0),w.push(0),c=w[f-1],n=l-f;n>=0;n--){for(o=v-1,d[n+f]!==c&&(o=Math.floor((d[n+f]*v+d[n+f-1])/c)),i=0,u=0,a=w.length,p=0;p<a;p++)i+=o*w[p],s=Math.floor(i/v),u+=d[n+p]-(i-s*v),i=s,u<0?(d[n+p]=u+v,u=-1):(d[n+p]=u,u=0);for(;0!==u;){for(o-=1,i=0,p=0;p<a;p++)(i+=d[n+p]-v+w[p])<0?(d[n+p]=i+v,i=0):(d[n+p]=i,i=1);u+=i}h[n]=o}return d=I(d,m)[0],[y(h),y(d)]}(u,v):function(t,e){for(var o,n,i,u,p,a=t.length,s=e.length,l=[],f=[],v=r;a;)if(f.unshift(t[--a]),c(f),P(f,e)<0)l.push(0);else{i=f[(n=f.length)-1]*v+f[n-2],u=e[s-1]*v+e[s-2],n>s&&(i=(i+1)*v),o=Math.ceil(i/u);do{if(P(p=N(e,o),f)<=0)break;o--}while(o);l.push(o),f=S(f,p)}return l.reverse(),[y(l),y(f)]}(u,v))[0];var q=t.sign!==n.sign,M=o[1],E=t.sign;return"number"==typeof i?(q&&(i=-i),i=new l(i)):i=new s(i,q),"number"==typeof M?(E&&(M=-M),M=new l(M)):M=new s(M,E),[i,M]}function P(t,e){if(t.length!==e.length)return t.length>e.length?1:-1;for(var r=t.length-1;r>=0;r--)if(t[r]!==e[r])return t[r]>e[r]?1:-1;return 0}function Z(t){var e=t.abs();return!e.isUnit()&&(!!(e.equals(2)||e.equals(3)||e.equals(5))||!(e.isEven()||e.isDivisibleBy(3)||e.isDivisibleBy(5))&&(!!e.lesser(49)||void 0))}function x(e,r){for(var o,n,i,u=e.prev(),p=u,a=0;p.isEven();)p=p.divide(2),a++;t:for(n=0;n<r.length;n++)if(!e.lesser(r[n])&&!(i=t(r[n]).modPow(p,e)).isUnit()&&!i.equals(u)){for(o=a-1;0!=o;o--){if((i=i.square().mod(e)).isUnit())return!1;if(i.equals(u))continue t}return!1}return!0}s.prototype=Object.create(a.prototype),l.prototype=Object.create(a.prototype),f.prototype=Object.create(a.prototype),s.prototype.add=function(t){var e=Q(t);if(this.sign!==e.sign)return this.subtract(e.negate());var r=this.value,o=e.value;return e.isSmall?new s(b(r,Math.abs(o)),this.sign):new s(w(r,o),this.sign)},s.prototype.plus=s.prototype.add,l.prototype.add=function(t){var e=Q(t),r=this.value;if(r<0!==e.sign)return this.subtract(e.negate());var o=e.value;if(e.isSmall){if(v(r+o))return new l(r+o);o=h(Math.abs(o))}return new s(b(o,Math.abs(r)),r<0)},l.prototype.plus=l.prototype.add,f.prototype.add=function(t){return new f(this.value+Q(t).value)},f.prototype.plus=f.prototype.add,s.prototype.subtract=function(t){var e=Q(t);if(this.sign!==e.sign)return this.add(e.negate());var r=this.value,o=e.value;return e.isSmall?q(r,Math.abs(o),this.sign):function(t,e,r){var o;return P(t,e)>=0?o=S(t,e):(o=S(e,t),r=!r),"number"==typeof(o=y(o))?(r&&(o=-o),new l(o)):new s(o,r)}(r,o,this.sign)},s.prototype.minus=s.prototype.subtract,l.prototype.subtract=function(t){var e=Q(t),r=this.value;if(r<0!==e.sign)return this.add(e.negate());var o=e.value;return e.isSmall?new l(r-o):q(o,Math.abs(r),r>=0)},l.prototype.minus=l.prototype.subtract,f.prototype.subtract=function(t){return new f(this.value-Q(t).value)},f.prototype.minus=f.prototype.subtract,s.prototype.negate=function(){return new s(this.value,!this.sign)},l.prototype.negate=function(){var t=this.sign,e=new l(-this.value);return e.sign=!t,e},f.prototype.negate=function(){return new f(-this.value)},s.prototype.abs=function(){return new s(this.value,!1)},l.prototype.abs=function(){return new l(Math.abs(this.value))},f.prototype.abs=function(){return new f(this.value>=0?this.value:-this.value)},s.prototype.multiply=function(t){var e,o,n,i=Q(t),u=this.value,p=i.value,l=this.sign!==i.sign;if(i.isSmall){if(0===p)return a[0];if(1===p)return this;if(-1===p)return this.negate();if((e=Math.abs(p))<r)return new s(N(u,e),l);p=h(e)}return o=u.length,n=p.length,new s(-.012*o-.012*n+15e-6*o*n>0?function t(e,r){var o=Math.max(e.length,r.length);if(o<=30)return M(e,r);o=Math.ceil(o/2);var n=e.slice(o),i=e.slice(0,o),u=r.slice(o),p=r.slice(0,o),a=t(i,p),s=t(n,u),l=t(w(i,n),w(p,u)),f=w(w(a,E(S(S(l,a),s),o)),E(s,2*o));return c(f),f}(u,p):M(u,p),l)},s.prototype.times=s.prototype.multiply,l.prototype._multiplyBySmall=function(t){return v(t.value*this.value)?new l(t.value*this.value):O(Math.abs(t.value),h(Math.abs(this.value)),this.sign!==t.sign)},s.prototype._multiplyBySmall=function(t){return 0===t.value?a[0]:1===t.value?this:-1===t.value?this.negate():O(Math.abs(t.value),this.value,this.sign!==t.sign)},l.prototype.multiply=function(t){return Q(t)._multiplyBySmall(this)},l.prototype.times=l.prototype.multiply,f.prototype.multiply=function(t){return new f(this.value*Q(t).value)},f.prototype.times=f.prototype.multiply,s.prototype.square=function(){return new s(B(this.value),!1)},l.prototype.square=function(){var t=this.value*this.value;return v(t)?new l(t):new s(B(h(Math.abs(this.value))),!1)},f.prototype.square=function(t){return new f(this.value*this.value)},s.prototype.divmod=function(t){var e=A(this,t);return{quotient:e[0],remainder:e[1]}},f.prototype.divmod=l.prototype.divmod=s.prototype.divmod,s.prototype.divide=function(t){return A(this,t)[0]},f.prototype.over=f.prototype.divide=function(t){return new f(this.value/Q(t).value)},l.prototype.over=l.prototype.divide=s.prototype.over=s.prototype.divide,s.prototype.mod=function(t){return A(this,t)[1]},f.prototype.mod=f.prototype.remainder=function(t){return new f(this.value%Q(t).value)},l.prototype.remainder=l.prototype.mod=s.prototype.remainder=s.prototype.mod,s.prototype.pow=function(t){var e,r,o,n=Q(t),i=this.value,u=n.value;if(0===u)return a[1];if(0===i)return a[0];if(1===i)return a[1];if(-1===i)return n.isEven()?a[1]:a[-1];if(n.sign)return a[0];if(!n.isSmall)throw new Error("The exponent "+n.toString()+" is too large.");if(this.isSmall&&v(e=Math.pow(i,u)))return new l(m(e));for(r=this,o=a[1];!0&u&&(o=o.times(r),--u),0!==u;)u/=2,r=r.square();return o},l.prototype.pow=s.prototype.pow,f.prototype.pow=function(t){var e=Q(t),r=this.value,o=e.value,n=BigInt(0),i=BigInt(1),u=BigInt(2);if(o===n)return a[1];if(r===n)return a[0];if(r===i)return a[1];if(r===BigInt(-1))return e.isEven()?a[1]:a[-1];if(e.isNegative())return new f(n);for(var p=this,s=a[1];(o&i)===i&&(s=s.times(p),--o),o!==n;)o/=u,p=p.square();return s},s.prototype.modPow=function(t,e){if(t=Q(t),(e=Q(e)).isZero())throw new Error("Cannot take modPow with modulus 0");for(var r=a[1],o=this.mod(e);t.isPositive();){if(o.isZero())return a[0];t.isOdd()&&(r=r.multiply(o).mod(e)),t=t.divide(2),o=o.square().mod(e)}return r},f.prototype.modPow=l.prototype.modPow=s.prototype.modPow,s.prototype.compareAbs=function(t){var e=Q(t),r=this.value,o=e.value;return e.isSmall?1:P(r,o)},l.prototype.compareAbs=function(t){var e=Q(t),r=Math.abs(this.value),o=e.value;return e.isSmall?r===(o=Math.abs(o))?0:r>o?1:-1:-1},f.prototype.compareAbs=function(t){var e=this.value,r=Q(t).value;return(e=e>=0?e:-e)===(r=r>=0?r:-r)?0:e>r?1:-1},s.prototype.compare=function(t){if(t===1/0)return-1;if(t===-1/0)return 1;var e=Q(t),r=this.value,o=e.value;return this.sign!==e.sign?e.sign?1:-1:e.isSmall?this.sign?-1:1:P(r,o)*(this.sign?-1:1)},s.prototype.compareTo=s.prototype.compare,l.prototype.compare=function(t){if(t===1/0)return-1;if(t===-1/0)return 1;var e=Q(t),r=this.value,o=e.value;return e.isSmall?r==o?0:r>o?1:-1:r<0!==e.sign?r<0?-1:1:r<0?1:-1},l.prototype.compareTo=l.prototype.compare,f.prototype.compare=function(t){if(t===1/0)return-1;if(t===-1/0)return 1;var e=this.value,r=Q(t).value;return e===r?0:e>r?1:-1},f.prototype.compareTo=f.prototype.compare,s.prototype.equals=function(t){return 0===this.compare(t)},f.prototype.eq=f.prototype.equals=l.prototype.eq=l.prototype.equals=s.prototype.eq=s.prototype.equals,s.prototype.notEquals=function(t){return 0!==this.compare(t)},f.prototype.neq=f.prototype.notEquals=l.prototype.neq=l.prototype.notEquals=s.prototype.neq=s.prototype.notEquals,s.prototype.greater=function(t){return this.compare(t)>0},f.prototype.gt=f.prototype.greater=l.prototype.gt=l.prototype.greater=s.prototype.gt=s.prototype.greater,s.prototype.lesser=function(t){return this.compare(t)<0},f.prototype.lt=f.prototype.lesser=l.prototype.lt=l.prototype.lesser=s.prototype.lt=s.prototype.lesser,s.prototype.greaterOrEquals=function(t){return this.compare(t)>=0},f.prototype.geq=f.prototype.greaterOrEquals=l.prototype.geq=l.prototype.greaterOrEquals=s.prototype.geq=s.prototype.greaterOrEquals,s.prototype.lesserOrEquals=function(t){return this.compare(t)<=0},f.prototype.leq=f.prototype.lesserOrEquals=l.prototype.leq=l.prototype.lesserOrEquals=s.prototype.leq=s.prototype.lesserOrEquals,s.prototype.isEven=function(){return 0==(1&this.value[0])},l.prototype.isEven=function(){return 0==(1&this.value)},f.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},s.prototype.isOdd=function(){return 1==(1&this.value[0])},l.prototype.isOdd=function(){return 1==(1&this.value)},f.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},s.prototype.isPositive=function(){return!this.sign},l.prototype.isPositive=function(){return this.value>0},f.prototype.isPositive=l.prototype.isPositive,s.prototype.isNegative=function(){return this.sign},l.prototype.isNegative=function(){return this.value<0},f.prototype.isNegative=l.prototype.isNegative,s.prototype.isUnit=function(){return!1},l.prototype.isUnit=function(){return 1===Math.abs(this.value)},f.prototype.isUnit=function(){return this.abs().value===BigInt(1)},s.prototype.isZero=function(){return!1},l.prototype.isZero=function(){return 0===this.value},f.prototype.isZero=function(){return this.value===BigInt(0)},s.prototype.isDivisibleBy=function(t){var e=Q(t);return!e.isZero()&&(!!e.isUnit()||(0===e.compareAbs(2)?this.isEven():this.mod(e).isZero()))},f.prototype.isDivisibleBy=l.prototype.isDivisibleBy=s.prototype.isDivisibleBy,s.prototype.isPrime=function(e){var r=Z(this);if(void 0!==r)return r;var o=this.abs(),n=o.bitLength();if(n<=64)return x(o,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var i=Math.log(2)*n.toJSNumber(),u=Math.ceil(!0===e?2*Math.pow(i,2):i),p=[],a=0;a<u;a++)p.push(t(a+2));return x(o,p)},f.prototype.isPrime=l.prototype.isPrime=s.prototype.isPrime,s.prototype.isProbablePrime=function(e){var r=Z(this);if(void 0!==r)return r;for(var o=this.abs(),n=void 0===e?5:e,i=[],u=0;u<n;u++)i.push(t.randBetween(2,o.minus(2)));return x(o,i)},f.prototype.isProbablePrime=l.prototype.isProbablePrime=s.prototype.isProbablePrime,s.prototype.modInv=function(e){for(var r,o,n,i=t.zero,u=t.one,p=Q(e),a=this.abs();!a.isZero();)r=p.divide(a),o=i,n=p,i=u,p=a,u=o.subtract(r.multiply(u)),a=n.subtract(r.multiply(a));if(!p.isUnit())throw new Error(this.toString()+" and "+e.toString()+" are not co-prime");return-1===i.compare(0)&&(i=i.add(e)),this.isNegative()?i.negate():i},f.prototype.modInv=l.prototype.modInv=s.prototype.modInv,s.prototype.next=function(){var t=this.value;return this.sign?q(t,1,this.sign):new s(b(t,1),this.sign)},l.prototype.next=function(){var t=this.value;return t+1<n?new l(t+1):new s(i,!1)},f.prototype.next=function(){return new f(this.value+BigInt(1))},s.prototype.prev=function(){var t=this.value;return this.sign?new s(b(t,1),!0):q(t,1,this.sign)},l.prototype.prev=function(){var t=this.value;return t-1>-n?new l(t-1):new s(i,!0)},f.prototype.prev=function(){return new f(this.value-BigInt(1))};for(var J=[1];2*J[J.length-1]<=r;)J.push(2*J[J.length-1]);var L=J.length,U=J[L-1];function T(t){return Math.abs(t)<=r}function j(e,r,o){r=Q(r);for(var n=e.isNegative(),i=r.isNegative(),u=n?e.not():e,p=i?r.not():r,a=0,s=0,l=null,f=null,v=[];!u.isZero()||!p.isZero();)a=(l=A(u,U))[1].toJSNumber(),n&&(a=U-1-a),s=(f=A(p,U))[1].toJSNumber(),i&&(s=U-1-s),u=l[0],p=f[0],v.push(o(a,s));for(var h=0!==o(n?1:0,i?1:0)?t(-1):t(0),y=v.length-1;y>=0;y-=1)h=h.multiply(U).add(t(v[y]));return h}s.prototype.shiftLeft=function(t){var e=Q(t).toJSNumber();if(!T(e))throw new Error(String(e)+" is too large for shifting.");if(e<0)return this.shiftRight(-e);var r=this;if(r.isZero())return r;for(;e>=L;)r=r.multiply(U),e-=L-1;return r.multiply(J[e])},f.prototype.shiftLeft=l.prototype.shiftLeft=s.prototype.shiftLeft,s.prototype.shiftRight=function(t){var e,r=Q(t).toJSNumber();if(!T(r))throw new Error(String(r)+" is too large for shifting.");if(r<0)return this.shiftLeft(-r);for(var o=this;r>=L;){if(o.isZero()||o.isNegative()&&o.isUnit())return o;o=(e=A(o,U))[1].isNegative()?e[0].prev():e[0],r-=L-1}return(e=A(o,J[r]))[1].isNegative()?e[0].prev():e[0]},f.prototype.shiftRight=l.prototype.shiftRight=s.prototype.shiftRight,s.prototype.not=function(){return this.negate().prev()},f.prototype.not=l.prototype.not=s.prototype.not,s.prototype.and=function(t){return j(this,t,function(t,e){return t&e})},f.prototype.and=l.prototype.and=s.prototype.and,s.prototype.or=function(t){return j(this,t,function(t,e){return t|e})},f.prototype.or=l.prototype.or=s.prototype.or,s.prototype.xor=function(t){return j(this,t,function(t,e){return t^e})},f.prototype.xor=l.prototype.xor=s.prototype.xor;var C=1<<30,D=(r&-r)*(r&-r)|C;function z(t){var e=t.value,o="number"==typeof e?e|C:"bigint"==typeof e?e|BigInt(C):e[0]+e[1]*r|D;return o&-o}function R(t,e){return t=Q(t),e=Q(e),t.greater(e)?t:e}function k(t,e){return t=Q(t),e=Q(e),t.lesser(e)?t:e}function _(t,e){if(t=Q(t).abs(),e=Q(e).abs(),t.equals(e))return t;if(t.isZero())return e;if(e.isZero())return t;for(var r,o,n=a[1];t.isEven()&&e.isEven();)r=k(z(t),z(e)),t=t.divide(r),e=e.divide(r),n=n.multiply(r);for(;t.isEven();)t=t.divide(z(t));do{for(;e.isEven();)e=e.divide(z(e));t.greater(e)&&(o=e,e=t,t=o),e=e.subtract(t)}while(!e.isZero());return n.isUnit()?t:t.multiply(n)}s.prototype.bitLength=function(){var e=this;return e.compareTo(t(0))<0&&(e=e.negate().subtract(t(1))),0===e.compareTo(t(0))?t(0):t(function e(r,o){if(o.compareTo(r)<=0){var n=e(r,o.square(o)),i=n.p,u=n.e,p=i.multiply(o);return p.compareTo(r)<=0?{p:p,e:2*u+1}:{p:i,e:2*u}}return{p:t(1),e:0}}(e,t(2)).e).add(t(1))},f.prototype.bitLength=l.prototype.bitLength=s.prototype.bitLength;var $=function(t,e,r,o){r=r||u,t=String(t),o||(t=t.toLowerCase(),r=r.toLowerCase());var n,i=t.length,p=Math.abs(e),a={};for(n=0;n<r.length;n++)a[r[n]]=n;for(n=0;n<i;n++){if("-"!==(f=t[n])&&(f in a&&a[f]>=p)){if("1"===f&&1===p)continue;throw new Error(f+" is not a valid digit in base "+e+".")}}e=Q(e);var s=[],l="-"===t[0];for(n=l?1:0;n<t.length;n++){var f;if((f=t[n])in a)s.push(Q(a[f]));else{if("<"!==f)throw new Error(f+" is not a valid character");var v=n;do{n++}while(">"!==t[n]&&n<t.length);s.push(Q(t.slice(v+1,n)))}}return F(s,e,l)};function F(t,e,r){var o,n=a[0],i=a[1];for(o=t.length-1;o>=0;o--)n=n.add(t[o].times(i)),i=i.times(e);return r?n.negate():n}function G(e,r){if((r=t(r)).isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(r.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var o=Array.apply(null,Array(e.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return o.unshift([1]),{value:[].concat.apply([],o),isNegative:!1}}var n=!1;if(e.isNegative()&&r.isPositive()&&(n=!0,e=e.abs()),r.isUnit())return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(e.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:n};for(var i,u=[],p=e;p.isNegative()||p.compareAbs(r)>=0;){i=p.divmod(r),p=i.quotient;var a=i.remainder;a.isNegative()&&(a=r.minus(a).abs(),p=p.next()),u.push(a.toJSNumber())}return u.push(p.toJSNumber()),{value:u.reverse(),isNegative:n}}function H(t,e,r){var o=G(t,e);return(o.isNegative?"-":"")+o.value.map(function(t){return function(t,e){return t<(e=e||u).length?e[t]:"<"+t+">"}(t,r)}).join("")}function K(t){if(v(+t)){var e=+t;if(e===m(e))return p?new f(BigInt(e)):new l(e);throw new Error("Invalid integer: "+t)}var r="-"===t[0];r&&(t=t.slice(1));var n=t.split(/e/i);if(n.length>2)throw new Error("Invalid integer: "+n.join("e"));if(2===n.length){var i=n[1];if("+"===i[0]&&(i=i.slice(1)),(i=+i)!==m(i)||!v(i))throw new Error("Invalid integer: "+i+" is not a valid exponent.");var u=n[0],a=u.indexOf(".");if(a>=0&&(i-=u.length-a-1,u=u.slice(0,a)+u.slice(a+1)),i<0)throw new Error("Cannot include negative exponent part for integers");t=u+=new Array(i+1).join("0")}if(!/^([0-9][0-9]*)$/.test(t))throw new Error("Invalid integer: "+t);if(p)return new f(BigInt(r?"-"+t:t));for(var h=[],y=t.length,g=o,d=y-g;y>0;)h.push(+t.slice(d,y)),(d-=g)<0&&(d=0),y-=g;return c(h),new s(h,r)}function Q(t){return"number"==typeof t?function(t){if(p)return new f(BigInt(t));if(v(t)){if(t!==m(t))throw new Error(t+" is not an integer.");return new l(t)}return K(t.toString())}(t):"string"==typeof t?K(t):"bigint"==typeof t?new f(t):t}s.prototype.toArray=function(t){return G(this,t)},l.prototype.toArray=function(t){return G(this,t)},f.prototype.toArray=function(t){return G(this,t)},s.prototype.toString=function(t,e){if(void 0===t&&(t=10),10!==t)return H(this,t,e);for(var r,o=this.value,n=o.length,i=String(o[--n]);--n>=0;)r=String(o[n]),i+="0000000".slice(r.length)+r;return(this.sign?"-":"")+i},l.prototype.toString=function(t,e){return void 0===t&&(t=10),10!=t?H(this,t,e):String(this.value)},f.prototype.toString=l.prototype.toString,f.prototype.toJSON=s.prototype.toJSON=l.prototype.toJSON=function(){return this.toString()},s.prototype.valueOf=function(){return parseInt(this.toString(),10)},s.prototype.toJSNumber=s.prototype.valueOf,l.prototype.valueOf=function(){return this.value},l.prototype.toJSNumber=l.prototype.valueOf,f.prototype.valueOf=f.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};for(var V=0;V<1e3;V++)a[V]=Q(V),V>0&&(a[-V]=Q(-V));return a.one=a[1],a.zero=a[0],a.minusOne=a[-1],a.max=R,a.min=k,a.gcd=_,a.lcm=function(t,e){return t=Q(t).abs(),e=Q(e).abs(),t.divide(_(t,e)).multiply(e)},a.isInstance=function(t){return t instanceof s||t instanceof l||t instanceof f},a.randBetween=function(t,e){var o=k(t=Q(t),e=Q(e)),n=R(t,e).subtract(o).add(1);if(n.isSmall)return o.add(Math.floor(Math.random()*n));for(var i=G(n,r).value,u=[],p=!0,s=0;s<i.length;s++){var l=p?i[s]:r,f=m(Math.random()*l);u.push(f),f<l&&(p=!1)}return o.add(a.fromArray(u,r,!1))},a.fromArray=function(t,e,r){return F(t.map(Q),Q(e||10),r)},a}();"undefined"!=typeof module&&module.hasOwnProperty("exports")&&(module.exports=t),"function"==typeof define&&define.amd&&define("big-integer",[],function(){return t});
},{}],"Focm":[function(require,module,exports) {
var n={};!function(e){"use strict";(n["Control.Apply"]=n["Control.Apply"]||{}).arrayApply=function(n){return function(e){for(var a=n.length,t=e.length,u=new Array(a*t),r=0,o=0;o<a;o++)for(var i=n[o],l=0;l<t;l++)u[r++]=i(e[l]);return u}}}(),function(n){"use strict";var e=function(n){this.compose=n},a=new e(function(n){return function(e){return function(a){return n(e(a))}}});n.compose=function(n){return n.compose},n.Semigroupoid=e,n.semigroupoidFn=a}(n["Control.Semigroupoid"]=n["Control.Semigroupoid"]||{}),function(e){"use strict";var a=n["Control.Semigroupoid"],t=function(n,e){this.Semigroupoid0=n,this.identity=e},u=new t(function(){return a.semigroupoidFn},function(n){return n});e.Category=t,e.identity=function(n){return n.identity},e.categoryFn=u}(n["Control.Category"]=n["Control.Category"]||{}),function(e){"use strict";(n["Data.Boolean"]=n["Data.Boolean"]||{}).otherwise=!0}(),function(e){"use strict";(n["Data.Eq"]=n["Data.Eq"]||{}).refEq=function(n){return function(e){return n===e}}}(),function(e){"use strict";(n["Data.Unit"]=n["Data.Unit"]||{}).unit={}}(),function(e){"use strict";n["Data.Show"],n["Data.Symbol"],n["Record.Unsafe"],n["Type.Data.RowList"];e.Show=function(n){this.show=n},e.show=function(n){return n.show}}(n["Data.Show"]=n["Data.Show"]||{}),function(e){"use strict";var a=n["Data.Unit"];n["Data.Show"];e.unit=a.unit}(n["Data.Unit"]=n["Data.Unit"]||{}),function(e){"use strict";var a=n["Data.Eq"],t=(n["Data.HeytingAlgebra"],n["Data.Symbol"],n["Data.Unit"],n["Data.Void"],n["Record.Unsafe"],n["Type.Data.RowList"],function(n){this.eq=n}),u=new t(a.refEq);e.Eq=t,e.eq=function(n){return n.eq},e.eqInt=u}(n["Data.Eq"]=n["Data.Eq"]||{}),function(e){"use strict";(n["Data.Ord.Unsafe"]=n["Data.Ord.Unsafe"]||{}).unsafeCompareImpl=function(n){return function(e){return function(a){return function(t){return function(u){return t<u?n:t===u?e:a}}}}}}(),function(e){"use strict";n["Data.Semigroup"],n["Data.Symbol"],n["Data.Unit"],n["Data.Void"],n["Record.Unsafe"],n["Type.Data.RowList"];e.Semigroup=function(n){this.append=n},e.append=function(n){return n.append}}(n["Data.Semigroup"]=n["Data.Semigroup"]||{}),function(e){"use strict";n["Data.Eq"],n["Data.Semigroup"],n["Data.Show"];var a=function(){function n(){}return n.value=new n,n}(),t=function(){function n(){}return n.value=new n,n}(),u=function(){function n(){}return n.value=new n,n}();e.LT=a,e.GT=t,e.EQ=u}(n["Data.Ordering"]=n["Data.Ordering"]||{}),function(e){"use strict";var a=n["Data.Ord.Unsafe"],t=n["Data.Ordering"],u=a.unsafeCompareImpl(t.LT.value)(t.EQ.value)(t.GT.value);e.unsafeCompare=u}(n["Data.Ord.Unsafe"]=n["Data.Ord.Unsafe"]||{}),function(e){"use strict";n["Data.Semiring"],n["Data.Symbol"],n["Data.Unit"],n["Record.Unsafe"],n["Type.Data.Row"],n["Type.Data.RowList"];e.Semiring=function(n,e,a,t){this.add=n,this.mul=e,this.one=a,this.zero=t},e.add=function(n){return n.add},e.zero=function(n){return n.zero},e.mul=function(n){return n.mul},e.one=function(n){return n.one}}(n["Data.Semiring"]=n["Data.Semiring"]||{}),function(e){"use strict";n["Data.Ord"];var a=n["Data.Eq"],t=n["Data.Ord.Unsafe"],u=n["Data.Ordering"],r=(n["Data.Ring"],n["Data.Semiring"],n["Data.Symbol"],n["Data.Unit"],n["Data.Void"],n["Record.Unsafe"],n["Type.Data.RowList"],function(n,e){this.Eq0=n,this.compare=e}),o=new r(function(){return a.eqInt},t.unsafeCompare),i=function(n){return n.compare};e.Ord=r,e.compare=i,e.min=function(n){return function(e){return function(a){var t=i(n)(e)(a);if(t instanceof u.LT)return e;if(t instanceof u.EQ)return e;if(t instanceof u.GT)return a;throw new Error("Failed pattern match at Data.Ord (line 119, column 3 - line 122, column 12): "+[t.constructor.name])}}},e.ordInt=o}(n["Data.Ord"]=n["Data.Ord"]||{}),function(e){"use strict";n["Control.Category"],n["Data.Boolean"],n["Data.Ord"],n["Data.Ring"];e.flip=function(n){return function(e){return function(a){return n(a)(e)}}},e.const=function(n){return function(e){return n}}}(n["Data.Function"]=n["Data.Function"]||{}),function(e){"use strict";(n["Data.Functor"]=n["Data.Functor"]||{}).arrayMap=function(n){return function(e){for(var a=e.length,t=new Array(a),u=0;u<a;u++)t[u]=n(e[u]);return t}}}(),function(e){"use strict";var a=n["Data.Functor"],t=(n["Control.Semigroupoid"],n["Data.Function"]),u=n["Data.Unit"],r=function(n){this.map=n},o=function(n){return n.map},i=new r(a.arrayMap);e.Functor=r,e.map=o,e.void=function(n){return o(n)(t.const(u.unit))},e.functorArray=i}(n["Data.Functor"]=n["Data.Functor"]||{}),function(e){"use strict";var a=n["Control.Apply"],t=(n["Control.Category"],n["Data.Function"],n["Data.Functor"]),u=function(n,e){this.Functor0=n,this.apply=e},r=new u(function(){return t.functorArray},a.arrayApply);e.Apply=u,e.apply=function(n){return n.apply},e.applyArray=r}(n["Control.Apply"]=n["Control.Apply"]||{}),function(e){"use strict";n["Control.Apply"],n["Data.Functor"],n["Data.Unit"];e.Applicative=function(n,e){this.Apply0=n,this.pure=e},e.pure=function(n){return n.pure}}(n["Control.Applicative"]=n["Control.Applicative"]||{}),function(e){"use strict";(n["Control.Bind"]=n["Control.Bind"]||{}).arrayBind=function(n){return function(e){for(var a=[],t=0,u=n.length;t<u;t++)Array.prototype.push.apply(a,e(n[t]));return a}}}(),function(e){"use strict";var a=n["Control.Bind"],t=(n["Control.Applicative"],n["Control.Apply"]),u=(n["Control.Category"],n["Data.Function"]),r=(n["Data.Functor"],n["Data.Unit"],function(n,e){this.Apply0=n,this.bind=e}),o=function(n){this.discard=n},i=new r(function(){return t.applyArray},a.arrayBind),l=function(n){return n.bind},c=new o(function(n){return l(n)});e.Bind=r,e.bind=l,e.bindFlipped=function(n){return u.flip(l(n))},e.Discard=o,e.discard=function(n){return n.discard},e.bindArray=i,e.discardUnit=c}(n["Control.Bind"]=n["Control.Bind"]||{}),function(e){"use strict";var a=n["Control.Applicative"],t=(n["Control.Apply"],n["Control.Bind"]);n["Data.Functor"],n["Data.Unit"];e.Monad=function(n,e){this.Applicative0=n,this.Bind1=e},e.ap=function(n){return function(e){return function(u){return t.bind(n.Bind1())(e)(function(e){return t.bind(n.Bind1())(u)(function(t){return a.pure(n.Applicative0())(e(t))})})}}}}(n["Control.Monad"]=n["Control.Monad"]||{}),function(e){"use strict";n["Data.Boolean"],n["Data.Eq"],n["Data.EuclideanRing"],n["Data.Ord"],n["Data.Ordering"],n["Data.Semigroup"],n["Data.Symbol"],n["Data.Unit"],n["Record.Unsafe"],n["Type.Data.RowList"];e.mempty=function(n){return n.mempty}}(n["Data.Monoid"]=n["Data.Monoid"]||{}),function(e){"use strict";n["Control.Alt"],n["Control.Alternative"];var a=n["Control.Applicative"],t=n["Control.Apply"],u=n["Control.Bind"],r=(n["Control.Category"],n["Control.Extend"],n["Control.Monad"],n["Control.MonadZero"],n["Control.Plus"],n["Data.Bounded"],n["Data.Eq"],n["Data.Function"]),o=n["Data.Functor"],i=(n["Data.Functor.Invariant"],n["Data.Monoid"],n["Data.Ord"],n["Data.Ordering"],n["Data.Semigroup"],n["Data.Show"],n["Data.Unit"],n.Prelude,function(){function n(){}return n.value=new n,n}()),l=function(){function n(n){this.value0=n}return n.create=function(e){return new n(e)},n}(),c=function(n){return function(e){return function(a){if(a instanceof i)return n;if(a instanceof l)return e(a.value0);throw new Error("Failed pattern match at Data.Maybe (line 217, column 1 - line 217, column 51): "+[n.constructor.name,e.constructor.name,a.constructor.name])}}},v=c(!1)(r.const(!0)),f=new o.Functor(function(n){return function(e){return e instanceof l?new l(n(e.value0)):i.value}}),s=new t.Apply(function(){return f},function(n){return function(e){if(n instanceof l)return o.map(f)(n.value0)(e);if(n instanceof i)return i.value;throw new Error("Failed pattern match at Data.Maybe (line 67, column 1 - line 67, column 35): "+[n.constructor.name,e.constructor.name])}}),d=new u.Bind(function(){return s},function(n){return function(e){if(n instanceof l)return e(n.value0);if(n instanceof i)return i.value;throw new Error("Failed pattern match at Data.Maybe (line 125, column 1 - line 125, column 33): "+[n.constructor.name,e.constructor.name])}}),p=new a.Applicative(function(){return s},l.create);e.Nothing=i,e.Just=l,e.maybe=c,e.isJust=v,e.fromJust=function(n){return function(n){if(n instanceof l)return n.value0;throw new Error("Failed pattern match at Data.Maybe (line 268, column 1 - line 268, column 46): "+[n.constructor.name])}},e.functorMaybe=f,e.applyMaybe=s,e.applicativeMaybe=p,e.bindMaybe=d}(n["Data.Maybe"]=n["Data.Maybe"]||{}),function(e){"use strict";n["Data.Foldable"],n["Control.Alt"],n["Control.Applicative"],n["Control.Apply"],n["Control.Bind"],n["Control.Category"],n["Control.Plus"],n["Control.Semigroupoid"],n["Data.Eq"],n["Data.Function"],n["Data.Functor"],n["Data.HeytingAlgebra"],n["Data.Maybe"],n["Data.Maybe.First"],n["Data.Maybe.Last"],n["Data.Monoid"],n["Data.Monoid.Additive"],n["Data.Monoid.Conj"],n["Data.Monoid.Disj"],n["Data.Monoid.Dual"],n["Data.Monoid.Endo"],n["Data.Monoid.Multiplicative"],n["Data.Newtype"],n["Data.Ord"],n["Data.Ordering"],n["Data.Semigroup"],n["Data.Semiring"],n["Data.Unit"],n.Prelude;e.Foldable=function(n,e,a){this.foldMap=n,this.foldl=e,this.foldr=a},e.foldr=function(n){return n.foldr},e.foldl=function(n){return n.foldl},e.foldMap=function(n){return n.foldMap}}(n["Data.Foldable"]=n["Data.Foldable"]||{}),function(e){"use strict";n["Control.Alt"];var a=n["Control.Applicative"],t=n["Control.Apply"],u=n["Control.Bind"],r=(n["Control.Extend"],n["Control.Monad"],n["Control.Semigroupoid"],n["Data.Bifoldable"],n["Data.Bifunctor"],n["Data.Bitraversable"],n["Data.Bounded"],n["Data.Eq"],n["Data.Foldable"],n["Data.FoldableWithIndex"],n["Data.Function"],n["Data.Functor"]),o=(n["Data.Functor.Invariant"],n["Data.FunctorWithIndex"],n["Data.Maybe"],n["Data.Monoid"],n["Data.Ord"],n["Data.Ordering"],n["Data.Semigroup"],n["Data.Show"],n["Data.Traversable"],n["Data.TraversableWithIndex"],n["Data.Unit"],n.Prelude,function(){function n(n){this.value0=n}return n.create=function(e){return new n(e)},n}()),i=function(){function n(n){this.value0=n}return n.create=function(e){return new n(e)},n}(),l=new r.Functor(function(n){return function(e){if(e instanceof o)return new o(e.value0);if(e instanceof i)return new i(n(e.value0));throw new Error("Failed pattern match at Data.Either (line 38, column 8 - line 38, column 52): "+[e.constructor.name])}}),c=function(n){return function(e){return function(a){if(a instanceof o)return n(a.value0);if(a instanceof i)return e(a.value0);throw new Error("Failed pattern match at Data.Either (line 238, column 1 - line 238, column 64): "+[n.constructor.name,e.constructor.name,a.constructor.name])}}},v=new t.Apply(function(){return l},function(n){return function(e){if(n instanceof o)return new o(n.value0);if(n instanceof i)return r.map(l)(n.value0)(e);throw new Error("Failed pattern match at Data.Either (line 82, column 1 - line 82, column 41): "+[n.constructor.name,e.constructor.name])}}),f=new u.Bind(function(){return v},c(function(n){return function(e){return new o(n)}})(function(n){return function(e){return e(n)}})),s=new a.Applicative(function(){return v},i.create);e.Left=o,e.Right=i,e.either=c,e.functorEither=l,e.applyEither=v,e.applicativeEither=s,e.bindEither=f}(n["Data.Either"]=n["Data.Either"]||{}),function(e){"use strict";(n["Partial.Unsafe"]=n["Partial.Unsafe"]||{}).unsafePartial=function(n){return n()}}(),function(e){"use strict";(n["Partial"]=n["Partial"]||{}).crashWith=function(){return function(n){throw new Error(n)}}}(),function(e){"use strict";var a=n.Partial;e.crashWith=a.crashWith}(n.Partial=n.Partial||{}),function(e){"use strict";var a=n["Partial.Unsafe"],t=n.Partial;e.unsafeCrashWith=function(n){return a.unsafePartial(function(e){return t.crashWith(e)(n)})}}(n["Partial.Unsafe"]=n["Partial.Unsafe"]||{}),function(e){"use strict";n["Control.Applicative"],n["Control.Bind"],n["Control.Monad"],n["Control.Semigroupoid"],n["Data.Bifunctor"],n["Data.Either"],n["Data.Functor"],n["Data.Identity"],n["Data.Maybe"],n["Data.Unit"],n.Effect,n["Effect.Ref"],n["Partial.Unsafe"],n.Prelude;var a=function(){function n(n){this.value0=n}return n.create=function(e){return new n(e)},n}(),t=function(){function n(n){this.value0=n}return n.create=function(e){return new n(e)},n}();e.Loop=a,e.Done=t,e.MonadRec=function(n,e){this.Monad0=n,this.tailRecM=e},e.tailRecM=function(n){return n.tailRecM}}(n["Control.Monad.Rec.Class"]=n["Control.Monad.Rec.Class"]||{}),function(n){"use strict";n.map_=function(n){return function(e){return function(){return n(e())}}},n.pure_=function(n){return function(){return n}},n.bind_=function(n){return function(e){return function(){return e(n())()}}},n.while=function(n){return function(e){return function(){for(;n();)e()}}},n.new=function(n){return function(){return{value:n}}},n.read=function(n){return function(){return n.value}},n.write=function(n){return function(e){return function(){return e.value=n}}}}(n["Control.Monad.ST.Internal"]=n["Control.Monad.ST.Internal"]||{}),function(e){"use strict";var a=n["Control.Monad.ST.Internal"],t=n["Control.Applicative"],u=n["Control.Apply"],r=n["Control.Bind"],o=n["Control.Monad"],i=n["Control.Monad.Rec.Class"],l=n["Data.Functor"],c=n["Data.Unit"],v=(n["Partial.Unsafe"],n.Prelude,new l.Functor(a.map_)),f=new o.Monad(function(){return p},function(){return s}),s=new r.Bind(function(){return d},a.bind_),d=new u.Apply(function(){return v},o.ap(f)),p=new t.Applicative(function(){return d},a.pure_),D=new i.MonadRec(function(){return f},function(n){return function(e){var u=function(n){return n instanceof i.Loop},o=function(n){if(n instanceof i.Done)return n.value0;throw new Error("Failed pattern match at Control.Monad.ST.Internal (line 54, column 32 - line 54, column 46): "+[n.constructor.name])};return r.bind(s)(r.bindFlipped(s)(a.new)(n(e)))(function(e){return r.discard(r.discardUnit)(s)(a.while(l.map(v)(u)(a.read(e)))(r.bind(s)(a.read(e))(function(u){if(u instanceof i.Loop)return r.bind(s)(n(u.value0))(function(n){return l.void(v)(a.write(n)(e))});if(u instanceof i.Done)return t.pure(p)(c.unit);throw new Error("Failed pattern match at Control.Monad.ST.Internal (line 46, column 18 - line 50, column 28): "+[u.constructor.name])})))(function(){return l.map(v)(o)(a.read(e))})})}});e.functorST=v,e.applyST=d,e.applicativeST=p,e.bindST=s,e.monadST=f,e.monadRecST=D,e.read=a.read,e.write=a.write}(n["Control.Monad.ST.Internal"]=n["Control.Monad.ST.Internal"]||{}),function(n){"use strict";n.length=function(n){return n.length},n.indexImpl=function(n){return function(e){return function(a){return function(t){return t<0||t>=a.length?e:n(a[t])}}}},n.sortImpl=function(n){return function(e){return e.slice().sort(function(e,a){return n(e)(a)})}},n.slice=function(n){return function(e){return function(a){return a.slice(n,e)}}}}(n["Data.Array"]=n["Data.Array"]||{}),function(n){"use strict";n.empty=function(){return[]},n.pushAll=function(n){return function(e){return function(){return e.push.apply(e,n)}}}}(n["Data.Array.ST"]=n["Data.Array.ST"]||{}),function(e){"use strict";(n["Unsafe.Coerce"]=n["Unsafe.Coerce"]||{}).unsafeCoerce=function(n){return n}}(),function(e){"use strict";var a=n["Unsafe.Coerce"];e.unsafeCoerce=a.unsafeCoerce}(n["Unsafe.Coerce"]=n["Unsafe.Coerce"]||{}),function(e){"use strict";var a=n["Data.Array.ST"],t=n["Control.Applicative"],u=(n["Control.Bind"],n["Control.Monad.ST"],n["Control.Monad.ST.Internal"]);n["Control.Semigroupoid"],n["Data.Maybe"],n["Data.Ord"],n["Data.Ordering"],n["Data.Ring"],n.Prelude,n["Unsafe.Coerce"];e.push=function(n){return a.pushAll([n])},e.unsafeFreeze=function(n){return t.pure(u.applicativeST)(n)},e.empty=a.empty}(n["Data.Array.ST"]=n["Data.Array.ST"]||{}),function(e){"use strict";n["Control.Applicative"],n["Control.Apply"],n["Control.Biapplicative"],n["Control.Biapply"],n["Control.Bind"],n["Control.Comonad"],n["Control.Extend"],n["Control.Lazy"],n["Control.Monad"],n["Control.Semigroupoid"],n["Data.Bifoldable"],n["Data.Bifunctor"],n["Data.Bitraversable"],n["Data.BooleanAlgebra"],n["Data.Bounded"],n["Data.CommutativeRing"],n["Data.Distributive"],n["Data.Eq"],n["Data.Foldable"],n["Data.FoldableWithIndex"],n["Data.Function"],n["Data.Functor"],n["Data.Functor.Invariant"],n["Data.FunctorWithIndex"],n["Data.HeytingAlgebra"],n["Data.Maybe"],n["Data.Maybe.First"],n["Data.Monoid"],n["Data.Newtype"],n["Data.Ord"],n["Data.Ordering"],n["Data.Ring"],n["Data.Semigroup"],n["Data.Semigroup.Foldable"],n["Data.Semigroup.Traversable"],n["Data.Semiring"],n["Data.Show"],n["Data.Traversable"],n["Data.TraversableWithIndex"],n["Data.Unit"],n.Prelude,n["Type.Equality"];var a=function(){function n(n,e){this.value0=n,this.value1=e}return n.create=function(e){return function(a){return new n(e,a)}},n}();e.Tuple=a,e.snd=function(n){return n.value1}}(n["Data.Tuple"]=n["Data.Tuple"]||{}),function(e){"use strict";var a=n["Data.Array"],t=(n["Control.Alt"],n["Control.Alternative"],n["Control.Applicative"],n["Control.Apply"],n["Control.Bind"]),u=(n["Control.Category"],n["Control.Lazy"],n["Control.Monad.Rec.Class"],n["Control.Monad.ST"],n["Control.Monad.ST.Internal"],n["Control.Semigroupoid"],n["Data.Array.NonEmpty.Internal"],n["Data.Array.ST"],n["Data.Array.ST.Iterator"],n["Data.Boolean"],n["Data.Eq"],n["Data.Foldable"],n["Data.Function"]),r=(n["Data.Functor"],n["Data.HeytingAlgebra"],n["Data.Maybe"]),o=(n["Data.Ord"],n["Data.Ordering"]),i=(n["Data.Ring"],n["Data.Semigroup"],n["Data.Semiring"],n["Data.Traversable"],n["Data.Tuple"],n["Data.Unfoldable"],n["Partial.Unsafe"],n.Prelude,n["Unsafe.Coerce"],function(n){return[n]}),l=a.indexImpl(r.Just.create)(r.Nothing.value),c=u.flip(t.bind(t.bindArray));e.singleton=i,e.index=l,e.concatMap=c,e.mapMaybe=function(n){return c(function(e){return r.maybe([])(i)(n(e))})},e.sortBy=function(n){return function(e){return a.sortImpl(function(e){return function(a){var t=n(e)(a);if(t instanceof o.GT)return 1;if(t instanceof o.EQ)return 0;if(t instanceof o.LT)return-1;throw new Error("Failed pattern match at Data.Array (line 702, column 15 - line 707, column 1): "+[t.constructor.name])}})(e)}}}(n["Data.Array"]=n["Data.Array"]||{}),function(n){var e=require("big-integer");n["fromBase'"]=function(n){return function(a){return function(t){return function(u){try{var r=e(u,t);return n(r)}catch(o){return a}}}}},n.fromInt=function(n){return e(n)},n.toBase=function(n){return function(e){return e.toString(n)}},n.biAdd=function(n){return function(e){return n.add(e)}},n.biMul=function(n){return function(e){return n.multiply(e)}},n.biEquals=function(n){return function(e){return n.equals(e)}},n.biCompare=function(n){return function(e){return n.compare(e)}}}(n["Data.BigInt"]=n["Data.BigInt"]||{}),function(e){"use strict";(n["Data.Int"]=n["Data.Int"]||{}).fromStringAsImpl=function(n){return function(e){return function(a){var t;t=a<11?"[0-"+(a-1).toString()+"]":11===a?"[0-9a]":"[0-9a-"+String.fromCharCode(86+a)+"]";var u=new RegExp("^[\\+\\-]?"+t+"+$","i");return function(t){if(u.test(t)){var r=parseInt(t,a);return(0|r)===r?n(r):e}return e}}}}}(),function(e){"use strict";var a=n["Data.Int"],t=(n["Control.Category"],n["Control.Semigroupoid"],n["Data.Boolean"],n["Data.Bounded"],n["Data.CommutativeRing"],n["Data.DivisionRing"],n["Data.Eq"],n["Data.EuclideanRing"],n["Data.HeytingAlgebra"],n["Data.Int.Bits"],n["Data.Maybe"]),u=(n["Data.Ord"],n["Data.Ordering"],n["Data.Ring"],n["Data.Semiring"],n["Data.Show"],n.Global,n.Math,n.Prelude,a.fromStringAsImpl(t.Just.create)(t.Nothing.value)),r=u(10);e.fromString=r,e.fromStringAs=u}(n["Data.Int"]=n["Data.Int"]||{}),function(e){"use strict";var a=n["Data.BigInt"],t=(n["Control.Semigroupoid"],n["Data.Array.NonEmpty"],n["Data.CommutativeRing"],n["Data.Eq"]),u=(n["Data.EuclideanRing"],n["Data.Function"],n["Data.Int"],n["Data.Maybe"]),r=n["Data.Ord"],o=n["Data.Ordering"],i=(n["Data.Ring"],n["Data.Semigroup"],n["Data.Semiring"]),l=(n["Data.Show"],n["Data.String.NonEmpty"],n["Data.String.NonEmpty.Internal"],n["Partial.Unsafe"],n.Prelude,a.toBase(10)),c=new i.Semiring(a.biAdd,a.biMul,a.fromInt(1),a.fromInt(0)),v=a["fromBase'"](u.Just.create)(u.Nothing.value),f=v(10),s=new t.Eq(a.biEquals),d=new r.Ord(function(){return s},function(n){return function(e){var t=a.biCompare(n)(e);return 1===t?o.GT.value:0===t?o.EQ.value:o.LT.value}});e.fromString=f,e.fromBase=v,e.toString=l,e.eqBigInt=s,e.ordBigInt=d,e.semiringBigInt=c}(n["Data.BigInt"]=n["Data.BigInt"]||{}),function(e){"use strict";n["Control.Alt"],n["Control.Alternative"];var a=n["Control.Applicative"],t=n["Control.Apply"],u=(n["Control.Bind"],n["Control.Category"],n["Control.Comonad"],n["Control.Extend"],n["Control.Monad"],n["Control.MonadPlus"],n["Control.MonadZero"],n["Control.Plus"],n["Control.Semigroupoid"],n["Data.Eq"],n["Data.Foldable"]),r=(n["Data.FoldableWithIndex"],n["Data.Function"]),o=n["Data.Functor"],i=(n["Data.FunctorWithIndex"],n["Data.HeytingAlgebra"],n["Data.Maybe"],n["Data.Monoid"]),l=(n["Data.Newtype"],n["Data.NonEmpty"],n["Data.Ord"],n["Data.Ordering"],n["Data.Ring"],n["Data.Semigroup"]),c=(n["Data.Semigroup.Foldable"],n["Data.Semigroup.Traversable"],n["Data.Semiring"],n["Data.Show"],n["Data.Traversable"],n["Data.TraversableWithIndex"],n["Data.Tuple"],n["Data.Unfoldable"],n["Data.Unfoldable1"],n.Prelude,function(){function n(){}return n.value=new n,n}()),v=function(){function n(n,e){this.value0=n,this.value1=e}return n.create=function(e){return function(a){return new n(e,a)}},n}(),f=new u.Foldable(function(n){return function(e){return u.foldl(f)(function(a){return function(t){return l.append(n.Semigroup0())(a)(e(t))}})(i.mempty(n))}},function(n){return function(e){return function(a){var t,u=e,r=!1;function o(e,t){if(t instanceof c)return r=!0,e;if(t instanceof v)return u=n(e)(t.value0),void(a=t.value1);throw new Error("Failed pattern match at Data.List.Types (line 81, column 12 - line 83, column 30): "+[t.constructor.name])}for(;!r;)t=o(u,a);return t}}},function(n){return function(e){var a=u.foldl(f)(r.flip(v.create))(c.value);return function(t){return u.foldl(f)(r.flip(n))(e)(a(t))}}}),s=new o.Functor(function(n){return u.foldr(f)(function(e){return function(a){return new v(n(e),a)}})(c.value)}),d=new l.Semigroup(function(n){return function(e){return u.foldr(f)(v.create)(e)(n)}}),p=new t.Apply(function(){return s},function(n){return function(e){if(n instanceof c)return c.value;if(n instanceof v)return l.append(d)(o.map(s)(n.value0)(e))(t.apply(p)(n.value1)(e));throw new Error("Failed pattern match at Data.List.Types (line 127, column 1 - line 127, column 33): "+[n.constructor.name,e.constructor.name])}}),D=new a.Applicative(function(){return p},function(n){return new v(n,c.value)});e.Nil=c,e.Cons=v,e.semigroupList=d,e.functorList=s,e.foldableList=f,e.applyList=p,e.applicativeList=D}(n["Data.List.Types"]=n["Data.List.Types"]||{}),function(e){"use strict";var a,t=n["Control.Applicative"],u=(n["Control.Apply"],n["Control.Category"],n["Control.Semigroupoid"],n["Data.Eq"],n["Data.Foldable"],n["Data.FoldableWithIndex"],n["Data.Function"],n["Data.Functor"],n["Data.FunctorWithIndex"],n["Data.HeytingAlgebra"],n["Data.List"],n["Data.List.Lazy"],n["Data.List.Lazy.Types"],n["Data.List.Types"]),r=n["Data.Maybe"],o=(n["Data.Monoid"],n["Data.Ord"]),i=n["Data.Ordering"],l=n["Data.Semigroup"],c=(n["Data.Semiring"],n["Data.Show"],n["Data.Traversable"],n["Data.TraversableWithIndex"],n["Data.Tuple"]),v=(n["Data.Unfoldable"],n["Partial.Unsafe"],n.Prelude,function(){function n(){}return n.value=new n,n}()),f=function(){function n(n,e,a,t){this.value0=n,this.value1=e,this.value2=a,this.value3=t}return n.create=function(e){return function(a){return function(t){return function(u){return new n(e,a,t,u)}}}},n}(),s=function(){function n(n,e,a,t,u,r,o){this.value0=n,this.value1=e,this.value2=a,this.value3=t,this.value4=u,this.value5=r,this.value6=o}return n.create=function(e){return function(a){return function(t){return function(u){return function(r){return function(o){return function(i){return new n(e,a,t,u,r,o,i)}}}}}}},n}(),d=function(){function n(n,e,a){this.value0=n,this.value1=e,this.value2=a}return n.create=function(e){return function(a){return function(t){return new n(e,a,t)}}},n}(),p=function(){function n(n,e,a){this.value0=n,this.value1=e,this.value2=a}return n.create=function(e){return function(a){return function(t){return new n(e,a,t)}}},n}(),D=function(){function n(n,e,a,t,u,r){this.value0=n,this.value1=e,this.value2=a,this.value3=t,this.value4=u,this.value5=r}return n.create=function(e){return function(a){return function(t){return function(u){return function(r){return function(o){return new n(e,a,t,u,r,o)}}}}}},n}(),m=function(){function n(n,e,a,t,u,r){this.value0=n,this.value1=e,this.value2=a,this.value3=t,this.value4=u,this.value5=r}return n.create=function(e){return function(a){return function(t){return function(u){return function(r){return function(o){return new n(e,a,t,u,r,o)}}}}}},n}(),w=function(){function n(n,e,a,t,u,r){this.value0=n,this.value1=e,this.value2=a,this.value3=t,this.value4=u,this.value5=r}return n.create=function(e){return function(a){return function(t){return function(u){return function(r){return function(o){return new n(e,a,t,u,r,o)}}}}}},n}(),h=function(){function n(n,e,a,t){this.value0=n,this.value1=e,this.value2=a,this.value3=t}return n.create=function(e){return function(a){return function(t){return function(u){return new n(e,a,t,u)}}}},n}(),C=function(n){return function(e){var a=o.compare(n);return function(n){var t,u=!1;function o(t){if(t instanceof v)return u=!0,r.Nothing.value;if(t instanceof f){var o=a(e)(t.value1);return o instanceof i.EQ?(u=!0,new r.Just(t.value2)):o instanceof i.LT?void(n=t.value0):void(n=t.value3)}if(t instanceof s){var l=a(e)(t.value1);if(l instanceof i.EQ)return u=!0,new r.Just(t.value2);var c=a(e)(t.value4);return c instanceof i.EQ?(u=!0,new r.Just(t.value5)):l instanceof i.LT?void(n=t.value0):c instanceof i.GT?void(n=t.value6):void(n=t.value3)}throw new Error("Failed pattern match at Data.Map.Internal (line 200, column 5 - line 200, column 22): "+[t.constructor.name])}for(;!u;)t=o(n);return t}}},y=function(n){if(n instanceof v)return u.Nil.value;if(n instanceof f)return l.append(u.semigroupList)(y(n.value0))(l.append(u.semigroupList)(t.pure(u.applicativeList)(n.value1))(y(n.value3)));if(n instanceof s)return l.append(u.semigroupList)(y(n.value0))(l.append(u.semigroupList)(t.pure(u.applicativeList)(n.value1))(l.append(u.semigroupList)(y(n.value3))(l.append(u.semigroupList)(t.pure(u.applicativeList)(n.value4))(y(n.value6)))));throw new Error("Failed pattern match at Data.Map.Internal (line 606, column 1 - line 606, column 38): "+[n.constructor.name])},g=function(n){return function(e){return function(a){var t,r=n,o=e,i=!1;function l(n,e,t){if(e instanceof u.Nil)return i=!0,t;if(e instanceof u.Cons){if(e.value0 instanceof d)return r=n,o=e.value1,void(a=new f(t,e.value0.value0,e.value0.value1,e.value0.value2));if(e.value0 instanceof p)return r=n,o=e.value1,void(a=new f(e.value0.value0,e.value0.value1,e.value0.value2,t));if(e.value0 instanceof D)return r=n,o=e.value1,void(a=new s(t,e.value0.value0,e.value0.value1,e.value0.value2,e.value0.value3,e.value0.value4,e.value0.value5));if(e.value0 instanceof m)return r=n,o=e.value1,void(a=new s(e.value0.value0,e.value0.value1,e.value0.value2,t,e.value0.value3,e.value0.value4,e.value0.value5));if(e.value0 instanceof w)return r=n,o=e.value1,void(a=new s(e.value0.value0,e.value0.value1,e.value0.value2,e.value0.value3,e.value0.value4,e.value0.value5,t));throw new Error("Failed pattern match at Data.Map.Internal (line 418, column 3 - line 423, column 88): "+[e.value0.constructor.name])}throw new Error("Failed pattern match at Data.Map.Internal (line 415, column 1 - line 415, column 80): "+[e.constructor.name,t.constructor.name])}for(;!i;)t=l(r,o,a);return t}}},S=function(n){return function(e){var a,t=function(e){return function(a){var t,r=e,o=!1;function i(e,t){if(e instanceof u.Nil)return o=!0,t;if(e instanceof u.Cons){if(e.value0 instanceof d&&e.value0.value2 instanceof v&&t instanceof v)return o=!0,g(n)(e.value1)(new f(v.value,e.value0.value0,e.value0.value1,v.value));if(e.value0 instanceof p&&e.value0.value0 instanceof v&&t instanceof v)return o=!0,g(n)(e.value1)(new f(v.value,e.value0.value1,e.value0.value2,v.value));if(e.value0 instanceof d&&e.value0.value2 instanceof f)return r=e.value1,void(a=new s(t,e.value0.value0,e.value0.value1,e.value0.value2.value0,e.value0.value2.value1,e.value0.value2.value2,e.value0.value2.value3));if(e.value0 instanceof p&&e.value0.value0 instanceof f)return r=e.value1,void(a=new s(e.value0.value0.value0,e.value0.value0.value1,e.value0.value0.value2,e.value0.value0.value3,e.value0.value1,e.value0.value2,t));if(e.value0 instanceof d&&e.value0.value2 instanceof s)return o=!0,g(n)(e.value1)(new f(new f(t,e.value0.value0,e.value0.value1,e.value0.value2.value0),e.value0.value2.value1,e.value0.value2.value2,new f(e.value0.value2.value3,e.value0.value2.value4,e.value0.value2.value5,e.value0.value2.value6)));if(e.value0 instanceof p&&e.value0.value0 instanceof s)return o=!0,g(n)(e.value1)(new f(new f(e.value0.value0.value0,e.value0.value0.value1,e.value0.value0.value2,e.value0.value0.value3),e.value0.value0.value4,e.value0.value0.value5,new f(e.value0.value0.value6,e.value0.value1,e.value0.value2,t)));if(e.value0 instanceof D&&e.value0.value2 instanceof v&&e.value0.value5 instanceof v&&t instanceof v)return o=!0,g(n)(e.value1)(new s(v.value,e.value0.value0,e.value0.value1,v.value,e.value0.value3,e.value0.value4,v.value));if(e.value0 instanceof m&&e.value0.value0 instanceof v&&e.value0.value5 instanceof v&&t instanceof v)return o=!0,g(n)(e.value1)(new s(v.value,e.value0.value1,e.value0.value2,v.value,e.value0.value3,e.value0.value4,v.value));if(e.value0 instanceof w&&e.value0.value0 instanceof v&&e.value0.value3 instanceof v&&t instanceof v)return o=!0,g(n)(e.value1)(new s(v.value,e.value0.value1,e.value0.value2,v.value,e.value0.value4,e.value0.value5,v.value));if(e.value0 instanceof D&&e.value0.value2 instanceof f)return o=!0,g(n)(e.value1)(new f(new s(t,e.value0.value0,e.value0.value1,e.value0.value2.value0,e.value0.value2.value1,e.value0.value2.value2,e.value0.value2.value3),e.value0.value3,e.value0.value4,e.value0.value5));if(e.value0 instanceof m&&e.value0.value0 instanceof f)return o=!0,g(n)(e.value1)(new f(new s(e.value0.value0.value0,e.value0.value0.value1,e.value0.value0.value2,e.value0.value0.value3,e.value0.value1,e.value0.value2,t),e.value0.value3,e.value0.value4,e.value0.value5));if(e.value0 instanceof m&&e.value0.value5 instanceof f)return o=!0,g(n)(e.value1)(new f(e.value0.value0,e.value0.value1,e.value0.value2,new s(t,e.value0.value3,e.value0.value4,e.value0.value5.value0,e.value0.value5.value1,e.value0.value5.value2,e.value0.value5.value3)));if(e.value0 instanceof w&&e.value0.value3 instanceof f)return o=!0,g(n)(e.value1)(new f(e.value0.value0,e.value0.value1,e.value0.value2,new s(e.value0.value3.value0,e.value0.value3.value1,e.value0.value3.value2,e.value0.value3.value3,e.value0.value4,e.value0.value5,t)));if(e.value0 instanceof D&&e.value0.value2 instanceof s)return o=!0,g(n)(e.value1)(new s(new f(t,e.value0.value0,e.value0.value1,e.value0.value2.value0),e.value0.value2.value1,e.value0.value2.value2,new f(e.value0.value2.value3,e.value0.value2.value4,e.value0.value2.value5,e.value0.value2.value6),e.value0.value3,e.value0.value4,e.value0.value5));if(e.value0 instanceof m&&e.value0.value0 instanceof s)return o=!0,g(n)(e.value1)(new s(new f(e.value0.value0.value0,e.value0.value0.value1,e.value0.value0.value2,e.value0.value0.value3),e.value0.value0.value4,e.value0.value0.value5,new f(e.value0.value0.value6,e.value0.value1,e.value0.value2,t),e.value0.value3,e.value0.value4,e.value0.value5));if(e.value0 instanceof m&&e.value0.value5 instanceof s)return o=!0,g(n)(e.value1)(new s(e.value0.value0,e.value0.value1,e.value0.value2,new f(t,e.value0.value3,e.value0.value4,e.value0.value5.value0),e.value0.value5.value1,e.value0.value5.value2,new f(e.value0.value5.value3,e.value0.value5.value4,e.value0.value5.value5,e.value0.value5.value6)));if(e.value0 instanceof w&&e.value0.value3 instanceof s)return o=!0,g(n)(e.value1)(new s(e.value0.value0,e.value0.value1,e.value0.value2,new f(e.value0.value3.value0,e.value0.value3.value1,e.value0.value3.value2,e.value0.value3.value3),e.value0.value3.value4,e.value0.value3.value5,new f(e.value0.value3.value6,e.value0.value4,e.value0.value5,t)));throw new Error("Failed pattern match at Data.Map.Internal (line 511, column 9 - line 528, column 136): "+[e.value0.constructor.name,t.constructor.name])}throw new Error("Failed pattern match at Data.Map.Internal (line 508, column 5 - line 528, column 136): "+[e.constructor.name])}for(;!o;)t=i(r,a);return t}},l=function(n){return function(e){var a,r=n,o=!1;function i(n,a){if(a instanceof f&&a.value0 instanceof v&&a.value3 instanceof v)return o=!0,t(n)(v.value);if(a instanceof f)return r=new u.Cons(new p(a.value0,a.value1,a.value2),n),void(e=a.value3);if(a instanceof s&&a.value0 instanceof v&&a.value3 instanceof v&&a.value6 instanceof v)return o=!0,t(new u.Cons(new p(v.value,a.value1,a.value2),n))(v.value);if(a instanceof s)return r=new u.Cons(new w(a.value0,a.value1,a.value2,a.value3,a.value4,a.value5),n),void(e=a.value6);throw new Error("Failed pattern match at Data.Map.Internal (line 540, column 5 - line 544, column 107): "+[a.constructor.name])}for(;!o;)a=i(r,e);return a}},h=function(n){var e,a=!1;function t(e){if(e instanceof f&&e.value3 instanceof v)return a=!0,{key:e.value1,value:e.value2};if(e instanceof f)n=e.value3;else{if(e instanceof s&&e.value6 instanceof v)return a=!0,{key:e.value4,value:e.value5};if(!(e instanceof s))throw new Error("Failed pattern match at Data.Map.Internal (line 531, column 33 - line 535, column 45): "+[e.constructor.name]);n=e.value6}}for(;!a;)e=t(n);return e},C=o.compare(n);return a=u.Nil.value,function(o){var y,S=a,b=!1;function E(a,y){if(y instanceof v)return b=!0,r.Nothing.value;if(y instanceof f){var E=C(e)(y.value1);if(y.value3 instanceof v&&E instanceof i.EQ)return b=!0,new r.Just(new c.Tuple(y.value2,t(a)(v.value)));if(E instanceof i.EQ){var F=h(y.value0);return b=!0,new r.Just(new c.Tuple(y.value2,l(new u.Cons(new d(F.key,F.value,y.value3),a))(y.value0)))}return E instanceof i.LT?(S=new u.Cons(new d(y.value1,y.value2,y.value3),a),void(o=y.value0)):(S=new u.Cons(new p(y.value0,y.value1,y.value2),a),void(o=y.value3))}if(y instanceof s){var M=y.value0 instanceof v&&y.value3 instanceof v&&y.value6 instanceof v,A=(E=C(e)(y.value4),C(e)(y.value1));return M&&A instanceof i.EQ?(b=!0,new r.Just(new c.Tuple(y.value2,g(n)(a)(new f(v.value,y.value4,y.value5,v.value))))):M&&E instanceof i.EQ?(b=!0,new r.Just(new c.Tuple(y.value5,g(n)(a)(new f(v.value,y.value1,y.value2,v.value))))):A instanceof i.EQ?(F=h(y.value0),b=!0,new r.Just(new c.Tuple(y.value2,l(new u.Cons(new D(F.key,F.value,y.value3,y.value4,y.value5,y.value6),a))(y.value0)))):E instanceof i.EQ?(F=h(y.value3),b=!0,new r.Just(new c.Tuple(y.value5,l(new u.Cons(new m(y.value0,y.value1,y.value2,F.key,F.value,y.value6),a))(y.value3)))):A instanceof i.LT?(S=new u.Cons(new D(y.value1,y.value2,y.value3,y.value4,y.value5,y.value6),a),void(o=y.value0)):A instanceof i.GT&&E instanceof i.LT?(S=new u.Cons(new m(y.value0,y.value1,y.value2,y.value4,y.value5,y.value6),a),void(o=y.value3)):(S=new u.Cons(new w(y.value0,y.value1,y.value2,y.value3,y.value4,y.value5),a),void(o=y.value6))}throw new Error("Failed pattern match at Data.Map.Internal (line 481, column 34 - line 504, column 80): "+[y.constructor.name])}for(;!b;)y=E(S,o);return y}}},b=(a=r.Nothing.value,function(n){var e,t=a,u=!1;function o(e,a){if(a instanceof v)return u=!0,e;if(a instanceof f)return t=new r.Just({key:a.value1,value:a.value2}),void(n=a.value3);if(a instanceof s)return t=new r.Just({key:a.value4,value:a.value5}),void(n=a.value6);throw new Error("Failed pattern match at Data.Map.Internal (line 289, column 5 - line 289, column 22): "+[e.constructor.name,a.constructor.name])}for(;!u;)e=o(t,n);return e}),E=v.value;e.empty=E,e.insert=function(n){return function(e){return function(a){var t,r=function(e){return function(a){var t,r=e,o=!1;function i(e,t){if(e instanceof u.Nil)return o=!0,new f(t.value0,t.value1,t.value2,t.value3);if(e instanceof u.Cons){if(e.value0 instanceof d)return o=!0,g(n)(e.value1)(new s(t.value0,t.value1,t.value2,t.value3,e.value0.value0,e.value0.value1,e.value0.value2));if(e.value0 instanceof p)return o=!0,g(n)(e.value1)(new s(e.value0.value0,e.value0.value1,e.value0.value2,t.value0,t.value1,t.value2,t.value3));if(e.value0 instanceof D)return r=e.value1,void(a=new h(new f(t.value0,t.value1,t.value2,t.value3),e.value0.value0,e.value0.value1,new f(e.value0.value2,e.value0.value3,e.value0.value4,e.value0.value5)));if(e.value0 instanceof m)return r=e.value1,void(a=new h(new f(e.value0.value0,e.value0.value1,e.value0.value2,t.value0),t.value1,t.value2,new f(t.value3,e.value0.value3,e.value0.value4,e.value0.value5)));if(e.value0 instanceof w)return r=e.value1,void(a=new h(new f(e.value0.value0,e.value0.value1,e.value0.value2,e.value0.value3),e.value0.value4,e.value0.value5,new f(t.value0,t.value1,t.value2,t.value3)));throw new Error("Failed pattern match at Data.Map.Internal (line 454, column 5 - line 459, column 108): "+[e.value0.constructor.name,t.constructor.name])}throw new Error("Failed pattern match at Data.Map.Internal (line 451, column 3 - line 451, column 56): "+[e.constructor.name,t.constructor.name])}for(;!o;)t=i(r,a);return t}},l=o.compare(n);return t=u.Nil.value,function(o){var c,C=t,y=!1;function S(t,c){if(c instanceof v)return y=!0,r(t)(new h(v.value,e,a,v.value));if(c instanceof f){var S=l(e)(c.value1);return S instanceof i.EQ?(y=!0,g(n)(t)(new f(c.value0,e,a,c.value3))):S instanceof i.LT?(C=new u.Cons(new d(c.value1,c.value2,c.value3),t),void(o=c.value0)):(C=new u.Cons(new p(c.value0,c.value1,c.value2),t),void(o=c.value3))}if(c instanceof s){var b=l(e)(c.value1);if(b instanceof i.EQ)return y=!0,g(n)(t)(new s(c.value0,e,a,c.value3,c.value4,c.value5,c.value6));var E=l(e)(c.value4);return E instanceof i.EQ?(y=!0,g(n)(t)(new s(c.value0,c.value1,c.value2,c.value3,e,a,c.value6))):b instanceof i.LT?(C=new u.Cons(new D(c.value1,c.value2,c.value3,c.value4,c.value5,c.value6),t),void(o=c.value0)):b instanceof i.GT&&E instanceof i.LT?(C=new u.Cons(new m(c.value0,c.value1,c.value2,c.value4,c.value5,c.value6),t),void(o=c.value3)):(C=new u.Cons(new w(c.value0,c.value1,c.value2,c.value3,c.value4,c.value5),t),void(o=c.value6))}throw new Error("Failed pattern match at Data.Map.Internal (line 434, column 3 - line 434, column 55): "+[t.constructor.name,c.constructor.name])}for(;!y;)c=S(C,o);return c}}}},e.lookup=C,e.findMax=b,e.delete=function(n){return function(e){return function(a){return r.maybe(a)(c.snd)(S(n)(e)(a))}}},e.pop=S,e.member=function(n){return function(e){return function(a){return r.isJust(C(n)(e)(a))}}},e.keys=y}(n["Data.Map.Internal"]=n["Data.Map.Internal"]||{}),function(e){"use strict";n["Control.Applicative"],n["Control.Bind"],n["Control.Monad.Rec.Class"],n["Control.Monad.ST"],n["Control.Monad.ST.Internal"],n["Control.Semigroupoid"],n["Data.Array"],n["Data.Array.ST"],n["Data.Eq"];var a=n["Data.Foldable"],t=(n["Data.Function"],n["Data.Functor"]),u=(n["Data.HeytingAlgebra"],n["Data.List"],n["Data.List.Types"]),r=n["Data.Map.Internal"],o=n["Data.Maybe"],i=(n["Data.Monoid"],n["Data.Ord"],n["Data.Ordering"],n["Data.Semigroup"],n["Data.Semiring"],n["Data.Show"],n["Data.Unfoldable"],n["Data.Unit"]),l=(n["Partial.Unsafe"],n.Prelude,function(n){return r.keys(n)}),c=function(n){return function(e){return function(a){return r.insert(n)(e)(i.unit)(a)}}},v=new a.Foldable(function(n){return function(e){return function(t){return a.foldMap(u.foldableList)(n)(e)(l(t))}}},function(n){return function(e){return function(t){return a.foldl(u.foldableList)(n)(e)(l(t))}}},function(n){return function(e){return function(t){return a.foldr(u.foldableList)(n)(e)(l(t))}}}),f=r.empty;e.empty=f,e.map=function(n){return function(e){return a.foldl(v)(function(a){return function(t){return c(n)(e(t))(a)}})(f)}},e.insert=c,e.member=function(n){return function(e){return function(a){return r.member(n)(e)(a)}}},e.delete=function(n){return function(e){return function(a){return r.delete(n)(e)(a)}}},e.findMax=function(n){return t.map(o.functorMaybe)(function(n){return n.key})(r.findMax(n))},e.foldableSet=v}(n["Data.Set"]=n["Data.Set"]||{}),function(n){"use strict";n.split=function(n){return function(e){return e.split(n)}},n.trim=function(n){return n.trim()},n.joinWith=function(n){return function(e){return e.join(n)}}}(n["Data.String.Common"]=n["Data.String.Common"]||{}),function(e){"use strict";var a=n["Data.String.Common"];n["Data.Eq"],n["Data.Ordering"],n["Data.String.Pattern"],n.Prelude;e.split=a.split,e.trim=a.trim,e.joinWith=a.joinWith}(n["Data.String.Common"]=n["Data.String.Common"]||{}),function(e){"use strict";var a=n["Control.Applicative"],t=n["Control.Bind"],u=n["Control.Category"],r=n["Control.Monad.Rec.Class"],o=(n["Control.Monad.ST"],n["Control.Monad.ST.Internal"]),i=(n["Control.Monad.ST.Ref"],n["Data.Array"]),l=n["Data.Array.ST"],c=n["Data.BigInt"],v=n["Data.Boolean"],f=n["Data.Either"],s=n["Data.Eq"],d=n["Data.Function"],p=(n["Data.HeytingAlgebra"],n["Data.Int"]),D=n["Data.Maybe"],m=n["Data.Ord"],w=n["Data.Ordering"],h=(n["Data.Ring"],n["Data.Semiring"]),C=n["Data.Set"],y=(n["Data.String"],n["Data.String.Common"]),g=(n["Data.String.Pattern"],n["Data.Tuple"]),S=n["Partial.Unsafe"],b=(n.Prelude,function(){function n(n,e,a,t){this.value0=n,this.value1=e,this.value2=a,this.value3=t}return n.create=function(e){return function(a){return function(t){return function(u){return new n(e,a,t,u)}}}},n}()),E=y.split(" "),F=new s.Eq(function(n){return function(e){return n.value0===e.value0&&n.value1===e.value1&&n.value2===e.value2&&s.eq(c.eqBigInt)(n.value3)(e.value3)}}),M=new m.Ord(function(){return F},function(n){return function(e){var a=m.compare(c.ordBigInt)(n.value3)(e.value3);if(a instanceof w.LT)return w.LT.value;if(a instanceof w.GT)return w.GT.value;if(a instanceof w.EQ){var t=m.compare(m.ordInt)(n.value0)(e.value0);if(t instanceof w.LT)return w.LT.value;if(t instanceof w.GT)return w.GT.value;if(t instanceof w.EQ){var u=m.compare(m.ordInt)(n.value1)(e.value1);if(u instanceof w.LT)return w.LT.value;if(u instanceof w.GT)return w.GT.value;if(u instanceof w.EQ)return m.compare(m.ordInt)(n.value2)(e.value2);throw new Error("Failed pattern match at AtCoder.ABC123.D (line 61, column 15 - line 64, column 31): "+[u.constructor.name])}throw new Error("Failed pattern match at AtCoder.ABC123.D (line 58, column 13 - line 64, column 31): "+[t.constructor.name])}throw new Error("Failed pattern match at AtCoder.ABC123.D (line 55, column 5 - line 64, column 31): "+[a.constructor.name])}});e.solve=function(n){return f.either(function(n){return S.unsafeCrashWith(n)})(u.identity(u.categoryFn))(t.bind(f.bindEither)(4===(s=y.split("\n")(y.trim(n))).length?t.bind(f.bindEither)(4===(e=i.mapMaybe(p.fromString)(E(s[0]))).length?a.pure(f.applicativeEither)({x:e[0],y:e[1],z:e[2],k:e[3]}):new f.Left("x y z k"))(function(n){var e=i.mapMaybe(c.fromString)(E(s[3])),t=i.mapMaybe(c.fromString)(E(s[2])),u=i.mapMaybe(c.fromString)(E(s[1]));return a.pure(f.applicativeEither)({x:n.x,y:n.y,z:n.z,k:n.k,as:u,bs:t,cs:e})}):new f.Left("lines"))(function(n){return a.pure(f.applicativeEither)(y.joinWith("\n")((e=n.x,function(n){return function(u){return function(f){return function(s){return function(p){return function(w){var y,S,E=function(n){return function(e){if(n instanceof D.Nothing)return e;if(n instanceof D.Just){if(C.member(M)(n.value0)(e.value0))return e;if(v.otherwise)return new g.Tuple(C.insert(M)(n.value0)(e.value0),C.insert(M)(n.value0)(e.value1))}throw new Error("Failed pattern match at AtCoder.ABC123.D (line 95, column 5 - line 95, column 42): "+[n.constructor.name,e.constructor.name])}},F=i.sortBy(d.flip(m.compare(c.ordBigInt)))(w),A=i.sortBy(d.flip(m.compare(c.ordBigInt)))(p),T=i.sortBy(d.flip(m.compare(c.ordBigInt)))(s),I=function(n){return function(e){return function(u){return t.bind(D.bindMaybe)(i.index(T)(n))(function(r){return t.bind(D.bindMaybe)(i.index(A)(e))(function(o){return t.bind(D.bindMaybe)(i.index(F)(u))(function(t){return a.pure(D.applicativeMaybe)(new b(n,e,u,h.add(c.semiringBigInt)(h.add(c.semiringBigInt)(r)(o))(t)))})})})}}},B=function(n){if(0===n.ki)return function(){var e=l.unsafeFreeze(n.sta)();return new r.Done(e)};if(v.otherwise)return function(){var e=o.read(n.qRef)(),a=D.fromJust()(C.findMax(e.value1)),t=new g.Tuple(e.value0,C.delete(M)(a)(e.value1)),u=E(I(a.value0+1|0)(a.value1)(a.value2))(t),i=E(I(a.value0)(a.value1+1|0)(a.value2))(u),v=E(I(a.value0)(a.value1)(a.value2+1|0))(i);return l.push(c.toString(a.value3))(n.sta)(),o.write(v)(n.qRef)(),new r.Loop({ki:n.ki-1|0,qRef:n.qRef,sta:n.sta})};throw new Error("Failed pattern match at AtCoder.ABC123.D (line 101, column 5 - line 101, column 60): "+[n.constructor.name])};return y=l.empty(),S={value:E(I(0)(0)(0))(new g.Tuple(C.empty,C.empty))},r.tailRecM(o.monadRecST)(B)({ki:m.min(m.ordInt)(f)((e*n|0)*u|0),qRef:S,sta:y})()}}}}}})(n.y)(n.z)(n.k)(n.as)(n.bs)(n.cs)));var e}));var e,s}}(n["AtCoder.ABC123.D"]=n["AtCoder.ABC123.D"]||{}),function(e){"use strict";(n["Effect.Console"]=n["Effect.Console"]||{}).log=function(n){return function(){return console.log(n),{}}}}(),function(e){"use strict";var a=n["Effect.Console"];n["Data.Show"],n["Data.Unit"],n.Effect;e.log=a.log}(n["Effect.Console"]=n["Effect.Console"]||{}),function(e){"use strict";n["Node.Encoding"];var a=n["Data.Show"],t=(n.Prelude,function(){function n(){}return n.value=new n,n}()),u=function(){function n(){}return n.value=new n,n}(),r=function(){function n(){}return n.value=new n,n}(),o=function(){function n(){}return n.value=new n,n}(),i=function(){function n(){}return n.value=new n,n}(),l=function(){function n(){}return n.value=new n,n}(),c=function(){function n(){}return n.value=new n,n}(),v=function(){function n(){}return n.value=new n,n}(),f=new a.Show(function(n){if(n instanceof t)return"ASCII";if(n instanceof u)return"UTF8";if(n instanceof r)return"UTF16LE";if(n instanceof o)return"UCS2";if(n instanceof i)return"Base64";if(n instanceof l)return"Latin1";if(n instanceof c)return"Binary";if(n instanceof v)return"Hex";throw new Error("Failed pattern match at Node.Encoding (line 19, column 1 - line 19, column 39): "+[n.constructor.name])});e.ASCII=t,e.UTF8=u,e.UTF16LE=r,e.UCS2=o,e.Base64=i,e.Latin1=l,e.Binary=c,e.Hex=v,e.showEncoding=f}(n["Node.Encoding"]=n["Node.Encoding"]||{}),function(e){"use strict";(n["Node.FS.Internal"]=n["Node.FS.Internal"]||{}).unsafeRequireFS=require("fs")}(),function(e){"use strict";var a=n["Node.FS.Internal"],t=(n.Effect,n.Prelude,n["Unsafe.Coerce"].unsafeCoerce);e.mkEffect=t,e.unsafeRequireFS=a.unsafeRequireFS}(n["Node.FS.Internal"]=n["Node.FS.Internal"]||{}),function(e){"use strict";n["Control.Bind"],n["Control.Semigroupoid"],n["Data.DateTime"],n["Data.DateTime.Instant"],n["Data.EuclideanRing"],n["Data.Function"],n["Data.Function.Uncurried"],n["Data.Functor"],n["Data.Int"],n["Data.Maybe"],n["Data.Nullable"];var a=n["Data.Show"],t=(n["Data.Time.Duration"],n.Effect,n["Node.Buffer"],n["Node.Encoding"]),u=(n["Node.FS"],n["Node.FS.Internal"]),r=(n["Node.FS.Perms"],n["Node.FS.Stats"],n["Node.Path"],n.Prelude,u.unsafeRequireFS);e.readTextFile=function(n){return function(e){return u.mkEffect(function(u){return r.readFileSync(e,{encoding:a.show(t.showEncoding)(n)})})}}}(n["Node.FS.Sync"]=n["Node.FS.Sync"]||{}),function(e){"use strict";var a=n["AtCoder.ABC123.D"],t=(n["Control.Applicative"],n["Control.Bind"],n.Effect,n["Effect.Console"]),u=n["Node.Encoding"],r=n["Node.FS.Sync"];n.Prelude;e.main=function(){var n=r.readTextFile(u.UTF8.value)("/dev/stdin")(),e=a.solve(n);return t.log(e)()}}(n.Main=n.Main||{}),n.Main.main();
},{"big-integer":"9xaU"}]},{},["Focm"], null)

Measured memory_bytes: 27132