fn main() { let mut input = String::new(); let _ = std::io::stdin().read_line(&mut input); let turn: usize = input.trim().parse().unwrap(); struct Input { estimate: Vec, answer: String, } let get_input = || { let mut input = String::new(); let _ = std::io::stdin().read_line(&mut input); let mut estimate: Vec = input.trim().split_whitespace().take(4).map(|n| n.parse().unwrap()).collect(); let answer: &str = input.trim().split_whitespace().nth(4).unwrap(); Input { estimate, answer: answer.to_string() } }; let mut checker = vec![0i32; 10]; for i in 0..turn { let input = get_input(); if input.answer == "YES" { for j in input.estimate { checker[j] += 1; } } else { for j in input.estimate { checker[j] -= 1; } } } let result = checker.iter().enumerate().max_by(|x, y| x.1.cmp(y.1)).unwrap(); println!("{}", result.0); }