Record Case Detail

Notes

This function is in beta test. Please help improve it in the issues here.

Stderr


        

Hints

Your answer may be identical to the JOJ answer in the first several lines.

However, you will still get Wrong Answer because the complete output may be longer and there might be errors in the future lines.

Please double check your code to solve this problem and try again.

Your Answer

1856
2461
2737
3481
1812
1539
2594
2034
2321
1301
2369
2617
2812
1872
1387
1485
1512
2661
2908
2403
2790
1540
3026
2862
2757
3808
1769
4695
3625
2313
4007
2874
3153
1793
2655
3287
1247
2288
2521
1724
2319
1500
3400
2375
1816
1193
2224
3231
3026
2672
2108
2390
3283
3285
1758
2379
4050
3068
2307
2482
2369
7033
2825
4001
2315
1359
2410
2767
3457
3806
5164
5432
3284
2598
2162
2764
2654
2305
3751
1754
2520
3149
3369
2909
1082
1486
2298
3286
8183
1410
2569
2993
2323
-9
1863
2236
1618
3054
1457
9999
3136
3460
1886
1630
-6
2234
2102
3865
2873
3683
3876
2228
2061
3940
3152
1577
2233
3394
2476
2767
2438
2357
2021
2888
1994
2423
2321
1526
2677
4950
1568
2564
3095
2558
3444
3657
4843
2345
3101
1823
5587
3470
1815
1863
1721
4515
5159
2544
2368
3155
3162
-2
3104
3259
3011
2155
2646
2397
2823
1073
1035
3063
3334
2457
3277
2490
2215
3320
1016
1205
3471
2774
2870
2850
2358
1630
1766
2314
2145
2684
1872
1131
3307
5166
3843
2449
3016
2547
2727
2007
2876
2798
1527
2670
2169
1810
2153
2221
3440
2491
3225
2650
2662
2471
1850
2261

JOJ Answer

1033
1128
973
936
987
1073
958
1079
1074
-21
-41
886
-72
937
914
-67
912
1073
938
-15
-27
913
989
929
941
-33
952
-84
1454
-19
1068
-84
983
910
983
1134
906
902
930
1132
947
1500
934
1070
899
-17
1114
1266
935
943
1727
1345
2113
1040
1308
992
988
950
1120
-70
1725
-21
2067
-33
1008
1286
-36
1402
2161
974
-51
-23
929
935
2047
1617
-26
933
959
-22
961
2345
967
938
971
-79
1392
2013
-29
1136
2240
1077
1091
-9
1241
-19
1256
2207
1348
1354
1035
925
947
958
-6
-18
1532
1308
1095
1029
1380
907
1289
1063
-32
-47
-23
1161
-14
1402
898
2101
-30
933
-60
968
-32
891
914
-42
939
-2
2226
1001
-37
-35
1438
1199
-45
-48
959
979
962
1863
1721
943
-33
1236
1217
1030
-27
-2
1135
-19
1106
1146
933
903
996
1073
949
-7
1162
1002
1721
-34
994
-87
-25
986
1016
-49
1291
1033
1425
1026
1766
1065
973
905
1002
912
1054
1054
1156
982
967
1057
967
1062
920
1052
905
914
1523
912
-21
1114
918
969
2079
927
904
1461
-23
932
901
924
926
1299
977
1002
-72
-26
1731
901
2588
991
1018
921
1145
1049
1094
1541
-32
-3
908
2016
2088
940
933
-33
1482
-