n=500; m=100; T=[9802, 490, 7085, 3165, 6654, 7366, 9026, 9951, 587, 3619, 5109, 7635, 5405, 1615, 3346, 8535, 8470, 2404, 8277, 166, 6218, 2869, 8895, 3547, 6700, 7170, 208, 7321, 6869, 2849, 4900, 4373, 309, 9867, 619, 6551, 6729, 6379, 462, 8099, 6392, 6763, 7263, 2341, 9061, 2724, 108, 9988, 3502, 9778, 5226, 5562, 8306, 8869, 2112, 6483, 9573, 393, 8451, 6530, 2553, 6634, 9297, 7873, 9929, 9218, 7089, 6644, 4344, 5052, 8074, 4675, 9076, 1180, 6142, 641, 8867, 9392, 6259, 3616, 6780, 2561, 9483, 3956, 1654, 8170, 8741, 5295, 8984, 5190, 1606, 766, 7316, 7283, 1851, 8365, 993, 1334, 7957, 12, 2463, 9460, 8995, 7863, 5115, 7910, 1411, 5707, 8779, 4903, 267, 1246, 5759, 7369, 7733, 5287, 6997, 9768, 1377, 5326, 3856, 5903, 7647, 4790, 3250, 6869, 9336, 1889, 73, 2501, 3593, 6990, 8406, 8237, 9152, 6458, 3032, 5429, 8566, 2623, 4004, 6378, 3136, 6189, 7064, 5488, 6273, 8391, 5753, 9963, 3257, 5910, 7426, 895, 9672, 6295, 731, 194, 9307, 7749, 8730, 8719, 7209, 7808, 9962, 3486, 9458, 9691, 2501, 4039, 7950, 5457, 5993, 6667, 4277, 932, 6709, 9259, 6842, 4163, 8019, 8194, 566, 5779, 392, 5817, 9833, 7742, 4501, 6927, 2079, 1944, 5328, 6567, 4340, 6542, 9102, 5206, 8016, 3281, 5749, 9166, 109, 9150, 7656, 2753, 1521, 352, 5703, 7588, 3920, 9854, 1759, 6402, 4131, 7375, 2885, 8003, 6265, 6281, 2098, 8161, 806, 8570, 621, 5175, 7305, 397, 9387, 4502, 6406, 1151, 4581, 2649, 295, 5174, 1059, 1396, 6169, 4777, 3812, 2380, 6472, 7487, 2716, 4870, 7572, 6519, 9591, 4661, 7423, 9334, 7795, 568, 5706, 8065, 7950, 2553, 9242, 9229, 6164, 8147, 4205, 8685, 9760, 7354, 238, 9542, 6009, 2636, 8689, 5751, 5808, 3796, 8169, 5710, 8246, 390, 6369, 7040, 3779, 1092, 431, 5813, 8844, 100, 7289, 3512, 9264, 4484, 9555, 6794, 8804, 9062, 6120, 1869, 7899, 877, 3682, 6698, 7420, 5885, 479, 8167, 299, 7154, 972, 7998, 9623, 870, 8041, 9548, 8486, 8942, 229, 5734, 1949, 9778, 9652, 682, 5920, 7721, 2633, 1754, 8948, 8644, 7669, 1578, 9251, 9138, 7865, 4749, 2928, 8538, 4954, 7855, 1417, 8829, 6078, 2713, 3357, 2051, 1986, 1296, 2042, 3301, 8325, 5411, 2269, 2944, 5893, 2140, 9718, 7229, 6111, 194, 9729, 6827, 1464, 7345, 4097, 8622, 6190, 4133, 5258, 9510, 8543, 2409, 9343, 3118, 9742, 3305, 6994, 6941, 15, 8723, 9452, 3411, 9777, 3002, 8310, 7157, 1094, 4724, 3274, 4720, 1923, 5689, 1283, 1698, 2566, 7635, 9989, 2949, 707, 9171, 8601, 3389, 4292, 6728, 6908, 7058, 4407, 6674, 4827, 6029, 2294, 6359, 3170, 4173, 469, 4457, 4583, 3894, 2397, 5940, 573, 7211, 4868, 9040, 5644, 1291, 2747, 9322, 9279, 7815, 5633, 3277, 2757, 7461, 813, 8057, 2376, 1559, 5065, 2204, 3047, 6093, 5581, 7585, 5610, 3713, 3434, 9174, 4209, 5969, 2210, 5466, 7154, 8523, 9461, 4599, 5843, 4982, 8899, 6345, 3037, 7491, 8144, 7929, 9440, 1806, 1012, 7636, 2825, 7575, 5279, 6074, 8637, 3351, 7490, 3406, 8701, 6893, 4935, 6093, 3736, 8918, 6604, 7426, 8229, 5950, 8660, 8444, 2612, 1705, 7829, 1251, 9313, 8150, 6067, 9580, 6451, 1289, 2434, 2290, 1423, 3183, 486, 6149];