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 t={};!function(n){"use strict";(t["Control.Apply"]=t["Control.Apply"]||{}).arrayApply=function(t){return function(n){for(var r=t.length,a=n.length,o=new Array(r*a),e=0,i=0;i<r;i++)for(var u=t[i],c=0;c<a;c++)o[e++]=u(n[c]);return o}}}(),function(t){"use strict";var n=function(t){this.compose=t},r=new n(function(t){return function(n){return function(r){return t(n(r))}}});t.compose=function(t){return t.compose},t.Semigroupoid=n,t.semigroupoidFn=r}(t["Control.Semigroupoid"]=t["Control.Semigroupoid"]||{}),function(n){"use strict";var r=t["Control.Semigroupoid"],a=function(t,n){this.Semigroupoid0=t,this.identity=n},o=new a(function(){return r.semigroupoidFn},function(t){return t});n.Category=a,n.identity=function(t){return t.identity},n.categoryFn=o}(t["Control.Category"]=t["Control.Category"]||{}),function(n){"use strict";(t["Data.Boolean"]=t["Data.Boolean"]||{}).otherwise=!0}(),function(n){"use strict";(t["Data.Eq"]=t["Data.Eq"]||{}).refEq=function(t){return function(n){return t===n}}}(),function(n){"use strict";var r=t["Data.Eq"],a=(t["Data.HeytingAlgebra"],t["Data.Symbol"],t["Data.Unit"],t["Data.Void"],t["Record.Unsafe"],t["Type.Data.RowList"],function(t){this.eq=t}),o=new a(r.refEq),e=new a(r.refEq),i=function(t){return t.eq};n.Eq=a,n.eq=i,n.notEq=function(t){return function(n){return function(r){return i(e)(i(t)(n)(r))(!1)}}},n.eqBoolean=e,n.eqInt=o}(t["Data.Eq"]=t["Data.Eq"]||{}),function(n){"use strict";(t["Data.Ord.Unsafe"]=t["Data.Ord.Unsafe"]||{}).unsafeCompareImpl=function(t){return function(n){return function(r){return function(a){return function(o){return a<o?t:a===o?n:r}}}}}}(),function(n){"use strict";t["Data.Semigroup"],t["Data.Symbol"],t["Data.Unit"],t["Data.Void"],t["Record.Unsafe"],t["Type.Data.RowList"];n.append=function(t){return t.append}}(t["Data.Semigroup"]=t["Data.Semigroup"]||{}),function(n){"use strict";t["Data.Show"],t["Data.Symbol"],t["Record.Unsafe"],t["Type.Data.RowList"];n.Show=function(t){this.show=t},n.show=function(t){return t.show}}(t["Data.Show"]=t["Data.Show"]||{}),function(n){"use strict";t["Data.Eq"],t["Data.Semigroup"],t["Data.Show"];var r=function(){function t(){}return t.value=new t,t}(),a=function(){function t(){}return t.value=new t,t}(),o=function(){function t(){}return t.value=new t,t}();n.LT=r,n.GT=a,n.EQ=o}(t["Data.Ordering"]=t["Data.Ordering"]||{}),function(n){"use strict";var r=t["Data.Ord.Unsafe"],a=t["Data.Ordering"],o=r.unsafeCompareImpl(a.LT.value)(a.EQ.value)(a.GT.value);n.unsafeCompare=o}(t["Data.Ord.Unsafe"]=t["Data.Ord.Unsafe"]||{}),function(n){"use strict";t["Data.Semiring"],t["Data.Symbol"],t["Data.Unit"],t["Record.Unsafe"],t["Type.Data.Row"],t["Type.Data.RowList"];n.Semiring=function(t,n,r,a){this.add=t,this.mul=n,this.one=r,this.zero=a},n.add=function(t){return t.add},n.zero=function(t){return t.zero},n.mul=function(t){return t.mul},n.one=function(t){return t.one}}(t["Data.Semiring"]=t["Data.Semiring"]||{}),function(n){"use strict";t["Data.Ring"],t["Data.Semiring"],t["Data.Symbol"],t["Data.Unit"],t["Record.Unsafe"],t["Type.Data.RowList"];n.Ring=function(t,n){this.Semiring0=t,this.sub=n},n.sub=function(t){return t.sub}}(t["Data.Ring"]=t["Data.Ring"]||{}),function(n){"use strict";t["Data.Ord"];var r=t["Data.Eq"],a=t["Data.Ord.Unsafe"],o=t["Data.Ordering"],e=(t["Data.Ring"],t["Data.Semiring"],t["Data.Symbol"],t["Data.Unit"],t["Data.Void"],t["Record.Unsafe"],t["Type.Data.RowList"],function(t,n){this.Eq0=t,this.compare=n}),i=new e(function(){return r.eqInt},a.unsafeCompare),u=function(t){return t.compare};n.Ord=e,n.compare=u,n.min=function(t){return function(n){return function(r){var a=u(t)(n)(r);if(a instanceof o.LT)return n;if(a instanceof o.EQ)return n;if(a instanceof o.GT)return r;throw new Error("Failed pattern match at Data.Ord (line 119, column 3 - line 122, column 12): "+[a.constructor.name])}}},n.ordInt=i}(t["Data.Ord"]=t["Data.Ord"]||{}),function(n){"use strict";t["Control.Category"],t["Data.Boolean"],t["Data.Ord"],t["Data.Ring"];n.flip=function(t){return function(n){return function(r){return t(r)(n)}}}}(t["Data.Function"]=t["Data.Function"]||{}),function(n){"use strict";(t["Data.Functor"]=t["Data.Functor"]||{}).arrayMap=function(t){return function(n){for(var r=n.length,a=new Array(r),o=0;o<r;o++)a[o]=t(n[o]);return a}}}(),function(n){"use strict";var r=t["Data.Functor"],a=(t["Control.Semigroupoid"],t["Data.Function"],t["Data.Unit"],function(t){this.map=t}),o=new a(r.arrayMap);n.Functor=a,n.map=function(t){return t.map},n.functorArray=o}(t["Data.Functor"]=t["Data.Functor"]||{}),function(n){"use strict";var r=t["Control.Apply"],a=(t["Control.Category"],t["Data.Function"],t["Data.Functor"]),o=function(t,n){this.Functor0=t,this.apply=n},e=new o(function(){return a.functorArray},r.arrayApply);n.Apply=o,n.apply=function(t){return t.apply},n.applyArray=e}(t["Control.Apply"]=t["Control.Apply"]||{}),function(n){"use strict";t["Control.Apply"],t["Data.Functor"],t["Data.Unit"];n.Applicative=function(t,n){this.Apply0=t,this.pure=n},n.pure=function(t){return t.pure}}(t["Control.Applicative"]=t["Control.Applicative"]||{}),function(n){"use strict";(t["Control.Bind"]=t["Control.Bind"]||{}).arrayBind=function(t){return function(n){for(var r=[],a=0,o=t.length;a<o;a++)Array.prototype.push.apply(r,n(t[a]));return r}}}(),function(n){"use strict";var r=t["Control.Bind"],a=(t["Control.Applicative"],t["Control.Apply"]),o=(t["Control.Category"],t["Data.Function"],t["Data.Functor"],t["Data.Unit"],function(t,n){this.Apply0=t,this.bind=n}),e=new o(function(){return a.applyArray},r.arrayBind);n.Bind=o,n.bind=function(t){return t.bind},n.bindArray=e}(t["Control.Bind"]=t["Control.Bind"]||{}),function(t){"use strict";t.slice=function(t){return function(n){return function(r){return r.slice(t,n)}}},t.drop=function(t){return function(n){return t<1?n:n.slice(t)}}}(t["Data.Array"]=t["Data.Array"]||{}),function(t){"use strict";t.foldrArray=function(t){return function(n){return function(r){for(var a=n,o=r.length-1;o>=0;o--)a=t(r[o])(a);return a}}},t.foldlArray=function(t){return function(n){return function(r){for(var a=n,o=r.length,e=0;e<o;e++)a=t(a)(r[e]);return a}}}}(t["Data.Foldable"]=t["Data.Foldable"]||{}),function(t){"use strict";t.topInt=2147483647,t.bottomInt=-2147483648}(t["Data.Bounded"]=t["Data.Bounded"]||{}),function(n){"use strict";var r=t["Data.Bounded"],a=t["Data.Ord"],o=(t["Data.Ordering"],t["Data.Unit"],function(t,n,r){this.Ord0=t,this.bottom=n,this.top=r}),e=new o(function(){return a.ordInt},r.bottomInt,r.topInt);n.Bounded=o,n.bottom=function(t){return t.bottom},n.top=function(t){return t.top},n.boundedInt=e}(t["Data.Bounded"]=t["Data.Bounded"]||{}),function(n){"use strict";t["Data.Ring"],t["Data.Semiring"],t["Data.Symbol"],t["Data.Unit"];n.CommutativeRing=function(t){this.Ring0=t}}(t["Data.CommutativeRing"]=t["Data.CommutativeRing"]||{}),function(n){"use strict";t["Data.EuclideanRing"],t["Data.BooleanAlgebra"],t["Data.CommutativeRing"],t["Data.Eq"],t["Data.HeytingAlgebra"],t["Data.Ring"],t["Data.Semiring"];n.EuclideanRing=function(t,n,r,a){this.CommutativeRing0=t,this.degree=n,this.div=r,this.mod=a},n.degree=function(t){return t.degree},n.div=function(t){return t.div},n.mod=function(t){return t.mod}}(t["Data.EuclideanRing"]=t["Data.EuclideanRing"]||{}),function(n){"use strict";t["Data.Boolean"],t["Data.Eq"],t["Data.EuclideanRing"],t["Data.Ord"],t["Data.Ordering"],t["Data.Semigroup"],t["Data.Symbol"],t["Data.Unit"],t["Record.Unsafe"],t["Type.Data.RowList"];n.mempty=function(t){return t.mempty}}(t["Data.Monoid"]=t["Data.Monoid"]||{}),function(n){"use strict";t["Control.Alt"],t["Control.Alternative"],t["Control.Applicative"],t["Control.Apply"],t["Control.Bind"];var r=t["Control.Category"],a=(t["Control.Extend"],t["Control.Monad"],t["Control.MonadZero"],t["Control.Plus"],t["Data.Bounded"],t["Data.Eq"],t["Data.Function"],t["Data.Functor"],t["Data.Functor.Invariant"],t["Data.Monoid"],t["Data.Ord"],t["Data.Ordering"],t["Data.Semigroup"],t["Data.Show"],t["Data.Unit"],t.Prelude,function(){function t(){}return t.value=new t,t}()),o=function(){function t(t){this.value0=t}return t.create=function(n){return new t(n)},t}(),e=function(t){return function(n){return function(r){if(r instanceof a)return t;if(r instanceof o)return n(r.value0);throw new Error("Failed pattern match at Data.Maybe (line 217, column 1 - line 217, column 51): "+[t.constructor.name,n.constructor.name,r.constructor.name])}}};n.Nothing=a,n.Just=o,n.maybe=e,n.fromMaybe=function(t){return e(t)(r.identity(r.categoryFn))}}(t["Data.Maybe"]=t["Data.Maybe"]||{}),function(n){"use strict";var r=t["Data.Foldable"],a=(t["Control.Alt"],t["Control.Applicative"],t["Control.Apply"],t["Control.Bind"],t["Control.Category"],t["Control.Plus"],t["Control.Semigroupoid"],t["Data.Eq"],t["Data.Function"],t["Data.Functor"],t["Data.HeytingAlgebra"],t["Data.Maybe"],t["Data.Maybe.First"],t["Data.Maybe.Last"],t["Data.Monoid"]),o=(t["Data.Monoid.Additive"],t["Data.Monoid.Conj"],t["Data.Monoid.Disj"],t["Data.Monoid.Dual"],t["Data.Monoid.Endo"],t["Data.Monoid.Multiplicative"],t["Data.Newtype"],t["Data.Ord"],t["Data.Ordering"],t["Data.Semigroup"]),e=(t["Data.Semiring"],t["Data.Unit"],t.Prelude,function(t,n,r){this.foldMap=t,this.foldl=n,this.foldr=r}),i=function(t){return t.foldr},u=function(t){return function(n){return function(r){return i(t)(function(t){return function(a){return o.append(n.Semigroup0())(r(t))(a)}})(a.mempty(n))}}},c=new e(function(t){return u(c)(t)},r.foldlArray,r.foldrArray);n.Foldable=e,n.foldr=i,n.foldl=function(t){return t.foldl},n.foldMap=function(t){return t.foldMap},n.foldMapDefaultR=u,n.foldableArray=c}(t["Data.Foldable"]=t["Data.Foldable"]||{}),function(n){"use strict";(t["Partial.Unsafe"]=t["Partial.Unsafe"]||{}).unsafePartial=function(t){return t()}}(),function(n){"use strict";(t["Partial"]=t["Partial"]||{}).crashWith=function(){return function(t){throw new Error(t)}}}(),function(n){"use strict";var r=t.Partial;n.crashWith=r.crashWith}(t.Partial=t.Partial||{}),function(n){"use strict";var r=t["Partial.Unsafe"],a=t.Partial;n.unsafeCrashWith=function(t){return r.unsafePartial(function(n){return a.crashWith(n)(t)})}}(t["Partial.Unsafe"]=t["Partial.Unsafe"]||{}),function(n){"use strict";(t["Unsafe.Coerce"]=t["Unsafe.Coerce"]||{}).unsafeCoerce=function(t){return t}}(),function(n){"use strict";var r=t["Unsafe.Coerce"];n.unsafeCoerce=r.unsafeCoerce}(t["Unsafe.Coerce"]=t["Unsafe.Coerce"]||{}),function(n){"use strict";var r=t["Data.Array"],a=(t["Control.Alt"],t["Control.Alternative"],t["Control.Applicative"],t["Control.Apply"],t["Control.Bind"]),o=(t["Control.Category"],t["Control.Lazy"],t["Control.Monad.Rec.Class"],t["Control.Monad.ST"],t["Control.Monad.ST.Internal"],t["Control.Semigroupoid"],t["Data.Array.NonEmpty.Internal"],t["Data.Array.ST"],t["Data.Array.ST.Iterator"],t["Data.Boolean"],t["Data.Eq"],t["Data.Foldable"],t["Data.Function"]),e=(t["Data.Functor"],t["Data.HeytingAlgebra"],t["Data.Maybe"]),i=(t["Data.Ord"],t["Data.Ordering"],t["Data.Ring"],t["Data.Semigroup"],t["Data.Semiring"],t["Data.Traversable"],t["Data.Tuple"],t["Data.Unfoldable"],t["Partial.Unsafe"],t.Prelude,t["Unsafe.Coerce"],function(t){return[t]}),u=o.flip(a.bind(a.bindArray));n.singleton=i,n.concatMap=u,n.mapMaybe=function(t){return u(function(n){return e.maybe([])(i)(t(n))})},n.drop=r.drop}(t["Data.Array"]=t["Data.Array"]||{}),function(t){var n=require("big-integer");t["fromBase'"]=function(t){return function(r){return function(a){return function(o){try{var e=n(o,a);return t(e)}catch(i){return r}}}}},t.fromInt=function(t){return n(t)},t.toBase=function(t){return function(n){return n.toString(t)}},t.toNumber=function(t){return t.toJSNumber()},t.biAdd=function(t){return function(n){return t.add(n)}},t.biMul=function(t){return function(n){return t.multiply(n)}},t.biSub=function(t){return function(n){return t.minus(n)}},t.biMod=function(t){return function(n){return t.mod(n)}},t.biDiv=function(t){return function(n){return t.divide(n)}},t.biEquals=function(t){return function(n){return t.equals(n)}},t.biCompare=function(t){return function(n){return t.compare(n)}},t.abs=function(t){return t.abs()}}(t["Data.BigInt"]=t["Data.BigInt"]||{}),function(t){"use strict";t.fromNumberImpl=function(t){return function(n){return function(r){return(0|r)===r?t(r):n}}},t.toNumber=function(t){return t}}(t["Data.Int"]=t["Data.Int"]||{}),function(n){"use strict";(t["Global"]=t["Global"]||{}).infinity=1/0}(),function(n){"use strict";var r=t.Global;n.infinity=r.infinity}(t.Global=t.Global||{}),function(n){"use strict";(t["Math"]=t["Math"]||{}).floor=Math.floor}(),function(n){"use strict";var r=t.Math;n.floor=r.floor}(t.Math=t.Math||{}),function(n){"use strict";var r=t["Data.Int"],a=(t["Control.Category"],t["Control.Semigroupoid"],t["Data.Boolean"]),o=t["Data.Bounded"],e=(t["Data.CommutativeRing"],t["Data.DivisionRing"],t["Data.Eq"],t["Data.EuclideanRing"],t["Data.HeytingAlgebra"],t["Data.Int.Bits"],t["Data.Maybe"]),i=(t["Data.Ord"],t["Data.Ordering"],t["Data.Ring"],t["Data.Semiring"],t["Data.Show"],t.Global),u=t.Math,c=(t.Prelude,r.fromNumberImpl(e.Just.create)(e.Nothing.value));n.fromNumber=c,n.floor=function(t){return function(t){if(t===i.infinity)return 0;if(t===-i.infinity)return 0;if(t>=r.toNumber(o.top(o.boundedInt)))return o.top(o.boundedInt);if(t<=r.toNumber(o.bottom(o.boundedInt)))return o.bottom(o.boundedInt);if(a.otherwise)return e.fromMaybe(0)(c(t));throw new Error("Failed pattern match at Data.Int (line 66, column 1 - line 66, column 29): "+[t.constructor.name])}(u.floor(t))}}(t["Data.Int"]=t["Data.Int"]||{}),function(n){"use strict";var r=t["Data.BigInt"],a=(t["Control.Semigroupoid"],t["Data.Array.NonEmpty"],t["Data.CommutativeRing"]),o=t["Data.Eq"],e=t["Data.EuclideanRing"],i=(t["Data.Function"],t["Data.Int"]),u=t["Data.Maybe"],c=t["Data.Ord"],f=t["Data.Ordering"],l=t["Data.Ring"],s=(t["Data.Semigroup"],t["Data.Semiring"]),d=(t["Data.Show"],t["Data.String.NonEmpty"],t["Data.String.NonEmpty.Internal"],t["Partial.Unsafe"],t.Prelude,r.toBase(10)),D=new s.Semiring(r.biAdd,r.biMul,r.fromInt(1),r.fromInt(0)),m=new l.Ring(function(){return D},r.biSub),p=r.biMod,g=r["fromBase'"](u.Just.create)(u.Nothing.value),C=g(10),y=new o.Eq(r.biEquals),h=new c.Ord(function(){return y},function(t){return function(n){var a=r.biCompare(t)(n);return 1===a?f.GT.value:0===a?f.EQ.value:f.LT.value}}),v=new a.CommutativeRing(function(){return m}),b=new e.EuclideanRing(function(){return v},function(t){return i.floor(r.toNumber(r.abs(t)))},function(t){return function(n){return r.biDiv(l.sub(m)(t)(e.mod(b)(t)(n)))(n)}},function(t){return function(n){var a=r.abs(n);return r.biMod(s.add(D)(r.biMod(t)(a))(a))(a)}});n.fromString=C,n.fromBase=g,n.toString=d,n.rem=p,n.eqBigInt=y,n.ordBigInt=h,n.semiringBigInt=D,n.ringBigInt=m,n.commutativeRingBigInt=v,n.euclideanRingBigInt=b,n.fromInt=r.fromInt}(t["Data.BigInt"]=t["Data.BigInt"]||{}),function(n){"use strict";t["Control.Alt"];var r=t["Control.Applicative"],a=t["Control.Apply"],o=t["Control.Bind"],e=(t["Control.Extend"],t["Control.Monad"],t["Control.Semigroupoid"],t["Data.Bifoldable"],t["Data.Bifunctor"],t["Data.Bitraversable"],t["Data.Bounded"],t["Data.Eq"],t["Data.Foldable"],t["Data.FoldableWithIndex"],t["Data.Function"],t["Data.Functor"]),i=(t["Data.Functor.Invariant"],t["Data.FunctorWithIndex"],t["Data.Maybe"]),u=(t["Data.Monoid"],t["Data.Ord"],t["Data.Ordering"],t["Data.Semigroup"],t["Data.Show"],t["Data.Traversable"],t["Data.TraversableWithIndex"],t["Data.Unit"],t.Prelude,function(){function t(t){this.value0=t}return t.create=function(n){return new t(n)},t}()),c=function(){function t(t){this.value0=t}return t.create=function(n){return new t(n)},t}(),f=new e.Functor(function(t){return function(n){if(n instanceof u)return new u(n.value0);if(n instanceof c)return new c(t(n.value0));throw new Error("Failed pattern match at Data.Either (line 38, column 8 - line 38, column 52): "+[n.constructor.name])}}),l=function(t){return function(n){return function(r){if(r instanceof u)return t(r.value0);if(r instanceof c)return n(r.value0);throw new Error("Failed pattern match at Data.Either (line 238, column 1 - line 238, column 64): "+[t.constructor.name,n.constructor.name,r.constructor.name])}}},s=new a.Apply(function(){return f},function(t){return function(n){if(t instanceof u)return new u(t.value0);if(t instanceof c)return e.map(f)(t.value0)(n);throw new Error("Failed pattern match at Data.Either (line 82, column 1 - line 82, column 41): "+[t.constructor.name,n.constructor.name])}}),d=new o.Bind(function(){return s},l(function(t){return function(n){return new u(t)}})(function(t){return function(n){return n(t)}})),D=new r.Applicative(function(){return s},c.create);n.Left=u,n.Right=c,n.either=l,n.note=function(t){return i.maybe(new u(t))(c.create)},n.functorEither=f,n.applyEither=s,n.applicativeEither=D,n.bindEither=d}(t["Data.Either"]=t["Data.Either"]||{}),function(t){"use strict";t.split=function(t){return function(n){return n.split(t)}},t.trim=function(t){return t.trim()}}(t["Data.String.Common"]=t["Data.String.Common"]||{}),function(n){"use strict";var r=t["Data.String.Common"];t["Data.Eq"],t["Data.Ordering"],t["Data.String.Pattern"],t.Prelude;n.split=r.split,n.trim=r.trim}(t["Data.String.Common"]=t["Data.String.Common"]||{}),function(n){"use strict";var r=t["Control.Applicative"],a=t["Control.Bind"],o=t["Data.Array"],e=t["Data.BigInt"],i=t["Data.Either"],u=t["Data.Eq"],c=t["Data.EuclideanRing"],f=t["Data.Foldable"],l=t["Data.Maybe"],s=t["Data.Ord"],d=t["Data.Semiring"],D=(t["Data.String"],t["Data.String.Common"]),m=(t["Data.String.Pattern"],t["Partial.Unsafe"]);t.Prelude;n.solve=function(t){var n=function(t){var n=o.mapMaybe(e.fromString)(D.split("\n")(D.trim(t))),m=o.drop(1)(n),p=f.foldl(f.foldableArray)(function(t){return function(n){if(t instanceof l.Nothing)return new l.Just(n);if(t instanceof l.Just)return new l.Just(s.min(e.ordBigInt)(t.value0)(n));throw new Error("Failed pattern match at AtCoder.ABC123.C (line 34, column 11 - line 36, column 51): "+[t.constructor.name])}})(l.Nothing.value)(m);return a.bind(i.bindEither)(i.note("minX")(p))(function(t){return r.pure(i.applicativeEither)(e.toString(d.add(e.semiringBigInt)(d.add(e.semiringBigInt)(c.div(e.euclideanRingBigInt)(n[0])(t))(u.notEq(e.eqBigInt)(e.rem(n[0])(t))(d.zero(e.semiringBigInt))?e.fromInt(1):e.fromInt(0)))(e.fromInt(4))))})}(t);if(n instanceof i.Left)return m.unsafeCrashWith(n.value0);if(n instanceof i.Right)return n.value0;throw new Error("Failed pattern match at AtCoder.ABC123.C (line 18, column 3 - line 20, column 24): "+[n.constructor.name])}}(t["AtCoder.ABC123.C"]=t["AtCoder.ABC123.C"]||{}),function(n){"use strict";(t["Effect.Console"]=t["Effect.Console"]||{}).log=function(t){return function(){return console.log(t),{}}}}(),function(n){"use strict";var r=t["Effect.Console"];t["Data.Show"],t["Data.Unit"],t.Effect;n.log=r.log}(t["Effect.Console"]=t["Effect.Console"]||{}),function(n){"use strict";t["Node.Encoding"];var r=t["Data.Show"],a=(t.Prelude,function(){function t(){}return t.value=new t,t}()),o=function(){function t(){}return t.value=new t,t}(),e=function(){function t(){}return t.value=new t,t}(),i=function(){function t(){}return t.value=new t,t}(),u=function(){function t(){}return t.value=new t,t}(),c=function(){function t(){}return t.value=new t,t}(),f=function(){function t(){}return t.value=new t,t}(),l=function(){function t(){}return t.value=new t,t}(),s=new r.Show(function(t){if(t instanceof a)return"ASCII";if(t instanceof o)return"UTF8";if(t instanceof e)return"UTF16LE";if(t instanceof i)return"UCS2";if(t instanceof u)return"Base64";if(t instanceof c)return"Latin1";if(t instanceof f)return"Binary";if(t instanceof l)return"Hex";throw new Error("Failed pattern match at Node.Encoding (line 19, column 1 - line 19, column 39): "+[t.constructor.name])});n.ASCII=a,n.UTF8=o,n.UTF16LE=e,n.UCS2=i,n.Base64=u,n.Latin1=c,n.Binary=f,n.Hex=l,n.showEncoding=s}(t["Node.Encoding"]=t["Node.Encoding"]||{}),function(n){"use strict";(t["Node.FS.Internal"]=t["Node.FS.Internal"]||{}).unsafeRequireFS=require("fs")}(),function(n){"use strict";var r=t["Node.FS.Internal"],a=(t.Effect,t.Prelude,t["Unsafe.Coerce"].unsafeCoerce);n.mkEffect=a,n.unsafeRequireFS=r.unsafeRequireFS}(t["Node.FS.Internal"]=t["Node.FS.Internal"]||{}),function(n){"use strict";t["Control.Bind"],t["Control.Semigroupoid"],t["Data.DateTime"],t["Data.DateTime.Instant"],t["Data.EuclideanRing"],t["Data.Function"],t["Data.Function.Uncurried"],t["Data.Functor"],t["Data.Int"],t["Data.Maybe"],t["Data.Nullable"];var r=t["Data.Show"],a=(t["Data.Time.Duration"],t.Effect,t["Node.Buffer"],t["Node.Encoding"]),o=(t["Node.FS"],t["Node.FS.Internal"]),e=(t["Node.FS.Perms"],t["Node.FS.Stats"],t["Node.Path"],t.Prelude,o.unsafeRequireFS);n.readTextFile=function(t){return function(n){return o.mkEffect(function(o){return e.readFileSync(n,{encoding:r.show(a.showEncoding)(t)})})}}}(t["Node.FS.Sync"]=t["Node.FS.Sync"]||{}),function(n){"use strict";var r=t["AtCoder.ABC123.C"],a=(t["Control.Applicative"],t["Control.Bind"],t.Effect,t["Effect.Console"]),o=t["Node.Encoding"],e=t["Node.FS.Sync"];t.Prelude;n.main=function(){var t=e.readTextFile(o.UTF8.value)("/dev/stdin")(),n=r.solve(t);return a.log(n)()}}(t.Main=t.Main||{}),t.Main.main();
},{"big-integer":"9xaU"}]},{},["Focm"], null)

Measured memory_bytes: 8232