use std::io::*;fn main(){loop{let b=&mut[0;8];stdin().read(b);print!("{}",b[if b[1]==b[2]{2}else{4}]-48)}}