Result

AC

Duration

4662ms

Code [DL]

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

stdin

485 849
842 499
818 116
683 543
988 275
791 887
589 942
376 776
979 228
522 126
744 698
968 864
385 484
373 334
297 717
219 236
932 723
576 967
511 122
977 771
249 343
436 369
631 137
187 877
641 652
899 699
611 663
447 772
439 317
399 778
988 887
788 876

stdout

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

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)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)
	   code:main(code.bal:1)

strace