A = [
6645 6409 40592 7477 6793 6315 6415 6296 6386 6269 7229 8634 10017 11789 14744 16383 17481 18167 18657 18243 17033 16464 16338 15875 15908 16798 16313 15419 15414 13009 12545 11889 8308 8290 8179 7979 7931 7698 7625 7785 7600 7734 7545 7754 7907 7937 7842 7543 7750 7741 7704 7780 7719 7790 7538 7552 7647 7787 7624 7276 7456 7466 7481 7344 7412 7318 7203 7084 7213 7166 7020 7466 7314 7379 7409 7501 7458 7228 7124 7035 7062 7064 6957 6989 6669 6990 6668 6555 6494 6496 6393 6392 6314 6323 6214 6210 6288 6224 6161 5977 6049 5983 5919 5954 5878 5785 5769 5778 5711 5763 5585 5705 5636 5595 5501 5555 5634 5544 5518 5358 5298 5354 5455 5206 5302 5303 5300 5383 5327 5164 5084 5156 5196 5109 5005 5041 5062 4940 5036 5010 4874 4842 4899 4817 4986 4890 4822 4753 4691 4905 4687 4652 4621 4568 4510 4669 4553 4375 4380 4395 4444 4382 4362 4293 4321 4242 4172 4251 4246 4269 4210 4254 4296 4194 4139 4077 4034 4069 4023 4070 4017 3978 3986 3989 3981 4053 3981 3924 3959 4171 3866 3667 3741 3866 3723 3833 3855 3719 3748 3803 3676 3645 3537 3627 3653 3641 3587 3550 3540 3502 3440 3394 3365 3333 3371 3334 3254 3395 3290 3314 3374 3231 3167 3226 3114 3153 3305 3127 3029 3135 2962 3068 3063 2965 3002 2976 2831 2869 2833 2872 2637 2841 2811 2811 2817 2615 2741 2766 2652 2615 2649 2535 2679 2651 2481 2602 2523 2504 2480 2516 2374 2368 2448 2306 2373 2309 2287 2253 2239 2285 2348 2292 2229 2332 2196 2244 2213 2153 2089 2215 2127 2221 2221 2069 2077 2083 2156 2064 1981 2149 2084 2078 2043 2032 1986 1930 1967 1940 1999 1880 1911 1925 1897 1865 1923 1924 1829 1789 1814 1775 1831 1759 1752 1838 1742 1764 1717 1779 1737 1801 1763 1720 1680 1726 1603 1625 1681 1639 1664 1644 1593 1709 1542 1614 1576 1614 1622 1553 1710 1555 1530 1529 1550 1469 1478 1410 1526 1498 1407 1434 1454 1378 1452 1423 1399 1325 1322 1331 1332 1374 1367 1303 1221 1201 1158 1236 1210 1202 1172 1156 1084 1104 1072 1004 991 995 1017 966 948 952 955 919 928 886 831 843 799 811 817 808 757 700 776 720 732 664 662 693 640 648 605 615 562 598 592 572 546 555 503 513 502 493 463 472 428 378 372 366 401 366 367 369 371 332 323 301 308 303 264 282 282 273 260 241 244 226 220 234 229 212 190 186 197 220 156 180 166 185 168 187 158 152 149 142 137 125 122 124 120 115 102 114 92 94 98 97 86 95 88 93 85 98 93 87 69 72 77 76 71 67 70 68 97 59 74 57 57 63 61 49 51 50 37 54 53 55 65 58 58 48 38 50 27 41 48 47 58 52 40 20 25 16 24 22 26 15 22 28 21 18 24 14 19 9 13 12 8 9 15 14 11 8 14 15 9 19 17 15 15 10 12 5 10 6 9 9 16 12 12 12 9 8 11 9 12 6 2 12 7 3 11 6 6 10 8 6 16 15 11 15 12 7 7 11 12 7 6 11 14 14 10 17 4 9 7 9 12 8 12 4 8 16 8 15 11 8 3 6 16 7 14 5 6 12 11 10 10 8 8 11 11 6 10 8 15 9 7 11 3 4 4 4 4 4 4 5 1 3 2 2 8 2 7 13 7 12 3 8 5 2 2 3 1 2 1 4 3 2 1 2 3 3 1 2 1 5 4 0 5 0 1 1 4 2 1 2 1 2 3 1 2 1 0 0 2 1 2 4 0 2 2 0 2 1 0 0 2 0 2 0 1 0 2 2 1 5 3 1 5 1 4 1 0 0 1 1 1 3 2 3 3 2 0 3 2 2 0 3 1 4 1 1 0 2 0 0 1 2 3 2 4 2 4 13 8 23 6 2 17 15 6 16 9 6 4 2 11 5 8 9 11 11 13 6 6 7 3 8 1 3 1 0 2 0 1 0 1 1 1 3 2 0 1 6 6 2 2 2 1 7 6 3 6 3 1 1 3 3 2 0 1 2 3 3 2 9 5 4 10 4 6 4 2 6 6 8 12 4 2 9 16 4 4 7 9 9 7 11 5 2 2 6 0 0 0 1 1 4 0 4 1 4 0 2 2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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
];
B = [
0 0 0
 5667 4292 1375
 9993 8280 1713
 5636 4509 1127
 18269 15109 3160
 6799 5718 1081
 3941 3282 659
 3661 3013 648
 2203 1738 465
 1583 1247 336
 1052 856 196
 2281 1911 370
 2296 1888 408
 1669 1370 299
 11670 9986 1684
 3335 2777 558
 3893 3334 559
 2590 2246 344
 3306 2797 509
 3471 2884 587
 2225 1868 357
 7780 6549 1231
 3927 3305 622
 4029 3368 661
 2451 2112 339
 4100 3452 648
 3701 3100 601
 6105 5108 997
 2429 2056 373
 4118 3469 649
 4061 3471 590
 2370 1994 376
 4324 3684 640
 3897 3332 565
 5606 4747 859
 2610 2252 358
 4271 3641 630
 6389 5428 961
 4240 3561 679
 2870 2481 389
 5860 4967 893
 5232 4436 796
 5735 4889 846
 2490 2115 375
 4546 3894 652
 5753 4922 831
 2728 2307 421
 5676 4831 845
 4604 3955 649
 5727 4836 891
 2863 2499 364
 5698 4869 829
 4708 3968 740
 5837 4954 883
 2470 2155 315
 6139 5240 899
 5548 4769 779
 2348 2041 307
 5619 4737 882
 3846 3256 590
 661633 578595 83038
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0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 1135 1185 1151
1414 1929 1423 1314
1627 1607 1447 1424
1688 1743 1641 1749
1962 1878 1783 1854
2070 2098 2051 1957
2275 2289 2091 2029
2526 2607 2383 2367
2861 2763 2520 2562
3222 2652 2587 2583
2748 2720 2494 2857
2566 2471 2549 2426
2603 2663 2563 2558
2666 2663 2651 2755
2673 2780 2728 2787
2928 2914 2973 2998
3093 3207 3059 2964
3110 3142 3134 3177
3298 3250 3342 3353
3384 3373 3436 3434
3642 3671 3657 3555
3662 3747 3835 3775
3862 3766 3810 4009
3849 4011 3990 4102
4036 3960 4025 4050
3915 3886 3794 3902
3738 3836 3867 3831
3706 3618 3735 3673
3493 3365 3406 3444
3285 3194 3171 3185
2966 3013 2987 3016
2648 2775 2670 2706
2411 2536 2474 2386
2388 2211 2285 2201
2086 2092 2085 2129
1989 1926 1993 2054
1902 1971 1926 1938
1911 1929 1929 1888
1963 1850 1972 1955
2044 2012 2080 2062
2106 2182 2221 2115
6043 6176 3444 3232
2505 2549 2485 2444
2636 2547 2656 2612
2650 2641 2633 2781
2685 2642 2850 2759
2531 2512 2539 2620
2218 2249 2180 2323
1901 1895 1863 1895
1510 1518 1509 1520
1073 1134 1092 1101
775 777 803 755
551 581 606 553
397 376 414 397
266 267 255 264
171 169 197 145
18 16 15 13
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0

];x = [
10 12 15 19 23 28 35 43 53 66 81 100 123 152 187 231 285 351 433 534 658 811 1000 1233 1520 1874 2310 2848 3511 4329 5337 6579 8111 10000 12328 15199 18738 23101 28480 35112 43288 53367 65793 81113 100000 123285 151991 187382 231013 284804 351119 432876 533670 657933 811131 1000000 1232847 1519911 1873817 2310130 2848036 3511192 4328761 5336699 6579332 8111308 10000000 12328467 15199111 18738174 23101297 28480359 35111917 43287613 53366992 65793322 81113083 100000000 123284674 151991108 187381742 231012970 284803587 351119173 432876128 533669923 657933225 811130831 1000000000 1232846739 1519911083 1873817423 2310129700 2848035868 3511191734 4328761281 5336699231 6579332247 8111308308 10000000000 
];
