sg[1] = 1
sg[2] = 2
sg[3] = 3
sg[4] = 4
sg[5] = 5
sg[6] = 6
sg[7] = 7
sg[8] = 8
sg[9] = 9
sg[10] = 0
sg[11] = 1
sg[12] = 2
sg[13] = 3
sg[14] = 4
sg[15] = 5
sg[16] = 6
sg[17] = 7
sg[18] = 8
sg[19] = 10
sg[20] = 0
sg[21] = 1
sg[22] = 2
sg[23] = 3
sg[24] = 4
sg[25] = 5
sg[26] = 6
sg[27] = 7
sg[28] = 9
sg[29] = 11
sg[30] = 0
sg[31] = 1
sg[32] = 2
sg[33] = 3
sg[34] = 4
sg[35] = 5
sg[36] = 6
sg[37] = 8
sg[38] = 10
sg[39] = 12
sg[40] = 0
sg[41] = 1
sg[42] = 2
sg[43] = 3
sg[44] = 4
sg[45] = 5
sg[46] = 7
sg[47] = 9
sg[48] = 11
sg[49] = 13
sg[50] = 0
sg[51] = 1
sg[52] = 2
sg[53] = 3
sg[54] = 4
sg[55] = 6
sg[56] = 8
sg[57] = 10
sg[58] = 12
sg[59] = 14
sg[60] = 0
sg[61] = 1
sg[62] = 2
sg[63] = 3
sg[64] = 5
sg[65] = 7
sg[66] = 9
sg[67] = 11
sg[68] = 13
sg[69] = 15
sg[70] = 0
sg[71] = 1
sg[72] = 2
sg[73] = 4
sg[74] = 6
sg[75] = 8
sg[76] = 10
sg[77] = 12
sg[78] = 14
sg[79] = 16
sg[80] = 0
sg[81] = 1
sg[82] = 3
sg[83] = 5
sg[84] = 7
sg[85] = 9
sg[86] = 11
sg[87] = 13
sg[88] = 15
sg[89] = 17
sg[90] = 0
sg[91] = 2
sg[92] = 4
sg[93] = 6
sg[94] = 8
sg[95] = 10
sg[96] = 12
sg[97] = 14
sg[98] = 16
sg[99] = 18
sg[100] = 0
sg[101] = 1
sg[102] = 2
sg[103] = 3
sg[104] = 4
sg[105] = 5
sg[106] = 6
sg[107] = 7
sg[108] = 8
sg[109] = 9
sg[110] = 0
sg[111] = 1
sg[112] = 2
sg[113] = 3
sg[114] = 4
sg[115] = 5
sg[116] = 6
sg[117] = 7
sg[118] = 10
sg[119] = 11
sg[120] = 0
sg[121] = 1
sg[122] = 2
sg[123] = 3
sg[124] = 4
sg[125] = 5
sg[126] = 6
sg[127] = 8
sg[128] = 9
sg[129] = 12
sg[130] = 0
sg[131] = 1
sg[132] = 2
sg[133] = 3
sg[134] = 4
sg[135] = 5
sg[136] = 7
sg[137] = 10
sg[138] = 11
sg[139] = 13
sg[140] = 0
sg[141] = 1
sg[142] = 2
sg[143] = 3
sg[144] = 4
sg[145] = 6
sg[146] = 8
sg[147] = 9
sg[148] = 12
sg[149] = 14
sg[150] = 0
sg[151] = 1
sg[152] = 2
sg[153] = 3
sg[154] = 5
sg[155] = 7
sg[156] = 10
sg[157] = 11
sg[158] = 13
sg[159] = 15
sg[160] = 0
sg[161] = 1
sg[162] = 2
sg[163] = 4
sg[164] = 6
sg[165] = 8
sg[166] = 9
sg[167] = 12
sg[168] = 14
sg[169] = 16
sg[170] = 0
sg[171] = 1
sg[172] = 3
sg[173] = 5
sg[174] = 7
sg[175] = 10
sg[176] = 11
sg[177] = 13
sg[178] = 15
sg[179] = 17
sg[180] = 0
sg[181] = 2
sg[182] = 4
sg[183] = 6
sg[184] = 8
sg[185] = 9
sg[186] = 12
sg[187] = 14
sg[188] = 16
sg[189] = 18
sg[190] = 1
sg[191] = 3
sg[192] = 5
sg[193] = 7
sg[194] = 10
sg[195] = 11
sg[196] = 13
sg[197] = 15
sg[198] = 17
sg[199] = 19
sg[200] = 0
sg[201] = 1
sg[202] = 2
sg[203] = 3
sg[204] = 4
sg[205] = 5
sg[206] = 6
sg[207] = 7
sg[208] = 8
sg[209] = 9
sg[210] = 0
sg[211] = 1
sg[212] = 2
sg[213] = 3
sg[214] = 4
sg[215] = 5
sg[216] = 6
sg[217] = 10
sg[218] = 11
sg[219] = 12
sg[220] = 0
sg[221] = 1
sg[222] = 2
sg[223] = 3
sg[224] = 4
sg[225] = 5
sg[226] = 7
sg[227] = 8
sg[228] = 9
sg[229] = 13
sg[230] = 0
sg[231] = 1
sg[232] = 2
sg[233] = 3
sg[234] = 4
sg[235] = 6
sg[236] = 10
sg[237] = 11
sg[238] = 12
sg[239] = 14
sg[240] = 0
sg[241] = 1
sg[242] = 2
sg[243] = 3
sg[244] = 5
sg[245] = 7
sg[246] = 8
sg[247] = 9
sg[248] = 13
sg[249] = 15
sg[250] = 0
sg[251] = 1
sg[252] = 2
sg[253] = 4
sg[254] = 6
sg[255] = 10
sg[256] = 11
sg[257] = 12
sg[258] = 14
sg[259] = 16
sg[260] = 0
sg[261] = 1
sg[262] = 3
sg[263] = 5
sg[264] = 7
sg[265] = 8
sg[266] = 9
sg[267] = 13
sg[268] = 15
sg[269] = 17
sg[270] = 0
sg[271] = 2
sg[272] = 4
sg[273] = 6
sg[274] = 10
sg[275] = 11
sg[276] = 12
sg[277] = 14
sg[278] = 16
sg[279] = 18
sg[280] = 1
sg[281] = 3
sg[282] = 5
sg[283] = 7
sg[284] = 8
sg[285] = 9
sg[286] = 13
sg[287] = 15
sg[288] = 17
sg[289] = 19
sg[290] = 0
sg[291] = 2
sg[292] = 4
sg[293] = 6
sg[294] = 10
sg[295] = 11
sg[296] = 12
sg[297] = 14
sg[298] = 16
sg[299] = 20
sg[300] = 0
sg[301] = 1
sg[302] = 2
sg[303] = 3
sg[304] = 4
sg[305] = 5
sg[306] = 6
sg[307] = 7
sg[308] = 8
sg[309] = 9
sg[310] = 0
sg[311] = 1
sg[312] = 2
sg[313] = 3
sg[314] = 4
sg[315] = 5
sg[316] = 10
sg[317] = 11
sg[318] = 12
sg[319] = 13
sg[320] = 0
sg[321] = 1
sg[322] = 2
sg[323] = 3
sg[324] = 4
sg[325] = 6
sg[326] = 7
sg[327] = 8
sg[328] = 9
sg[329] = 14
sg[330] = 0
sg[331] = 1
sg[332] = 2
sg[333] = 3
sg[334] = 5
sg[335] = 10
sg[336] = 11
sg[337] = 12
sg[338] = 13
sg[339] = 15
sg[340] = 0
sg[341] = 1
sg[342] = 2
sg[343] = 4
sg[344] = 6
sg[345] = 7
sg[346] = 8
sg[347] = 9
sg[348] = 14
sg[349] = 16
sg[350] = 0
sg[351] = 1
sg[352] = 3
sg[353] = 5
sg[354] = 10
sg[355] = 11
sg[356] = 12
sg[357] = 13
sg[358] = 15
sg[359] = 17
sg[360] = 0
sg[361] = 2
sg[362] = 4
sg[363] = 6
sg[364] = 7
sg[365] = 8
sg[366] = 9
sg[367] = 14
sg[368] = 16
sg[369] = 18
sg[370] = 1
sg[371] = 3
sg[372] = 5
sg[373] = 10
sg[374] = 11
sg[375] = 12
sg[376] = 13
sg[377] = 15
sg[378] = 17
sg[379] = 19
sg[380] = 0
sg[381] = 2
sg[382] = 4
sg[383] = 6
sg[384] = 7
sg[385] = 8
sg[386] = 9
sg[387] = 14
sg[388] = 16
sg[389] = 20
sg[390] = 1
sg[391] = 3
sg[392] = 5
sg[393] = 10
sg[394] = 11
sg[395] = 12
sg[396] = 13
sg[397] = 15
sg[398] = 18
sg[399] = 21
sg[400] = 0
sg[401] = 1
sg[402] = 2
sg[403] = 3
sg[404] = 4
sg[405] = 5
sg[406] = 6
sg[407] = 7
sg[408] = 8
sg[409] = 9
sg[410] = 0
sg[411] = 1
sg[412] = 2
sg[413] = 3
sg[414] = 4
sg[415] = 10
sg[416] = 11
sg[417] = 12
sg[418] = 13
sg[419] = 14
sg[420] = 0
sg[421] = 1
sg[422] = 2
sg[423] = 3
sg[424] = 5
sg[425] = 6
sg[426] = 7
sg[427] = 8
sg[428] = 9
sg[429] = 15
sg[430] = 0
sg[431] = 1
sg[432] = 2
sg[433] = 4
sg[434] = 10
sg[435] = 11
sg[436] = 12
sg[437] = 13
sg[438] = 14
sg[439] = 16
sg[440] = 0
sg[441] = 1
sg[442] = 3
sg[443] = 5
sg[444] = 6
sg[445] = 7
sg[446] = 8
sg[447] = 9
sg[448] = 15
sg[449] = 17
sg[450] = 0
sg[451] = 2
sg[452] = 4
sg[453] = 10
sg[454] = 11
sg[455] = 12
sg[456] = 13
sg[457] = 14
sg[458] = 16
sg[459] = 18
sg[460] = 1
sg[461] = 3
sg[462] = 5
sg[463] = 6
sg[464] = 7
sg[465] = 8
sg[466] = 9
sg[467] = 15
sg[468] = 17
sg[469] = 19
sg[470] = 0
sg[471] = 2
sg[472] = 4
sg[473] = 10
sg[474] = 11
sg[475] = 12
sg[476] = 13
sg[477] = 14
sg[478] = 16
sg[479] = 20
sg[480] = 1
sg[481] = 3
sg[482] = 5
sg[483] = 6
sg[484] = 7
sg[485] = 8
sg[486] = 9
sg[487] = 15
sg[488] = 18
sg[489] = 21
sg[490] = 0
sg[491] = 2
sg[492] = 4
sg[493] = 10
sg[494] = 11
sg[495] = 12
sg[496] = 13
sg[497] = 17
sg[498] = 19
sg[499] = 22
sg[500] = 0
sg[501] = 1
sg[502] = 2
sg[503] = 3
sg[504] = 4
sg[505] = 5
sg[506] = 6
sg[507] = 7
sg[508] = 8
sg[509] = 9
sg[510] = 0
sg[511] = 1
sg[512] = 2
sg[513] = 3
sg[514] = 10
sg[515] = 11
sg[516] = 12
sg[517] = 13
sg[518] = 14
sg[519] = 15
sg[520] = 0
sg[521] = 1
sg[522] = 2
sg[523] = 4
sg[524] = 5
sg[525] = 6
sg[526] = 7
sg[527] = 8
sg[528] = 9
sg[529] = 16
sg[530] = 0
sg[531] = 1
sg[532] = 3
sg[533] = 10
sg[534] = 11
sg[535] = 12
sg[536] = 13
sg[537] = 14
sg[538] = 15
sg[539] = 17
sg[540] = 0
sg[541] = 2
sg[542] = 4
sg[543] = 5
sg[544] = 6
sg[545] = 7
sg[546] = 8
sg[547] = 9
sg[548] = 16
sg[549] = 18
sg[550] = 1
sg[551] = 3
sg[552] = 10
sg[553] = 11
sg[554] = 12
sg[555] = 13
sg[556] = 14
sg[557] = 15
sg[558] = 17
sg[559] = 19
sg[560] = 0
sg[561] = 2
sg[562] = 4
sg[563] = 5
sg[564] = 6
sg[565] = 7
sg[566] = 8
sg[567] = 9
sg[568] = 16
sg[569] = 20
sg[570] = 1
sg[571] = 3
sg[572] = 10
sg[573] = 11
sg[574] = 12
sg[575] = 13
sg[576] = 14
sg[577] = 15
sg[578] = 18
sg[579] = 21
sg[580] = 0
sg[581] = 2
sg[582] = 4
sg[583] = 5
sg[584] = 6
sg[585] = 7
sg[586] = 8
sg[587] = 17
sg[588] = 19
sg[589] = 22
sg[590] = 1
sg[591] = 3
sg[592] = 9
sg[593] = 10
sg[594] = 11
sg[595] = 12
sg[596] = 13
sg[597] = 16
sg[598] = 20
sg[599] = 23
sg[600] = 0
sg[601] = 1
sg[602] = 2
sg[603] = 3
sg[604] = 4
sg[605] = 5
sg[606] = 6
sg[607] = 7
sg[608] = 8
sg[609] = 9
sg[610] = 0
sg[611] = 1
sg[612] = 2
sg[613] = 10
sg[614] = 11
sg[615] = 12
sg[616] = 13
sg[617] = 14
sg[618] = 15
sg[619] = 16
sg[620] = 0
sg[621] = 1
sg[622] = 3
sg[623] = 4
sg[624] = 5
sg[625] = 6
sg[626] = 7
sg[627] = 8
sg[628] = 9
sg[629] = 17
sg[630] = 0
sg[631] = 2
sg[632] = 10
sg[633] = 11
sg[634] = 12
sg[635] = 13
sg[636] = 14
sg[637] = 15
sg[638] = 16
sg[639] = 18
sg[640] = 1
sg[641] = 3
sg[642] = 4
sg[643] = 5
sg[644] = 6
sg[645] = 7
sg[646] = 8
sg[647] = 9
sg[648] = 17
sg[649] = 19
sg[650] = 0
sg[651] = 2
sg[652] = 10
sg[653] = 11
sg[654] = 12
sg[655] = 13
sg[656] = 14
sg[657] = 15
sg[658] = 16
sg[659] = 20
sg[660] = 1
sg[661] = 3
sg[662] = 4
sg[663] = 5
sg[664] = 6
sg[665] = 7
sg[666] = 8
sg[667] = 9
sg[668] = 18
sg[669] = 21
sg[670] = 0
sg[671] = 2
sg[672] = 10
sg[673] = 11
sg[674] = 12
sg[675] = 13
sg[676] = 14
sg[677] = 17
sg[678] = 19
sg[679] = 22
sg[680] = 1
sg[681] = 3
sg[682] = 4
sg[683] = 5
sg[684] = 6
sg[685] = 7
sg[686] = 15
sg[687] = 16
sg[688] = 20
sg[689] = 23
sg[690] = 0
sg[691] = 2
sg[692] = 8
sg[693] = 9
sg[694] = 10
sg[695] = 11
sg[696] = 12
sg[697] = 18
sg[698] = 21
sg[699] = 24
sg[700] = 0
sg[701] = 1
sg[702] = 2
sg[703] = 3
sg[704] = 4
sg[705] = 5
sg[706] = 6
sg[707] = 7
sg[708] = 8
sg[709] = 13
sg[710] = 0
sg[711] = 1
sg[712] = 9
sg[713] = 10
sg[714] = 11
sg[715] = 12
sg[716] = 14
sg[717] = 15
sg[718] = 16
sg[719] = 17
sg[720] = 0
sg[721] = 2
sg[722] = 3
sg[723] = 4
sg[724] = 5
sg[725] = 6
sg[726] = 7
sg[727] = 8
sg[728] = 13
sg[729] = 18
sg[730] = 1
sg[731] = 9
sg[732] = 10
sg[733] = 11
sg[734] = 12
sg[735] = 14
sg[736] = 15
sg[737] = 16
sg[738] = 17
sg[739] = 19
sg[740] = 0
sg[741] = 2
sg[742] = 3
sg[743] = 4
sg[744] = 5
sg[745] = 6
sg[746] = 7
sg[747] = 8
sg[748] = 13
sg[749] = 20
sg[750] = 1
sg[751] = 9
sg[752] = 10
sg[753] = 11
sg[754] = 12
sg[755] = 14
sg[756] = 15
sg[757] = 16
sg[758] = 18
sg[759] = 21
sg[760] = 0
sg[761] = 2
sg[762] = 3
sg[763] = 4
sg[764] = 5
sg[765] = 6
sg[766] = 7
sg[767] = 17
sg[768] = 19
sg[769] = 22
sg[770] = 1
sg[771] = 8
sg[772] = 9
sg[773] = 10
sg[774] = 11
sg[775] = 12
sg[776] = 13
sg[777] = 14
sg[778] = 20
sg[779] = 23
sg[780] = 0
sg[781] = 2
sg[782] = 3
sg[783] = 4
sg[784] = 5
sg[785] = 15
sg[786] = 16
sg[787] = 18
sg[788] = 21
sg[789] = 24
sg[790] = 1
sg[791] = 6
sg[792] = 7
sg[793] = 8
sg[794] = 9
sg[795] = 10
sg[796] = 17
sg[797] = 19
sg[798] = 22
sg[799] = 25
sg[800] = 0
sg[801] = 1
sg[802] = 2
sg[803] = 3
sg[804] = 4
sg[805] = 5
sg[806] = 6
sg[807] = 11
sg[808] = 12
sg[809] = 13
sg[810] = 0
sg[811] = 7
sg[812] = 8
sg[813] = 9
sg[814] = 10
sg[815] = 14
sg[816] = 15
sg[817] = 16
sg[818] = 17
sg[819] = 18
sg[820] = 1
sg[821] = 2
sg[822] = 3
sg[823] = 4
sg[824] = 5
sg[825] = 6
sg[826] = 11
sg[827] = 12
sg[828] = 13
sg[829] = 19
sg[830] = 0
sg[831] = 7
sg[832] = 8
sg[833] = 9
sg[834] = 10
sg[835] = 14
sg[836] = 15
sg[837] = 16
sg[838] = 17
sg[839] = 20
sg[840] = 1
sg[841] = 2
sg[842] = 3
sg[843] = 4
sg[844] = 5
sg[845] = 6
sg[846] = 11
sg[847] = 12
sg[848] = 18
sg[849] = 21
sg[850] = 0
sg[851] = 7
sg[852] = 8
sg[853] = 9
sg[854] = 10
sg[855] = 13
sg[856] = 14
sg[857] = 15
sg[858] = 19
sg[859] = 22
sg[860] = 1
sg[861] = 2
sg[862] = 3
sg[863] = 4
sg[864] = 5
sg[865] = 6
sg[866] = 16
sg[867] = 17
sg[868] = 20
sg[869] = 23
sg[870] = 0
sg[871] = 7
sg[872] = 8
sg[873] = 9
sg[874] = 10
sg[875] = 11
sg[876] = 12
sg[877] = 18
sg[878] = 21
sg[879] = 24
sg[880] = 1
sg[881] = 2
sg[882] = 3
sg[883] = 4
sg[884] = 13
sg[885] = 14
sg[886] = 15
sg[887] = 19
sg[888] = 22
sg[889] = 25
sg[890] = 0
sg[891] = 5
sg[892] = 6
sg[893] = 7
sg[894] = 8
sg[895] = 16
sg[896] = 17
sg[897] = 20
sg[898] = 23
sg[899] = 26
sg[900] = 0
sg[901] = 1
sg[902] = 2
sg[903] = 3
sg[904] = 4
sg[905] = 9
sg[906] = 10
sg[907] = 11
sg[908] = 12
sg[909] = 13
sg[910] = 5
sg[911] = 6
sg[912] = 7
sg[913] = 8
sg[914] = 14
sg[915] = 15
sg[916] = 16
sg[917] = 17
sg[918] = 18
sg[919] = 19
sg[920] = 0
sg[921] = 1
sg[922] = 2
sg[923] = 3
sg[924] = 4
sg[925] = 9
sg[926] = 10
sg[927] = 11
sg[928] = 12
sg[929] = 20
sg[930] = 5
sg[931] = 6
sg[932] = 7
sg[933] = 8
sg[934] = 13
sg[935] = 14
sg[936] = 15
sg[937] = 16
sg[938] = 17
sg[939] = 21
sg[940] = 0
sg[941] = 1
sg[942] = 2
sg[943] = 3
sg[944] = 4
sg[945] = 9
sg[946] = 10
sg[947] = 18
sg[948] = 19
sg[949] = 22
sg[950] = 5
sg[951] = 6
sg[952] = 7
sg[953] = 8
sg[954] = 11
sg[955] = 12
sg[956] = 13
sg[957] = 14
sg[958] = 20
sg[959] = 23
sg[960] = 0
sg[961] = 1
sg[962] = 2
sg[963] = 3
sg[964] = 4
sg[965] = 15
sg[966] = 16
sg[967] = 17
sg[968] = 21
sg[969] = 24
sg[970] = 5
sg[971] = 6
sg[972] = 7
sg[973] = 8
sg[974] = 9
sg[975] = 10
sg[976] = 18
sg[977] = 19
sg[978] = 22
sg[979] = 25
sg[980] = 0
sg[981] = 1
sg[982] = 2
sg[983] = 11
sg[984] = 12
sg[985] = 13
sg[986] = 14
sg[987] = 20
sg[988] = 23
sg[989] = 26
sg[990] = 3
sg[991] = 4
sg[992] = 5
sg[993] = 6
sg[994] = 15
sg[995] = 16
sg[996] = 17
sg[997] = 21
sg[998] = 24
sg[999] = 27
sg[1000] = 0