A = [
318943 321664 331332 391768 346077 306325 293602 287777 296161 272792 270515 274999 270388 268929 269273 259166 253650 257220 260411 255016 248041 248326 244904 239281 236532 235581 227247 221611 218027 216494 215811 214313 213935 218641 213413 213210 213458 206981 206046 205861 203716 198458 197911 194967 192768 193748 188963 185844 186367 187949 182844 178545 180886 182016 178622 171971 171898 168626 165137 166033 162894 158652 162021 163256 158660 162293 159439 154180 151106 154609 151750 150368 151307 150495 145834 144223 144354 144903 141722 139177 139628 141075 136372 134206 133128 134194 130239 132739 127477 126764 126209 123749 123818 122809 122109 115506 116717 118468 115290 115035 114304 108972 114181 111918 106132 109626 108470 103803 106057 106729 106091 101791 100244 100314 102781 99244 95366 96877 95055 93820 98637 96224 92254 90158 90500 89877 88804 88742 89748 85965 87964 87468 83208 84732 85154 84198 82696 80422 78745 79612 76118 74416 75342 74972 75768 75434 73003 77019 72166 69303 70684 69940 67958 68539 68983 67886 67313 66718 66541 64851 65192 63834 61961 62080 60642 61540 58972 58824 60927 58388 57767 57953 58456 56432 58217 55861 53640 54671 51253 52631 53767 52008 49444 51143 50430 49159 49216 50013 47001 46409 49782 47333 45557 43884 45409 45688 46739 42807 42561 42604 43943 43271 40784 41486 41559 41842 40306 40888 41196 39619 39867 39761 38813 37543 39652 37510 36068 34230 34850 34487 35426 35381 33830 33919 32574 31431 32661 31123 31027 30643 29865 30176 29598 30939 29455 31047 30094 29138 27702 28043 27031 27876 25987 25648 24504 25638 26487 26005 23578 24298 21812 21762 22042 21481 21898 19139 20116 19485 18767 17834 18583 16274 15854 16531 14662 15339 14355 13775 12938 13082 12741 12592 12016 11666 11942 10023 10936 9638 8976 9886 9058 9115 8671 8107 8431 7556 7271 7224 7040 7169 6369 6034 6400 5542 5109 4852 4697 4718 4346 4052 4054 4149 4010 3799 3978 3242 3110 3409 2832 2919 2357 2674 2539 2212 2439 2186 2053 1976 1865 1987 1659 1782 1930 1440 1403 1580 1326 1218 1461 1207 1102 1110 1025 1093 1079 1018 931 897 1003 798 877 782 807 675 743 712 583 536 518 518 450 545 556 368 438 428 359 333 339 357 313 305 351 271 229 324 219 256 206 182 199 195 177 148 145 194 161 157 137 130 128 110 129 121 99 90 97 90 89 80 112 80 88 88 47 63 80 100 71 47 70 67 58 47 59 55 75 38 44 54 41 49 47 48 39 38 36 28 26 24 32 41 35 40 25 33 38 23 45 35 22 25 26 39 29 25 31 24 25 25 34 23 34 28 33 26 23 20 90 21 19 23 24 27 39 30 27 24 21 20 23 24 18 17 24 22 21 19 20 24 19 26 21 28 21 17 13 23 25 23 17 15 17 13 9 16 20 11 23 17 19 21 15 17 10 20 9 14 12 14 18 16 14 15 16 24 13 9 14 12 13 12 15 11 7 9 15 12 7 5 12 10 15 17 14 14 7 11 11 20 13 12 9 9 16 13 7 8 6 10 10 6 12 9 7 9 11 11 10 17 4 9 8 7 8 10 11 9 4 9 9 7 11 8 8 7 2 12 8 10 12 7 8 4 8 10 7 9 6 10 7 5 8 14 11 8 10 11 8 10 5 8 10 11 6 5 6 8 6 7 7 5 7 6 7 4 3 8 10 6 6 7 5 8 3 3 7 7 7 2 5 8 6 5 3 6 4 7 4 7 4 4 5 5 9 8 9 6 7 3 3 3 2 3 5 2 8 7 6 4 6 6 4 2 4 2 4 2 3 0 5 3 0 9 2 2 3 8 7 2 6 0 4 4 3 4 6 4 0 2 5 3 3 1 8 6 6 6 0 1 4 1 2 1 1 7 5 2 4 3 3 2 4 3 3 3 1 2 2 5 4 5 1 3 2 2 2 4 1 3 4 1 5 0 4 4 1 1 3 5 3 5 2 2 2 4 2 3 3 3 4 2 1 2 4 2 1 5 2 0 4 4 5 2 2 3 1 4 2 5 2 5 5 1 3 1 1 2 1 1 0 3 1 4 2 3 2 4 6 4 2 2 0 1 4 1 0 2 2 0 2 1 3 6 2 0 0 0 0 3 1 1 3 5 2 2 2 1 2 1 1 1 0 1 1 1 0 2 3 1 0 1 1 2 1 1 0 1 0 1 1 3 4 0 1 0 1 1 0 2 1 0 1 1 1 4 0 1 3 0 0 3 1 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 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
];
B = [
0 0 0
 1174 1174 0
 723 723 0
 4048 4048 0
 1323 1323 0
 3041 3041 0
 2160 2160 0
 3297 3297 0
 3273 3273 0
 2443 2443 0
 3348 3348 0
 10615 10615 0
 1781 1781 0
 5960 5960 0
 5693 5693 0
 595 595 0
 4236 4236 0
 2516 2516 0
 877 877 0
 86 86 0
 3465 3465 0
 388 388 0
 2805 2805 0
 1425 1425 0
 166 166 0
 3699 3699 0
 4532 4532 0
 2249 2249 0
 6623 6623 0
 5401 5401 0
 4989 4989 0
 2118 2118 0
 12279 12279 0
 17449 17449 0
 13251 13251 0
 10768 10768 0
 22531 22531 0
 975711 975711 0
 9443 9443 0
 32921 32921 0
 3598048 3598048 0
 27061 27061 0
 9868673 9868673 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 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 = [
1 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
10 0 0 0
50 0 0 0
170 0 3 0
509 0 2 3
988 0 2 2
1717 0 3 2
2646 1 1 3
5924 4 9 4
21011 8 9 8
152695 10 19 15
8161031 14 12 18
5533040 27 18 6
731978 29 12 21
17574 17 17 11
43 38 26 30
51 51 23 30
52 53 33 40
1550 65 46 40
1237 73 44 46
119 66 241 365
44 69 201 671
79 91 79 73
75 94 81 99
103 84 98 86
91 107 107 103
135 114 114 116
132 121 148 115
133 151 153 139
173 160 156 132
177 184 162 169
190 204 198 245
231 230 231 242
277 266 280 232
314 287 303 279
296 309 357 351
364 322 362 353
399 395 395 423
422 421 470 459
469 550 465 472
567 490 497 472
524 526 509 485
479 526 548 516
552 522 489 540
545 533 529 551
537 498 517 524
520 503 518 533
517 460 494 536
454 508 476 464
463 421 447 450
383 353 327 345
318 302 294 310
244 262 294 260
260 268 231 224
244 227 254 266
257 229 278 237
294 319 308 297
590 553 563 560
181 852 172 190
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
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 
];
