n=500; m=100; T=[1191, 3663, 3560, 8731, 8330, 7058, 5971, 9489, 9197, 4204, 658, 204, 1461, 6031, 4192, 5087, 2841, 3942, 8507, 5002, 1706, 9762, 2005, 6736, 3372, 9306, 6724, 9643, 4922, 7287, 9502, 341, 3862, 6423, 3747, 6440, 1162, 7976, 8727, 7257, 3179, 5326, 2125, 728, 453, 7830, 1055, 5349, 6268, 7225, 3082, 2538, 5886, 6501, 6123, 1727, 7072, 2353, 740, 303, 9764, 6614, 4935, 2907, 4, 7626, 6008, 415, 4964, 3079, 5740, 2904, 2607, 6565, 7184, 8465, 4364, 3070, 1013, 6075, 3373, 142, 5931, 7128, 7715, 8379, 8418, 2163, 6995, 8626, 698, 8486, 4298, 7001, 6559, 4295, 7453, 4905, 1782, 9791, 2831, 7678, 7658, 6204, 6286, 914, 4841, 8993, 4731, 8621, 9009, 4211, 6537, 3306, 7637, 9291, 96, 6212, 6623, 6786, 2985, 1111, 1706, 6103, 6337, 3680, 9554, 4526, 2114, 8317, 234, 7561, 5936, 4804, 8920, 9768, 9221, 2660, 5398, 2215, 8703, 3817, 7390, 5483, 6346, 6535, 7049, 2023, 6454, 3953, 29, 7033, 6618, 9389, 9209, 1903, 7682, 6839, 9987, 8852, 4023, 5320, 6418, 5745, 9581, 1607, 9933, 4206, 5838, 5211, 4696, 6344, 5572, 7354, 204, 3386, 7625, 6925, 8828, 1309, 7849, 6512, 668, 1303, 5654, 6982, 1218, 9084, 8070, 3460, 3498, 2147, 5516, 7964, 1227, 9158, 8741, 7351, 9184, 6773, 8544, 5485, 3994, 4646, 8883, 3566, 3807, 9108, 6794, 8711, 3789, 1353, 848, 6832, 4583, 413, 3757, 9862, 5937, 8676, 5146, 8464, 7346, 7126, 6498, 111, 724, 8123, 9109, 2754, 2354, 7486, 568, 7475, 4119, 846, 7574, 6574, 8160, 2104, 6716, 6219, 8542, 7608, 4776, 6062, 9361, 6717, 5103, 7919, 8939, 3366, 3882, 8369, 2467, 2657, 9679, 3477, 6113, 6130, 4336, 4433, 3623, 459, 4550, 5743, 8527, 967, 1097, 8849, 6986, 3547, 8773, 1926, 1456, 7865, 2414, 7756, 6942, 9001, 4373, 6917, 5741, 5131, 8960, 8322, 4519, 7135, 2889, 6562, 4939, 4052, 2332, 6381, 3275, 2626, 2966, 7160, 3140, 6283, 6801, 1143, 5388, 3378, 7548, 1306, 2285, 7385, 6648, 9521, 2543, 9646, 8604, 1776, 5997, 8483, 4529, 1845, 4434, 8296, 476, 3494, 8270, 4779, 6306, 7590, 752, 6028, 474, 1443, 8782, 2383, 7058, 5605, 5983, 9646, 9998, 7198, 8402, 272, 1067, 3672, 450, 4597, 6606, 5595, 5721, 9006, 774, 6923, 5276, 2781, 7836, 2518, 9861, 8055, 3179, 8650, 7747, 5235, 8035, 628, 9466, 8038, 9190, 5397, 6157, 2248, 3843, 9446, 8242, 6331, 2650, 5761, 6538, 8895, 522, 2753, 5721, 1489, 8959, 8031, 8197, 5537, 8466, 1634, 8224, 9612, 6166, 5269, 1983, 9038, 8582, 5369, 9339, 658, 1371, 7920, 1449, 9122, 7406, 9938, 3568, 9474, 6602, 1515, 5886, 8754, 8061, 7099, 5152, 9586, 6913, 9297, 645, 3020, 1553, 1906, 6799, 7167, 6904, 8319, 8893, 3722, 6070, 5521, 4862, 7978, 395, 9092, 1485, 5828, 9117, 5633, 6195, 3529, 6364, 820, 7248, 9549, 7602, 2877, 7539, 6663, 5912, 5226, 4134, 3092, 5915, 3336, 5004, 6844, 7864, 1957, 1816, 7048, 8829, 7317, 9422, 717, 4105, 7689, 6524, 8234, 8802, 1468, 2352, 7459, 3357, 2107, 1741, 9772, 3013, 8151, 1513, 5896, 767, 3275, 5634, 286, 85, 6232, 5870, 318, 9665, 984, 3942, 9403, 572, 4921, 6825, 7796, 8628, 7935, 1617, 4235, 6097, 942, 2479, 5055];