Result

AC

Duration

9890ms

Code [DL]

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

stdin

728 663
659 957
966 685
155 725
531 272
977 448
176 776
162 125
568 892
335 357
922 422
944 448
625 751
229 993
561 498
677 337
176 971
752 883
887 768
182 858
455 562
588 482
814 112
898 638
627 245
812 218
532 226
433 825
568 688
822 226
334 831
232 898

stdout

6
9
6
5
2
7
7
1
8
3
2
4
7
9
4
7
9
8
7
8
5
8
1
6
2
2
2
3
6
2
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)

strace