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