import os fn main(){for i:=32;i--;{a:=os.get_line() print(a[if a[1]==a[2]{2}else{4}])}}