A = [
3063 6274 13565 6284 9177 8658 7989 8190 8102 7536 7621 8017 8201 7991 8158 8050 7772 7769 7691 7504 7607 7267 7394 7423 7275 7105 7250 7062 6978 7107 6981 6777 6990 6549 6596 6508 6433 6376 5991 6197 6049 6071 5920 5796 5837 5644 5490 5413 5452 5112 5171 4979 4836 4672 4521 4439 4128 4173 3935 3869 3787 3637 3381 3320 3202 3146 2988 2857 2776 2681 2546 2492 2413 2300 2208 2160 2062 1966 1839 1877 1764 1840 1626 1534 1526 1461 1434 1337 1320 1308 1247 1202 1128 1100 1041 1040 973 964 927 975 912 880 898 834 821 803 755 727 749 677 736 732 628 675 671 683 590 591 593 574 545 526 547 534 502 552 519 493 467 512 455 448 435 411 442 433 425 369 429 378 358 419 384 367 347 381 370 369 327 376 332 353 326 315 364 331 327 327 304 336 334 289 291 277 308 314 257 295 260 273 269 259 284 292 263 246 257 250 265 242 256 244 239 242 241 211 252 223 239 241 226 226 253 213 232 222 226 218 215 232 194 199 217 206 176 196 196 166 164 190 188 196 187 182 208 200 175 193 185 157 181 168 171 159 196 186 158 177 156 179 158 184 165 160 154 160 146 175 143 157 153 153 160 158 145 143 156 161 139 146 162 149 606 167 157 134 144 140 133 147 152 135 116 138 127 142 134 120 135 135 113 105 130 126 128 114 111 125 119 113 111 101 98 120 111 129 96 114 90 133 120 113 104 95 108 117 99 111 105 102 116 107 109 106 97 137 99 110 102 117 108 105 98 87 112 106 107 86 81 90 107 100 91 108 105 79 97 91 92 97 94 82 71 85 77 99 82 63 91 65 85 102 75 103 58 97 78 67 90 66 70 99 58 81 81 96 69 77 71 62 89 94 73 63 64 75 72 84 66 78 74 52 71 80 73 84 89 70 80 58 69 61 77 52 64 54 72 49 74 53 60 62 63 67 80 63 59 54 51 53 49 52 71 43 56 59 58 42 55 52 51 70 71 69 68 59 53 55 49 59 54 43 60 44 53 40 48 58 52 48 43 47 66 40 54 46 48 53 45 55 38 52 51 40 41 44 33 49 37 47 49 51 46 47 45 52 32 32 32 40 40 32 44 54 40 44 35 39 41 43 43 42 37 37 44 41 21 33 42 30 37 35 36 32 25 38 41 34 33 23 34 21 34 30 32 34 29 38 53 32 31 23 26 40 19 29 31 30 37 31 31 32 18 32 26 38 46 33 24 21 43 28 35 26 24 28 19 24 28 28 27 27 24 25 35 24 24 23 23 30 26 29 31 36 24 24 25 31 27 27 27 24 27 20 19 17 27 21 23 26 25 26 27 33 28 27 23 16 20 26 27 22 19 20 26 26 21 25 19 31 20 30 14 31 21 32 17 30 17 23 17 28 21 32 19 28 23 20 27 20 28 24 27 26 22 25 19 13 18 22 22 20 15 17 14 20 15 19 12 24 29 19 14 13 19 19 17 13 16 17 22 14 10 9 15 11 24 16 28 16 18 15 11 35 15 9 15 14 17 14 21 13 22 13 17 13 15 18 10 10 11 15 13 8 14 12 19 15 15 10 6 24 9 17 15 11 17 14 8 7 13 24 22 15 9 24 9 13 17 11 7 8 14 11 8 7 13 11 10 13 6 9 12 17 14 12 8 15 8 13 9 11 16 6 7 8 12 13 11 11 10 11 8 15 12 5 13 11 13 14 8 11 8 6 15 10 6 14 9 11 11 8 11 7 11 6 12 10 11 11 7 11 5 16 12 7 9 9 11 11 6 9 5 15 10 7 5 12 9 8 12 12 8 9 11 4 12 11 7 9 11 10 6 9 4 5 8 8 7 10 4 7 11 6 9 13 6 8 3 9 6 7 5 15 6 7 8 4 10 7 8 4 8 4 5 11 6 9 10 4 4 7 6 8 4 5 3 7 9 11 8 8 7 9 9 10 4 4 14 7 4 6 10 2 6 11 3 8 5 10 6 6 6 3 4 6 8 4 6 10 9 8 6 4 5 8 6 10 5 4 8 5 6 8 8 11 4 6 5 1 4 8 7 3 4 4 5 6 5 10 9 3 5 6 5 6 4 4 3 9 6 5 5 4 4 5 3 5 4 4 2 2 5 4 2 3 4 7 4 4 6 6 7 8 8 1 1 1 6 4 3 5 0 8 4 4 4 2 8 3 0 3 2 8 3 1 5 2 4 5 2 3 2 3 3 3 3 3 5 4 2 3 2 3 0 1 1 9 3 6 3 3 6 4 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0 0 
];
B = [
0 0 0
 864 323 541
 533 219 314
 1423 709 714
 443 143 300
 475 174 301
 577 249 328
 681 309 372
 589 262 327
 1573 697 876
 407 168 239
 445 185 260
 432 197 235
 847 443 404
 367 181 186
 1064 674 390
 366 161 205
 430 224 206
 449 231 218
 887 500 387
 482 248 234
 1274 791 483
 734 417 317
 581 353 228
 1441 871 570
 1598 991 607
 409 234 175
 4711 3177 1534
 103 63 40
 308 205 103
 163 117 46
 360 257 103
 198 130 68
 1249 911 338
 98 62 36
 306 207 99
 162 106 56
 314 219 95
 68 39 29
 1264 908 356
 5 3 2
 113 75 38
 60 42 18
 369 251 118
 45 29 16
 50 34 16
 270 202 68
 165 100 65
 2117 1486 631
 369 294 75
 36 23 13
 335 249 86
 161 121 40
 228 152 76
 2868 2113 755
 129 96 33
 2170 1823 347
 714 576 138
 1192 1010 182
 1075 684 391
 238001 205010 32991
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 0 0 0
 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 0 0 0
0 0 0 0
0 0 0 0
2 1 0 0
0 1 0 0
2 1 0 0
33 4 0 0
1113 4 1 4
14378 9 5 3
46853 6 7 5
55794 10 8 9
45609 11 12 14
27769 23 13 22
15937 26 15 10
7448 23 17 7
3250 25 16 14
1160 25 15 18
345 31 21 15
110 37 15 14
45 27 18 13
44 27 22 14
36 28 20 11
41 29 15 10
41 21 20 14
30 24 14 12
25 26 17 8
42 27 13 12
31 25 7 16
18 39 16 16
41 29 16 9
30 26 15 8
30 35 11 11
34 33 16 14
42 34 10 19
41 32 15 12
47 32 13 18
42 34 23 18
40 34 15 19
41 24 18 14
21 28 20 15
30 36 16 22
31 23 24 19
28 24 24 24
23 32 33 28
24 34 26 37
34 26 33 40
42 45 41 43
43 35 30 36
47 43 37 46
61 37 45 46
47 42 72 46
52 46 50 46
52 65 53 54
74 49 68 57
72 75 88 74
86 78 66 80
102 78 98 68
135 115 101 103
82 115 92 97
105 120 97 111
126 134 111 122
129 103 102 120
115 99 138 122
109 102 94 102
85 69 80 75
56 71 47 48
62 60 60 54
63 73 66 76
107 73 80 83
73 67 55 77
59 59 44 62
44 77 59 50
2 4 4 4
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
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 
];
