A = [
257882 256181 1331356 209287 202925 190350 180875 178823 173696 164221 161764 159155 155849 153475 150535 148413 146721 145105 143246 141285 141374 139237 138701 138317 140701 190799 190972 193312 243426 243433 247009 249452 250391 254307 255503 253627 250503 248720 246969 243663 243717 242202 241270 240815 240569 237843 235960 232740 230674 229529 227702 226773 224679 224620 223960 221487 221020 218983 217534 214886 215017 212923 211370 210728 208649 208293 207261 205880 204166 201280 200371 199605 197322 196020 194858 194698 193210 191306 189440 187473 185956 183975 183167 182179 180866 179513 178344 177612 175124 174422 172001 170758 169178 168329 166534 166352 164501 163484 162177 159960 159321 157941 155471 154476 154422 152165 151592 151126 148615 148467 146242 144617 143723 142309 141685 139498 138180 137072 136905 135102 134234 132359 131178 129904 128624 128243 126889 126389 125284 123780 122821 121567 120399 119659 118277 117397 116709 114933 114014 112850 112443 110329 109693 108752 107272 106898 106019 105021 104014 103477 103487 101846 99977 99123 98382 97637 96476 95892 94413 94289 93128 92287 90722 90426 89305 88227 87900 87449 86441 85525 84482 83208 82445 81252 80998 79986 78900 78226 77621 76752 76403 74925 74350 74132 73340 72067 71663 70438 70139 69322 68837 68320 66944 66186 66321 64837 64412 63217 63243 62070 61210 60657 60092 59337 58919 58253 57132 56442 55918 55342 54911 54334 53477 52815 51869 51746 51356 50017 49848 49072 48325 47856 47823 47044 46383 45755 45381 44562 44094 43245 42958 42386 42050 41154 40602 40481 39827 39504 38844 37800 38352 37437 36966 36277 36099 35552 35653 34983 34618 33983 33090 32980 32595 32093 32052 31290 30913 30799 29999 29951 29566 29049 28827 28071 27871 27389 27173 26635 26617 25968 25726 25261 24949 24628 24583 23853 23682 23343 23055 22924 22482 22066 21905 21944 21371 21248 20725 20560 20269 19623 19413 19217 19019 18596 18536 18613 18074 17751 17560 17334 16942 16522 16470 16340 16142 15687 15695 15328 15266 14913 14904 14540 14717 14256 14253 13833 13483 13065 13009 12784 12943 12555 12181 12192 11866 11954 11619 11198 11086 11147 10779 10648 10496 10238 10452 9883 9823 9913 9575 9704 9500 9283 8958 9188 8960 8824 8654 8387 8354 8303 8248 8936 7955 7858 8055 7677 8952 7574 7290 7414 7192 7027 7048 6885 6772 6739 6536 6452 6212 6299 6160 6011 5936 5717 5660 5543 5499 5355 5208 5174 5186 5066 4873 4828 5122 5037 4861 4885 4987 4784 4775 4686 4759 4493 4469 4459 4030 3984 3878 3805 3751 3921 3789 3785 3770 3706 3604 3582 3403 3492 3307 3165 3278 3122 3072 3080 2930 2944 3007 2803 2888 2765 2830 2837 2814 2659 2696 2648 2583 2590 2519 2378 2412 2377 2373 2358 2367 2194 2262 2139 2194 2066 2062 2067 2010 2016 1950 1898 1905 1874 1796 1855 1784 1887 1764 1709 1668 1675 1627 1579 1543 1569 1572 1534 1487 1525 1459 1494 1474 1379 1446 1385 1407 1358 1286 1257 1274 1352 1286 1271 1232 1217 1205 1246 1192 1211 1169 1142 1120 1054 1099 1109 1066 1083 1064 1026 1001 967 1010 971 942 1005 926 962 965 961 947 936 887 883 840 903 839 866 918 841 855 830 807 806 782 732 758 755 732 728 745 689 713 763 720 702 671 709 675 687 733 677 589 636 585 606 615 603 612 570 612 580 590 601 570 551 549 554 532 479 533 595 575 544 502 541 513 493 505 497 510 498 508 484 519 503 471 483 463 456 451 397 450 428 423 444 382 463 392 392 405 395 399 392 390 379 396 402 401 356 381 341 358 354 370 350 358 347 353 363 315 354 334 350 339 310 327 310 306 286 312 290 306 310 313 280 344 304 293 274 266 287 255 307 238 294 292 269 255 271 273 294 266 260 249 277 274 256 241 264 211 270 214 260 251 235 250 246 227 240 259 243 206 221 193 236 220 226 237 223 208 230 235 194 208 191 226 178 203 217 185 187 167 177 203 182 187 199 196 208 184 196 192 178 191 185 184 170 179 183 180 180 175 171 190 194 189 194 188 189 191 193 182 194 162 179 177 168 154 166 170 179 153 160 169 175 168 166 170 136 162 176 187 157 175 186 161 172 180 186 184 187 211 245 185 203 251 315 222 223 195 180 177 170 169 202 168 148 132 129 137 134 136 131 128 159 127 107 142 126 134 141 117 113 148 146 125 142 128 122 136 137 133 154 139 136 141 134 124 130 142 156 146 133 104 132 115 110 118 112 144 116 130 102 140 115 98 91 96 98 99 110 106 108 112 107 95 125 92 100 107 101 117 116 125 118 125 88 90 102 122 124 97 114 98 97 114 85 101 91 90 109 87 82 92 116 97 101 89 89 90 105 82 91 87 92 91 75 64 102 80 91 73 79 88 66 79 79 65 74 84 80 98 64 75 71 57 96 67 70 69 87 85 84 86 95 91 84 88 80 80 85 86 70 67 88 81 61 74 81 95 66 87 59 57 64 45 60 77 68 75 81 80 61 63 82 65 60 82 83 70 75 68 73 72 75 67 64 84 66 58 74 79 67 65 76 53 52 68 41 55 51 56 54 57 39 56 63 43 52 56 67 59 66 57 62 41 55 64 47 59 49 56 54 42 43 40 51 58 57 45 37 52 45 37 36 34 40 39 36 41 37 31 33 49 32 28 33 37 38 32 35 34 39 29 41 41 53 35 41 39 36 50 41 37 36 35 36 32 30 31 39 40 28 29 43 54 35 44 38 29 36 42 29 29 28 41 42 32 34 46 35 37 43 51 46 39 39 44 40 40 33 23 41 43 32 28 29 24 36 31 24 44 32 43 42 25 31 38 30 48 43 39 40 29 34 32 23 29 36 26 27 34 23 28 25 31 34 24 23 35 22 24 28 24 31 24 21 31 30 22 39 31 32 33 35 27 29 32 33 25 29 29 34 23 25 34 20 17 22 29 25 21 22 34 23 23 17 19 35 29 15 30 21 27 32 29 29 31 26 14 35 18 25 22 34 27 31 26 33 16 28 29 23 15 19 26 21 18 21 23 25 21 28 17 18 17 19 22 20 13 26 20 26 22 30 18 18 36 14 33 23 19 25 31 24 21 20 32 30 33 21 16 33 32 26 28 25 24 32 26 31 29 27 32 27 30 29 36 28 26 23 26 23 21 17 27 19 23 14 17 21 20 21 13 17 14 16 16 22 17 23 17 20 15 21 15 13 20 18 16 15 13 8 16 16 18 12 10 10 8 15 15 13 17 19 12 15 20 20 19 13 14 9 10 12 14 17 17 19 13 9 14 20 17 13 15 11 16 11 17 13 19 9 11 12 16 9 15 24 18 17 13 14 17 18 13 19 22 12 22 11 13 17 11 23 14 12 16 20 15 12 16 23 13 21 18 18 13 17 12 15 16 9 14 15 10 13 8 10 11 4 17 11 15 9 11 7 11 8 9 6 10 6 6 4 8 5 13 10 10 8 4 9 8 6 13 10 13 15 14 12 13 4 8 9 5 11 11 8 6 8 6 5 11 11 6 8 13 5 8 13 3 8 4 4 7 4 9 8 8 5 10 5 12 4 6 7 7 7 7 5 13 7 11 8 6 5 10 15 12 7 11 8 10 9 8 8 14 16 11 11 12 9 21 3 13 11 11 14 19 8 13 16 14 9 14 18 18 13 13 22 12 18 14 12 18 20 15 14 14 21 10 11 8 13 15 14 11 12 7 5 9 14 6 8 13 12 8 7 7 11 5 5 6 6 4 10 7 6 8 5 5 1 12 3 6 4 5 4 3 7 5 4 10 5 5 7 3 5 4 5 3 10 5 4 4 3 6 3 5 3 2 2 5 4 3 3 4 10 3 5 3 7 7 7 3 1 5 3 3 2 4 4 3 7 2 4 7 4 3 1 3 4 3 2 5 2 0 3 5 4 9 3 8 2 3 5 3 4 6 4 4 7 7 4 3 7 3 3 4 3 5 6 4 6 4 0 2 2 9 8 7 7 4 2 3 3 2 5 4 4 2 5 2 0 5 2 2 5 1 3 6 5 4 4 1 3 1 4 5 6 5 5 9 10 6 10 7 8 6 7 5 7 6 10 2 7 5 10 10 4 0 5 7 2 2 1 2 2 5 6 1 3 4 5 1 2 3 7 4 5 2 3 5 3 4 2 2 5 4 2 5 9 4 5 4 4 2 2 6 2 3 1 5 5 4 7 2 3 3 5 4 5 5 3 2 7 1 5 4 3 4 2 6 4 2 2 3 7 6 3 1 3 3 3 5 6 3 1 1 3 1 5 5 3 2 2 6 1 4 3 3 3 1 1 2 3 1 4 3 2 0 3 2 1 1 4 4 2 0 1 5 2 1 2 3 2 4 2 2 1 1 3 1 2 0 4 7 5 1 1 2 1 2 3 3 0 1 2 3 1 2 1 1 4 1 4 3 1 1 0 0 2 1 3 4 1 0 3 3 2 3 3 2 3 1 1 2 0 0 4 3 1 3 1 2 2 0 1 0 2 0 1 2 2 0 2 2 1 0 0 2 1 1 2 3 1 2 0 3 0 3 3 2 2 0 1 2 1 3 1 2 2 1 4 0 4 4 1 0 2 2 3 2 1 1 0 0 2 6 5 4 2 1 6 5 1 4 1 3 3 2 2 3 3 4 3 3 5 3 2 2 5 0 1 3 1 1 2 1 1 4 4 1 2 3 3 3 3 0 3 3 2 3 1 2 1 3 5 4 1 2 4 3 2 1 4 3 1 3 3 1 3 2 3 1 3 1 0 2 0 4 2 2 1 4 3 3 2 2 3 2 3 2 2 1 2 2 1 3 0 2 2 3 1 0 4 3 0 2 0 3 2 1 0 3 3 0 1 2 2 1 1 1 4 2 3 1 2 2 1 5 4 7 4 5 3 0 2 2 1 1 2 1 2 0 0 1 2 0 0 1 3 2 1 2 2 4 2 3 5 2 1 
];
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
 530173 155172 375001
 39252 11914 27338
 69021 20967 48054
 373964 120172 253792
 245731 78870 166861
 405575 130392 275183
 756469 244237 512232
 632092 200122 431970
 378389 120008 258381
 881149 291717 589432
 361527 114271 247256
 24894 7912 16982
 821392 274159 547233
 13504 4374 9130
 23476 7567 15909
 1114033 378644 735389
 24515 7972 16543
 287720 92011 195709
 1497601 531414 966187
 283924 91592 192332
 9 4 5
 10020296 3643505 6376791
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 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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012 963
289450 2379 1464 1395
176610 3358 1830 1837
79379 3988 2163 2211
20671 4297 2460 2427
5010 3628 2604 2578
3724 3293 2699 2653
3571 3373 2910 2767
3619 3481 2966 3006
3646 3181 3073 3050
3647 3300 3355 3309
3947 3524 3618 3638
4063 3726 3776 3872
4372 3955 4255 4234
4682 4354 4503 4379
5220 4790 4922 4922
5627 5318 5367 5522
6178 5917 6006 5963
6858 6686 6811 6680
7656 7437 7548 7411
8594 8474 8513 8484
9689 9462 9772 9653
10950 10691 10782 10856
12374 12333 12427 12292
14323 14288 14228 14104
16040 16179 16136 16230
18271 18404 18345 18407
20820 20880 20853 20757
23752 23990 23594 23983
26558 26894 26848 26359
29545 29713 29612 29663
32873 33069 33098 33129
36400 36341 36066 36199
39480 39931 39968 39805
42453 42748 42673 42242
45571 45110 45236 45290
48145 47864 48012 47836
51340 50796 51637 50819
54002 53993 53897 53858
57994 58152 58207 57822
61758 62006 60756 61712
65688 65865 66061 65196
68720 69053 69014 68837
72051 73024 72732 72121
73773 73534 73447 73422
70483 70387 70261 70136
61304 61111 60825 61044
45148 45225 45297 44659
24293 24407 24556 24346
9339 9478 9556 9177
4037 4030 4236 3961
2992 2952 2827 2887
2507 2685 3191 2464
1664 1762 1686 1844
1275 1023 1011 1281
68 60 42 43
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
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 
];
