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 t=n.length,a=e.length,u=new Array(t*a),r=0,o=0;o<t;o++)for(var i=n[o],l=0;l<a;l++)u[r++]=i(e[l]);return u}}}(),function(n){"use strict";var e=function(n){this.compose=n},t=new e(function(n){return function(e){return function(t){return n(e(t))}}});n.compose=function(n){return n.compose},n.Semigroupoid=e,n.semigroupoidFn=t}(n["Control.Semigroupoid"]=n["Control.Semigroupoid"]||{}),function(e){"use strict";var t=n["Control.Semigroupoid"],a=function(n,e){this.Semigroupoid0=n,this.identity=e},u=new a(function(){return t.semigroupoidFn},function(n){return n});e.Category=a,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.Symbol"];var t=function(){function n(){}return n.value=new n,n}();e.IsSymbol=function(n){this.reflectSymbol=n},e.reflectSymbol=function(n){return n.reflectSymbol},e.SProxy=t}(n["Data.Symbol"]=n["Data.Symbol"]||{}),function(e){"use strict";(n["Data.Unit"]=n["Data.Unit"]||{}).unit={}}(),function(e){"use strict";(n["Record.Unsafe"]=n["Record.Unsafe"]||{}).unsafeGet=function(n){return function(e){return e[n]}}}(),function(e){"use strict";var t=n["Record.Unsafe"];e.unsafeGet=t.unsafeGet}(n["Record.Unsafe"]=n["Record.Unsafe"]||{}),function(n){"use strict";var e=function(){function n(){}return n.value=new n,n}();n.RLProxy=e}(n["Type.Data.RowList"]=n["Type.Data.RowList"]||{}),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 t=n["Data.Unit"];n["Data.Show"];e.unit=t.unit}(n["Data.Unit"]=n["Data.Unit"]||{}),function(e){"use strict";var t=n["Data.Eq"],a=(n["Data.HeytingAlgebra"],n["Data.Symbol"]),u=(n["Data.Unit"],n["Data.Void"],n["Record.Unsafe"]),r=n["Type.Data.RowList"],o=function(n){this.eq=n},i=function(n){this.eqRecord=n},l=new i(function(n){return function(n){return function(n){return!0}}}),c=function(n){return n.eqRecord},v=new o(t.refEq),f=new o(t.refEq),s=function(n){return n.eq};e.Eq=o,e.eq=s,e.notEq=function(n){return function(e){return function(t){return s(f)(s(n)(e)(t))(!1)}}},e.EqRecord=i,e.eqRecord=c,e.eqBoolean=f,e.eqInt=v,e.eqRec=function(n){return function(n){return new o(c(n)(r.RLProxy.value))}},e.eqRowNil=l,e.eqRowCons=function(n){return function(e){return function(e){return function(t){return new i(function(o){return function(o){return function(i){var l=c(n)(r.RLProxy.value)(o)(i),v=a.reflectSymbol(e)(a.SProxy.value),f=u.unsafeGet(v);return s(t)(f(o))(f(i))&&l}}})}}}}}(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(t){return function(a){return function(u){return a<u?n:a===u?e:t}}}}}}(),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";var t=n["Data.Eq"],a=(n["Data.Semigroup"],n["Data.Show"],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=new t.Eq(function(n){return function(e){return n instanceof a&&e instanceof a||(n instanceof u&&e instanceof u||n instanceof r&&e instanceof r)}});e.LT=a,e.GT=u,e.EQ=r,e.eqOrdering=o}(n["Data.Ordering"]=n["Data.Ordering"]||{}),function(e){"use strict";var t=n["Data.Ord.Unsafe"],a=n["Data.Ordering"],u=t.unsafeCompareImpl(a.LT.value)(a.EQ.value)(a.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,t,a){this.add=n,this.mul=e,this.one=t,this.zero=a},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 t=n["Data.Eq"],a=n["Data.Ord.Unsafe"],u=n["Data.Ordering"],r=(n["Data.Ring"],n["Data.Semiring"],n["Data.Symbol"]),o=(n["Data.Unit"],n["Data.Void"],n["Record.Unsafe"]),i=n["Type.Data.RowList"],l=function(n,e){this.Eq0=n,this.compare=e},c=function(n,e){this.EqRecord0=n,this.compareRecord=e},v=new c(function(){return t.eqRowNil},function(n){return function(n){return function(n){return u.EQ.value}}}),f=new l(function(){return t.eqInt},a.unsafeCompare),s=function(n){return n.compareRecord},d=function(n){return n.compare};e.Ord=l,e.compare=d,e.min=function(n){return function(e){return function(t){var a=d(n)(e)(t);if(a instanceof u.LT)return e;if(a instanceof u.EQ)return e;if(a instanceof u.GT)return t;throw new Error("Failed pattern match at Data.Ord (line 119, column 3 - line 122, column 12): "+[a.constructor.name])}}},e.OrdRecord=c,e.compareRecord=s,e.ordInt=f,e.ordRecordNil=v,e.ordRecordCons=function(n){return function(e){return function(a){return function(l){return new c(function(){return t.eqRowCons(n.EqRecord0())(e)(a)(l.Eq0())},function(e){return function(e){return function(c){var v=r.reflectSymbol(a)(r.SProxy.value),f=d(l)(o.unsafeGet(v)(e))(o.unsafeGet(v)(c));return t.notEq(u.eqOrdering)(f)(u.EQ.value)?f:s(n)(i.RLProxy.value)(e)(c)}}})}}}},e.ordRecord=function(n){return function(e){return new l(function(){return t.eqRec(n)(e.EqRecord0())},s(e)(i.RLProxy.value))}}}(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(t){return n(t)(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 t=e.length,a=new Array(t),u=0;u<t;u++)a[u]=n(e[u]);return a}}}(),function(e){"use strict";var t=n["Data.Functor"],a=(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(t.arrayMap);e.Functor=r,e.map=o,e.void=function(n){return o(n)(a.const(u.unit))},e.functorArray=i}(n["Data.Functor"]=n["Data.Functor"]||{}),function(e){"use strict";var t=n["Control.Apply"],a=(n["Control.Category"],n["Data.Function"],n["Data.Functor"]),u=function(n,e){this.Functor0=n,this.apply=e},r=new u(function(){return a.functorArray},t.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 t=[],a=0,u=n.length;a<u;a++)Array.prototype.push.apply(t,e(n[a]));return t}}}(),function(e){"use strict";var t=n["Control.Bind"],a=(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 a.applyArray},t.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 t=n["Control.Applicative"],a=(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 a.bind(n.Bind1())(e)(function(e){return a.bind(n.Bind1())(u)(function(a){return t.pure(n.Applicative0())(e(a))})})}}}}(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 t=n["Control.Applicative"],a=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(t){if(t instanceof i)return n;if(t instanceof l)return e(t.value0);throw new Error("Failed pattern match at Data.Maybe (line 217, column 1 - line 217, column 51): "+[n.constructor.name,e.constructor.name,t.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 a.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 t.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,t){this.foldMap=n,this.foldl=e,this.foldr=t},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 t=n["Control.Applicative"],a=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(t){if(t instanceof o)return n(t.value0);if(t instanceof i)return e(t.value0);throw new Error("Failed pattern match at Data.Either (line 238, column 1 - line 238, column 64): "+[n.constructor.name,e.constructor.name,t.constructor.name])}}},v=new a.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 t.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 t=n.Partial;e.crashWith=t.crashWith}(n.Partial=n.Partial||{}),function(e){"use strict";var t=n["Partial.Unsafe"],a=n.Partial;e.unsafeCrashWith=function(n){return t.unsafePartial(function(e){return a.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 t=function(){function n(n){this.value0=n}return n.create=function(e){return new n(e)},n}(),a=function(){function n(n){this.value0=n}return n.create=function(e){return new n(e)},n}();e.Loop=t,e.Done=a,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 t=n["Control.Monad.ST.Internal"],a=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(t.map_)),f=new o.Monad(function(){return p},function(){return s}),s=new r.Bind(function(){return d},t.bind_),d=new u.Apply(function(){return v},o.ap(f)),p=new a.Applicative(function(){return d},t.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)(t.new)(n(e)))(function(e){return r.discard(r.discardUnit)(s)(t.while(l.map(v)(u)(t.read(e)))(r.bind(s)(t.read(e))(function(u){if(u instanceof i.Loop)return r.bind(s)(n(u.value0))(function(n){return l.void(v)(t.write(n)(e))});if(u instanceof i.Done)return a.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)(t.read(e))})})}});e.functorST=v,e.applyST=d,e.applicativeST=p,e.bindST=s,e.monadST=f,e.monadRecST=D,e.read=t.read,e.write=t.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(t){return function(a){return a<0||a>=t.length?e:n(t[a])}}}},n.sortImpl=function(n){return function(e){return e.slice().sort(function(e,t){return n(e)(t)})}},n.slice=function(n){return function(e){return function(t){return t.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 t=n["Unsafe.Coerce"];e.unsafeCoerce=t.unsafeCoerce}(n["Unsafe.Coerce"]=n["Unsafe.Coerce"]||{}),function(e){"use strict";var t=n["Data.Array.ST"],a=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 t.pushAll([n])},e.unsafeFreeze=function(n){return a.pure(u.applicativeST)(n)},e.empty=t.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 t=function(){function n(n,e){this.value0=n,this.value1=e}return n.create=function(e){return function(t){return new n(e,t)}},n}();e.Tuple=t,e.snd=function(n){return n.value1}}(n["Data.Tuple"]=n["Data.Tuple"]||{}),function(e){"use strict";var t=n["Data.Array"],a=(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=t.indexImpl(r.Just.create)(r.Nothing.value),c=u.flip(a.bind(a.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 t.sortImpl(function(e){return function(t){var a=n(e)(t);if(a instanceof o.GT)return 1;if(a instanceof o.EQ)return 0;if(a instanceof o.LT)return-1;throw new Error("Failed pattern match at Data.Array (line 702, column 15 - line 707, column 1): "+[a.constructor.name])}})(e)}}}(n["Data.Array"]=n["Data.Array"]||{}),function(n){var e=require("big-integer");n["fromBase'"]=function(n){return function(t){return function(a){return function(u){try{var r=e(u,a);return n(r)}catch(o){return t}}}}},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(t){var a;a=t<11?"[0-"+(t-1).toString()+"]":11===t?"[0-9a]":"[0-9a-"+String.fromCharCode(86+t)+"]";var u=new RegExp("^[\\+\\-]?"+a+"+$","i");return function(a){if(u.test(a)){var r=parseInt(a,t);return(0|r)===r?n(r):e}return e}}}}}(),function(e){"use strict";var t=n["Data.Int"],a=(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,t.fromStringAsImpl(a.Just.create)(a.Nothing.value)),r=u(10);e.fromString=r,e.fromStringAs=u}(n["Data.Int"]=n["Data.Int"]||{}),function(e){"use strict";var t=n["Data.BigInt"],a=(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,t.toBase(10)),c=new i.Semiring(t.biAdd,t.biMul,t.fromInt(1),t.fromInt(0)),v=t["fromBase'"](u.Just.create)(u.Nothing.value),f=v(10),s=new a.Eq(t.biEquals),d=new r.Ord(function(){return s},function(n){return function(e){var a=t.biCompare(n)(e);return 1===a?o.GT.value:0===a?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 t=n["Control.Applicative"],a=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(t){return new n(e,t)}},n}(),f=new u.Foldable(function(n){return function(e){return u.foldl(f)(function(t){return function(a){return l.append(n.Semigroup0())(t)(e(a))}})(i.mempty(n))}},function(n){return function(e){return function(t){var a,u=e,r=!1;function o(e,a){if(a instanceof c)return r=!0,e;if(a instanceof v)return u=n(e)(a.value0),void(t=a.value1);throw new Error("Failed pattern match at Data.List.Types (line 81, column 12 - line 83, column 30): "+[a.constructor.name])}for(;!r;)a=o(u,t);return a}}},function(n){return function(e){var t=u.foldl(f)(r.flip(v.create))(c.value);return function(a){return u.foldl(f)(r.flip(n))(e)(t(a))}}}),s=new o.Functor(function(n){return u.foldr(f)(function(e){return function(t){return new v(n(e),t)}})(c.value)}),d=new l.Semigroup(function(n){return function(e){return u.foldr(f)(v.create)(e)(n)}}),p=new a.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))(a.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 t.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 t,a=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,t,a){this.value0=n,this.value1=e,this.value2=t,this.value3=a}return n.create=function(e){return function(t){return function(a){return function(u){return new n(e,t,a,u)}}}},n}(),s=function(){function n(n,e,t,a,u,r,o){this.value0=n,this.value1=e,this.value2=t,this.value3=a,this.value4=u,this.value5=r,this.value6=o}return n.create=function(e){return function(t){return function(a){return function(u){return function(r){return function(o){return function(i){return new n(e,t,a,u,r,o,i)}}}}}}},n}(),d=function(){function n(n,e,t){this.value0=n,this.value1=e,this.value2=t}return n.create=function(e){return function(t){return function(a){return new n(e,t,a)}}},n}(),p=function(){function n(n,e,t){this.value0=n,this.value1=e,this.value2=t}return n.create=function(e){return function(t){return function(a){return new n(e,t,a)}}},n}(),D=function(){function n(n,e,t,a,u,r){this.value0=n,this.value1=e,this.value2=t,this.value3=a,this.value4=u,this.value5=r}return n.create=function(e){return function(t){return function(a){return function(u){return function(r){return function(o){return new n(e,t,a,u,r,o)}}}}}},n}(),m=function(){function n(n,e,t,a,u,r){this.value0=n,this.value1=e,this.value2=t,this.value3=a,this.value4=u,this.value5=r}return n.create=function(e){return function(t){return function(a){return function(u){return function(r){return function(o){return new n(e,t,a,u,r,o)}}}}}},n}(),w=function(){function n(n,e,t,a,u,r){this.value0=n,this.value1=e,this.value2=t,this.value3=a,this.value4=u,this.value5=r}return n.create=function(e){return function(t){return function(a){return function(u){return function(r){return function(o){return new n(e,t,a,u,r,o)}}}}}},n}(),h=function(){function n(n,e,t,a){this.value0=n,this.value1=e,this.value2=t,this.value3=a}return n.create=function(e){return function(t){return function(a){return function(u){return new n(e,t,a,u)}}}},n}(),y=function(n){return function(e){var t=o.compare(n);return function(n){var a,u=!1;function o(a){if(a instanceof v)return u=!0,r.Nothing.value;if(a instanceof f){var o=t(e)(a.value1);return o instanceof i.EQ?(u=!0,new r.Just(a.value2)):o instanceof i.LT?void(n=a.value0):void(n=a.value3)}if(a instanceof s){var l=t(e)(a.value1);if(l instanceof i.EQ)return u=!0,new r.Just(a.value2);var c=t(e)(a.value4);return c instanceof i.EQ?(u=!0,new r.Just(a.value5)):l instanceof i.LT?void(n=a.value0):c instanceof i.GT?void(n=a.value6):void(n=a.value3)}throw new Error("Failed pattern match at Data.Map.Internal (line 200, column 5 - line 200, column 22): "+[a.constructor.name])}for(;!u;)a=o(n);return a}}},C=function(n){if(n instanceof v)return u.Nil.value;if(n instanceof f)return l.append(u.semigroupList)(C(n.value0))(l.append(u.semigroupList)(a.pure(u.applicativeList)(n.value1))(C(n.value3)));if(n instanceof s)return l.append(u.semigroupList)(C(n.value0))(l.append(u.semigroupList)(a.pure(u.applicativeList)(n.value1))(l.append(u.semigroupList)(C(n.value3))(l.append(u.semigroupList)(a.pure(u.applicativeList)(n.value4))(C(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(t){var a,r=n,o=e,i=!1;function l(n,e,a){if(e instanceof u.Nil)return i=!0,a;if(e instanceof u.Cons){if(e.value0 instanceof d)return r=n,o=e.value1,void(t=new f(a,e.value0.value0,e.value0.value1,e.value0.value2));if(e.value0 instanceof p)return r=n,o=e.value1,void(t=new f(e.value0.value0,e.value0.value1,e.value0.value2,a));if(e.value0 instanceof D)return r=n,o=e.value1,void(t=new s(a,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(t=new s(e.value0.value0,e.value0.value1,e.value0.value2,a,e.value0.value3,e.value0.value4,e.value0.value5));if(e.value0 instanceof w)return r=n,o=e.value1,void(t=new s(e.value0.value0,e.value0.value1,e.value0.value2,e.value0.value3,e.value0.value4,e.value0.value5,a));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,a.constructor.name])}for(;!i;)a=l(r,o,t);return a}}},S=function(n){return function(e){var t,a=function(e){return function(t){var a,r=e,o=!1;function i(e,a){if(e instanceof u.Nil)return o=!0,a;if(e instanceof u.Cons){if(e.value0 instanceof d&&e.value0.value2 instanceof v&&a 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&&a 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(t=new s(a,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(t=new s(e.value0.value0.value0,e.value0.value0.value1,e.value0.value0.value2,e.value0.value0.value3,e.value0.value1,e.value0.value2,a));if(e.value0 instanceof d&&e.value0.value2 instanceof s)return o=!0,g(n)(e.value1)(new f(new f(a,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,a)));if(e.value0 instanceof D&&e.value0.value2 instanceof v&&e.value0.value5 instanceof v&&a 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&&a 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&&a 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(a,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,a),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(a,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,a)));if(e.value0 instanceof D&&e.value0.value2 instanceof s)return o=!0,g(n)(e.value1)(new s(new f(a,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,a),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(a,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,a)));throw new Error("Failed pattern match at Data.Map.Internal (line 511, column 9 - line 528, column 136): "+[e.value0.constructor.name,a.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;)a=i(r,t);return a}},l=function(n){return function(e){var t,r=n,o=!1;function i(n,t){if(t instanceof f&&t.value0 instanceof v&&t.value3 instanceof v)return o=!0,a(n)(v.value);if(t instanceof f)return r=new u.Cons(new p(t.value0,t.value1,t.value2),n),void(e=t.value3);if(t instanceof s&&t.value0 instanceof v&&t.value3 instanceof v&&t.value6 instanceof v)return o=!0,a(new u.Cons(new p(v.value,t.value1,t.value2),n))(v.value);if(t instanceof s)return r=new u.Cons(new w(t.value0,t.value1,t.value2,t.value3,t.value4,t.value5),n),void(e=t.value6);throw new Error("Failed pattern match at Data.Map.Internal (line 540, column 5 - line 544, column 107): "+[t.constructor.name])}for(;!o;)t=i(r,e);return t}},h=function(n){var e,t=!1;function a(e){if(e instanceof f&&e.value3 instanceof v)return t=!0,{key:e.value1,value:e.value2};if(e instanceof f)n=e.value3;else{if(e instanceof s&&e.value6 instanceof v)return t=!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(;!t;)e=a(n);return e},y=o.compare(n);return t=u.Nil.value,function(o){var C,S=t,b=!1;function E(t,C){if(C instanceof v)return b=!0,r.Nothing.value;if(C instanceof f){var E=y(e)(C.value1);if(C.value3 instanceof v&&E instanceof i.EQ)return b=!0,new r.Just(new c.Tuple(C.value2,a(t)(v.value)));if(E instanceof i.EQ){var F=h(C.value0);return b=!0,new r.Just(new c.Tuple(C.value2,l(new u.Cons(new d(F.key,F.value,C.value3),t))(C.value0)))}return E instanceof i.LT?(S=new u.Cons(new d(C.value1,C.value2,C.value3),t),void(o=C.value0)):(S=new u.Cons(new p(C.value0,C.value1,C.value2),t),void(o=C.value3))}if(C instanceof s){var M=C.value0 instanceof v&&C.value3 instanceof v&&C.value6 instanceof v,A=(E=y(e)(C.value4),y(e)(C.value1));return M&&A instanceof i.EQ?(b=!0,new r.Just(new c.Tuple(C.value2,g(n)(t)(new f(v.value,C.value4,C.value5,v.value))))):M&&E instanceof i.EQ?(b=!0,new r.Just(new c.Tuple(C.value5,g(n)(t)(new f(v.value,C.value1,C.value2,v.value))))):A instanceof i.EQ?(F=h(C.value0),b=!0,new r.Just(new c.Tuple(C.value2,l(new u.Cons(new D(F.key,F.value,C.value3,C.value4,C.value5,C.value6),t))(C.value0)))):E instanceof i.EQ?(F=h(C.value3),b=!0,new r.Just(new c.Tuple(C.value5,l(new u.Cons(new m(C.value0,C.value1,C.value2,F.key,F.value,C.value6),t))(C.value3)))):A instanceof i.LT?(S=new u.Cons(new D(C.value1,C.value2,C.value3,C.value4,C.value5,C.value6),t),void(o=C.value0)):A instanceof i.GT&&E instanceof i.LT?(S=new u.Cons(new m(C.value0,C.value1,C.value2,C.value4,C.value5,C.value6),t),void(o=C.value3)):(S=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 481, column 34 - line 504, column 80): "+[C.constructor.name])}for(;!b;)C=E(S,o);return C}}},b=(t=r.Nothing.value,function(n){var e,a=t,u=!1;function o(e,t){if(t instanceof v)return u=!0,e;if(t instanceof f)return a=new r.Just({key:t.value1,value:t.value2}),void(n=t.value3);if(t instanceof s)return a=new r.Just({key:t.value4,value:t.value5}),void(n=t.value6);throw new Error("Failed pattern match at Data.Map.Internal (line 289, column 5 - line 289, column 22): "+[e.constructor.name,t.constructor.name])}for(;!u;)e=o(a,n);return e}),E=v.value;e.empty=E,e.insert=function(n){return function(e){return function(t){var a,r=function(e){return function(t){var a,r=e,o=!1;function i(e,a){if(e instanceof u.Nil)return o=!0,new f(a.value0,a.value1,a.value2,a.value3);if(e instanceof u.Cons){if(e.value0 instanceof d)return o=!0,g(n)(e.value1)(new s(a.value0,a.value1,a.value2,a.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,a.value0,a.value1,a.value2,a.value3));if(e.value0 instanceof D)return r=e.value1,void(t=new h(new f(a.value0,a.value1,a.value2,a.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(t=new h(new f(e.value0.value0,e.value0.value1,e.value0.value2,a.value0),a.value1,a.value2,new f(a.value3,e.value0.value3,e.value0.value4,e.value0.value5)));if(e.value0 instanceof w)return r=e.value1,void(t=new h(new f(e.value0.value0,e.value0.value1,e.value0.value2,e.value0.value3),e.value0.value4,e.value0.value5,new f(a.value0,a.value1,a.value2,a.value3)));throw new Error("Failed pattern match at Data.Map.Internal (line 454, column 5 - line 459, column 108): "+[e.value0.constructor.name,a.constructor.name])}throw new Error("Failed pattern match at Data.Map.Internal (line 451, column 3 - line 451, column 56): "+[e.constructor.name,a.constructor.name])}for(;!o;)a=i(r,t);return a}},l=o.compare(n);return a=u.Nil.value,function(o){var c,y=a,C=!1;function S(a,c){if(c instanceof v)return C=!0,r(a)(new h(v.value,e,t,v.value));if(c instanceof f){var S=l(e)(c.value1);return S instanceof i.EQ?(C=!0,g(n)(a)(new f(c.value0,e,t,c.value3))):S instanceof i.LT?(y=new u.Cons(new d(c.value1,c.value2,c.value3),a),void(o=c.value0)):(y=new u.Cons(new p(c.value0,c.value1,c.value2),a),void(o=c.value3))}if(c instanceof s){var b=l(e)(c.value1);if(b instanceof i.EQ)return C=!0,g(n)(a)(new s(c.value0,e,t,c.value3,c.value4,c.value5,c.value6));var E=l(e)(c.value4);return E instanceof i.EQ?(C=!0,g(n)(a)(new s(c.value0,c.value1,c.value2,c.value3,e,t,c.value6))):b instanceof i.LT?(y=new u.Cons(new D(c.value1,c.value2,c.value3,c.value4,c.value5,c.value6),a),void(o=c.value0)):b instanceof i.GT&&E instanceof i.LT?(y=new u.Cons(new m(c.value0,c.value1,c.value2,c.value4,c.value5,c.value6),a),void(o=c.value3)):(y=new u.Cons(new w(c.value0,c.value1,c.value2,c.value3,c.value4,c.value5),a),void(o=c.value6))}throw new Error("Failed pattern match at Data.Map.Internal (line 434, column 3 - line 434, column 55): "+[a.constructor.name,c.constructor.name])}for(;!C;)c=S(y,o);return c}}}},e.lookup=y,e.findMax=b,e.delete=function(n){return function(e){return function(t){return r.maybe(t)(c.snd)(S(n)(e)(t))}}},e.pop=S,e.member=function(n){return function(e){return function(t){return r.isJust(y(n)(e)(t))}}},e.keys=C}(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 t=n["Data.Foldable"],a=(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(t){return r.insert(n)(e)(i.unit)(t)}}},v=new t.Foldable(function(n){return function(e){return function(a){return t.foldMap(u.foldableList)(n)(e)(l(a))}}},function(n){return function(e){return function(a){return t.foldl(u.foldableList)(n)(e)(l(a))}}},function(n){return function(e){return function(a){return t.foldr(u.foldableList)(n)(e)(l(a))}}}),f=r.empty;e.empty=f,e.map=function(n){return function(e){return t.foldl(v)(function(t){return function(a){return c(n)(e(a))(t)}})(f)}},e.insert=c,e.member=function(n){return function(e){return function(t){return r.member(n)(e)(t)}}},e.delete=function(n){return function(e){return function(t){return r.delete(n)(e)(t)}}},e.findMax=function(n){return a.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 t=n["Data.String.Common"];n["Data.Eq"],n["Data.Ordering"],n["Data.String.Pattern"],n.Prelude;e.split=t.split,e.trim=t.trim,e.joinWith=t.joinWith}(n["Data.String.Common"]=n["Data.String.Common"]||{}),function(e){"use strict";var t=n["Control.Applicative"],a=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"]),y=n["Data.Set"],C=(n["Data.String"],n["Data.String.Common"]),g=(n["Data.String.Pattern"],n["Data.Symbol"]),S=n["Data.Tuple"],b=n["Partial.Unsafe"],E=(n.Prelude,function(){function n(n,e,t,a){this.value0=n,this.value1=e,this.value2=t,this.value3=a}return n.create=function(e){return function(t){return function(a){return function(u){return new n(e,t,a,u)}}}},n}()),F=C.split(" "),M=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)}}),A=new m.Ord(function(){return M},function(n){return function(e){var t=m.compare(c.ordBigInt)(n.value3)(e.value3);if(t instanceof w.LT)return w.LT.value;if(t instanceof w.GT)return w.GT.value;if(t instanceof w.EQ)return m.compare(m.ordRecord()(m.ordRecordCons(m.ordRecordCons(m.ordRecordCons(m.ordRecordNil)()(new g.IsSymbol(function(){return"ci"}))(m.ordInt))()(new g.IsSymbol(function(){return"bi"}))(m.ordInt))()(new g.IsSymbol(function(){return"ai"}))(m.ordInt)))({ai:n.value0,bi:n.value1,ci:n.value2})({ai:e.value0,bi:e.value1,ci:e.value2});throw new Error("Failed pattern match at AtCoder.ABC123.D (line 55, column 5 - line 58, column 65): "+[t.constructor.name])}});e.solve=function(n){return f.either(function(n){return b.unsafeCrashWith(n)})(u.identity(u.categoryFn))(a.bind(f.bindEither)(4===(s=C.split("\n")(C.trim(n))).length?a.bind(f.bindEither)(4===(e=i.mapMaybe(p.fromString)(F(s[0]))).length?t.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)(F(s[3])),a=i.mapMaybe(c.fromString)(F(s[2])),u=i.mapMaybe(c.fromString)(F(s[1]));return t.pure(f.applicativeEither)({x:n.x,y:n.y,z:n.z,k:n.k,as:u,bs:a,cs:e})}):new f.Left("lines"))(function(n){return t.pure(f.applicativeEither)(C.joinWith("\n")((e=n.x,function(n){return function(u){return function(f){return function(s){return function(p){return function(w){var C,g,b=function(n){return function(e){if(n instanceof D.Nothing)return e;if(n instanceof D.Just){if(y.member(A)(n.value0)(e.value0))return e;if(v.otherwise)return new S.Tuple(y.insert(A)(n.value0)(e.value0),y.insert(A)(n.value0)(e.value1))}throw new Error("Failed pattern match at AtCoder.ABC123.D (line 89, column 5 - line 89, column 42): "+[n.constructor.name,e.constructor.name])}},F=i.sortBy(d.flip(m.compare(c.ordBigInt)))(w),M=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 a.bind(D.bindMaybe)(i.index(T)(n))(function(r){return a.bind(D.bindMaybe)(i.index(M)(e))(function(o){return a.bind(D.bindMaybe)(i.index(F)(u))(function(a){return t.pure(D.applicativeMaybe)(new E(n,e,u,h.add(c.semiringBigInt)(h.add(c.semiringBigInt)(r)(o))(a)))})})})}}},R=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)(),t=D.fromJust()(y.findMax(e.value1)),a=new S.Tuple(e.value0,y.delete(A)(t)(e.value1)),u=b(I(t.value0+1|0)(t.value1)(t.value2))(a),i=b(I(t.value0)(t.value1+1|0)(t.value2))(u),v=b(I(t.value0)(t.value1)(t.value2+1|0))(i);return l.push(c.toString(t.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 95, column 5 - line 95, column 60): "+[n.constructor.name])};return C=l.empty(),g={value:b(I(0)(0)(0))(new S.Tuple(y.empty,y.empty))},r.tailRecM(o.monadRecST)(R)({ki:m.min(m.ordInt)(f)((e*n|0)*u|0),qRef:g,sta:C})()}}}}}})(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 t=n["Effect.Console"];n["Data.Show"],n["Data.Unit"],n.Effect;e.log=t.log}(n["Effect.Console"]=n["Effect.Console"]||{}),function(e){"use strict";n["Node.Encoding"];var t=n["Data.Show"],a=(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 t.Show(function(n){if(n instanceof a)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=a,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 t=n["Node.FS.Internal"],a=(n.Effect,n.Prelude,n["Unsafe.Coerce"].unsafeCoerce);e.mkEffect=a,e.unsafeRequireFS=t.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 t=n["Data.Show"],a=(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:t.show(a.showEncoding)(n)})})}}}(n["Node.FS.Sync"]=n["Node.FS.Sync"]||{}),function(e){"use strict";var t=n["AtCoder.ABC123.D"],a=(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=t.solve(n);return a.log(e)()}}(n.Main=n.Main||{}),n.Main.main();
},{"big-integer":"9xaU"}]},{},["Focm"], null)