Result

AC

Duration

4418ms

Code [DL]

import ballerina/io;public function main(){while(1>0){string s=io:readln("");io:println(s[s[1]==s[2]?2:4]);}}

stdin

611 452
783 865
934 434
844 753
659 295
352 528
355 572
924 735
899 992
237 335
921 823
334 439
426 235
921 162
966 998
671 621
417 779
822 441
935 995
622 229
213 132
336 687
724 448
844 343
488 659
727 375
399 191
799 939
416 113
213 889
829 828
763 478

stdout

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

stderr

Compiling source
	code.bal
Running executables

error: java.util.NoSuchElementException message=No line found
	at ballerina.io:readlnExtern(read.bal:30)
	   ballerina.io:readln(read.bal:27)
	   code:main(code.bal:1)

strace