import"io"for Stdin for(i in 0..31){ var s=Stdin.readLine() System.print(s[s[1]==s[2]?1:4]) }