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