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