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