use std::io::*; use std::str::FromStr; fn read() -> T { let stdin = stdin(); let stdin = stdin.lock(); let token: String = stdin .bytes() .map(|c| c.expect("failed to read char") as char) .skip_while(|c| c.is_whitespace()) .take_while(|c| !c.is_whitespace()) .collect(); token.parse().ok().expect("failed to parse token") } fn main() { let x: u64 = read(); let n: u64 = read(); let m: u64 = read(); let a: Vec = (0..n).map(|_| read()).collect(); let b: Vec = (0..m).map(|_| read()).collect(); let in_a = (&a).into_iter().fold(false, |a, b| *b == x || a); let in_b = (&b).into_iter().fold(false, |a, b| *b == x || a); if in_a && in_b { println!("MrMaxValu"); } else if in_a { println!("MrMax"); } else if in_b { println!("MaxValu"); } else { println!("-1"); } }