A = [
4155 7815 47072 5286 7520 6787 6330 6847 6949 6937 7042 7503 7401 7248 7252 7149 7001 6851 6862 6581 6702 6514 6448 6479 6203 6091 6223 5986 6062 6099 6067 5926 6000 5783 5804 5792 5662 5637 5596 5585 5466 5418 5495 5382 5358 5112 5183 5144 5090 4779 5023 4746 4625 4610 4602 4478 4580 4346 4146 4079 4078 3953 3874 3819 3654 3649 3385 3461 3275 3169 3094 2943 2871 2804 2732 2601 2515 2470 2303 2208 2075 2170 2031 1895 1876 1808 1750 1726 1615 1596 1482 1452 1425 1324 1283 1192 1157 1166 1027 1087 962 981 918 906 853 859 777 749 743 739 660 621 627 644 603 571 519 520 468 505 481 426 396 429 452 431 382 375 364 355 328 326 341 316 331 320 285 279 277 231 279 258 244 230 223 209 238 181 199 214 223 188 196 171 162 168 166 159 177 169 148 141 147 184 169 161 127 118 139 130 138 126 129 120 112 93 106 101 144 137 121 99 110 93 124 112 108 129 98 125 97 90 99 86 100 89 106 102 96 83 92 110 99 96 81 63 73 71 80 81 67 64 75 69 72 77 55 67 62 67 54 55 69 68 53 77 61 55 48 61 58 61 41 50 53 56 227 119 56 60 78 44 43 44 60 70 53 51 40 40 39 57 52 44 675 60 48 60 56 57 57 39 40 35 39 39 51 38 37 38 40 41 46 33 36 28 48 38 41 45 30 41 41 44 34 35 42 34 40 32 44 40 27 31 36 41 31 28 39 31 29 27 35 39 31 28 23 35 32 38 30 43 32 33 36 28 23 29 46 32 25 33 37 34 32 30 27 29 39 27 30 24 26 30 26 30 22 30 29 32 30 37 30 25 24 28 22 30 27 19 28 29 26 49 40 40 30 17 28 29 26 33 17 29 34 21 17 17 25 25 35 27 29 23 28 26 16 16 23 16 22 30 24 24 27 33 30 29 38 29 29 37 35 20 26 26 18 31 22 25 20 19 24 24 24 30 19 23 17 22 19 24 17 34 28 24 22 31 13 21 26 22 33 16 31 22 21 27 16 19 19 14 43 25 26 26 10 27 27 16 9 17 12 27 19 15 12 17 21 13 14 19 16 19 16 23 16 21 18 19 15 18 22 16 15 14 12 17 19 14 25 16 12 18 15 27 12 11 17 13 13 15 11 9 9 18 11 9 21 16 18 9 12 17 19 8 11 12 10 15 15 17 8 11 12 14 13 16 14 19 12 11 14 12 12 8 14 7 10 9 5 12 5 6 10 12 10 6 10 6 6 7 9 8 8 5 8 10 10 11 5 12 14 14 8 3 11 12 9 7 5 10 9 7 7 6 5 5 5 8 8 8 11 4 8 11 8 11 12 8 7 15 10 9 12 5 9 7 10 12 8 6 8 10 10 8 9 8 6 7 4 10 5 4 9 8 10 8 12 6 8 7 7 9 7 9 6 13 15 4 14 7 5 10 4 4 5 8 4 9 7 3 11 6 10 2 4 6 8 6 6 7 4 13 11 9 11 9 16 6 10 7 11 18 6 11 7 8 5 7 2 4 6 10 10 2 0 9 1 7 4 2 6 8 6 5 16 5 13 7 7 12 11 10 12 4 13 6 7 13 8 2 7 7 5 8 3 3 4 6 7 9 7 5 6 6 6 3 8 5 3 8 6 9 3 4 11 8 4 8 5 9 3 6 6 3 9 3 2 5 6 2 1 3 4 4 9 8 6 3 4 5 2 5 5 7 2 7 7 6 4 5 4 4 5 6 1 3 6 4 2 3 3 5 4 3 2 7 5 1 4 5 5 2 3 1 2 2 8 8 4 7 4 4 2 4 5 6 6 4 6 4 4 4 4 1 6 4 3 2 1 9 2 5 3 7 7 2 4 4 3 4 4 3 2 7 5 6 3 3 3 2 1 3 5 5 5 2 5 3 6 3 2 1 4 3 1 6 6 3 6 4 2 6 2 3 3 2 2 1 3 1 8 1 5 3 4 6 1 3 2 5 1 1 2 2 4 0 3 1 3 2 1 5 3 2 2 5 3 3 3 1 2 1 2 1 3 2 3 3 2 4 5 3 3 1 2 5 3 4 6 0 2 4 2 1 1 3 2 3 3 0 3 1 2 2 3 4 1 2 3 4 1 2 8 1 2 2 3 7 0 0 0 2 1 1 2 2 3 1 2 1 0 3 3 2 6 1 3 0 1 1 0 3 3 3 3 1 3 0 4 0 1 2 1 2 1 1 3 1 2 3 5 0 1 1 0 0 0 1 1 1 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0 0 0 0 
];
B = [
0 0 0
 1248 482 766
 591 228 363
 1795 950 845
 611 197 414
 551 230 321
 780 340 440
 865 419 446
 643 289 354
 2019 970 1049
 459 221 238
 443 200 243
 485 268 217
 881 561 320
 398 231 167
 1195 867 328
 383 225 158
 426 258 168
 477 281 196
 967 662 305
 352 239 113
 1443 1134 309
 637 448 189
 547 423 124
 1320 956 364
 1747 1370 377
 239 177 62
 5342 4525 817
 113 95 18
 235 191 44
 187 165 22
 362 326 36
 95 69 26
 1303 1183 120
 103 81 22
 246 204 42
 170 156 14
 307 285 22
 38 26 12
 1451 1337 114
 0 0 0
 6 6 0
 47 38 9
 298 270 28
 30 28 2
 28 24 4
 37 29 8
 107 93 14
 2621 2459 162
 2 2 0
 47 40 7
 22 19 3
 38 36 2
 182 168 14
 2937 2832 105
 68 64 4
 47 43 4
 104 102 2
 1576 1504 72
 1590 1533 57
 231006 228448 2558
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 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 = [
0 4 0 0
0 0 0 0
1 1 0 0
0 1 0 0
1 0 0 0
2 0 0 0
24 1 0 0
567 2 0 1
7303 3 1 2
39245 4 1 1
63890 7 3 2
61449 8 2 1
39891 8 5 1
22624 9 3 0
10625 15 3 0
4405 9 0 1
1986 19 0 1
1074 24 1 1
614 12 2 6
299 15 2 3
130 18 1 2
48 40 2 2
49 23 1 5
46 15 1 5
37 30 3 6
37 28 5 9
66 34 9 9
29 32 2 0
27 34 4 5
33 32 10 2
21 34 4 4
24 33 3 4
36 43 5 4
49 46 6 5
51 41 7 11
35 36 5 7
40 40 14 16
34 32 9 10
29 29 16 6
17 18 5 9
23 20 13 6
12 18 10 3
10 18 18 9
10 7 7 9
7 14 11 7
8 13 11 20
11 22 10 6
9 7 9 13
20 13 10 11
27 15 5 17
15 22 19 10
20 23 17 11
29 29 11 19
29 20 20 18
27 27 18 15
38 22 21 43
24 18 32 17
34 28 22 40
38 24 33 33
24 27 42 35
43 40 36 40
33 31 29 29
35 27 28 36
42 31 27 55
38 30 34 42
25 42 28 23
44 63 38 43
37 33 30 37
42 21 25 28
33 31 29 25
40 33 25 35
20 30 24 14
4 5 5 12
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
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 
];
