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