A = [
2413901 2488924 38641701 2233408 2694090 2385145 2274293 2731098 2499546 2729605 2870842 2721888 3069332 3012263 3058991 3286133 3143783 3407983 3531611 3344580 3413326 3394836 3316269 3352548 3315006 3308095 3401626 3370687 3355728 3332091 3336252 3358292 3280358 3309257 3308925 3293123 3288651 3221554 3239846 3295570 3225757 3259070 3294680 3239015 3294271 3212222 3165876 3297230 3221206 3174630 3197948 3035819 3039375 3026958 2917252 2843490 2879988 2934855 2807350 2759320 2798270 2744366 2707653 2652556 2612922 2631013 2568015 2523613 2527380 2486812 2469688 2475345 2447391 2445965 2457183 2427490 2411877 2407898 2361468 2320941 2308613 2310314 2257717 2226194 2239995 2179623 2120648 2046342 2001698 1987948 1957962 1936705 1928393 1901117 1880397 1863833 1850619 1840745 1817243 1796062 1782465 1764555 1742875 1728694 1715942 1699702 1685015 1666028 1656573 1639567 1625038 1613115 1598719 1587360 1575164 1561558 1560561 1544512 1526808 1525253 1522106 1508306 1494820 1488729 1474058 1461210 1446053 1430622 1415000 1403233 1391061 1372124 1359247 1342973 1332549 1313788 1297842 1290100 1277797 1258442 1247362 1234990 1220207 1206834 1193426 1180176 1170078 1153934 1138786 1124746 1109836 1098923 1088578 1070473 1058428 1045965 1030871 1019023 1005699 992769 980470 971885 955733 945060 935983 922485 912559 899758 892441 880987 867468 860030 847378 840724 836589 822622 811565 803935 788644 778284 767355 759637 756931 744102 736347 729647 718184 711623 703435 695594 690000 680025 674591 665545 656295 648723 640366 634149 625460 617879 610795 605575 599349 591521 586292 580982 574260 568953 561295 551058 544095 534343 528580 521119 517605 510878 506291 503162 496699 491729 487815 481430 475491 469788 458656 449506 439341 430616 417416 409195 401361 395131 387573 379550 374631 369769 364525 359128 355236 349438 344806 339385 334316 329881 325820 320550 316508 312350 307608 302971 298523 294500 291482 285658 281957 277806 274661 269829 266220 262176 259764 256175 252097 248165 244524 240626 237825 234144 230847 227372 224502 221241 218307 215478 212932 209260 206019 203978 201133 197056 194971 192024 188793 186194 183212 181079 179522 175878 173088 170562 168494 166275 163893 161191 159227 156277 154490 152118 149394 147883 145584 143105 141430 138990 137141 134732 132443 131048 129464 127199 124407 123731 121714 120079 117983 115574 114301 112775 111583 110011 107577 105727 104782 102892 101551 99974 98719 97007 95855 94087 92819 91088 90101 88204 87586 85818 84249 83125 81893 80854 79577 78488 77250 75876 75309 73932 72980 71842 70677 70056 68836 67623 66390 65892 64195 63231 62650 61917 60826 59926 59049 57607 57075 56013 55280 54786 53504 52865 51899 51134 50428 49510 48886 48339 47290 46698 45576 45372 44683 43877 43066 42688 41817 41271 40809 40454 39264 38848 38112 37456 37013 36306 35753 35413 34679 34283 33684 33348 32661 32450 31499 31198 30610 30272 29865 29378 29012 28568 27754 27114 27115 26690 26388 25712 25261 24847 24645 24247 23926 23657 23181 22784 22517 22182 21642 21366 21124 20703 20392 20226 20093 19729 19227 18931 18485 18057 18040 17785 17705 17171 16764 16565 16136 16234 15896 15485 15272 15094 14768 14919 14548 14161 13824 13671 13527 13458 12973 12863 12885 12419 12394 12083 12098 11679 11627 11336 11141 11007 10745 10703 10765 10468 10319 9971 9857 9796 9684 9504 9378 9033 9090 8981 8763 8516 8243 8231 8196 8008 7990 8029 7831 7562 7471 7293 7266 7030 7045 6874 6877 6735 6727 6388 6399 6254 6195 5976 5929 5761 5825 5714 5729 5482 5452 5323 5123 5154 5108 5156 4976 4812 4769 4844 4617 4614 4498 4549 4390 4315 4367 4157 4160 4057 3952 3877 3763 3872 3651 3645 3724 3525 3453 3378 3322 3330 3270 3266 3187 3125 2982 3009 2986 2897 2915 2868 2704 2601 2686 2725 2671 2537 2635 2571 2490 2366 2342 2310 2375 2320 2225 2216 2180 2188 2081 2143 2053 2058 2002 1976 1901 1911 1779 1926 1780 1689 1784 1801 1777 1676 1725 1568 1649 1652 1575 1578 1530 1425 1473 1458 1465 1347 1364 1306 1339 1358 1343 1321 1227 1229 1223 1226 1189 1155 1198 1160 1090 1106 1008 1080 1037 1042 1017 948 976 984 973 951 937 868 918 901 929 900 798 867 800 792 851 740 801 760 806 756 766 692 729 748 716 715 693 656 673 641 648 636 637 609 618 570 605 603 552 552 551 626 560 525 522 524 510 537 495 481 526 482 492 492 482 481 449 443 458 462 432 430 419 411 351 424 379 402 374 381 359 378 338 379 354 349 340 321 310 299 357 320 328 329 318 317 314 298 296 303 288 271 292 310 260 307 247 293 253 250 254 248 260 265 246 265 245 251 216 243 252 223 214 246 234 229 205 207 237 221 219 204 204 194 216 188 214 189 183 187 200 178 181 172 161 182 183 157 192 176 167 163 183 157 177 172 145 141 168 147 161 165 131 160 133 133 135 142 130 120 111 152 133 130 127 119 128 115 138 129 121 120 133 128 113 120 119 111 116 113 120 109 101 100 104 133 103 122 113 100 109 104 95 94 102 104 95 88 87 95 78 95 84 82 98 104 85 89 96 81 73 87 86 84 73 85 78 80 68 86 86 73 72 63 70 86 75 67 83 79 80 69 73 81 79 64 62 60 77 74 73 70 62 73 72 55 61 61 62 56 62 65 58 65 68 70 64 58 52 48 50 57 63 46 63 45 45 55 46 61 59 53 51 54 37 63 52 47 54 71 45 43 46 45 62 48 53 48 51 54 44 46 48 37 34 46 50 55 58 49 52 47 52 50 53 50 54 63 40 42 42 38 40 41 38 41 38 46 39 46 47 33 52 39 43 40 35 32 23 40 42 43 42 42 37 32 26 41 35 39 38 34 33 42 42 41 30 35 23 37 42 32 24 28 35 42 31 47 33 27 33 30 27 33 21 28 32 36 25 32 32 27 44 26 28 32 33 25 32 35 31 22 31 29 30 31 15 29 29 23 24 38 20 24 23 29 24 18 15 22 24 25 26 17 21 20 15 20 20 20 30 29 32 24 19 22 13 26 27 26 29 22 17 26 17 20 27 30 15 21 22 24 26 21 23 33 46 60 45 48 62 58 63 31 38 39 37 37 44 39 58 43 52 44 59 60 59 62 69 67 58 68 80 73 75 77 80 80 65 76 55 68 81 65 82 60 86 56 51 55 52 60 72 61 65 41 46 55 56 53 52 48 51 698 67 63 45 72 53 49 48 46 45 48 45 39 40 34 40 28 27 33 31 31 27 33 29 29 42 31 30 23 37 27 35 22 26 24 21 25 24 19 18 18 31 22 16 23 25 24 33 20 25 16 18 21 19 16 18 10 19 8 16 13 31 18 25 21 14 32 43 70 414 12 7 13 10 11 12 9 11 5 10 15 11 8 3 11 11 10 10 8 7 11 13 15 11 13 9 8 13 12 12 9 11 11 12 9 7 11 11 9 17 16 13 13 15 9 18 18 8 10 13 19 19 14 13 19 21 15 18 22 18 14 13 16 17 17 17 21 25 14 24 23 20 21 28 15 23 26 27 19 20 28 21 26 29 31 40 29 34 33 32 24 24 36 37 25 26 25 49 28 34 48 35 32 35 34 27 37 37 32 35 43 45 34 34 35 38 46 39 40 42 62 40 46 46 63 56 47 45 37 35 34 38 31 23 38 35 45 29 23 20 28 29 11 11 13 13 6 13 12 7 5 10 3 8 6 7 6 3 7 4 2 4 2 5 7 2 5 5 7 6 10 8 6 4 4 7 6 6 2 5 4 6 8 12 10 9 11 8 8 6 12 14 12 6 11 7 12 15 13 7 10 8 9 16 9 12 10 10 10 12 7 12 10 11 4 12 11 13 13 4 14 7 23 14 7 7 11 5 13 5 6 5 12 11 10 10 6 2 3 6 8 4 10 6 3 4 6 7 2 7 10 6 7 5 6 6 7 8 6 4 7 5 8 6 4 3 4 3 4 10 3 6 3 2 9 7 5 4 5 5 3 7 4 5 6 2 6 2 3 9 7 4 2 3 4 4 2 3 2 4 5 4 5 4 4 5 1 5 6 4 6 3 6 3 4 3 1 5 7 5 3 4 2 2 2 2 2 2 4 4 4 4 2 4 2 2 2 5 1 2 9 8 5 6 2 3 6 3 7 2 7 4 3 5 4 5 6 7 7 4 6 5 3 8 7 2 5 5 3 4 9 6 5 8 13 7 6 5 7 6 11 8 6 4 5 9 7 9 13 6 9 3 8 8 6 2 3 13 7 9 4 8 7 10 6 8 6 5 5 8 5 4 7 9 7 4 10 6 5 8 2 4 3 4 5 6 12 8 5 6 8 5 6 4 5 7 5 1 2 4 3 5 6 2 4 4 3 6 1 1 3 5 2 6 7 5 2 4 1 2 4 2 3 2 3 2 8 1 0 3 2 4 1 1 3 2 1 1 3 6 1 1 2 0 0 2 1 2 7 2 2 5 3 2 8 1 1 1 4 4 1 0 2 1 2 1 0 0 0 2 3 1 1 2 1 2 2 0 0 0 0 0 1 1 1 1 1 1 1 2 1 2 0 3 2 0 0 1 1 0 0 1 1 4 1 0 2 1 1 1 1 2 2 2 0 1 0 1 2 1 4 2 1 0 2 2 4 1 0 1 2 1 2 1 0 1 2 1 3 1 0 0 2 1 0 1 0 0 0 1 1 4 2 2 3 1 1 3 0 0 0 0 2 2 0 2 1 2 2 0 1 1 0 1 2 0 0 2 2 1 2 0 1 0 0 0 2 0 0 2 2 1 1 0 1 1 0 0 3 1 1 1 2 2 1 1 0 0 0 1 2 0 0 1 0 2 3 0 1 0 0 0 1 0 0 2 0 2 1 2 2 2 1 3 0 2 1 0 0 2 0 0 0 0 1 4 0 0 2 4 1 3 3 0 0 1 1 0 0 2 3 0 2 2 2 1 1 1 1 0 1 2 1 2 3 2 1 1 0 0 1 0 2 1 1 0 1 1 1 0 0 0 1 2 1 1 1 1 1 0 0 0 0 1 0 0 1 0 0 0 0 1 0 1 0 2 1 2 1 0 0 1 3 1 0 2 0 1 1 0 0 4 0 0 0 1 3 1 1 1 1 0 1 0 1 0 0 1 1 1 0 1 1 1 0 1 1 1 0 0 2 0 1 0 2 1 1 0 1 2 0 0 1 1 3 
];
B = [
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
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 1413083 977373 435710
 1271160 867515 403645
 1821381 1350297 471084
 1286270 892807 393463
 1875122 1419845 455277
 1480625 1072513 408112
 1336898 954441 382457
 2397382 1902750 494632
 1527798 1152316 375482
 1771265 1387329 383936
 2613032 2132913 480119
 1810868 1437925 372943
 1720032 1327524 392508
 2365862 1966190 399672
 1550939 1205216 345723
 1525562 1142975 382587
 2438572 2056954 381618
 1451988 1095781 356207
 1166568 844577 321991
 3836867 3427176 409691
 1192268 873865 318403
 1338257 1010215 328042
 5791452 5391193 400259
 1329013 1013335 315678
 1060948 773052 287896
 9944513 9496388 448125
 1084911 793273 291638
 1041476 766448 275028
 1083058 799078 283980
 1014464 751156 263308
 185563782 172587632 12976150
 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
 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
 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
 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
 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
 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
 
];
D = [
5 21 0 0
3 4 0 0
5 22 0 0
8 12 0 0
9 14 0 0
15 11 24 0
1153 16 55 8
9190 10 73 17
132432 9 101 22
928919 16 112 26
2392547 29 160 46
5831727 26 215 80
12048359 49 417 154
22299054 88 1117 467
32184253 183 1293 692
39409317 429 1563 1067
37397910 915 2492 2121
29036684 1605 3881 3718
18571872 2663 5999 5937
8928758 3981 8152 8361
2891914 5485 10460 10559
523636 7502 12657 12585
49592 10407 14943 15086
19814 13290 17412 17605
22050 17053 20195 20664
25132 20828 23696 23380
28372 25097 26576 26924
31851 28677 29916 30210
34752 32149 32902 33305
37121 35075 35733 36245
39403 37532 37999 38111
41183 39485 39780 39968
41686 40786 41437 41235
42889 41944 42378 42375
43396 42474 42691 42781
43992 43272 43554 43285
44357 44768 43827 43957
45004 44356 44422 44805
45275 45537 45228 45529
46252 46041 46356 46276
47132 47154 47246 46951
48672 48669 48329 48720
49917 50167 50117 50144
52051 51977 52099 52449
54365 54834 54432 54549
57388 57123 57016 57429
59534 59736 59647 59712
63069 62414 61738 62317
64387 64918 64646 64429
66487 67205 66224 66575
68023 68129 68254 67955
68223 68886 68229 68542
67880 67820 68388 68225
66837 66834 67353 67549
64630 64876 65043 65053
62198 62312 62393 62193
59179 59002 58794 59193
54788 54986 55035 55185
50561 50652 49946 50590
46445 46758 46546 46180
42608 42772 42680 43091
40081 40070 39677 39550
36555 37223 36582 37054
35161 34863 35110 34973
34372 34326 34469 34531
34319 34208 34158 34503
35513 36018 35580 35569
36675 36998 36991 36807
36849 37393 37009 37461
39055 39403 39184 39106
39966 39895 39803 40055
41065 40805 40579 40776
41536 41110 41410 42216
40291 39840 39922 39803
37612 37447 37834 37879
36305 36617 36149 36059
31859 31800 31915 31961
25098 25218 24983 24958
23179 23364 23171 23198
21513 21642 21634 21749
12244 12455 12318 12318
7374 7280 7362 7279
465 452 483 457
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 
];
