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