A = [
1836557 1710516 25538031 1247372 1242604 1184688 1124009 1234824 1086828 1016337 1031794 930433 937866 945192 947011 951289 964293 975083 974530 966032 953635 957619 949149 935015 939908 1215904 1216213 1220397 1488068 1399413 1407438 1404818 1313432 1328335 1324490 1314335 1309761 1297114 1291704 1282079 1274377 1273850 1260950 1252799 1251537 1240314 1227694 1236617 1221667 1211225 1209200 1187473 1185424 1175845 1160766 1147112 1143113 1142498 1124219 1113519 1113469 1101033 1091255 1079512 1068580 1063343 1052064 1042886 1037679 1027503 1023552 1023012 1016549 1014710 1014906 1010038 1002917 996078 984969 978758 970319 962060 950574 942561 935717 924180 911154 896673 884506 877414 868247 855838 848489 839081 830174 822812 813615 806271 797167 788092 780961 774224 764381 755130 749309 740596 731829 724155 719021 710003 701394 695643 690723 682010 675701 668976 681340 678613 669448 684239 681738 676445 670755 667035 661096 653148 647260 640143 631340 625819 616993 609769 602347 595715 589860 581797 575994 568374 561133 553961 548917 541831 535022 527842 522369 515178 509682 501871 496547 490191 482165 478093 471903 464857 458196 453451 446925 440823 436309 429026 424442 417829 412262 407480 401821 395636 390776 386416 382753 376390 370936 365866 361494 356769 353125 347415 341232 337928 333492 329307 323669 319708 314946 312117 306401 302930 297919 294624 291624 287323 282999 278478 275042 271256 266621 264196 260339 257439 251609 248720 246304 241902 238552 236724 231323 229604 226127 223255 218973 216494 213149 209863 206892 204313 202074 198475 195280 192458 189953 187512 185305 182096 179819 176496 174671 171337 168810 165737 163208 160577 157493 155172 153704 150542 148597 145619 143798 142055 139483 137343 135659 132877 131697 129181 127556 125599 123602 121665 119916 117745 116193 114972 113124 110953 109345 107571 106131 104873 103197 101164 98977 97843 96974 94936 94461 92041 90412 88618 87914 86255 85182 83410 82434 81470 79841 78190 77382 75808 74756 73723 72663 71620 70647 69278 68087 67111 65794 65081 63754 62543 61800 60289 60422 58445 58200 56911 55697 55327 54661 53245 52738 51815 50910 50290 49030 48331 47717 47023 46117 45683 44982 44079 43045 42253 41611 41171 40442 40157 39234 38446 38077 37343 36690 36299 35474 34990 34498 33769 33320 32784 32130 32122 31056 30813 30031 29473 29150 28490 27911 27982 27672 26972 26445 26059 25594 25161 24714 24460 23773 23527 23284 22612 22078 22034 21698 21151 21096 20343 20385 20027 19471 19341 18881 18795 17965 18125 17847 17540 17088 16723 16511 16328 15951 15915 15467 15271 14963 14771 14383 14071 14269 13687 13714 13252 13089 12873 12820 12603 12125 12027 12027 11573 11222 11392 11213 10829 10878 10591 10450 10226 10152 9920 9774 9763 9456 9405 9104 8726 8955 8712 8467 8473 8228 7977 8013 7767 7655 7573 7512 7233 7302 7228 7002 6871 6727 6656 6548 6486 6281 6208 6131 5838 5993 5743 5718 5570 5514 5414 5250 5241 5092 5060 4972 4957 4787 4817 4687 4565 4595 4397 4309 4305 4233 4182 4101 3997 3955 3805 3848 3698 3747 3667 3546 3521 3479 3380 3452 3366 3270 3183 3134 3041 3062 3055 2980 2957 2894 2845 2813 2774 2613 2686 2669 2676 2463 2509 2417 2402 2308 2381 2328 2253 2309 2228 2234 2110 2109 2066 2052 1998 2008 1914 1907 1873 1875 1833 1794 1758 1735 1744 1674 1601 1675 1619 1557 1590 1643 1495 1475 1515 1411 1468 1402 1409 1409 1307 1361 1306 1246 1330 1319 1297 1189 1201 1257 1171 1141 1210 1148 1180 1106 1111 1076 1017 1009 1051 1038 1014 1010 987 940 966 920 887 919 916 900 891 837 868 790 851 844 809 726 781 768 782 797 745 737 700 699 709 694 708 681 726 656 693 675 643 626 644 584 631 580 618 571 582 529 576 544 561 549 532 586 542 535 510 543 519 509 524 500 524 502 483 488 431 440 464 412 472 462 457 434 426 409 392 420 432 407 433 410 409 376 375 395 365 331 385 364 376 375 345 377 352 358 338 354 346 348 354 345 292 361 356 340 331 353 297 301 327 315 289 326 320 302 278 295 276 290 277 297 275 333 295 260 261 301 259 275 273 276 268 259 261 279 244 253 274 261 205 267 250 251 229 216 221 264 262 252 245 223 230 222 239 207 222 197 210 219 201 219 218 235 191 209 187 194 199 207 196 214 193 188 196 179 200 184 189 204 193 158 183 198 185 180 191 199 172 184 184 175 167 188 170 190 169 180 170 166 170 175 191 168 152 162 175 166 190 151 187 189 159 177 163 152 143 146 128 169 184 147 165 150 149 150 149 146 162 149 148 150 153 114 154 121 161 138 138 130 143 141 134 144 120 135 143 102 156 129 140 130 143 127 118 122 135 124 130 110 122 132 125 141 108 112 120 107 112 128 121 107 124 101 112 124 96 99 120 113 111 109 129 129 108 116 108 123 114 77 93 113 87 109 99 99 103 81 104 97 101 101 81 86 97 96 105 99 96 100 110 86 106 108 81 89 79 88 98 77 100 82 82 85 88 87 74 100 89 74 80 95 64 80 79 91 85 93 90 90 79 83 74 83 81 83 74 95 73 81 63 73 71 76 76 78 68 87 72 70 84 77 73 91 77 68 79 81 85 73 58 67 70 67 63 89 65 52 71 72 59 69 86 82 71 85 62 57 70 62 56 70 70 70 75 55 71 58 56 66 79 70 63 64 82 56 73 52 73 57 65 76 64 54 56 68 61 52 47 73 74 57 67 61 40 55 45 61 52 53 70 52 61 52 70 67 58 60 38 44 51 53 50 60 57 56 57 46 48 46 48 52 56 54 49 53 43 63 41 55 52 42 44 51 38 42 44 48 58 52 28 48 45 39 48 43 44 45 44 49 50 47 51 45 41 37 54 45 46 46 47 55 26 38 45 42 37 44 49 36 51 39 45 30 49 30 38 33 36 41 49 34 42 40 48 33 47 50 43 49 42 51 51 39 36 37 40 38 36 42 35 42 45 39 48 42 50 37 41 41 49 51 53 49 37 55 39 40 43 38 43 32 34 47 40 37 37 32 35 44 42 43 29 39 33 38 48 31 27 33 36 20 128 44 37 38 34 28 38 34 37 34 31 29 32 37 34 31 29 25 35 38 33 35 27 35 32 24 28 29 32 19 24 31 35 33 24 29 32 27 32 35 25 38 38 24 22 32 33 30 22 41 30 29 36 26 27 25 35 30 29 17 23 28 26 19 29 24 30 31 30 121 19 18 29 24 21 24 24 23 22 18 26 16 15 36 26 21 19 15 21 18 28 21 18 15 21 20 22 13 17 13 20 19 30 17 20 24 13 11 17 15 15 21 13 19 20 21 14 13 22 28 16 12 16 25 16 22 17 27 15 16 22 18 17 14 17 18 8 17 18 14 24 22 14 14 17 19 19 21 17 9 19 15 11 17 11 14 21 17 18 24 22 20 19 21 20 20 25 13 16 18 24 20 21 13 13 10 20 14 16 15 13 20 25 22 12 19 21 17 20 23 14 20 18 22 22 21 18 20 16 19 24 19 18 10 13 17 15 15 14 23 10 12 17 9 21 10 13 11 9 12 8 8 11 15 10 12 16 5 7 11 10 12 10 15 6 9 8 15 11 12 5 7 7 10 17 3 10 9 5 7 9 12 8 13 9 12 12 7 10 9 8 13 10 6 7 9 15 7 10 9 6 7 12 6 5 5 12 10 7 10 5 14 6 6 10 7 10 14 7 15 14 10 11 11 9 7 6 6 6 7 9 10 8 5 6 8 14 10 10 10 6 7 10 7 11 8 7 13 7 7 9 3 9 4 12 6 6 5 8 7 6 9 8 5 7 13 5 8 10 3 6 10 4 6 6 9 8 8 3 7 6 2 5 4 12 8 6 7 6 10 6 6 4 5 13 4 5 8 4 11 4 8 7 6 1 5 6 5 4 5 4 8 6 7 8 5 9 3 4 1 5 3 3 5 4 6 4 9 3 5 11 4 3 6 7 2 5 7 6 7 3 4 7 3 3 6 2 1 7 7 2 6 5 3 7 3 4 11 5 4 5 6 5 3 5 7 2 4 6 3 8 7 9 9 6 3 3 3 1 7 5 2 4 2 3 2 1 7 3 9 5 8 6 2 3 4 4 8 3 6 7 3 7 6 7 5 3 7 3 6 6 8 1 5 3 6 8 5 2 3 2 3 2 4 6 8 5 2 4 1 3 4 5 3 6 5 2 7 6 7 5 5 3 3 1 1 7 4 3 5 4 4 3 1 1 8 4 3 4 3 3 4 3 4 2 4 3 4 3 3 7 3 2 3 1 0 0 8 2 3 1 3 3 4 2 1 1 3 4 4 3 6 4 4 4 3 3 5 2 1 1 2 0 1 3 4 4 3 2 3 4 0 0 3 3 1 2 6 3 1 1 2 2 0 3 2 1 2 4 1 1 4 2 2 3 1 4 1 1 3 1 3 4 2 3 2 3 4 1 3 2 2 2 6 4 2 3 2 4 3 1 3 2 1 1 1 2 2 3 6 3 1 2 3 1 3 1 4 3 4 1 4 2 1 4 0 2 2 5 3 4 2 0 2 4 2 2 3 2 4 0 2 1 0 2 4 3 2 0 2 1 1 2 1 0 4 3 2 3 2 1 2 3 1 4 3 3 2 2 1 1 0 3 1 1 1 0 2 1 4 2 0 1 1 1 3 1 3 1 1 3 0 1 0 3 3 2 1 2 1 2 3 3 0 0 2 3 4 2 1 4 5 2 2 2 0 0 0 4 0 0 0 0 1 0 0 0 2 1 1 2 2 1 0 2 3 3 0 0 3 1 1 1 0 2 3 0 2 1 1 0 0 3 1 0 1 0 2 0 2 1 3 1 4 1 3 0 0 2 2 0 2 2 0 1 2 2 2 1 0 1 3 1 0 1 0 4 1 1 1 0 2 0 1 1 1 2 3 0 2 0 1 0 2 0 1 3 3 2 0 2 0 1 0 1 1 1 0 0 2 1 1 0 1 2 2 3 3 0 0 0 4 2 1 1 1 0 1 2 1 1 1 1 1 0 1 3 3 1 0 0 0 0 1 0 
];
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
 968855 813438 155417
 412447 348881 63566
 1858750 1569163 289587
 944479 804534 139945
 2197253 1865236 332017
 849930 736461 113469
 1271968 1092659 179309
 3804281 3267452 536829
 1118642 972742 145900
 2205615 1915700 289915
 3800401 3272963 527438
 1411891 1229511 182380
 2597634 2255573 342061
 2958339 2553184 405155
 1030447 896268 134179
 2847136 2482753 364383
 3385794 2934369 451425
 1203301 1037135 166166
 3014905 2658457 356448
 6428172 5617789 810383
 330756 283218 47538
 5689554 5040775 648779
 9438092 8324457 1113635
 733999 631088 102911
 161709 136351 25358
 15218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 0 0
 0 0 0
 0 0 0
 
];
D = [
153 280 0 1
16 32 0 0
20 74 0 0
23 61 0 0
9 50 5 0
22 64 674 35
456 82 1905 159
6271 85 2236 359
54377 109 2810 553
264948 106 3808 1003
626262 169 4240 1467
1452255 289 5509 2018
2978109 408 6829 3034
5548052 811 9358 4772
8204359 1522 10400 6646
9889153 2596 12477 9837
9180133 4388 15910 14390
6862343 6777 21805 20830
4082743 10539 29578 29259
1774767 15327 38753 38935
543172 22813 47802 47885
148378 32455 57867 58099
78395 45533 68981 68672
82460 61814 81056 81405
95689 80442 94287 94866
109653 100432 109855 110520
125333 121237 126431 126103
142265 140748 143445 143967
159086 160749 161094 161193
175570 178740 177480 177548
190989 195356 192578 193542
202920 208350 205606 205577
212623 219460 216682 216282
219462 227202 224202 223456
225170 231733 228143 228315
227824 233751 230225 229974
227063 233058 230463 230932
228596 232189 229509 230423
227775 231333 228711 229597
228891 231288 229672 229971
231230 233506 231350 233093
235557 237534 235604 236943
242442 243679 243205 244758
251826 252939 251027 253593
263655 265028 264180 264294
277126 278597 277845 278867
292148 292956 292233 292228
305159 306486 305651 305547
315339 317400 315558 317505
323902 324940 324936 324664
326447 328441 327790 326802
323366 325766 324384 324928
314638 316106 315860 317002
303291 304401 303894 304084
284860 287474 286506 287285
265709 265942 265528 266162
240925 241902 242858 242040
217667 218763 217756 217712
193894 194401 194405 194156
172657 173776 173287 173619
155520 156453 155239 155554
137668 138465 138532 138645
126379 126714 126496 127030
118974 119545 119676 119679
114522 115561 115061 115046
113163 113066 113030 113465
117695 118488 117875 118475
138627 136357 137265 137641
125786 126093 126227 125929
132087 132200 131835 132565
123998 124694 123347 124489
110082 109714 109261 109806
116511 117245 117122 117329
78386 78589 78678 78280
65135 65063 65612 65251
52181 52277 51668 52397
42284 42548 42646 42256
36458 36610 36537 36357
30773 31399 30605 30786
24209 24532 24601 24583
15772 15748 15744 15670
7829 7789 7842 7902
395 362 388 438
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
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 
];
