#include <iostream>
#include <string>
#include <random>
#include <array>
#include <chrono>
#include <iomanip>

using namespace std;


array<float, 1600> randomnumbers = {
0.087689608335 , 0.019256826490 , 0.069453619421 , 0.067025110126 , 0.021043231711 , 0.033587388694 , 0.083239227533 , 0.011742727831 ,
0.050024010241 , 0.033509049565 , 0.026612102985 , 0.029627762735 , 0.043801158667 , 0.026102619246 , 0.016713805497 , 0.078916274011 ,
0.075892351568 , 0.012752453797 , 0.010492545553 , 0.098215453327 , 0.077127024531 , 0.063857689500 , 0.066082894802 , 0.025198820978 ,
0.036578901112 , 0.051618985832 , 0.020236346871 , 0.062257833779 , 0.087350353599 , 0.077401287854 , 0.083397977054 , 0.069831058383 ,
0.020533673465 , 0.019459091127 , 0.048951141536 , 0.091810673475 , 0.071908190846 , 0.010920760222 , 0.095227859914 , 0.084559679031 ,
0.064516827464 , 0.074339732528 , 0.017835870385 , 0.037455156446 , 0.018784150481 , 0.045206874609 , 0.071962803602 , 0.028839532286 ,
0.026009963825 , 0.079459398985 , 0.024113021791 , 0.057558842003 , 0.041398443282 , 0.053615272045 , 0.091859295964 , 0.079091019928 ,
0.042793452740 , 0.099563740194 , 0.057780340314 , 0.074154675007 , 0.057579360902 , 0.026275074109 , 0.035156831145 , 0.090875029564 ,
0.096631355584 , 0.093221917748 , 0.030689291656 , 0.064897559583 , 0.083190895617 , 0.099413029850 , 0.044733747840 , 0.040033459663 ,
0.062338255346 , 0.088953837752 , 0.027152974159 , 0.030029930174 , 0.053023055196 , 0.038526661694 , 0.027532642707 , 0.021131597459 ,
0.078735113144 , 0.090938992798 , 0.091561265290 , 0.020117569715 , 0.045997880399 , 0.046296872199 , 0.031501196325 , 0.030569467694 ,
0.031045878306 , 0.028074115515 , 0.031649973243 , 0.011071201414 , 0.013690388761 , 0.024367623031 , 0.016608621925 , 0.021105695516 ,
0.093413427472 , 0.099525645375 , 0.047419846058 , 0.095260165632 , 0.087628625333 , 0.074282482266 , 0.045628927648 , 0.055375993252 ,
0.074262984097 , 0.077898144722 , 0.064189933240 , 0.070275001228 , 0.011893828399 , 0.069569855928 , 0.040555670857 , 0.019180923700 ,
0.053778052330 , 0.037701986730 , 0.027224821970 , 0.067582748830 , 0.033238366246 , 0.067163296044 , 0.093539983034 , 0.066578544676 ,
0.075627349317 , 0.058851882815 , 0.083491317928 , 0.018568858504 , 0.026787340641 , 0.094813704491 , 0.053884223104 , 0.022072382271 ,
0.050509676337 , 0.096110798419 , 0.074125207961 , 0.012316224165 , 0.058780744672 , 0.057857200503 , 0.015935737640 , 0.051939815283 ,
0.012505761348 , 0.094335451722 , 0.025935405865 , 0.086372375488 , 0.020469410345 , 0.019377402961 , 0.025991059840 , 0.031742695719 ,
0.039473034441 , 0.093248769641 , 0.031997419894 , 0.090658470988 , 0.056987650692 , 0.071375899017 , 0.064772821963 , 0.056840211153 ,
0.023425381631 , 0.020372580737 , 0.011946289800 , 0.051302857697 , 0.017166655511 , 0.039981104434 , 0.082383789122 , 0.034305211157 ,
0.087662264705 , 0.099666669965 , 0.077774532139 , 0.056564308703 , 0.066337756813 , 0.078602336347 , 0.019442321733 , 0.037101827562 ,
0.020384581760 , 0.033673152328 , 0.084622830153 , 0.045915722847 , 0.015553466044 , 0.017102912068 , 0.048641391098 , 0.015817685053 ,
0.047826074064 , 0.082837969065 , 0.017671193928 , 0.059765636921 , 0.051028974354 , 0.093908667564 , 0.052930861712 , 0.018997114152 ,
0.024472419173 , 0.067919254303 , 0.018820807338 , 0.031308054924 , 0.024490779266 , 0.016529111192 , 0.034775137901 , 0.065709173679 ,
0.044011794031 , 0.056200779974 , 0.076547980309 , 0.051838420331 , 0.018259227276 , 0.042833514512 , 0.052902288735 , 0.078768119216 ,
0.015807593241 , 0.058219335973 , 0.072438940406 , 0.021168895066 , 0.075613193214 , 0.091001234949 , 0.057779505849 , 0.060114398599 ,
0.062733568251 , 0.072995215654 , 0.010579665191 , 0.032434128225 , 0.050419859588 , 0.026591762900 , 0.047753170133 , 0.027524374425 ,
0.062176369131 , 0.068191073835 , 0.087344743311 , 0.073131494224 , 0.051009126008 , 0.030384417623 , 0.070897139609 , 0.028169376776 ,
0.012707940303 , 0.072351671755 , 0.084563799202 , 0.043817996979 , 0.039092317224 , 0.084510996938 , 0.056402817369 , 0.052101008594 ,
0.021578749642 , 0.034041799605 , 0.070500403643 , 0.020203258842 , 0.046155162156 , 0.079813838005 , 0.041232720017 , 0.058274157345 ,
0.093776732683 , 0.085549131036 , 0.044253975153 , 0.076494060457 , 0.045693948865 , 0.068187117577 , 0.020804718137 , 0.074910566211 ,
0.071891665459 , 0.093203298748 , 0.077861644328 , 0.080598443747 , 0.087969549000 , 0.044162921607 , 0.076142489910 , 0.076775923371 ,
0.012924431823 , 0.020933188498 , 0.074101209641 , 0.058980137110 , 0.079153753817 , 0.017107056454 , 0.028302494437 , 0.089993149042 ,
0.034789972007 , 0.045105189085 , 0.072953298688 , 0.026070488617 , 0.016689864919 , 0.036557860672 , 0.057965859771 , 0.042219161987 ,
0.077433779836 , 0.089552074671 , 0.091792792082 , 0.041440881789 , 0.046881213784 , 0.042603954673 , 0.064635917544 , 0.095878966153 ,
0.047704346478 , 0.016925331205 , 0.034059152007 , 0.092132054269 , 0.073341496289 , 0.070594519377 , 0.072084665298 , 0.096970237792 ,
0.028746547177 , 0.083197347820 , 0.027834381908 , 0.052435740829 , 0.067467637360 , 0.078556828201 , 0.064634568989 , 0.073207303882 ,
0.065093517303 , 0.046759836376 , 0.072597488761 , 0.076015695930 , 0.015801768750 , 0.050338931382 , 0.016406899318 , 0.050762914121 ,
0.032324798405 , 0.012874213047 , 0.076905287802 , 0.027092160657 , 0.087940700352 , 0.099288582802 , 0.023223511875 , 0.047537028790 ,
0.084756754339 , 0.046800263226 , 0.031998582184 , 0.020120307803 , 0.092005424201 , 0.015130603686 , 0.020055877045 , 0.089129485190 ,
0.099234022200 , 0.096219725907 , 0.014837726951 , 0.047675259411 , 0.067990988493 , 0.054597198963 , 0.035076208413 , 0.085831388831 ,
0.018129512668 , 0.022714538500 , 0.043245300651 , 0.043737694621 , 0.039417404681 , 0.058301068842 , 0.096034362912 , 0.049474515021 ,
0.068088412285 , 0.071890942752 , 0.081054270267 , 0.099122352898 , 0.019344689324 , 0.016196757555 , 0.028924938291 , 0.021418366581 ,
0.038477282971 , 0.097647145391 , 0.065536484122 , 0.021624978632 , 0.091035209596 , 0.088731065392 , 0.062980979681 , 0.091323882341 ,
0.080427832901 , 0.010585856624 , 0.046493299305 , 0.092904880643 , 0.012287507765 , 0.026147721335 , 0.054729990661 , 0.016949009150 ,
0.071996927261 , 0.062254287302 , 0.027764605358 , 0.049712769687 , 0.022501658648 , 0.065397657454 , 0.028482327238 , 0.052452348173 ,
0.076647371054 , 0.012443380430 , 0.035894207656 , 0.063945233822 , 0.097500972450 , 0.038787595928 , 0.093092821538 , 0.020959112793 ,
0.059815920889 , 0.086221203208 , 0.089794456959 , 0.025374084711 , 0.012242406607 , 0.078137874603 , 0.043242871761 , 0.092884749174 ,
0.034001696855 , 0.026523688808 , 0.073624230921 , 0.052444271743 , 0.030842103064 , 0.023228317499 , 0.038330040872 , 0.053020559251 ,
0.086550243199 , 0.039867449552 , 0.062210217118 , 0.097098544240 , 0.025171816349 , 0.032723758370 , 0.058200292289 , 0.022243540734 ,
0.047196023166 , 0.023541532457 , 0.082516930997 , 0.022110946476 , 0.068678855896 , 0.095518037677 , 0.011730105616 , 0.017891444266 ,
0.071492098272 , 0.037694804370 , 0.086599498987 , 0.057746194303 , 0.040201075375 , 0.089448004961 , 0.052595272660 , 0.048706613481 ,
0.032011911273 , 0.064207494259 , 0.095363005996 , 0.016065448523 , 0.071987658739 , 0.086484260857 , 0.010913499631 , 0.063195899129 ,
0.013436457142 , 0.076534986496 , 0.013436224312 , 0.072635576129 , 0.086048662663 , 0.069839842618 , 0.078206934035 , 0.033891476691 ,
0.063981935382 , 0.084381885827 , 0.046425402164 , 0.031740646809 , 0.095036923885 , 0.025665557012 , 0.051023714244 , 0.095491513610 ,
0.015815360472 , 0.098766468465 , 0.067991033196 , 0.055297344923 , 0.012446735054 , 0.092283509672 , 0.098970316350 , 0.074071593583 ,
0.011334107257 , 0.022349059582 , 0.020654974505 , 0.078157536685 , 0.013660829514 , 0.067570365965 , 0.095077052712 , 0.070050805807 ,
0.023875277489 , 0.021800221875 , 0.066323988140 , 0.027220658958 , 0.087604679167 , 0.031782485545 , 0.078183852136 , 0.095942422748 ,
0.034223325551 , 0.061475448310 , 0.077884025872 , 0.096821092069 , 0.042029425502 , 0.038503006101 , 0.080018199980 , 0.055888324976 ,
0.045003883541 , 0.080206379294 , 0.068524137139 , 0.015192532912 , 0.070905387402 , 0.076834402978 , 0.095830790699 , 0.048100568354 ,
0.016246678308 , 0.057917281985 , 0.035699144006 , 0.025496367365 , 0.087430931628 , 0.081651799381 , 0.061860375106 , 0.067295081913 ,
0.058373294771 , 0.049987114966 , 0.043400689960 , 0.045421220362 , 0.074457168579 , 0.011581941508 , 0.047699622810 , 0.027522042394 ,
0.022960387170 , 0.035219132900 , 0.057976558805 , 0.041982956231 , 0.067574270070 , 0.070641525090 , 0.052086442709 , 0.046789333224 ,
0.028242394328 , 0.069923341274 , 0.041529022157 , 0.088231660426 , 0.039484284818 , 0.012308175676 , 0.013515014201 , 0.046857252717 ,
0.089802481234 , 0.070355243981 , 0.010528378189 , 0.070461608469 , 0.088308647275 , 0.073445379734 , 0.016519522294 , 0.053608201444 ,
0.063030116260 , 0.017176842317 , 0.031177608296 , 0.082053720951 , 0.066916614771 , 0.087416000664 , 0.010703342967 , 0.041083216667 ,
0.065553665161 , 0.040391240269 , 0.045558460057 , 0.040949858725 , 0.074265502393 , 0.030320435762 , 0.075562916696 , 0.056031584740 ,
0.022828411311 , 0.067086547613 , 0.063498020172 , 0.051229991019 , 0.052455306053 , 0.036319069564 , 0.094638772309 , 0.083748638630 ,
0.023324012756 , 0.026654325426 , 0.019245054573 , 0.051628991961 , 0.098446309566 , 0.087107814848 , 0.050970800221 , 0.016264678910 ,
0.090456850827 , 0.088314235210 , 0.077297478914 , 0.048736624420 , 0.086398795247 , 0.014509113505 , 0.014679096639 , 0.081569038332 ,
0.020741552114 , 0.093251056969 , 0.070469580591 , 0.042279027402 , 0.093626014888 , 0.072415903211 , 0.084009446204 , 0.086702041328 ,
0.071115754545 , 0.012449936010 , 0.056081421673 , 0.050518363714 , 0.062163993716 , 0.040235441178 , 0.037045326084 , 0.060774654150 ,
0.089556269348 , 0.072204053402 , 0.033513337374 , 0.098615251482 , 0.046486325562 , 0.065657727420 , 0.079421825707 , 0.022591702640 ,
0.048757642508 , 0.079654648900 , 0.065668180585 , 0.074976988137 , 0.018286611885 , 0.053085073829 , 0.090839855373 , 0.045434698462 ,
0.031035721302 , 0.037363629788 , 0.010476679541 , 0.011550312862 , 0.056109845638 , 0.078176394105 , 0.060665413737 , 0.053587011993 ,
0.066858865321 , 0.016876321286 , 0.020341143012 , 0.023575499654 , 0.023449476808 , 0.065340697765 , 0.061148241162 , 0.068430840969 ,
0.067111916840 , 0.039879791439 , 0.089658699930 , 0.083749286830 , 0.034303780645 , 0.063648074865 , 0.053063668311 , 0.091072067618 ,
0.078259021044 , 0.099329493940 , 0.080803781748 , 0.029153268784 , 0.078970529139 , 0.087671808898 , 0.080032035708 , 0.018353324383 ,
0.094302162528 , 0.096414417028 , 0.047076135874 , 0.078564271331 , 0.099635459483 , 0.093190453947 , 0.041954338551 , 0.036590889096 ,
0.073049299419 , 0.019589524716 , 0.081121243536 , 0.054669223726 , 0.075569786131 , 0.081370592117 , 0.015465967357 , 0.076508954167 ,
0.025981707498 , 0.054544202983 , 0.044344834983 , 0.073648490012 , 0.010110139847 , 0.061119623482 , 0.037510856986 , 0.054975770414 ,
0.097785986960 , 0.059056684375 , 0.015590736642 , 0.013519637287 , 0.034551024437 , 0.079102188349 , 0.050397634506 , 0.012945006602 ,
0.096725508571 , 0.055563986301 , 0.083818569779 , 0.028759522364 , 0.031302295625 , 0.017652843148 , 0.021330457181 , 0.090998075902 ,
0.094618342817 , 0.010480793193 , 0.080690182745 , 0.099868617952 , 0.051825836301 , 0.076833851635 , 0.086571104825 , 0.030481904745 ,
0.089365780354 , 0.020600195974 , 0.057469874620 , 0.076124653220 , 0.047063700855 , 0.049650691450 , 0.059110768139 , 0.024742174894 ,
0.011725334451 , 0.027700664476 , 0.055061094463 , 0.091774374247 , 0.091858282685 , 0.062095202506 , 0.054017342627 , 0.099490009248 ,
0.078567355871 , 0.061494238675 , 0.033620737493 , 0.013716056012 , 0.095749035478 , 0.024007152766 , 0.078191600740 , 0.046275414526 ,
0.030901543796 , 0.032242283225 , 0.066049955785 , 0.011591747403 , 0.032496895641 , 0.025319501758 , 0.084880091250 , 0.049692504108 ,
0.041881561279 , 0.073312938213 , 0.040533170104 , 0.090959258378 , 0.072336331010 , 0.096650503576 , 0.054932415485 , 0.089062571526 ,
0.054603546858 , 0.051754236221 , 0.043491072953 , 0.034478172660 , 0.024616234004 , 0.055023901165 , 0.096633262932 , 0.035292729735 ,
0.034922167659 , 0.016830790788 , 0.065114989877 , 0.047670818865 , 0.083497889340 , 0.038991339505 , 0.097386389971 , 0.092972710729 ,
0.072355031967 , 0.051008045673 , 0.012238353491 , 0.010012303479 , 0.036781441420 , 0.035685062408 , 0.058890350163 , 0.010173564777 ,
0.047111734748 , 0.046937078238 , 0.081450358033 , 0.096148148179 , 0.071854174137 , 0.093166798353 , 0.094409614801 , 0.012296372093 ,
0.085125476122 , 0.033880900592 , 0.066274911165 , 0.012372131459 , 0.098414637148 , 0.094701670110 , 0.060918472707 , 0.076778545976 ,
0.057029470801 , 0.054246000946 , 0.072558112442 , 0.044279582798 , 0.056954160333 , 0.048464059830 , 0.095414489508 , 0.071373179555 ,
0.018927283585 , 0.020838692784 , 0.015900867060 , 0.095870293677 , 0.082039959729 , 0.015612412244 , 0.017802456394 , 0.015876688063 ,
0.049518786371 , 0.092218577862 , 0.087687678635 , 0.076859883964 , 0.074041113257 , 0.039018098265 , 0.097168140113 , 0.024918809533 ,
0.010445792228 , 0.032435692847 , 0.076683126390 , 0.073208950460 , 0.092757068574 , 0.048118077219 , 0.040505640209 , 0.078290998936 ,
0.096845157444 , 0.086616478860 , 0.073130048811 , 0.026723042130 , 0.094158656895 , 0.024465780705 , 0.046358503401 , 0.077365852892 ,
0.027910986915 , 0.079944781959 , 0.081926442683 , 0.087622396648 , 0.059638679028 , 0.077271133661 , 0.055962681770 , 0.034703575075 ,
0.032979898155 , 0.043166078627 , 0.062236316502 , 0.085789941251 , 0.041495226324 , 0.060292705894 , 0.089458487928 , 0.048874534667 ,
0.064277678728 , 0.014943756163 , 0.029702907428 , 0.046754345298 , 0.070228099823 , 0.033632561564 , 0.032439470291 , 0.050127431750 ,
0.061657778919 , 0.082189336419 , 0.096239514649 , 0.077460378408 , 0.086555786431 , 0.043085612357 , 0.059866480529 , 0.035858035088 ,
0.085990130901 , 0.076079778373 , 0.012897620909 , 0.020317457616 , 0.075488403440 , 0.063586242497 , 0.093968048692 , 0.060985475779 ,
0.032814957201 , 0.060943216085 , 0.042532734573 , 0.037664897740 , 0.033960871398 , 0.060355685651 , 0.068001858890 , 0.057210884988 ,
0.043386869133 , 0.083042852581 , 0.041282199323 , 0.079924821854 , 0.016404585913 , 0.011883625761 , 0.078108504415 , 0.089646987617 ,
0.066885419190 , 0.013303850777 , 0.097822003067 , 0.034337274730 , 0.086603581905 , 0.036402858794 , 0.062816806138 , 0.032024852931 ,
0.011704565957 , 0.038641467690 , 0.067094795406 , 0.022162344307 , 0.032514441758 , 0.050199724734 , 0.016723435372 , 0.060788996518 ,
0.060649141669 , 0.050075359643 , 0.086584612727 , 0.077659182250 , 0.097788259387 , 0.097184397280 , 0.028233235702 , 0.095967777073 ,
0.010398717597 , 0.051252685487 , 0.073865666986 , 0.060201816261 , 0.091966673732 , 0.083864293993 , 0.077199727297 , 0.025830430910 ,
0.032042097300 , 0.031529501081 , 0.056281313300 , 0.080045521259 , 0.065050214529 , 0.038935203105 , 0.053943946958 , 0.035894397646 ,
0.067154355347 , 0.033255621791 , 0.087193906307 , 0.057992912829 , 0.046837143600 , 0.021840685979 , 0.026395639405 , 0.081482954323 ,
0.014072334394 , 0.053717456758 , 0.099329724908 , 0.084732070565 , 0.081915274262 , 0.079949900508 , 0.077932521701 , 0.011891505681 ,
0.030537717044 , 0.037406377494 , 0.098981752992 , 0.086321115494 , 0.058969527483 , 0.080833211541 , 0.073850087821 , 0.068390518427 ,
0.019370324910 , 0.087047778070 , 0.032007563859 , 0.081131584942 , 0.048619821668 , 0.013387368061 , 0.061494871974 , 0.044201128185 ,
0.088336467743 , 0.091028057039 , 0.058533996344 , 0.050892189145 , 0.045009821653 , 0.090047761798 , 0.052664369345 , 0.040068041533 ,
0.013570840470 , 0.085120432079 , 0.039118736982 , 0.078621841967 , 0.077383004129 , 0.046131357551 , 0.039707303047 , 0.070674009621 ,
0.058060221374 , 0.098120428622 , 0.010002977215 , 0.060046419501 , 0.090224683285 , 0.056237258017 , 0.059547096491 , 0.068048685789 ,
0.034223303199 , 0.061032399535 , 0.011529838666 , 0.072003804147 , 0.087845452130 , 0.028549697250 , 0.014738662168 , 0.092692598701 ,
0.044472254813 , 0.055236838758 , 0.075559295714 , 0.085139930248 , 0.096744567156 , 0.015886161476 , 0.028703613207 , 0.081637412310 ,
0.089918732643 , 0.044150650501 , 0.049904823303 , 0.010336376727 , 0.083491869271 , 0.027770789340 , 0.063657127321 , 0.025327324867 ,
0.036363333464 , 0.028479442000 , 0.093962594867 , 0.059288755059 , 0.046104706824 , 0.041858352721 , 0.043300069869 , 0.064259827137 ,
0.074929364026 , 0.027755161747 , 0.071010433137 , 0.042387470603 , 0.026234721765 , 0.076972194016 , 0.071688830853 , 0.014162933454 ,
0.046420246363 , 0.035052023828 , 0.039357319474 , 0.038426369429 , 0.052010461688 , 0.029841659591 , 0.038767181337 , 0.020015858114 ,
0.046531938016 , 0.022244023159 , 0.055278703570 , 0.059192232788 , 0.043913431466 , 0.023034691811 , 0.024043291807 , 0.055617727339 ,
0.087057501078 , 0.015427788720 , 0.064855225384 , 0.091783091426 , 0.058370023966 , 0.085004441440 , 0.069662272930 , 0.063795149326 ,
0.095098868012 , 0.076581276953 , 0.071538321674 , 0.094509303570 , 0.067876324058 , 0.017386246473 , 0.040627777576 , 0.061002954841 ,
0.056541413069 , 0.041485831141 , 0.082292631269 , 0.032230034471 , 0.040177159011 , 0.047443889081 , 0.049384452403 , 0.084426254034 ,
0.072044618428 , 0.053916960955 , 0.032311141491 , 0.053358420730 , 0.094991713762 , 0.075637683272 , 0.052517920732 , 0.098594926298 ,
0.064883619547 , 0.029003702104 , 0.085224464536 , 0.077574558556 , 0.025519935414 , 0.033535923809 , 0.028254812583 , 0.098629131913 ,
0.099725432694 , 0.075358629227 , 0.042552284896 , 0.096228249371 , 0.068136826158 , 0.075637847185 , 0.055207215250 , 0.027609685436 ,
0.055984437466 , 0.040362037718 , 0.094702586532 , 0.076330162585 , 0.080990962684 , 0.025029933080 , 0.078085787594 , 0.067802026868 ,
0.028709301725 , 0.087212406099 , 0.098864518106 , 0.095896862447 , 0.078623861074 , 0.021218275651 , 0.095558568835 , 0.062860436738 ,
0.045270346105 , 0.058691695333 , 0.091233126819 , 0.085169576108 , 0.055144980550 , 0.061618253589 , 0.047952704132 , 0.051068589091 ,
0.039685063064 , 0.056846231222 , 0.034563515335 , 0.019008928910 , 0.043067634106 , 0.027708671987 , 0.099656254053 , 0.082616634667 ,
0.077727526426 , 0.076536469162 , 0.038497827947 , 0.082940764725 , 0.035411395133 , 0.049292288721 , 0.065454579890 , 0.084997937083 ,
0.050251975656 , 0.084978245199 , 0.079376176000 , 0.065332032740 , 0.095389463007 , 0.010772192851 , 0.028255032375 , 0.012303841300 ,
0.030663101003 , 0.074725568295 , 0.022548725829 , 0.046429231763 , 0.096043579280 , 0.024496493861 , 0.022557724267 , 0.017651118338 ,
0.082339867949 , 0.016092477366 , 0.076271764934 , 0.089489124715 , 0.023634014651 , 0.016871435568 , 0.028217563406 , 0.012572335079 ,
0.043238669634 , 0.022362902761 , 0.073300302029 , 0.098086453974 , 0.069015495479 , 0.083421394229 , 0.013405937701 , 0.013600531965 ,
0.044139288366 , 0.038966849446 , 0.045803494751 , 0.019347604364 , 0.065164782107 , 0.074557796121 , 0.082798272371 , 0.070622697473 ,
0.095698185265 , 0.069373495877 , 0.070379711688 , 0.061795711517 , 0.060483105481 , 0.049492299557 , 0.097122319043 , 0.064784586430 ,
0.074563413858 , 0.087274447083 , 0.061663024127 , 0.080457165837 , 0.053614012897 , 0.070741482079 , 0.021992653608 , 0.060508631170 ,
0.028499271721 , 0.067271299660 , 0.018771795556 , 0.017561873421 , 0.022398196161 , 0.036457926035 , 0.088380843401 , 0.026810687035 ,
0.037219326943 , 0.015205528587 , 0.019317438826 , 0.098195672035 , 0.014678351581 , 0.069062188268 , 0.058094590902 , 0.045721977949 ,
0.089212760329 , 0.058922961354 , 0.018087893724 , 0.043237403035 , 0.091037295759 , 0.033873654902 , 0.034480325878 , 0.060790024698 ,
0.077942207456 , 0.084656663239 , 0.074548490345 , 0.016404174268 , 0.094948366284 , 0.067212916911 , 0.027546776459 , 0.078657515347 ,
0.046944089234 , 0.019328627735 , 0.016221065074 , 0.077423378825 , 0.094685785472 , 0.064053997397 , 0.035493906587 , 0.086080625653 ,
0.067009665072 , 0.031364768744 , 0.077669069171 , 0.083985120058 , 0.037884518504 , 0.035052709281 , 0.050844237208 , 0.049068786204 ,
0.089053951204 , 0.089813284576 , 0.071896880865 , 0.090792812407 , 0.064856044948 , 0.015566263348 , 0.052199482918 , 0.056649468839 ,
0.057582601905 , 0.080832302570 , 0.058501087129 , 0.037795785815 , 0.073768489063 , 0.046995550394 , 0.074229225516 , 0.050564952195 ,
0.035188950598 , 0.090693295002 , 0.012176701799 , 0.053840540349 , 0.097897119820 , 0.036833323538 , 0.097606852651 , 0.018414743245 ,
0.046585790813 , 0.027325591072 , 0.051203809679 , 0.062462225556 , 0.012630736455 , 0.034792635590 , 0.089800491929 , 0.036846093833 ,
0.042280800641 , 0.033382263035 , 0.055663309991 , 0.043224692345 , 0.057436116040 , 0.048790760338 , 0.096224315464 , 0.092064499855 ,
0.018115134910 , 0.051063805819 , 0.049360454082 , 0.041119046509 , 0.037792071700 , 0.011350454763 , 0.027096884325 , 0.077322855592 ,
0.025235319510 , 0.020002055913 , 0.084546618164 , 0.024896778166 , 0.090120859444 , 0.021306827664 , 0.053845681250 , 0.094313152134 ,
0.011051770300 , 0.047112673521 , 0.062643893063 , 0.095952764153 , 0.028025312349 , 0.021390436217 , 0.019063234329 , 0.055790245533 ,
0.016607098281 , 0.085514411330 , 0.090630739927 , 0.040794700384 , 0.076526463032 , 0.050325900316 , 0.067364431918 , 0.054032810032 ,
0.089468531311 , 0.037644471973 , 0.050656400621 , 0.042125009000 , 0.024983238429 , 0.013309052214 , 0.095241062343 , 0.036438655108 ,
0.034487493336 , 0.091232918203 , 0.081632927060 , 0.014533892274 , 0.071129210293 , 0.058544591069 , 0.048881672323 , 0.094218358397 ,
0.037854608148 , 0.072386614978 , 0.041756093502 , 0.034694887698 , 0.066954873502 , 0.010591877624 , 0.057686381042 , 0.024936500937 ,
0.037758216262 , 0.072277463973 , 0.097245596349 , 0.066678032279 , 0.037593867630 , 0.010115860030 , 0.067260935903 , 0.024530988187 ,
0.062323108315 , 0.014428569935 , 0.010975875892 , 0.031544163823 , 0.032757710665 , 0.088815160096 , 0.036354474723 , 0.059645377100 ,
0.099845476449 , 0.022876571864 , 0.066545926034 , 0.067304484546 , 0.036453668028 , 0.016793277115 , 0.064608678222 , 0.088005363941 ,
0.016208328307 , 0.043379850686 , 0.055087111890 , 0.078985176980 , 0.063862934709 , 0.064249292016 , 0.077843591571 , 0.047215029597 ,
0.072950139642 , 0.062995970249 , 0.073179572821 , 0.049065396190 , 0.032096222043 , 0.041198652238 , 0.025711696595 , 0.016487220302 ,
0.050715349615 , 0.042864702642 , 0.037007391453 , 0.053265459836 , 0.062508739531 , 0.074384301901 , 0.046936802566 , 0.076847277582 ,
0.042198047042 , 0.082583926618 , 0.068091705441 , 0.037358924747 , 0.021450933069 , 0.045834451914 , 0.089597672224 , 0.048093818128 ,
0.082745380700 , 0.081667758524 , 0.059962436557 , 0.028650157154 , 0.083191737533 , 0.023568816483 , 0.091077297926 , 0.076047874987 ,
0.016591362655 , 0.091039165854 , 0.065202064812 , 0.071038618684 , 0.066002398729 , 0.022314786911 , 0.074614316225 , 0.042844213545 ,
0.052709758282 , 0.082889460027 , 0.073174737394 , 0.057780727744 , 0.080628566444 , 0.054322332144 , 0.095441535115 , 0.075959458947 ,
0.060606144369 , 0.047480694950 , 0.038057997823 , 0.070794433355 , 0.012091497891 , 0.061807490885 , 0.078496508300 , 0.040762558579 ,
0.076258108020 , 0.040042355657 , 0.031883731484 , 0.069855898619 , 0.078088946640 , 0.030885711312 , 0.036118805408 , 0.058763101697 ,
0.031354807317 , 0.090255044401 , 0.026528192684 , 0.059325337410 , 0.030907729641 , 0.046213410795 , 0.068734861910 , 0.046727620065 ,
0.071077466011 , 0.088893696666 , 0.096361890435 , 0.064246416092 , 0.029563032091 , 0.035861484706 , 0.053941734135 , 0.088678136468 ,
0.073402665555 , 0.018603306264 , 0.065740577877 , 0.031914878637 , 0.053355947137 , 0.053399875760 , 0.071739397943 , 0.054042071104 ,
0.065025843680 , 0.079298496246 , 0.019820615649 , 0.095079623163 , 0.023232406005 , 0.017044469714 , 0.056385166943 , 0.025494366884 ,
0.053814716637 , 0.023967280984 , 0.038100216538 , 0.060315936804 , 0.029896801338 , 0.065542034805 , 0.025012897328 , 0.061746098101 ,
0.036569997668 , 0.081920653582 , 0.080401279032 , 0.014349916950 , 0.039057496935 , 0.039361391217 , 0.016888631508 , 0.047227539122 ,
0.013182305731 , 0.035007201135 , 0.096012540162 , 0.042668625712 , 0.071610607207 , 0.049430571496 , 0.049603790045 , 0.080877676606 ,
0.011147823185 , 0.041476249695 , 0.011317988858 , 0.021434435621 , 0.038564972579 , 0.041454456747 , 0.094981215894 , 0.079331651330 ,
0.037087611854 , 0.051492877305 , 0.060804754496 , 0.055548414588 , 0.092221394181 , 0.045037060976 , 0.097847394645 , 0.011128287762 ,
0.073143236339 , 0.068299137056 , 0.013616912067 , 0.049433000386 , 0.090395450592 , 0.046352505684 , 0.066535532475 , 0.072655841708 ,
0.066780760884 , 0.054230317473 , 0.078868247569 , 0.078667946160 , 0.042192153633 , 0.073480725288 , 0.070595659316 , 0.091177403927 ,
0.048665925860 , 0.068154260516 , 0.098540179431 , 0.044820740819 , 0.062129154801 , 0.084690675139 , 0.016188219190 , 0.065388463438 ,
0.053914666176 , 0.083751641214 , 0.073776155710 , 0.085797943175 , 0.086062215269 , 0.027598926798 , 0.055148579180 , 0.032175332308 ,
0.020796105266 , 0.020141441375 , 0.087186329067 , 0.020639412105 , 0.086594872177 , 0.070020012558 , 0.046334929764 , 0.041199579835 ,
0.041367098689 , 0.066786356270 , 0.058265551925 , 0.039069592953 , 0.062623083591 , 0.016084235162 , 0.027736337855 , 0.024632040411 ,
0.050709255040 , 0.030434744433 , 0.016743734479 , 0.041929632425 , 0.071312151849 , 0.073334500194 , 0.042897976935 , 0.056319184601 ,
0.086556620896 , 0.057083621621 , 0.064408212900 , 0.048869155347 , 0.063856586814 , 0.047577604651 , 0.046729512513 , 0.012906678952 ,
0.082555055618 , 0.032758828253 , 0.017640940845 , 0.091296203434 , 0.065355546772 , 0.040632307529 , 0.047172464430 , 0.077541485429 ,
0.099835671484 , 0.038009561598 , 0.066746771336 , 0.022941358387 , 0.075407624245 , 0.055932193995 , 0.062352351844 , 0.055878937244 ,
0.067205965519 , 0.090598985553 , 0.047112233937 , 0.055291645229 , 0.096723824739 , 0.027273533866 , 0.076283507049 , 0.016865065321 ,
0.011151421815 , 0.011953734793 , 0.086422085762 , 0.046001166105 , 0.011594395153 , 0.077004835010 , 0.080197647214 , 0.011898988858 ,
0.066300742328 , 0.086539342999 , 0.036688849330 , 0.099502012134 , 0.010294916108 , 0.016652606428 , 0.040374282748 , 0.030566932634 ,
0.078417211771 , 0.058049656451 , 0.010581038892 , 0.055532641709 , 0.097101651132 , 0.077471531928 , 0.093993030488 , 0.030765857548 ,
0.091750122607 , 0.044260025024 , 0.088304169476 , 0.088164784014 , 0.085581421852 , 0.046910859644 , 0.090795166790 , 0.014362931252 ,
0.077797792852 , 0.087417498231 , 0.035823404789 , 0.043975681067 , 0.079288154840 , 0.025960169733 , 0.052577361465 , 0.017681440338 ,
0.051958829165 , 0.062036231160 , 0.052857846022 , 0.051778897643 , 0.097941473126 , 0.062233477831 , 0.038040481508 , 0.046295985579 ,
0.016661457717 , 0.099138617516 , 0.022682357579 , 0.042385973036 , 0.091035768390 , 0.098178826272 , 0.091452687979 , 0.085400670767};

array<array<float,100>,30> pngimage = {{
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 249, 75, 12, 35, 118, 255, 255, 255,
255, 255, 83, 125, 241, 160, 25, 86, 255, 255,
255, 232, 17, 255, 255, 255, 206, 5, 173, 255,
255, 104, 32, 255, 255, 255, 255, 34, 108, 255,
255, 45, 107, 255, 255, 255, 255, 40, 94, 255,
255, 84, 38, 223, 255, 255, 255, 19, 101, 255,
255, 233, 47, 51, 245, 255, 157, 1, 214, 255,
255, 255, 228, 34, 27, 25, 19, 138, 255, 255,
255, 255, 255, 235, 165, 181, 244, 255, 255, 255},

{255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 254, 142, 39, 183, 255, 255, 255, 255,
255, 255, 120, 21, 62, 166, 255, 255, 255, 255,
255, 255, 112, 232, 78, 157, 255, 255, 255, 255,
255, 255, 255, 255, 93, 138, 255, 255, 255, 255,
255, 255, 255, 255, 100, 130, 255, 255, 255, 255,
255, 255, 255, 255, 99, 130, 255, 255, 255, 255,
255, 255, 255, 255, 87, 143, 255, 255, 255, 255,
255, 208, 22, 56, 53, 44, 38, 44, 255, 255,
255, 255, 243, 188, 183, 208, 230, 240, 255, 255},

{255, 255, 213, 60, 5, 15, 76, 255, 255, 255,
255, 133, 18, 61, 196, 163, 13, 192, 255, 255,
255, 152, 158, 255, 255, 255, 28, 167, 255, 255,
255, 255, 255, 255, 251, 72, 27, 234, 255, 255,
255, 255, 255, 255, 120, 15, 210, 255, 255, 255,
255, 255, 255, 150, 10, 175, 255, 255, 255, 255,
255, 255, 198, 13, 145, 255, 255, 255, 255, 255,
255, 200, 24, 92, 255, 255, 255, 255, 255, 255,
255, 37, 33, 76, 59, 53, 41, 48, 65, 255,
255, 146, 169, 202, 230, 240, 254, 249, 250, 255},

{255, 255, 145, 124, 154, 186, 238, 255, 255, 255,
255, 255, 193, 156, 124, 96, 53, 187, 255, 255,
255, 255, 255, 255, 255, 255, 173, 85, 255, 255,
255, 255, 255, 255, 255, 255, 213, 58, 255, 255,
255, 255, 255, 255, 249, 250, 147, 58, 255, 255,
255, 255, 255, 48, 17, 15, 31, 132, 235, 255,
255, 255, 255, 241, 242, 250, 206, 92, 170, 255,
255, 255, 255, 255, 255, 255, 255, 144, 136, 255,
255, 255, 214, 245, 255, 255, 199, 79, 169, 255,
255, 255, 83, 31, 63, 56, 19, 197, 255, 255},

{255, 167, 101, 255, 255, 255, 237, 46, 255, 255,
255, 156, 104, 255, 255, 255, 237, 38, 255, 255,
255, 156, 105, 255, 255, 255, 254, 38, 237, 255,
255, 143, 104, 224, 225, 210, 195, 44, 223, 255,
255, 123, 64, 75, 77, 86, 96, 34, 225, 255,
255, 250, 251, 255, 255, 255, 255, 60, 210, 255,
255, 255, 255, 255, 255, 255, 255, 64, 205, 255,
255, 255, 255, 255, 255, 255, 255, 47, 222, 255,
255, 255, 255, 255, 255, 255, 255, 48, 222, 255,
255, 255, 255, 255, 255, 255, 255, 76, 187, 255},

{255, 248, 93, 116, 100, 63, 90, 95, 237, 255,
255, 207, 51, 157, 171, 204, 179, 174, 247, 255,
255, 184, 91, 255, 255, 255, 255, 255, 255, 255,
255, 164, 86, 162, 163, 163, 179, 236, 255, 255,
255, 200, 101, 122, 121, 121, 102, 70, 233, 255,
255, 255, 255, 255, 255, 255, 255, 90, 208, 255,
255, 255, 255, 255, 255, 255, 255, 95, 200, 255,
255, 255, 255, 255, 255, 255, 252, 78, 220, 255,
255, 166, 89, 88, 104, 138, 112, 87, 255, 255,
255, 234, 211, 209, 182, 143, 158, 229, 255, 255},

{255, 255, 255, 254, 111, 123, 255, 255, 255, 255,
255, 255, 255, 205, 46, 255, 255, 255, 255, 255,
255, 255, 236, 88, 177, 255, 255, 255, 255, 255,
255, 255, 174, 103, 255, 255, 255, 255, 255, 255,
255, 255, 103, 169, 245, 211, 174, 203, 255, 255,
255, 255, 70, 134, 51, 29, 27, 29, 158, 255,
255, 247, 55, 30, 96, 186, 227, 116, 4, 254,
255, 251, 61, 248, 255, 255, 255, 102, 16, 245,
255, 255, 99, 101, 204, 243, 141, 9, 148, 255,
255, 255, 241, 162, 64, 60, 95, 149, 255, 255},

{244, 21, 15, 22, 32, 28, 28, 57, 250, 255,
254, 210, 172, 143, 122, 121, 98, 7, 228, 255,
255, 255, 255, 255, 255, 255, 134, 26, 255, 255,
255, 255, 255, 255, 255, 245, 32, 107, 255, 255,
255, 255, 255, 255, 255, 136, 17, 251, 255, 255,
255, 255, 255, 255, 240, 21, 141, 255, 255, 255,
255, 255, 255, 255, 97, 35, 255, 255, 255, 255,
255, 255, 255, 155, 13, 168, 255, 255, 255, 255,
255, 255, 220, 8, 138, 252, 255, 255, 255, 255,
255, 255, 160, 64, 255, 255, 255, 255, 255, 255},

{255, 255, 108, 116, 84, 79, 96, 173, 255, 255,
255, 128, 68, 155, 215, 224, 190, 50, 184, 255,
255, 116, 155, 255, 255, 255, 239, 96, 130, 255,
255, 177, 69, 237, 255, 168, 21, 131, 255, 255,
255, 250, 123, 67, 65, 91, 213, 255, 255, 255,
255, 255, 153, 57, 11, 120, 248, 255, 255, 255,
255, 246, 31, 207, 245, 115, 52, 218, 255, 255,
255, 168, 94, 255, 255, 255, 160, 97, 255, 255,
255, 156, 89, 227, 255, 255, 231, 71, 255, 255,
255, 255, 152, 26, 69, 93, 8, 144, 255, 255},

{255, 255, 187, 29, 70, 68, 70, 129, 227, 255,
255, 236, 61, 92, 222, 241, 239, 52, 44, 255,
255, 219, 81, 204, 255, 255, 231, 59, 55, 255,
255, 255, 182, 40, 79, 70, 15, 68, 150, 255,
255, 255, 255, 235, 186, 196, 251, 85, 190, 255,
255, 255, 255, 255, 255, 255, 255, 99, 175, 255,
255, 255, 255, 255, 255, 255, 255, 113, 162, 255,
255, 255, 255, 255, 255, 255, 255, 115, 160, 255,
255, 255, 255, 255, 255, 255, 255, 117, 154, 255,
255, 255, 255, 255, 255, 255, 255, 159, 146, 255},

{255, 255, 252, 198, 110, 84, 201, 255, 255, 255,
255, 255, 45, 8, 13, 11, 2, 37, 242, 255,
255, 93, 26, 217, 255, 255, 181, 7, 58, 254,
220, 5, 197, 255, 255, 255, 255, 72, 21, 250,
126, 37, 255, 255, 255, 255, 255, 81, 52, 255,
106, 49, 255, 255, 255, 255, 243, 27, 132, 255,
132, 33, 254, 255, 255, 255, 133, 28, 243, 255,
237, 8, 129, 222, 208, 144, 7, 145, 255, 255,
255, 160, 24, 17, 20, 31, 103, 255, 255, 255,
255, 255, 245, 223, 223, 244, 255, 255, 255, 255},

{255, 255, 255, 245, 189, 148, 230, 255, 255, 255,
255, 255, 255, 186, 28, 11, 128, 253, 255, 255,
255, 255, 255, 126, 11, 10, 74, 251, 255, 255,
255, 255, 255, 116, 11, 10, 73, 255, 255, 255,
255, 255, 255, 115, 11, 10, 75, 255, 255, 255,
255, 255, 255, 107, 11, 10, 80, 255, 255, 255,
255, 255, 255, 97, 11, 11, 90, 255, 255, 255,
255, 255, 255, 100, 10, 11, 110, 255, 255, 255,
255, 255, 255, 161, 18, 16, 160, 255, 255, 255,
255, 255, 255, 240, 174, 171, 239, 255, 255, 255},

{122, 59, 40, 34, 34, 46, 86, 196, 250, 255,
16, 14, 15, 14, 15, 15, 14, 82, 234, 255,
162, 134, 119, 134, 87, 19, 15, 103, 243, 255,
255, 254, 247, 201, 51, 15, 47, 199, 254, 255,
255, 254, 221, 78, 16, 25, 157, 250, 255, 255,
255, 229, 91, 16, 17, 111, 238, 255, 255, 255,
240, 114, 16, 16, 92, 216, 241, 242, 248, 254,
185, 25, 15, 34, 81, 97, 97, 96, 135, 232,
189, 26, 14, 16, 16, 16, 15, 15, 18, 173,
243, 174, 97, 63, 59, 60, 65, 77, 121, 229},

{238, 132, 42, 28, 28, 37, 62, 129, 231, 255,
231, 99, 26, 22, 21, 18, 16, 19, 136, 248,
251, 218, 170, 159, 154, 126, 48, 15, 55, 222,
255, 255, 246, 193, 139, 99, 33, 15, 68, 228,
255, 255, 202, 41, 16, 15, 15, 26, 161, 250,
255, 255, 196, 33, 15, 14, 14, 26, 158, 248,
255, 255, 244, 180, 114, 67, 22, 21, 100, 234,
253, 232, 196, 178, 156, 84, 20, 23, 112, 237,
240, 135, 44, 30, 22, 16, 16, 48, 196, 252,
239, 126, 29, 21, 25, 47, 108, 196, 248, 255},

{160, 23, 73, 221, 245, 137, 34, 129, 241, 255,
144, 23, 44, 199, 251, 114, 20, 43, 201, 255,
147, 23, 38, 191, 252, 128, 21, 25, 162, 255,
149, 23, 30, 93, 111, 78, 22, 21, 136, 255,
162, 24, 20, 20, 20, 20, 20, 20, 120, 255,
231, 120, 61, 71, 85, 71, 24, 20, 114, 253,
254, 244, 226, 230, 238, 171, 29, 21, 112, 252,
255, 255, 255, 255, 255, 179, 30, 21, 120, 255,
255, 255, 255, 255, 255, 185, 34, 22, 137, 255,
255, 255, 255, 255, 255, 213, 72, 48, 192, 255},

{242, 175, 127, 102, 85, 78, 73, 69, 124, 232,
182, 16, 4, 5, 7, 8, 9, 13, 46, 211,
145, 9, 43, 127, 151, 154, 157, 166, 200, 246,
121, 6, 65, 139, 147, 147, 149, 174, 238, 255,
147, 7, 5, 4, 4, 4, 4, 11, 161, 253,
220, 101, 75, 86, 92, 82, 30, 2, 140, 254,
252, 235, 227, 232, 235, 211, 75, 3, 148, 255,
229, 170, 148, 158, 182, 166, 64, 2, 150, 255,
136, 13, 5, 7, 22, 20, 8, 3, 167, 255,
200, 69, 19, 16, 23, 30, 47, 132, 235, 255},

{255, 255, 253, 205, 65, 13, 81, 228, 255, 255,
255, 246, 179, 58, 3, 3, 98, 238, 255, 255,
250, 174, 20, 5, 15, 82, 215, 253, 255, 255,
210, 50, 10, 71, 154, 225, 254, 255, 255, 255,
140, 2, 27, 179, 179, 157, 158, 197, 246, 255,
145, 6, 18, 52, 12, 18, 7, 30, 170, 249,
136, 3, 17, 65, 182, 207, 98, 9, 53, 215,
152, 6, 26, 217, 255, 255, 205, 12, 35, 203,
202, 34, 5, 87, 217, 209, 66, 2, 80, 233,
246, 164, 39, 7, 16, 13, 6, 65, 205, 253},

{235, 137, 81, 93, 109, 122, 125, 121, 161, 239,
203, 21, 4, 3, 2, 1, 2, 1, 8, 173,
245, 190, 155, 144, 140, 129, 70, 9, 21, 185,
255, 255, 255, 255, 252, 192, 45, 2, 102, 235,
255, 251, 222, 187, 149, 51, 7, 44, 198, 254,
255, 228, 99, 29, 8, 0, 1, 38, 209, 255,
255, 226, 90, 21, 3, 3, 30, 112, 231, 255,
255, 241, 149, 28, 4, 89, 193, 231, 252, 255,
250, 187, 45, 8, 73, 216, 254, 255, 255, 255,
242, 130, 14, 55, 194, 252, 255, 255, 255, 255},

{255, 242, 160, 65, 30, 24, 29, 65, 188, 250,
255, 184, 16, 5, 22, 30, 20, 2, 57, 217,
255, 159, 7, 83, 173, 189, 127, 15, 27, 192,
255, 165, 11, 42, 170, 202, 83, 4, 57, 214,
255, 218, 64, 1, 23, 35, 9, 25, 158, 246,
255, 248, 174, 37, 1, 0, 13, 117, 230, 254,
254, 220, 86, 5, 5, 11, 6, 29, 159, 246,
247, 132, 9, 25, 120, 163, 70, 3, 54, 215,
238, 95, 3, 41, 119, 136, 75, 8, 42, 206,
246, 152, 24, 6, 2, 1, 1, 17, 136, 241},

{255, 251, 198, 66, 11, 4, 9, 51, 180, 249,
249, 195, 65, 19, 86, 134, 43, 3, 38, 208,
225, 72, 8, 72, 242, 253, 195, 20, 5, 165,
243, 153, 37, 44, 219, 251, 195, 28, 13, 179,
254, 207, 46, 5, 57, 115, 49, 9, 88, 231,
255, 244, 151, 23, 3, 0, 8, 82, 213, 253,
255, 245, 180, 57, 5, 7, 110, 224, 253, 255,
243, 162, 44, 14, 28, 117, 229, 255, 255, 255,
200, 45, 8, 53, 152, 231, 254, 255, 255, 255,
204, 67, 131, 206, 244, 254, 255, 255, 253, 255},

{255, 255, 251, 154, 101, 119, 193, 247, 255, 255,
255, 232, 24, 3, 5, 9, 10, 116, 255, 255,
255, 170, 2, 127, 234, 239, 29, 19, 255, 255,
255, 90, 8, 251, 255, 255, 56, 20, 255, 255,
255, 44, 25, 255, 255, 255, 70, 14, 255, 255,
255, 34, 29, 255, 255, 255, 53, 17, 255, 255,
255, 45, 19, 255, 255, 255, 38, 27, 255, 255,
255, 41, 21, 255, 255, 255, 27, 40, 255, 255,
255, 138, 0, 102, 184, 118, 2, 139, 255, 255,
255, 255, 64, 4, 3, 5, 46, 255, 255, 255},

{255, 255, 242, 185, 142, 220, 253, 255, 255, 255,
254, 231, 132, 22, 3, 117, 245, 255, 255, 255,
247, 148, 14, 3, 2, 88, 236, 255, 255, 255,
246, 164, 60, 79, 4, 86, 233, 255, 255, 255,
254, 240, 218, 144, 5, 87, 232, 255, 255, 255,
255, 255, 255, 152, 6, 79, 227, 255, 255, 255,
255, 255, 255, 156, 7, 73, 223, 255, 255, 255,
255, 255, 255, 164, 10, 82, 225, 255, 255, 255,
255, 255, 255, 193, 40, 137, 239, 255, 255, 255,
255, 255, 255, 215, 77, 184, 248, 255, 255, 255},

{252, 219, 128, 44, 17, 15, 27, 126, 237, 255,
224, 83, 15, 12, 20, 27, 16, 31, 189, 255,
177, 17, 13, 75, 157, 150, 50, 19, 167, 255,
217, 91, 98, 214, 237, 127, 27, 35, 191, 255,
250, 229, 232, 232, 143, 28, 21, 119, 237, 255,
255, 249, 203, 106, 27, 18, 110, 228, 254, 255,
235, 154, 54, 15, 25, 113, 226, 254, 255, 255,
126, 18, 12, 47, 109, 154, 166, 165, 162, 185,
40, 13, 18, 22, 22, 21, 22, 21, 19, 30,
74, 33, 49, 59, 66, 68, 68, 70, 85, 129},

{255, 252, 229, 195, 167, 186, 209, 247, 255, 255,
249, 206, 108, 31, 19, 17, 47, 190, 250, 255,
230, 101, 55, 118, 172, 130, 38, 108, 234, 255,
244, 190, 181, 222, 212, 132, 8, 155, 247, 255,
254, 249, 246, 197, 74, 34, 66, 204, 253, 255,
255, 255, 246, 146, 13, 11, 32, 157, 244, 255,
252, 237, 234, 228, 174, 149, 64, 68, 218, 255,
238, 149, 120, 184, 201, 170, 67, 79, 220, 255,
242, 148, 32, 43, 49, 36, 22, 130, 238, 255,
253, 234, 186, 136, 128, 142, 179, 231, 253, 255},

{255, 253, 242, 135, 23, 10, 25, 203, 255, 255,
253, 239, 132, 29, 11, 12, 12, 179, 255, 255,
241, 193, 47, 28, 145, 77, 14, 177, 255, 255,
175, 61, 22, 105, 233, 192, 23, 188, 255, 255,
26, 19, 43, 185, 223, 118, 20, 197, 255, 255,
19, 18, 21, 58, 74, 29, 14, 204, 255, 255,
140, 128, 142, 167, 212, 74, 15, 208, 255, 255,
253, 254, 252, 254, 255, 156, 12, 195, 255, 255,
255, 255, 255, 255, 255, 156, 13, 191, 255, 255,
255, 255, 255, 255, 255, 197, 79, 217, 255, 255},

{196, 38, 15, 19, 15, 13, 12, 12, 20, 184,
167, 31, 100, 186, 185, 174, 162, 148, 169, 218,
160, 59, 227, 252, 252, 252, 252, 252, 252, 249,
157, 28, 123, 195, 200, 198, 205, 232, 251, 255,
158, 31, 38, 32, 44, 35, 25, 68, 210, 254,
203, 167, 183, 178, 207, 203, 90, 16, 136, 248,
241, 247, 251, 252, 252, 252, 211, 31, 103, 239,
193, 141, 211, 250, 251, 234, 113, 21, 139, 246,
142, 28, 44, 127, 181, 79, 22, 70, 219, 252,
221, 126, 37, 21, 23, 29, 64, 193, 249, 252},

{253, 200, 61, 22, 16, 25, 73, 223, 255, 255,
236, 91, 15, 23, 102, 152, 206, 249, 255, 255,
224, 57, 16, 99, 230, 246, 253, 255, 255, 255,
221, 59, 23, 167, 251, 252, 255, 255, 255, 255,
216, 59, 26, 152, 143, 121, 136, 174, 229, 253,
210, 54, 25, 55, 23, 20, 20, 27, 93, 217,
175, 34, 20, 33, 82, 120, 57, 20, 20, 128,
187, 31, 16, 70, 224, 245, 183, 34, 18, 130,
235, 94, 15, 27, 75, 109, 49, 20, 27, 179,
252, 211, 90, 27, 18, 17, 18, 32, 138, 239},

{168, 18, 6, 7, 8, 9, 9, 10, 16, 89,
60, 0, 2, 10, 12, 11, 10, 6, 0, 5,
58, 0, 15, 138, 165, 163, 130, 27, 0, 23,
109, 0, 61, 229, 255, 221, 73, 2, 6, 133,
224, 131, 207, 249, 221, 82, 2, 4, 98, 234,
255, 253, 253, 216, 74, 2, 3, 86, 226, 255,
255, 253, 209, 66, 2, 3, 88, 225, 254, 255,
251, 199, 55, 1, 5, 90, 226, 251, 253, 255,
205, 39, 1, 7, 109, 230, 254, 255, 255, 255,
124, 0, 2, 101, 238, 255, 255, 255, 255, 255},

{255, 253, 221, 126, 53, 27, 35, 110, 224, 254,
255, 233, 105, 19, 17, 38, 23, 13, 136, 247,
255, 203, 42, 23, 114, 148, 54, 20, 107, 237,
255, 228, 90, 19, 97, 60, 17, 32, 170, 250,
255, 248, 138, 15, 13, 15, 47, 143, 236, 255,
255, 252, 163, 19, 10, 20, 67, 125, 222, 254,
255, 242, 116, 17, 38, 80, 31, 22, 124, 240,
255, 239, 111, 16, 72, 185, 117, 18, 66, 219,
255, 252, 183, 38, 14, 82, 86, 23, 71, 219,
255, 255, 242, 145, 29, 17, 35, 94, 166, 242},

{255, 255, 233, 145, 59, 8, 26, 67, 144, 236,
255, 250, 149, 10, 5, 13, 19, 1, 3, 157,
255, 242, 102, 3, 63, 159, 157, 34, 0, 111,
255, 235, 92, 6, 100, 170, 149, 45, 0, 96,
255, 244, 127, 9, 15, 18, 10, 4, 1, 113,
255, 251, 210, 97, 76, 123, 103, 61, 1, 131,
255, 255, 252, 234, 241, 254, 235, 76, 2, 132,
255, 255, 255, 255, 251, 228, 96, 11, 59, 209,
255, 255, 255, 255, 208, 57, 6, 45, 211, 253,
255, 255, 255, 255, 190, 24, 23, 167, 251, 255}}};

void cleandata(array<array<float, 100>, 30>& pngimage){
    for ( int index1 = 0; index1 <30; ++index1){
        for (int index2 = 0; index2 <100; ++index2){
            pngimage[index1][index2] = 256 - pngimage[index1][index2];
            pngimage[index1][index2] = pngimage[index1][index2] / 255;
        }
    }
}

class ineuron {
public:
    array<float,100> weights;
    array<float,100> negweights;
    array<float,100> inputs;
    string typeset;
    float bias;
    float output;
    float error;
    bool activestate;
    bool firstfire;
    float inputsum;
    float neginputsum;
    float weightssum;
    int consecutivecorrect;
    int expectedoutput;
    int totalcorrect;
    int testvar;

    ineuron(float& x, array<float, 100>& y,array<float,100>& z)
        : bias(x), weights(y), negweights(z),typeset("inputneuron"), error(0), activestate(false),firstfire(true), inputsum(0),neginputsum(0),weightssum(0),consecutivecorrect(0),expectedoutput(0),totalcorrect(0),output(0),testvar(0) {}

     ineuron() : bias(0.1), typeset("inputneuron"), error(0), activestate(false),firstfire(true),consecutivecorrect(0), inputsum(0),neginputsum(0),weightssum(0),expectedoutput(0),totalcorrect(0),output(0),testvar(0){
        weights.fill(0);
        negweights.fill(0);
        inputs.fill(0);
     }
};
class outputneuron {
public:
    float bias;
    array<float,10> weights;
    string typeset;
    float output;
    float error;
    int activity = 0;
    int targets = 0;
    float totallayererror = 0;
    float highestincoming = 0;
    float lowestincoming = 100000;
    bool correct;
    int totalcorrect = 0;

    outputneuron(float x, const array<float,10>& y, const string& z)
        :bias(x),weights(y),typeset(z),output(0),error(0),activity(0),targets(0),totallayererror(0),highestincoming(0),lowestincoming(100000),correct(false),totalcorrect(0){}
};

void buildineurons(array<ineuron, 10>& ineurons, const array<float, 1600>& randomnumbers) {
    for (int index1 = 0; index1 < 10; ++index1) {
        ineurons[index1].expectedoutput = index1;
        for (int index2 = 0; index2 < 100; ++index2) {
            int index3 = (index1 * 100) + index2;
            ineurons[index1].weights[index2] = randomnumbers[index3];
            ineurons[index1].negweights[index2] = (randomnumbers[index3]) / 2;
        }
    }
}
unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
std::default_random_engine generator(seed);
std::uniform_real_distribution<float> distribution(0.01, 0.1);
float random_float = distribution(generator);



void adjustbias(array<ineuron,10>& ineurons,outputneuron& finaloutput){
    float biasgap  = finaloutput.highestincoming - finaloutput.lowestincoming;
    if (finaloutput.activity == 0){
        for(int index1 = 0; index1 <10; index1++){
            float bias = ineurons[index1].bias;
            float individualerror = 1 - ineurons[index1].bias;
            float adjustment = (0.8-ineurons[index1].bias) *individualerror;
            ineurons[index1].bias += abs(adjustment) + 0.1 + distribution(generator);
        }
        //cout << "test1";
    }
    if (finaloutput.activity > 1){
        for(int index = 0; index <10; index++){
            if ((ineurons[index].activestate) && (ineurons[index].output != finaloutput.highestincoming)){
                float individualerror = ineurons[index].bias - 0.3;
                float adjustment = (1-ineurons[index].bias) *individualerror;
                ineurons[index].bias = ineurons[index].bias - abs(adjustment);
            }
        }
        //cout << "test2";
    }
    return;
}

void resetvariables(array<ineuron,10>& ineurons,outputneuron& finaloutput){
    finaloutput.totallayererror = 0;
    finaloutput.highestincoming = 0;
    finaloutput.lowestincoming = 10000000;
    finaloutput.activity = 0;
    finaloutput.targets = 0;
    finaloutput.correct = false;
}
void feedforward(array<ineuron, 10>& ineurons,array<array<float, 100>, 30>& pngimage,outputneuron& finaloutput,int image) {
    for (int index1 = 0; index1 < 10; ++index1) {
        float calc = 0;
        float negcalc = 0;
        ineurons[index1].inputsum = 0;
        ineurons[index1].neginputsum = 0;
        ineurons[index1].activestate = false;
        for (int index2 = 0; index2 < 100; ++index2) {
            calc += (ineurons[index1].weights[index2] * ineurons[index1].weights[index2]) * (pngimage[image][index2]);
            negcalc += (ineurons[index1].negweights[index2] * ineurons[index1].negweights[index2]) * (pngimage[image][index2]);
            ineurons[index1].inputs[index2] = pngimage[image][index2];
            }
        ineurons[index1].inputsum = calc;
        ineurons[index1].neginputsum = negcalc;
        ineurons[index1].output = (calc-negcalc)/100 + ineurons[index1].bias;

        if (ineurons[index1].output >= finaloutput.highestincoming){
            finaloutput.highestincoming = ineurons[index1].output;
        }
        if (ineurons[index1].output < finaloutput.lowestincoming){
            finaloutput.lowestincoming = ineurons[index1].output;
        }
        if ((ineurons[index1].output >0.8)&&(ineurons[index1].output >= finaloutput.highestincoming)){
            finaloutput.targets = index1;
            finaloutput.activity += 1;
            ineurons[index1].activestate = true;
        }
    }
}
void feedforwardoutputlayer(array<ineuron,10>& ineurons,outputneuron& finaloutput,int expected){
    finaloutput.correct = false;
    if (ineurons[finaloutput.targets].expectedoutput == expected){
        finaloutput.correct = true;
    }
}
/*
void biaserroradjust(array<ineuron,10>& ineurons,outputneuron& finaloutput,int expected){
    for(int index1 = 0; index1 <10; ++index1){
        float inputsum = ineurons[index1].inputsum;
        float neginputsum = ineurons[index1].neginputsum;
        if (ineurons[index1].expectedoutput == expected){
            float bias  = ineurons[index1].bias;
            float output = ineurons[index1].output;
            for (int index2 = 0; index2 <100; ++index2){
                float weight = ineurons[index1].weights[index2];
                float negweight = ineurons[index1].negweights[index2];
                float input = ineurons[index1].inputs[index2];
                float indiverror =  bias / 2;
                float adjustment =( ( (weight * weight) * input ) / ineurons[index1].inputsum ) * indiverror;
                float adjustment2 = ( ( (negweight * negweight) * input) / ineurons[index1].neginputsum) * indiverror;
                ineurons[index1].weights[index2] += sqrt(abs(adjustment));
                ineurons[index1].negweights[index2] += sqrt(abs(adjustment2));
            }
            ineurons[index1].bias = ineurons[index1].bias /10;
        }
    }
}
*/
int main() {
//Create random number availability

// Create and Declare first layer
cleandata(pngimage);
array<ineuron, 10> ineurons;
buildineurons(ineurons,randomnumbers);

// Create and Declare last layer
array<float,10> outputweights;
copy(randomnumbers.begin(), randomnumbers.begin() + 10, outputweights.begin());
outputneuron finaloutput(0,outputweights,"outputneuron");
int loopcount = 0;
//Feed Forward
for (int extraloop = 0; extraloop < 100; ++extraloop){
for (int mainloop =0; mainloop <30; ++mainloop){
    int expected = mainloop % 10;
    ++loopcount;
    resetvariables(ineurons,finaloutput);
    //Bias Adjustments forcing an output
    int test = 0;
    //Perform calculations for first layer

    while (finaloutput.activity == 0){
        test++;
        resetvariables(ineurons,finaloutput);
        feedforward(ineurons,pngimage,finaloutput,expected);
        if (finaloutput.activity ==0){
            adjustbias(ineurons,finaloutput);
        }
        //biaserroradjust(ineurons,finaloutput,expected);
    }
    //Perform calculations for output layer
    feedforwardoutputlayer(ineurons,finaloutput,expected);


    if (finaloutput.correct == true){
        cout << " \n Yep this fired";
        int self = finaloutput.targets;
        ineurons[self].totalcorrect += 1;
        //biaserroradjust(ineurons,finaloutput,expected);
        finaloutput.totalcorrect +=1;
        ineurons[self].consecutivecorrect +=1;
        if (ineurons[self].expectedoutput == expected){
            float bias = ineurons[self].bias;
            float output = ineurons[self].output;
            float inputsum = ineurons[self].inputsum;
            float neginputsum = ineurons[self].neginputsum;
            float error = 1 - output - bias;
            float poserror1  =( inputsum / (inputsum + neginputsum))*abs(error);
            float negerror1 = (neginputsum / (inputsum + neginputsum))*abs(error);
            float poserror = (1.25 - inputsum/100);
            float negerror = (0.25 - neginputsum/100);
            ineurons[self].weightssum = bias;
            ineurons[self].bias = 0.5;
            for(int index2 = 0; index2 <100; ++index2){
                float weights = ineurons[self].weights[index2];
                float negweights = ineurons[self].negweights[index2];
                float input = ineurons[self].inputs[index2];
                float indiverror = (((weights * weights) * input) / (inputsum)) * (poserror);
                float negindiverror = (((negweights * negweights) * input) / (neginputsum)) * (negerror);
                float adjustment = abs((indiverror *input) / input);
                float negadjustment = abs((negindiverror *(1-input)) / input);
                ineurons[self].weights[index2] += copysign(sqrt(adjustment),(poserror));// if input is small decrease this more
                ineurons[self].negweights[index2] += copysign(sqrt(negadjustment),(negerror));//if input is big decrease this more
                ineurons[self].weights[index2] = ineurons[self].weights[index2] *0.95;
                ineurons[self].negweights[index2] = ineurons[self].negweights[index2] *0.95;
                //cout << "  \n input " << input << " signalvar " << signalvar << " bigbalancepos " << bigbalancedownerrorpos << " small balance " << smallbalancedownerrorpos << " error " << error;
                //ineurons[self].weights[index2] = ineurons[self].weights[index2] *0.9;
               //ineurons[self].negweights[index2] = ineurons[self].negweights[index2] * 0.9;

            }
        }
    }

    if (finaloutput.correct == false){
        cout << " NOPE DIDNT CORRECT HERE!" ;
        ineurons[finaloutput.targets].consecutivecorrect = 0;
        for (int index1 = 0; index1<10; ++index1){
            int self = index1;
            if ((ineurons[self].activestate)&&(ineurons[self].expectedoutput != expected)){
                float bias = ineurons[self].bias;
                float output = ineurons[self].output;
                float inputsum = ineurons[self].inputsum;
                float neginputsum = ineurons[self].neginputsum;
                float error = (output) - ineurons[self].bias;
                float poserror1  = (inputsum / (inputsum + neginputsum) ) * abs(error);
                float negerror1 = (neginputsum / (inputsum + neginputsum))* abs(error);
                float poserror = (0.5 - inputsum/100);
                float negerror = (0.5 - neginputsum/100);
                float balanceerror = poserror + negerror;

                ineurons[self].bias = ineurons[self].bias / 2;
                for(int index2 = 0; index2 <100; ++index2){
                    float weights = ineurons[self].weights[index2];
                    float negweights = ineurons[self].negweights[index2];
                    float input = ineurons[self].inputs[index2];
                    //float balance1 = input
                    //float balance2 = 1-input
                    //float signalvar = input - 0.5;
                    //float bigbalancedownerrorpos  =  copysign(input,signalvar) +  ((1 - copysign(1,signalvar))/2);
                    //float smallbalancedownerrorpos = -1* (copysign(input,signalvar)) + ((1 - (-1*(copysign(1,signalvar))))/2);
                    float indiverror = (((weights * weights) * input) / (inputsum)) * (poserror);
                    float negindiverror = (((negweights * negweights) * input) / (neginputsum)) * (negerror);
                    float indivbalance = indiverror + negindiverror;
                    float balanceadjustment = 1-input;
                    float adjustment = abs((indiverror *(1-input)) / input);
                    float negadjustment = abs((negindiverror * input) / input);
                    ineurons[self].weights[index2] += copysign(sqrt(adjustment),(poserror));// if input is small decrease this more
                    ineurons[self].negweights[index2] += copysign(sqrt(negadjustment),(negerror));//if input is big decrease this more
                    //cout << "  \n input " << input << " signalvar " << signalvar << " bigbalancepos " << bigbalancedownerrorpos << " small balance " << smallbalancedownerrorpos << " error " << error;
                }
            }
            if (ineurons[self].expectedoutput == expected){
                float bias = ineurons[self].bias;
                float output = ineurons[self].output;
                float inputsum = ineurons[self].inputsum;
                float neginputsum = ineurons[self].neginputsum;
                float error = 1 - (output) - ineurons[self].bias;
                float poserror1  = (inputsum / (inputsum + neginputsum))*abs(error);
                float negerror1 = (neginputsum / (inputsum + neginputsum))*abs(error);
                float poserror = (1.25 - inputsum/100) ;
                float negerror = (0.25 - neginputsum/100) ;
                ineurons[self].bias = 0.5;
                for(int index2 = 0; index2 <100; ++index2){
                    float weights = ineurons[self].weights[index2];
                    float negweights = ineurons[self].negweights[index2];
                    float input = ineurons[self].inputs[index2];
                    float indiverror = (((weights * weights) * input) / (inputsum)) * (poserror);
                    float negindiverror = (((negweights * negweights) * input) / (neginputsum)) * (negerror);
                    float adjustment = abs((indiverror *input)/ input);
                    float negadjustment = abs((negindiverror * (1- input))/ input);
                    ineurons[self].weights[index2] += copysign(sqrt(adjustment),(poserror));// if input is small decrease this more
                    ineurons[self].negweights[index2] += copysign(sqrt(negadjustment),(negerror));//if input is big decrease this more
                    //cout << "  \n input " << input << " signalvar " << signalvar << " bigbalancepos " << bigbalancedownerrorpos << " small balance " << smallbalancedownerrorpos << " error " << error;
                }
            }

        }
    }

    cout << " \n Current Neuron " << finaloutput.targets << " Previous Output " << ineurons[finaloutput.targets].output << " Inputsum " << ineurons[finaloutput.targets].inputsum << " Neginputsum " << ineurons[finaloutput.targets].neginputsum  << " Bias " << ineurons[finaloutput.targets].bias;
    feedforward(ineurons,pngimage,finaloutput,expected);
    cout << "  \n Current Neuron " << finaloutput.targets << " Afterwards Output " << ineurons[finaloutput.targets].output << " Inputsum " << ineurons[finaloutput.targets].inputsum << " Neginputsum " << ineurons[finaloutput.targets].neginputsum << " Bias " << ineurons[finaloutput.targets].bias;
    cout << fixed;
    cout << setprecision(12);

    for (int index = 0; index <10; ++index){
        cout << " \n Neuron " << index <<" Solo OutPut "<< (ineurons[index].output - ineurons[index].bias) <<  " bias " << ineurons[index].bias << " Expected " << ineurons[index].expectedoutput << " Output " << ineurons[index].output;
        cout << " Total correct " << ineurons[index].totalcorrect << " Consecutive Correct " << ineurons[index].consecutivecorrect;
        //for (int index2 = 0; index2<100; ++index2){
            //cout << " \n Neuron " << index2 << " Value " << ineurons[index].weights[index2] << " Neg Weight " << ineurons[index].negweights[index2] ;
        //}
    }
    cout << "\n The current saved target is " << finaloutput.targets << " mainloop is " << mainloop << " and expected is " << expected << " Total Correct is "<< finaloutput.totalcorrect << " Total loops " << loopcount << "\n";
    cout << "The value finaloutput is "  << ineurons[finaloutput.targets].expectedoutput << " But the model is expecting" << expected << "\n";
    cout << "It took " << test << " iterations to arrive here \n \n";
    }

    }

    for (int index = 0; index <10; ++index){
        for (int index2 = 0; index2<100; ++index2){
            cout << " \n Weight " << index2 << " Value " << ineurons[index].weights[index2] << " Neg Weight " << ineurons[index].negweights[index2] << " Input " << ineurons[index].inputs[index2];
        }
    }
    cout << "Exited without Errors";
    return 0;
}




/*
float floatnumber = 0.48573;
int xyz = -5;
cout << "the value of xyz is " << xyz << "\n";
cout << sqrt(64) <<"\n";
cout << round(2.6)<<"\n";
cout << log(2)<<"\n";
cout << abs(xyz) << "\n";
cout << floatnumber << "\n";
cout << ineurons[0].bias << "\n";
cout << ineurons[0].weights[5] << "\n";
cout << ineurons[0].typeset << "\n";
cout << ineurons[0].calcweights(ineurons[0].bias,ineurons[0].weights[5]) << "\n";
cout << pngimage[0][12] << "\n"; */


                    // These next 3 statements flip the values of what will be applied to the weights, according to error and input
                    // It handles 4 cases, Error up /down, and Input being high/low
                    //float signalvar = input - 0.5;
                    //float bigbalancedownerrorpos  =  copysign(input,signalvar) +  ((1 - copysign(1,signalvar))/2);
                    //float smallbalancedownerrorpos = -1* (copysign(input,signalvar)) + ((1 - (-1*(copysign(1,signalvar))))/2);
