A = [
221155 216530 1025751 201145 197378 190156 188995 192134 189953 185618 186145 184786 182953 182343 182725 182240 182574 182360 181660 181031 181737 179911 181051 187537 205512 276536 282679 298694 369858 371522 380718 385094 387336 398468 397908 395717 390153 386068 382180 377770 376658 373591 370299 370365 366458 363178 361683 356477 351890 349182 346392 342332 340853 338500 335019 333266 329567 325465 323501 319397 314905 313150 309914 305996 304725 301893 297528 295233 292161 288912 285968 283454 278919 276513 275319 270798 270126 265316 262320 259265 256075 251817 250376 246905 244813 243338 240210 237368 235905 231903 226733 226190 223612 219686 219934 216236 212633 210924 209419 205935 204138 202172 198742 196996 194252 190916 190048 187709 184991 182189 180565 178422 175593 173559 171660 169027 166619 164294 163164 160271 158073 155203 153679 150923 149857 147072 145710 144130 142274 140263 138114 135456 134149 132724 131078 128365 127282 124800 123117 122472 120434 117691 116939 114397 113040 112393 110076 108065 107026 105296 104724 102768 101308 99752 98545 97895 96087 94906 93387 91735 91030 89320 88215 87146 85053 83684 82808 82224 81018 79969 79176 77268 76631 74647 73839 72849 71898 70992 69533 68687 67598 66772 66412 65075 63882 63227 62691 61671 60691 59311 58731 57971 56425 56197 55272 54316 53123 52310 52470 51151 50245 49724 49205 48552 47929 46735 46166 45692 44450 44156 42767 42328 42382 41223 40584 39859 39223 39105 38273 37449 36762 35592 35511 35399 34798 34009 33255 32556 32358 31906 31240 30533 30371 29811 29356 28641 28308 27750 27922 27223 26690 26426 25456 25150 24857 24305 24012 23674 23206 22885 22380 21823 21743 21535 21405 20787 20650 19992 19459 19248 18960 18639 18341 18248 17751 17446 16940 16794 16550 16198 16101 15952 15695 15137 15007 14582 14509 14232 13978 13596 13552 13343 13178 12734 12621 12460 12136 12184 11628 11583 11416 11143 10865 10936 10482 10601 10303 10350 10069 9822 9468 9518 9392 9200 9053 9006 8787 8625 8237 8177 8030 7924 7826 7640 7530 7446 7227 6968 6766 6891 6843 6564 6728 6433 6540 6377 5998 6174 5845 5893 5942 5805 5635 5464 5408 5406 5254 5298 5021 5010 4923 4827 4650 4628 4507 4414 4330 4208 4124 4146 4027 3978 3890 3900 3917 3770 3845 3602 3640 3488 3443 3301 3317 3187 3135 3159 3185 3046 3012 2840 3006 2947 2998 2967 2795 2810 2684 2610 2540 2662 2736 2593 2564 2479 2486 2339 2431 2306 2228 2228 2227 2158 2219 2158 2120 2076 1988 2104 2007 1961 2035 1869 1775 1843 1809 1692 1766 1649 1612 1674 1580 1588 1527 1569 1474 1527 1457 1463 1418 1430 1434 1409 1464 1348 1317 1312 1363 1329 1195 1203 1302 1228 1238 1269 1164 1165 1142 1168 1081 1150 1104 1039 1032 1048 997 997 1008 981 986 947 978 979 938 889 910 925 958 860 830 862 854 791 868 777 794 766 783 746 752 823 733 722 820 708 701 673 729 743 687 670 658 693 649 650 669 643 620 574 599 550 628 618 601 594 592 579 570 563 562 582 583 518 530 541 511 513 528 516 540 511 491 514 531 508 497 447 519 460 491 466 496 495 440 446 458 419 426 449 436 395 435 413 415 387 411 388 377 372 346 401 417 319 382 348 376 357 393 399 355 366 382 363 369 350 312 364 401 362 325 362 340 311 412 356 378 357 301 323 340 353 361 335 341 349 337 283 323 326 338 323 347 320 310 275 273 308 297 310 265 289 264 284 252 242 242 284 264 264 285 256 275 240 203 216 233 255 234 257 239 222 168 199 191 210 181 195 213 183 216 207 182 193 178 168 182 158 174 192 189 189 199 170 183 167 168 136 158 144 136 146 148 169 177 186 124 129 134 146 130 125 114 109 125 146 139 138 127 125 127 119 115 107 105 137 150 116 118 91 114 131 116 111 116 92 77 83 100 72 58 69 84 98 79 84 83 84 77 72 70 76 88 71 90 60 67 55 78 69 77 72 85 73 85 83 83 73 67 79 80 70 69 79 74 59 66 79 53 88 77 55 56 73 53 43 43 48 51 33 47 42 39 42 54 59 81 80 53 75 72 85 83 64 62 65 65 107 61 68 68 68 63 44 60 55 47 47 68 50 63 84 49 51 45 28 30 33 31 23 33 40 32 34 38 36 34 48 43 40 48 48 41 48 34 33 94 63 45 56 44 78 82 14 30 18 18 17 16 24 23 30 30 17 24 16 11 21 16 23 21 18 12 21 17 19 21 29 18 25 20 16 25 22 24 29 19 21 21 31 38 24 34 44 39 39 31 33 50 47 28 29 26 41 13 27 16 17 11 16 13 14 15 14 21 20 22 21 29 21 16 16 16 31 20 18 22 17 18 36 14 12 13 26 25 24 20 26 22 16 15 7 15 18 13 19 10 15 9 8 8 7 9 7 8 13 21 11 13 28 17 16 17 10 13 30 13 16 7 7 8 9 4 23 12 14 15 15 10 12 6 7 19 10 20 7 9 7 13 16 13 19 4 6 12 11 4 8 4 7 8 12 12 8 7 8 8 15 13 13 9 10 8 8 13 7 9 6 17 20 18 17 18 13 4 12 10 11 13 15 13 10 8 10 11 9 8 12 11 10 12 20 12 8 9 8 3 8 11 7 10 20 3 11 9 4 11 9 5 5 11 12 13 11 6 12 10 8 10 12 10 10 5 9 14 9 8 15 9 2 5 7 13 7 8 7 6 4 5 7 4 3 3 5 4 5 9 3 8 8 6 4 2 8 7 4 9 3 5 4 9 7 5 4 1 1 5 2 1 2 4 5 4 1 8 6 7 4 8 6 3 7 4 5 2 3 5 5 7 4 3 3 5 4 4 2 5 4 3 9 14 5 6 7 4 12 8 4 6 1 8 2 4 9 6 4 14 16 5 10 13 13 11 13 7 11 7 7 7 4 6 10 4 13 17 4 4 5 6 7 10 4 4 2 8 5 3 8 7 4 2 4 14 4 9 1 3 3 4 3 2 4 6 8 3 0 4 1 2 5 4 3 3 5 1 9 2 5 1 5 2 4 2 7 6 7 2 7 3 1 1 3 0 1 2 3 4 4 3 0 2 6 2 3 6 5 4 2 4 2 3 2 4 8 6 7 2 1 2 7 3 2 5 3 6 2 1 5 0 3 1 4 5 1 2 0 0 1 0 0 1 3 3 3 1 2 1 1 4 1 1 3 1 3 0 0 0 0 1 0 0 1 3 1 5 2 5 6 8 2 0 1 4 2 5 2 2 0 3 2 1 2 3 2 4 7 5 3 3 4 5 4 6 5 1 1 2 0 2 0 0 0 0 1 1 5 6 1 3 0 0 5 5 3 2 1 1 1 2 1 2 1 0 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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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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
 20515 2690 17825
 12946 2195 10751
 40695 8642 32053
 9321 1060 8261
 8953 1151 7802
 14955 1965 12990
 14430 2132 12298
 18601 3498 15103
 34115 7750 26365
 9673 1114 8559
 11488 1509 9979
 10707 1455 9252
 23523 4186 19337
 11984 2177 9807
 34029 8188 25841
 13291 1880 11411
 14867 2351 12516
 18626 2828 15798
 38612 6487 32125
 25288 3997 21291
 50013 10554 39459
 40401 5002 35399
 25490 3478 22012
 66793 11247 55546
 73165 12487 60678
 12748 2635 10113
 232891 55335 177556
 1587 436 1151
 7670 2118 5552
 3597 925 2672
 5833 1693 4140
 3622 843 2779
 25961 7991 17970
 2258 574 1684
 7255 2177 5078
 3585 914 2671
 5107 1397 3710
 1007 302 705
 27921 8869 19052
 11 6 5
 64 22 42
 849 266 583
 7732 2355 5377
 963 312 651
 829 263 566
 1778 435 1343
 2474 683 1791
 42839 13953 28886
 63 20 43
 1127 413 714
 940 317 623
 906 239 667
 3510 1102 2408
 45594 15587 30007
 2199 907 1292
 2511 1036 1475
 7252 3808 3444
 362938 176929 186009
 15958 6739 9219
 20382388 10982396 9399992
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 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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 2844 2474
679359 1186 4390 3977
754921 2000 6221 5994
694103 3080 8438 8349
495888 4996 11618 11463
244929 7797 14718 14614
81996 11305 18062 17967
31512 15328 20909 20752
27668 20423 24290 23898
30392 25788 28007 27974
33089 30303 32402 32651
37746 35912 36517 36824
40893 40290 40626 40168
44522 44918 44467 44178
47694 48156 47885 47747
49767 50157 49978 49846
51405 52976 52274 51613
54877 54669 54150 53735
55842 55715 55689 54605
56268 56573 56845 55856
58003 58840 57986 57292
58632 59194 59765 59059
60374 60394 60985 60330
60431 60752 61144 60059
61559 62231 62289 60588
61551 63345 62664 62089
63108 63480 64270 62681
69037 68032 69112 67498
69486 68213 69303 68823
67320 68535 68063 66737
60713 59372 59852 60903
51138 49556 50477 50342
49138 49637 49633 49540
50531 50671 50627 50285
51318 51554 51396 51884
51223 50858 50766 51366
50007 50667 50001 49696
47561 48063 47907 47663
43430 43609 43421 43596
36418 36225 36368 36625
26655 26874 26555 26902
17659 17387 17730 17647
11613 11359 11653 11331
7959 7980 7987 7767
5199 5218 5269 5119
2997 3008 3075 2903
342 358 367 366
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
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 
];
