use std::collections::HashSet; fn read_vec() -> Vec { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().split_whitespace() .map(|e| e.parse().ok().unwrap()).collect() } fn main() { let xnm: Vec = read_vec(); let mr_max_items: HashSet = read_vec().into_iter().collect(); let max_valu_items: HashSet = read_vec().into_iter().collect(); let ans = if mr_max_items.contains(&xnm[0]) && max_valu_items.contains(&xnm[1]) { "MrMaxValu" } else if mr_max_items.contains(&xnm[0]) { "MrMax" } else if max_valu_items.contains(&xnm[0]) { "MaxValu" } else { "-1" }; println!("{}", ans); }