parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"Focm":[function(require,module,exports) {
var n={};!function(t){"use strict";(n["Control.Apply"]=n["Control.Apply"]||{}).arrayApply=function(n){return function(t){for(var r=n.length,e=t.length,a=new Array(r*e),o=0,i=0;i<r;i++)for(var u=n[i],c=0;c<e;c++)a[o++]=u(t[c]);return a}}}(),function(n){"use strict";var t=function(n){this.compose=n},r=new t(function(n){return function(t){return function(r){return n(t(r))}}});n.compose=function(n){return n.compose},n.Semigroupoid=t,n.semigroupoidFn=r}(n["Control.Semigroupoid"]=n["Control.Semigroupoid"]||{}),function(t){"use strict";var r=n["Control.Semigroupoid"],e=function(n,t){this.Semigroupoid0=n,this.identity=t},a=new e(function(){return r.semigroupoidFn},function(n){return n});t.Category=e,t.identity=function(n){return n.identity},t.categoryFn=a}(n["Control.Category"]=n["Control.Category"]||{}),function(t){"use strict";(n["Data.Eq"]=n["Data.Eq"]||{}).refEq=function(n){return function(t){return n===t}}}(),function(t){"use strict";(n["Data.Unit"]=n["Data.Unit"]||{}).unit={}}(),function(t){"use strict";(n["Data.Show"]=n["Data.Show"]||{}).showIntImpl=function(n){return n.toString()}}(),function(t){"use strict";var r=n["Data.Show"],e=(n["Data.Symbol"],n["Record.Unsafe"],n["Type.Data.RowList"],function(n){this.show=n}),a=new e(r.showIntImpl);t.Show=e,t.show=function(n){return n.show},t.showInt=a}(n["Data.Show"]=n["Data.Show"]||{}),function(t){"use strict";var r=n["Data.Unit"];n["Data.Show"];t.unit=r.unit}(n["Data.Unit"]=n["Data.Unit"]||{}),function(t){"use strict";var r=n["Data.Eq"],e=(n["Data.HeytingAlgebra"],n["Data.Symbol"],n["Data.Unit"],n["Data.Void"],n["Record.Unsafe"],n["Type.Data.RowList"],function(n){this.eq=n}),a=new e(r.refEq);t.Eq=e,t.eq=function(n){return n.eq},t.eqInt=a}(n["Data.Eq"]=n["Data.Eq"]||{}),function(t){"use strict";(n["Data.Ord.Unsafe"]=n["Data.Ord.Unsafe"]||{}).unsafeCompareImpl=function(n){return function(t){return function(r){return function(e){return function(a){return e<a?n:e===a?t:r}}}}}}(),function(t){"use strict";n["Data.Semigroup"],n["Data.Symbol"],n["Data.Unit"],n["Data.Void"],n["Record.Unsafe"],n["Type.Data.RowList"];t.Semigroup=function(n){this.append=n},t.append=function(n){return n.append}}(n["Data.Semigroup"]=n["Data.Semigroup"]||{}),function(t){"use strict";n["Data.Eq"],n["Data.Semigroup"],n["Data.Show"];var r=function(){function n(){}return n.value=new n,n}(),e=function(){function n(){}return n.value=new n,n}(),a=function(){function n(){}return n.value=new n,n}();t.LT=r,t.GT=e,t.EQ=a}(n["Data.Ordering"]=n["Data.Ordering"]||{}),function(t){"use strict";var r=n["Data.Ord.Unsafe"],e=n["Data.Ordering"],a=r.unsafeCompareImpl(e.LT.value)(e.EQ.value)(e.GT.value);t.unsafeCompare=a}(n["Data.Ord.Unsafe"]=n["Data.Ord.Unsafe"]||{}),function(t){"use strict";n["Data.Ord"];var r=n["Data.Eq"],e=n["Data.Ord.Unsafe"],a=(n["Data.Ordering"],n["Data.Ring"],n["Data.Semiring"],n["Data.Symbol"],n["Data.Unit"],n["Data.Void"],n["Record.Unsafe"],n["Type.Data.RowList"],function(n,t){this.Eq0=n,this.compare=t}),o=new a(function(){return r.eqInt},e.unsafeCompare);t.Ord=a,t.compare=function(n){return n.compare},t.ordInt=o}(n["Data.Ord"]=n["Data.Ord"]||{}),function(t){"use strict";n["Control.Category"],n["Data.Boolean"],n["Data.Ord"],n["Data.Ring"];t.flip=function(n){return function(t){return function(r){return n(r)(t)}}},t.const=function(n){return function(t){return n}}}(n["Data.Function"]=n["Data.Function"]||{}),function(t){"use strict";(n["Data.Functor"]=n["Data.Functor"]||{}).arrayMap=function(n){return function(t){for(var r=t.length,e=new Array(r),a=0;a<r;a++)e[a]=n(t[a]);return e}}}(),function(t){"use strict";var r=n["Data.Functor"],e=(n["Control.Semigroupoid"],n["Data.Function"]),a=n["Data.Unit"],o=function(n){this.map=n},i=function(n){return n.map},u=new o(r.arrayMap);t.Functor=o,t.map=i,t.void=function(n){return i(n)(e.const(a.unit))},t.functorArray=u}(n["Data.Functor"]=n["Data.Functor"]||{}),function(t){"use strict";var r=n["Control.Apply"],e=n["Control.Category"],a=n["Data.Function"],o=n["Data.Functor"],i=function(n,t){this.Functor0=n,this.apply=t},u=new i(function(){return o.functorArray},r.arrayApply),c=function(n){return n.apply};t.Apply=i,t.apply=c,t.applySecond=function(n){return function(t){return function(r){return c(n)(o.map(n.Functor0())(a.const(e.identity(e.categoryFn)))(t))(r)}}},t.applyArray=u}(n["Control.Apply"]=n["Control.Apply"]||{}),function(t){"use strict";var r=n["Control.Apply"],e=(n["Data.Functor"],n["Data.Unit"],function(n){return n.pure});t.Applicative=function(n,t){this.Apply0=n,this.pure=t},t.pure=e,t.liftA1=function(n){return function(t){return function(a){return r.apply(n.Apply0())(e(n)(t))(a)}}}}(n["Control.Applicative"]=n["Control.Applicative"]||{}),function(t){"use strict";(n["Control.Bind"]=n["Control.Bind"]||{}).arrayBind=function(n){return function(t){for(var r=[],e=0,a=n.length;e<a;e++)Array.prototype.push.apply(r,t(n[e]));return r}}}(),function(t){"use strict";var r=n["Control.Bind"],e=(n["Control.Applicative"],n["Control.Apply"]),a=(n["Control.Category"],n["Data.Function"]),o=(n["Data.Functor"],n["Data.Unit"],function(n,t){this.Apply0=n,this.bind=t}),i=new o(function(){return e.applyArray},r.arrayBind),u=function(n){return n.bind},c=function(n){return a.flip(u(n))};t.Bind=o,t.bind=u,t.bindFlipped=c,t.composeKleisliFlipped=function(n){return function(t){return function(r){return function(e){return c(n)(t)(r(e))}}}},t.bindArray=i}(n["Control.Bind"]=n["Control.Bind"]||{}),function(n){"use strict";n.length=function(n){return n.length},n.indexImpl=function(n){return function(t){return function(r){return function(e){return e<0||e>=r.length?t:n(r[e])}}}},n.sortImpl=function(n){return function(t){return t.slice().sort(function(t,r){return n(t)(r)})}},n.slice=function(n){return function(t){return function(r){return r.slice(n,t)}}}}(n["Data.Array"]=n["Data.Array"]||{}),function(n){"use strict";n.foldrArray=function(n){return function(t){return function(r){for(var e=t,a=r.length-1;a>=0;a--)e=n(r[a])(e);return e}}},n.foldlArray=function(n){return function(t){return function(r){for(var e=t,a=r.length,o=0;o<a;o++)e=n(e)(r[o]);return e}}}}(n["Data.Foldable"]=n["Data.Foldable"]||{}),function(t){"use strict";var r=n["Control.Applicative"],e=(n["Control.Apply"],n["Control.Bind"]);n["Data.Functor"],n["Data.Unit"];t.Monad=function(n,t){this.Applicative0=n,this.Bind1=t},t.ap=function(n){return function(t){return function(a){return e.bind(n.Bind1())(t)(function(t){return e.bind(n.Bind1())(a)(function(e){return r.pure(n.Applicative0())(t(e))})})}}}}(n["Control.Monad"]=n["Control.Monad"]||{}),function(t){"use strict";n["Data.Boolean"],n["Data.Eq"],n["Data.EuclideanRing"],n["Data.Ord"],n["Data.Ordering"],n["Data.Semigroup"],n["Data.Symbol"],n["Data.Unit"],n["Record.Unsafe"],n["Type.Data.RowList"];t.Monoid=function(n,t){this.Semigroup0=n,this.mempty=t},t.mempty=function(n){return n.mempty}}(n["Data.Monoid"]=n["Data.Monoid"]||{}),function(t){"use strict";n["Control.Alt"],n["Control.Alternative"];var r=n["Control.Applicative"],e=n["Control.Apply"],a=n["Control.Bind"],o=(n["Control.Category"],n["Control.Extend"],n["Control.Monad"],n["Control.MonadZero"],n["Control.Plus"],n["Data.Bounded"],n["Data.Eq"],n["Data.Function"],n["Data.Functor"]),i=(n["Data.Functor.Invariant"],n["Data.Monoid"],n["Data.Ord"],n["Data.Ordering"],n["Data.Semigroup"],n["Data.Show"],n["Data.Unit"],n.Prelude,function(){function n(){}return n.value=new n,n}()),u=function(){function n(n){this.value0=n}return n.create=function(t){return new n(t)},n}(),c=new o.Functor(function(n){return function(t){return t instanceof u?new u(n(t.value0)):i.value}}),f=new e.Apply(function(){return c},function(n){return function(t){if(n instanceof u)return o.map(c)(n.value0)(t);if(n instanceof i)return i.value;throw new Error("Failed pattern match at Data.Maybe (line 67, column 1 - line 67, column 35): "+[n.constructor.name,t.constructor.name])}}),l=new a.Bind(function(){return f},function(n){return function(t){if(n instanceof u)return t(n.value0);if(n instanceof i)return i.value;throw new Error("Failed pattern match at Data.Maybe (line 125, column 1 - line 125, column 33): "+[n.constructor.name,t.constructor.name])}}),s=new r.Applicative(function(){return f},u.create);t.Nothing=i,t.Just=u,t.maybe=function(n){return function(t){return function(r){if(r instanceof i)return n;if(r instanceof u)return t(r.value0);throw new Error("Failed pattern match at Data.Maybe (line 217, column 1 - line 217, column 51): "+[n.constructor.name,t.constructor.name,r.constructor.name])}}},t.functorMaybe=c,t.applyMaybe=f,t.applicativeMaybe=s,t.bindMaybe=l}(n["Data.Maybe"]=n["Data.Maybe"]||{}),function(t){"use strict";var r=n["Data.Foldable"],e=(n["Control.Alt"],n["Control.Applicative"]),a=n["Control.Apply"],o=(n["Control.Bind"],n["Control.Category"],n["Control.Plus"],n["Control.Semigroupoid"],n["Data.Eq"],n["Data.Function"],n["Data.Functor"],n["Data.HeytingAlgebra"],n["Data.Maybe"],n["Data.Maybe.First"],n["Data.Maybe.Last"],n["Data.Monoid"]),i=(n["Data.Monoid.Additive"],n["Data.Monoid.Conj"],n["Data.Monoid.Disj"],n["Data.Monoid.Dual"],n["Data.Monoid.Endo"],n["Data.Monoid.Multiplicative"],n["Data.Newtype"],n["Data.Ord"],n["Data.Ordering"],n["Data.Semigroup"]),u=(n["Data.Semiring"],n["Data.Unit"]),c=(n.Prelude,function(n,t,r){this.foldMap=n,this.foldl=t,this.foldr=r}),f=function(n){return n.foldr},l=function(n){return function(t){return function(r){return f(n)(function(n){return function(e){return i.append(t.Semigroup0())(r(n))(e)}})(o.mempty(t))}}},s=new c(function(n){return l(s)(n)},r.foldlArray,r.foldrArray);t.Foldable=c,t.foldr=f,t.foldl=function(n){return n.foldl},t.foldMap=function(n){return n.foldMap},t.foldMapDefaultR=l,t.traverse_=function(n){return function(t){return function(r){return f(t)(function(t){return a.applySecond(n.Apply0())(r(t))})(e.pure(n)(u.unit))}}},t.foldableArray=s}(n["Data.Foldable"]=n["Data.Foldable"]||{}),function(t){"use strict";(n["Partial.Unsafe"]=n["Partial.Unsafe"]||{}).unsafePartial=function(n){return n()}}(),function(t){"use strict";(n["Partial"]=n["Partial"]||{}).crashWith=function(){return function(n){throw new Error(n)}}}(),function(t){"use strict";var r=n.Partial;t.crashWith=r.crashWith}(n.Partial=n.Partial||{}),function(t){"use strict";var r=n["Partial.Unsafe"],e=n.Partial;t.unsafeCrashWith=function(n){return r.unsafePartial(function(t){return e.crashWith(t)(n)})}}(n["Partial.Unsafe"]=n["Partial.Unsafe"]||{}),function(t){"use strict";(n["Unsafe.Coerce"]=n["Unsafe.Coerce"]||{}).unsafeCoerce=function(n){return n}}(),function(t){"use strict";var r=n["Unsafe.Coerce"];t.unsafeCoerce=r.unsafeCoerce}(n["Unsafe.Coerce"]=n["Unsafe.Coerce"]||{}),function(t){"use strict";var r=n["Data.Array"],e=(n["Control.Alt"],n["Control.Alternative"],n["Control.Applicative"],n["Control.Apply"],n["Control.Bind"]),a=(n["Control.Category"],n["Control.Lazy"],n["Control.Monad.Rec.Class"],n["Control.Monad.ST"],n["Control.Monad.ST.Internal"],n["Control.Semigroupoid"],n["Data.Array.NonEmpty.Internal"],n["Data.Array.ST"],n["Data.Array.ST.Iterator"],n["Data.Boolean"],n["Data.Eq"],n["Data.Foldable"],n["Data.Function"]),o=(n["Data.Functor"],n["Data.HeytingAlgebra"],n["Data.Maybe"]),i=(n["Data.Ord"],n["Data.Ordering"]),u=(n["Data.Ring"],n["Data.Semigroup"],n["Data.Semiring"],n["Data.Traversable"],n["Data.Tuple"],n["Data.Unfoldable"],n["Partial.Unsafe"],n.Prelude,n["Unsafe.Coerce"],function(n){return[n]}),c=r.indexImpl(o.Just.create)(o.Nothing.value),f=a.flip(e.bind(e.bindArray));t.singleton=u,t.index=c,t.concatMap=f,t.mapMaybe=function(n){return f(function(t){return o.maybe([])(u)(n(t))})},t.sortBy=function(n){return function(t){return r.sortImpl(function(t){return function(r){var e=n(t)(r);if(e instanceof i.GT)return 1;if(e instanceof i.EQ)return 0;if(e instanceof i.LT)return-1;throw new Error("Failed pattern match at Data.Array (line 702, column 15 - line 707, column 1): "+[e.constructor.name])}})(t)}}}(n["Data.Array"]=n["Data.Array"]||{}),function(t){"use strict";n["Control.Alt"];var r=n["Control.Applicative"],e=n["Control.Apply"],a=n["Control.Bind"],o=(n["Control.Extend"],n["Control.Monad"],n["Control.Semigroupoid"],n["Data.Bifoldable"],n["Data.Bifunctor"],n["Data.Bitraversable"],n["Data.Bounded"],n["Data.Eq"],n["Data.Foldable"],n["Data.FoldableWithIndex"],n["Data.Function"],n["Data.Functor"]),i=(n["Data.Functor.Invariant"],n["Data.FunctorWithIndex"],n["Data.Maybe"]),u=(n["Data.Monoid"],n["Data.Ord"],n["Data.Ordering"],n["Data.Semigroup"],n["Data.Show"],n["Data.Traversable"],n["Data.TraversableWithIndex"],n["Data.Unit"],n.Prelude,function(){function n(n){this.value0=n}return n.create=function(t){return new n(t)},n}()),c=function(){function n(n){this.value0=n}return n.create=function(t){return new n(t)},n}(),f=new o.Functor(function(n){return function(t){if(t instanceof u)return new u(t.value0);if(t instanceof c)return new c(n(t.value0));throw new Error("Failed pattern match at Data.Either (line 38, column 8 - line 38, column 52): "+[t.constructor.name])}}),l=function(n){return function(t){return function(r){if(r instanceof u)return n(r.value0);if(r instanceof c)return t(r.value0);throw new Error("Failed pattern match at Data.Either (line 238, column 1 - line 238, column 64): "+[n.constructor.name,t.constructor.name,r.constructor.name])}}},s=new e.Apply(function(){return f},function(n){return function(t){if(n instanceof u)return new u(n.value0);if(n instanceof c)return o.map(f)(n.value0)(t);throw new Error("Failed pattern match at Data.Either (line 82, column 1 - line 82, column 41): "+[n.constructor.name,t.constructor.name])}}),p=new a.Bind(function(){return s},l(function(n){return function(t){return new u(n)}})(function(n){return function(t){return t(n)}})),d=new r.Applicative(function(){return s},c.create);t.Left=u,t.Right=c,t.either=l,t.note=function(n){return i.maybe(new u(n))(c.create)},t.functorEither=f,t.applyEither=s,t.applicativeEither=d,t.bindEither=p}(n["Data.Either"]=n["Data.Either"]||{}),function(t){"use strict";(n["Data.Int"]=n["Data.Int"]||{}).fromStringAsImpl=function(n){return function(t){return function(r){var e;e=r<11?"[0-"+(r-1).toString()+"]":11===r?"[0-9a]":"[0-9a-"+String.fromCharCode(86+r)+"]";var a=new RegExp("^[\\+\\-]?"+e+"+$","i");return function(e){if(a.test(e)){var o=parseInt(e,r);return(0|o)===o?n(o):t}return t}}}}}(),function(t){"use strict";var r=n["Data.Int"],e=(n["Control.Category"],n["Control.Semigroupoid"],n["Data.Boolean"],n["Data.Bounded"],n["Data.CommutativeRing"],n["Data.DivisionRing"],n["Data.Eq"],n["Data.EuclideanRing"],n["Data.HeytingAlgebra"],n["Data.Int.Bits"],n["Data.Maybe"]),a=(n["Data.Ord"],n["Data.Ordering"],n["Data.Ring"],n["Data.Semiring"],n["Data.Show"],n.Global,n.Math,n.Prelude,r.fromStringAsImpl(e.Just.create)(e.Nothing.value)),o=a(10);t.fromString=o,t.fromStringAs=a}(n["Data.Int"]=n["Data.Int"]||{}),function(n){"use strict";n.split=function(n){return function(t){return t.split(n)}},n.trim=function(n){return n.trim()}}(n["Data.String.Common"]=n["Data.String.Common"]||{}),function(t){"use strict";var r=n["Data.String.Common"];n["Data.Eq"],n["Data.Ordering"],n["Data.String.Pattern"],n.Prelude;t.split=r.split,t.trim=r.trim}(n["Data.String.Common"]=n["Data.String.Common"]||{}),function(n){"use strict";n.pureE=function(n){return function(){return n}},n.bindE=function(n){return function(t){return function(){return t(n())()}}}}(n.Effect=n.Effect||{}),function(t){"use strict";var r=n.Effect,e=n["Control.Applicative"],a=n["Control.Apply"],o=n["Control.Bind"],i=n["Control.Monad"],u=n["Data.Functor"],c=(n["Data.Monoid"],n["Data.Semigroup"],n.Prelude,new i.Monad(function(){return s},function(){return f})),f=new o.Bind(function(){return l},r.bindE),l=new a.Apply(function(){return p},i.ap(c)),s=new e.Applicative(function(){return l},r.pureE),p=new u.Functor(e.liftA1(s));t.functorEffect=p,t.applyEffect=l,t.applicativeEffect=s,t.bindEffect=f,t.monadEffect=c}(n.Effect=n.Effect||{}),function(n){"use strict";var t=function(){var n={},t="Pure",r="Throw",e="Catch",a="Sync",o="Async",i="Bind",u="Bracket",c="Fork",f="Sequential",l="Map",s="Apply",p="Alt",d="Cons",D="Resume",m="Release",h="Finalizer",w="Finalized",C="Forked";function v(n,t,r,e){this.tag=n,this._1=t,this._2=r,this._3=e}function y(n){var t=function(t,r,e){return new v(n,t,r,e)};return t.tag=n,t}function g(n){return new v(t,void 0)}function E(n){try{n()}catch(t){setTimeout(function(){throw t},0)}}function A(n,t,r){try{return t(r())}catch(e){return n(e)}}function b(n,t,r){try{return t(r)()}catch(e){return r(n(e))(),g}}var S=function(){var n=1024,t=0,r=0,e=new Array(n),a=!1;function o(){var o;for(a=!0;0!==t;)t--,o=e[r],e[r]=void 0,r=(r+1)%n,o();a=!1}return{isDraining:function(){return a},enqueue:function(i){var u;t===n&&(u=a,o(),a=u),e[(r+t)%n]=i,t++,a||o()}}}();var _=0,F=1,M=2,P=3,B=4,U=5,k=6;function R(n,l,s){var p=0,C=_,y=s,g=null,I=null,L=null,N=null,q=null,O=0,x=0,W=null,H=!0;function j(s){for(var x,z,G;;)switch(x=null,z=null,G=null,C){case M:C=F,y=L(y),null===N?L=null:(L=N._1,N=N._2);break;case P:n.isLeft(y)?(C=U,g=y,y=null):null===L?C=U:(C=M,y=n.fromRight(y));break;case F:switch(y.tag){case i:L&&(N=new v(d,L,N)),L=y._2,C=F,y=y._1;break;case t:null===L?(C=U,y=n.right(y._1)):(C=M,y=y._1);break;case a:C=P,y=A(n.left,n.right,y._1);break;case o:return C=B,void(y=b(n.left,y._1,function(n){return function(){p===s&&(p++,S.enqueue(function(){p===s+1&&(C=P,y=n,j(p))}))}}));case r:C=U,g=n.left(y._1),y=null;break;case e:q=new v(d,y,null===L?q:new v(d,new v(D,L,N),q,I),I),L=null,N=null,C=F,y=y._1;break;case u:O++,q=new v(d,y,null===L?q:new v(d,new v(D,L,N),q,I),I),L=null,N=null,C=F,y=y._1;break;case c:C=P,x=R(n,l,y._2),l&&l.register(x),y._1&&x.run(),y=n.right(x);break;case f:C=F,y=T(n,l,y._1)}break;case U:if(L=null,N=null,null===q)C=k,y=I||g||y;else switch(x=q._3,G=q._1,q=q._2,G.tag){case e:I&&I!==x?C=U:g&&(C=F,y=G._2(n.fromLeft(g)),g=null);break;case D:I&&I!==x||g?C=U:(L=G._1,N=G._2,C=M,y=n.fromRight(y));break;case u:O--,null===g&&(z=n.fromRight(y),q=new v(d,new v(m,G._2,z),q,x),(I===x||O>0)&&(C=F,y=G._3(z)));break;case m:O++,q=new v(d,new v(w,y,g),q,I),C=F,y=I&&I!==x?G._1.killed(n.fromLeft(I))(G._2):g?G._1.failed(n.fromLeft(g))(G._2):G._1.completed(n.fromRight(y))(G._2),g=null;break;case h:O++,q=new v(d,new v(w,y,g),q,I),C=F,y=G._1;break;case w:O--,C=U,y=G._1,g=G._2}break;case k:for(var J in W)W.hasOwnProperty(J)&&(H=H&&W[J].rethrow,E(W[J].handler(y)));return W=null,void(I&&g?setTimeout(function(){throw n.fromLeft(g)},0):n.isLeft(y)&&H&&setTimeout(function(){if(H)throw n.fromLeft(y)},0));case _:C=F;break;case B:return}}function z(n){return function(){if(C===k)return H=H&&n.rethrow,n.handler(y)(),function(){};var t=x++;return(W=W||{})[t]=n,function(){null!==W&&delete W[t]}}}return{kill:function(t,r){return function(){if(C===k)return r(n.right(void 0))(),function(){};var e=z({rethrow:!1,handler:function(){return r(n.right(void 0))}})();switch(C){case _:I=n.left(t),C=k,y=I,j(p);break;case B:null===I&&(I=n.left(t)),0===O&&(C===B&&(q=new v(d,new v(h,y(t)),q,I)),C=U,y=null,g=null,j(++p));break;default:null===I&&(I=n.left(t)),0===O&&(C=U,y=null,g=null)}return e}},join:function(n){return function(){var t=z({rethrow:!1,handler:n})();return C===_&&j(p),t}},onComplete:z,isSuspended:function(){return C===_},run:function(){C===_&&(S.isDraining()?j(p):S.enqueue(function(){j(p)}))}}}function I(t,r,e,a){var i=0,u={},c=0,f={},D=new Error("[ParAff] Early exit"),m=null,h=n;function w(r,e,a){var o,i,c=e,f=null,D=null,m=0,h={};n:for(;;)switch(o=null,c.tag){case C:if(c._3===n&&(o=u[c._1],h[m++]=o.kill(r,function(n){return function(){0===--m&&a(n)()}})),null===f)break n;c=f._2,null===D?f=null:(f=D._1,D=D._2);break;case l:c=c._2;break;case s:case p:f&&(D=new v(d,f,D)),f=c,c=c._1}if(0===m)a(t.right(void 0))();else for(i=0,o=m;i<o;i++)h[i]=h[i]();return h}function y(r){return function(e){return function(){delete u[r._1],r._3=e,function r(e,o,i){var u,d,h,C,v,y;for(t.isLeft(e)?(u=e,d=null):(d=e,u=null);;){if(h=null,C=null,v=null,y=null,null!==m)return;if(null===o)return void a(u||d)();if(o._3!==n)return;switch(o.tag){case l:null===u?(o._3=t.right(o._1(t.fromRight(d))),d=o._3):o._3=u;break;case s:if(h=o._1._3,C=o._2._3,u){if(o._3=u,v=!0,y=c++,f[y]=w(D,u===h?o._2:o._1,function(){return function(){delete f[y],v?v=!1:null===i?r(u,null,null):r(u,i._1,i._2)}}),v)return void(v=!1)}else{if(h===n||C===n)return;d=t.right(t.fromRight(h)(t.fromRight(C))),o._3=d}break;case p:if(h=o._1._3,C=o._2._3,h===n&&t.isLeft(C)||C===n&&t.isLeft(h))return;if(h!==n&&t.isLeft(h)&&C!==n&&t.isLeft(C))u=d===h?C:h,d=null,o._3=u;else if(o._3=d,v=!0,y=c++,f[y]=w(D,d===h?o._2:o._1,function(){return function(){delete f[y],v?v=!1:null===i?r(d,null,null):r(d,i._1,i._2)}}),v)return void(v=!1)}null===i?o=null:(o=i._1,i=i._2)}}(e,r._2._1,r._2._2)}}}return function(){var a,o,c=F,f=e,D=null,m=null;n:for(;;)switch(a=null,o=null,c){case F:switch(f.tag){case l:D&&(m=new v(d,D,m)),D=new v(l,f._1,n,n),f=f._2;break;case s:D&&(m=new v(d,D,m)),D=new v(s,n,f._2,n),f=f._1;break;case p:D&&(m=new v(d,D,m)),D=new v(p,n,f._2,n),f=f._1;break;default:o=i++,c=U,a=f,f=new v(C,o,new v(d,D,m),n),(a=R(t,r,a)).onComplete({rethrow:!1,handler:y(f)})(),u[o]=a,r&&r.register(a)}break;case U:if(null===D)break n;D._1===n?(D._1=f,c=F,f=D._2,D._2=n):(D._2=f,f=D,null===m?D=null:(D=m._1,m=m._2))}for(h=f,o=0;o<i;o++)u[o].run()}(),function(n){return new v(o,function(r){return function(){return function(n,r){var e;for(var a in m=t.left(n),f)if(f.hasOwnProperty(a))for(a in e=f[a])e.hasOwnProperty(a)&&e[a]();f=null;var i=w(n,h,r);return function(n){return new v(o,function(n){return function(){for(var n in i)i.hasOwnProperty(n)&&i[n]();return g}})}}(n,r)}})}}function T(n,t,r){return new v(o,function(e){return function(){return I(n,t,r,e)}})}return v.EMPTY=n,v.Pure=y(t),v.Throw=y(r),v.Catch=y(e),v.Sync=y(a),v.Async=y(o),v.Bind=y(i),v.Bracket=y(u),v.Fork=y(c),v.Seq=y(f),v.ParMap=y(l),v.ParApply=y(s),v.ParAlt=y(p),v.Fiber=R,v.Supervisor=function(n){var t={},r=0,e=0;return{register:function(n){var a=r++;n.onComplete({rethrow:!0,handler:function(n){return function(){e--,delete t[a]}}}),t[a]=n,e++},isEmpty:function(){return 0===e},killAll:function(o,i){return function(){var u=0,c={};function f(r){c[r]=t[r].kill(o,function(t){return function(){delete c[r],u--,n.isLeft(t)&&n.fromLeft(t)&&setTimeout(function(){throw n.fromLeft(t)},0),0===u&&i()}})()}for(var l in t)t.hasOwnProperty(l)&&(u++,f(l));return t={},r=0,e=0,function(n){return new v(a,function(){for(var n in c)c.hasOwnProperty(n)&&c[n]()})}}}}},v.Scheduler=S,v.nonCanceler=g,v}();n._pure=t.Pure,n._map=function(n){return function(r){return r.tag===t.Pure.tag?t.Pure(n(r._1)):t.Bind(r,function(r){return t.Pure(n(r))})}},n._bind=function(n){return function(r){return t.Bind(n,r)}},n._liftEffect=t.Sync,n._parAffMap=function(n){return function(r){return t.ParMap(n,r)}},n._parAffApply=function(n){return function(r){return t.ParApply(n,r)}},n.makeAff=t.Async,n._makeFiber=function(n,r){return function(){return t.Fiber(n,null,r)}},n._sequential=t.Seq}(n["Effect.Aff"]=n["Effect.Aff"]||{}),function(t){"use strict";n["Control.Category"],n["Control.Monad"],n.Effect;t.liftEffect=function(n){return n.liftEffect},t.MonadEffect=function(n,t){this.Monad0=n,this.liftEffect=t}}(n["Effect.Class"]=n["Effect.Class"]||{}),function(n){"use strict";n.new=function(n){return function(){return{value:n}}},n.read=function(n){return function(){return n.value}},n.write=function(n){return function(t){return function(){return t.value=n,{}}}}}(n["Effect.Ref"]=n["Effect.Ref"]||{}),function(t){"use strict";var r=n["Effect.Ref"];n["Data.Function"],n["Data.Functor"],n.Effect,n.Prelude;t.new=r.new,t.read=r.read,t.write=r.write}(n["Effect.Ref"]=n["Effect.Ref"]||{}),function(t){"use strict";n["Control.Alt"],n["Control.Alternative"],n["Control.Applicative"],n["Control.Apply"],n["Control.Bind"],n["Control.Monad.Cont.Trans"],n["Control.Monad.Except.Trans"],n["Control.Monad.Maybe.Trans"],n["Control.Monad.Reader.Trans"],n["Control.Monad.Writer.Trans"],n["Control.Plus"],n["Control.Semigroupoid"],n["Data.Either"],n["Data.Function"],n["Data.Functor"],n["Data.Functor.Compose"],n["Data.Maybe"],n["Data.Newtype"],n["Data.Unit"],n["Effect.Class"],n["Effect.Ref"],n.Prelude;t.parallel=function(n){return n.parallel},t.sequential=function(n){return n.sequential},t.Parallel=function(n,t,r,e){this.Applicative1=n,this.Monad0=t,this.parallel=r,this.sequential=e}}(n["Control.Parallel.Class"]=n["Control.Parallel.Class"]||{}),function(t){"use strict";n["Control.Alternative"],n["Control.Apply"];var r=n["Control.Category"],e=n["Control.Parallel.Class"],a=(n["Control.Semigroupoid"],n["Data.Foldable"]),o=(n["Data.Traversable"],n.Prelude,function(n){return function(t){return function(r){return function(o){return e.sequential(n)(a.traverse_(n.Applicative1())(t)(function(t){return e.parallel(n)(r(t))})(o))}}}});t.parTraverse_=o,t.parSequence_=function(n){return function(t){return o(n)(t)(r.identity(r.categoryFn))}}}(n["Control.Parallel"]=n["Control.Parallel"]||{}),function(n){"use strict";n.error=function(n){return new Error(n)},n.throwException=function(n){return function(){throw n}}}(n["Effect.Exception"]=n["Effect.Exception"]||{}),function(t){"use strict";var r=n["Effect.Exception"];n["Control.Applicative"],n["Control.Semigroupoid"],n["Data.Either"],n["Data.Functor"],n["Data.Maybe"],n["Data.Show"],n.Effect,n.Prelude;t.throw=function(n){return r.throwException(r.error(n))}}(n["Effect.Exception"]=n["Effect.Exception"]||{}),function(t){"use strict";var r=n["Effect.Aff"],e=(n["Control.Alt"],n["Control.Alternative"],n["Control.Applicative"]),a=n["Control.Apply"],o=n["Control.Bind"],i=(n["Control.Lazy"],n["Control.Monad"]),u=(n["Control.Monad.Error.Class"],n["Control.Monad.Rec.Class"],n["Control.Parallel"]),c=n["Control.Parallel.Class"],f=(n["Control.Plus"],n["Control.Semigroupoid"],n["Data.Either"]),l=n["Data.Foldable"],s=n["Data.Function"],p=(n["Data.Function.Uncurried"],n["Data.Functor"]),d=n["Data.Monoid"],D=(n["Data.Newtype"],n["Data.Semigroup"]),m=(n["Data.Time.Duration"],n["Data.Unit"]),h=n.Effect,w=n["Effect.Class"],C=(n["Effect.Exception"],n["Effect.Unsafe"],n["Partial.Unsafe"]),v=(n.Prelude,n["Unsafe.Coerce"]),y=new p.Functor(r._parAffMap),g=new p.Functor(r._map),E={isLeft:function(n){if(n instanceof f.Left)return!0;if(n instanceof f.Right)return!1;throw new Error("Failed pattern match at Effect.Aff (line 390, column 12 - line 392, column 20): "+[n.constructor.name])},fromLeft:function(n){if(n instanceof f.Left)return n.value0;if(n instanceof f.Right)return C.unsafeCrashWith("unsafeFromLeft: Right");throw new Error("Failed pattern match at Effect.Aff (line 395, column 20 - line 399, column 3): "+[n.constructor.name])},fromRight:function(n){if(n instanceof f.Right)return n.value0;if(n instanceof f.Left)return C.unsafeCrashWith("unsafeFromRight: Left");throw new Error("Failed pattern match at Effect.Aff (line 400, column 21 - line 402, column 31): "+[n.constructor.name])},left:f.Left.create,right:f.Right.create},A=function(n){return function(){var t=function(n){return r._makeFiber(E,n)}(n)();return t.run(),t}},b=new a.Apply(function(){return y},r._parAffApply),S=new i.Monad(function(){return M},function(){return _}),_=new o.Bind(function(){return F},r._bind),F=new a.Apply(function(){return g},i.ap(S)),M=new e.Applicative(function(){return F},r._pure),P=new w.MonadEffect(function(){return S},r._liftEffect),B=new c.Parallel(function(){return U},function(){return S},v.unsafeCoerce,r._sequential),U=new e.Applicative(function(){return b},function(n){return c.parallel(B)(e.pure(M)(n))}),k=new D.Semigroup(function(n){return function(t){return function(r){return u.parSequence_(B)(l.foldableArray)([n(r),t(r)])}}}),R=s.const(e.pure(M)(m.unit)),I=new d.Monoid(function(){return k},R);t.launchAff=A,t.launchAff_=function(n){return p.void(h.functorEffect)(A(n))},t.nonCanceler=R,t.functorAff=g,t.applyAff=F,t.applicativeAff=M,t.bindAff=_,t.monadAff=S,t.monadEffectAff=P,t.functorParAff=y,t.applyParAff=b,t.applicativeParAff=U,t.parallelAff=B,t.semigroupCanceler=k,t.monoidCanceler=I,t.makeAff=r.makeAff}(n["Effect.Aff"]=n["Effect.Aff"]||{}),function(t){"use strict";n["Node.Encoding"];var r=n["Data.Show"],e=(n.Prelude,function(){function n(){}return n.value=new n,n}()),a=function(){function n(){}return n.value=new n,n}(),o=function(){function n(){}return n.value=new n,n}(),i=function(){function n(){}return n.value=new n,n}(),u=function(){function n(){}return n.value=new n,n}(),c=function(){function n(){}return n.value=new n,n}(),f=function(){function n(){}return n.value=new n,n}(),l=function(){function n(){}return n.value=new n,n}(),s=new r.Show(function(n){if(n instanceof e)return"ASCII";if(n instanceof a)return"UTF8";if(n instanceof o)return"UTF16LE";if(n instanceof i)return"UCS2";if(n instanceof u)return"Base64";if(n instanceof c)return"Latin1";if(n instanceof f)return"Binary";if(n instanceof l)return"Hex";throw new Error("Failed pattern match at Node.Encoding (line 19, column 1 - line 19, column 39): "+[n.constructor.name])});t.ASCII=e,t.UTF8=a,t.UTF16LE=o,t.UCS2=i,t.Base64=u,t.Latin1=c,t.Binary=f,t.Hex=l,t.encodingToNode=function(n){if(n instanceof e)return"ascii";if(n instanceof a)return"utf8";if(n instanceof o)return"utf16le";if(n instanceof i)return"ucs2";if(n instanceof u)return"base64";if(n instanceof c)return"latin1";if(n instanceof f)return"binary";if(n instanceof l)return"hex";throw new Error("Failed pattern match at Node.Encoding (line 31, column 1 - line 31, column 37): "+[n.constructor.name])},t.showEncoding=s}(n["Node.Encoding"]=n["Node.Encoding"]||{}),function(t){"use strict";(n["Node.Process"]=n["Node.Process"]||{}).process=process}(),function(n){"use strict";n.readChunkImpl=function(n){return function(t){return function(r){if(r instanceof Buffer)return t(r);if("string"==typeof r)return n(r);throw new Error("Node.Stream.readChunkImpl: Unrecognised chunk type; expected String or Buffer, got: "+r)}}},n.onDataEitherImpl=function(n){return function(t){return function(r){return function(){t.on("data",function(t){r(n(t))()})}}}},n.onEnd=function(n){return function(t){return function(){n.on("end",t)}}},n.write=function(n){return function(t){return function(r){return function(){return n.write(t,null,r)}}}},n.writeStringImpl=function(n){return function(t){return function(r){return function(e){return function(){return n.write(r,t,e)}}}}}}(n["Node.Stream"]=n["Node.Stream"]||{}),function(t){"use strict";(n["Node.Buffer"]=n["Node.Buffer"]||{}).toStringImpl=function(n){return function(t){return function(){return t.toString(n)}}}}(),function(t){"use strict";var r=n["Node.Buffer"],e=(n["Control.Semigroupoid"],n["Data.ArrayBuffer.Types"],n["Data.Maybe"],n["Data.Show"],n.Effect,n["Node.Encoding"]);n.Prelude;t.toString=function(n){return r.toStringImpl(e.encodingToNode(n))}}(n["Node.Buffer"]=n["Node.Buffer"]||{}),function(t){"use strict";var r=n["Node.Stream"],e=n["Control.Applicative"],a=n["Control.Bind"],o=n["Data.Either"],i=(n["Data.Functor"],n["Data.Maybe"],n["Data.Show"]),u=n.Effect,c=n["Effect.Exception"],f=n["Node.Buffer"],l=n["Node.Encoding"],s=(n.Prelude,r.readChunkImpl(o.Left.create)(o.Right.create)),p=function(n){return function(t){return r.onDataEitherImpl(s)(n)(t)}},d=function(n){return function(t){return p(n)(a.composeKleisliFlipped(u.bindEffect)(t)(function(n){if(n instanceof o.Left)return c.throw("Stream encoding should not be set");if(n instanceof o.Right)return e.pure(u.applicativeEffect)(n.value0);throw new Error("Failed pattern match at Node.Stream (line 94, column 5 - line 98, column 17): "+[n.constructor.name])}))}};t.onData=d,t.onDataString=function(n){return function(t){return function(r){return d(n)(a.composeKleisliFlipped(u.bindEffect)(r)(f.toString(t)))}}},t.onDataEither=p,t.writeString=function(n){return function(t){return r.writeStringImpl(n)(i.show(l.showEncoding)(t))}},t.onEnd=r.onEnd}(n["Node.Stream"]=n["Node.Stream"]||{}),function(t){"use strict";var r=n["Node.Process"],e=(n["Data.Functor"],n["Data.Maybe"],n["Data.Posix"],n["Data.Posix.Signal"],n.Effect,n["Foreign.Object"],n["Node.Platform"],n["Node.Stream"],n.Prelude,n["Unsafe.Coerce"],r.process.stdout),a=r.process.stdin;t.stdin=a,t.stdout=e}(n["Node.Process"]=n["Node.Process"]||{}),function(t){"use strict";var r=n["Control.Applicative"],e=n["Control.Bind"],a=n["Control.Category"],o=n["Data.Array"],i=n["Data.Either"],u=n["Data.Function"],c=n["Data.Functor"],f=n["Data.Int"],l=n["Data.Maybe"],s=n["Data.Monoid"],p=n["Data.Ord"],d=(n["Data.Semigroup"],n["Data.Semiring"],n["Data.Show"]),D=(n["Data.String"],n["Data.String.Common"]),m=(n["Data.String.Pattern"],n["Data.Unit"]),h=n.Effect,w=n["Effect.Aff"],C=n["Effect.Class"],v=n["Effect.Ref"],y=n["Node.Encoding"],g=n["Node.Process"],E=n["Node.Stream"],A=n["Partial.Unsafe"],b=(n.Prelude,function(n){return i.either(function(n){return A.unsafeCrashWith(n)})(a.identity(a.categoryFn))((c=o.sortBy(u.flip(p.compare(p.ordInt)))(o.mapMaybe(f.fromString)((t=D.trim(n),D.split(" ")(t)))),e.bind(i.bindEither)(i.note("a")(e.bind(l.bindMaybe)(o.index(c)(0))(function(n){return e.bind(l.bindMaybe)(o.index(c)(1))(function(t){return e.bind(l.bindMaybe)(o.index(c)(2))(function(e){return r.pure(l.applicativeMaybe)(d.show(d.showInt)(((10*n|0)+t|0)+e|0))})})})))(function(n){return r.pure(i.applicativeEither)(n+"\n")})));var t,c}),S=w.makeAff(function(n){return function(){var t=v.new("")();return E.onDataString(g.stdin)(y.UTF8.value)(function(n){return function(){var r=v.read(t)();return v.write(r+n)(t)()}})(),E.onEnd(g.stdin)(function(){var e=v.read(t)();return n(r.pure(i.applicativeEither)(e))()})(),s.mempty(w.monoidCanceler)}}),_=w.launchAff_(e.bind(w.bindAff)(S)(function(n){return e.bind(w.bindAff)(r.pure(w.applicativeAff)(b(n)))(function(n){return C.liftEffect(w.monadEffectAff)((t=n,c.void(h.functorEffect)(E.writeString(g.stdout)(y.UTF8.value)(t)(r.pure(h.applicativeEffect)(m.unit)))));var t})}));t.main=_,t.solve=b}(n.ABC110A=n.ABC110A||{}),n.ABC110A.main();
},{}]},{},["Focm"], null)


function main(input) {
  const formatted_input = input.split('\n')[0].split(' ').map( x => parseInt(x, 10) );

  const A = formatted_input.sort()[0];
  const B = formatted_input.sort()[1];
  const C = formatted_input.sort()[2];

  console.log(inconvenience(10*A + B + C);

}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.

Score : 100 points

Problem Statement

You have decided to give an allowance to your child depending on the outcome of the game that he will play now.

The game is played as follows:

There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a + printed on it.

The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)

Then, the amount of the allowance will be equal to the resulting value of the formula.

Given the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.

Constraints

All values in input are integers.

1 \leq A, B, C \leq 9

Input

Input is given from Standard Input in the following format:

A B C

Output

Print the maximum possible amount of the allowance.

Sample Input 1

1 5 2

Sample Output 1

53

The amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.

Sample Input 2

9 9 9

Sample Output 2

108

Sample Input 3

6 6 7

Sample Output 3

82

Submitted source-code file size, in bytes.

Execution CPU time reported by official Project CodeNet metadata, in milliseconds.

Peak memory usage reported by official Project CodeNet metadata, in kilobytes.


'use strict'

function main(input) {
  input = input.split(' ').sort().reverse()
//   console.log(input)

  const ans = eval( input[0]+input[1] +'+'+ input[2] )
  console.log(ans)
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input){
  var arr = input.split(" ");
  arr.sort(function(a,b){
    return (a < b ? 1 : -1);
  });
  var sum = parseInt(arr[0],10) * 10  + parseInt(arr[1],10) + parseInt(arr[2],10)
  console.log(sum);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


// inputに入力データ全体が入る, 10)
function Main(input) {
	var A = parseInt(input.split(' ')[0], 10);
	var B = parseInt(input.split(' ')[1], 10);
	var C = parseInt(input.split(' ')[2], 10);
	var strA = input.split(' ')[0];
	var strB = input.split(' ')[1];
	var strC = input.split(' ')[2];
	var results = [];
	results[0] = A + parseInt(strB+strC, 10);
	results[1] = A + parseInt(strC+strB, 10);
	results[2] = B + parseInt(strA+strC, 10);
	results[3] = B + parseInt(strC+strA, 10);
	results[4] = C + parseInt(strA+strB, 10);
	results[5] = C + parseInt(strB+strA, 10);
	results[6] = parseInt(strB+strC, 10) + A;
	results[7] = parseInt(strC+strB, 10) + A;
	results[8] = parseInt(strA+strC, 10) + B;
	results[9] = parseInt(strC+strA, 10) + B;
	results[10] = parseInt(strA+strB, 10) + C;
	results[11] = parseInt(strB+strA, 10) + C;
	console.log(Math.max(...results))
}

// ※この行以降は編集しない (標準入力から一度に読み込みMainを呼び出します)
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
	tmp = input[0].split(" ");
	//文字列から10進数に変換するときはparseIntを使います
	var a = parseInt(tmp[0], 10);
	var b = parseInt(tmp[1], 10);
	var c = parseInt(tmp[2], 10);

    var max = Math.max(a,b,c);

    if (a == max) {
        console.log('%d',((a * 10) + b + c));
        return;
    }
    if (b == max) {
        console.log('%d',((b * 10) + a + c));
        return;
    }
    if (c == max) {
        console.log('%d',((c * 10) + a + b));
        return;
    }

}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


'use strict';

function Main(input) {
    const tmp = input.split(" ");
    tmp.sort((a,b) => {
        if( a > b ) return -1;
        if( a < b ) return 1;
        return 0;
    });
    console.log(parseInt(tmp[0] + tmp[1], 10) + parseInt(tmp[2], 10));
}
//* この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function main(arg) {
	arg = arg.split("\n")[0]
	arg = arg.split(" ").map((e) => Number(e))
	arg.sort((a,b) => {
		if (a > b) {
			return -1
		}
		return 1
	})
	console.log(arg[0]*10+arg[1] + arg[2])
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


var toInt = x=>parseInt(x,10);
var toIntArr = arr=>arr.map(x=>toInt(x));
var abs = x=>x>0?x:-x;
function min(){var rest=arguments,v=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]<v)v=rest[i];return v}
function max(){var rest=arguments,v=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]>v)v=rest[i];return v}
function gcd(){var rest=arguments,v=rest[0],temp=(a,b)=>b?temp(b,a%b):a;for(var i=1;i<rest.length;i++)v=temp(v,rest[i]);return v}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

function Main(input){
	var input = input.split(' ');
	var a = toInt(input[0].split(' '));
	var b = toInt(input[1].split(' '));
	var c = toInt(input[2].split(' '));
	var i = [a,b,c].sort((a,b)=>a-b);
	console.log(i[0]+i[1]+i[2]*10)
	return 0;
}


function main(input) {
  input=input.trim();
  const N = parseInt(input.split(" ")[0], 10);
  const M = parseInt(input.split(" ")[1], 10);
  const X = parseInt(input.split(" ")[2], 10);
  const Y = parseInt(input.split(" ")[3], 10);
  const arrX = input.split('\n')[1].split(' ').map((n) => parseInt(n, 10));
  const arrY = input.split('\n')[2].split(' ').map((n) => parseInt(n, 10));
  var ans=0

  //Zで全探索
  for(var i=0; i<Y-X; i++){
    var judgeX=0;
    var judgeY=0;
    var Z=X+1+i;
    for(var j=0; j<N; j++){
      if(arrX[j]>=Z){
        judgeX++;
      }
    }
    for(var k=0; k<M; k++){
      if(arrY[k]<Z){
        judgeY++;
      }
    }
    //条件に反する場合ans処理しない
    if(judgeX>0||judgeY>0){
    }else{
      ans++
    }
  }

  if(ans>0){
    console.log("No War");
  }else{
    console.log("War");
  }

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Score : 200 points

Problem Statement

Our world is one-dimensional, and ruled by two empires called Empire A and Empire B.

The capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.

One day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.

If there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.

X < Z \leq Y

x_1, x_2, ..., x_N < Z

y_1, y_2, ..., y_M \geq Z

Determine if war will break out.

Constraints

All values in input are integers.

1 \leq N, M \leq 100

-100 \leq X < Y \leq 100

-100 \leq x_i, y_i \leq 100

x_1, x_2, ..., x_N \neq X

x_i are all different.

y_1, y_2, ..., y_M \neq Y

y_i are all different.

Input

Input is given from Standard Input in the following format:

N M X Y
x_1 x_2 ... x_N
y_1 y_2 ... y_M

Output

If war will break out, print War; otherwise, print No War.

Sample Input 1

3 2 10 20
8 15 13
16 22

Sample Output 1

No War

The choice Z = 16 satisfies all of the three conditions as follows, thus they will come to an agreement.

X = 10 < 16 \leq 20 = Y

8, 15, 13 < 16

16, 22 \geq 16

Sample Input 2

4 2 -48 -1
-20 -35 -91 -23
-22 66

Sample Output 2

War

Sample Input 3

5 3 6 8
-10 3 1 5 -100
100 6 14

Sample Output 3

War


'use strict'

const main = (input) => {
    input = input.split('\n')
    const X = parseInt(input[0].split(' ')[2])
    const Y = parseInt(input[0].split(' ')[3])
    const Xs = input[1].split(' ').map(i => parseInt(i))
    const Ys = input[2].split(' ').map(i => parseInt(i))

    const MAX_X = Xs.sort((a, b) => b - a).shift()
    const MIN_Y = Ys.sort((a, b) => a - b).shift()

    for(let i = X + 1; i <= Y; i++) {
        if(MAX_X < i && i <= MIN_Y){
            console.log('No War')
            return
        }
    }
    console.log('War')
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))


function Main(input){
	input = input.split("\n");
  var X = input[0].split(" ")[2];
  var Y = input[0].split(" ")[3];
  var maxX = Math.max(...input[1].split(" ").map(a=>~~a));
  var minY = Math.min(...input[2].split(" ").map(a=>~~a));

  for(var z = maxX + 1; z <= minY; z++){
  	return "No War";
  }
  return "War";
}

// If you are interested in the algorithms I used,
// there is no need to read down from this line.

((b,c,d)=>"undefined"!=typeof require?console.log(Main(require("fs").readFileSync("/dev/stdin","utf8"))):[b=b.split("\n").slice(1,-1).join("\n"),c=function(){try{return Main(b)}catch(f){return f.stack||f.message}}(),d=typeof c,"string"==d||(c=JSON.stringify(c)),$("<form>").append([[10,b],0,[1,d],0,[10,c]].map(f=>$(f?"<textarea>":"<br>",f&&{rows:f[0],cols:40,text:f[1]}))).appendTo("body")])(`
5 3 6 8
-10 3 1 5 -100
100 6 14
`);


let lines = [];
let reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', function(line){
  lines.push(line.split(" "));
})

reader.on('close', function(){
  console.log(lines)
  if(happensWars(lines)) console.log("War");
  else console.log("No War");
})

//1行目に[N,M,X,Y]
//（
//Nは最低いくつ支配下に置くか、
//Mが最大いくつ支配下に置くか、
//XがA帝国の現在の座標
//YがB帝国の現在の座標
//）
//2行目にA帝国が支配下に置きたい座標の配列
//3行目にB帝国が支配下に置きたい座標の配列
function happensWars(coordinates){
  // A帝国の希望する最大の座標
  let maxOfA = -100;
  // B帝国の希望する最小の座標
  let minOfB = 100;

  const coordinateA = coordinates[0][2];
  const coordinateB = coordinates[0][3];

  coordinates[1].map((num) => {
    const coordinateX = Number(num);
    if(maxOfA < coordinateX) {
      maxOfA = coordinateX;
    }
  })

  coordinates[2].map((num) => {
    const coordinateY = Number(num);
    if(minOfB > coordinateY) {
      minOfB = coordinateY;
    }
  })

//  console.log(`Aの座標は${coordinateA},希望地の最大座標は${maxOfA}`);
//  console.log(`Bの座標は${coordinateB},希望地の最小座標は${minOfB}`);
  // Aの希望地座標がBの座標もしくは希望地座標より大きければ戦争勃発
  if (maxOfA >= coordinateB || maxOfA >= minOfB) return true;
  // Bの希望地座標がAの座標もしくは希望地座標より小さければ戦争勃発
  if (minOfB <= coordinateA || minOfB <= maxOfA) return true;
  return false;
}


// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
	lineTop = input[0].split(" ");
	lineX = input[1].split(" ");
	lineY = input[2].split(" ");
	//文字列から10進数に変換するときはparseIntを使います
	var n = parseInt(lineTop[0], 10);
	var m = parseInt(lineTop[1], 10);
	var x = parseInt(lineTop[2], 10);
	var y = parseInt(lineTop[3], 10);

	var maxX = x;
	var minY = y;

	for (var work of lineX) {
		if (parseInt(work) > parseInt(maxX)) {
			maxX = work;
		}
	}

	for (var work of lineY) {
		if (parseInt(work) < parseInt(minY)) {
			minY = work;
		}
	}

	if (parseInt(minY) <= parseInt(maxX)) {
		console.log('War');
	} else {
		console.log('No War');
	}
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


// inputに入力データ全体が入る, 10)
function Main(input) {
	var N = parseInt(input.split('\n')[0].split(' ')[0], 10);
	var M = parseInt(input.split('\n')[0].split(' ')[1], 10);
	var X = parseInt(input.split('\n')[0].split(' ')[2], 10);
	var Y = parseInt(input.split('\n')[0].split(' ')[3], 10);
	var x = input.split('\n')[1].split(' ');
	var y = input.split('\n')[2].split(' ');
	var Z = [];
	var flag = false;
	x = x.map( val => parseInt(val, 10) );
	y = y.map( val => parseInt(val, 10) );
	for ( var i = X + 1; i <= Y; i++ ) {
		Z.push(i);
	}
	for ( var j = 0; j < Z.length; j++ ) {
		if ( Math.max(...x) < Z[j] && Z[j] <= Math.min(...y) ) {
			flag = true;
		}
	}
	if ( flag ) {
		console.log('No War');
	} else {
		console.log('War');
	}
}

// ※この行以降は編集しない (標準入力から一度に読み込みMainを呼び出します)
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(arg) {
    arg = arg.trim().split('\n');
    X = Number(arg[0].split(' ')[2]);
    Y = Number(arg[0].split(' ')[3]);
    if(X >= Y){
        console.log('War');
    }

    x = arg[1].split(' ');
    y = arg[2].split(' ');

    x.sort(function(a,b){
        if(Number(a)<Number(b))return -1;
        if(Number(a)>Number(b))return 1;
        return 0;
    });
    y.sort(function(a,b){
        if(Number(a)<Number(b))return -1;
        if(Number(a)>Number(b))return 1;
        return 0;
    });
    if(Number(x[x.length - 1]) < Number(y[0])){
        console.log('No War');
    } else {
        console.log('War');
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
  input = input.split("\n");
  var n = parseInt(input[0].split(" ")[0]);
  var m = parseInt(input[0].split(" ")[1]);
  var X = parseInt(input[0].split(" ")[2]);
  var Y = parseInt(input[0].split(" ")[3]);
  x = new Array(n).fill(0);
  y = new Array(m).fill(0);
  tmp1=input[1].split(" ");
  for(i=0;i<n;i++){
    x[i]=parseInt(tmp1[i]);
  }
  tmp2=input[2].split(" ");
  for(i=0;i<m;i++){
    y[i]=parseInt(tmp2[i]);
  }
  var ans = "War";
  maxx=Math.max.apply(null,x);
  miny=Math.min.apply(null,y);
  if(X<Y&&X<miny&&maxx<Y&&maxx<miny){
    ans = "No War";
  }

  console.log('%s', ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


inp = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n')
l = inp.shift().split(' ')
A = l[0] * 1
B = l[1] * 1
console.log((A % 2 && B % 2) ? 'Yes' : 'No')

Score : 100 points

Problem Statement

You are given integers A and B, each between 1 and 3 (inclusive).

Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.

Constraints

All values in input are integers.

1 \leq A, B \leq 3

Input

Input is given from Standard Input in the following format:

A B

Output

If there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.

Sample Input 1

3 1

Sample Output 1

Yes

Let C = 3. Then, A \times B \times C = 3 \times 1 \times 3 = 9, which is an odd number.

Sample Input 2

1 2

Sample Output 2

No

Sample Input 3

2 2

Sample Output 3

No


function main(input) {
    const args = input.split(' ');
    const a = parseInt(args[0]);
    const b = parseInt(args[1]);
  	var c = [1,2,3];

  	const t = a*b;
  	c.forEach( n => {
      if(t * n % 2 === 1){
        console.log('Yes');
      } else {
        console.log('No');
      }
    })
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


function main(input) {
    const args = input.split(' ');
    const a = parseInt(args[0]);
    const b = parseInt(args[1]);
  	var c = [1,2,3];

  	const t = a*b;
  	c.forEach( n => {
      if(t * n % 2 === 1){
        console.log('Yes');
      } else {
        console.log('No');
      }
    })
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


'use strict'

const main = (input) => {
    const A = parseInt(input.split(' ')[0])
    const B = parseInt(input.split(' ')[1])

    if(A * B % 2 !== 0){
        console.log('Yes')
    } else {
        console.log('No')
    }
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))


function Main(input){
  var arr = input.split("\n")[0].split(" ");
  var a = parseInt(arr[0],10);
  var b = parseInt(arr[1],10);
  if(a % 2 == 0 || b % 2 == 0){
    console.log('No');
  }else {
    console.log('Yes');
  }
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
	input = input.split("\n")
	const tmp = input[0].split(" ")

	const a = parseInt(tmp[0], 10)
	const b = parseInt(tmp[1], 10)

	console.log((a * b) % 2 ? "Yes" : "No")
}


function Main(input) {
	args = input.split(" ");
    const n = args[0] * args[1];
    let result = 'No';
    if( n % 2 === 1){
         result = 'Yes';
    }
	console.log('%s',result);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
	input = input.split(" ");
    const n = input[0] * input[1];
    let result = 'No';
    if( n % 2 === 1){
         result = 'Yes';
    }
	console.log('%s',result);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function main(input) {
  var input = input.split(' ');
  var answer = input[0] == 2 && input[1] == 2 ? "Yes" : "No"
  console.log(answer);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


'use strict';

function Main(input) {
  const A = Number(input.split('\n')[0].split(' ')[0]);
  const B = Number(input.split('\n')[0].split(' ')[1]);

  if((A * B) % 2 === 0) {
    console.log('No');
  } else {
    console.log('Yes');
  }

};

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());


// parameter "input" gets all data
function Main(input) {
	// the first line is assigned to input[0], the second line is assigned to input[1] similarly.
	var ab = input.split(' ');
	a = parseInt(ab[0]);
	b = parseInt(ab[1]);

	console.log((a*b)%2==0?'No':'Yes');
}
// Don't edit this line!
//Main(require("fs").readFileSync(__dirname+'/in.txt', "utf8"));
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));


process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(input) {
    var w = input.split("\n").slice(0,1);
    var y = w[0].split(" ").map(a => parseInt(a) );

    var ans = 'YES';
    if(y[0] % 2 == 0 || y[1] % 2 == 0) {ans = 'NO';}
    console.log(ans);
} );
process.stdin.on('end', function() {
});


var int = x=>parseInt(x,10);var spln = x=>x.split(/\n/g);var spsp = x=>x.split(/\s/g);
function main(input) {
  if(input.includes('2'))
    console.log('No');
  }else{
   console.log('Yes')
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


"use strict";
function Main(input) {
    let lines = input.split("\n");
    let N = lines.shift().split(/\s/).map((v) => v - 0)[0];
    let ans = true;
    let word = [];
    for (let n = 0; n < N; n++) {
        word.push(lines.shift().trim());
    }
    const firstChar = (v) => v.charAt(0);
    const lastChar = (v) => v.charAt(v.length - 1);
    for (let n = 1; n < N && ans; n++) {
        if (lastChar(word[n-1]) != firstChar(word[n])) {
            ans = false;
        }
    }
    word.sort();
    for (let n = 0; n < N - 1 && ans; n++) {
        if (word[n] == word[n+1]) {
            ans = false;
        }
    }
    console.log(ans ? "Yes" : "No");
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Score : 200 points

Problem Statement

Takahashi is practicing shiritori alone again today.

Shiritori is a game as follows:

In the first turn, a player announces any one word.

In the subsequent turns, a player announces a word that satisfies the following conditions:

That word is not announced before.

The first character of that word is the same as the last character of the last word announced.

In this game, he is practicing to announce as many words as possible in ten seconds.

You are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.

Constraints

N is an integer satisfying 2 \leq N \leq 100.

W_i is a string of length between 1 and 10 (inclusive) consisting of lowercase English letters.

Input

Input is given from Standard Input in the following format:

N
W_1
W_2
:
W_N

Output

If every word announced by Takahashi satisfied the conditions, print Yes; otherwise, print No.

Sample Input 1

4
hoge
english
hoge
enigma

Sample Output 1

No

As hoge is announced multiple times, the rules of shiritori was not observed.

Sample Input 2

9
basic
c
cpp
php
python
nadesico
ocaml
lua
assembly

Sample Output 2

Yes

Sample Input 3

8
a
aa
aaa
aaaa
aaaaa
aaaaaa
aaa
aaaaaaa

Sample Output 3

No

Sample Input 4

3
abc
arc
agc

Sample Output 4

No


'use strict';

function main(arg) {
    const words = (arg.split("\n"));
    const memo  = new Set();

    words.shift();
    let lastLetter = words[0].slice(0, 1);

    for(let i=0; i<words.length; i++) {
        if(lastLetter !== words[i].slice(0, 1)) {
            console.log('No');
            return;
        }

        if(memo.has(words[i])) {
            console.log('No');
            return;
        }

        lastLetter = words[i].slice(-1);
        memo.add(words[i]);
    }

    console.log('Yes');
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


'use strict'

const main = (INPUT) => {
  const W = INPUT.split('\n').slice(1)
  let tmp = W.filter(function (x, i, self) {
    return self.indexOf(x) !== self.lastIndexOf(x)
  })
  if (tmp > 0) {
    console.log('No')
    return
  } else {
    for (let i = 0; i < W.length - 1; i++) {
      let a = W[i]
      let b = W[i + 1]
      if (a[a.length - 1] != b[0]) {
        console.log('No')
        return
      }
    }
  }
  console.log('Yes')
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))


'use strict'

const main = (INPUT) => {
  const input = INPUT.split('\n')
  const N = Number(input[0])
  input.shift()
  let tmp = input.filter((x, i, self) => self.indexOf(x) === i)
  if (tmp.length != N) {
    console.log('No')
    return
  } else {
    for (let i = 1; i < input.length; i++) {
      if (input[i - 1].slice(-1) != input[i].slice(0, 1)) {
        console.log('No')
        return
      }
    }
  }

  console.log('Yes')
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))


'use strict'

const main = (INPUT) => {
  const input = INPUT.split('\n')
  const N = Number(input[0])
  let ans = 'Yes'
  let tmp = input.filter((x, i, self) => self.indexOf(x) === i)
  if (tmp.length != N) {
    ans = 'No'
  } else {
    for (let i = 2; i < input.length; i++) {
      if (input[i - 1].slice(-1) != input[i].slice(0, 1)) {
        ans = 'No'
        break
      }
    }
  }

  console.log(ans)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))


'use strict'

const main = (INPUT) => {
  const input = INPUT.split('\n')
  const N = Number(input[0])
  let ans = 'Yes'
  let tmp = input.filter((x, i, self) => self.indexOf(x) === i)
  if (tmp.length != N) {
    ans = 'No'
  } else {
    for (let i = 2; i < input.length; i++) {
      let a = input[i - 1].slice(-1)
      let b = input[i].slice(0, 1)
      if (a != b) {
        ans = 'No'
        break
      }
    }
  }

  console.log(ans)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))


function Main(input) {
    input = input.split('\n');
    var n = Number(input.shift());
    var w = input;

    if(isShiritori(w)){
        console.log('Yes');
    }else{
        console.log('No')
    }

}

function isShiritori(arr) {
    for(var i=0,len=arr.length;i<len-1;i++) {
        if(arr[i][arr[i].length-1] !== arr[i+1][0]) return false;
    }

    var used = {};

    for(var i=0,len=arr.length;i<len;i++) {
        if(i!=0) {
            if(used[arr[i]]) return false;
        }
        used[arr[i]] = true;
    }

    return true;
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


l = require("fs").readFileSync("/dev/stdin","utf8").split(/[\r\n]+/);
a = {}; p = 0; r = 1;
l.shift();
for (const w of l) {
  if (p!==0 && ([...p].pop() != w[0] || a[w])) {r = 0;break}
  a[p = w] = 1;
}
console.log(r?"Yes":"No")


function Main(input) {
	const args = input.split("\n");
	const n = parseInt(args[0] ,10);
	let result;
	for( i = 2; i <= n; i++ ){
		for( I = 1; I <= n; I++ ){
			if( args[i] === args[I] && i !== I){
				result = 'No';
				break;
			}
		}
		if( args[i].slice(0, 1) !== args[i-1].slice(-1) ){
			result = 'No';
		}
	}
	if(result === undefined){
		result = 'Yes';
    }
	console.log('%s', result);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function main(input) {

	var answer = "Yes";
	var input = input.split('\n');
	var shiritori_length = input[0];
	var shiritori_array = [];

	for (var i = 0; i < shiritori_length; i++) {
	  	if(shiritori_array.indexOf(input[i+1]) != -1){
			answer = "No";
			break;
		}
	  	shiritori_array.push(input[i+1])

	  	//末尾チェック
	  	if(i > 0){
	  		//前の語尾と先頭の文字が一致するか
	  		if(shiritori_array[i-1].slice(-1) != shiritori_array[i].slice(0,1) ){
	  			answer = "No";
	  			break;
	  		}
	  		//重複チェック
	  		/*
	  		for (var j = 0; j < shiritori_array.length - 1; j++) {
	  			if(input[i+1] == shiritori_array[j]){
	  				answer = "No";
		  			break;
	  			}
	  		}
			*/
	  	}

	}

	console.log(answer);

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


function main(input) {
  var answer = "Yes";
  var input = input.split('\n');
  var shiritori_length = input[0];
  var shiritori_array = [];

  for (var i = 0; i < shiritori_length; i++) {
  	shiritori_array.push(input[i+1])
  	//末尾チェック
  	if(i > 0){
  		//前の語尾と先頭の文字が一致するか
  		if(shiritori_array[i-1].slice(-1) != shiritori_array[i].slice(0,1) ){
  			answer = "No";
  			break;
  		}
  		//重複チェック

	  	if(shiritori_array.slice(0,-1).includes(input[i+1])){
	  		answer = "No";
	  		break;
	  	}
  	}

  }

  console.log(answer);

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


'use strict';

function Main(inputs) {
    let input = inputs.split("\n");
    const n = parseInt(input[0], 10);
    let output = "Yes";
    input.shift();

    const ary = input.filter((w, index, array) => {
        return array.indexOf(w) === index;
    });

    for (let i = 1; i < n; i++) {
        let w = input[i-1];
        let we = w.slice(-1);
        let nw = input[i];
        let nwf = nw.slice(0, 1);
        if (n != ary.length || we != nwf) {
            output = "No";
            break;
        }
    }
    console.log(output);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


var Main = function(Str){
  var MySet = new Set();
  var Arr = Str.split('\n');
  var LL = undefined;

  for(var i=1;i<Arr[0];++i){
    var Word = Arr[i];
    var F = Word.slice(0,1);
    var L = Word.slice(-1);
    // console.log(LL);
    // console.log(Word+','+F+','+L);
    // console.log('--');
    if(LL != undefined && LL !== F){
      console.log('No');
      return;
    }
    if(MySet.has(Word)){
      console.log('No');
      return;
    }
    MySet.add(Word);
    LL = L;
  }
  console.log('Yes');
  return;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


var GetChars = function(word){
  return {f:word.slice(0,1), l:word.slice(-1)};
}

var Main = function(input){
  var arr = input.split('\n');
  var set = new Set();
  var latestLastChar = undefined;
  for(var i=1;i<arr.length;++i){
    var currentWord = arr[i];
    var chars = GetChars(currentWord);
    // console.log(currentWord);
    // console.log(chars);

    if(latestLastChar != undefined && latestLastChar != chars.f){
      console.log('No');
      return;
    }

    for(var j=1;j<i;++j){
      if(arr[j] == currentWord){
        console.log('No');
        return;
      }
    }

    set.add(currentWord);
    latestLastChar = chars.l;
  }
  console.log('Yes');
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
  input = input.split("\n");
  var n = parseInt(input[0].split(" ")[0]);
  w = new Array(n).fill(0);
  var ans = "Yes";
  for(i=0;i<n;i++){
    w[i]=input[i+1];
    if(i>0){
      if(w[i].substr(0,1)!=w[i-1].substr(w[i-1].length-1,1)){
        ans="No";
        break;
      }
    }
    for(j=0;j<i;j++){
      if(w[i]==w[j]){
        ans="No";
        break;
      }
    }
  }

  console.log('%s', ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


var toInt = x=>parseInt(x,10);
var toIntArr = arr=>arr.map(x=>toInt(x));
var abs = x=>x>0?x:-x;
function min(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]<val)val = rest[i];return val}
function max(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]>val)val = rest[i];return val}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

function Main(input){
	var input = input.split('\n');
	var n = toInt(input[0]);
	var ws = [];
	for(var i = 0; i < n; i++){
		ws[i] = input[i+1];
	}
	var x,y;
	for(var i = 1; i < n; i++){
		for(var j = 0; j < i; j++){
			if(ws[i]===ws[j]){
				console.log('No');
				return 0;
			}
		}
		x = ws[i-1];
		y = ws[i];
		if(x[x.length-1]!==y[0]){
			console.log('No');
			return 0;
		}
	}

	console.log('Yes');
}


module.exports=function(r){var t={};function e(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=r,e.c=t,e.d=function(r,t,n){e.o(r,t)||Object.defineProperty(r,t,{enumerable:!0,get:n})},e.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},e.t=function(r,t){if(1&t&&(r=e(r)),8&t)return r;if(4&t&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&t&&"string"!=typeof r)for(var o in r)e.d(n,o,function(t){return r[t]}.bind(null,o));return n},e.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return e.d(t,"a",t),t},e.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},e.p="",e(e.s=0)}([function(r,t,e){e(1)(e(2).readFileSync("/dev/stdin","UTF-8").split("\n"))},function(r,t){function e(r,t){return function(r){if(Array.isArray(r))return r}(r)||function(r,t){var e=[],n=!0,o=!1,u=void 0;try{for(var i,f=r[Symbol.iterator]();!(n=(i=f.next()).done)&&(e.push(i.value),!t||e.length!==t);n=!0);}catch(r){o=!0,u=r}finally{try{n||null==f.return||f.return()}finally{if(o)throw u}}return e}(r,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}r.exports=function(r){var t=e(r[0].split(" ").map(function(r){return Number(r)}),2),n=t[0],o=t[1],u=r[1].split(" ").map(function(r){return Number(r)});u.push(o),u.sort(function(r,t){return r-t});var f=[];for(i=0;i<n;i++)f.push(u[i+1]-u[i]);for(var l=f[0],a=1;a<n;a++){for(var c=f[a],p=l;0!=p;){var s=c;c=p,p=s%p}l=c}console.log(l)}},function(r,t){r.exports=require("fs")}]);

Score : 300 points

Problem Statement

There are N cities on a number line. The i-th city is located at coordinate x_i.

Your objective is to visit all these cities at least once.

In order to do so, you will first set a positive integer D.

Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:

Move 1: travel from coordinate y to coordinate y + D.

Move 2: travel from coordinate y to coordinate y - D.

Find the maximum value of D that enables you to visit all the cities.

Here, to visit a city is to travel to the coordinate where that city is located.

Constraints

All values in input are integers.

1 \leq N \leq 10^5

1 \leq X \leq 10^9

1 \leq x_i \leq 10^9

x_i are all different.

x_1, x_2, ..., x_N \neq X

Input

Input is given from Standard Input in the following format:

N X
x_1 x_2 ... x_N

Output

Print the maximum value of D that enables you to visit all the cities.

Sample Input 1

3 3
1 7 11

Sample Output 1

2

Setting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.

Perform Move 2 to travel to coordinate 1.

Perform Move 1 to travel to coordinate 3.

Perform Move 1 to travel to coordinate 5.

Perform Move 1 to travel to coordinate 7.

Perform Move 1 to travel to coordinate 9.

Perform Move 1 to travel to coordinate 11.

Sample Input 2

3 81
33 105 57

Sample Output 2

24

Sample Input 3

1 1
1000000000

Sample Output 3

999999999


'use strict'
function main(input) {
  input = input.trim().split('\n')
  const NX = input[0].split(' ').map(v => v - 0)
  input = input[1].split(' ').map(v => Math.abs(v - NX[1]))

  const gcd = (x, y) => y === 0 ? x : gcd(y, x%y);
  for (let i = 1; i < NX[0]; i ++) {
    input[i] = gcd(input[i], input[i-1])
  }
  console.log(input[NX[0]-1])
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


"use strict";

const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0].split(" ")[0]);
    const X = parseInt(arg[0].split(" ")[1]);
    const numbers = arg[1].split(" ").map(n=>parseInt(n));

    const evenOdd = numbers.filter(n=>n % 2 === 0).length;

    if(N === 1) {
        console.log(numbers[0] - X);
        return;
    }

    if(evenOdd === 0 !== N && evenOdd !== 0) {
        console.log(1);
        return;
    }

    let answer = Math.abs(numbers[0] - X);

    for(let i=1; i<N; i++) {
        let temp = Math.abs(numbers[i] - X);

        if(temp < answer) {
            answer = temp;
        }
    }

    console.log(answer);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


'use strict'

const gcd = (a, b) => {
    const r = a % b
    if(r === 0){
        return b
    }
    return gcd(b, r)
}

const main = (input) => {
    input = input.split('\n')
    const n = parseInt(input[0].split(' ')[0])
    const x = parseInt(input[0].split(' ')[1])
    const arr = input[1].split(' ').map(v => Math.abs(parseInt(v) - x))
    console.log(arr.reduce((p, c) => gcd(p, c)))

}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))


'use strict'

const gcd = (a, b) => {
    const r = a % b
    if(r === 0){
        return b
    }
    return gcd(b, r)
}

const main = (input) => {
    input = input.split('\n')
    const n = parseInt(input[0].split(' ')[0])
    const x = parseInt(input[0].split(' ')[1])
    const arr = input[1].split(' ').map(v => Math.abs(parseInt(v) - x)).sort((a, b) => a - b)
    console.log(arr.reduce((p, c) => gcd(p, c)))

}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))


function yakusu(n) {
  var list = []
  for (var i = 1; i < n; i++) {
    if (n % i != 0) continue
    var wari = Math.floor(n / i)
    list.push(wari)
    if (wari <= 1) {
      break
    }
  }
  return list
}

function saikou(list) {
  var hash = {}
  for (var i = 0, len = list.length; i < len; i++) {
    yaku_list = yakusu(list[i])
    yaku_list.forEach((yaku) => {
      if (hash[yaku]) {
        hash[yaku] += 1
      } else {
        hash[yaku] = 1
      }
    })
  }

  var common_yakus = []
  Object.keys(hash).forEach(k => {
    if (hash[k] == list.length) {
      common_yakus.push(Number(k))
    }
  })
  if (common_yakus.length <= 0) {
    return 1
  }
  return Math.max( ...common_yakus )
}

function pr(s) {
  console.log(s)
}

(function(input) {
  'use strict';

  var N = null
  var X = null
  var xs = []
  input.split("\n").some(function(line) {
    if (N == null) {
      var list = line.split(' ')
      N = parseInt(list[0], 10)
      X = parseInt(list[1], 10)
      return false
    } else {
      xs = line.split(' ').map((x) => { return parseInt(x, 10) })
      return true
    }
  })

  // xs.length <= 1の処理
  if (xs.length <= 1) {
    pr(xs[0] - X)
    return
  }

  var abss = []
  xs.forEach((x) => {
    if (x < X) {
      abss.push(X - x)
    } else {
      abss.push(x - X)
    }
  })

  // debug
  // console.log('N')
  // console.log(N)
  // console.log('X')
  // console.log(X)
  // console.log(xs)

  console.log(saikou(abss))
})(require('fs').readFileSync('/dev/stdin', 'utf8'))


'use strict';

function Main(input) {
  const N = Number(input.split('\n')[0].split(' ')[0]);
  const X = Number(input.split('\n')[0].split(' ')[1]);
  let list = input.split('\n')[1].split(' ').map(n => Number(n));

  list.sort((a, b) => (a > b ? 1 : -1));

  const gcd = (m, n) => {
    if(n === 0) {
      return m;
    } else {
      return gcd(n, m % n);
    }
  }

  if(list.length === 1) {
    console.log(list[0]);
  } else {
    let gcdans = gcd(list[0], list[1]);
    for(let k=2; k<N; k++) {
      gcdans = gcd(gcdans, list[k]);
    }
    console.log(gcdans);
  }

};

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());


'use strict';

function Main(input) {
  const N = Number(input.split('\n')[0].split(' ')[0]);
  const X = Number(input.split('\n')[0].split(' ')[1]);

  let list = [];

  for(let i=0; i<N; i++) {
    list.push(Math.abs(Number(input.split('\n')[1].split(' ')[i]) - X));
  }

  const gcd = (m, n) => {
    if(n === 0) {
      return m;
    } else {
      return gcd(n, m % n);
    }
  }

  if(list.length === 1) {
    console.log(list[0]);
  } else {
    let gcdans = gcd(list[0], list[1]);
    for(let k=1; k<N; k++) {
      gcdans = gcd(gcdans, list[k]);
    }
    console.log(gcdans);
  }

};

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());


'use strict';

function Main(input) {
  const N = Number(input.split('\n')[0].split(' ')[0]);
  const X = Number(input.split('\n')[0].split(' ')[1]);

  let Xlist = [];

  for(let i=0; i<N; i++) {
    Xlist.push(Math.abs(Number(input.split('\n')[1].split(' ')[i]) - X));
  }

  const gcd = (m, n) => {
    if(n === 0) {
      return m;
    } else {
      return gcd(n, m % n);
    }
  }

  if(Xlist.length === 1) {
    console.log(Xlist[0] - X);
  } else {
    let gcdans = gcd(Xlist[0], Xlist[1]);
    for(let k=1; k<N-1; k++) {
      gcdans = gcd(gcdans, Xlist[k]);
    }

    console.log(gcdans);
  }

};

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());


function gcd(a, b) {
    if (b === 0)
        return a;

    return gcd(b, a % b);
}

function main(arg) {
    arg = arg.split("\n")
    var tmp = arg[0].split(" ")
    var N = tmp[0]
    var X = tmp[1]
    var xi = arg[1].split(" ")

    xi.push(X)
    xi = xi.map(function(e){return parseInt(e,10)})

    xi.sort(function(a,b) {
        if (a > b) {
            return 1
        }
        return -1
    })

    if (xi.length === 2) {
        console.log(xi[1] - xi[0])
        return
    }

    var result = []

    for (var i = 1; i < xi.length; i++ ){
        result.push(xi[i] - xi[i-1])
    }

    result = result.filter(function (x, i, self) {
        return self.indexOf(x) === i;
    });

    if (result.length === 1) {
        console.log(result[0])
        return
    } else {
        while(1) {
            var _tmp = [];
            result = result.sort(function(a,b) {
                if (a > b) {
                    return 1
                }
                return -1
            })

            for (var i = 1; i < xi.length; i++ ){
                _tmp.push(result[i] - result[i-1])
            }

            _tmp = _tmp.filter(function (x, i, self) {
                return self.indexOf(x) === i;
            });
            result = _tmp
            if (result.length === 1) {
                break;
            } else{
                result = _tmp
            }
        }
        console.log(result[0])
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


'use strict'

const Main = (input) => {
  const tmp = input.trim().split(' ')
  const D = parseInt(tmp[0])
  const N = parseInt(tmp[1])
  let result = 0
  switch (D) {
    case 0:
      if (N === 100) {
        result = 101
      } else {
        result = N
      }
      break;
    case 1:
      if (N === 100) {
        result = 10100
      } else {
        result = N * 100
      }
      break
    default:
      if (N === 100) {
        result = 1010000
      } else {
        result = N * 10000
      }
      break;
  }

  console.log(result)
  return result
}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'))

Score: 200 points

Problem Statement

Today, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.

As the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.

Find the N-th smallest integer that would make Ringo happy.

Constraints

D is 0, 1 or 2.

N is an integer between 1 and 100 (inclusive).

Input

Input is given from Standard Input in the following format:

D N

Output

Print the N-th smallest integer that can be divided by 100 exactly D times.

Sample Input 1

0 5

Sample Output 1

5

The integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...

Thus, the 5-th smallest integer that would make Ringo happy is 5.

Sample Input 2

1 11

Sample Output 2

1100

The integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \ 000, 1 \ 100, ...

Thus, the integer we are seeking is 1 \ 100.

Sample Input 3

2 85

Sample Output 3

850000

The integers that can be divided by 100 exactly twice are as follows: 10 \ 000, 20 \ 000, 30 \ 000, ...

Thus, the integer we are seeking is 850 \ 000.


"use strict";

const main = arg => {
    arg = arg.trim().split("\n");
    const D = parseInt(arg[0].split(" ")[0]);
    const N = parseInt(arg[0].split(" ")[1]);

    let temp = [...Array(D * 2)].fill(0);
    let answer = parseInt(N + String(temp.join("")));
    let plus  = parseInt(1 + String(temp.join("")));

    console.log(N !== 100 ? answer : answer + plus);

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


inp = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n')[0].split(' ')
D = inp.shift() * 1
N = inp.shift() * 1
if (D == 0) {
    if (N == 100) {
        ans = N + 1
    } else {
        ans = N
    }
} else {
    if (N == 100) {
        ans = Math.pow(100, D) * (N + 1)
    } else {
        ans = Math.pow(100, D) * N
    }
}
console.log(ans)


function main(input) {
  input=input.trim();
  const d = parseInt(input.split(" ")[0], 10);
  const n = parseInt(input.split(" ")[1], 10);
  if(d==0){
    if(n==100){
      console.log(101);
    }else{
      console.log(n);
    }
  }else if(d==1){
    if(n==100){
      console.log(10100);
    }else{
      console.log(n*100);
    }
  }else{
    if(n==100){
      console.log(1010000);
    }else{
      console.log(n*10000);
    }

  }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));