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