// c=203 
int sinp[1806]={
362,7796,3530,4880,1220,470,614,338,776,194,236,122,344,86,254,146,
128,32,8,2,376,94,1288,322,172,316,214,424,106,286,268,586,
3338,1304,326,314,170,116,74,80,20,56,14,260,128,32,8,2,
92,3176,794,350,1880,470,818,854,592,148,484,268,130,1474,4768,1192,
298,502,292,214,2444,512,128,32,8,2,1418,932,302,188,662,518,
248,62,460,244,100,136,34,334,3172,1066,454,2200,550,388,472,118,
202,130,1714,2980,514,-4766,-1814,-626,-6494,-1850,-1394,-1634,-1490,-2174,320,80,
20,362,574,250,280,70,82,334,1258,2332,694,316,142,262,154,226,
610,92,74,332,146,224,56,14,62,80,20,278,458,656,164,188,
184,46,232,58,292,112,28,148,196,94,178,124,304,76,130,106,
530,428,266,158,410,212,98,386,374,356,152,38,896,224,56,14,
698,320,80,20,62,7352,1838,2030,4622,8312,2078,2222,7538,3614,3326,14018,
4652,1454,8996,7052,5270,3110,6026,2318,5756,6746,2588,3302,3932,4892,3938,4316,
11912,2978,1336,334,184,46,76,406,352,88,22,544,136,34,166,262,
5024,1256,314,326,182,128,32,8,2,488,122,218,272,68,5618,1094,
470,236,104,26,164,212,2432,608,152,38,74,3188,1046,452,3566,1792,
448,112,28,298,172,622,2080,520,130,142,406,430,766,1054,14428,4840,
1210,514,250,154,118,83996,17894,22508,9602,3662,1352,338,188,206,398,344,
86,4238,1964,2672,668,112,28,526,256,64,16,4,274,3706,2956,616,
154,700,3886,2320,580,538,88,22,70,160,40,10,814,862,8990,3434,
4856,1214,518,446,230,728,182,338,500,22028,4874,22838,57830,55562,179576,44894,
16898,9662,3686,6314,88240,22060,10966,7228,4342,3964,1018,334,346,208,52,118,
400,100,82,94,1048,262,3154,1246,1750,1396,562,274,166,724,382,544,
136,34,76,64,16,4,680,170,128,32,8,2,176,44,194,2936,
734,2732,892,232,58,964,1618,1072,268,178,262,856,214,802,1342,568,
142,118,298,484,226,430,340,4736,1184,296,74,206,548,1088,272,68,
254,584,146,902,404,278,170,260,422,224,56,14,182,134,116,386,
638,686,308,706,538,268,7348,1444,286,556,322,376,94,394,214,8482,
5794,3136,784,196,19654,1880,470,716,662,878,7952,1988,440,110,230,3146,
3578,1124,278,554,1202,518,1976,494,446,1688,422,1364,986,566,1148,734,
638,746,842,908,1004,688,172,100,364,136,34,958,388,796,974,434,
416,104,26,956,248,62,92,86,866,1064,266,482,536,134,158,128,
32,8,2,2414,664,166,358,5986,2314,772,214,3142,2980,628,1036,766,
604,802,370,208,52,262,550,146,164,512,128,32,8,2,1196,296,
74,98,200,50,272,68,218,152,38,131444,24716,20582,6734,20636,30842,11636,
2252,578,818,7042,4138,5812,2788,1258,1696,424,106,3262,1294,556,202,952,
238,160,40,10,8458,16990,6442,8728,2182,11362,6568,1642,122,248,62,206,
332,134,338,626,2840,710,2060,458,1112,278,176,44,80,20,914,3518,
908,242,1070,926,386,460,310,580,208,52,82,2200,550,490,256,64,
16,4,884,452,158,272,68,86,704,176,44,5704,1426,2404,5086,2248,
562,5896,1474,1594,4348,1522,3862,3214,1618,2458,1762,1978,2782,1954,2302,3268,
2788,2494,350,206,152,38,290,3152,788,1106,3284,620,218,434,398,224,
56,14,80,20,1672,418,232,58,148,304,76,3130,1012,274,178,142,
268,1066,1492,1510,23542,11506,4390,10624,2656,664,166,662,824,206,536,134,
266,176,44,968,242,644,224,56,14,374,296,74,104,26,86,2912,
728,182,994,640,160,40,10,346,13090,4384,1096,274,166,670,328,82,
238,1264,316,136,34,9688,2422,1300,820,66550,28354,151168,37792,9448,2362,11182,
4270,1678,706,2722,1732,586,932,1910,794,1166,464,116,248,62,308,-89662,
2396,2252,500,5312,1328,332,140,104,26,722,-194116,-169366,-95074,-56590,-70990,-112558,
-604456,-151114,-91222,-51118,-458818,-193282,-289528,-72382,-99934,-83950,-178006,-122830,-168028,-158470,-1066036,-199804,
-105802,-39598,-55534,-156526,-567682,-286018,-120382,-127672,-31918,-298258,-62734,-78766,-166876,-777634,-491596,-174328,
-43582,-103108,-345346,-278998,-156742,-65902,-89638,-239242,-301354,-112930,-242692,-681622,-383218,-107644,-84814,-101596,
-361714,-747232,-186808,-46702,-532300,-168010,-62926,-66382,-1295368,-323842,-129028,-213046,-119644,-226510,-214456,-53614,
-112390,-246922,-92518,-130606,-133198,-188746,-70702,-106204,-126214,-231100,-97126,-434842,-162988,-45646,-131074,-168190,
-106078,-89134,-299410,-168394,-63070,-52846,-502072,-125518,-237202,-66670,-423340,-118870,-175966,-148102,-190204,-152638,
-108130,-200590,-253240,-63310,-90574,-143782,-1928212,-361462,-203128,-50782,-42478,-607048,-151762,-228292,-561850,-210616,
-52654,-246640,-61660,-412162,-135142,-127582,-107278,-137302,-77038,-217762,-101218,-160510,-113854,-161116,-199876,-140974,
-253078,-142162,-145186,-153826,-261880,-65470,-176668,-111166,-312262,-131512,-32878,-232486,-58414,-109870,-207556,-416356,
-140326,-79294,-90466,-322348,-95782,-434032,-108508,-159100,-200644,-222514,-62446,-158290,-395962,-148408,-37102,-104038,
-469726,-169420,-222622,-187468,-397420,-111580,-117538,-279484,-68782,-259882,-97378,-151810,-106726,-199618,-83932,-237022,
-331486,-279322,-104668,-250162,-70222,-220678,-104290,-111586,-118786,-197836,-209500,-147292,-116878,-350584,-87646,-73582,
-353572,-206404,-222460,-171430,-108070,-98350,-185686,-104254,-104830,-125566,-186754,-181150,-152476,-92902,-633616,-158404,
-124774,-132322,-139612,-158236,-99502,-165580,-78286,-74158,-235474,-146002,-331144,-82786,-392938,-147274,-55150,-142204,
-370852,-87406,-496240,-124060,-348982,-196108,-77998,-463192,-115798,-64942,-87394,-311218,-151756,-162940,-86758,-521170,
-164554,-61630,-260044,-122722,-184444,-194434,-102958,-92542,-109150,-91726,-467080,-116770,-274948,-325654,-182986,-68542,
-217372,-136924,-244006,-115420,-488950,-274840,-68710,-130012,-206242,-153292,-128482,-192586,-72142,-80446,-113926,-130054,
6040,1510,862,1432,358,376,94,1558,1072,268,700,946,502,478,9928,2482,
29134,42334,40798,39340,11260,5122,20464,5116,2530,16012,5482,2134,1396,340,142,3124,
664,166,2152,538,280,70,460,322,7342,160,40,10,82,208,52,88,
22,-2093642,-1177478,-441476,-185876,-52082,-219950,-61724,854,902,25154,9512,2378,1928,482,260,
128,32,8,2,80,20,2924,1610,1226,1286,700,238,664,166,142,592,
148,1258,760,190,9682,8548,6178,6430,1948,410,962,638,320,80,20,392,
98,1202,878,1012,508,346,742,904,226,166,526,1228,704,176,44,218,
164,950,740,248,62,122,128,32,8,2,542,848,212,1346,866,2630,
590,4250,1676,208,52,394,1288,322,388,316,142,136,34,226,334,4708,
1006,460,880,220,124,106,6598,1034,812,236,128,32,8,2,596,14822,
5642,3158,1268,566,296,74,272,68,1646,998,458,434,764,254,218,332,
146,940,934,736,184,46,574,1798,1222,898,400,100,3112,778,376,94,
2308,472,118,292,1384,346,214,466,502,454,364,1492,418,2006,7484,2318,
9590,12830,7430,6674,2588,1454,208,52,472,118,130,796,262,184,46,1138,
6106,7600,1900,442,1441828,1734034,3293086,2084458,1172722,1113778,1410322,2008990,1271866,11032066,59645188,28308838,
10615900,1119844,709348,4808,1202,1526,3350,1094,776,194,326,452,344,86,176,44,
158,146,320,80,20,806,4394,6266,14312,3578,2660,15500,3584,896,224,56,
14,92,104,26,434,1190,2054,2224,556,574,430,460,1000,250,712,178,
154,196,124,550,1330,586,1486,1054,412,334,406,2026,2842,952,238,352,
88,22,314,206,488,122,134,296,74,116,110,512,128,32,8,2,
650,332,1964,668,614,566,5534,10340,1802,764,4718,4400,1100,530,638,3080,
770,94,124,112,28,256,64,16,4,1222,436,2104,526,286,196,56308,
235654,65074,36826,165994,105448,26362,84022,307582,115432,28858,346948,110248,27562,426382,159982,60082,
34018,180688,45172,74506,63286,61018,106378,90178,73654,82402,150586,545386,345532,64876,182032,45508,
99394,91636,131974,42154,399436,56326,66082,60898,36922,120514,57706,31162,68026,146758,128068,338,
1526,662,770,1076,1160,290,1322,968,242,1808,452,4172,872,218,350,1832,
458,482,1256,314,764,674,836,1052,490,274,1018,472,118,292,1696,424,
106,130,382,1210,544,136,34,994,724,226,562,316,868,280,70,2164,
496,124,640,160,40,10,94,508,802,388,262,370,452,176,44,7814,
12188,3656,914,434,254,2612,7148,2678,4826,194,164,122,416,104,26,1720,
430,514,1396,622,538,532,376,94,232,58,262,190,214,172,124,178,
586,448,112,28,718,1810,1564,692,1880,470,5282,1964,5354,4958,1952,488,
122,908,290,1466,2468,926,440,110,134,200,50,260,524,236,386,1766,
1340,344,86,1070,494,278,2798,1142,818,-1126,454,826,2338,970,436,430,
1960,490,592,148,184,46,880,220,83986,31588,6016,1504,376,94,286,394,
274,196,130,142,328,82,124,268,556,626,350,4064,1016,254,662,608,
152,38,932,296,74,122,140,116684,24884,4760,1190,674,212,134,1652,404,
170,158,530,314,1714,1588,1120,280,70,820,796,244,3820,622,328,82,
596,18398,5342,1670,722,1064,266,2144,536,134,146,578,2360,590,1460,650,
920,230,182,164,524,194,766,5596,2818,628,214,8326,4924,3898,1558,934,
3502,3412,736,184,46,496,124,424,106,136,34,178,-61172,-16964,-88766,-27656,
-6914,-45026,-56204,-10442,-24074,-10946,3086,13292,20306,7712,1928,482,278,1142,4052,740,
236,1496,374,20654,6842,4616,1154,530,296,74,458,4706,1862,1622,650,362,
272,68,110,326,3958,1582,616,154,346,418,1480,370,2884,286,454,268,
148,232,58,556,202,358,832,208,52,292,278,314,734,374,428,1328,
332,1544,386,464,116,518,266,1088,272,68,1868,752,188,134,1840,460,
16744,4186,1768,442,298,2110,1450,2434,1012,316,352,88,22,490};
unsigned char cflag[1806+1]={
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,1,1,1,2,2,3,3,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,2,2,2,0,0,
0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,
3,4,5,6,7,0,0,0,0,0,0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,0,0,0,1,1,1,1,1,1,1,0,0,0,0,
0,0,0,0,0,0,0,0,1,1,1,2,2,2,3,4,4,5,6,7,8,
9,10,11,12,13,14,15,0,0,0,0,0,1,1,1,1,2,2,2,2,2,
2,2,2,2,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
2,2,2,2,2,2,2,2,0,0,0,0,0,1,1,1,1,1,2,2,2,
2,2,3,3,3,3,4,4,4,4,5,5,5,5,5,5,5,5,5,5,6,
6,6,0,0,0,0,0,0,0,0,0,1,2,2,2,2,2,2,2,2,2,
2,3,4,4,5,5,5,5,5,6,6,6,6,7,7,8,8,8,9,10,10,
11,11,11,11,11,11,12,12,12,12,12,13,13,13,13,14,14,14,14,15,15,
16,16,16,17,17,18,18,19,20,20,20,20,21,21,22,22,22,23,23,23,23,
24,24,24,25,25,26,26,26,27,28,28,28,29,29,29,30,31,32,32,33,33,
33,34,35,35,35,36,37,37,37,37,37,38,39,39,39,40,40,41,42,42,43,
43,43,44,44,45,45,45,45,45,46,46,47,48,48,48,49,49,49,50,50,50,
51,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,59,59,
60,60,60,60,61,62,63,63,64,65,65,66,67,68,68,69,70,70,70,70,70,
71,72,72,73,73,74,74,75,76,76,77,78,79,79,79,80,80,80,81,81,82,
82,83,84,85,85,86,86,87,87,87,88,89,90,91,91,92,92,92,93,94,95,
96,96,97,98,98,99,99,100,101,101,102,103,104,104,105,106,106,107,107,107,108,
109,109,110,110,111,111,112,113,113,113,114,114,115,116,117,117,117,117,118,118,119,
120,120,121,122,122,123,123,124,125,125,125,126,126,127,127,128,128,128,129,129,130,
131,132,132,133,134,135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,4,4,4,0,
0,0,0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1,
1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,
1,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
1,1,2,2,2,2,2,3,3,4,4,4,5,5,5,6,6,0,0,0,0,
0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,2,
2,2,2,2,2,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,
2,2,3,3,3,3,0,0,0,0,1,1,1,2,2,2,2,2,3,3,3,
3,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
255}; //  index=1806 
unsigned int size[66]={
  20,
  12,
  24,
  12,
  14,
  28,
  4,
  15,
  15,
  16,
  50,
  14,
  31,
  22,
  16,
  25,
  22,
  34,
  12,
  21,
  28,
  18,
  32,
  9,
  22,
  19,
  28,
  25,
  25,
  13,
  9,
  23,
  18,
  23,
  23,
  36,
  298,
  56,
  18,
  15,
  10,
  9,
  23,
  20,
  26,
  28,
  9,
  29,
  36,
  27,
  31,
  62,
  25,
  36,
  19,
  24,
  35,
  31,
  27,
  12,
  22,
  32,
  30,
  22,
  20,
  16};
int cval[66]={
203,205,209,211,215,217,221,223,227,229,233,
235,239,241,245,247,251,253,257,259,263,265,
269,271,275,277,281,283,287,289,293,295,299,
301,305,307,311,313,317,319,323,325,329,331,
335,337,341,343,347,349,353,355,359,361,365,
367,371,373,377,379,383,385,389,391,395,397};
unsigned int numbc=66;