結果
問題 | No.3086 愛国心(2) |
ユーザー | googol_S0 |
提出日時 | 2021-04-01 22:32:32 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 40,763 bytes |
コンパイル時間 | 222 ms |
コンパイル使用メモリ | 91,716 KB |
実行使用メモリ | 77,112 KB |
最終ジャッジ日時 | 2024-06-01 04:08:57 |
合計ジャッジ時間 | 1,171 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 61 ms
70,016 KB |
testcase_01 | WA | - |
ソースコード
X=[[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3058,3060,3048,3048,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3054,3048,3048,3057,3036,3020,3048,3048,3048,3060,3057,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3054,3048,3048,3052,3014,2919,2679,2549,2827,2976,3039,3048,3048,3060,3059,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3048,3048,3045,2993,2879,2538,1983,1352,1056,1644,2245,2720,2940,3021,3057,3048,3056,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3056,3048,3048,3039,2965,2806,2382,1801,1128,580,680,741,522,672,1416,2060,2588,2894,3002,3051,3048,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3056,3048,3048,3057,3024,2936,2703,2203,1594,910,550,715,819,848,845,832,766,576,600,1206,1859,2435,2837,2980,3039,3060,3048,3060,3057,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3048,3048,3046,3003,2895,2583,2040,1384,673,567,748,821,851,838,831,833,832,845,842,794,699,571,972,1646,2241,2723,2941,3024,3057,3048,3048,3054,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3048,3048,3039,2976,2832,2436,1857,1176,595,660,777,823,849,837,828,832,832,832,831,829,832,844,846,811,752,533,655,1411,2068,2595,2897,3000,3045,3048,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3048,3048,3057,3029,2944,2740,2258,1663,969,556,720,814,839,845,840,828,832,832,832,832,832,832,832,832,832,828,840,845,821,773,611,596,1211,1867,2438,2836,2973,3039,3048,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3057,3060,3048,3048,3054,3011,2908,2621,2089,1452,729,526,744,832,846,835,829,832,832,832,832,832,832,832,832,832,832,832,832,832,832,834,832,840,842,809,695,561,983,1650,2243,2727,2941,3025,3057,3048,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3056,3060,3060,3060,3056,3060,3060,3060,3060,3060,3060,3056,3060,3060,3060,3060,3060,3048,3060,3060,3060,3057,3057,3048,3036,3036,2990,2861,2485,1899,1250,625,610,745,815,851,831,816,832,820,832,832,820,832,832,820,832,832,820,832,832,832,832,832,820,820,832,830,836,850,821,736,541,715,1421,2061,2596,2898,3003,3048,3048,3048,3060,3060,3060,3060,3060,3048,3060,3048,3060,3060,3060,3060,3056,3060,3056,3060,3060,3056,3056,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3056,3060,3060,3060,3056,3060,3060,3060,3060,3060,3060,3048,3060,3060,3060,3060,3060,3048,3060,3060,3060,3048,3046,3028,2951,2763,2317,1719,1018,561,707,791,833,838,825,828,829,820,832,820,832,832,820,832,832,820,832,832,820,832,832,832,832,832,820,820,832,831,832,830,836,848,810,773,644,597,1195,1869,2439,2832,2975,3039,3048,3048,3060,3060,3060,3048,3060,3048,3060,3060,3060,3060,3048,3060,3056,3060,3060,3056,3056,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3048,3048,3054,3012,2919,2657,2152,1513,759,528,744,818,842,842,834,826,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,828,841,847,839,805,718,557,967,1651,2244,2721,2939,3025,3057,3048,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3048,3048,3048,2997,2874,2527,1970,1319,633,547,759,832,844,836,835,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,830,835,847,833,747,523,708,1420,2058,2595,2896,3003,3048,3048,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3048,3057,3038,2968,2801,2372,1783,1113,593,659,781,832,844,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,828,831,852,828,761,615,612,1207,1862,2434,2832,2977,3039,3060,3048,3060,3059,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3048,3057,3021,2934,2696,2204,1573,838,549,734,802,846,847,832,825,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,829,828,836,849,834,794,717,563,937,1644,2245,2722,2940,3024,3057,3048,3056,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3048,3048,3051,3001,2890,2574,2033,1377,642,529,756,816,847,844,832,831,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,831,826,834,844,843,819,752,515,660,1415,2060,2592,2895,3002,3051,3048,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3048,3048,3060,3039,2981,2837,2427,1844,1188,595,613,782,830,843,834,834,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,835,836,840,830,770,581,598,1211,1860,2435,2836,2980,3039,3060,3048,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3057,3030,2948,2736,2251,1648,964,568,696,801,844,843,829,833,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,833,831,842,842,795,692,569,976,1647,2243,2724,2944,3028,3057,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3042,2926,2589,2093,1443,678,553,751,815,850,842,831,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,831,846,847,810,750,551,673,1426,2072,2552,2912,3039,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3054,2955,2334,1204,585,609,759,834,863,845,832,829,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,829,832,844,863,835,764,625,558,1058,2250,2935,3054,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3058,3006,2719,2182,1553,867,562,739,806,846,844,831,829,831,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,830,825,832,845,846,809,744,558,834,1509,2129,2682,2998,3057,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3057,3034,3003,2950,2776,2351,1761,1086,587,663,782,831,845,831,834,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,844,832,781,665,584,1063,1730,2324,2759,2943,2997,3033,3057,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3025,2801,2764,2949,3012,2987,2867,2506,1951,1301,627,547,757,829,843,836,834,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,835,837,842,832,761,546,625,1294,1941,2493,2855,2983,3003,2934,2738,2830,3030,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2953,2200,1533,2126,2638,2911,3004,3008,2913,2643,2135,1509,751,529,748,818,842,841,834,826,831,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,826,834,844,844,816,744,531,770,1512,2133,2635,2911,2999,2997,2896,2597,2058,1478,2318,2974,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3048,2942,2014,496,634,1303,1933,2483,2852,2983,3009,2952,2755,2307,1729,1043,577,700,783,828,847,835,828,829,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,830,828,837,849,826,782,694,581,1070,1745,2319,2760,2949,3009,2970,2825,2435,1873,1233,589,505,2160,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2944,2029,568,762,682,582,1054,1714,2296,2746,2949,3008,2983,2849,2483,1929,1270,626,573,747,828,851,831,828,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,830,834,851,828,748,564,639,1303,1955,2501,2860,2986,3002,2938,2712,2238,1654,987,569,699,766,609,2173,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3056,2942,2015,513,816,864,808,739,541,737,1475,2113,2616,2907,2996,3001,2910,2626,2108,1475,759,531,744,829,844,834,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,833,830,839,845,820,728,542,846,1533,2144,2645,2916,3002,2996,2894,2580,2058,1417,680,553,746,811,863,810,544,2160,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2942,2012,500,798,848,841,846,819,762,573,603,1256,1910,2462,2840,2978,3008,2947,2741,2286,1702,1024,562,702,803,837,846,841,828,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,828,840,845,826,793,672,571,1095,1758,2334,2768,2951,3009,2967,2813,2421,1861,1201,591,627,772,819,847,841,846,793,532,2158,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2944,2012,500,794,844,828,831,841,840,835,806,689,566,1023,1685,2267,2728,2942,3003,2981,2843,2466,1903,1237,615,636,770,818,847,836,831,832,831,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,829,841,849,815,756,574,630,1319,1973,2513,2862,2986,3001,2934,2701,2226,1630,964,556,708,817,840,844,837,832,832,842,790,532,2159,2968,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3056,3060,3060,3060,2942,2014,500,794,844,832,832,820,832,831,836,851,822,715,529,743,1457,2077,2593,2898,2991,2990,2906,2608,2088,1441,734,539,731,808,840,836,830,820,832,820,832,832,820,832,832,820,832,832,820,832,832,832,832,832,820,820,832,832,829,844,846,806,700,551,856,1544,2158,2656,2920,3003,2995,2887,2565,2038,1408,700,527,725,825,841,837,831,832,832,820,832,830,790,532,2148,2960,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3056,3060,3060,3060,2942,2014,500,794,844,832,832,820,832,832,832,831,837,841,818,763,639,617,1218,1878,2425,2813,2970,3006,2941,2712,2261,1669,1003,553,677,807,842,828,832,822,832,832,820,832,832,820,832,832,820,832,832,832,832,832,820,822,835,839,832,789,638,586,1106,1772,2350,2773,2956,3006,2965,2801,2402,1837,1172,606,656,771,820,835,837,818,832,832,832,832,820,832,830,790,532,2148,2960,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2944,2012,500,794,844,832,832,832,832,832,832,832,832,828,836,848,836,799,712,556,967,1657,2242,2705,2936,3000,2975,2829,2441,1877,1220,596,609,773,822,846,840,828,832,832,832,832,832,832,832,832,832,831,824,831,844,845,823,763,538,629,1333,1981,2521,2874,2987,3000,2931,2689,2208,1608,910,549,725,803,838,851,835,827,832,832,832,832,832,832,832,832,842,790,532,2159,2968,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2942,2012,500,794,844,832,832,832,832,832,832,832,832,832,832,828,835,841,842,828,752,521,690,1411,2048,2573,2890,2990,2991,2897,2594,2069,1413,656,537,753,811,845,844,831,829,831,832,832,832,829,826,835,845,839,801,734,543,825,1553,2167,2662,2921,3003,2990,2882,2553,2017,1377,651,516,758,828,843,840,835,830,832,832,832,832,832,832,832,832,832,832,842,790,532,2158,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2942,2012,500,794,844,832,832,832,832,832,832,832,832,832,832,832,832,832,827,831,843,830,760,592,603,1198,1849,2407,2812,2966,3001,2937,2708,2232,1638,963,567,702,797,843,844,831,833,832,828,831,843,828,771,652,598,1127,1789,2355,2779,2959,3004,2964,2796,2383,1818,1164,597,614,767,832,843,834,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2158,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2944,2012,500,794,844,832,832,832,832,832,832,832,832,832,832,832,832,832,832,829,827,830,843,837,792,710,565,936,1616,2214,2692,2929,2997,2969,2815,2418,1848,1191,600,598,772,832,841,837,846,832,750,523,641,1349,1993,2533,2877,2987,3000,2927,2678,2194,1586,888,562,719,798,840,843,831,827,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2159,2968,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3056,3060,3060,3060,2942,2014,500,794,844,832,832,820,832,832,832,832,832,820,834,826,831,832,832,832,820,816,824,834,844,836,814,754,521,633,1372,2023,2552,2876,2985,2982,2889,2568,2027,1391,651,504,758,811,717,544,890,1574,2178,2669,2918,2997,2991,2877,2540,2006,1361,636,527,754,814,844,845,834,825,827,832,832,832,832,832,832,832,820,832,820,832,832,832,832,820,832,830,790,532,2148,2960,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2944,2012,500,794,844,832,832,832,832,832,832,832,825,828,837,848,835,826,831,832,832,832,832,832,828,828,840,841,828,784,622,586,1163,1821,2385,2796,2961,2991,2931,2694,2209,1607,902,597,1132,1806,2373,2787,2960,3003,2960,2787,2369,1797,1145,585,645,788,829,843,840,827,828,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2159,2968,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3048,2942,2012,500,794,844,832,832,832,832,832,832,826,825,785,655,758,824,846,832,832,832,832,832,832,832,832,832,833,833,842,843,811,699,557,923,1594,2181,2671,2921,2993,2963,2809,2407,2175,2546,2879,2989,3000,2923,2666,2174,1570,900,551,705,812,849,845,833,833,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2158,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2942,2012,500,794,844,832,832,832,832,832,826,830,741,1156,1380,769,525,750,833,847,834,834,832,832,832,832,832,832,832,832,829,836,851,816,754,573,649,1353,1996,2534,2875,2986,2992,2969,3009,2992,2874,2526,1985,1337,648,574,751,816,853,836,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2158,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2942,2012,500,794,844,832,832,832,832,828,828,828,499,1561,2560,2272,1574,822,539,756,825,844,840,828,832,832,832,832,832,832,830,832,830,842,849,825,778,667,581,1129,1784,2462,2960,3054,2962,2460,1776,1113,577,672,780,825,848,841,829,832,831,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2158,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2942,2012,500,794,844,832,832,832,832,828,826,832,467,1637,2859,2975,2792,2334,1684,917,556,745,814,849,842,831,832,831,832,832,832,832,832,832,828,840,840,838,822,763,522,1444,2755,3029,2761,1448,522,766,822,837,841,840,827,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2158,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2942,2012,500,796,845,832,832,832,832,828,826,829,464,1674,2871,3057,3043,2989,2842,2410,1779,1049,582,715,807,848,836,830,832,832,832,832,832,832,832,832,832,828,838,867,725,1405,2726,3019,2734,1417,717,870,840,828,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2158,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2942,2012,502,798,846,832,832,832,832,828,827,832,463,1692,2869,3051,3042,3048,3051,3000,2871,2482,1867,1161,596,681,807,847,836,828,832,832,832,832,832,832,832,831,832,841,665,1420,2731,3018,2736,1428,657,841,834,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2158,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2942,2012,500,796,845,832,832,832,832,826,829,837,491,1690,2845,3046,3038,3052,3048,3048,3054,3008,2889,2548,1953,1251,609,660,801,834,828,832,832,832,832,832,832,832,830,836,661,1406,2727,3016,2733,1419,653,841,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2158,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2942,2012,500,794,844,832,832,832,832,832,828,842,697,1356,2357,2851,2990,3048,3048,3048,3056,3048,3057,3015,2914,2608,2038,1334,634,702,824,829,832,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,651,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2158,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2942,2012,500,794,844,832,832,832,832,832,832,829,819,809,1038,1713,2357,2819,2980,3042,3048,3048,3057,3048,3054,3027,2933,2669,2103,1348,775,831,835,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2158,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3048,2942,2012,500,794,844,832,832,832,832,832,832,832,828,820,742,560,862,1615,2267,2768,2964,3039,3048,3048,3060,3048,3057,3028,2875,2034,566,791,844,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2158,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2942,2012,500,794,844,832,832,832,832,832,832,832,832,835,849,817,757,539,691,1515,2203,2719,2948,3031,3048,3048,3054,3030,2958,2129,530,785,844,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2158,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2942,2012,500,794,844,832,832,832,832,832,832,832,832,832,828,840,842,821,761,561,656,1427,2118,2667,2929,3027,3051,3030,2953,2101,526,787,845,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2158,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2944,2012,500,796,845,832,832,832,832,832,832,832,832,832,832,832,832,833,839,834,768,572,632,1342,2037,2613,2915,3009,2952,2090,522,792,846,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2159,2968,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3056,3060,3060,3060,2942,2014,502,798,846,832,832,820,832,832,832,832,832,820,832,832,832,832,832,829,829,824,780,663,621,1238,1955,2536,2805,2054,523,792,846,820,832,820,832,832,818,836,660,1398,2726,3014,2720,1416,648,840,830,832,820,820,832,832,832,832,832,832,820,832,832,832,832,832,832,832,832,832,832,832,832,832,832,820,832,820,832,832,832,832,820,832,830,790,532,2148,2960,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2944,2012,500,798,846,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,843,841,798,707,583,1112,1847,1632,690,803,841,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2159,2968,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2942,2012,502,798,846,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,828,831,844,844,813,714,564,782,812,823,832,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2158,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2944,2012,502,798,846,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,834,836,845,828,820,826,832,832,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2159,2968,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3056,3060,3060,3060,2942,2014,502,798,846,832,832,820,832,832,832,832,832,820,832,832,832,832,832,832,820,820,832,832,832,820,832,828,835,826,820,832,832,820,832,820,832,832,818,836,660,1398,2726,3014,2720,1416,648,840,830,832,820,820,832,832,832,832,832,832,820,832,832,832,832,832,832,832,832,832,832,832,832,832,832,820,832,820,832,832,832,832,820,832,830,790,532,2148,2960,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3056,3060,3060,3060,2942,2014,500,798,846,832,832,820,832,832,832,832,832,820,832,832,832,832,832,832,820,820,832,832,832,820,832,832,832,820,820,832,832,820,832,820,832,832,818,836,660,1398,2726,3014,2720,1416,648,840,830,832,820,820,832,832,832,832,832,832,820,832,832,832,832,832,832,832,832,832,832,832,832,832,832,820,832,820,832,832,832,832,820,832,830,790,532,2148,2960,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2944,2012,502,798,846,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2159,2968,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2942,2012,500,796,845,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2158,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2942,2012,500,794,844,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2158,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2942,2012,500,795,845,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,790,532,2158,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2943,2014,500,798,846,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,791,537,2162,2967,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3056,2946,2023,512,800,841,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,842,804,569,2168,2969,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,2943,1995,468,796,860,832,833,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,834,833,861,791,506,2141,2966,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3048,2970,2179,611,516,762,833,840,834,834,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,834,836,844,832,759,513,711,2315,2990,3048,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3041,2851,2281,1629,836,543,754,818,845,840,828,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,829,839,847,820,750,557,954,1707,2343,2892,3045,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3056,3060,3060,3060,3048,3045,2980,2822,2359,1701,931,549,741,814,848,836,829,818,832,832,832,832,832,832,820,820,832,832,832,820,832,832,832,820,820,832,832,820,832,820,832,832,818,836,660,1398,2726,3014,2720,1416,648,840,830,832,820,820,832,832,832,832,832,832,820,832,832,832,832,832,832,832,832,832,832,832,832,832,832,820,830,831,848,809,735,574,1005,1771,2409,2853,2997,3040,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3048,3048,3046,2996,2850,2410,1765,1029,577,718,816,850,835,828,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,830,838,851,812,699,586,1102,1833,2465,2870,3001,3048,3048,3053,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3056,3060,3060,3060,3048,3060,3056,3048,3048,3051,3000,2858,2462,1829,1108,580,714,810,846,836,835,832,832,832,820,820,832,832,832,820,832,832,832,820,820,832,832,820,832,820,832,832,818,836,660,1398,2726,3014,2720,1416,648,840,830,832,820,820,832,832,832,832,832,832,820,832,832,832,832,832,832,832,832,832,832,832,834,835,848,802,698,580,1171,1886,2507,2883,2999,3054,3036,3048,3056,3052,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3048,3054,3006,2881,2509,1894,1164,585,712,810,844,841,832,828,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,824,834,843,839,803,690,600,1227,1951,2553,2894,3013,3054,3054,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3056,3060,3060,3060,3048,3060,3060,3060,3060,3060,3060,3048,3048,3054,3013,2896,2556,1941,1226,609,698,792,839,844,819,820,832,832,832,820,832,832,832,820,820,832,832,820,832,820,832,832,818,836,660,1398,2726,3014,2720,1416,648,840,830,832,820,820,832,832,832,832,832,832,820,832,832,832,832,832,832,832,832,844,836,787,681,620,1282,1996,2599,2903,3017,3057,3048,3060,3048,3060,3048,3060,3060,3048,3056,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3048,3056,3017,2914,2599,2012,1294,632,646,782,839,843,831,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,829,841,835,770,626,642,1344,2057,2638,2923,3026,3057,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3059,3056,3048,3057,3027,2924,2637,2060,1358,634,587,779,837,839,831,832,832,832,832,832,832,832,832,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,832,832,832,831,837,831,767,571,648,1405,2108,2671,2934,3028,3057,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3048,3045,3028,2934,2677,2122,1415,647,571,767,827,844,838,827,832,832,832,832,832,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,832,832,832,828,837,842,822,760,554,662,1460,2162,2704,2946,3033,3048,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3048,3048,3027,2948,2711,2173,1471,671,573,759,821,849,837,827,831,832,832,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,832,829,828,837,849,820,756,567,693,1516,2211,2739,2956,3037,3048,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3057,3048,3048,3038,2958,2748,2225,1541,764,563,745,828,846,832,832,832,832,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,832,832,827,831,852,822,742,554,817,1582,2259,2769,2967,3039,3048,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3057,3060,3048,3048,3039,2972,2785,2278,1614,864,547,753,834,846,836,834,832,832,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,832,832,834,836,843,832,745,552,902,1647,2315,2800,2977,3044,3048,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3048,3048,3046,2977,2812,2342,1685,924,551,751,821,844,840,828,832,832,830,836,660,1410,2726,3014,2732,1416,648,840,830,832,832,828,840,842,822,749,557,964,1716,2371,2831,2980,3048,3048,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3048,3048,3045,2984,2839,2399,1746,982,566,740,808,849,843,831,828,836,660,1411,2726,3014,2732,1416,651,840,829,831,843,848,808,737,572,1016,1774,2424,2853,2992,3045,3048,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3054,3048,3048,3045,2998,2862,2447,1807,1075,585,712,810,849,842,839,664,1412,2726,3014,2732,1417,656,842,841,850,809,711,590,1099,1834,2468,2869,3001,3048,3048,3048,3054,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3054,3048,3048,3052,3004,2877,2492,1866,1150,588,697,819,857,668,1411,2726,3014,2731,1421,665,863,819,691,596,1171,1886,2506,2883,3006,3054,3048,3048,3054,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3052,3048,3054,3009,2888,2540,1931,1213,605,724,700,1426,2728,3017,2735,1438,694,727,606,1231,1949,2554,2895,3013,3054,3048,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3048,3056,3015,2905,2584,2000,1290,593,1350,2721,3020,2730,1363,600,1304,2013,2594,2910,3017,3057,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3056,3060,3060,3060,3056,3060,3060,3060,3060,3060,3060,3056,3060,3060,3060,3060,3060,3056,3060,3060,3060,3060,3060,3060,3056,3056,3060,3060,3060,3048,3060,3060,3060,3048,3048,3060,3060,3054,3060,3036,3057,3023,2915,2633,2043,1871,2781,3018,2772,1901,2053,2642,2924,3025,3045,3036,3060,3060,3060,3060,3060,3060,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3056,3060,3056,3060,3060,3060,3060,3056,3060,3056,3060,3060,3056,3056,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3056,3060,3060,3060,3056,3060,3060,3060,3060,3060,3060,3056,3060,3060,3060,3060,3060,3056,3060,3060,3060,3060,3060,3060,3056,3048,3060,3060,3060,3056,3060,3060,3060,3048,3048,3060,3060,3048,3060,3054,3060,3048,3045,3027,2934,2811,2983,3042,2971,2830,2936,3027,3057,3048,3048,3054,3060,3060,3060,3060,3060,3060,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3056,3060,3056,3060,3060,3060,3060,3056,3060,3056,3060,3060,3056,3056,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3048,3057,3048,3051,3060,3051,3048,3058,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3048,3060,3060,3060,3048,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060],[3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060,3060]] for t in range(int(input())): a,b=map(int,input().split()) print(X[a][b]>>2)