function BigInteger(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function nbi(){return new BigInteger(null)}function am1(e,t,n,i,a,o){for(;--o>=0;){var s=t*this[e++]+n[i]+a;a=Math.floor(s/67108864),n[i++]=67108863&s}return a}function am2(e,t,n,i,a,o){for(var s=32767&t,r=t>>15;--o>=0;){var c=32767&this[e],l=this[e++]>>15,d=r*c+l*s;c=s*c+((32767&d)<<15)+n[i]+(1073741823&a),a=(c>>>30)+(d>>>15)+r*l+(a>>>30),n[i++]=1073741823&c}return a}function am3(e,t,n,i,a,o){for(var s=16383&t,r=t>>14;--o>=0;){var c=16383&this[e],l=this[e++]>>14,d=r*c+l*s;c=s*c+((16383&d)<<14)+n[i]+a,a=(c>>28)+(d>>14)+r*l,n[i++]=268435455&c}return a}function int2char(e){return BI_RM.charAt(e)}function intAt(e,t){var n=BI_RC[e.charCodeAt(t)];return null==n?-1:n}function bnpCopyTo(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function bnpFromInt(e){this.t=1,this.s=0>e?-1:0,e>0?this[0]=e:-1>e?this[0]=e+this.DV:this.t=0}function nbv(e){var t=nbi();return t.fromInt(e),t}function bnpFromString(e,t,n){var i;if(16==t)i=4;else if(8==t)i=3;else if(256==t)i=8;else if(2==t)i=1;else if(32==t)i=5;else{if(4!=t)return void this.fromRadix(e,t);i=2}this.t=0,this.s=0;for(var a=e.length,o=!1,s=0;--a>=0;){var r=8==i?255&e[a]:intAt(e,a);0>r?"-"==e.charAt(a)&&(o=!0):(o=!1,0==s?this[this.t++]=r:s+i>this.DB?(this[this.t-1]|=(r&(1<>this.DB-s):this[this.t-1]|=r<=this.DB&&(s-=this.DB))}8==i&&0!=(128&e[0])&&n&&(this.s=-1,s>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==e;)--this.t}function bnToString(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n,i=(1<0)for(r>r)>0&&(a=!0,o=int2char(n));s>=0;)t>r?(n=(this[s]&(1<>(r+=this.DB-t)):(n=this[s]>>(r-=t)&i,0>=r&&(r+=this.DB,--s)),n>0&&(a=!0),a&&(o+=int2char(n));return a?o:"0"}function bnNegate(){var e=nbi();return BigInteger.ZERO.subTo(this,e),e}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(t=n-e.t,0!=t)return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0}function nbits(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s}function bnpDRShiftTo(e,t){for(var n=e;n=0;--n)t[n+s+1]=this[n]>>a|r,r=(this[n]&o)<=0;--n)t[n]=0;t[s]=r,t.t=this.t+s+1,t.s=this.s,t.clamp()}function bnpRShiftTo(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)return void(t.t=0);var i=e%this.DB,a=this.DB-i,o=(1<>i;for(var s=n+1;s>i;i>0&&(t[this.t-n-1]|=(this.s&o)<n;)i+=this[n]-e[n],t[n++]=i&this.DM,i>>=this.DB;if(e.t>=this.DB;i+=this.s}else{for(i+=this.s;n>=this.DB;i-=e.s}t.s=0>i?-1:0,-1>i?t[n++]=this.DV+i:i>0&&(t[n++]=i),t.t=n,t.clamp()}function bnpMultiplyTo(e,t){var n=this.abs(),i=e.abs(),a=n.t;for(t.t=a+i.t;--a>=0;)t[a]=0;for(a=0;a=0;)e[n]=0;for(n=0;n=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()}function bnpDivRemTo(e,t,n){var i=e.abs();if(!(i.t<=0)){var a=this.abs();if(a.t0?(i.lShiftTo(c,o),a.lShiftTo(c,n)):(i.copyTo(o),a.copyTo(n));var l=o.t,d=o[l-1];if(0!=d){var u=d*(1<1?o[l-2]>>this.F2:0),p=this.FV/u,m=(1<=0&&(n[n.t++]=1,n.subTo(_,n)),BigInteger.ONE.dlShiftTo(l,_),_.subTo(o,o);o.t=0;){var v=n[--g]==d?this.DM:Math.floor(n[g]*p+(n[g-1]+h)*m);if((n[g]+=o.am(0,v,n,f,0,l))0&&n.rShiftTo(c,n),0>s&&BigInteger.ZERO.subTo(n,n)}}}function bnMod(e){var t=nbi();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(BigInteger.ZERO)>0&&e.subTo(t,t),t}function Classic(e){this.m=e}function cConvert(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function cRevert(e){return e}function cReduce(e){e.divRemTo(this.m,null,e)}function cMulTo(e,t,n){e.multiplyTo(t,n),this.reduce(n)}function cSqrTo(e,t){e.squareTo(t),this.reduce(t)}function bnpInvDigit(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return t=t*(2-(15&e)*t)&15,t=t*(2-(255&e)*t)&255,t=t*(2-((65535&e)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function Montgomery(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(t,t),t}function montRevert(e){var t=nbi();return e.copyTo(t),this.reduce(t),t}function montReduce(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(n=t+this.m.t,e[n]+=this.m.am(0,i,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function montSqrTo(e,t){e.squareTo(t),this.reduce(t)}function montMulTo(e,t,n){e.multiplyTo(t,n),this.reduce(n)}function bnpIsEven(){return 0==(this.t>0?1&this[0]:this.s)}function bnpExp(e,t){if(e>4294967295||1>e)return BigInteger.ONE;var n=nbi(),i=nbi(),a=t.convert(this),o=nbits(e)-1;for(a.copyTo(n);--o>=0;)if(t.sqrTo(n,i),(e&1<0)t.mulTo(i,a,n);else{var s=n;n=i,i=s}return t.revert(n)}function bnModPowInt(e,t){var n;return n=256>e||t.isEven()?new Classic(t):new Montgomery(t),this.exp(e,n)}function bnClone(){var e=nbi();return this.copyTo(e),e}function bnIntValue(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<>24}function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}function bnpChunkSize(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function bnSigNum(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function bnpToRadix(e){if(null==e&&(e=10),0==this.signum()||2>e||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),i=nbv(n),a=nbi(),o=nbi(),s="";for(this.divRemTo(i,a,o);a.signum()>0;)s=(n+o.intValue()).toString(e).substr(1)+s,a.divRemTo(i,a,o);return o.intValue().toString(e)+s}function bnpFromRadix(e,t){this.fromInt(0),null==t&&(t=10);for(var n=this.chunkSize(t),i=Math.pow(t,n),a=!1,o=0,s=0,r=0;rc?"-"==e.charAt(r)&&0==this.signum()&&(a=!0):(s=t*s+c,++o>=n&&(this.dMultiply(i),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(s,0)),a&&BigInteger.ZERO.subTo(this,this)}function bnpFromNumber(e,t,n){if("number"==typeof t)if(2>e)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(e-1),op_or,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(BigInteger.ONE.shiftLeft(e-1),this);else{var i=new Array,a=7&e;i.length=(e>>3)+1,t.nextBytes(i),a>0?i[0]&=(1<0)for(a>a)!=(this.s&this.DM)>>a&&(n[o++]=i|this.s<=0;)8>a?(i=(this[t]&(1<>(a+=this.DB-8)):(i=this[t]>>(a-=8)&255,0>=a&&(a+=this.DB,--t)),e&&0!=(128&i)&&(i|=-256),0==o&&(128&this.s)!=(128&i)&&++o,(o>0||i!=this.s)&&(n[o++]=i);return n}function bnEquals(e){return 0==this.compareTo(e)}function bnMin(e){return this.compareTo(e)<0?this:e}function bnMax(e){return this.compareTo(e)>0?this:e}function bnpBitwiseTo(e,t,n){var i,a,o=Math.min(e.t,this.t);for(i=0;o>i;++i)n[i]=t(this[i],e[i]);if(e.te?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function bnShiftRight(e){var t=nbi();return 0>e?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function lbit(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function bnGetLowestSetBit(){for(var e=0;e=this.t?0!=this.s:0!=(this[t]&1<n;)i+=this[n]+e[n],t[n++]=i&this.DM,i>>=this.DB;if(e.t>=this.DB;i+=this.s}else{for(i+=this.s;n>=this.DB;i+=e.s}t.s=0>i?-1:0,i>0?t[n++]=i:-1>i&&(t[n++]=this.DV+i),t.t=n,t.clamp()}function bnAdd(e){var t=nbi();return this.addTo(e,t),t}function bnSubtract(e){var t=nbi();return this.subTo(e,t),t}function bnMultiply(e){var t=nbi();return this.multiplyTo(e,t),t}function bnSquare(){var e=nbi();return this.squareTo(e),e}function bnDivide(e){var t=nbi();return this.divRemTo(e,t,null),t}function bnRemainder(e){var t=nbi();return this.divRemTo(e,null,t),t}function bnDivideAndRemainder(e){var t=nbi(),n=nbi();return this.divRemTo(e,t,n),new Array(t,n)}function bnpDMultiply(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function bnpDAddOffset(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}function NullExp(){}function nNop(e){return e}function nMulTo(e,t,n){e.multiplyTo(t,n)}function nSqrTo(e,t){e.squareTo(t)}function bnPow(e){return this.exp(e,new NullExp)}function bnpMultiplyLowerTo(e,t,n){var i=Math.min(this.t+e.t,t);for(n.s=0,n.t=i;i>0;)n[--i]=0;var a;for(a=n.t-this.t;a>i;++i)n[i+this.t]=this.am(0,e[i],n,i,0,this.t);for(a=Math.min(e.t,t);a>i;++i)this.am(0,e[i],n,i,0,t-i);n.clamp()}function bnpMultiplyUpperTo(e,t,n){--t;var i=n.t=this.t+e.t-t;for(n.s=0;--i>=0;)n[i]=0;for(i=Math.max(t-this.t,0);i2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=nbi();return e.copyTo(t),this.reduce(t),t}function barrettRevert(e){return e}function barrettReduce(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function barrettSqrTo(e,t){e.squareTo(t),this.reduce(t)}function barrettMulTo(e,t,n){e.multiplyTo(t,n),this.reduce(n)}function bnModPow(e,t){var n,i,a=e.bitLength(),o=nbv(1);if(0>=a)return o;n=18>a?1:48>a?3:144>a?4:768>a?5:6,i=8>a?new Classic(t):t.isEven()?new Barrett(t):new Montgomery(t);var s=new Array,r=3,c=n-1,l=(1<1){var d=nbi();for(i.sqrTo(s[1],d);l>=r;)s[r]=nbi(),i.mulTo(d,s[r-2],s[r]),r+=2}var u,p,m=e.t-1,h=!0,g=nbi();for(a=nbits(e[m])-1;m>=0;){for(a>=c?u=e[m]>>a-c&l:(u=(e[m]&(1<0&&(u|=e[m-1]>>this.DB+a-c)),r=n;0==(1&u);)u>>=1,--r;if((a-=r)<0&&(a+=this.DB,--m),h)s[u].copyTo(o),h=!1;else{for(;r>1;)i.sqrTo(o,g),i.sqrTo(g,o),r-=2;r>0?i.sqrTo(o,g):(p=o,o=g,g=p),i.mulTo(g,s[u],o)}for(;m>=0&&0==(e[m]&1<o)return t;for(o>a&&(o=a),o>0&&(t.rShiftTo(o,t),n.rShiftTo(o,n));t.signum()>0;)(a=t.getLowestSetBit())>0&&t.rShiftTo(a,t),(a=n.getLowestSetBit())>0&&n.rShiftTo(a,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n}function bnpModInt(e){if(0>=e)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(0==t)n=this[0]%e;else for(var i=this.t-1;i>=0;--i)n=(t*n+this[i])%e;return n}function bnModInverse(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return BigInteger.ZERO;for(var n=e.clone(),i=this.clone(),a=nbv(1),o=nbv(0),s=nbv(0),r=nbv(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),t?(a.isEven()&&o.isEven()||(a.addTo(this,a),o.subTo(e,o)),a.rShiftTo(1,a)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;i.isEven();)i.rShiftTo(1,i),t?(s.isEven()&&r.isEven()||(s.addTo(this,s),r.subTo(e,r)),s.rShiftTo(1,s)):r.isEven()||r.subTo(e,r),r.rShiftTo(1,r);n.compareTo(i)>=0?(n.subTo(i,n),t&&a.subTo(s,a),o.subTo(r,o)):(i.subTo(n,i),t&&s.subTo(a,s),r.subTo(o,r))}return 0!=i.compareTo(BigInteger.ONE)?BigInteger.ZERO:r.compareTo(e)>=0?r.subtract(e):r.signum()<0?(r.addTo(e,r),r.signum()<0?r.add(e):r):r}function bnIsProbablePrime(e){var t,n=this.abs();if(1==n.t&&n[0]<=lowprimes[lowprimes.length-1]){for(t=0;ti;)i*=lowprimes[a++];for(i=n.modInt(i);a>t;)if(i%lowprimes[t++]==0)return!1}return n.millerRabin(e)}function bnpMillerRabin(e){var t=this.subtract(BigInteger.ONE),n=t.getLowestSetBit();if(0>=n)return!1;var i=t.shiftRight(n);e=e+1>>1,e>lowprimes.length&&(e=lowprimes.length);for(var a=nbi(),o=0;e>o;++o){a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);var s=a.modPow(i,this);if(0!=s.compareTo(BigInteger.ONE)&&0!=s.compareTo(t)){for(var r=1;r++>8&255,rng_pool[rng_pptr++]^=e>>16&255,rng_pool[rng_pptr++]^=e>>24&255,rng_pptr>=rng_psize&&(rng_pptr-=rng_psize)}function rng_seed_time(){rng_seed_int((new Date).getTime())}function rng_get_byte(){if(null==rng_state){for(rng_seed_time(),rng_state=prng_newstate(),rng_state.init(rng_pool),rng_pptr=0;rng_pptrt;++t)this.S[t]=t;for(n=0,t=0;256>t;++t)n=n+this.S[t]+e[t%e.length]&255,i=this.S[t],this.S[t]=this.S[n],this.S[n]=i;this.i=0,this.j=0}function ARC4next(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]}function prng_newstate(){return new Arcfour}function findPrimes(e){var t,n,i,a;for(n=new Array(e),t=0;e>t;t++)n[t]=0;for(n[0]=2,i=0;n[i]t;t+=n[i])n[t]=1;for(i++,n[i]=n[i-1]+1;n[i]t;t++)a[t]=n[t];return a}function millerRabinInt(e,t){return mr_x1.length!=e.length&&(mr_x1=dup(e),mr_r=dup(e),mr_a=dup(e)),copyInt_(mr_a,t),millerRabin(e,mr_a)}function millerRabin(e,t){var n,i,a,o;for(mr_x1.length!=e.length&&(mr_x1=dup(e),mr_r=dup(e),mr_a=dup(e)),copy_(mr_a,t),copy_(mr_r,e),copy_(mr_x1,e),addInt_(mr_r,-1),addInt_(mr_x1,-1),a=0,n=0;n=i&&!equals(mr_a,mr_x1);){if(squareMod_(mr_a,e),equalsInt(mr_a,1))return 0;i++}if(!equals(mr_a,mr_x1))return 0}return 1}function bitSize(e){var t,n,i;for(t=e.length-1;0==e[t]&&t>0;t--);for(n=0,i=e[t];i;i>>=1,n++);return n+=bpe*t}function expand(e,t){var n=int2bigInt(0,(e.length>t?e.length:t)*bpe,0);return copy_(n,e),n}function randTruePrime(e){var t=int2bigInt(0,e,0);return randTruePrime_(t,e),trim(t,1)}function randProbPrime(e){return e>=600?randProbPrimeRounds(e,2):e>=550?randProbPrimeRounds(e,4):e>=500?randProbPrimeRounds(e,5):e>=400?randProbPrimeRounds(e,6):e>=350?randProbPrimeRounds(e,7):e>=300?randProbPrimeRounds(e,9):e>=250?randProbPrimeRounds(e,12):e>=200?randProbPrimeRounds(e,15):e>=150?randProbPrimeRounds(e,18):e>=100?randProbPrimeRounds(e,27):randProbPrimeRounds(e,40)}function randProbPrimeRounds(e,t){var n,i,a,o;for(o=3e4,n=int2bigInt(0,e,0),0==primes.length&&(primes=findPrimes(3e4)),rpprb.length!=n.length&&(rpprb=dup(n));;){for(randBigInt_(n,e,0),n[0]|=1,a=0,i=0;ii&&!a;i++){for(randBigInt_(rpprb,e,0);!greater(n,rpprb);)randBigInt_(rpprb,e,0);millerRabin(n,rpprb)||(a=1)}if(!a)return n}}function mod(e,t){var n=dup(e);return mod_(n,t),trim(n,1)}function addInt(e,t){var n=expand(e,e.length+1);return addInt_(n,t),trim(n,1)}function mult(e,t){var n=expand(e,e.length+t.length);return mult_(n,t),trim(n,1)}function powMod(e,t,n){var i=expand(e,n.length);return powMod_(i,trim(t,2),trim(n,2),0),trim(i,1)}function sub(e,t){var n=expand(e,e.length>t.length?e.length+1:t.length+1);return sub_(n,t),trim(n,1)}function add(e,t){var n=expand(e,e.length>t.length?e.length+1:t.length+1);return add_(n,t),trim(n,1)}function inverseMod(e,t){var n,i=expand(e,t.length);return n=inverseMod_(i,t),n?trim(i,1):null}function multMod(e,t,n){var i=expand(e,n.length);return multMod_(i,t,n),trim(i,1)}function randTruePrime_(e,t){var n,i,a,o,s,r,c,l,d,u,p;if(0==primes.length&&(primes=findPrimes(3e4)),0==pows.length)for(pows=new Array(512),s=0;512>s;s++)pows[s]=Math.pow(2,s/511-1);if(n=.1,i=20,recLimit=20,s_i2.length!=e.length&&(s_i2=dup(e),s_R=dup(e),s_n1=dup(e),s_r2=dup(e),s_d=dup(e),s_x1=dup(e),s_x2=dup(e),s_b=dup(e),s_n=dup(e),s_i=dup(e),s_rm=dup(e),s_q=dup(e),s_a=dup(e),s_aa=dup(e)),t<=recLimit){for(a=(1<<(t+2>>1))-1,copyInt_(e,0),o=1;o;)for(o=0,e[0]=1|1<2*i)for(r=1;i>=t-t*r;)r=pows[Math.floor(512*Math.random())];else r=.5;for(p=Math.floor(r*t)+1,randTruePrime_(s_q,p),copyInt_(s_i2,0),s_i2[Math.floor((t-2)/bpe)]|=1<<(t-2)%bpe,divide_(s_i2,s_q,s_i,s_rm),d=bitSize(s_i);;){for(;randBigInt_(s_R,d,0),!greater(s_i,s_R););for(addInt_(s_R,1),add_(s_R,s_i),copy_(s_n,s_q),mult_(s_n,s_R),multInt_(s_n,2),addInt_(s_n,1),copy_(s_r2,s_R),multInt_(s_r2,2),l=0,s=0;s0;s--);for(u=0,w=s_n[s];w;w>>=1,u++);for(u+=bpe*s;randBigInt_(s_a,u,0),!greater(s_n,s_a););if(addInt_(s_n,3),addInt_(s_a,2),copy_(s_b,s_a),copy_(s_n1,s_n),addInt_(s_n1,-1),powMod_(s_b,s_n1,s_n),addInt_(s_b,-1),isZero(s_b)&&(copy_(s_b,s_a),powMod_(s_b,s_r2,s_n),addInt_(s_b,-1),copy_(s_aa,s_n),copy_(s_d,s_b),GCD_(s_d,s_n),equalsInt(s_d,1)))return void copy_(e,s_aa)}}}function randBigInt(e,t){var n,i;return n=Math.floor((e-1)/bpe)+2,i=int2bigInt(0,0,n),randBigInt_(i,e,t),i}function randBigInt_(e,t,n){var i,a;for(i=0;ii;i++)e[i]=Math.floor(Math.random()*(1<=0;i--);for(a=e[i],o=n[i],s=1,r=0,c=0,l=1;o+c&&o+l&&(d=Math.floor((a+s)/(o+c)),qp=Math.floor((a+r)/(o+l)),d==qp);)t=s-d*c,s=c,c=t,t=r-d*l,r=l,l=t,t=a-d*o,a=o,o=t;r?(copy_(T,e),linComb_(e,n,s,r),linComb_(n,T,l,c)):(mod_(e,n),copy_(T,e),copy_(e,n),copy_(n,T))}if(0!=n[0])for(t=modInt(e,n[0]),copyInt_(e,n[0]),n[0]=t;n[0];)e[0]%=n[0],t=e[0],e[0]=n[0],n[0]=t}function inverseMod_(e,t){var n=1+2*Math.max(e.length,t.length);if(!(1&e[0]||1&t[0]))return copyInt_(e,0),0;for(eg_u.length!=n&&(eg_u=new Array(n),eg_v=new Array(n),eg_A=new Array(n),eg_B=new Array(n),eg_C=new Array(n),eg_D=new Array(n)),copy_(eg_u,e),copy_(eg_v,t),copyInt_(eg_A,1),copyInt_(eg_B,0),copyInt_(eg_C,0),copyInt_(eg_D,1);;){for(;!(1&eg_u[0]);)halve_(eg_u),1&eg_A[0]||1&eg_B[0]?(add_(eg_A,t),halve_(eg_A),sub_(eg_B,e),halve_(eg_B)):(halve_(eg_A),halve_(eg_B));for(;!(1&eg_v[0]);)halve_(eg_v),1&eg_C[0]||1&eg_D[0]?(add_(eg_C,t),halve_(eg_C),sub_(eg_D,e),halve_(eg_D)):(halve_(eg_C),halve_(eg_D));if(greater(eg_v,eg_u)?(sub_(eg_v,eg_u),sub_(eg_C,eg_A),sub_(eg_D,eg_B)):(sub_(eg_u,eg_v),sub_(eg_A,eg_C),sub_(eg_B,eg_D)),equalsInt(eg_u,0)){for(;negative(eg_C);)add_(eg_C,t);return copy_(e,eg_C),equalsInt(eg_v,1)?1:(copyInt_(e,0),0)}}}function inverseModInt(e,t){for(var n=1,i=0;;){if(1==e)return n;if(0==e)return 0;if(i-=n*Math.floor(t/e),t%=e,1==t)return i;if(0==t)return 0;n-=i*Math.floor(e/t),e%=t}}function inverseModInt_(e,t){return inverseModInt(e,t)}function eGCD_(e,t,n,i,a){var o=0,s=Math.max(e.length,t.length);for(eg_u.length!=s&&(eg_u=new Array(s),eg_A=new Array(s),eg_B=new Array(s),eg_C=new Array(s),eg_D=new Array(s));!(1&e[0]||1&t[0]);)halve_(e),halve_(t),o++;for(copy_(eg_u,e),copy_(n,t),copyInt_(eg_A,1),copyInt_(eg_B,0),copyInt_(eg_C,0),copyInt_(eg_D,1);;){for(;!(1&eg_u[0]);)halve_(eg_u),1&eg_A[0]||1&eg_B[0]?(add_(eg_A,t),halve_(eg_A),sub_(eg_B,e),halve_(eg_B)):(halve_(eg_A),halve_(eg_B));for(;!(1&n[0]);)halve_(n),1&eg_C[0]||1&eg_D[0]?(add_(eg_C,t),halve_(eg_C),sub_(eg_D,e),halve_(eg_D)):(halve_(eg_C),halve_(eg_D));if(greater(n,eg_u)?(sub_(n,eg_u),sub_(eg_C,eg_A),sub_(eg_D,eg_B)):(sub_(eg_u,n),sub_(eg_A,eg_C),sub_(eg_B,eg_D)),equalsInt(eg_u,0)){for(;negative(eg_C);)add_(eg_C,t),sub_(eg_D,e);return multInt_(eg_D,-1),copy_(i,eg_C),copy_(a,eg_D),void leftShift_(n,o)}}}function negative(e){return e[e.length-1]>>bpe-1&1}function greaterShift(e,t,n){var i,a=e.length,o=t.length;for(k=o>a+n?a+n:o,i=o-1-n;a>i&&i>=0;i++)if(e[i]>0)return 1;for(i=a-1+n;o>i;i++)if(t[i]>0)return 0;for(i=k-1;i>=n;i--){if(e[i-n]>t[i])return 1;if(e[i-n]=0;n--){if(e[n]>t[n])return 1;if(e[n]>=1;for(d=bpe-d,leftShift_(t,d),leftShift_(i,d),a=i.length;0==i[a-1]&&a>o;a--);for(copyInt_(n,0);!greaterShift(t,i,a-o);)subShift_(i,t,a-o),n[a-o]++;for(s=a-1;s>=o;s--){for(n[s-o]=i[s]==t[o-1]?mask:Math.floor((i[s]*radix+i[s-1])/t[o-1]);c=(o>1?t[o-2]:0)*n[s-o],l=c>>bpe,c&=mask,r=l+n[s-o]*t[o-1],l=r>>bpe,r&=mask,l==i[s]?r==i[s-1]?c>(s>1?i[s-2]:0):r>i[s-1]:l>i[s];)n[s-o]--;linCombShift_(i,t,-n[s-o],s-o),negative(i)&&(addShift_(i,t,s-o),n[s-o]--)}rightShift_(t,d),rightShift_(i,d)}function carry_(e){var t,n,i,a;for(n=e.length,i=0,t=0;n>t;t++)i+=e[t],a=0,0>i&&(a=-(i>>bpe),i+=a*radix),e[t]=i&mask,i=(i>>bpe)-a}function modInt(e,t){var n,i=0;for(n=e.length-1;n>=0;n--)i=(i*radix+e[n])%t;return i}function int2bigInt(e,t,n){var i;return i=Math.ceil(t/bpe)+1,i=n>i?n:i,buff=new Array(i),copyInt_(buff,e),buff}function str2bigInt(e,t,n){var i,a,o,s,r,c=e.length;if(-1==t){for(o=new Array(0);;){for(s=new Array(o.length+1),a=0;ai)break;if(e=e.substring(i+1),0==e.length)break}return o.lengtha&&(i=digitsStr.indexOf(e.substring(a,a+1),0),36>=t&&i>=36&&(i-=26),!(i>=t||0>i));a++)multInt_(o,t),addInt_(o,i);for(c=o.length;c>0&&!o[c-1];c--);for(c=n>c+1?n:c+1,s=new Array(c),r=ca;a++)s[a]=o[a];for(;c>a;a++)s[a]=0;return s}function equalsInt(e,t){var n;if(e[0]!=t)return 0;for(n=1;nn;n++)if(e[n]!=t[n])return 0;if(e.length>t.length){for(;n0;n--)a+=e[n]+",";a+=e[0]}else for(;!isZero(s6);)i=divInt_(s6,t),a=digitsStr.substring(i,i+1)+a;return 0==a.length&&(a="0"),a}function dup(e){return buff=new Array(e.length),copy_(buff,e),buff}function copy_(e,t){var n,i=e.lengthn;n++)e[n]=t[n];for(n=i;n>=bpe}function addInt_(e,t){var n,i,a,o;for(e[0]+=t,i=e.length,a=0,n=0;i>n;n++)if(a+=e[n],o=0,0>a&&(o=-(a>>bpe),a+=o*radix),e[n]=a&mask,a=(a>>bpe)-o,!a)return}function rightShift_(e,t){var n,i=Math.floor(t/bpe);if(i){for(n=0;n>t);e[n]>>=t}function halve_(e){var t;for(t=0;t>1);e[t]=e[t]>>1|e[t]&radix>>1}function leftShift_(e,t){var n,i=Math.floor(t/bpe);if(i){for(n=e.length;n>=i;n--)e[n]=e[n-i];for(;n>=0;n--)e[n]=0;t%=bpe}if(t){for(n=e.length-1;n>0;n--)e[n]=mask&(e[n]<>bpe-t);e[n]=mask&e[n]<n;n++)a+=e[n]*t,o=0,0>a&&(o=-(a>>bpe),a+=o*radix),e[n]=a&mask,a=(a>>bpe)-o}function divInt_(e,t){var n,i,a=0;for(n=e.length-1;n>=0;n--)i=a*radix+e[n],e[n]=Math.floor(i/t),a=i%t;return a}function linComb_(e,t,n,i){var a,o,s,r;for(s=e.lengtha;a++)o+=n*e[a]+i*t[a],e[a]=o&mask,o>>=bpe;for(a=s;r>a;a++)o+=n*e[a],e[a]=o&mask,o>>=bpe}function linCombShift_(e,t,n,i){var a,o,s,r;for(s=e.lengtha;a++)o+=e[a]+n*t[a-i],e[a]=o&mask,o>>=bpe;for(a=s;o&&r>a;a++)o+=e[a],e[a]=o&mask,o>>=bpe}function addShift_(e,t,n){var i,a,o,s;for(o=e.lengthi;i++)a+=e[i]+t[i-n],e[i]=a&mask,a>>=bpe;for(i=o;a&&s>i;i++)a+=e[i],e[i]=a&mask,a>>=bpe}function subShift_(e,t,n){var i,a,o,s;for(o=e.lengthi;i++)a+=e[i]-t[i-n],e[i]=a&mask,a>>=bpe;for(i=o;a&&s>i;i++)a+=e[i],e[i]=a&mask,a>>=bpe}function sub_(e,t){var n,i,a;for(a=e.lengthn;n++)i+=e[n]-t[n],e[n]=i&mask,i>>=bpe;for(n=a;i&&n>=bpe}function add_(e,t){var n,i,a;for(a=e.lengthn;n++)i+=e[n]+t[n],e[n]=i&mask,i>>=bpe;for(n=a;i&&n>=bpe}function mult_(e,t){var n;for(ss.length!=2*e.length&&(ss=new Array(2*e.length)),copyInt_(ss,0),n=0;n0&&!e[o-1];o--);for(s=o>t.length?2*o:2*t.length,s0.length!=s&&(s0=new Array(s)),copyInt_(s0,0),n=0;o>n;n++){for(a=s0[2*n]+e[n]*e[n],s0[2*n]=a&mask,a>>=bpe,i=n+1;o>i;i++)a=s0[n+i]+2*e[n]*e[i]+a,s0[n+i]=a&mask,a>>=bpe;s0[n+o]=a}mod_(s0,t),copy_(e,s0)}function trim(e,t){var n,i;for(n=e.length;n>0&&!e[n-1];n--);return i=new Array(n+t),copy_(i,e),i}function powMod_(e,t,n){var i,a,o,s;if(s7.length!=n.length&&(s7=dup(n)),0!=(1&n[0])){for(copyInt_(s7,0),o=n.length;o>0&&!n[o-1];o--);for(s=radix-inverseModInt(modInt(n,radix),radix),s7[o]=1,multMod_(e,s7,n),s3.length!=e.length?s3=dup(e):copy_(s3,e),i=t.length-1;i>0&!t[i];i--);if(0==t[i])return void copyInt_(e,1);for(a=1<>=1);for(;;){if(!(a>>=1)){if(i--,0>i)return void mont_(e,one,n,s);a=1<0&&0==n[d-1];d--);for(;u>0&&0==t[u-1];u--);for(l=sa.length-1,a=0;d>a;a++){for(c=sa[0]+e[a]*t[0],r=(c&mask)*i&mask,s=c+r*n[0]>>bpe,c=e[a],o=1;u-4>o;)s+=sa[o]+r*n[o]+c*t[o],sa[o-1]=s&mask,s>>=bpe,o++,s+=sa[o]+r*n[o]+c*t[o],sa[o-1]=s&mask,s>>=bpe,o++,s+=sa[o]+r*n[o]+c*t[o],sa[o-1]=s&mask,s>>=bpe,o++,s+=sa[o]+r*n[o]+c*t[o],sa[o-1]=s&mask,s>>=bpe,o++,s+=sa[o]+r*n[o]+c*t[o],sa[o-1]=s&mask,s>>=bpe,o++;for(;u>o;)s+=sa[o]+r*n[o]+c*t[o],sa[o-1]=s&mask,s>>=bpe,o++;for(;d-4>o;)s+=sa[o]+r*n[o],sa[o-1]=s&mask,s>>=bpe,o++,s+=sa[o]+r*n[o],sa[o-1]=s&mask,s>>=bpe,o++,s+=sa[o]+r*n[o],sa[o-1]=s&mask,s>>=bpe,o++,s+=sa[o]+r*n[o],sa[o-1]=s&mask,s>>=bpe,o++,s+=sa[o]+r*n[o],sa[o-1]=s&mask,s>>=bpe,o++;for(;d>o;)s+=sa[o]+r*n[o],sa[o-1]=s&mask,s>>=bpe,o++;for(;l>o;)s+=sa[o],sa[o-1]=s&mask,s>>=bpe,o++;sa[o-1]=s&mask}greater(n,sa)||sub_(sa,n),copy_(e,sa)}function dT(){return"["+(((new Date).getTime()-_logTimer)/1e3).toFixed(3)+"]"}function checkClick(e,t){return 1==e.which&&(e.ctrlKey||e.metaKey)||2==e.which?!0:(t||e.preventDefault(),!1)}function checkDragEvent(e){if(!e||e.target&&("IMG"==e.target.tagName||"A"==e.target.tagName))return!1;if(!e.dataTransfer||!e.dataTransfer.types)return!0;for(var t=0;t/g,">")}function calcImageInBox(e,t,n,i,a){var o=n,s=i;return e/t>n/i?s=parseInt(t*n/e):(o=parseInt(e*i/t),o>n&&(s=parseInt(s*n/o),o=n)),a&&o>=e&&s>=t&&(o=e,s=t),{w:o,h:s}}function versionCompare(e,t){"string"!=typeof e&&(e=""),"string"!=typeof t&&(t=""),e=e.replace(/^\s+|\s+$/g,"").split("."),t=t.replace(/^\s+|\s+$/g,"").split(".");var n,i=Math.max(e.length,t.length);for(n=0;i>n;n++)if(e[n]!=t[n])return e[n]>t[n]?1:-1;return 0}function bigint(e){return new BigInteger(e.toString(16),16)}function bigStringInt(e){return new BigInteger(e,10)}function dHexDump(e){for(var t=[],n=0;nt;t+=2)a.push(parseInt(e.substr(t,2),16));return a}function bytesToBase64(e){for(var t,n="",i=e.length,a=0,o=0;i>o;o++)t=o%3,a|=e[o]<<(16>>>t&24),(2===t||i-o===1)&&(n+=String.fromCharCode(uint6ToBase64(a>>>18&63),uint6ToBase64(a>>>12&63),uint6ToBase64(a>>>6&63),uint6ToBase64(63&a)),a=0);return n.replace(/A(?=A$|$)/g,"=")}function uint6ToBase64(e){return 26>e?e+65:52>e?e+71:62>e?e-4:62===e?43:63===e?47:65}function base64ToBlob(e,t){for(var n=1024,i=atob(e),a=i.length,o=Math.ceil(a/n),s=new Array(o),r=0;o>r;++r){for(var c=r*n,l=Math.min(c+n,a),d=new Array(l-c),u=c,p=0;l>u;++p,++u)d[p]=i[u].charCodeAt(0);s[r]=new Uint8Array(d)}return blobConstruct(s,t)}function dataUrlToBlob(e){var t=e.split(","),n=t[1],i=t[0].split(":")[1].split(";")[0],a=base64ToBlob(n,i);return a}function blobConstruct(e,t){var n;try{n=new Blob(e,{type:t})}catch(i){var a=new BlobBuilder;angular.forEach(e,function(e){a.append(e)}),n=a.getBlob(t)}return n}function bytesCmp(e,t){var n=e.length;if(n!=t.length)return!1;for(var i=0;n>i;i++)if(e[i]!=t[i])return!1;return!0}function bytesXor(e,t){for(var n=e.length,i=[],a=0;n>a;++a)i[a]=e[a]^t[a];return i}function bytesToWords(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var t,n=e.length,i=[];for(t=0;n>t;t++)i[t>>>2]|=e[t]<<24-t%4*8;return new CryptoJS.lib.WordArray.init(i,n)}function bytesFromWords(e){for(var t=e.words,n=e.sigBytes,i=[],a=0;n>a;a++)i.push(t[a>>>2]>>>24-a%4*8&255);return i}function bytesFromBigInt(e,t){var n=e.toByteArray();if(t&&n.lengtha;a++)i[a]=0;n=n instanceof ArrayBuffer?bufferConcat(i,n):i.concat(n)}else for(;!n[0]&&(!t||n.length>t);)n=n.slice(1);return n}function bytesFromLeemonBigInt(e){var t=bigInt2str(e,16);return bytesFromHex(t)}function bytesToArrayBuffer(e){return new Uint8Array(e).buffer}function convertToArrayBuffer(e){return e instanceof ArrayBuffer?e:void 0!==e.buffer&&e.buffer.byteLength==e.length*e.BYTES_PER_ELEMENT?e.buffer:bytesToArrayBuffer(e)}function convertToUint8Array(e){return void 0!==e.buffer?e:new Uint8Array(e)}function convertToByteArray(e){if(Array.isArray(e))return e;e=convertToUint8Array(e);for(var t=[],n=0,i=e.length;i>n;n++)t.push(e[n]);return t}function bytesFromArrayBuffer(e){for(var t=e.byteLength,n=new Uint8Array(e),i=[],a=0;t>a;++a)i[a]=n[a];return i}function bufferConcat(e,t){var n=e.byteLength||e.length,i=t.byteLength||t.length,a=new Uint8Array(n+i);return a.set(e instanceof ArrayBuffer?new Uint8Array(e):e,0),a.set(t instanceof ArrayBuffer?new Uint8Array(t):t,n),a.buffer}function longToInts(e){var t=bigStringInt(e).divideAndRemainder(bigint(4294967296));return[t[0].intValue(),t[1].intValue()]}function longToBytes(e){return bytesFromWords({words:longToInts(e),sigBytes:8}).reverse()}function longFromInts(e,t){return bigint(e).shiftLeft(32).add(bigint(t)).toString(10)}function intToUint(e){return e=parseInt(e),0>e&&(e+=4294967296),e}function uintToInt(e){return e>2147483647&&(e-=4294967296),e}function sha1HashSync(e){this.rushaInstance=this.rushaInstance||new Rusha(1048576);var t=rushaInstance.rawDigest(e).buffer;return t}function sha1BytesSync(e){return bytesFromArrayBuffer(sha1HashSync(e))}function sha256HashSync(e){var t=CryptoJS.SHA256(bytesToWords(e)),n=bytesFromWords(t);return n}function rsaEncrypt(e,t){t=addPadding(t,255);var n=new BigInteger(e.modulus,16),i=new BigInteger(e.exponent,16),a=new BigInteger(t),o=a.modPowInt(i,n),s=bytesFromBigInt(o,256);return s}function addPadding(e,t,n){t=t||16;var i=e.byteLength||e.length,a=t-i%t;if(a>0&&t>a){var o=new Array(a);if(n)for(var s=0;a>s;s++)o[s]=0;else(new SecureRandom).nextBytes(o);e=e instanceof ArrayBuffer?bufferConcat(e,o):e.concat(o)}return e}function aesEncryptSync(e,t,n){e.byteLength||e.length;e=addPadding(e);var i=CryptoJS.AES.encrypt(bytesToWords(e),bytesToWords(t),{iv:bytesToWords(n),padding:CryptoJS.pad.NoPadding,mode:CryptoJS.mode.IGE}).ciphertext,a=bytesFromWords(i);return a}function aesDecryptSync(e,t,n){var i=CryptoJS.AES.decrypt({ciphertext:bytesToWords(e)},bytesToWords(t),{iv:bytesToWords(n),padding:CryptoJS.pad.NoPadding,mode:CryptoJS.mode.IGE}),a=bytesFromWords(i);return a}function gzipUncompress(e){var t=new Zlib.Gunzip(e).decompress();return t}function nextRandomInt(e){return Math.floor(Math.random()*e)}function pqPrimeFactorization(e){var t=new BigInteger(e),n=!1;try{n=pqPrimeLeemon(str2bigInt(t.toString(16),16,Math.ceil(64/bpe)+1))}catch(i){console.error("Pq leemon Exception",i)}if(n===!1&&t.bitLength()<=64)try{n=pqPrimeLong(goog.math.Long.fromString(t.toString(16),16))}catch(i){console.error("Pq long Exception",i)}return n===!1&&(n=pqPrimeBigInteger(t)),n}function pqPrimeBigInteger(e){for(var t,n=0,i=0;3>i;i++){for(var a=(15&nextRandomInt(128))+17,o=bigint(nextRandomInt(1e9)+1),s=o.clone(),r=1<c;c++){++n;for(var l=o.clone(),d=o.clone(),u=bigint(a);!d.equals(BigInteger.ZERO);)d.and(BigInteger.ONE).equals(BigInteger.ZERO)||(u=u.add(l),u.compareTo(e)>0&&(u=u.subtract(e))),l=l.add(l),l.compareTo(e)>0&&(l=l.subtract(e)),d=d.shiftRight(1);o=u.clone();var p=o.compareTo(s)<0?s.subtract(o):o.subtract(s);if(t=p.gcd(e),!t.equals(BigInteger.ONE))break;0==(c&c-1)&&(s=o.clone())}if(t.compareTo(BigInteger.ONE)>0)break}var m,h,g=e.divide(t);return t.compareTo(g)>0?(m=g,h=t):(m=t,h=g),[bytesFromBigInt(m),bytesFromBigInt(h),n]}function gcdLong(e,t){for(;e.notEquals(goog.math.Long.ZERO)&&t.notEquals(goog.math.Long.ZERO);){for(;t.and(goog.math.Long.ONE).equals(goog.math.Long.ZERO);)t=t.shiftRight(1);for(;e.and(goog.math.Long.ONE).equals(goog.math.Long.ZERO);)e=e.shiftRight(1);e.compare(t)>0?e=e.subtract(t):t=t.subtract(e)}return t.equals(goog.math.Long.ZERO)?e:t}function pqPrimeLong(e){for(var t,n=0,i=0;3>i;i++){for(var a=goog.math.Long.fromInt((15&nextRandomInt(128))+17),o=goog.math.Long.fromInt(nextRandomInt(1e9)+1),s=o,r=1<c;c++){++n;for(var l=o,d=o,u=a;d.notEquals(goog.math.Long.ZERO);)d.and(goog.math.Long.ONE).notEquals(goog.math.Long.ZERO)&&(u=u.add(l),u.compare(e)>0&&(u=u.subtract(e))),l=l.add(l),l.compare(e)>0&&(l=l.subtract(e)),d=d.shiftRight(1);o=u;var p=o.compare(s)<0?s.subtract(o):o.subtract(s);if(t=gcdLong(p,e),t.notEquals(goog.math.Long.ONE))break;0==(c&c-1)&&(s=o)}if(t.compare(goog.math.Long.ONE)>0)break}var m,h,g=e.div(t);return t.compare(g)>0?(m=g,h=t):(m=t,h=g),[bytesFromHex(m.toString(16)),bytesFromHex(h.toString(16)),n]}function pqPrimeLeemon(e){var t,n,i,a,o,s,r,c=64,l=Math.ceil(c/bpe)+1,d=0,u=new Array(l),p=new Array(l),m=new Array(l),o=new Array(l),h=new Array(l),g=new Array(l),f=new Array(l);for(t=0;3>t;t++){for(n=(15&nextRandomInt(128))+17,copyInt_(g,nextRandomInt(1e9)+1),copy_(f,g),a=1<i;i++){for(++d,copy_(u,g),copy_(p,g),copyInt_(m,n);!isZero(p);)1&p[0]&&(add_(m,u),greater(m,e)&&sub_(m,e)),add_(u,u),greater(u,e)&&sub_(u,e),rightShift_(p,1);if(copy_(g,m),greater(g,f)?(copy_(h,g),sub_(h,f)):(copy_(h,f),sub_(h,g)),eGCD_(h,e,o,u,p),!equalsInt(o,1))break;0==(i&i-1)&©_(f,g)}if(greater(o,one))break}return divide_(e,o,g,f),greater(o,g)?(s=g,r=o):(s=o,r=g),[bytesFromLeemonBigInt(s),bytesFromLeemonBigInt(r),d]}function bytesModPow(e,t,n){try{var i=str2bigInt(bytesToHex(e),16),a=str2bigInt(bytesToHex(t),16),o=str2bigInt(bytesToHex(n),16),s=powMod(i,a,o);return bytesFromHex(bigInt2str(s,16))}catch(r){console.error("mod pow error",r)}return bytesFromBigInt(new BigInteger(e).modPow(new BigInteger(t),new BigInteger(n)),256)}function TLSerialization(e){return e=e||{},this.maxLength=e.startMaxLength||2048,this.offset=0,this.createBuffer(),this.mtproto=e.mtproto||!1,this}function TLDeserialization(e,t){return t=t||{},this.offset=0,this.override=t.override||{},this.buffer=e,this.intView=new Uint32Array(this.buffer),this.byteView=new Uint8Array(this.buffer),this.mtproto=t.mtproto||!1,this}function EmojiTooltip(e,t){t=t||{};var n=this;this.btnEl=$(e),this.onEmojiSelected=t.onEmojiSelected,this.onStickerSelected=t.onStickerSelected,this.getStickers=t.getStickers,Config.Navigator.touch||$(this.btnEl).on("mouseenter mouseleave",function(e){n.isOverBtn="mouseenter"==e.type,n.createTooltip(),n.isOverBtn?n.onMouseEnter(!0):n.onMouseLeave(!0)}),$(this.btnEl).on("mousedown",function(e){return n.shown?(clearTimeout(n.hideTimeout),delete n.hideTimeout,n.hide()):(clearTimeout(n.showTimeout),delete n.showTimeout,n.createTooltip(),n.show()),cancelEvent(e)}),$(document).on("mousedown",function(){n.shown&&n.hide()})}function EmojiPanel(e,t){t=t||{};var n=this;this.containerEl=$(e),this.onEmojiSelected=t.onEmojiSelected,this.containerEl.on("mousedown",function(e){e=e.originalEvent||e;var t,i=$(e.target);return"A"!=i[0].tagName&&(i=$(i[0].parentNode)),(t=i.attr("data-code"))&&(n.onEmojiSelected&&n.onEmojiSelected(t),EmojiHelper.pushPopularEmoji(t)),cancelEvent(e)}),this.update()}function MessageComposer(e,t){this.textareaEl=$(e),this.setUpInput(),this.autoCompleteEl=$('').appendTo(document.body);var n=this;this.autoCompleteEl.on("mousedown",function(e){e=e.originalEvent||e;var t,i,a=$(e.target);return"A"!=a[0].tagName&&(a=$(a[0].parentNode)),(i=a.attr("data-code"))&&(n.onEmojiSelected&&n.onEmojiSelected(i,!0),EmojiHelper.pushPopularEmoji(i)),(t=a.attr("data-mention"))&&n.onMentionSelected&&n.onMentionSelected(t),cancelEvent(e)}),this.isActive=!1,this.onTyping=t.onTyping,this.onMessageSubmit=t.onMessageSubmit,this.getSendOnEnter=t.getSendOnEnter,this.onFilePaste=t.onFilePaste,this.mentions=t.mentions,this.getPeerImage=t.getPeerImage}!function(e){"use strict";e.console=e.console||{};for(var t,n,i=e.console,a={},o=function(){},s="memory".split(","),r="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");t=s.pop();)i[t]||(i[t]=a);for(;n=r.pop();)i[n]||(i[n]=o)}("undefined"==typeof window?this:window),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var n;if(null==this)throw new TypeError('"this" is null or not defined');var i=Object(this),a=i.length>>>0;if(0===a)return-1;var o=+t||0;if(1/0===Math.abs(o)&&(o=0),o>=a)return-1;for(n=Math.max(o>=0?o:a-Math.abs(o),0);a>n;){if(n in i&&i[n]===e)return n;n++}return-1}),Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),"function"!=typeof Object.create&&(Object.create=function(){var e=function(){};return function(t){if(arguments.length>1)throw Error("Second argument not supported");if("object"!=typeof t)throw TypeError("Argument must be an object");e.prototype=t;var n=new e;return e.prototype=null,n}}()),Function.prototype.bind||(Function.prototype.bind=function(e){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),n=this,i=function(){},a=function(){return n.apply(this instanceof i&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};return i.prototype=this.prototype,a.prototype=new i,a}),function(e){function t(t){i.push(t),e.postMessage(a,"*")}function n(t){if(t.source==e&&t.data==a&&(t.stopPropagation(),i.length>0)){var n=i.shift();n()}}var i=[],a="zero-timeout-message";e.addEventListener("message",n,!0);var o=e.setTimeout;e.setTimeout=function(e,n){return!n||5>=n?t(e):o(e,n)},e.setZeroTimeout=t}(this),!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=e.length,n=at.type(e);return"function"===n||at.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function i(e,t,n){if(at.isFunction(t))return at.grep(e,function(e,i){return!!t.call(e,i,e)!==n});if(t.nodeType)return at.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(pt.test(t))return at.filter(t,e,n);t=at.filter(t,e)}return at.grep(e,function(e){return at.inArray(e,t)>=0!==n})}function a(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function o(e){var t=bt[e]={};return at.each(e.match(yt)||[],function(e,n){t[n]=!0}),t}function s(){ht.addEventListener?(ht.removeEventListener("DOMContentLoaded",r,!1),e.removeEventListener("load",r,!1)):(ht.detachEvent("onreadystatechange",r),e.detachEvent("onload",r))}function r(){(ht.addEventListener||"load"===event.type||"complete"===ht.readyState)&&(s(),at.ready())}function c(e,t,n){if(void 0===n&&1===e.nodeType){var i="data-"+t.replace(Ct,"-$1").toLowerCase();if(n=e.getAttribute(i),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:St.test(n)?at.parseJSON(n):n}catch(a){}at.data(e,t,n)}else n=void 0}return n}function l(e){var t;for(t in e)if(("data"!==t||!at.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function d(e,t,n,i){if(at.acceptData(e)){var a,o,s=at.expando,r=e.nodeType,c=r?at.cache:e,l=r?e[s]:e[s]&&s;if(l&&c[l]&&(i||c[l].data)||void 0!==n||"string"!=typeof t)return l||(l=r?e[s]=K.pop()||at.guid++:s),c[l]||(c[l]=r?{}:{toJSON:at.noop}),("object"==typeof t||"function"==typeof t)&&(i?c[l]=at.extend(c[l],t):c[l].data=at.extend(c[l].data,t)),o=c[l],i||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[at.camelCase(t)]=n),"string"==typeof t?(a=o[t],null==a&&(a=o[at.camelCase(t)])):a=o,a}}function u(e,t,n){if(at.acceptData(e)){var i,a,o=e.nodeType,s=o?at.cache:e,r=o?e[at.expando]:at.expando;if(s[r]){if(t&&(i=n?s[r]:s[r].data)){at.isArray(t)?t=t.concat(at.map(t,at.camelCase)):t in i?t=[t]:(t=at.camelCase(t),t=t in i?[t]:t.split(" ")),a=t.length;for(;a--;)delete i[t[a]];if(n?!l(i):!at.isEmptyObject(i))return}(n||(delete s[r].data,l(s[r])))&&(o?at.cleanData([e],!0):nt.deleteExpando||s!=s.window?delete s[r]:s[r]=null)}}}function p(){return!0}function m(){return!1}function h(){try{return ht.activeElement}catch(e){}}function g(e){var t=Ot.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function f(e,t){var n,i,a=0,o=typeof e.getElementsByTagName!==kt?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==kt?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(i=n[a]);a++)!t||at.nodeName(i,t)?o.push(i):at.merge(o,f(i,t));return void 0===t||t&&at.nodeName(e,t)?at.merge([e],o):o}function _(e){Tt.test(e.type)&&(e.defaultChecked=e.checked)}function v(e,t){return at.nodeName(e,"table")&&at.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function y(e){return e.type=(null!==at.find.attr(e,"type"))+"/"+e.type,e}function b(e){var t=Gt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function w(e,t){for(var n,i=0;null!=(n=e[i]);i++)at._data(n,"globalEval",!t||at._data(t[i],"globalEval"))}function $(e,t){if(1===t.nodeType&&at.hasData(e)){var n,i,a,o=at._data(e),s=at._data(t,o),r=o.events;if(r){delete s.handle,s.events={};for(n in r)for(i=0,a=r[n].length;a>i;i++)at.event.add(t,n,r[n][i])}s.data&&(s.data=at.extend({},s.data))}}function k(e,t){var n,i,a;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!nt.noCloneEvent&&t[at.expando]){a=at._data(t);for(i in a.events)at.removeEvent(t,i,a.handle);t.removeAttribute(at.expando)}"script"===n&&t.text!==e.text?(y(t).text=e.text,b(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),nt.html5Clone&&e.innerHTML&&!at.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Tt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function S(t,n){var i,a=at(n.createElement(t)).appendTo(n.body),o=e.getDefaultComputedStyle&&(i=e.getDefaultComputedStyle(a[0]))?i.display:at.css(a[0],"display");return a.detach(),o}function C(e){var t=ht,n=Qt[e];return n||(n=S(e,t),"none"!==n&&n||(Jt=(Jt||at("