n=500; m=100; T=[1285, 2901, 8928, 8162, 3321, 2842, 2122, 326, 6364, 3184, 9285, 3328, 2771, 6151, 9977, 3794, 1118, 5627, 8561, 3543, 8235, 6472, 1906, 3030, 2854, 4857, 6506, 1067, 1576, 7148, 4757, 2366, 2975, 8651, 9542, 3237, 618, 1623, 1721, 4635, 449, 9003, 955, 1247, 3836, 1607, 750, 3937, 4532, 8806, 8447, 5440, 7715, 8823, 9488, 6395, 5104, 9759, 2895, 4973, 9881, 3820, 509, 7700, 108, 7452, 360, 387, 7216, 935, 7570, 9401, 295, 2783, 5511, 9903, 2229, 9506, 5676, 4119, 5752, 769, 3008, 9140, 984, 133, 2747, 308, 8826, 5425, 1308, 835, 6864, 4097, 1326, 1589, 4821, 9427, 757, 7112, 7701, 8048, 2871, 1452, 8510, 6706, 5793, 5092, 3192, 6696, 3162, 1173, 1370, 2210, 5096, 4251, 3450, 4053, 140, 6573, 2818, 9910, 8921, 112, 4624, 9666, 907, 8141, 3647, 5031, 7932, 7391, 2467, 7704, 6457, 5194, 6272, 1991, 842, 1918, 3727, 5333, 2669, 8087, 1470, 799, 813, 915, 5497, 8213, 7259, 9172, 5568, 2286, 2673, 3403, 1676, 2412, 1466, 7806, 2138, 1142, 810, 5168, 9053, 7185, 2743, 9594, 2098, 6605, 1710, 3563, 516, 2586, 2402, 4046, 1755, 9279, 9476, 44, 1561, 6303, 9959, 2458, 1835, 1411, 8471, 6259, 4388, 6878, 8707, 3050, 2188, 8974, 1554, 453, 9214, 2012, 6862, 2333, 5695, 6539, 5970, 7000, 557, 9340, 4581, 1088, 3110, 7195, 7078, 6190, 9073, 7245, 2641, 478, 7569, 5602, 672, 4595, 2370, 6962, 2070, 8295, 5250, 9430, 2357, 9735, 6404, 7227, 7479, 4182, 6106, 4120, 8815, 992, 9738, 9267, 1596, 7988, 2095, 7965, 1849, 1851, 8911, 1764, 3515, 9768, 2538, 2410, 281, 8535, 8792, 8921, 3623, 158, 8318, 3124, 9199, 4624, 183, 6813, 649, 1113, 2078, 637, 3705, 9933, 8004, 3322, 3234, 9850, 3548, 5023, 1768, 3130, 1267, 4303, 3114, 287, 8142, 416, 681, 7884, 4654, 9585, 7295, 3057, 3458, 2260, 2799, 2208, 6062, 8465, 6065, 941, 2021, 2489, 5377, 6671, 1885, 9849, 1288, 730, 8665, 8282, 9905, 6322, 5887, 5425, 6682, 1534, 889, 7394, 1062, 4936, 557, 7799, 4785, 5463, 9360, 1307, 1133, 7471, 1972, 3261, 8950, 3687, 8708, 3755, 9479, 9999, 375, 1441, 3612, 1532, 2660, 9261, 9753, 9182, 537, 4920, 4473, 1207, 4976, 6786, 9094, 3116, 7021, 9923, 2392, 4350, 3263, 2449, 1876, 7787, 7403, 3844, 210, 9508, 5284, 1139, 1081, 7629, 5768, 3047, 9494, 6778, 2501, 4478, 6, 3927, 6492, 1922, 4245, 4561, 3501, 4697, 7044, 2947, 4883, 1770, 5963, 6780, 929, 7079, 9327, 973, 2871, 8897, 9218, 4562, 5221, 6504, 3701, 3887, 564, 9480, 955, 9826, 707, 238, 2608, 9338, 1681, 8864, 8282, 178, 6786, 6795, 9656, 9419, 62, 7319, 1713, 8248, 5215, 1213, 7805, 6224, 5722, 5780, 2833, 2274, 9872, 67, 3953, 290, 582, 9038, 233, 2955, 4953, 8884, 7809, 3941, 7387, 9754, 3084, 2119, 3980, 167, 2026, 2296, 5856, 9651, 416, 2510, 6363, 8617, 1682, 1404, 9580, 7146, 9124, 7657, 4313, 8392, 4218, 2742, 826, 543, 2611, 3857, 6186, 7178, 9672, 7607, 1045, 2426, 5313, 7656, 7242, 6948, 1001, 5794, 3236, 1459, 9131, 645, 5497, 8359, 1322, 7498, 1833, 4712, 2888, 1626, 8277, 5955, 3413, 5510, 7866, 3414, 3120, 4537, 6786, 2442, 7197, 4380];