while s:=input():print(s[2] if s[1]==s[2] else s[4])