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
1180
3215
2104
2594
2236
4094
2372
2007
2629
3830
2450
2351
2370
2565
3485
3265
3619
3994
3608
3687
3311
3398
3856
3655
2134
3343
2432
3938
2874
3153
1381
3528
3400
3603
3771
2521
1877
2373
1500
2476
3754
3944
2448
3322
3231
2400
2679
3506
3194
3490
3285
1758
2379
4690
2554
3302
2620
3709
3539
3310
4004
2315
3208
2919
3158
3457
4019
2913
2525
3284
3224
3423
4064
3490
2305
3945
2673
3250
2903
2518
3183
2885
3784
2807
3286
2827
3434
2569
2993
2323
3791
2524
3401
3235
3419
1457
3371
3521
2438
3220
1630
3051
2356
2935
3865
3259
3187
2604
3030
3697
2317
3094
1389
2449
3975
3469
3158
3455
2357
2021
3443
2833
2423
3651
3974
4217
2641
2948
2363
3095
2472
2655
3968
2530
3035
1365
2013
3523
2707
2605
3526
1721
3401
3570
3746
2275
2151
3783
1417
3104
2451
3011
2946
2480
2158
2773
2417
3418
3063
3229
2702
2866
3544
2705
3150
3786
3308
3725
3595
2870
2872
2233
2225
3335
1322
2145
3321
2314
3267
3417
2990
3610
3346
3024
3283
2873
3197
1756
3083
1527
3313
2178
3695
2691
2221
2915
3410
3114
4457
2662
2471
3531

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
-