The first line contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of nodes. Each of the next $$$n-1$$$ lines contains two integers $$$u$$$ and $$$v$$$ ($$$1 \le u, v \le n$$$, $$$u \neq v$$$), meaning that there is an edge between nodes $$$u$$$ and $$$v$$$. It is guaranteed that these edges form a tree.

NoteIn the first example, distance between nodes $$$1$$$ and $$$2$$$ is equal to $$$2$$$, between nodes $$$2$$$ and $$$3$$$ to $$$1$$$, between $$$1$$$ and $$$3$$$ to $$$3$$$.In the third example, numbers from $$$1$$$ to $$$9$$$ (inclusive) will be written on the blackboard, while we need just from $$$1$$$ to $$$5$$$ to pass the test.

Output $$$n-1$$$ lines, each of form $$$u$$$ $$$v$$$ $$$x$$$ ($$$0 \le x \le 10^6$$$), which will mean that you wrote number $$$x$$$ on the edge between $$$u$$$, $$$v$$$.  Set of edges $$$(u, v)$$$ has to coincide with the set of edges of the input graph, but you can output edges in any order. You can also output ends of edges in an order different from the order in input.

You are given a tree with $$$n$$$ nodes. You have to write non-negative integers on its edges so that the following condition would be satisfied:For every two nodes $$$i$$$, $$$j$$$, look at the path between them and count the sum of numbers on the edges of this path. Write all obtained sums on the blackboard. Then every integer from $$$1$$$ to $$$\lfloor \frac{2n^2}{9} \rfloor$$$ has to be written on the blackboard at least once. It is guaranteed that such an arrangement exists.

Input:
3
2 3
2 1

Output:
1 2 1
3 2 1

Output:
1 2 1
2 3 1

Output:
2 1 2
2 3 1

Output:
3 2 1
1 2 2

Input:
4
2 4
2 3
2 1

Output:
4 2 1
3 2 2
1 2 4

Output:
1 2 2
3 2 1
4 2 1

Output:
2 1 4
2 4 2
2 3 1

Output:
1 2 1
2 4 1
2 3 2

Input:
5
1 2
1 3
1 4
2 5

Output:
2 1 1
3 1 2
4 1 4
5 2 1

Output:
1 2 1
2 5 1
1 3 3
1 4 3

Output:
3 1 1
4 1 2
2 1 3
5 2 3

Output:
1 2 2
1 3 6
2 5 2
1 4 1

Input:
2
1 2

Output: 2 1 1

Output: 1 2 1

Input:
5
5 1
5 2
5 3
5 4

Output:
1 5 2
2 5 4
3 5 1
4 5 2

Output:
5 1 1
5 2 2
5 3 3
5 4 3

Output:
5 1 2
5 2 4
5 3 6
5 4 1

Output:
1 5 1
2 5 2
3 5 3
4 5 6

Input:
7
4 5
2 6
2 4
6 1
3 7
2 3

Output:
6 2 1
2 4 1
4 5 1
2 3 3
3 7 1
6 1 5

Output:
2 4 9
2 6 3
3 7 1
4 5 3
6 1 3
2 3 1

Output:
1 6 1
3 2 4
4 2 2
5 4 4
6 2 1
7 3 4

Output:
6 2 1
1 6 1
4 2 3
5 4 3
3 2 9
7 3 3

Input:
10
8 2
5 6
1 8
2 9
1 4
8 10
10 5
2 7
2 3

Output:
1 8 1
4 1 1
10 8 3
5 10 1
6 5 1
2 8 6
9 2 6
7 2 12
3 2 18

Output:
1 8 8
2 8 1
3 2 3
4 1 8
5 10 8
6 5 8
7 2 2
9 2 1
10 8 4

Output:
8 2 1
2 9 1
2 7 2
2 3 3
8 1 5
1 4 1
8 10 6
10 5 6
5 6 6

Output:
1 4 4
2 3 12
2 7 8
2 9 4
5 6 1
8 1 20
8 2 4
10 5 1
8 10 1

Input:
10
1 2
1 4
2 10
6 3
9 5
9 7
1 9
10 8
4 6

Output:
1 2 1
2 10 1
10 8 1
1 4 4
4 6 1
6 3 1
1 9 6
9 5 6
9 7 12

Output:
2 1 6
3 6 3
4 1 1
5 9 2
6 4 2
7 9 3
8 10 6
9 1 2
10 2 6

Output:
1 2 4
1 4 16
2 10 4
4 6 4
6 3 4
9 5 1
9 7 2
10 8 4
1 9 1

Output:
2 1 1
10 2 1
8 10 1
4 1 4
6 4 4
3 6 4
9 1 16
5 9 4
7 9 8

Input:
20
14 9
12 13
10 15
2 1
20 19
16 6
16 3
17 14
3 5
2 11
3 10
15 8
14 2
6 4
3 20
5 18
1 7
1 16
4 12

Output:
6 16 1
4 6 1
12 4 1
13 12 1
1 16 5
2 1 1
11 2 1
14 2 2
9 14 1
17 14 2
7 1 6
3 16 12
5 3 12
18 5 12
10 3 36
15 10 12
8 15 12
20 3 72
19 20 12

Output:
1 2 8
1 7 48
2 11 8
2 14 16
3 16 8
4 12 8
5 18 1
6 4 8
10 15 1
12 13 8
14 9 8
14 17 16
15 8 1
16 1 40
16 6 8
20 19 1
3 5 6
3 10 3
3 20 1

Output:
1 16 8
2 1 16
3 16 1
4 6 24
5 3 1
6 16 16
7 1 24
8 15 2
9 14 16
10 3 2
11 2 24
12 4 24
13 12 24
14 2 32
15 10 3
17 14 24
18 5 3
19 20 3
20 3 3

Output:
1 2 13
2 11 13
2 14 26
14 9 13
14 17 26
1 7 78
1 16 1
16 6 1
6 4 1
4 12 1
12 13 1
16 3 5
3 5 1
5 18 1
3 10 3
10 15 1
15 8 1
3 20 6
20 19 1

Input:
41
21 12
1 35
20 11
35 40
13 33
32 14
3 30
16 17
38 1
13 16
15 21
15 23
25 20
26 29
27 25
37 27
22 37
25 7
33 26
30 41
15 24
22 13
15 3
13 19
22 15
36 34
26 38
15 8
17 18
37 36
30 2
37 6
27 9
15 31
3 10
27 39
17 28
15 5
19 4
39 32

Output:
37 22 1
27 37 1
25 27 1
20 25 1
11 20 1
7 25 3
9 27 5
39 27 6
32 39 1
14 32 1
36 37 10
34 36 1
6 37 12
15 22 14
21 15 1
12 21 1
23 15 3
24 15 4
3 15 5
30 3 1
41 30 1
2 30 2
10 3 4
8 15 10
31 15 11
5 15 12
13 22 27
33 13 27
26 33 27
29 26 27
38 26 54
1 38 27
35 1 27
40 35 27
16 13 216
17 16 27
18 17 27
28 17 54
19 13 324
4 19 27

Output:
13 33 27
33 26 27
26 29 27
26 38 54
38 1 27
1 35 27
35 40 27
13 16 216
16 17 27
17 18 27
17 28 54
13 22 1
22 37 1
37 27 1
27 25 1
25 20 1
20 11 1
25 7 3
27 9 5
27 39 6
39 32 1
32 14 1
37 36 10
36 34 1
37 6 12
22 15 14
15 21 1
21 12 1
15 23 3
15 24 4
15 3 5
3 30 1
30 41 1
30 2 2
3 10 4
15 8 10
15 31 11
15 5 12
13 19 324
19 4 27

Output:
1 38 3
2 30 84
3 15 56
4 19 3
5 15 14
6 37 126
7 25 28
8 15 42
9 27 56
10 3 168
11 20 28
12 21 84
13 22 1
14 32 70
15 22 28
16 13 2
17 16 3
18 17 4
19 13 3
20 25 70
21 15 98
23 15 84
24 15 70
25 27 98
26 33 3
27 37 154
28 17 5
29 26 3
30 3 154
31 15 28
32 39 84
33 13 1
34 36 28
35 1 1
36 37 140
37 22 14
38 26 4
39 27 28
40 35 1
41 30 70

Output:
1 35 14
3 10 4
3 30 1
13 16 112
13 19 168
13 33 14
15 3 5
15 5 12
15 8 10
15 21 1
15 23 3
15 24 4
15 31 11
16 17 14
17 18 14
17 28 28
19 4 14
20 11 14
21 12 1
22 13 196
22 37 14
25 7 42
25 20 14
26 29 14
26 38 28
27 9 70
27 25 14
27 39 84
30 2 2
30 41 1
32 14 14
33 26 14
35 40 14
36 34 14
37 6 168
37 27 14
37 36 140
38 1 14
39 32 14
22 15 1

Input:
43
7 29
19 18
32 4
39 40
21 11
34 28
30 23
13 19
33 39
13 35
37 21
29 8
40 1
7 9
8 38
7 31
8 12
7 42
33 20
5 36
17 32
30 43
39 34
40 3
8 24
13 37
35 16
23 22
7 41
35 30
9 14
13 2
7 27
10 25
17 15
41 10
39 26
39 17
33 7
20 13
39 6
34 5

Output:
33 39 1
39 40 1
40 1 1
40 3 2
39 34 4
34 28 1
34 5 2
5 36 1
39 26 8
39 17 9
17 32 1
32 4 1
17 15 3
39 6 13
33 20 15
20 13 1
13 19 1
19 18 1
13 35 3
35 16 1
35 30 2
30 23 1
23 22 1
30 43 3
13 37 9
37 21 1
21 11 1
13 2 12
33 7 28
7 29 28
29 8 28
8 38 28
8 12 56
8 24 84
7 9 168
9 14 28
7 31 224
7 42 252
7 41 280
41 10 28
10 25 28
7 27 364

Output:
39 33 1
40 39 1
1 40 1
3 40 2
34 39 4
28 34 1
5 34 2
36 5 1
26 39 8
17 39 9
32 17 1
4 32 1
15 17 3
6 39 13
20 33 15
13 20 15
19 13 15
18 19 15
35 13 45
16 35 15
30 35 30
23 30 15
22 23 15
43 30 45
37 13 135
21 37 15
11 21 15
2 13 180
7 33 225
29 7 15
8 29 15
38 8 15
12 8 30
24 8 45
9 7 90
14 9 15
31 7 120
42 7 135
41 7 150
10 41 15
25 10 15
27 7 195

Output:
1 40 140
2 13 3
3 40 168
4 32 84
5 34 196
6 39 140
7 33 2
8 29 6
9 7 5
10 41 7
11 21 2
12 8 3
13 20 8
14 9 9
15 17 196
16 35 5
17 39 112
18 19 6
19 13 4
20 33 1
21 37 14
22 23 3
23 30 2
24 8 7
25 10 7
26 39 84
27 7 1
28 34 168
29 7 6
30 35 8
31 7 4
32 17 168
34 39 56
35 13 6
36 5 84
37 13 1
38 8 8
39 33 28
40 39 28
41 7 2
42 7 3
43 30 4

Output:
5 36 15
7 9 6
7 27 13
7 29 1
7 31 8
7 41 10
7 42 9
8 12 2
8 24 3
8 38 1
9 14 1
10 25 1
13 2 180
13 19 15
13 35 45
13 37 135
17 15 45
17 32 15
19 18 15
20 13 15
21 11 15
23 22 15
29 8 1
30 23 15
30 43 45
32 4 15
33 20 225
33 39 15
34 5 30
34 28 15
35 16 15
35 30 30
37 21 15
39 6 195
39 17 135
39 26 120
39 34 60
39 40 15
40 1 15
40 3 30
41 10 1
33 7 1

Input:
400
290 206
354 176
316 49
143 146
121 232
148 115
396 158
36 352
384 150
40 196
399 322
396 101
272 233
212 140
158 373
180 204
51 200
50 282
266 337
148 198
74 84
66 370
169 85
355 24
358 208
85 48
276 332
16 180
174 305
302 348
347 248
399 108
374 242
148 2
256 300
290 365
276 201
23 240
204 7
81 5
279 15
133 264
267 238
360 112
260 367
49 131
262 166
53 118
380 203
324 333
286 400
246 347
30 209
305 320
69 308
324 20
114 288
229 191
57 262
358...

Output:
57 262 1
262 166 1
57 326 3
326 229 1
229 191 1
229 170 2
229 384 3
384 150 1
150 174 1
174 305 1
305 320 1
305 388 2
174 91 4
174 316 5
316 49 1
49 131 1
150 42 9
42 95 1
95 6 1
384 61 13
61 58 1
58 310 1
310 94 1
61 335 4
61 190 5
190 185 1
185 141 1
185 273 2
273 245 1
245 175 1
175 137 1
190 119 7
190 89 8
384 168 27
229 363 31
363 124 1
363 311 2
311 134 1
229 1 35
1 344 1
229 117 37
117 145 1
145 315 1
315 43 1
326 286 42
286 400 1
400 382 1
286 154 3
2...

Output:
1 344 142
3 364 142
12 76 284
12 195 142
13 41 142
13 193 568
15 21 284
15 331 142
16 55 7100
16 93 2840
16 132 7242
16 179 2698
16 180 142
16 227 7384
16 257 4686
17 80 142
18 199 142
20 107 142
23 19 1562
23 128 568
23 240 142
23 301 710
23 397 284
24 219 1
29 159 142
30 209 1
35 127 1
35 169 7
35 186 21
36 45 10
36 202 2
36 256 11
36 352 1
39 92 1
40 196 142
41 10 284
41 11 142
42 95 142
46 77 1
49 131 142
50 183 284
50 282 142
50 292 568
51 194 994
51 200 142...

Output:
1 229 9261
2 148 3591
3 381 1890
4 82 23
5 81 43
6 95 4347
7 204 10584
8 328 20
9 378 3024
10 41 3213
11 41 2835
12 236 11
13 113 6993
14 327 10962
15 279 12474
16 251 1512
17 96 8316
18 180 5292
19 23 12096
20 324 7
21 15 4347
22 380 40
23 180 4914
24 355 20
25 56 14
26 250 6237
27 324 2
28 399 45
29 301 7560
30 178 39
31 84 30
32 287 21
33 118 40
34 371 31
35 139 44
36 246 12
37 399 44
38 75 13
39 215 37
40 212 4536
41 13 7938
42 150 7938
43 315 9072
44 138 6804...

Output:
262 57 1
166 262 1
326 57 3
229 326 1
191 229 1
170 229 2
384 229 3
150 384 1
174 150 1
305 174 1
320 305 1
388 305 2
91 174 4
316 174 5
49 316 1
131 49 1
42 150 9
95 42 1
6 95 1
61 384 13
58 61 1
310 58 1
94 310 1
335 61 4
190 61 5
185 190 1
141 185 1
273 185 2
245 273 1
175 245 1
137 175 1
119 190 7
89 190 8
168 384 27
363 229 31
124 363 1
311 363 2
134 311 1
1 229 35
344 1 1
117 229 37
145 117 1
315 145 1
43 315 1
286 326 42
400 286 1
382 400 1
154 286 3
3...

Input:
500
239 314
463 446
235 463
414 88
384 40
345 374
91 376
264 41
133 444
357 63
337 377
283 161
280 418
40 68
265 47
256 70
242 118
166 409
84 61
98 67
366 339
475 25
464 30
61 134
332 114
154 94
31 48
7 133
362 334
414 42
310 361
410 411
145 293
91 481
124 267
495 12
79 38
59 109
15 120
347 45
212 399
206 130
148 179
256 100
45 457
64 187
309 415
268 402
174 364
89 80
166 83
332 7
268 91
195 384
485 251
162 288
435 121
108 144
441 353
36 428
416 ...

Output:
38 79 1
436 38 1
333 436 1
266 79 4
345 266 1
374 345 1
367 374 1
448 367 1
154 367 2
94 154 1
287 374 5
199 287 1
325 345 8
433 325 1
429 325 2
10 429 1
494 345 12
431 266 14
71 266 15
65 71 1
35 65 1
341 71 3
18 341 1
257 71 5
381 79 25
60 79 26
211 60 1
232 79 28
98 232 1
67 98 1
420 98 2
87 420 1
443 79 33
465 443 1
246 443 2
315 246 1
275 246 2
254 275 1
224 254 1
343 224 1
292 254 3
110 443 9
250 443 10
177 250 1
240 177 1
49 177 2
220 443 14
206 220 1
...

Output:
1 332 12915
2 107 5330
3 168 25
4 96 4
5 305 15375
6 151 14760
7 332 13325
8 366 17220
9 91 51
10 429 55
11 453 7
12 495 23
13 416 13530
14 347 12710
15 247 43
16 485 26
17 137 36
18 341 26
19 196 64
20 228 3690
21 268 14
22 129 1435
23 435 8815
24 33 1435
25 475 77
26 445 19065
27 84 3895
28 248 19065
29 84 4100
30 464 10455
31 204 6355
32 209 7995
33 484 205
34 456 8405
35 65 33
36 57 6970
37 244 5125
38 79 6
39 337 17835
40 384 11480
41 264 21
42 414 17835
43 23...

Output:
79 38 333
38 436 333
436 333 333
79 491 1
491 223 1
223 280 1
280 418 1
418 50 1
50 342 1
50 312 2
280 262 5
262 308 1
280 103 7
103 352 1
103 295 2
295 357 1
357 63 1
103 451 5
280 235 13
235 463 1
463 446 1
280 299 16
299 366 1
366 339 1
339 373 1
373 427 1
427 128 1
339 277 4
339 217 5
339 278 6
366 8 8
8 258 1
366 76 10
76 72 1
76 471 2
366 141 13
299 170 15
170 228 1
228 20 1
280 410 34
410 411 1
410 305 2
305 5 1
223 169 39
223 69 40
223 387 41
387 489 1
...

Output:
1 358 238
6 285 1
7 133 238
7 222 952
7 467 714
8 258 238
9 447 1
12 317 238
13 74 2
13 237 1
14 363 16
14 464 1
15 115 476
15 120 238
16 350 238
21 340 1
22 263 238
22 417 476
26 209 3
26 490 1
28 229 1
29 313 1
29 462 4
30 51 1
31 48 1
32 136 1
33 24 1
33 97 2
33 225 3
36 143 7
36 428 1
36 445 8
37 201 238
38 436 238
40 68 1
45 457 1
46 178 238
50 312 476
50 342 238
51 116 1
54 205 1
56 371 238
56 413 1904
57 36 4
57 303 1
59 109 1
60 211 238
61 95 2
61 134...

Input:
500
136 35
6 12
162 3
59 377
356 229
461 341
115 151
25 41
58 244
58 385
25 416
353 47
32 93
208 269
48 476
416 271
180 207
186 358
35 434
423 81
398 318
89 126
101 275
283 116
267 45
397 178
361 141
287 127
35 245
314 73
314 37
253 403
249 211
119 421
209 191
287 111
307 28
288 225
428 411
481 63
369 25
132 366
383 359
278 222
59 218
132 370
180 348
426 300
92 142
471 281
209 307
107 333
267 62
147 386
191 456
480 174
85 242
422 498
424 347
130 3...

Output:
25 41 333
41 280 333
280 79 333
280 188 666
41 75 1332
75 478 333
478 27 333
27 219 333
219 466 333
466 108 333
27 46 1332
478 310 1998
75 406 2664
406 284 333
284 435 333
284 447 666
75 442 3996
41 189 5661
41 290 5994
290 198 333
290 192 666
41 8 6993
8 176 333
25 416 7992
416 271 333
416 440 666
440 155 333
155 374 333
440 312 999
312 293 333
293 194 333
194 490 333
440 204 2331
25 369 1
369 356 1
356 229 1
229 71 1
229 99 2
229 115 3
115 151 1
115 263 2
356 209 ...

Output:
1 62 18
2 377 3173
3 162 8350
4 58 9686
5 482 7348
6 25 3
7 497 30
8 41 39
9 298 3340
10 212 5845
11 266 8350
12 6 12
13 292 12
14 261 6
15 28 12191
16 25 9
17 267 26
18 358 334
19 193 4676
20 449 5511
21 393 18
22 199 14362
23 423 23
24 385 3841
25 369 1
26 69 34
27 478 43
28 307 9185
29 307 8684
30 186 7181
31 224 6680
32 209 3507
33 106 9185
34 388 8851
35 136 4509
36 498 8
37 314 3173
38 494 7014
39 120 1670
40 498 5
41 25 1
42 317 11
43 58 10855
44 286 18537
...

Output:
356 369 1
229 356 1
71 229 1
99 229 2
115 229 3
151 115 1
263 115 2
209 356 7
191 209 1
456 191 1
51 191 2
157 51 1
417 157 1
450 417 1
307 209 7
28 307 1
15 28 1
500 28 2
29 307 4
138 307 5
392 307 6
384 209 14
32 209 15
93 32 1
443 32 2
383 32 3
359 383 1
184 383 2
61 32 6
169 209 22
199 169 1
114 199 1
394 114 1
107 394 1
333 107 1
459 394 3
68 199 6
389 199 7
119 199 8
421 119 1
22 199 10
149 169 12
331 149 1
327 149 2
220 149 3
89 220 1
126 89 1
202 89 2
...

Output:
3 243 1
6 12 167
6 419 334
8 176 167
9 473 1
11 355 167
13 432 167
16 109 334
16 251 167
17 148 167
17 499 334
19 113 167
19 190 334
23 418 167
24 323 1
24 349 4
25 6 6680
25 16 15197
25 41 167
25 69 5678
25 267 11690
25 268 7181
25 283 8183
25 317 14362
25 416 4008
25 423 15865
27 46 668
27 219 167
28 15 167
28 500 334
31 102 167
32 61 1002
32 93 167
32 383 501
32 443 334
33 56 1
33 217 10
33 270 15
35 245 11
35 375 59
35 410 56
35 434 1
35 481 57
37 289 1
38 57...

Input:
1000
282 21
509 466
600 356
525 785
224 373
961 58
760 394
875 6
766 491
91 353
60 42
643 783
146 914
774 755
344 77
494 703
35 725
678 714
994 773
562 145
807 170
396 135
46 185
634 209
434 453
930 64
311 49
884 614
150 681
163 961
638 132
766 938
744 975
32 401
969 874
312 753
923 906
143 792
643 584
943 78
177 106
182 955
445 117
133 141
393 282
662 331
145 671
401 139
538 365
853 522
192 729
962 194
638 339
398 756
54 905
392 545
308 859
497 660...

Output:
706 915 666
915 223 666
223 974 666
706 998 1
998 273 1
998 4 2
998 743 3
743 742 1
742 922 1
742 934 2
743 74 4
74 977 1
743 933 6
706 94 2664
94 262 666
262 816 666
816 81 666
81 529 666
816 309 1998
309 125 666
309 293 1332
293 511 666
511 251 666
816 150 5328
150 681 666
681 254 666
681 478 1332
681 903 1998
903 802 666
903 541 1332
681 899 3996
150 233 5328
150 503 5994
816 115 11988
115 354 666
354 182 666
182 955 666
115 626 2664
626 17 666
17 296 666
262 884 ...

Output:
2 965 1
3 70 17
3 168 21
3 443 1
3 667 18
7 280 363
11 327 363
15 321 363
17 296 363
19 87 23232
19 464 363
19 672 24321
19 835 22869
20 333 2
20 380 1
24 319 363
24 704 6897
24 727 7260
26 247 1
26 265 8
26 609 11
32 401 1
35 725 1
36 109 363
37 75 1815
37 189 363
37 221 1089
37 427 726
40 84 363
42 689 363
42 840 1815
46 185 1
48 23 363
48 347 726
51 127 2541
51 198 363
51 485 1815
54 905 363
56 179 363
56 547 5445
57 12 59532
57 69 59895
57 219 1089
57 509 363
...

Output:
915 706 1
223 915 1
974 223 1
998 706 4
273 998 1
4 998 2
743 998 3
742 743 1
922 742 1
934 742 2
74 743 4
977 74 1
933 743 6
94 706 14
262 94 1
816 262 1
81 816 1
529 81 1
309 816 3
125 309 1
293 309 2
511 293 1
251 511 1
150 816 8
681 150 1
254 681 1
478 681 2
903 681 3
802 903 1
541 903 2
899 681 6
233 150 8
503 150 9
115 816 18
354 115 1
182 354 1
955 182 1
626 115 4
17 626 1
296 17 1
884 262 26
614 884 1
779 884 2
971 779 1
7 971 1
280 7 1
898 779 4
728 7...

Output:
1 689 23532
2 736 74
3 100 56
4 998 8436
5 344 34632
6 875 27084
7 971 39516
8 307 25752
9 738 58164
10 94 8436
11 785 38184
12 57 4884
13 219 8880
14 367 34632
15 179 51
16 204 18204
17 626 61272
18 134 56
19 262 35076
20 930 40
21 282 5772
22 617 39
23 48 15096
24 643 37740
25 983 50
26 506 105
27 155 15
28 267 49284
29 707 44844
30 184 11988
31 606 91
32 430 35
33 761 66156
34 253 25308
35 546 113
36 358 53724
37 179 47
38 390 19092
39 550 23088
40 351 24420
41 91...

Input:
1000
544 450
475 580
590 360
923 111
90 330
296 361
960 702
824 94
173 648
949 527
273 226
9 518
337 573
606 666
327 158
795 997
597 271
130 235
100 761
728 754
166 706
296 686
590 344
748 466
622 443
815 218
534 208
857 36
99 739
266 122
52 66
456 263
208 231
465 525
421 570
297 604
975 455
556 674
639 492
11 40
948 203
728 127
66 431
527 669
914 824
100 294
90 688
365 830
250 738
663 107
33 251
221 515
642 191
227 392
650 481
123 304
970 43
735 70...

Output:
1 954 52632
2 873 85
3 56 16254
4 665 35604
5 606 4644
6 904 25
7 568 34
8 639 59
9 556 11223
10 54 35217
11 952 9675
12 675 7353
13 339 63468
14 937 26316
15 314 67
16 384 42183
17 643 32121
18 168 27090
19 454 48
20 196 1935
21 9 11223
22 854 17
23 430 20511
24 236 32
25 616 46
26 378 9288
27 540 18963
28 586 14
29 391 65
30 239 83
31 648 34056
32 411 14706
33 936 25
34 407 45666
35 606 12384
36 857 3
37 264 56889
38 850 20
39 556 9675
40 11 8514
41 8 68
42 871 40...

Output:
973 196 1
20 196 2
342 20 1
796 342 1
475 796 1
580 475 1
741 580 1
888 796 4
600 20 7
743 600 1
808 20 9
949 808 1
527 949 1
669 527 1
485 527 2
870 808 5
605 808 6
253 20 16
555 253 1
104 253 2
432 104 1
280 432 1
588 20 21
399 20 22
567 399 1
763 20 24
310 763 1
232 763 2
439 232 1
556 196 30
674 556 1
535 674 1
710 535 1
395 710 1
692 395 1
287 710 3
645 535 5
577 535 6
383 674 8
923 674 9
111 923 1
161 111 1
470 161 1
566 161 2
691 566 1
909 161 4
807 161 ...

Output:
5 317 429
7 921 1
8 41 1
9 21 858
9 201 3003
9 518 429
9 697 1716
11 40 429
11 872 858
12 197 429
12 321 2574
12 801 3003
12 867 3432
18 120 429
20 253 6864
20 342 429
20 399 9438
20 588 9009
20 600 3003
20 763 10296
20 808 3861
21 442 429
23 963 429
25 286 1
27 54 858
27 91 429
29 531 1
31 405 858
31 599 429
33 251 1
35 382 16731
35 581 9009
35 620 429
36 638 8
36 716 14
36 839 21
36 880 16
36 912 1
38 375 2
38 631 3
38 682 1
43 292 429
45 138 429
45 370 1287
46...

Output:
196 973 1
196 20 2
20 342 1
342 796 1
796 475 1
475 580 1
580 741 1
796 888 4
20 600 7
600 743 1
20 808 9
808 949 1
949 527 1
527 669 1
527 485 2
808 870 5
808 605 6
20 253 16
253 555 1
253 104 2
104 432 1
432 280 1
20 588 21
20 399 22
399 567 1
20 763 24
763 310 1
763 232 2
232 439 1
196 556 30
556 674 1
674 535 1
535 710 1
710 395 1
395 692 1
710 287 3
535 645 5
535 577 6
674 383 8
674 923 9
923 111 1
111 161 1
161 470 1
161 566 2
566 691 1
161 909 4
161 807 ...

Input:
1000
51 59
555 989
35 576
666 167
920 826
655 305
526 743
15 311
389 893
230 244
66 902
457 886
679 513
641 931
254 769
175 868
966 265
857 828
617 15
173 504
117 755
576 172
331 399
829 987
202 964
530 489
178 163
366 556
598 251
541 897
937 906
474 852
114 930
571 118
781 270
173 515
25 938
980 142
746 310
962 784
101 50
31 530
796 384
688 682
689 366
534 659
47 885
699 460
689 500
564 350
146 878
964 46
184 841
167 804
365 602
412 358
98 300
331 ...

Output:
1 269 1002
1 400 334
1 718 668
2 367 1
3 284 2
3 484 1
3 550 3
4 233 334
4 672 668
5 14 334
5 426 1336
5 533 1002
11 196 1002
11 700 668
11 819 334
13 36 334
13 111 7682
13 217 7348
14 859 334
15 311 1
15 834 3
16 487 334
16 974 668
17 74 1
18 146 668
18 498 334
19 581 334
19 924 668
20 955 334
22 517 334
23 372 334
23 876 1670
25 938 334
29 136 668
29 675 334
30 869 334
31 530 1
31 628 11
31 746 6
32 354 1
35 323 109886
35 555 99532
35 576 334
36 466 334
36 541 ...

Output:
1 555 33
2 849 37
3 246 67
4 597 86
5 584 36630
6 116 127
7 705 124
8 184 32634
9 731 45954
10 215 39
11 132 17982
12 742 8658
13 340 68
14 5 16650
15 617 76
16 179 134
17 838 146
18 933 151
19 385 23310
20 256 51282
21 129 132
22 424 113
23 196 20646
24 591 44
25 196 21312
26 173 35
27 594 3
28 223 57
29 300 66
30 556 142
31 173 38
32 937 87
33 394 75
34 472 9990
35 332 2
36 13 95
37 376 47
38 539 26640
39 149 66
40 243 38628
41 527 14652
42 82 45954
43 235 218
4...

Output:
332 201 1
201 522 1
522 132 1
132 11 1
11 819 1
11 700 2
11 196 3
196 785 1
785 835 1
196 351 3
196 25 4
25 938 1
196 23 6
23 372 1
372 546 1
372 723 2
723 468 1
23 876 5
876 763 1
763 299 1
196 257 14
132 526 19
526 743 1
743 627 1
526 208 3
132 934 23
934 243 1
243 887 1
243 40 2
40 633 1
243 439 4
439 799 1
934 232 7
132 997 31
997 922 1
922 919 1
997 461 3
461 598 1
598 251 1
598 709 2
709 490 1
490 197 1
522 668 41
668 429 1
429 88 1
429 704 2
704 774 1
5...

Output:
201 332 1
522 201 1
132 522 1
11 132 1
819 11 1
700 11 2
196 11 3
785 196 1
835 785 1
351 196 3
25 196 4
938 25 1
23 196 6
372 23 1
546 372 1
723 372 2
468 723 1
876 23 5
763 876 1
299 763 1
257 196 14
526 132 19
743 526 1
627 743 1
208 526 3
934 132 23
243 934 1
887 243 1
40 243 2
633 40 1
439 243 4
799 439 1
232 934 7
997 132 31
922 997 1
919 922 1
461 997 3
598 461 1
251 598 1
709 598 2
490 709 1
197 490 1
668 522 41
429 668 1
88 429 1
704 429 2
774 704 1
4...

Input:
1000
555 643
237 776
144 181
603 345
690 727
308 619
344 186
636 274
164 470
147 542
350 296
982 605
433 367
691 31
820 480
638 466
809 450
626 426
212 639
130 915
444 357
488 349
149 876
308 435
70 987
659 375
440 641
159 102
303 347
647 433
323 225
309 356
559 362
497 703
179 591
22 83
440 993
809 990
121 994
334 234
762 313
947 911
76 273
736 147
53 489
264 629
748 249
801 711
195 770
396 464
601 563
666 690
521 495
934 171
97 200
476 674
491 410
...

Output:
1 240 334
5 979 334
6 584 1
7 526 1
8 722 334
9 115 334
9 258 668
9 385 1670
9 418 1002
10 717 4342
10 890 2338
10 917 334
11 38 2
11 460 3
11 670 1
13 283 4676
13 436 334
13 843 5344
16 624 1336
16 723 334
16 842 5010
18 497 1
19 104 32064
19 122 668
19 747 334
20 201 2
20 389 12
20 488 5
20 597 11
20 706 8
20 763 1
22 32 2338
22 83 334
22 332 1002
22 829 1336
24 114 1336
24 804 334
26 360 668
26 431 334
28 555 1336
28 943 334
29 342 334
31 307 334
31 902 668
39...

Output:
662 647 1
647 433 1
433 367 1
367 255 1
255 642 1
255 896 2
255 992 3
255 89 4
367 22 6
22 83 1
83 487 1
22 332 3
22 829 4
829 652 1
652 108 1
22 32 7
367 415 14
415 429 1
429 871 1
367 887 17
433 442 19
433 942 20
942 576 1
942 136 2
136 737 1
433 721 24
721 269 1
269 420 1
269 172 2
269 71 3
71 348 1
348 744 1
744 528 1
348 196 3
71 999 5
269 253 9
721 922 11
922 536 1
536 161 1
922 508 3
508 157 1
922 944 5
944 229 1
944 265 2
265 105 1
105 632 1
721 63 21
...

Output:
647 662 1
433 647 1
367 433 1
255 367 1
642 255 1
896 255 2
992 255 3
89 255 4
22 367 6
83 22 1
487 83 1
332 22 3
829 22 4
652 829 1
108 652 1
32 22 7
415 367 14
429 415 1
871 429 1
887 367 17
442 433 19
942 433 20
576 942 1
136 942 2
737 136 1
721 433 24
269 721 1
420 269 1
172 269 2
71 269 3
348 71 1
744 348 1
528 744 1
196 348 3
999 71 5
253 269 9
922 721 11
536 922 1
161 536 1
508 922 3
157 508 1
944 922 5
229 944 1
265 944 2
105 265 1
632 105 1
63 721 21
...

Output:
1 202 141
2 176 33966
3 245 24642
4 716 130
5 643 15318
6 956 63
7 812 3
8 909 44
9 165 67932
10 122 99
11 353 25
12 973 66600
13 457 87
14 985 10
15 513 51
16 511 49950
17 521 39294
18 556 105
19 830 49
20 546 23
21 418 21978
22 367 6660
23 450 48
24 972 81252
25 583 92
26 736 37962
27 740 135
28 828 61272
29 613 49284
30 106 65
31 691 47952
32 22 73926
33 778 30
34 492 29970
35 69 109
36 411 77922
37 160 162
38 11 123
39 191 94
40 402 33
41 276 34
42 111 83
43 27...

Input:
1000
381 917
227 796
79 664
227 840
133 178
124 322
459 48
498 397
923 52
647 460
912 652
179 786
23 482
979 237
414 209
822 606
927 990
480 46
204 423
910 984
633 141
684 15
361 171
337 782
796 729
241 12
837 734
999 309
907 585
266 980
245 462
172 318
6 287
380 391
737 246
635 808
741 510
236 783
511 970
782 19
374 468
219 602
639 336
89 63
768 839
449 572
460 200
844 776
557 348
876 955
577 684
584 838
977 913
380 546
184 695
209 463
494 357
856 ...

Output:
848 269 1
514 848 1
593 848 2
954 593 1
294 848 4
557 848 5
348 557 1
945 348 1
351 945 1
959 351 1
502 959 1
252 945 4
105 252 1
292 945 6
66 292 1
92 66 1
500 66 2
903 292 4
459 903 1
48 459 1
683 459 2
59 459 3
274 459 4
157 459 5
270 903 7
711 270 1
977 711 1
913 977 1
155 913 1
886 270 5
119 886 1
413 270 7
306 413 1
277 557 28
208 277 1
661 208 1
177 661 1
997 177 1
432 997 1
524 661 4
944 208 6
893 208 7
476 893 1
71 848 43
60 269 45
960 60 1
563 960 1
...

Output:
184 695 1
695 657 1
657 400 1
400 308 1
657 505 3
505 455 1
505 139 2
505 310 3
310 666 1
505 519 5
519 431 1
519 368 2
657 260 11
657 142 12
695 659 14
659 665 1
695 296 16
296 152 1
296 642 2
642 897 1
897 799 1
799 833 1
799 548 2
296 312 7
312 862 1
312 323 2
323 525 1
525 983 1
323 752 3
312 506 6
506 150 1
506 710 2
312 53 9
312 315 10
315 924 1
924 797 1
924 672 2
315 957 4
957 371 1
371 303 1
371 561 2
371 705 3
705 378 1
957 339 6
339 262 1
339 75 2
33...

Output:
2 54 366
5 325 366
5 715 3660
6 287 366
7 108 366
7 443 732
8 133 6
8 190 19
8 332 1
8 738 20
10 603 1098
10 756 1464
10 939 366
12 202 366
13 396 2
13 667 1
19 726 366
20 628 1
22 256 1
23 482 1
25 376 366
27 362 9
27 441 8
27 452 1
27 698 6
27 733 3
29 229 366
30 163 1464
30 407 1098
30 616 732
30 781 366
32 162 366
33 392 32
33 584 2
33 677 1
34 473 1
36 489 2196
36 517 366
36 908 1464
38 989 366
39 904 366
41 458 366
42 204 1
44 456 732
44 788 366
45 24 366
...

Output:
1 363 83
2 767 28
3 396 42097
4 110 84
5 414 31
6 704 90
7 641 47
8 927 8041
9 509 52503
10 474 104
11 627 3311
12 241 49
13 866 18920
14 513 33
15 684 46354
16 611 130
17 98 20
18 136 57233
19 782 82
20 203 67639
21 898 29799
22 424 33110
23 269 5203
24 45 5
25 922 5203
26 222 43989
27 927 5676
28 484 67
29 194 117
30 844 75680
31 901 33583
32 226 78
33 675 26961
34 57 17028
35 488 88451
36 566 139
37 766 32
38 884 20
39 520 45
40 483 32
41 191 85
42 909 31691
43 ...

Input:
30
17 27
30 7
4 3
25 12
7 10
1 11
14 13
3 23
4 20
7 29
22 30
18 24
26 21
3 15
23 19
20 26
16 14
25 16
18 2
16 6
18 9
26 18
22 25
22 5
1 8
28 4
3 1
4 22
25 17

Output:
3 4 1
23 3 1
19 23 1
15 3 3
1 3 4
11 1 1
8 1 2
20 4 8
26 20 1
21 26 1
18 26 2
24 18 1
2 18 2
9 18 3
28 4 15
22 4 16
30 22 16
7 30 16
10 7 16
29 7 32
25 22 80
12 25 16
16 25 32
14 16 16
13 14 16
6 16 48
17 25 96
27 17 16
5 22 208

Output:
1 8 20
1 11 10
3 1 40
3 15 30
3 23 10
4 3 10
4 20 80
4 28 150
7 10 10
7 29 20
14 13 1
16 6 3
16 14 1
17 27 1
18 2 20
18 9 30
18 24 10
20 26 10
22 4 50
22 30 10
23 19 10
25 12 1
25 16 2
25 17 6
26 18 20
26 21 10
30 7 10
22 5 1
22 25 2

Output:
4 3 1
3 23 1
23 19 1
3 15 3
3 1 4
1 11 1
1 8 2
4 20 8
20 26 1
26 21 1
26 18 2
18 24 1
18 2 2
18 9 3
4 28 15
4 22 15
22 30 15
30 7 15
7 10 15
7 29 30
22 25 75
25 12 15
25 16 30
16 14 15
14 13 15
16 6 45
25 17 90
17 27 15
22 5 195

Output:
1 3 70
2 18 28
3 4 14
5 22 3
6 16 5
7 30 3
8 1 56
9 18 42
10 7 4
11 1 42
12 25 3
13 14 3
14 16 4
15 3 56
16 25 4
17 25 5
18 26 70
19 23 56
20 4 28
21 26 56
22 4 1
23 3 42
24 18 14
25 22 2
26 20 70
27 17 5
28 4 42
29 7 5
30 22 1

Input:
40
11 8
18 34
21 23
6 7
23 28
27 14
8 18
12 1
27 4
11 30
40 22
29 19
9 32
13 12
15 9
34 5
27 37
20 2
18 33
39 13
27 17
35 24
40 3
11 21
1 35
20 10
27 20
1 16
27 6
11 26
38 36
40 11
17 25
2 38
40 39
1 15
12 27
30 29
14 31

Output:
1 15 56
1 16 42
1 35 14
2 38 1
6 7 1
8 18 14
9 32 14
11 8 14
11 21 126
11 26 168
11 30 84
12 1 14
12 13 112
13 39 14
14 31 1
15 9 14
17 25 1
18 33 42
18 34 14
20 2 1
20 10 4
21 23 14
23 28 14
27 12 14
29 19 14
30 29 14
34 5 14
35 24 14
38 36 1
39 40 14
40 3 28
40 11 42
40 22 14
27 4 11
27 6 1
27 14 12
27 17 8
27 20 3
27 37 10

Output:
12 1 1
1 35 1
35 24 1
1 16 3
1 15 4
15 9 1
9 32 1
12 13 8
13 39 1
39 40 1
40 22 1
40 3 2
40 11 3
11 8 1
8 18 1
18 34 1
34 5 1
18 33 3
11 30 6
30 29 1
29 19 1
11 21 9
21 23 1
23 28 1
11 26 12
12 27 25
27 14 25
14 31 25
27 4 75
27 37 100
27 17 125
17 25 25
27 20 175
20 2 25
2 38 25
38 36 25
20 10 100
27 6 300
6 7 25

Output:
1 12 1
35 1 1
24 35 1
16 1 3
15 1 4
9 15 1
32 9 1
27 12 8
14 27 1
31 14 1
4 27 3
37 27 4
17 27 5
25 17 1
20 27 7
2 20 1
38 2 1
36 38 1
10 20 4
6 27 12
7 6 1
13 12 22
39 13 22
40 39 22
22 40 22
3 40 44
11 40 66
8 11 22
18 8 22
34 18 22
5 34 22
33 18 66
30 11 132
29 30 22
19 29 22
21 11 198
23 21 22
28 23 22
26 11 264

Output:
1 12 18
2 20 108
3 40 2
4 27 144
5 34 3
6 27 72
7 6 180
8 11 4
9 15 198
10 20 144
11 40 3
13 12 1
14 27 162
15 1 36
16 1 54
17 27 108
18 8 2
19 29 5
20 27 90
21 11 2
22 40 1
23 21 5
24 35 234
25 17 72
26 11 1
27 12 36
28 23 4
29 30 2
30 11 3
31 14 108
32 9 90
33 18 2
34 18 3
35 1 72
36 38 18
37 27 126
38 2 126
39 13 1
40 39 1

Input:
45
22 30
16 32
28 27
26 45
12 43
12 37
34 44
12 31
26 15
37 8
21 26
10 13
7 14
34 42
18 34
13 39
4 20
16 18
28 38
18 19
23 12
2 29
6 41
26 36
25 11
23 28
19 33
19 25
43 40
23 16
41 24
7 3
38 9
38 6
28 10
37 4
4 22
37 5
10 7
4 2
19 21
32 17
28 35
43 1

Output:
12 23 1
43 12 1
40 43 1
1 43 2
37 12 4
8 37 1
4 37 2
20 4 1
22 4 2
30 22 1
2 4 4
29 2 1
5 37 8
31 12 13
28 23 15
27 28 1
38 28 2
9 38 1
6 38 2
41 6 1
24 41 1
10 28 7
13 10 1
39 13 1
7 10 3
14 7 1
3 7 2
35 28 13
16 23 29
32 16 29
17 32 29
18 16 87
34 18 29
44 34 29
42 34 58
19 18 116
33 19 29
25 19 58
11 25 29
21 19 116
26 21 29
45 26 29
15 26 58
36 26 87

Output:
1 43 112
2 4 64
3 7 208
4 37 128
5 37 144
6 38 144
7 10 112
8 37 112
9 38 80
10 28 32
11 25 2
12 23 16
13 10 128
14 7 192
15 26 2
16 23 1
17 32 2
18 16 2
19 18 3
20 4 32
21 19 5
22 4 128
24 41 96
25 19 4
26 21 2
27 28 64
28 23 32
29 2 96
30 22 48
31 12 96
32 16 1
33 19 3
34 18 2
35 28 16
36 26 3
37 12 128
38 28 48
39 13 160
40 43 80
41 6 96
42 34 3
43 12 112
44 34 2
45 26 1

Output:
23 12 1
12 43 1
43 40 1
43 1 2
12 37 4
37 8 1
37 4 2
4 20 1
4 22 2
22 30 1
4 2 4
2 29 1
37 5 8
12 31 13
23 28 30
28 27 30
28 38 60
38 9 30
38 6 60
6 41 30
41 24 30
28 10 210
10 13 30
13 39 30
10 7 90
7 14 30
7 3 60
28 35 390
23 16 15
16 32 1
32 17 1
16 18 3
18 34 1
34 44 1
34 42 2
18 19 4
19 33 1
19 25 2
25 11 1
19 21 4
21 26 1
26 45 1
26 15 2
26 36 3

Output:
2 29 16
4 2 64
4 20 16
4 22 32
6 41 16
7 3 32
7 14 16
10 7 48
10 13 16
12 31 208
12 37 64
12 43 16
13 39 16
16 23 16
18 19 4
18 34 1
19 21 4
19 25 2
19 33 1
21 26 1
22 30 16
23 12 16
23 28 240
25 11 1
26 15 2
26 36 3
26 45 1
28 10 112
28 27 16
28 35 208
28 38 32
32 17 1
34 42 2
34 44 1
37 4 32
37 5 128
37 8 16
38 6 32
38 9 16
41 24 16
43 1 32
43 40 16
16 18 1
16 32 14

Input:
50
49 6
43 7
1 27
19 35
15 37
16 12
19 21
16 28
49 9
48 39
13 1
2 48
9 50
44 3
41 32
48 31
49 33
6 11
13 20
49 22
13 41
48 29
13 46
15 47
34 2
49 13
48 14
34 24
16 36
13 40
49 34
49 17
43 25
11 23
10 15
19 26
34 44
16 42
19 18
46 8
29 38
1 45
12 43
13 16
46 30
15 5
49 10
11 19
32 4

Output:
1 27 18
1 45 36
2 48 1
6 11 18
9 50 18
10 15 1
11 19 36
11 23 18
12 43 18
13 1 18
13 16 216
13 20 72
13 40 198
13 41 90
13 46 144
15 5 3
15 37 1
15 47 2
16 12 18
16 28 90
16 36 108
16 42 126
19 18 72
19 21 36
19 26 54
19 35 18
29 38 1
32 4 18
34 2 1
34 24 8
34 44 9
41 32 18
43 7 18
43 25 36
44 3 1
46 8 18
46 30 36
48 14 5
48 29 3
48 31 2
48 39 1
49 6 18
49 9 162
49 13 234
49 22 216
49 33 198
49 10 1
49 17 6
49 34 7

Output:
6 49 1
11 6 1
23 11 1
19 11 2
35 19 1
21 19 2
26 19 3
18 19 4
9 49 9
50 9 1
33 49 11
22 49 12
34 49 13
2 34 1
48 2 1
39 48 1
31 48 2
29 48 3
38 29 1
14 48 5
24 34 8
44 34 9
3 44 1
17 49 24
10 49 25
15 10 1
37 15 1
47 15 2
5 15 3
13 49 30
1 13 30
27 1 30
45 1 60
20 13 120
41 13 150
32 41 30
4 32 30
46 13 240
8 46 30
30 46 60
40 13 330
16 13 360
12 16 30
43 12 30
7 43 30
25 43 60
28 16 150
36 16 180
42 16 210

Output:
1 13 1
2 34 140
3 44 60
4 32 3
5 15 120
6 49 140
7 43 1
8 46 8
9 49 100
10 49 120
11 6 80
12 16 5
13 49 1
14 48 180
15 10 80
16 13 5
17 49 40
18 19 40
19 11 160
20 13 2
21 19 100
22 49 60
23 11 180
24 34 240
25 43 2
26 19 60
27 1 14
28 16 4
29 48 240
30 46 7
31 48 260
32 41 10
33 49 80
34 49 20
35 19 120
36 16 3
37 15 160
38 29 60
39 48 280
40 13 6
41 13 3
42 16 2
43 12 7
44 34 220
45 1 13
46 13 4
47 15 140
48 2 120
50 9 80

Output:
13 1 1
1 27 1
1 45 2
13 20 33
13 41 66
41 32 33
32 4 33
13 46 165
46 8 33
46 30 66
13 49 4
49 6 1
6 11 1
11 23 1
11 19 2
19 35 1
19 21 2
19 26 3
19 18 4
49 9 9
9 50 1
49 33 11
49 22 12
49 34 13
34 2 1
2 48 1
48 39 1
48 31 2
48 29 3
29 38 1
48 14 5
34 24 8
34 44 9
44 3 1
49 17 24
49 10 25
10 15 1
15 37 1
15 47 2
15 5 3
13 40 264
13 16 297
16 12 33
12 43 33
43 7 33
43 25 66
16 28 165
16 36 198
16 42 231

Input:
100
30 18
36 6
57 32
85 27
3 77
36 30
57 15
82 85
82 47
58 23
83 69
35 33
88 43
79 20
15 39
20 17
45 65
83 11
83 8
35 22
12 78
22 51
92 1
30 46
1 99
72 70
33 95
63 24
88 74
75 64
12 49
67 13
52 84
60 91
32 73
92 36
1 82
27 62
6 34
43 89
19 10
82 5
46 9
30 7
8 44
75 29
92 41
80 83
33 98
79 14
63 28
57 37
36 79
76 66
33 81
16 75
97 31
63 3
5 68
36 19
24 59
100 87
20 71
50 55
66 52
48 60
92 57
33 61
86 94
52 53
30 76
20 72
83 21
45 25
...

Output:
1 82 324
1 99 36
3 77 36
5 68 36
6 34 36
6 56 72
6 67 108
8 26 72
8 44 36
12 49 72
12 78 36
15 39 1
16 75 36
19 10 36
20 4 180
20 17 36
20 71 72
20 72 108
22 51 1
24 59 36
25 50 1
27 62 36
30 7 144
30 18 36
30 46 72
30 76 180
30 90 720
32 73 1
33 61 8
33 81 3
33 95 1
33 98 2
35 22 10
35 33 1
35 45 12
36 6 36
36 19 1260
36 30 216
36 79 972
43 89 1
45 25 7
45 65 1
45 96 10
46 9 36
48 42 3
48 60 1
50 55 1
52 53 72
52 84 36
57 15 3
57 32 1
57 35 6
57 37 5
58...

Output:
1 92 185
2 66 5
3 63 4
4 20 10
5 82 370
6 36 1
7 30 7
8 83 703
9 46 1
10 19 3
11 83 740
12 99 185
13 67 8
14 79 2
15 57 407
16 99 222
17 20 13
18 30 11
19 36 2
20 79 3
21 83 666
22 35 407
23 58 5
24 63 5
25 45 703
26 8 370
27 85 518
28 63 3
29 75 666
30 36 3
31 97 333
32 57 185
33 35 296
34 6 10
35 57 481
36 92 1
37 57 444
38 81 222
39 15 518
40 66 6
41 92 74
42 48 148
43 88 185
44 8 333
45 35 333
46 30 12
47 82 333
48 92 148
49 12 666
50 25 333
51 22 555
...

Output:
1 92 1
99 1 1
16 99 1
75 16 1
64 75 1
29 75 2
12 99 5
78 12 1
49 12 2
82 1 9
85 82 1
27 85 1
62 27 1
47 82 4
5 82 5
68 5 1
97 82 7
31 97 1
80 82 9
83 80 1
69 83 1
11 83 2
8 83 3
44 8 1
26 8 2
21 83 6
41 92 27
57 92 28
32 57 1
73 32 1
15 57 3
39 15 1
37 57 5
35 57 6
33 35 1
95 33 1
98 33 2
81 33 3
100 81 1
87 100 1
54 100 2
38 81 4
61 33 8
22 35 10
51 22 1
45 35 12
65 45 1
93 65 1
88 65 2
43 88 1
89 43 1
74 88 3
25 45 7
50 25 1
55 50 1
96 45 10
86 92 5...

Output:
92 1 66
1 99 66
99 16 66
16 75 66
75 64 66
75 29 132
99 12 330
12 78 66
12 49 132
1 82 594
82 85 66
85 27 66
27 62 66
82 47 264
82 5 330
5 68 66
82 97 462
97 31 66
82 80 594
80 83 66
83 69 66
83 11 132
83 8 198
8 44 66
8 26 132
83 21 396
92 36 1
36 6 1
6 34 1
6 56 2
6 67 3
67 13 1
36 30 6
30 18 1
30 46 2
46 9 1
30 7 4
30 76 5
76 66 1
66 52 1
52 84 1
52 53 2
66 40 4
66 2 5
76 58 7
58 23 1
76 63 9
63 24 1
24 59 1
63 28 3
63 3 4
3 77 1
30 90 20
36 79 27
79...

Input:
200
23 150
77 29
114 7
71 139
183 54
72 73
82 169
108 33
16 141
74 134
113 34
71 27
187 104
175 45
66 43
192 100
88 155
74 11
11 3
42 198
200 126
112 9
59 68
64 148
6 17
106 118
72 112
82 131
88 36
182 167
166 133
44 28
44 10
155 95
141 144
141 158
125 132
51 184
182 49
28 199
88 200
5 140
162 127
112 51
151 59
125 157
200 66
78 87
37 23
71 77
91 168
117 196
46 78
13 111
21 32
75 122
142 39
76 20
129 175
40 52
165 90
145 14
116 189
108 128
19...

Output:
1 63 86
2 83 344
2 153 86
3 42 86
4 18 86
5 140 1
6 17 1
11 3 86
11 40 430
11 44 1376
11 81 1978
11 183 2236
11 186 1892
12 159 86
13 48 2
13 111 1
16 53 4
16 141 1
21 32 1
23 147 172
23 150 86
26 15 86
28 199 86
30 35 86
32 188 1
33 16 1
33 82 6
35 85 86
36 116 86
37 23 86
39 6 22
39 61 1
39 114 12
40 52 86
40 93 860
40 156 172
40 174 344
41 84 1
42 176 172
42 198 86
44 10 258
44 28 86
44 50 344
44 67 430
45 58 86
46 78 1
46 124 3
47 119 1
48 171 1
51 12 34...

Output:
126 200 1
74 126 1
134 74 1
99 134 1
11 74 3
3 11 1
42 3 1
198 42 1
176 42 2
40 11 5
52 40 1
156 40 2
55 156 1
174 40 4
113 174 1
34 113 1
194 113 2
123 113 3
172 113 4
93 40 10
44 11 16
28 44 1
199 28 1
10 44 3
50 44 4
67 44 5
186 11 22
81 11 23
109 81 1
25 81 2
183 11 26
54 183 1
89 183 2
72 74 32
73 72 1
177 73 1
8 73 2
37 73 3
23 37 1
150 23 1
147 23 2
91 73 7
168 91 1
4 168 1
18 4 1
26 91 4
15 26 1
97 91 6
151 97 1
59 151 1
68 59 1
64 97 4
148 64 1
...

Output:
1 66 558
2 200 465
3 11 837
4 168 465
5 125 8
6 39 20
7 114 31
8 73 2418
9 112 1674
10 44 651
11 74 1395
12 51 3162
13 61 43
14 145 1302
15 26 1116
16 33 13
17 6 25
18 4 1488
19 112 2418
20 76 10
21 101 16
22 71 6
23 37 1953
24 133 279
25 81 2046
26 91 1209
27 71 10
28 44 1116
29 77 27
30 58 2325
31 132 12
32 21 21
33 108 3
34 113 1767
35 30 651
36 88 3
37 73 2511
38 185 18
39 142 17
40 11 1023
41 82 27
42 3 2790
43 66 651
44 11 1209
45 175 2232
46 102 11
47 10...

Output:
200 126 112
126 74 112
74 134 112
134 99 112
74 11 336
11 3 112
3 42 112
42 198 112
42 176 224
11 40 560
40 52 112
40 156 224
156 55 112
40 174 448
174 113 112
113 34 112
113 194 224
113 123 336
113 172 448
40 93 1120
11 44 1792
44 28 112
28 199 112
44 10 336
44 50 448
44 67 560
11 186 2464
11 81 2576
81 109 112
81 25 224
11 183 2912
183 54 112
183 89 224
74 72 3584
72 73 112
73 177 112
73 8 224
73 37 336
37 23 112
23 150 112
23 147 224
73 91 784
91 168 112
168 4 ...

Input:
300
9 86
70 74
223 56
162 234
168 191
232 88
37 100
223 176
116 26
121 18
116 20
47 3
215 51
202 291
264 72
51 224
51 84
241 170
69 81
292 296
139 202
148 186
120 200
245 60
6 58
261 265
181 237
7 112
196 249
21 73
139 31
36 114
107 71
201 159
245 199
213 233
288 261
129 78
41 130
237 132
96 136
266 117
283 145
215 124
289 43
128 182
139 103
255 282
128 292
275 263
278 85
274 54
103 27
208 69
13 47
201 272
153 297
123 59
35 102
25 253
99 178
91 ...

Output:
115 213 200
213 233 200
233 236 200
236 188 200
188 217 200
217 28 200
233 83 1000
115 139 1
139 202 1
202 291 1
139 31 3
31 36 1
36 114 1
36 231 2
36 279 3
36 286 4
31 222 6
222 137 1
31 164 8
139 103 12
103 27 1
27 280 1
280 257 1
280 21 2
21 73 1
21 119 2
21 22 3
22 17 1
22 148 2
148 186 1
148 138 2
280 61 10
61 62 1
103 247 14
247 293 1
247 32 2
103 154 17
154 226 1
226 150 1
226 175 2
175 38 1
38 95 1
95 166 1
226 118 6
226 185 7
154 42 9
154 67 10
67 66 ...

Output:
1 243 3146
2 120 1144
3 47 27
4 128 3861
5 203 3289
6 51 22
7 115 715
8 262 20
9 197 286
10 203 3575
11 52 6292
12 120 1430
13 139 5
14 207 1144
15 242 7007
16 6 17
17 22 22
18 121 30
19 6 18
20 116 23
21 280 36
22 21 11
23 258 7
24 241 3432
25 52 6435
26 116 22
27 103 19
28 217 3146
29 224 30
30 258 6
31 139 6
32 247 24
33 97 3003
34 18 7
35 111 22
36 31 15
37 145 1859
38 175 27
39 7 1001
40 39 1573
41 115 143
42 154 28
43 289 3575
44 292 4576
45 214 6149
46 27...

Output:
213 115 1
233 213 1
236 233 1
188 236 1
217 188 1
28 217 1
83 233 5
41 115 8
130 41 1
206 130 1
241 130 2
170 241 1
24 241 2
284 241 3
242 284 1
15 242 1
254 241 6
127 41 10
87 127 1
255 127 2
282 255 1
183 282 1
214 255 3
45 214 1
108 214 2
273 255 6
204 273 1
207 204 1
14 207 1
104 204 3
162 127 13
234 162 1
283 162 2
145 283 1
37 145 1
100 37 1
243 283 4
1 243 1
177 243 2
294 162 9
196 162 10
249 196 1
129 196 2
78 129 1
133 78 1
110 133 1
299 129 4
89 299 ...

Output:
2 194 132
4 252 132
6 16 3
6 19 5
6 58 1
6 165 2
7 39 264
7 82 5808
7 112 132
7 128 2772
7 221 1716
7 269 1584
9 86 132
10 295 132
13 47 1
13 116 9
13 190 7
13 260 8
16 228 1
18 34 1
20 105 1
21 22 3
21 73 1
21 119 2
22 17 1
22 148 2
25 253 132
26 205 1
26 262 3
27 280 1
29 220 1
30 48 2
30 256 1
31 36 132
31 164 1056
31 222 792
34 184 1
35 102 1
36 114 132
36 231 264
36 279 396
36 286 528
37 100 132
38 95 1
39 40 924
39 180 132
39 192 1188
39 208 396
40 50 1...

Input:
1000
466 195
637 687
987 639
156 529
487 530
560 941
129 846
762 841
548 609
595 144
919 145
313 955
24 137
141 585
546 390
188 744
149 317
897 265
586 995
542 499
38 588
709 848
928 437
731 32
902 442
489 289
179 218
127 524
643 522
924 244
716 31
904 308
232 539
751 25
894 800
891 951
327 632
618 924
768 643
151 412
561 917
452 810
613 756
561 651
750 914
324 597
534 870
902 627
865 474
491 453
802 403
852 813
987 827
339 278
111 775
891 449
552 25...

Output:
802 403 1
802 133 666
133 650 666
133 147 1332
147 379 666
379 699 666
699 972 666
379 411 1998
147 773 3330
147 357 3996
357 65 666
65 702 666
65 345 1332
357 371 2664
133 42 8658
802 873 9990
873 665 666
665 85 666
85 534 666
534 870 666
665 257 2664
257 163 666
163 754 666
257 763 1998
873 101 5994
873 456 6660
456 971 666
971 99 666
99 923 666
99 895 1332
99 532 1998
99 229 2664
971 749 3996
749 338 666
456 223 5994
223 703 666
223 974 1332
456 77 7992
873 272 1531...

Output:
1 494 21364
2 536 138
3 698 1
4 801 62
5 586 27
6 116 142
7 5 78
8 41 33572
9 452 44908
10 196 67
11 446 43
12 74 47960
13 207 24
14 41 31392
15 57 92
16 572 43600
17 942 59
18 886 46
19 60 30956
20 790 54
21 979 70
22 28 16568
23 95 43600
24 308 48
25 751 24852
26 984 109
27 469 57
28 181 47960
29 843 119
30 904 8
31 716 23544
32 731 18
33 410 44908
34 274 13516
35 849 65
36 796 84
37 680 41
38 358 26160
39 536 143
40 166 53
41 424 37060
42 133 16568
43 501 28776
...

Output:
956 698 1
106 956 1
776 956 2
107 956 3
616 107 1
501 107 2
75 501 1
981 501 2
622 501 3
326 501 4
360 501 5
399 501 6
791 501 7
986 501 8
43 501 9
678 107 12
570 698 17
561 570 1
917 561 1
458 917 1
973 458 1
329 973 1
167 458 3
209 917 5
652 917 6
504 652 1
672 917 8
634 672 1
139 634 1
996 139 1
79 139 2
205 672 5
651 561 15
765 651 1
708 765 1
276 765 2
480 561 19
953 480 1
822 953 1
520 953 2
370 520 1
919 561 24
145 919 1
929 145 1
564 929 1
61 929 2
120 ...

Output:
3 148 424
3 565 1272
3 698 5512
4 134 2
4 761 4
4 795 1
5 7 4
5 808 1
6 91 1
6 514 2
7 644 1
10 852 1
10 975 5
14 46 424
16 184 424
20 361 4
20 780 2
20 954 1
23 74 424
23 109 18232
23 560 19080
23 688 22048
24 137 1
24 140 10
24 563 8
25 633 424
26 221 1
27 384 424
28 22 424
29 655 1
30 64 6
30 300 1
30 387 5
30 401 22
30 448 8
30 676 26
34 428 424
34 443 1272
36 637 1
37 287 5
37 686 4
37 900 1
37 921 3
37 944 2
38 588 424
39 375 3
39 414 1
40 373 1
41 8 63...

Input:
1000
341 305
331 177
7 739
739 862
437 385
228 744
825 132
382 251
83 869
321 803
886 529
635 562
691 826
381 599
186 546
15 986
415 75
817 297
623 725
15 341
109 458
438 881
186 852
794 220
320 720
213 205
403 738
416 300
57 474
556 982
78 137
3 825
842 785
332 476
228 860
276 73
618 163
768 314
466 169
961 889
175 750
670 949
212 356
654 908
410 934
15 298
385 505
883 283
9 109
409 518
540 624
377 964
681 354
403 433
360 535
45 496
442 510
538 711...

Output:
611 33 1
987 611 1
106 33 3
776 106 1
842 33 5
785 842 1
270 785 1
728 270 1
203 270 2
552 785 4
645 552 1
376 785 6
559 376 1
116 376 2
671 116 1
271 785 10
783 271 1
248 271 2
355 248 1
321 355 1
803 321 1
736 321 2
523 248 5
637 523 1
397 637 1
832 637 2
661 523 4
413 661 1
328 413 1
327 271 14
481 785 25
350 481 1
90 350 1
143 481 3
260 143 1
389 260 1
666 389 1
126 666 1
915 260 4
198 260 5
107 143 7
596 107 1
660 596 1
363 596 2
76 363 1
602 143 12
993 60...

Output:
1 646 46842
2 134 18990
3 57 21944
4 678 41356
5 966 30384
6 249 43
7 910 16880
8 848 91
9 519 35870
10 438 60
11 457 47686
12 669 71
13 702 34604
14 761 58
15 298 13
16 466 34604
17 687 39246
18 341 56
19 96 27008
20 848 47
21 877 32494
22 173 52328
23 357 22
24 943 14348
25 151 25742
26 308 56548
27 147 31650
28 283 100
29 276 28696
30 101 98
31 526 47
32 984 38402
34 200 95
35 135 101
36 66 13504
37 992 47686
38 648 29962
39 725 21100
40 946 47
41 323 6752
42 213 ...

Output:
3 825 361
3 886 1805
6 544 1
7 739 361
8 69 1
9 109 361
11 153 361
14 589 1
14 954 5
15 341 2
15 926 11
15 986 1
22 168 361
24 675 361
29 65 361
31 420 1
33 106 1083
33 431 75088
33 539 73644
33 611 361
33 636 206853
33 842 1805
33 918 92777
33 977 75449
33 983 74366
35 643 1
36 771 361
37 173 722
37 592 361
40 313 361
40 462 722
42 437 361
43 48 2
43 436 1
45 490 2527
45 496 361
45 715 722
46 779 722
46 801 361
48 342 1
51 571 1
52 139 8
52 157 1
52 445 6
52 516...

Output:
33 611 1
611 987 1
33 106 3
106 776 1
33 842 5
842 785 1
785 270 1
270 728 1
270 203 2
785 552 4
552 645 1
785 376 6
376 559 1
376 116 2
116 671 1
785 271 10
271 783 1
271 248 2
248 355 1
355 321 1
321 803 1
321 736 2
248 523 5
523 637 1
637 397 1
637 832 2
523 661 4
661 413 1
413 328 1
271 327 14
785 481 25
481 350 1
350 90 1
481 143 3
143 260 1
260 389 1
389 666 1
666 126 1
260 915 4
260 198 5
143 107 7
107 596 1
596 660 1
596 363 2
363 76 1
143 602 12
602 99...

Input:
1000
71 971
193 893
738 654
706 109
535 779
575 195
259 51
714 702
374 48
80 691
223 910
907 689
51 666
532 843
39 115
738 966
973 290
349 679
452 449
673 696
54 4
287 205
99 203
599 538
137 348
169 761
533 219
524 256
858 226
994 391
741 225
16 260
725 844
29 286
680 151
927 886
58 5
134 158
191 855
58 306
794 988
62 623
946 816
873 597
480 400
928 868
706 920
438 619
399 64
354 595
550 427
725 963
16 429
523 583
959 878
932 770
235 508
902 939
50...

Output:
883 794 1
532 794 2
843 532 1
433 843 1
184 433 1
333 532 4
21 532 5
223 21 1
910 223 1
376 223 2
796 376 1
665 376 2
160 665 1
598 160 1
658 598 1
985 658 1
516 160 4
386 223 10
758 386 1
278 758 1
249 223 13
845 223 14
877 845 1
486 223 16
909 223 17
906 21 19
305 906 1
680 305 1
151 680 1
91 532 28
622 91 1
407 622 1
955 622 2
887 622 3
848 91 5
212 848 1
728 848 2
565 91 8
533 565 1
219 533 1
576 219 1
773 219 2
273 773 1
146 273 1
481 773 3
856 481 1
371 7...

Output:
1 431 31213
2 286 31899
3 71 8
4 54 38
5 58 8232
6 586 22
7 954 3
8 127 28
9 58 9261
10 763 51
11 601 39
12 86 34986
13 960 9261
14 882 43
15 349 45276
16 870 79
17 550 21952
18 33 3087
19 256 53851
20 37 50
21 532 7546
22 465 22295
23 463 71
24 176 49735
25 256 58653
26 478 59682
27 811 67228
28 1000 12348
29 468 43904
30 315 30527
31 634 54
32 381 26754
33 772 12005
34 177 45276
35 515 60
36 973 24696
37 600 31
38 878 23324
39 342 78204
40 431 41160
41 108 58996
4...

Output:
1 605 424
3 287 41976
3 443 3392
3 517 34344
3 725 6784
3 869 424
3 935 6360
4 484 848
4 762 424
4 827 1272
5 388 2
5 980 1
7 784 424
9 353 1
10 258 1696
10 322 424
10 807 848
12 104 6
12 189 1
12 705 4
15 231 1
16 260 424
16 310 2544
16 429 848
19 395 5512
19 501 424
21 223 1
21 906 19
23 84 424
23 123 848
25 157 424
25 299 848
26 204 424
27 523 424
28 102 424
28 246 1696
28 308 1272
28 786 5512
29 255 1696
29 286 424
31 288 1272
31 631 848
31 924 2968
31 943 424...

Output:
794 988 656
988 71 656
71 971 656
971 103 656
103 744 656
103 230 1312
230 870 656
870 16 656
16 260 656
16 429 1312
429 55 656
55 93 656
55 551 1312
16 310 3936
230 746 5904
103 175 7872
103 323 8528
971 539 9840
539 808 656
808 401 656
539 237 1968
237 780 656
237 660 1312
660 487 656
487 820 656
487 652 1312
652 199 656
237 364 4592
364 731 656
364 456 1312
456 284 656
971 62 19024
62 623 656
62 139 1312
139 463 656
463 453 656
463 23 1312
23 84 656
23 123 1312
62 ...

Input:
1000
927 709
257 934
696 878
648 199
749 715
906 994
841 203
731 353
963 269
656 279
791 133
704 553
850 363
108 541
786 333
174 935
368 796
577 835
512 670
467 332
357 373
953 314
459 305
139 642
70 337
90 822
600 659
545 921
782 160
171 546
519 928
628 552
353 826
365 565
207 698
525 112
199 992
896 303
648 137
232 752
24 56
558 859
50 431
272 833
874 253
743 79
734 32
340 347
87 524
152 260
579 417
221 173
284 367
547 426
842 135
150 440
840 799
...

Output:
648 199 1
137 648 1
568 137 1
667 137 2
164 137 3
189 648 5
107 189 1
105 189 2
299 105 1
466 299 1
213 105 3
395 213 1
18 213 2
776 189 8
369 776 1
538 369 1
861 538 1
396 369 3
325 369 4
718 325 1
758 718 1
897 325 3
175 776 9
908 175 1
783 908 1
428 783 1
275 908 3
990 776 14
181 990 1
143 181 1
262 143 1
844 262 1
76 776 19
754 76 1
751 76 2
702 751 1
116 776 23
654 116 1
436 654 1
232 116 3
752 232 1
520 189 36
585 520 1
493 585 1
380 585 2
327 380 1
741 3...

Output:
4 3 1
5 530 1730
5 673 2076
5 729 346
12 691 346
13 21 346
13 31 5882
13 572 6228
13 769 5536
13 973 3114
17 161 1
17 515 2
19 147 1730
19 841 346
21 78 692
21 537 1038
21 549 346
21 724 2422
23 246 346
24 56 346
24 141 692
25 771 1
27 389 5
27 482 1
27 484 3
27 722 4
28 301 13
28 446 1
29 453 1
35 12 346
35 405 1038
38 306 1
38 472 3
38 852 2
41 919 346
44 139 346
47 590 1
48 290 346
50 431 346
51 241 346
53 499 346
55 901 1
57 272 1
57 508 3
62 614 4
62 773 1
...

Output:
467 332 1
467 750 666
750 106 666
106 360 666
360 124 666
360 735 1332
735 483 666
483 348 666
348 830 666
360 5 3996
5 729 666
729 152 666
152 260 666
260 54 666
5 530 3330
5 673 3996
673 938 666
938 495 666
673 345 1998
673 886 2664
106 877 11988
106 633 12654
106 469 13320
469 849 666
469 185 1332
469 626 1998
469 354 2664
354 767 666
767 847 666
106 883 17982
883 993 666
993 183 666
993 837 1332
106 321 20646
321 952 666
952 582 666
582 456 666
321 522 2664
522 863...

Output:
1 605 36
2 291 68
3 4 43000
4 892 67080
5 360 45
6 207 43860
7 658 4300
8 800 8170
9 608 34830
10 103 44
11 744 29240
12 35 102
13 467 23
14 559 103
15 836 12040
16 947 42140
17 318 70950
18 213 77830
19 992 13760
20 910 34400
21 13 38
22 240 90
23 485 55900
24 138 36
25 679 3870
26 936 119
27 910 39130
28 331 12900
29 940 51600
30 184 70
31 13 44
32 734 72
33 950 90
34 486 20
35 512 22
36 450 38
37 464 37410
38 925 3010
39 987 78
40 438 12040
41 736 29
42 227 21
4...

Input:
1000
264 131
857 858
941 268
857 97
395 890
22 571
259 55
66 774
458 414
559 901
945 791
955 676
921 56
459 873
667 220
104 960
56 434
415 289
393 23
563 128
969 780
564 168
104 226
410 945
942 441
474 80
203 273
66 597
798 772
818 341
338 256
280 228
931 794
73 839
93 911
16 17
477 237
455 533
119 407
618 603
89 91
422 98
734 472
385 969
368 946
146 908
411 134
733 57
590 845
454 48
462 421
680 402
618 24
915 862
384 786
466 775
5 564
733 101
483 ...

Output:
669 445 1
568 669 1
959 568 1
96 959 1
803 96 1
600 959 3
622 600 1
607 622 1
105 600 3
130 600 4
463 130 1
478 959 9
546 478 1
506 546 1
37 478 3
365 37 1
550 365 1
160 37 3
783 959 16
280 568 18
228 280 1
723 228 1
389 723 1
334 723 2
584 723 3
678 584 1
300 584 2
887 300 1
449 887 1
929 584 5
476 228 10
702 476 1
732 702 1
60 476 3
861 60 1
744 280 16
363 280 17
408 363 1
475 363 2
623 363 3
889 280 21
921 669 41
56 921 1
434 56 1
671 434 1
379 56 3
140 379 ...

Output:
445 669 1
669 568 1
568 959 1
959 96 1
96 803 1
959 600 3
600 622 1
622 607 1
600 105 3
600 130 4
130 463 1
959 478 9
478 546 1
546 506 1
478 37 3
37 365 1
365 550 1
37 160 3
959 783 16
568 280 18
280 228 1
228 723 1
723 389 1
723 334 2
723 584 3
584 678 1
584 300 2
300 887 1
887 449 1
584 929 5
228 476 10
476 702 1
702 732 1
476 60 3
60 861 1
280 744 16
280 363 17
363 408 1
363 475 2
363 623 3
280 889 21
669 921 41
921 56 1
56 434 1
434 671 1
56 379 3
379 140 ...

Output:
3 361 342
5 77 24
5 197 27
5 227 14
5 354 11
5 439 17
5 564 1
5 646 8
8 16 1368
8 663 342
16 17 342
16 362 2736
16 423 3078
16 444 684
16 981 3420
20 258 342
21 420 3
21 630 1
22 571 342
23 542 4
23 577 2
23 601 1
23 713 3
24 123 342
26 173 342
26 412 1710
27 275 9
27 453 10
27 562 53
27 768 1
27 857 11
27 867 7
28 282 342
28 769 1026
30 576 1
31 115 1710
31 345 1026
31 384 342
31 508 1368
32 188 342
33 828 1
34 537 342
36 685 1
36 825 2
37 160 1026
37 365 342
...

Output:
1 521 18
2 613 52
3 812 33
4 958 39576
5 240 45008
6 474 97776
7 667 26
8 104 50828
9 526 103
10 931 37248
11 460 5044
12 982 46172
13 261 33756
14 483 41904
15 567 55
16 8 38800
17 16 74884
18 79 147
19 492 72
20 115 121
21 73 17072
22 667 27
23 393 37636
24 618 63
25 555 9700
26 945 17072
27 415 19400
28 286 44232
29 81 29100
30 73 17848
31 246 88
32 460 17848
33 66 40740
34 410 1940
35 288 19
36 468 58588
37 478 158
38 844 46172
39 235 84
40 879 66736
41 629 97388...

Input:
1000
609 323
691 330
286 127
81 861
403 207
621 608
537 755
742 759
541 987
399 444
340 440
494 297
949 167
206 909
29 738
222 708
903 842
678 757
115 196
261 453
12 499
211 62
903 233
605 505
921 267
959 20
647 837
235 334
436 697
260 446
225 741
293 314
101 761
588 794
235 9
23 803
38 507
671 355
585 315
956 456
80 57
554 526
49 645
854 422
843 29
89 821
314 770
88 320
201 27
559 920
949 387
619 586
894 66
481 169
377 511
735 500
403 919
535 424
...

Output:
1 626 334
1 684 668
5 258 1
8 19 3
8 71 2
8 350 29
8 374 19
8 386 27
8 509 31
8 823 1
8 854 6
8 899 4
10 884 1
12 376 1002
12 499 334
12 522 4008
12 862 3340
13 236 1
14 225 1336
14 246 3674
14 490 1002
14 516 4676
14 713 334
16 997 334
21 1 668
21 652 334
23 96 668
23 678 1002
23 803 334
25 616 334
25 924 668
27 228 334
28 146 668
28 375 334
28 863 1002
29 603 2338
29 685 1670
29 738 334
30 969 334
33 130 334
33 477 1002
33 811 1670
35 982 334
38 507 334
38 576 ...

Output:
1 21 120
2 850 87
3 308 81
4 623 46
5 190 76
6 713 116
7 251 7992
8 909 98
9 235 37296
10 207 64
11 419 89
12 314 5328
13 190 129
14 414 120
15 454 161
16 760 83
17 376 12654
18 194 75
19 8 97
20 959 33
21 433 50
22 740 26
23 998 121
24 629 7992
25 529 28
26 506 30636
27 201 4662
28 836 13320
29 843 66
30 294 46620
31 682 50
32 872 39
33 583 29
34 717 35
35 571 164
36 195 93
37 220 119
38 678 131
39 499 29304
40 361 60
41 384 61
42 124 11988
43 107 29970
44 261 16...

Output:
540 887 1
887 124 1
124 856 1
124 750 2
750 155 1
155 407 1
750 629 3
629 24 1
629 118 2
118 889 1
629 953 4
953 165 1
165 763 1
763 464 1
763 827 2
827 260 1
260 446 1
446 441 1
827 962 4
763 455 7
953 838 10
953 107 11
107 615 1
615 369 1
369 294 1
294 30 1
30 969 1
294 721 3
369 630 5
630 637 1
369 86 7
107 43 10
629 106 26
106 743 1
629 356 28
124 63 34
63 293 1
293 314 1
314 770 1
770 618 1
618 943 1
943 129 1
943 747 2
618 666 4
618 771 5
771 671 1
671 35...

Output:
887 540 1
124 887 1
856 124 1
750 124 2
155 750 1
407 155 1
629 750 3
24 629 1
118 629 2
889 118 1
953 629 4
165 953 1
763 165 1
464 763 1
827 763 2
260 827 1
446 260 1
441 446 1
962 827 4
455 763 7
838 953 10
107 953 11
615 107 1
369 615 1
294 369 1
30 294 1
969 30 1
721 294 3
630 369 5
637 630 1
86 369 7
43 107 10
106 629 26
743 106 1
356 629 28
63 124 34
293 63 1
314 293 1
770 314 1
618 770 1
943 618 1
129 943 1
747 943 2
666 618 4
771 618 5
671 771 1
355 67...

Input:
1000
528 593
334 82
666 807
44 144
811 403
588 343
143 800
350 899
329 675
22 654
838 425
201 392
790 941
354 508
106 83
491 217
807 158
138 727
740 641
68 891
666 304
435 691
964 439
847 567
545 122
723 894
567 72
191 324
867 259
506 812
304 825
860 853
23 266
998 489
87 931
791 917
296 748
491 161
404 692
927 864
246 290
73 227
248 728
699 944
425 219
868 961
524 147
527 502
798 269
228 141
805 818
878 734
819 344
700 579
451 634
301 633
8 915
807...

Output:
1 414 334
5 39 334
8 288 10
8 474 8
8 588 63
8 915 1
11 804 334
12 379 1
17 108 3
17 790 7
17 909 1
21 70 334
21 136 1670
21 442 1336
21 795 1002
22 126 5344
22 654 334
22 789 4342
22 796 2672
23 266 334
25 852 334
26 48 668
26 327 334
34 270 334
37 353 334
38 723 1
39 283 668
39 600 334
40 465 334
41 73 1
44 144 1
44 349 11
44 664 5
44 747 2
45 374 1002
45 467 668
45 663 334
46 411 334
47 29 1002
47 912 334
48 102 334
48 806 668
52 879 334
54 577 668
54 586 334
...

Output:
997 603 1
603 305 1
305 836 1
836 887 1
887 423 1
423 587 1
887 620 3
620 632 1
632 858 1
887 813 6
813 478 1
478 363 1
813 926 3
836 513 11
836 923 12
923 681 1
836 249 14
836 443 15
443 207 1
207 351 1
836 982 18
836 172 19
305 458 21
458 452 1
305 151 23
151 672 1
672 721 1
721 985 1
721 384 2
721 859 3
721 568 4
672 229 6
151 883 8
151 946 9
946 986 1
986 583 1
583 863 1
583 148 2
148 322 1
322 625 1
151 702 16
702 390 1
390 76 1
390 340 2
340 820 1
340 913 ...

Output:
1 872 188
2 436 2664
3 704 22644
4 329 202
5 904 108
6 889 13
7 868 117
8 369 8
9 846 45954
10 393 111
11 218 46620
12 563 49
13 642 45
14 477 174
15 636 101
16 897 15984
17 349 145
18 922 37296
19 325 81
20 909 91
21 175 34
22 666 3
23 737 80586
24 446 48618
25 726 45288
26 435 12654
27 599 3330
28 601 90
29 47 44
30 255 32
31 337 35298
32 244 20
33 711 61272
34 496 46
35 485 108
36 735 58
37 943 37296
38 889 19
39 5 103
40 635 21
41 901 109
42 844 6660
43 670 512...

Output:
603 997 1
305 603 1
836 305 1
887 836 1
423 887 1
587 423 1
620 887 3
632 620 1
858 632 1
813 887 6
478 813 1
363 478 1
926 813 3
513 836 11
923 836 12
681 923 1
249 836 14
443 836 15
207 443 1
351 207 1
982 836 18
172 836 19
458 305 21
452 458 1
151 305 23
672 151 1
721 672 1
985 721 1
384 721 2
859 721 3
568 721 4
229 672 6
883 151 8
946 151 9
986 946 1
583 986 1
863 583 1
148 583 2
322 148 1
625 322 1
702 151 16
390 702 1
76 390 1
340 390 2
820 340 1
913 340 ...

Input:
1000
291 599
771 516
196 694
258 20
328 342
583 999
437 806
565 309
655 305
633 363
773 447
133 319
794 139
714 782
172 325
994 67
21 188
10 705
583 314
937 173
253 197
783 91
487 819
376 359
855 634
439 255
1 916
776 121
297 34
500 200
972 384
294 101
895 760
272 158
302 575
75 151
956 360
906 625
851 83
873 975
681 492
487 551
258 235
92 216
547 326
614 60
910 688
803 830
809 580
186 860
665 56
634 62
740 483
954 868
286 332
952 756
906 93
273 488...

Output:
885 466 1
466 770 1
770 73 1
73 220 1
770 493 3
770 550 4
550 498 1
770 71 6
71 814 1
814 375 1
375 503 1
503 449 1
449 64 1
449 828 2
828 340 1
503 932 5
932 350 1
350 10 1
10 705 1
814 450 11
450 180 1
770 672 20
770 801 21
801 14 1
14 540 1
540 122 1
122 89 1
14 784 4
784 408 1
784 421 2
421 454 1
454 203 1
421 996 3
784 523 6
523 420 1
523 178 2
784 257 9
784 586 10
586 538 1
784 24 12
801 791 18
466 437 41
437 806 1
806 61 1
61 240 1
240 701 1
240 519 2
2...

Output:
1 916 334
3 124 1670
3 202 334
4 518 1
6 463 1670
6 865 334
6 943 668
7 237 334
7 792 1002
8 942 334
10 705 334
12 282 8
12 674 1
12 681 11
12 896 6
13 883 334
14 540 334
14 784 1336
15 16 334
17 471 4
17 927 1
18 666 334
21 188 1
21 511 2
25 490 334
26 574 334
27 54 334
29 248 668
29 913 334
30 181 334
30 660 1336
30 778 1670
31 457 334
33 166 334
34 650 668
34 981 334
35 717 1
35 986 2
37 445 334
39 478 4
39 528 8
39 593 7
39 851 1
40 238 1
41 754 334
42 80 33...

Output:
1 839 102
2 212 72
3 704 64
4 510 8
5 289 54
6 781 21978
7 48 12654
8 572 171
9 713 41292
10 350 24642
11 442 10
12 644 110
13 921 29
14 801 15984
15 677 134
16 15 56
17 482 47
18 928 40
19 725 92
20 258 91
21 132 27
22 75 8658
23 261 86
24 784 39294
25 871 23310
26 222 3996
27 964 70
28 344 4
29 383 1998
30 403 29
31 297 37296
32 764 76590
33 806 8658
34 297 41958
35 132 28
36 226 58
37 663 105
38 609 33
39 873 25
40 561 43
41 901 35964
42 181 117
43 674 74
44 82...

Output:
466 885 1
770 466 1
73 770 1
220 73 1
493 770 3
550 770 4
498 550 1
71 770 6
814 71 1
375 814 1
503 375 1
449 503 1
64 449 1
828 449 2
340 828 1
932 503 5
350 932 1
10 350 1
705 10 1
450 814 11
180 450 1
672 770 20
801 770 21
14 801 1
540 14 1
122 540 1
89 122 1
784 14 4
408 784 1
421 784 2
454 421 1
203 454 1
996 421 3
523 784 6
420 523 1
178 523 2
257 784 9
586 784 10
538 586 1
24 784 12
791 801 18
437 466 41
806 437 1
61 806 1
240 61 1
701 240 1
519 240 2
1...

Input:
1000
705 980
591 848
16 907
855 588
193 405
453 642
135 104
337 787
200 134
161 264
332 171
839 772
110 48
427 870
736 111
125 448
162 724
619 685
646 581
987 931
875 465
626 378
202 694
346 77
314 78
207 281
731 752
908 824
881 116
338 837
203 37
80 23
281 287
795 861
495 82
509 688
82 726
173 677
193 238
591 427
372 336
913 547
594 792
547 749
943 214
162 353
252 289
716 55
457 834
6 789
509 198
121 533
127 39
477 344
408 713
381 358
383 415
262 3...

Output:
693 224 1
710 693 1
479 710 1
24 693 3
902 24 1
651 902 1
768 24 3
501 768 1
337 501 1
787 337 1
736 501 3
111 736 1
654 501 5
386 654 1
11 386 1
808 654 3
223 808 1
266 768 11
757 24 15
819 757 1
338 24 17
837 338 1
75 338 2
596 75 1
301 596 1
667 301 1
507 301 2
395 75 5
730 338 8
613 730 1
684 24 27
788 684 1
845 684 2
978 845 1
227 978 1
117 227 1
742 845 4
661 693 37
670 661 1
462 670 1
718 462 1
629 661 4
786 629 1
741 629 2
425 661 7
181 425 1
352 181 1
...

Output:
1 183 334
1 729 668
4 990 334
5 204 334
6 789 1
7 56 334
7 85 668
7 576 1336
7 780 1002
7 851 1670
8 60 334
12 362 334
14 18 334
14 536 3006
14 835 4342
15 359 5
15 439 1
16 515 77154
16 666 35738
16 875 54442
16 907 334
17 531 334
18 761 668
18 785 334
19 560 334
19 897 1336
20 326 334
22 712 334
24 338 5678
24 684 9018
24 757 5010
24 768 1002
24 902 334
25 220 334
26 294 334
26 873 1002
26 885 1336
27 568 2338
27 585 668
27 695 1002
27 767 334
27 855 6012
27 926 ...

Output:
1 731 6660
2 968 41
3 49 85
4 281 189
5 714 5994
6 848 49
7 567 57942
8 389 71928
9 155 59274
10 637 118
11 386 46620
12 339 4662
13 447 49284
14 875 26640
15 505 87
16 693 1998
17 846 179
18 14 43290
19 509 78588
20 138 28
21 966 18
22 299 103
23 80 104
24 693 1332
25 408 96
26 58 33300
27 693 2664
28 680 41958
29 817 136
30 795 110
31 624 24
32 656 34
33 895 48
34 166 159
35 692 161
36 846 178
37 203 73
38 713 94
39 127 170
40 951 87
41 368 78
42 977 31
43 410 18...

Output:
224 693 1
693 710 1
710 479 1
693 24 3
24 902 1
902 651 1
24 768 3
768 501 1
501 337 1
337 787 1
501 736 3
736 111 1
501 654 5
654 386 1
386 11 1
654 808 3
808 223 1
768 266 11
24 757 15
757 819 1
24 338 17
338 837 1
338 75 2
75 596 1
596 301 1
301 667 1
301 507 2
75 395 5
338 730 8
730 613 1
24 684 27
684 788 1
684 845 2
845 978 1
978 227 1
227 117 1
845 742 4
693 661 37
661 670 1
670 462 1
462 718 1
661 629 4
629 786 1
629 741 2
661 425 7
425 181 1
181 352 1
...

Input:
1000
742 818
716 305
707 337
512 891
606 622
705 974
861 896
958 151
313 762
256 871
538 859
104 339
559 642
118 293
954 476
269 388
398 194
133 467
197 202
976 401
726 91
654 348
119 962
826 468
902 112
228 941
31 39
882 790
291 489
439 844
934 1000
44 907
836 360
622 10
318 446
74 747
679 236
218 686
858 128
626 528
831 395
30 353
617 910
118 673
33 829
246 159
152 15
193 46
693 478
118 927
30 386
614 453
870 597
608 580
121 626
71 913
871 181
33 ...

Output:
1 10 131
2 380 48
3 909 81
4 538 13320
5 570 31302
6 304 46620
7 377 135
8 787 87
9 933 1
10 622 159
11 178 12654
12 742 244
13 922 18
14 683 46620
15 152 204
16 808 49950
17 754 13320
18 465 25974
19 804 63270
20 452 13986
21 663 85
22 398 33966
23 569 195
24 946 29
25 205 26640
26 280 44622
27 593 132
28 835 33300
29 276 6
30 988 12
31 47 52
32 166 119
33 313 103
34 345 129
35 88 6
36 352 3996
37 695 1998
38 609 39960
39 31 37
40 104 41
41 587 97
42 323 90
43 264...

Output:
211 933 1
695 211 1
156 695 1
780 156 1
522 780 1
813 780 2
651 813 1
906 813 2
316 906 1
775 780 6
869 775 1
442 775 2
808 780 9
409 808 1
290 409 1
638 808 3
139 638 1
613 139 1
535 638 3
205 535 1
217 205 1
694 205 2
25 205 3
968 535 5
475 808 12
795 475 1
864 795 1
676 795 2
709 676 1
697 709 1
260 795 5
214 795 6
248 214 1
480 795 8
892 795 9
590 475 11
358 590 1
585 475 13
853 585 1
243 853 1
723 808 28
400 723 1
710 400 1
885 723 3
16 808 32
346 16 1
744...

Output:
933 211 1
211 695 1
695 156 1
156 780 1
780 522 1
780 813 2
813 651 1
813 906 2
906 316 1
780 775 6
775 869 1
775 442 2
780 808 9
808 409 1
409 290 1
808 638 3
638 139 1
139 613 1
638 535 3
535 205 1
205 217 1
205 694 2
205 25 3
535 968 5
808 475 12
475 795 1
795 864 1
795 676 2
676 709 1
709 697 1
795 260 5
795 214 6
214 248 1
795 480 8
795 892 9
475 590 11
590 358 1
475 585 13
585 853 1
853 243 1
808 723 28
723 400 1
400 710 1
723 885 3
808 16 32
16 346 1
808...

Output:
2 206 1
3 188 1
3 193 14
3 702 10
5 656 334
7 423 334
9 104 20708
9 264 85504
9 389 108550
9 441 85170
9 684 334
9 988 90180
10 1 668
10 794 334
16 346 334
19 76 334
20 216 334
21 533 1
22 739 334
26 602 334
30 353 334
30 386 1336
30 610 4342
30 991 4676
31 39 334
33 231 19
33 670 6
33 705 2
33 829 1
33 914 25
33 986 20
34 444 334
36 299 334
37 150 334
37 349 1002
37 674 668
40 69 334
44 643 1002
44 907 334
45 362 334
47 31 1002
47 412 334
48 470 1670
48 678 3674
...


The only line of input contains two integers $$$n$$$ and $$$k$$$ ($$$3 \le n \le 10^{6}$$$, $$$1 \le k \le n-2$$$), the maximum number of sides of a polygon and the number of polygons to construct, respectively.

NoteIn the first example, we have $$$n = 6$$$ and $$$k = 2$$$. So, we have $$$4$$$ polygons with number of sides $$$3$$$, $$$4$$$, $$$5$$$ and $$$6$$$ to choose from and if we choose the triangle and the hexagon, then we can arrange them as shown in the picture in the statement.Hence, the minimum number of points required on the circle is $$$6$$$, which is also the minimum overall possible sets.

Print a single integer — the minimum number of points required for $$$k$$$ polygons.

You are given two integers $$$n$$$ and $$$k$$$.You need to construct $$$k$$$ regular polygons having same circumcircle, with distinct number of sides $$$l$$$ between $$$3$$$ and $$$n$$$.   Illustration for the first example. You can rotate them to minimize the total number of distinct points on the circle. Find the minimum number of such points.

Input: 6 2

Output: 6

Input: 200 50

Output: 708

Input: 200000 4000

Output: 4121264

Input: 80 67

Output: 1312

Input: 68 37

Output: 408

Input: 54 47

Output: 678

Input: 8544 2914

Output: 2187680

Input: 773361 408936

Output: 43051232976

Input: 873734 740943

Output: 148773569438

Input: 1000000 999998

Output: 303963552392

Input: 3 1

Output: 3

Input: 4 1

Output: 3

Input: 4 2

Output: 6

Input: 52 35

Output: 374

Input: 89 66

Output: 1252

Input: 76 64

Output: 1214

Input: 69 16

Output: 88

Input: 55 38

Output: 434

Input: 94 17

Output: 98

Input: 80 29

Output: 260

Input: 8441 6435

Output: 10945924

Input: 5892 5197

Output: 7448978

Input: 6818 2738

Output: 1931900

Input: 7744 4958

Output: 6370120

Input: 8670 8134

Output: 18926772

Input: 6121 238

Output: 14884

Input: 5982 1353

Output: 472868

Input: 8434 1533

Output: 606468

Input: 7835 6193

Output: 10210232

Input: 5286 5078

Output: 7523824

Input: 6212 1131

Output: 330580

Input: 8664 7467

Output: 15213874

Input: 8064 2765

Output: 1970404

Input: 5515 282

Output: 20840

Input: 866405 45817

Output: 540081560

Input: 966778 950550

Output: 269300901418

Input: 620840 281294

Output: 20357048276

Input: 679920 256665

Output: 16947428356

Input: 821587 272623

Output: 19120339940

Input: 963254 219217

Output: 12362992364

Input: 563626 29170

Output: 218931416

Input: 663999 623250

Output: 111074438298

Input: 764372 634018

Output: 108163329976

Input: 906039 381234

Output: 37390107252

Input: 506411 108795

Output: 3045114792

Input: 606784 173721

Output: 7763887336

Input: 760847 735109

Output: 158288794300

Input: 1000000 256389

Output: 16910984240


The first line contains an integer $$$n$$$ ($$$1 \le n \le 100$$$), where $$$n$$$ is the length of the given sequence. The second line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 100$$$). These numbers can contain duplicates.

NoteIn the first example, one possible way to paint the elements in $$$3$$$ colors is:  paint in the first color the elements: $$$a_1=10$$$ and $$$a_4=5$$$,  paint in the second color the element $$$a_3=3$$$,  paint in the third color the elements: $$$a_2=2$$$, $$$a_5=4$$$ and $$$a_6=2$$$. In the second example, you can use one color to paint all the elements.In the third example, one possible way to paint the elements in $$$4$$$ colors is:  paint in the first color the elements: $$$a_4=4$$$, $$$a_6=2$$$ and $$$a_7=2$$$,  paint in the second color the elements: $$$a_2=6$$$, $$$a_5=3$$$ and $$$a_8=3$$$,  paint in the third color the element $$$a_3=5$$$,  paint in the fourth color the element $$$a_1=7$$$.

Print the minimal number of colors to paint all the given numbers in a valid way.

You are given a sequence of integers $$$a_1, a_2, \dots, a_n$$$. You need to paint elements in colors, so that:   If we consider any color, all elements of this color must be divisible by the minimal element of this color.  The number of used colors must be minimized. For example, it's fine to paint elements $$$[40, 10, 60]$$$ in a single color, because they are all divisible by $$$10$$$. You can use any color an arbitrary amount of times (in particular, it is allowed to use a color only once). The elements painted in one color do not need to be consecutive.For example, if $$$a=[6, 2, 3, 4, 12]$$$ then two colors are required: let's paint $$$6$$$, $$$3$$$ and $$$12$$$ in the first color ($$$6$$$, $$$3$$$ and $$$12$$$ are divisible by $$$3$$$) and paint $$$2$$$ and $$$4$$$ in the second color ($$$2$$$ and $$$4$$$ are divisible by $$$2$$$). For example, if $$$a=[10, 7, 15]$$$ then $$$3$$$ colors are required (we can simply paint each element in an unique color).

Input:
6
10 2 3 5 4 2

Output: 3

Input:
4
100 100 100 100

Output: 1

Input:
8
7 6 5 4 3 2 2 3

Output: 4

Input:
1
1

Output: 1

Input:
1
100

Output: 1

Input:
100
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97

Output: 25

Input:
100
17 23 71 25 50 71 85 46 78 72 89 26 23 70 40 59 23 43 86 81 70 89 92 98 85 88 16 10 26 91 61 58 23 13 75 39 48 15 73 79 59 29 48 32 45 44 25 37 58 54 45 67 27 77 20 64 95 41 80 53 69 24 38 97 59 94 50 88 92 47 95 31 66 48 48 56 37 76 42 74 55 34 43 79 65 82 70 52 48 56 36 17 14 65 77 81 88 18 33 40

Output: 32

Input:
100
89 38 63 73 77 4 99 74 30 5 69 57 97 37 88 71 36 59 19 63 46 20 33 58 61 98 100 31 33 53 99 96 34 17 44 95 54 52 22 77 67 88 20 88 26 43 12 23 96 94 14 7 57 86 56 54 32 8 3 43 97 56 74 22 5 100 12 60 93 12 44 68 31 63 7 71 21 29 19 38 50 47 97 43 50 59 88 40 51 61 20 68 32 66 70 48 19 55 91 53

Output: 22

Input:
100
9 9 72 55 14 8 55 58 35 67 3 18 73 92 41 49 15 60 18 66 9 26 97 47 43 88 71 97 19 34 48 96 79 53 8 24 69 49 12 23 77 12 21 88 66 9 29 13 61 69 54 77 41 13 4 68 37 74 7 6 29 76 55 72 89 4 78 27 29 82 18 83 12 4 32 69 89 85 66 13 92 54 38 5 26 56 17 55 29 4 17 39 29 94 3 67 85 98 21 14

Output: 22

Input:
100
83 74 53 90 85 65 55 74 86 64 69 70 66 57 93 90 97 66 62 52 76 80 70 65 79 59 88 65 76 70 94 57 53 83 91 69 59 80 82 53 97 91 75 74 77 70 51 58 56 79 72 79 60 91 60 84 75 92 88 93 96 100 56 77 55 56 69 80 100 78 68 69 90 99 97 62 85 97 71 52 60 83 85 89 96 98 59 96 85 98 51 90 90 71 97 91 94 64 57 52

Output: 42

Input:
100
94 83 55 57 63 89 73 59 75 97 77 54 77 81 70 81 99 52 88 76 98 88 79 67 76 80 89 50 60 60 53 83 96 87 75 99 61 91 75 85 88 80 90 54 84 88 98 93 69 97 93 54 83 59 57 92 88 78 53 55 99 63 60 70 61 52 60 55 100 85 80 58 53 97 59 61 50 90 75 85 86 63 91 96 67 68 86 96 79 98 51 83 82 92 65 100 76 83 57 100

Output: 42

Input:
100
70 89 84 63 91 63 75 56 87 98 93 58 95 67 57 90 56 100 84 82 80 64 71 58 67 62 52 81 92 74 79 83 100 72 70 61 97 86 91 93 62 86 88 66 55 59 65 59 72 80 68 95 53 82 54 85 81 85 52 65 96 94 66 74 68 64 73 99 97 99 78 69 79 90 54 51 87 96 77 78 77 76 98 53 71 76 55 61 89 94 88 57 83 51 69 60 75 60 92 73

Output: 50

Input:
10
7 70 8 9 8 9 35 1 99 27

Output: 1

Input:
5
40 80 40 40 40

Output: 1

Input:
17
13 63 82 53 83 30 7 8 21 61 74 41 11 54 71 53 66

Output: 12

Input:
10
8 5 5 10 8 10 8 9 7 9

Output: 4

Input:
20
6 8 14 8 9 4 7 9 7 6 9 10 14 14 11 7 12 6 11 6

Output: 6

Input:
15
5 4 2 6 9 8 2 8 6 4 4 6 5 10 6

Output: 3

Input:
26
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 1

Output: 1

Input:
2
1 1

Output: 1

Input:
2
1 2

Output: 1


The first line contains one integer $$$n$$$ ($$$1 \leq n \leq 7000$$$) — the number of students interested in the camp. The second line contains $$$n$$$ integers. The $$$i$$$-th of them is $$$a_i$$$ ($$$0 \leq a_i < 2^{60}$$$). The third line contains $$$n$$$ integers. The $$$i$$$-th of them is $$$b_i$$$ ($$$1 \leq b_i \leq 10^9$$$).

NoteIn the first sample test, it's optimal to send the first, the second and the third student to the camp. It's also possible to send only the first and the third student, but they'd have a lower sum of $$$b_i$$$.In the second test, in each group of at least two students someone will always think that he is better than everyone else in the subset.

Output one integer which denotes the maximum sum of $$$b_i$$$ over the students in a group of students which can work together calmly. If no group of at least two students can work together calmly, print 0.

Marcin is a coach in his university. There are $$$n$$$ students who want to attend a training camp. Marcin is a smart coach, so he wants to send only the students that can work calmly with each other.Let's focus on the students. They are indexed with integers from $$$1$$$ to $$$n$$$. Each of them can be described with two integers $$$a_i$$$ and $$$b_i$$$; $$$b_i$$$ is equal to the skill level of the $$$i$$$-th student (the higher, the better). Also, there are $$$60$$$ known algorithms, which are numbered with integers from $$$0$$$ to $$$59$$$. If the $$$i$$$-th student knows the $$$j$$$-th algorithm, then the $$$j$$$-th bit ($$$2^j$$$) is set in the binary representation of $$$a_i$$$. Otherwise, this bit is not set.Student $$$x$$$ thinks that he is better than student $$$y$$$ if and only if $$$x$$$ knows some algorithm which $$$y$$$ doesn't know. Note that two students can think that they are better than each other. A group of students can work together calmly if no student in this group thinks that he is better than everyone else in this group.Marcin wants to send a group of at least two students which will work together calmly and will have the maximum possible sum of the skill levels. What is this sum?

Input:
4
3 2 3 6
2 8 5 10

Output: 15

Input:
3
1 2 3
1 2 3

Output: 0

Input:
1
0
1

Output: 0

Input:
2
0 0
69 6969

Output: 7038

Input:
10
3 3 5 5 6 6 1 2 4 7
1 1 1 1 1 1 1 1 1 1

Output: 9

Input:
10
206158430208 206162624513 68719476737 137506062337 206162624513 4194305 68719476737 206225539072 137443147777 68719476736
202243898 470292528 170057449 290025540 127995253 514454151 607963029 768676450 611202521 68834463

Output: 2773043292

Input:
100
704911647744 17180009473 17179878400 37520834306048 37950867898368 2336999079937 35201551967232 2354178950145 17716749313 2886754903040 687194776576 2765958946816 35338990911488 2199560257536 137439093760 37933688161280 35888746865665 2199023387649 37933151167489 2886755025921 35339527914497 567472686080 567472555009 35734664904705 704374776832 687194906624 2749316080640 35202088828929 35338990920705 37538014299136 37400575345665 566935692288 35339527790592 137439092737 38071126991872 17716871168 5368...

Output: 10068780298

Input:
700
51005873131902650 1025713774629604343 703216596437289234 610225437545351555 365433803774704394 565993446550925372 602436658326849968 248682276445332589 1060681239981621291 824791796017586105 715531190992046653 284724871582514572 266478498862875005 398617754036218313 9684371389972578 1103749757215508053 244950785021770457 49023897032761109 525026206156603974 552115471297374835 400669342366083013 758911569030840480 107428763273056774 1139899929378869965 91329013407903913 52479822241024794 15528454951957...

Output: 357083482611

Input:
1000
1073742112 4503875847471492 5066894251934852 4503599895807124 5066894654570640 581527645750052148 581527645615833136 5066824592934160 580964353004552580 581527646689559856 576461027583984820 576461028389306772 577024047196405940 577024046927987876 580964353407206576 581527576896356500 275951666176 581527645884253588 581527371677450240 577024047196406064 276220084352 576460822365078944 5066824727135264 563018672914452 345073795348 402671008 576460822499311664 563225905086736 577024047330623908 4503669...

Output: 146604368759

Input:
3000
993549146546148037 594618917401542816 660907703772381187 97601793974996829 212894751188212475 72130453863142530 294540613180989750 503327348837479139 1152920608015644671 950089612464118255 10491781486215464 1150662264725290363 147495362773729538 845676316398717283 970636326919654651 864480012220743167 397999820678831834 914397099756025210 1148702673845116837 1062770330041949758 705613904073593305 878137491298789758 304561102162985779 1138581590105062273 76980835159653675 464479282957936738 3704568389...

Output: 988696012904

Input:
3000
17593528365064 10133100671696904 9009398412259584 9009402975793416 9024796977434656 2200398991656 10150691381358880 10152894800113928 10135298621210920 9009403680391208 1143493334565128 2200533209088 17592488042760 1128104298979584 17596648828968 17597957542152 1145695545331752 9024791474511880 5670838568 10133099329356064 1342222376 9009398546563080 1128100406657064 10135298218405920 1143496555638784 10135303587115304 1107341600 1128100138193184 1145692357697792 1125904336162856 10135303721463808 11...

Output: 729001705307

Input:
7000
1125986410299396 1129217769080868 36353170196267520 36303815051904 88650942592 36030996646330528 36068465404019200 37161296679930528 36314672189669380 1408491575050916 1133667355200164 281546447784452 37476925303816836 39585170196512 37441672212119588 1415157901167104 1166650556678308 37471358959093888 37475823107703328 36349854951145604 37197646598769280 36071695152450176 36348823622126116 37161379962159264 37478022600720900 1415157364295716 1445928724728320 36351042576845444 37477972738836512 28595...

Output: 1447756183808

Input:
6997
583218370095227904 577604244401037328 23643915224358920 666550337041466504 19160089630220304 24773113670415384 7901090557867032 94578907893867520 4503599627899024 2252916509515776 596746741836427408 576464068018177032 579858243237974032 666550339184628880 650789954548663448 1146807812101256 648539256394744848 601249244099260424 656399662869647512 5649292891656336 582091370676761744 667677338607423496 78833886352388104 649661857762129048 594476269652021384 19140317743944728 666532746998981656 22540009...

Output: 45316954001

Input:
7000
887098671863086630 437412122533589152 1007064394797743913 20839637003304992 144967329998316993 633972193843695235 633687684712297100 1078603314357690171 450068612004163952 223401641222007687 354558744946231328 937373486296401921 36312513985421576 304886222596465647 1079882449114391325 1037687183524257191 25717687668736875 122723446466545664 1124912766516299593 1060510671153980009 1043241519439871448 908692882435023313 1053418927455595003 87384686242323699 1150660898944187519 619162994908460164 529011...

Output: 2352862518526

Input:
6997
1091810937771591111 437879308180268074 400046452433682946 51340347231666496 748403613875867191 609876027342622316 852886384252009966 846637146283028955 191460768205086872 140035522570062436 302013379185266844 873021660883580959 11954017150521165 710741286927096033 676709214016421326 1113369801045523276 78258975094198868 481994387027575847 532809737535007344 360459224948300194 1077641830362400488 177118222397769939 1114335911026238189 589192718175588422 1065419067262740911 273380156860486541 340108171...

Output: 2602684126028

Input:
7000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

Output: 3499724900353

Input:
7000
857934498136189181 857934498136189181 857934498136189181 37799698078416916 857934498136189181 857934498136189181 857934498136189181 819895376150849729 857934498136189181 857934498136189181 857934498136189181 857934498136189181 857934498136189181 811204291340535816 857934498136189181 857934498136189181 857326604424169693 667993309282672744 820544087893592080 857934498136189181 857934498136189181 216978453563449497 857934498136189181 857934498136189181 757821622040404129 271130776843634896 100124277870...

Output: 3527557401725

Input:
7000
979079844327171813 835976751295925276 482082287622490956 751889085122709061 1000508774786754835 877042723238534724 521284712204578272 298169970027666639 165245246222515030 836528672497853355 45301345778862032 123251353804107367 42969115743213283 703277540176695260 1116753405635464529 911534225867382137 761315788446335984 402540133666342876 1069339841378298038 551477351373075375 659047192339785171 508094745573937351 1006167826371010675 127435933946354868 958103514494986191 1032062057925007916 85429393...

Output: 1784794871552

Input:
2
0 1
1 1

Output: 0

Input:
6997
180143989524025353 36028810038087849 287915905032 180144273555980329 36029072041594913 144115472225288192 144115467265523880 144115472239956105 13438554121 36028806307266593 144115196818882600 180144264276103169 180144273411297416 144115476526551200 36028802001813641 545280032 144115462955876353 36029076730826912 144115201631866913 144115192515526689 279726526624 144115467408117897 36029076328153217 180143989943439528 36029072039497856 36029085463351457 180144273539219625 180143997981835304 144115201...

Output: 2672531147024

Input:
7000
306244792931619072 288231475730587648 17592211247232 18015515226185992 288231493984096384 288231495074742536 2164396416 3296899072 306262387248369792 18033107454132608 306262370093641984 18015498029506944 288230394413854728 18015501326393344 18033109610143880 288230395495882880 17594333561224 18033092379811968 19335913600 17196790016 18014417853776256 17612679426056 306245894641160584 18032009041547520 18712107299072 288230396561228168 288231476745507072 2147627400 306262366922866696 2882490689400343...

Output: 2204026890660

Input:
7000
735565191560303617 743375413493893409 2322739790086145 588001930723205377 726205439914556672 19211216916976641 735283162531900448 597079498722121761 596727637822539777 590042624306063360 749920398191639552 31807381039494177 21462621593537569 14988563984682272 577868835857114401 605804677539966977 732961530845474816 747879700316692736 605805227295769601 737465130472833056 605805072676423681 151996642044159233 179018089483474209 2251816995139872 29344333258961152 20266219798007072 4855464823625984 5855...

Output: 4508825672

Input:
7000
333873372111113024 562950566118976 297237653353464384 325675421459089152 36917202996495104 54685379576529216 325524800211776 54685318919554816 307379471265366784 65091166320004160 64176363946705216 289145170398806528 325209228571839040 342906967729112384 65135068863073856 45950799084258880 46452236046305536 46267518125344000 64457769708749888 334471506462573632 288265638379847680 56119073515308608 9614207095146304 288617413475566592 46443380321092160 324936480990497280 343232423164641856 120514269230...

Output: 3569283882

Input:
6999
271343226238009714 19141612747098224 36029003177476160 180161578693820450 144115256806426656 216172997936496738 37156003739879714 1127112169818416 90089584810541392 162147214272561186 252219344537845778 180145161995026738 126119558650087744 270234876583100786 217317452372511042 90090692913727746 108086528832981296 55188028993830960 145259995510882370 144116537032261696 72075426743206176 144132952329027890 73202332018411520 91199206792956242 199301980194146624 253345287049840976 18033228998264946 1801...

Output: 0

Input:
6999
292734698992058565 941252871890567365 288230416031154836 72066945280802832 364801092343611905 648527833937887445 869204250173522432 869204113160700497 648527732637483585 941261122698756613 941252910530969797 864691816333607424 364800954861764676 288230964750975685 76570024684339281 288239315607126020 576461440766443653 869203525271830660 941253043688063573 576461440580977221 864700617275245072 4504189682745541 936749311629754384 364791711571919440 864691684142891025 936757660366193361 720665619387024...

Output: 0

Input:
6999
649661886501397028 648606376821657856 1144737642754564 600193844746691456 670034865748050304 18085897375854624 816349120566169728 239923345679590144 144151648330224036 145259891366433184 738679653548303264 170063723443298852 814061036063589124 220729210384458500 739735124597317924 797138452607931300 815204498116489252 798264172932113060 223051499478856064 816348978840383488 582213629362307332 162182599661196064 602374192948188036 601265774111752832 746577385457726244 745433737940078884 58098203862307...

Output: 0

Input:
6998
510178901525037570 180660209781069395 288878548277302866 290148007381980235 401133733221647379 144701860011856409 433924543141384794 150621622712276483 42512692853920280 293508652056215555 366697092411068499 42380747232007697 510474113082476096 256917384710475867 185023072977196099 289075362733277273 144904168004014088 252303909032088666 216344389416126017 506334532669851163 438331934558535744 546709699015905793 222097032721650712 325834843602028059 290222770678415888 432567197627896897 3974564182766...

Output: 0

Input:
6998
495145956486554518 670754297951481324 788059150981770178 964195857776041547 575983021297157052 230812478646353610 1036424843770345779 100583276118550372 368399654856529133 655363405710665822 927718280303640044 250944298381037054 760524738254703803 174357933049451253 287519384039421753 284823641000937417 557680838610154814 916581142755715090 331473124900191352 49674558142477815 350361602620535345 771962440731878497 301316286456132187 200231963348666439 818525512730138159 824460540780444931 41957566960...

Output: 0

Input:
50
126161263285108788 378846012245746538 1121685704262918369 825137520933395238 1038080854073265647 250928239631403586 6178776356287829 436991992600561526 6178776356287829 825137520933395238 812348895148377156 821743273088755316 275202424785772597 825137520933395238 574138505340319861 825137520933395238 861792039473431980 436991992600561526 275202424785772597 1033202241603360639 193346832298366919 828656542807358382 275202424785772597 144257052464972294 582639706900854133 235833019633757938 82174327308875...

Output: 16152467993

Input:
400
1074150314856853633 701670361381361894 513590568162887074 1066478094805791073 860648124927273760 15405447856980757 130448106308899871 1140482935437824460 177779269258547191 630577142811789313 672432522570858288 136359189302836303 45053904703851025 130448106308899871 457044074059667278 909663976099223591 838844339829830061 788731842419659093 1011897160870144452 579876763476730272 751935440102670465 963055486166253051 672432522570858288 111253651330928285 936449968557008684 839173988910246525 3829548532...

Output: 144562071568

Input:
6997
599893615124190282 232251882128140652 990699284112310004 572419580842125100 502206154352153942 465347819983893837 392033108891253834 351253139987683498 62578015567865998 189198811376868393 688320412589300027 78765240397418173 841888988099755454 814490941680110770 534819994248936062 1020130193520311742 320470797874374967 972773656907218783 9162711450517522 145244283725531118 227917755667536137 1038007936614898559 988432330328505078 645369409438914170 284711937734539087 115161301974166529 3729819220490...

Output: 1893348316801

Input:
7000
272483080491667500 454862144303789231 229569569970038667 1125548257852023381 439567867128379398 138665694516607098 30580649866898224 466002864370289977 739383477872147146 713988235410301301 509681011307526240 279223159582286766 346993196551426597 69097654418007130 1125477654372284377 11261533168345361 682245135820908746 123328097348187226 82825302001074312 1049140434073298979 462868769170322264 446038858837606206 1004209213250861974 581245972408189968 452895740195781664 359689693784027131 87715811784...

Output: 2626100064095

Input:
7000
510339857212720117 227954262633872315 1076280412585867003 1094373738650918903 615354614579265286 972788659051954306 1122238527618996151 256852108582131076 856040473576795931 725396047009431671 914507153192845774 577600409605376065 949355437174183186 924556514980745267 753659834226428496 1148377964511490811 579031005083553886 1057767969784194895 519194825062996963 1029890389323318880 975443130339477394 594983971145750723 175212738501640189 1018057807005459262 626773776755176357 197786694690498419 7979...

Output: 2459034131415

Input:
7000
571791534237358751 38289532516507936 1149217524609283325 901924697262643611 129611937246613454 671237241295757284 952016827030798655 1094158928649764607 707208541695767544 1122386842387566645 440020442951801615 295373637012038148 503493225391121904 642607838711062652 156131205185557 169750009360301589 240446258192341944 841608719806167002 416138313784367830 828621649503420151 11299554871935544 1996913419233807 413851227440855037 1137197447521058512 672554933490002670 1115766120345745022 1899476010051...

Output: 1907044869860

Input:
6999
1024073303489061364 18587287035380562 853291267611356136 611252503725288291 853186863834124280 565195139479043064 875686603187142219 922183708111483468 373888935730191914 108406357530793728 1080817706266779639 1129972497843453933 471732938023911171 252943006155294354 1130403506468928499 392866263951742107 749371657666914292 173786392457151873 18304875740031432 521571446424304848 972860445669373953 424062631216026145 1012731050390632758 929757204071773223 270706533802511850 1145952563136296895 8466370...

Output: 2158264058576

Input:
7000
681857526284895478 1011077112182959529 288285352272208001 62144738740058142 855683619891436505 325133919636513338 89457799803826536 483763517934741186 791777889421523383 1030701924109588228 866662003058618400 630458797958690687 245162861681632748 795750062460661712 1044177591437946217 328546941782327278 450736551375299684 1074403505553245925 737589240437152151 1130951371477449 451886686629117587 422767644326682303 713304193821462420 792633464601312895 16773835492330121 242420886494682871 125514730222...

Output: 1777881644720

Input:
30
294405360237677428 294405360237677428 598044474179569322 526746889070111334 113267808165152746 876958326340343712 284187594537683456 598044474179569322 294405360237677428 962280885497219473 373756197545107498 876958326340343712 526746889070111334 533841663428653225 332617636124369256 1132337959601548534 1103348406812797543 284187594537683456 29416368861638792 936963433589214258 962280885497219473 936963433589214258 959824516599381374 113267808165152746 533841663428653225 294405360237677428 112473428425...

Output: 13809836896

Input:
3000
1102582025052825912 634531467793336688 911566087762312194 289645632981732809 434616234975851828 686402500520366627 15205285418242073 883963698651532278 324154161784682804 45319680730071099 114407245143092432 349019873759539925 821555724339429275 1006810911579643886 212815099400435332 365005443980820628 106783985169846207 70382390973418441 233342787226168106 187847808736285128 48428576100114110 250704236987335317 1130332983039498191 234187524230087687 949396989229648975 767750217136812389 502511692223...

Output: 897936897059

Input:
7000
1105189349005145454 201323701617557439 234591835536018496 903087145137774582 995160263588011967 581000637963045412 1069192893267687267 653618897561078459 1120149324684496537 1022604035659651373 346114518747235806 882849983929942272 678278143411089298 453552390048817274 991962145778822438 1112278113572093694 104963139231757574 711083383983368516 1139753087729646204 635056734494595244 252288506854365832 726207708084113413 576429959264861343 1124975903953123567 589572169225056539 450892533399991999 6762...

Output: 2586823443500

Input:
7000
576478447856782338 771127477022729989 140972033578008493 561043338108430300 448152439900805202 161460866966876299 26654210941972169 108693477594783370 572366528373589342 1026749006227700685 884931494714277932 1148445321072379285 235884827654489669 999799112373108031 206622405581654046 1080808107903207919 1043706993143969759 577876972229904449 971334401423665111 693563260060677294 389631685077940141 1080643868577216878 578717087669682945 295598945242997802 313319170669051028 864618121862823903 6085746...

Output: 1680458771837

Input:
7000
1036894966352521285 10140140777390593 121282172049629482 528731901035341574 119115332069682002 211450099147609244 1027868781423139618 1051866072286471132 1063784244048538082 153819305339643006 784425029012624865 41589011192975942 792366226834026836 393633469125105808 915931128658506824 270549659314529286 612487814137736926 856721178498154399 7809987642332033 272902106845587443 346201555616866515 659755353027581858 346012548599559718 569529429899866734 620705978920137472 308760904044445825 30990074940...

Output: 2960679594209

Input:
6999
266530278943858034 521484845255297356 529332023651249573 503465672863564534 574672522039420786 212609108349732094 56664320269555142 612564207814595432 305261791559111997 270774831671826177 149616390560269180 796769695451343584 94506534046870529 901189328340802661 195724017279031997 586075423540011749 663097353434394252 619444504019013902 352629276757179431 133451475715037869 421118389870503315 741824922829165040 490994117303748855 825769604872847590 116464667864820296 469269155588965628 2646896842532...

Output: 3498117328014

Input:
6999
357524567188940136 473316753975180296 109481615111237855 697359271533007482 512344632509006754 196895994042650832 370177809407949916 216366298442263752 357806326755363412 1138742216851516567 341281870747302161 373856795590264414 33036757798916059 338614954850885804 913706108391842234 319916043488201670 615403530034873378 445477157434115537 1144749933414840991 348530189221003275 437967308174149779 767068760972053673 22827104790008834 124610122408033030 221324703243489405 682994022446953477 10748691948...

Output: 3001127523504

Input:
6999
304130082944960983 877780645486619114 1141632945543480504 206566898775613433 721515778410401166 696852867565223927 577164458065922873 946965482249126436 220223290721588517 651350827143055392 178528043122674319 653308103269294593 783414659308773239 1103861295630168959 1152358519018388159 702790794875483879 568475494784784599 736336843549670911 270213357227736414 985529238088352319 425398023962091698 34213341596346137 1076350926438006647 972732885942729725 653097830712378372 1072892172376478756 6938376...

Output: 1908619188750

Input:
7000
1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 1152921504606846975 11529...

Output: 3485321616733

Input:
7000
677917446792440714 131243794510410566 948006613834985171 534063265909192013 736870462662897302 880682024840414361 181058921111592523 807368393411765471 1021971358234486534 485606682279695588 784992166916032789 144016544597255421 681223484327304073 996340254943761778 655879162241921284 219899794274362124 386689210324124006 526252578559102594 709695810266157474 111414879455354641 116198792224043435 677917446792440714 770879716692094021 717135703631615702 368514150257664043 274907010616891959 4451786390...

Output: 3497417390450

Input:
7000
871897332255951232 65833281553698241 56782085706565549 455225446668633337 18163937916683432 147695354050642824 646259007842881328 585696672623233320 1026152349884499728 339450185946646860 58417074611145021 626329241014421285 8182586304875700 740595852803754889 741696599135980224 920363943296486080 922625637628200280 493876571401094905 447606809411716497 597881442628963325 67169182931240712 627876115059621988 865870929159179253 908120880168354404 1045997440154946192 1079477445740806589 165068581263000...

Output: 7000000000000

Input:
7000
371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 371919868631517904 37191986863...

Output: 3522191336063

Input:
7000
855678692526390239 1152916831681380351 855678692526390239 855678692526390239 855678692526390239 855678692526390239 855678692526390239 855678692526390239 257517927052638870 855678692526390239 855678692526390239 855678692526390239 855678692526390239 855678692526390239 855678692526390239 56615039949824526 855678692526390239 855678692526390239 864690573297056767 237602420988133842 1152916548214062079 855678692526390239 855678692526390239 864690299492892671 855678692526390239 1143909356440911839 597027360...

Output: 3261376906705

Input:
7000
998103873115481327 537203122375300817 421244938071598247 841267314861400782 523343470714624236 998103873115481327 707621533654189248 686974903975961734 998103873115481327 390099519500948174 998103873115481327 998103873115481327 998103873115481327 998103873115481327 998103873115481327 961872673301760094 327930775488995696 245685252947817150 998103873115481327 1139638441204056285 12798659248145018 781336516091358940 210449195017517598 998103873115481327 998103873115481327 907970247712063552 97996398418...

Output: 2663700833165

Input:
6998
1152921504606846975 576460752303423487 288230376151711743 144115188075855871 72057594037927935 36028797018963967 18014398509481983 9007199254740991 4503599627370495 2251799813685247 1125899906842623 562949953421311 281474976710655 140737488355327 70368744177663 35184372088831 17592186044415 8796093022207 4398046511103 2199023255551 1099511627775 549755813887 274877906943 137438953471 68719476735 34359738367 17179869183 8589934591 4294967295 2147483647 1073741823 536870911 268435455 134217727 67108863...

Output: 9277443