Result

AC

Duration

773ms

Code [DL]

for x in io.lines()do print(x:match("(%d) ?%1")or 1)end

stdin

891 617
973 688
478 733
714 442
532 583
275 751
522 313
488 686
569 151
248 843
785 993
152 369
551 532
664 642
496 633
684 546
511 142
441 347
766 693
343 221
197 993
488 886
145 543
911 779
844 995
739 998
499 681
144 449
413 396
941 948
536 334
288 585

stdout

1
8
3
4
1
1
2
8
1
8
9
1
5
6
6
1
1
4
6
2
9
8
5
1
4
9
9
4
3
1
3
8

stderr

strace

10    execve("/bin/sh", ["/bin/sh", "/root/script", "/volume/CODE"], 0x7ffe44d45290 /* 7 vars */) = 0
11    execve("/bin/cat", ["cat", "-"], 0x5617a14a5d30 /* 7 vars */ <unfinished ...>
12    execve("/usr/bin/lua5.3", ["/usr/bin/lua5.3", "/volume/CODE"], 0x5617a14a5d40 /* 7 vars */ <unfinished ...>
11    <... execve resumed>)             = 0
12    <... execve resumed>)             = 0
11    +++ exited with 0 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=11, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
12    +++ exited with 0 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=12, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
10    +++ exited with 0 +++