Problem:
Score : 400 points

Problem Statement

Given is an integer S.
Find a combination of six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfies all of the following conditions:

0 \leq X_1,Y_1,X_2,Y_2,X_3,Y_3 \leq 10^9

The area of the triangle in a two-dimensional plane whose vertices are (X_1,Y_1),(X_2,Y_2), and (X_3,Y_3) is S/2.

We can prove that there always exist six integers that satisfy the conditions under the constraints of this problem.

Constraints

1 \leq S \leq 10^{18}

All values in input are integers.

Input

Input is given from Standard Input in the following format:

S

Output

Print six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfy the conditions, in this order, with spaces in between.
If multiple solutions exist, any of them will be accepted.

Sample Input 1

3

Sample Output 1

1 0 2 2 0 1

The area of the triangle in a two-dimensional plane whose vertices are (1,0),(2,2), and (0,1) is 3/2.
Printing 3 0 3 1 0 1 or 1 0 0 1 2 2 will also be accepted.

Sample Input 2

100

Sample Output 2

0 0 10 0 0 10

Sample Input 3

311114770564041497

Sample Output 3

314159265 358979323 846264338 327950288 419716939 937510582

Solution in JavaScript (node.js v5.12) (judge verdict: Accepted)

module.exports=function(e){var r={};function n(t){if(r[t])return r[t].exports;var i=r[t]={i:t,l:!1,exports:{}};return e[t].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,r){if(1&r&&(e=n(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var i in e)n.d(t,i,function(r){return e[r]}.bind(null,i));return t},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="",n(n.s=0)}([function(e,r,n){n(1)(n(3).readFileSync("/dev/stdin","UTF-8").split("\n"))},function(e,r,n){var t=n(2);e.exports=function(e){var r=new t(e[0]);if(0!=r.comparedTo(1e18)){var n=1e9,i=r.idiv(n).plus(1),o=r.mod(n),u=new t(n).minus(o);console.log(`0 0 ${n} 1 ${u.toString()} ${i.toString()}`)}else console.log("0 0 1000000000 0 1000000000 1000000000")}},function(e,r,n){var t;!function(i){"use strict";var o,u=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,f=Math.ceil,s=Math.floor,l="[BigNumber Error] ",c=l+"Number primitive has more than 15 significant digits: ",a=1e14,h=14,p=9007199254740991,g=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e7,w=1e9;function m(e){var r=0|e;return e>0||e===r?r:r-1}function v(e){for(var r,n,t=1,i=e.length,o=e[0]+"";t<i;){for(r=e[t++]+"",n=h-r.length;n--;r="0"+r);o+=r}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function b(e,r){var n,t,i=e.c,o=r.c,u=e.s,f=r.s,s=e.e,l=r.e;if(!u||!f)return null;if(n=i&&!i[0],t=o&&!o[0],n||t)return n?t?0:-f:u;if(u!=f)return u;if(n=u<0,t=s==l,!i||!o)return t?0:!i^n?1:-1;if(!t)return s>l^n?1:-1;for(f=(s=i.length)<(l=o.length)?s:l,u=0;u<f;u++)if(i[u]!=o[u])return i[u]>o[u]^n?1:-1;return s==l?0:s>l^n?1:-1}function y(e,r,n,t){if(e<r||e>n||e!==s(e))throw Error(l+(t||"Argument")+("number"==typeof e?e<r||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function O(e){var r=e.c.length-1;return m(e.e/h)==r&&e.c[r]%2!=0}function N(e,r){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(r<0?"e":"e+")+r}function E(e,r,n){var t,i;if(r<0){for(i=n+".";++r;i+=n);e=i+e}else if(++r>(t=e.length)){for(i=n,r-=t;--r;i+=n);e+=i}else r<t&&(e=e.slice(0,r)+"."+e.slice(r));return e}(o=function e(r){var n,t,i,o,A,S,_,x,P,R=$.prototype={constructor:$,toString:null,valueOf:null},D=new $(1),T=20,B=4,L=-7,U=21,M=-1e7,I=1e7,C=!1,j=1,F=0,G={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},k="0123456789abcdefghijklmnopqrstuvwxyz";function $(e,r){var n,o,f,l,a,g,d,w,m=this;if(!(m instanceof $))return new $(e,r);if(null==r){if(e&&!0===e._isBigNumber)return m.s=e.s,void(!e.c||e.e>I?m.c=m.e=null:e.e<M?m.c=[m.e=0]:(m.e=e.e,m.c=e.c.slice()));if((g="number"==typeof e)&&0*e==0){if(m.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,a=e;a>=10;a/=10,l++);return void(l>I?m.c=m.e=null:(m.e=l,m.c=[e]))}w=String(e)}else{if(!u.test(w=String(e)))return i(m,w,g);m.s=45==w.charCodeAt(0)?(w=w.slice(1),-1):1}(l=w.indexOf("."))>-1&&(w=w.replace(".","")),(a=w.search(/e/i))>0?(l<0&&(l=a),l+=+w.slice(a+1),w=w.substring(0,a)):l<0&&(l=w.length)}else{if(y(r,2,k.length,"Base"),10==r)return V(m=new $(e),T+m.e+1,B);if(w=String(e),g="number"==typeof e){if(0*e!=0)return i(m,w,g,r);if(m.s=1/e<0?(w=w.slice(1),-1):1,$.DEBUG&&w.replace(/^0\.0*|\./,"").length>15)throw Error(c+e)}else m.s=45===w.charCodeAt(0)?(w=w.slice(1),-1):1;for(n=k.slice(0,r),l=a=0,d=w.length;a<d;a++)if(n.indexOf(o=w.charAt(a))<0){if("."==o){if(a>l){l=d;continue}}else if(!f&&(w==w.toUpperCase()&&(w=w.toLowerCase())||w==w.toLowerCase()&&(w=w.toUpperCase()))){f=!0,a=-1,l=0;continue}return i(m,String(e),g,r)}g=!1,(l=(w=t(w,r,10,m.s)).indexOf("."))>-1?w=w.replace(".",""):l=w.length}for(a=0;48===w.charCodeAt(a);a++);for(d=w.length;48===w.charCodeAt(--d););if(w=w.slice(a,++d)){if(d-=a,g&&$.DEBUG&&d>15&&(e>p||e!==s(e)))throw Error(c+m.s*e);if((l=l-a-1)>I)m.c=m.e=null;else if(l<M)m.c=[m.e=0];else{if(m.e=l,m.c=[],a=(l+1)%h,l<0&&(a+=h),a<d){for(a&&m.c.push(+w.slice(0,a)),d-=h;a<d;)m.c.push(+w.slice(a,a+=h));a=h-(w=w.slice(a)).length}else a-=d;for(;a--;w+="0");m.c.push(+w)}}else m.c=[m.e=0]}function q(e,r,n,t){var i,o,u,f,s;if(null==n?n=B:y(n,0,8),!e.c)return e.toString();if(i=e.c[0],u=e.e,null==r)s=v(e.c),s=1==t||2==t&&(u<=L||u>=U)?N(s,u):E(s,u,"0");else if(o=(e=V(new $(e),r,n)).e,f=(s=v(e.c)).length,1==t||2==t&&(r<=o||o<=L)){for(;f<r;s+="0",f++);s=N(s,o)}else if(r-=u,s=E(s,o,"0"),o+1>f){if(--r>0)for(s+=".";r--;s+="0");}else if((r+=o-f)>0)for(o+1==f&&(s+=".");r--;s+="0");return e.s<0&&i?"-"+s:s}function z(e,r){for(var n,t=1,i=new $(e[0]);t<e.length;t++){if(!(n=new $(e[t])).s){i=n;break}r.call(i,n)&&(i=n)}return i}function H(e,r,n){for(var t=1,i=r.length;!r[--i];r.pop());for(i=r[0];i>=10;i/=10,t++);return(n=t+n*h-1)>I?e.c=e.e=null:n<M?e.c=[e.e=0]:(e.e=n,e.c=r),e}function V(e,r,n,t){var i,o,u,l,c,p,d,w=e.c,m=g;if(w){e:{for(i=1,l=w[0];l>=10;l/=10,i++);if((o=r-i)<0)o+=h,u=r,d=(c=w[p=0])/m[i-u-1]%10|0;else if((p=f((o+1)/h))>=w.length){if(!t)break e;for(;w.length<=p;w.push(0));c=d=0,i=1,u=(o%=h)-h+1}else{for(c=l=w[p],i=1;l>=10;l/=10,i++);d=(u=(o%=h)-h+i)<0?0:c/m[i-u-1]%10|0}if(t=t||r<0||null!=w[p+1]||(u<0?c:c%m[i-u-1]),t=n<4?(d||t)&&(0==n||n==(e.s<0?3:2)):d>5||5==d&&(4==n||t||6==n&&(o>0?u>0?c/m[i-u]:0:w[p-1])%10&1||n==(e.s<0?8:7)),r<1||!w[0])return w.length=0,t?(r-=e.e+1,w[0]=m[(h-r%h)%h],e.e=-r||0):w[0]=e.e=0,e;if(0==o?(w.length=p,l=1,p--):(w.length=p+1,l=m[h-o],w[p]=u>0?s(c/m[i-u]%m[u])*l:0),t)for(;;){if(0==p){for(o=1,u=w[0];u>=10;u/=10,o++);for(u=w[0]+=l,l=1;u>=10;u/=10,l++);o!=l&&(e.e++,w[0]==a&&(w[0]=1));break}if(w[p]+=l,w[p]!=a)break;w[p--]=0,l=1}for(o=w.length;0===w[--o];w.pop());}e.e>I?e.c=e.e=null:e.e<M&&(e.c=[e.e=0])}return e}function W(e){var r,n=e.e;return null===n?e.toString():(r=v(e.c),r=n<=L||n>=U?N(r,n):E(r,n,"0"),e.s<0?"-"+r:r)}return $.clone=e,$.ROUND_UP=0,$.ROUND_DOWN=1,$.ROUND_CEIL=2,$.ROUND_FLOOR=3,$.ROUND_HALF_UP=4,$.ROUND_HALF_DOWN=5,$.ROUND_HALF_EVEN=6,$.ROUND_HALF_CEIL=7,$.ROUND_HALF_FLOOR=8,$.EUCLID=9,$.config=$.set=function(e){var r,n;if(null!=e){if("object"!=typeof e)throw Error(l+"Object expected: "+e);if(e.hasOwnProperty(r="DECIMAL_PLACES")&&(y(n=e[r],0,w,r),T=n),e.hasOwnProperty(r="ROUNDING_MODE")&&(y(n=e[r],0,8,r),B=n),e.hasOwnProperty(r="EXPONENTIAL_AT")&&((n=e[r])&&n.pop?(y(n[0],-w,0,r),y(n[1],0,w,r),L=n[0],U=n[1]):(y(n,-w,w,r),L=-(U=n<0?-n:n))),e.hasOwnProperty(r="RANGE"))if((n=e[r])&&n.pop)y(n[0],-w,-1,r),y(n[1],1,w,r),M=n[0],I=n[1];else{if(y(n,-w,w,r),!n)throw Error(l+r+" cannot be zero: "+n);M=-(I=n<0?-n:n)}if(e.hasOwnProperty(r="CRYPTO")){if((n=e[r])!==!!n)throw Error(l+r+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw C=!n,Error(l+"crypto unavailable");C=n}else C=n}if(e.hasOwnProperty(r="MODULO_MODE")&&(y(n=e[r],0,9,r),j=n),e.hasOwnProperty(r="POW_PRECISION")&&(y(n=e[r],0,w,r),F=n),e.hasOwnProperty(r="FORMAT")){if("object"!=typeof(n=e[r]))throw Error(l+r+" not an object: "+n);G=n}if(e.hasOwnProperty(r="ALPHABET")){if("string"!=typeof(n=e[r])||/^.$|[+-.\s]|(.).*\1/.test(n))throw Error(l+r+" invalid: "+n);k=n}}return{DECIMAL_PLACES:T,ROUNDING_MODE:B,EXPONENTIAL_AT:[L,U],RANGE:[M,I],CRYPTO:C,MODULO_MODE:j,POW_PRECISION:F,FORMAT:G,ALPHABET:k}},$.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!$.DEBUG)return!0;var r,n,t=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(t)){if((1===o||-1===o)&&i>=-w&&i<=w&&i===s(i)){if(0===t[0]){if(0===i&&1===t.length)return!0;break e}if((r=(i+1)%h)<1&&(r+=h),String(t[0]).length==r){for(r=0;r<t.length;r++)if((n=t[r])<0||n>=a||n!==s(n))break e;if(0!==n)return!0}}}else if(null===t&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(l+"Invalid BigNumber: "+e)},$.maximum=$.max=function(){return z(arguments,R.lt)},$.minimum=$.min=function(){return z(arguments,R.gt)},$.random=(o=9007199254740992*Math.random()&2097151?function(){return s(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var r,n,t,i,u,c=0,a=[],p=new $(D);if(null==e?e=T:y(e,0,w),i=f(e/h),C)if(crypto.getRandomValues){for(r=crypto.getRandomValues(new Uint32Array(i*=2));c<i;)(u=131072*r[c]+(r[c+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),r[c]=n[0],r[c+1]=n[1]):(a.push(u%1e14),c+=2);c=i/2}else{if(!crypto.randomBytes)throw C=!1,Error(l+"crypto unavailable");for(r=crypto.randomBytes(i*=7);c<i;)(u=281474976710656*(31&r[c])+1099511627776*r[c+1]+4294967296*r[c+2]+16777216*r[c+3]+(r[c+4]<<16)+(r[c+5]<<8)+r[c+6])>=9e15?crypto.randomBytes(7).copy(r,c):(a.push(u%1e14),c+=7);c=i/7}if(!C)for(;c<i;)(u=o())<9e15&&(a[c++]=u%1e14);for(i=a[--c],e%=h,i&&e&&(u=g[h-e],a[c]=s(i/u)*u);0===a[c];a.pop(),c--);if(c<0)a=[t=0];else{for(t=-1;0===a[0];a.splice(0,1),t-=h);for(c=1,u=a[0];u>=10;u/=10,c++);c<h&&(t-=h-c)}return p.e=t,p.c=a,p}),$.sum=function(){for(var e=1,r=arguments,n=new $(r[0]);e<r.length;)n=n.plus(r[e++]);return n},t=function(){function e(e,r,n,t){for(var i,o,u=[0],f=0,s=e.length;f<s;){for(o=u.length;o--;u[o]*=r);for(u[0]+=t.indexOf(e.charAt(f++)),i=0;i<u.length;i++)u[i]>n-1&&(null==u[i+1]&&(u[i+1]=0),u[i+1]+=u[i]/n|0,u[i]%=n)}return u.reverse()}return function(r,t,i,o,u){var f,s,l,c,a,h,p,g,d=r.indexOf("."),w=T,m=B;for(d>=0&&(c=F,F=0,r=r.replace(".",""),h=(g=new $(t)).pow(r.length-d),F=c,g.c=e(E(v(h.c),h.e,"0"),10,i,"0123456789"),g.e=g.c.length),l=c=(p=e(r,t,i,u?(f=k,"0123456789"):(f="0123456789",k))).length;0==p[--c];p.pop());if(!p[0])return f.charAt(0);if(d<0?--l:(h.c=p,h.e=l,h.s=o,p=(h=n(h,g,w,m,i)).c,a=h.r,l=h.e),d=p[s=l+w+1],c=i/2,a=a||s<0||null!=p[s+1],a=m<4?(null!=d||a)&&(0==m||m==(h.s<0?3:2)):d>c||d==c&&(4==m||a||6==m&&1&p[s-1]||m==(h.s<0?8:7)),s<1||!p[0])r=a?E(f.charAt(1),-w,f.charAt(0)):f.charAt(0);else{if(p.length=s,a)for(--i;++p[--s]>i;)p[s]=0,s||(++l,p=[1].concat(p));for(c=p.length;!p[--c];);for(d=0,r="";d<=c;r+=f.charAt(p[d++]));r=E(r,l,f.charAt(0))}return r}}(),n=function(){function e(e,r,n){var t,i,o,u,f=0,s=e.length,l=r%d,c=r/d|0;for(e=e.slice();s--;)f=((i=l*(o=e[s]%d)+(t=c*o+(u=e[s]/d|0)*l)%d*d+f)/n|0)+(t/d|0)+c*u,e[s]=i%n;return f&&(e=[f].concat(e)),e}function r(e,r,n,t){var i,o;if(n!=t)o=n>t?1:-1;else for(i=o=0;i<n;i++)if(e[i]!=r[i]){o=e[i]>r[i]?1:-1;break}return o}function n(e,r,n,t){for(var i=0;n--;)e[n]-=i,i=e[n]<r[n]?1:0,e[n]=i*t+e[n]-r[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(t,i,o,u,f){var l,c,p,g,d,w,v,b,y,O,N,E,A,S,_,x,P,R=t.s==i.s?1:-1,D=t.c,T=i.c;if(!(D&&D[0]&&T&&T[0]))return new $(t.s&&i.s&&(D?!T||D[0]!=T[0]:T)?D&&0==D[0]||!T?0*R:R/0:NaN);for(y=(b=new $(R)).c=[],R=o+(c=t.e-i.e)+1,f||(f=a,c=m(t.e/h)-m(i.e/h),R=R/h|0),p=0;T[p]==(D[p]||0);p++);if(T[p]>(D[p]||0)&&c--,R<0)y.push(1),g=!0;else{for(S=D.length,x=T.length,p=0,R+=2,(d=s(f/(T[0]+1)))>1&&(T=e(T,d,f),D=e(D,d,f),x=T.length,S=D.length),A=x,N=(O=D.slice(0,x)).length;N<x;O[N++]=0);P=T.slice(),P=[0].concat(P),_=T[0],T[1]>=f/2&&_++;do{if(d=0,(l=r(T,O,x,N))<0){if(E=O[0],x!=N&&(E=E*f+(O[1]||0)),(d=s(E/_))>1)for(d>=f&&(d=f-1),v=(w=e(T,d,f)).length,N=O.length;1==r(w,O,v,N);)d--,n(w,x<v?P:T,v,f),v=w.length,l=1;else 0==d&&(l=d=1),v=(w=T.slice()).length;if(v<N&&(w=[0].concat(w)),n(O,w,N,f),N=O.length,-1==l)for(;r(T,O,x,N)<1;)d++,n(O,x<N?P:T,N,f),N=O.length}else 0===l&&(d++,O=[0]);y[p++]=d,O[0]?O[N++]=D[A]||0:(O=[D[A]],N=1)}while((A++<S||null!=O[0])&&R--);g=null!=O[0],y[0]||y.splice(0,1)}if(f==a){for(p=1,R=y[0];R>=10;R/=10,p++);V(b,o+(b.e=p+c*h-1)+1,u,g)}else b.e=c,b.r=+g;return b}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,S=/^([^.]+)\.$/,_=/^\.([^.]+)$/,x=/^-?(Infinity|NaN)$/,P=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,r,n,t){var i,o=n?r:r.replace(P,"");if(x.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!n&&(o=o.replace(A,function(e,r,n){return i="x"==(n=n.toLowerCase())?16:"b"==n?2:8,t&&t!=i?e:r}),t&&(i=t,o=o.replace(S,"$1").replace(_,"0.$1")),r!=o))return new $(o,i);if($.DEBUG)throw Error(l+"Not a"+(t?" base "+t:"")+" number: "+r);e.s=null}e.c=e.e=null},R.absoluteValue=R.abs=function(){var e=new $(this);return e.s<0&&(e.s=1),e},R.comparedTo=function(e,r){return b(this,new $(e,r))},R.decimalPlaces=R.dp=function(e,r){var n,t,i,o=this;if(null!=e)return y(e,0,w),null==r?r=B:y(r,0,8),V(new $(o),e+o.e+1,r);if(!(n=o.c))return null;if(t=((i=n.length-1)-m(this.e/h))*h,i=n[i])for(;i%10==0;i/=10,t--);return t<0&&(t=0),t},R.dividedBy=R.div=function(e,r){return n(this,new $(e,r),T,B)},R.dividedToIntegerBy=R.idiv=function(e,r){return n(this,new $(e,r),0,1)},R.exponentiatedBy=R.pow=function(e,r){var n,t,i,o,u,c,a,p,g=this;if((e=new $(e)).c&&!e.isInteger())throw Error(l+"Exponent not an integer: "+W(e));if(null!=r&&(r=new $(r)),u=e.e>14,!g.c||!g.c[0]||1==g.c[0]&&!g.e&&1==g.c.length||!e.c||!e.c[0])return p=new $(Math.pow(+W(g),u?2-O(e):+W(e))),r?p.mod(r):p;if(c=e.s<0,r){if(r.c?!r.c[0]:!r.s)return new $(NaN);(t=!c&&g.isInteger()&&r.isInteger())&&(g=g.mod(r))}else{if(e.e>9&&(g.e>0||g.e<-1||(0==g.e?g.c[0]>1||u&&g.c[1]>=24e7:g.c[0]<8e13||u&&g.c[0]<=9999975e7)))return o=g.s<0&&O(e)?-0:0,g.e>-1&&(o=1/o),new $(c?1/o:o);F&&(o=f(F/h+2))}for(u?(n=new $(.5),c&&(e.s=1),a=O(e)):a=(i=Math.abs(+W(e)))%2,p=new $(D);;){if(a){if(!(p=p.times(g)).c)break;o?p.c.length>o&&(p.c.length=o):t&&(p=p.mod(r))}if(i){if(0===(i=s(i/2)))break;a=i%2}else if(V(e=e.times(n),e.e+1,1),e.e>14)a=O(e);else{if(0==(i=+W(e)))break;a=i%2}g=g.times(g),o?g.c&&g.c.length>o&&(g.c.length=o):t&&(g=g.mod(r))}return t?p:(c&&(p=D.div(p)),r?p.mod(r):o?V(p,F,B,void 0):p)},R.integerValue=function(e){var r=new $(this);return null==e?e=B:y(e,0,8),V(r,r.e+1,e)},R.isEqualTo=R.eq=function(e,r){return 0===b(this,new $(e,r))},R.isFinite=function(){return!!this.c},R.isGreaterThan=R.gt=function(e,r){return b(this,new $(e,r))>0},R.isGreaterThanOrEqualTo=R.gte=function(e,r){return 1===(r=b(this,new $(e,r)))||0===r},R.isInteger=function(){return!!this.c&&m(this.e/h)>this.c.length-2},R.isLessThan=R.lt=function(e,r){return b(this,new $(e,r))<0},R.isLessThanOrEqualTo=R.lte=function(e,r){return-1===(r=b(this,new $(e,r)))||0===r},R.isNaN=function(){return!this.s},R.isNegative=function(){return this.s<0},R.isPositive=function(){return this.s>0},R.isZero=function(){return!!this.c&&0==this.c[0]},R.minus=function(e,r){var n,t,i,o,u=this,f=u.s;if(r=(e=new $(e,r)).s,!f||!r)return new $(NaN);if(f!=r)return e.s=-r,u.plus(e);var s=u.e/h,l=e.e/h,c=u.c,p=e.c;if(!s||!l){if(!c||!p)return c?(e.s=-r,e):new $(p?u:NaN);if(!c[0]||!p[0])return p[0]?(e.s=-r,e):new $(c[0]?u:3==B?-0:0)}if(s=m(s),l=m(l),c=c.slice(),f=s-l){for((o=f<0)?(f=-f,i=c):(l=s,i=p),i.reverse(),r=f;r--;i.push(0));i.reverse()}else for(t=(o=(f=c.length)<(r=p.length))?f:r,f=r=0;r<t;r++)if(c[r]!=p[r]){o=c[r]<p[r];break}if(o&&(i=c,c=p,p=i,e.s=-e.s),(r=(t=p.length)-(n=c.length))>0)for(;r--;c[n++]=0);for(r=a-1;t>f;){if(c[--t]<p[t]){for(n=t;n&&!c[--n];c[n]=r);--c[n],c[t]+=a}c[t]-=p[t]}for(;0==c[0];c.splice(0,1),--l);return c[0]?H(e,c,l):(e.s=3==B?-1:1,e.c=[e.e=0],e)},R.modulo=R.mod=function(e,r){var t,i,o=this;return e=new $(e,r),!o.c||!e.s||e.c&&!e.c[0]?new $(NaN):!e.c||o.c&&!o.c[0]?new $(o):(9==j?(i=e.s,e.s=1,t=n(o,e,0,3),e.s=i,t.s*=i):t=n(o,e,0,j),(e=o.minus(t.times(e))).c[0]||1!=j||(e.s=o.s),e)},R.multipliedBy=R.times=function(e,r){var n,t,i,o,u,f,s,l,c,p,g,w,v,b,y,O=this,N=O.c,E=(e=new $(e,r)).c;if(!(N&&E&&N[0]&&E[0]))return!O.s||!e.s||N&&!N[0]&&!E||E&&!E[0]&&!N?e.c=e.e=e.s=null:(e.s*=O.s,N&&E?(e.c=[0],e.e=0):e.c=e.e=null),e;for(t=m(O.e/h)+m(e.e/h),e.s*=O.s,(s=N.length)<(p=E.length)&&(v=N,N=E,E=v,i=s,s=p,p=i),i=s+p,v=[];i--;v.push(0));for(b=a,y=d,i=p;--i>=0;){for(n=0,g=E[i]%y,w=E[i]/y|0,o=i+(u=s);o>i;)n=((l=g*(l=N[--u]%y)+(f=w*l+(c=N[u]/y|0)*g)%y*y+v[o]+n)/b|0)+(f/y|0)+w*c,v[o--]=l%b;v[o]=n}return n?++t:v.splice(0,1),H(e,v,t)},R.negated=function(){var e=new $(this);return e.s=-e.s||null,e},R.plus=function(e,r){var n,t=this,i=t.s;if(r=(e=new $(e,r)).s,!i||!r)return new $(NaN);if(i!=r)return e.s=-r,t.minus(e);var o=t.e/h,u=e.e/h,f=t.c,s=e.c;if(!o||!u){if(!f||!s)return new $(i/0);if(!f[0]||!s[0])return s[0]?e:new $(f[0]?t:0*i)}if(o=m(o),u=m(u),f=f.slice(),i=o-u){for(i>0?(u=o,n=s):(i=-i,n=f),n.reverse();i--;n.push(0));n.reverse()}for((i=f.length)-(r=s.length)<0&&(n=s,s=f,f=n,r=i),i=0;r;)i=(f[--r]=f[r]+s[r]+i)/a|0,f[r]=a===f[r]?0:f[r]%a;return i&&(f=[i].concat(f),++u),H(e,f,u)},R.precision=R.sd=function(e,r){var n,t,i,o=this;if(null!=e&&e!==!!e)return y(e,1,w),null==r?r=B:y(r,0,8),V(new $(o),e,r);if(!(n=o.c))return null;if(t=(i=n.length-1)*h+1,i=n[i]){for(;i%10==0;i/=10,t--);for(i=n[0];i>=10;i/=10,t++);}return e&&o.e+1>t&&(t=o.e+1),t},R.shiftedBy=function(e){return y(e,-p,p),this.times("1e"+e)},R.squareRoot=R.sqrt=function(){var e,r,t,i,o,u=this,f=u.c,s=u.s,l=u.e,c=T+4,a=new $("0.5");if(1!==s||!f||!f[0])return new $(!s||s<0&&(!f||f[0])?NaN:f?u:1/0);if(0==(s=Math.sqrt(+W(u)))||s==1/0?(((r=v(f)).length+l)%2==0&&(r+="0"),s=Math.sqrt(+r),l=m((l+1)/2)-(l<0||l%2),t=new $(r=s==1/0?"1e"+l:(r=s.toExponential()).slice(0,r.indexOf("e")+1)+l)):t=new $(s+""),t.c[0])for((s=(l=t.e)+c)<3&&(s=0);;)if(o=t,t=a.times(o.plus(n(u,o,c,1))),v(o.c).slice(0,s)===(r=v(t.c)).slice(0,s)){if(t.e<l&&--s,"9999"!=(r=r.slice(s-3,s+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(V(t,t.e+T+2,1),e=!t.times(t).eq(u));break}if(!i&&(V(o,o.e+T+2,0),o.times(o).eq(u))){t=o;break}c+=4,s+=4,i=1}return V(t,t.e+T+1,B,e)},R.toExponential=function(e,r){return null!=e&&(y(e,0,w),e++),q(this,e,r,1)},R.toFixed=function(e,r){return null!=e&&(y(e,0,w),e=e+this.e+1),q(this,e,r)},R.toFormat=function(e,r,n){var t,i=this;if(null==n)null!=e&&r&&"object"==typeof r?(n=r,r=null):e&&"object"==typeof e?(n=e,e=r=null):n=G;else if("object"!=typeof n)throw Error(l+"Argument not an object: "+n);if(t=i.toFixed(e,r),i.c){var o,u=t.split("."),f=+n.groupSize,s=+n.secondaryGroupSize,c=n.groupSeparator||"",a=u[0],h=u[1],p=i.s<0,g=p?a.slice(1):a,d=g.length;if(s&&(o=f,f=s,s=o,d-=o),f>0&&d>0){for(o=d%f||f,a=g.substr(0,o);o<d;o+=f)a+=c+g.substr(o,f);s>0&&(a+=c+g.slice(o)),p&&(a="-"+a)}t=h?a+(n.decimalSeparator||"")+((s=+n.fractionGroupSize)?h.replace(new RegExp("\\d{"+s+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):h):a}return(n.prefix||"")+t+(n.suffix||"")},R.toFraction=function(e){var r,t,i,o,u,f,s,c,a,p,d,w,m=this,b=m.c;if(null!=e&&(!(s=new $(e)).isInteger()&&(s.c||1!==s.s)||s.lt(D)))throw Error(l+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+W(s));if(!b)return new $(m);for(r=new $(D),a=t=new $(D),i=c=new $(D),w=v(b),u=r.e=w.length-m.e-1,r.c[0]=g[(f=u%h)<0?h+f:f],e=!e||s.comparedTo(r)>0?u>0?r:a:s,f=I,I=1/0,s=new $(w),c.c[0]=0;p=n(s,r,0,1),1!=(o=t.plus(p.times(i))).comparedTo(e);)t=i,i=o,a=c.plus(p.times(o=a)),c=o,r=s.minus(p.times(o=r)),s=o;return o=n(e.minus(t),i,0,1),c=c.plus(o.times(a)),t=t.plus(o.times(i)),c.s=a.s=m.s,d=n(a,i,u*=2,B).minus(m).abs().comparedTo(n(c,t,u,B).minus(m).abs())<1?[a,i]:[c,t],I=f,d},R.toNumber=function(){return+W(this)},R.toPrecision=function(e,r){return null!=e&&y(e,1,w),q(this,e,r,2)},R.toString=function(e){var r,n=this,i=n.s,o=n.e;return null===o?i?(r="Infinity",i<0&&(r="-"+r)):r="NaN":(null==e?r=o<=L||o>=U?N(v(n.c),o):E(v(n.c),o,"0"):10===e?r=E(v((n=V(new $(n),T+o+1,B)).c),n.e,"0"):(y(e,2,k.length,"Base"),r=t(E(v(n.c),o,"0"),10,e,i,!0)),i<0&&n.c[0]&&(r="-"+r)),r},R.valueOf=R.toJSON=function(){return W(this)},R._isBigNumber=!0,null!=r&&$.set(r),$}()).default=o.BigNumber=o,void 0===(t=function(){return o}.call(r,n,r,e))||(e.exports=t)}()},function(e,r){e.exports=require("fs")}]);