@swtc/rpc
Version:
swtc lib rpc
2 lines • 474 kB
JavaScript
/*! For license information please see swtc-rpc.js.LICENSE.txt */
var swtc_rpc;(()=>{var t={6823(t,e,r){var n=e;n.Signature=r(9297),n.sm2=r(7521),n.sm3=r(9634),n.version=r(3164).rE},9297(t,e,r){"use strict";var n=r(2823),i=r(9042),o=r(7784);function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function u(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=e.place;o<n;o++,s++)i<<=8,i|=t[s],i>>>=0;return!(i<=127)&&(e.place=s,i)}function f(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function c(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=s,s.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;var o=u(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var s=u(t,r);if(!1===s)return!1;var f=t.slice(r.place,s+r.place);if(r.place+=s,2!==t[r.place++])return!1;var c=u(t,r);if(!1===c)return!1;if(t.length!==c+r.place)return!1;var h=t.slice(r.place,c+r.place);if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new n(f),this.s=new n(h),this.recoveryParam=null,!0},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=f(e),r=f(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];c(n,e.length),(n=n.concat(e)).push(2),c(n,r.length);var o=n.concat(r),s=[48];return c(s,o.length),s=s.concat(o),i.encode(s,t)}},7521(t,e,r){var n,i=r(9634),o=r(3154),s=r(3360),a=r(2823),u=r(4742),f=r(9499),c=r(5615),d=new u({hash:f.sha256,entropy:"UQi4W3Y2bJfzleYy+oEZ2kA9A+9jrmwewST9vmBZNgMmFyzzH0S9Vol/UK",nonce:"0123456789avcdef",pers:"0123456789abcdef"});function l(t){if(!(this instanceof l))return new l(t);s.curve.short.call(this,t)}function p(t,e,r){if(null==t)return n.point();var i;if(null!=e){if(i=n.point(t,e),!n.validate(i))throw"point is not on curve"}else{var o=new a(t,16).toRed(n.red),s=o.redSqr().redMul(o);"odd"===r!=(s=s.redIAdd(o.redMul(n.a)).redIAdd(n.b).redSqrt()).fromRed().isOdd()&&(s=s.redNeg()),i=n.point(o,s)}return i}function b(t,e){if(!(this instanceof b))return new b(t,e);this.curve=n,this.pub=null,this.pri=null;var r=!1,i=!1;if(null!=t)if("string"==typeof t)this._pubFromString(t);else if(Array.isArray(t))this._pubFromBytes(t);else{if(!("x"in t&&a.isBN(t.x)&&"y"in t&&a.isBN(t.y)))throw"invalid public key";this.pub=t,r=!0}if(null!=e){if("string"==typeof e)this.pri=new a(e,16);else{if(!a.isBN(e))throw"invalid private key";this.pri=e,i=!0}null==this.pub&&(this.pub=n.g.mul(this.pri))}if(!(r&&i||this.validate()))throw"invalid key"}c(l,s.curve.short),n=l({type:"SM2",prime:null,p:"FFFFFFFE FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 00000000 FFFFFFFF FFFFFFFF",a:"FFFFFFFE FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 00000000 FFFFFFFF FFFFFFFC",b:"28E9FA9E 9D9F5E34 4D5A9E4B CF6509A7 F39789F5 15AB8F92 DDBCBD41 4D940E93",n:"FFFFFFFE FFFFFFFF FFFFFFFF FFFFFFFF 7203DF6B 21C6052B 53BBF409 39D54123",hash:i,gRed:!1,g:["32C4AE2C 1F198119 5F990446 6A39C994 8FE30BBF F2660BE1 715A4589 334C74C7","BC3736A2 F4F6779C 59BDCEE3 6B692153 D0A9877C C62A4740 02DF32E5 2139F0A0"]}),e.curve=n,e.SM2KeyPair=b,e.genKeyPair=function(){var t=0,e=n.n.sub(new a(2));do{t=new a(d.generate(32,"hex",o.random(64)))}while(t.cmp(e)>0);return new b(null,t)},b.prototype._pubFromString=function(t){var e="invalid key string";if(t.length<66)throw e;var r=t.slice(2,66);switch(t.slice(0,2)){case"00":throw"public key should not be infinity";case"02":this.pub=p(r,null,"even");break;case"03":this.pub=p(r,null,"odd");break;case"04":case"06":case"07":if(t.length<130)throw e;this.pub=p(r,t.slice(66,130));break;default:throw e}},b.prototype._pubFromBytes=function(t){var e="unrecognized key";if(t.length<33)throw e;var r=t.slice(1,33);switch(t[0]){case 0:throw"public key should not be infinity";case 2:this.pub=p(r,null,"even");break;case 3:this.pub=p(r,null,"odd");break;case 4:case 6:case 7:if(t.length<65)throw e;this.pub=p(r,t.slice(33,65));break;default:throw e}},b.prototype.validate=function(){if(null!=this.pub){if(this.pub.isInfinity())return!1;if(!this.curve.validate(this.pub))return!1;if(!this.pub.mul(this.curve.n).isInfinity())return!1}if(null!=this.pri){if(this.pri.cmp(this.curve.n.sub(new a(2)))>0)return!1;if(null!=this.pub&&!this.pub.eq(this.curve.g.mul(this.pri)))return!1}return!0},b.prototype.pubToString=function(t){var e="";switch(t){case"compress":return(e=this.pub.getY().isEven()?"02":"03")+this.pub.getX().toString(16,32);case"mix":e=this.pub.getY().isEven()?"06":"07";break;default:e="04"}return e+this.pub.getX().toString(16,32)+this.pub.getY().toString(16,32)},b.prototype.pubToBytes=function(t){var e=[];switch(t){case"compress":return this.pub.getY().isEven()?e.push(2):e.push(3),e.concat(this.pub.getX().toArray("be",32));case"mix":this.pub.getY().isEven()?e.push(6):e.push(7);break;default:e.push(4)}return e.concat(this.pub.getX().toArray("be",32)).concat(this.pub.getY().toArray("be",32))},b.prototype.sign=function(t){if(null==this.pri)throw"cannot sign message without private key";return"string"==typeof t?this.signDigest((new i).sum(this._combine(o.strToBytes(t)))):this.signDigest((new i).sum(this._combine(t)))},b.prototype.verify=function(t,e,r){if(null==this.pub)throw"cannot verify signature without public key";return this.verifyDigest((new i).sum(this._combine(t)),e,r)},b.prototype.signRaw=function(t){return this.signDigest((new i).sum(t))},b.prototype.verifyRaw=function(t,e,r){return this.verifyDigest((new i).sum(t),e,r)},b.prototype.signDigest=function(t){for(var e={r:"",s:""};;){var r=new a(d.generate(32,"hex",o.random(64)),16).umod(this.curve.n),n=this.curve.g.mul(r),i=o.hashToBN(t).add(n.getX()).umod(this.curve.n);if(!i.isZero()&&!i.add(r).eq(this.curve.n)){var s=new a(1).add(this.pri).invm(this.curve.n),u=r.sub(i.mul(this.pri)).umod(this.curve.n),f=s.mul(u).umod(this.curve.n);if(!f.isZero()){e.r=o.padStart(i.toString(16),64,"0"),e.s=o.padStart(f.toString(16),64,"0");break}}}return e},b.prototype.verifyDigest=function(t,e,r){var n=new a(e,16);if(n.cmp(this.curve.n)>=0)return!1;var i=new a(r,16);if(i.cmp(this.curve.n)>=0)return!1;var s=n.add(i).umod(this.curve.n);if(s.isZero())return!1;var u=this.curve.g.mul(i).add(this.pub.mul(s));return!!o.hashToBN(t).add(u.getX()).umod(this.curve.n).eq(n)},b.prototype._combine=function(t){var e=[0,128,49,50,51,52,53,54,55,56,49,50,51,52,53,54,55,56];return e=(e=(e=(e=(e=(e=e.concat(this.curve.a.fromRed().toArray())).concat(this.curve.b.fromRed().toArray())).concat(this.curve.g.getX().toArray())).concat(this.curve.g.getY().toArray())).concat(this.pub.getX().toArray())).concat(this.pub.getY().toArray()),h=new i,e=h.sum(e),"string"==typeof t?e.concat(o.strToBytes(t)):e.concat(t)},b.prototype.toString=function(){var t="public: ";return this.pub?t+="("+this.pub.getX().toString(16)+", "+this.pub.getY().toString(16)+")":t+="null",t+=", private: ",this.pri?t+=o.padStart(this.pri.toString(16),64,"0"):t+="null",t}},9634(t,e,r){var n=r(3154);function i(){if(!(this instanceof i))return new i;this.reg=new Array(8),this.chunk=[],this.size=0,this.reset()}function o(t,e){return(t<<(e%=32)|t>>>32-e)>>>0}function s(t){return 0<=t&&t<16?2043430169:16<=t&&t<64?2055708042:void console.error("invalid j for constant Tj")}function a(t,e,r,n){return 0<=t&&t<16?(e^r^n)>>>0:16<=t&&t<64?(e&r|e&n|r&n)>>>0:(console.error("invalid j for bool function FF"),0)}function u(t,e,r,n){return 0<=t&&t<16?(e^r^n)>>>0:16<=t&&t<64?(e&r|~e&n)>>>0:(console.error("invalid j for bool function GG"),0)}t.exports=i,i.prototype.reset=function(){this.reg[0]=1937774191,this.reg[1]=1226093241,this.reg[2]=388252375,this.reg[3]=3666478592,this.reg[4]=2842636476,this.reg[5]=372324522,this.reg[6]=3817729613,this.reg[7]=2969243214,this.chunk=[],this.size=0},i.prototype.write=function(t){var e="string"==typeof t?n.strToBytes(t):t;this.size+=e.length;var r=64-this.chunk.length;if(e.length<r)this.chunk=this.chunk.concat(e);else for(this.chunk=this.chunk.concat(e.slice(0,r));this.chunk.length>=64;)this._compress(this.chunk),r<e.length?this.chunk=e.slice(r,Math.min(r+64,e.length)):this.chunk=[],r+=64},i.prototype.sum=function(t,e){t&&(this.reset(),this.write(t)),this._fill();for(var r=0;r<this.chunk.length;r+=64)this._compress(this.chunk.slice(r,r+64));var i=null;if("hex"==e)for(i="",r=0;r<8;r++)i+=n.padStart(this.reg[r].toString(16),8,"0");else for(i=new Array(32),r=0;r<8;r++)h=this.reg[r],i[4*r+3]=(255&h)>>>0,h>>>=8,i[4*r+2]=(255&h)>>>0,h>>>=8,i[4*r+1]=(255&h)>>>0,h>>>=8,i[4*r]=(255&h)>>>0;return this.reset(),i},i.prototype._compress=function(t){if(t<64)console.error("compress error: not enough data");else{for(var e=function(t){for(var e=new Array(132),r=0;r<16;r++)e[r]=t[4*r]<<24,e[r]|=t[4*r+1]<<16,e[r]|=t[4*r+2]<<8,e[r]|=t[4*r+3],e[r]>>>=0;for(var n=16;n<68;n++)x=e[n-16]^e[n-9]^o(e[n-3],15),x=x^o(x,15)^o(x,23),e[n]=(x^o(e[n-13],7)^e[n-6])>>>0;for(n=0;n<64;n++)e[n+68]=(e[n]^e[n+4])>>>0;return e}(t),r=this.reg.slice(0),n=0;n<64;n++){var i=o(r[0],12)+r[4]+o(s(n),n),f=((i=o(i=(4294967295&i)>>>0,7))^o(r[0],12))>>>0,c=a(n,r[0],r[1],r[2]);c=(4294967295&(c=c+r[3]+f+e[n+68]))>>>0;var h=u(n,r[4],r[5],r[6]);h=(4294967295&(h=h+r[7]+i+e[n]))>>>0,r[3]=r[2],r[2]=o(r[1],9),r[1]=r[0],r[0]=c,r[7]=r[6],r[6]=o(r[5],19),r[5]=r[4],r[4]=(h^o(h,9)^o(h,17))>>>0}for(var d=0;d<8;d++)this.reg[d]=(this.reg[d]^r[d])>>>0}},i.prototype._fill=function(){var t=8*this.size,e=this.chunk.push(128)%64;for(64-e<8&&(e-=64);e<56;e++)this.chunk.push(0);for(var r=0;r<4;r++){var n=Math.floor(t/4294967296);this.chunk.push(n>>>8*(3-r)&255)}for(r=0;r<4;r++)this.chunk.push(t>>>8*(3-r)&255)}},3154(t,e,r){var n=e,i=r(2823),o=r(7048);n.strToBytes=function(t){for(var e,r,n=[],i=0;i<t.length;i++){e=t.charCodeAt(i),r=[];do{r.push(255&e),e>>=8}while(e);n=n.concat(r.reverse())}return n},n.hashToBN=function(t){if("string"==typeof t)return new i(t,16);for(var e="",r=0;r<t.length;r++){var n=t[r].toString(16);1==n.length&&(e+="0"),e+=n}return new i(e,16)},n.random=function(t){return o(t).toString("hex")},n.padStart=function(t,e,r){return t.length>=e?t:r.repeat(e-t.length)+t}},7403(t,e,r){"use strict";var n=r(5636).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),s=o.charCodeAt(0);if(255!==e[s])throw new TypeError(o+" is ambiguous");e[s]=i}var a=t.length,u=t.charAt(0),f=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function h(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return n.alloc(0);for(var r=0,i=0,o=0;t[r]===u;)i++,r++;for(var s=(t.length-r)*f+1>>>0,c=new Uint8Array(s);r<t.length;){var h=t.charCodeAt(r);if(h>255)return;var d=e[h];if(255===d)return;for(var l=0,p=s-1;(0!==d||l<o)&&-1!==p;p--,l++)d+=a*c[p]>>>0,c[p]=d%256>>>0,d=d/256>>>0;if(0!==d)throw new Error("Non-zero carry");o=l,r++}for(var b=s-o;b!==s&&0===c[b];)b++;var m=n.allocUnsafe(i+(s-b));m.fill(0,0,i);for(var y=i;b!==s;)m[y++]=c[b++];return m}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,s=e.length;o!==s&&0===e[o];)o++,r++;for(var f=(s-o)*c+1>>>0,h=new Uint8Array(f);o!==s;){for(var d=e[o],l=0,p=f-1;(0!==d||l<i)&&-1!==p;p--,l++)d+=256*h[p]>>>0,h[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");i=l,o++}for(var b=f-i;b!==f&&0===h[b];)b++;for(var m=u.repeat(r);b<f;++b)m+=t.charAt(h[b]);return m},decodeUnsafe:h,decode:function(t){var e=h(t);if(e)return e;throw new Error("Non-base"+a+" character")}}}},7991(t,e){"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=a(t),s=o[0],u=o[1],f=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,u)),c=0,h=u>0?s-4:s;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],f[c++]=e>>16&255,f[c++]=e>>8&255,f[c++]=255&e;return 2===u&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,f[c++]=255&e),1===u&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,f[c++]=e>>8&255,f[c++]=255&e),f},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(f(t,a,a+s>u?u:a+s));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function f(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),i.push(u(n));return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},3092(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(5302).Buffer}catch(t){}function a(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o<i;o++){var s=t.charCodeAt(o)-48;n<<=4,n|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):t<9007199254740992?(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3):(n(t<=9999999999999900),this.words=[67108863&t,t/67108864&67108863,2],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,o=0;for(r=t.length-6,n=0;r>=e;r-=6)i=a(t,r,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=a(t,e,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,f=0,c=r;c<a;c+=n)f=u(t,c,c+n,e),this.imuln(i),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!==s){var h=1;for(f=u(t,c,t.length,e),c=0;c<s;c++)h*=e;this.imuln(h),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var f=1;f<n;f++){for(var c=u>>>26,h=67108863&u,d=Math.min(f,e.length-1),l=Math.max(0,f-t.length+1);l<=d;l++){var p=f-l|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[l])+h)/67108864|0,h=67108863&s}r.words[f]=0|h,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=c[t],l=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?b+r:f[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3!==this.length||1!==this.words[2]&&2!==this.words[2]?this.length>2&&n(!1,"Number can only safely store up to 54 bits"):t+=4503599627370496+67108864*this.words[1],0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,f=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),f[a]=s;for(;a<o;a++)f[a]=0}else{for(a=0;a<o-i;a++)f[a]=0;for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),f[o-a-1]=s}return f},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0===(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0===(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0===(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var l=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,f=0,c=0|s[0],h=8191&c,d=c>>>13,l=0|s[1],p=8191&l,b=l>>>13,m=0|s[2],y=8191&m,g=m>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],S=8191&M,A=M>>>13,x=0|s[5],T=8191&x,E=x>>>13,k=0|s[6],j=8191&k,R=k>>>13,O=0|s[7],I=8191&O,P=O>>>13,N=0|s[8],C=8191&N,B=N>>>13,F=0|s[9],L=8191&F,D=F>>>13,q=0|a[0],U=8191&q,z=q>>>13,V=0|a[1],K=8191&V,H=V>>>13,W=0|a[2],J=8191&W,G=W>>>13,Z=0|a[3],X=8191&Z,$=Z>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ft=at>>>13,ct=0|a[8],ht=8191&ct,dt=ct>>>13,lt=0|a[9],pt=8191<,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(f+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,z))+Math.imul(d,U)|0))<<13)|0;f=((o=Math.imul(d,z))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,z))+Math.imul(b,U)|0,o=Math.imul(b,z);var yt=(f+(n=n+Math.imul(h,K)|0)|0)+((8191&(i=(i=i+Math.imul(h,H)|0)+Math.imul(d,K)|0))<<13)|0;f=((o=o+Math.imul(d,H)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,z))+Math.imul(g,U)|0,o=Math.imul(g,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,H)|0;var gt=(f+(n=n+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(d,J)|0))<<13)|0;f=((o=o+Math.imul(d,G)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,z))+Math.imul(_,U)|0,o=Math.imul(_,z),n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,H)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,G)|0;var vt=(f+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,$)|0)+Math.imul(d,X)|0))<<13)|0;f=((o=o+Math.imul(d,$)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,U),i=(i=Math.imul(S,z))+Math.imul(A,U)|0,o=Math.imul(A,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(y,J)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,G)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,$)|0;var wt=(f+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,Q)|0))<<13)|0;f=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,z))+Math.imul(E,U)|0,o=Math.imul(E,z),n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,H)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var _t=(f+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;f=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,z))+Math.imul(R,U)|0,o=Math.imul(R,z),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,H)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var Mt=(f+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(d,ot)|0))<<13)|0;f=((o=o+Math.imul(d,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,z))+Math.imul(P,U)|0,o=Math.imul(P,z),n=n+Math.imul(j,K)|0,i=(i=i+Math.imul(j,H)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,H)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,$)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,$)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0;var St=(f+(n=n+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(d,ut)|0))<<13)|0;f=((o=o+Math.imul(d,ft)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,z))+Math.imul(B,U)|0,o=Math.imul(B,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(j,J)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,G)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,$)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,$)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0;var At=(f+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;f=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,z))+Math.imul(D,U)|0,o=Math.imul(D,z),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,H)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,H)|0,n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,G)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,$)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,$)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ft)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,dt)|0;var xt=(f+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,bt)|0)+Math.imul(d,pt)|0))<<13)|0;f=((o=o+Math.imul(d,bt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,H))+Math.imul(D,K)|0,o=Math.imul(D,H),n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(B,J)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,$)|0,n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ft)|0,n=n+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,dt)|0)+Math.imul(g,ht)|0,o=o+Math.imul(g,dt)|0;var Tt=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(L,J),i=(i=Math.imul(L,G))+Math.imul(D,J)|0,o=Math.imul(D,G),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(j,rt)|0,i=(i=i+Math.imul(j,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ft)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,dt)|0;var Et=(f+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,bt)|0)+Math.imul(g,pt)|0))<<13)|0;f=((o=o+Math.imul(g,bt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,$))+Math.imul(D,X)|0,o=Math.imul(D,$),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(j,ot)|0,i=(i=i+Math.imul(j,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ft)|0,n=n+Math.imul(S,ht)|0,i=(i=i+Math.imul(S,dt)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,dt)|0;var kt=(f+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;f=((o=o+Math.imul(_,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,n=n+Math.imul(j,ut)|0,i=(i=i+Math.imul(j,ft)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ft)|0,n=n+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,dt)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,dt)|0;var jt=(f+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,bt)|0)+Math.imul(A,pt)|0))<<13)|0;f=((o=o+Math.imul(A,bt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(L,rt),i=(i=Math.imul(L,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ft)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ft)|0,n=n+Math.imul(j,ht)|0,i=(i=i+Math.imul(j,dt)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,dt)|0;var Rt=(f+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,bt)|0)+Math.imul(E,pt)|0))<<13)|0;f=((o=o+Math.imul(E,bt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(L,ot),i=(i=Math.imul(L,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ft)|0,n=n+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,dt)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,dt)|0;var Ot=(f+(n=n+Math.imul(j,pt)|0)|0)+((8191&(i=(i=i+Math.imul(j,bt)|0)+Math.imul(R,pt)|0))<<13)|0;f=((o=o+Math.imul(R,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(L,ut),i=(i=Math.imul(L,ft))+Math.imul(D,ut)|0,o=Math.imul(D,ft),n=n+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,dt)|0)+Math.imul(B,ht)|0,o=o+Math.imul(B,dt)|0;var It=(f+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,bt)|0)+Math.imul(P,pt)|0))<<13)|0;f=((o=o+Math.imul(P,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(L,ht),i=(i=Math.imul(L,dt))+Math.imul(D,ht)|0,o=Math.imul(D,dt);var Pt=(f+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,bt)|0)+Math.imul(B,pt)|0))<<13)|0;f=((o=o+Math.imul(B,bt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Nt=(f+(n=Math.imul(L,pt))|0)+((8191&(i=(i=Math.imul(L,bt))+Math.imul(D,pt)|0))<<13)|0;return f=((o=Math.imul(D,bt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=mt,u[1]=yt,u[2]=gt,u[3]=vt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=St,u[8]=At,u[9]=xt,u[10]=Tt,u[11]=Et,u[12]=kt,u[13]=jt,u[14]=Rt,u[15]=Ot,u[16]=It,u[17]=Pt,u[18]=Nt,0!==f&&(u[19]=f,r.length++),r};function p(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(l=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?l(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),f=Math.max(0,o-t.length+1);f<=u;f++){var c=o-f,h=(0|t.words[c])*(0|e.words[f]),d=67108863&h;a=67108863&(d=d+a|0),i+=(s=(s=s+(h/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e),r},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},b.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},b.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),f=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var h=u,d=f,l=0;l<s;l++){var p=r[c+l],b=n[c+l],m=r[c+l+s],y=n[c+l+s],g=h*m-d*y;y=h*y+d*m,m=g,r[c+l]=p+m,n[c+l]=b+y,r[c+l+s]=p-m,n[c+l+s]=b-y,l!==a&&(g=u*h-f*d,d=u*d+f*h,h=g)}},b.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},b.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},b.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(!(-8192&o))},b.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},b.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),f=new Array(n),c=new Array(n),h=new Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,f,n),this.transform(s,o,a,u,n,i),this.transform(f,o,c,h,n,i);for(var l=0;l<n;l++){var p=a[l]*c[l]-u[l]*h[l];u[l]=a[l]*h[l]+u[l]*c[l],a[l]=p}return this.conjugate(a,u,n),this.transform(a,u,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var f=0;f<s;f++)u.words[f]=this.words[f];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,f=0;f<this.length;f++)this.words[f]=this.words[f+s];else this.words[0]=0,this.length=1;var c=0;for(f=this.length-1;f>=0&&(0!==c||f>=i);f--){var h=0|this.words[f];this.words[f]=c<<26-o|h>>>o,c=h&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var f=0;f<a.length;f++)a.words[f]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,a&&(a.words[u]=1));for(var h=u-1;h>=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=d)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),f=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++f;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var d=0,l=1;0===(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,b=1;0===(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,c=1;0===(e.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(e.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,d=1;0===(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return!(1&this.words[0])},o.prototype.isOdd=function(){return!(1&~this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red nu