macro_rules! read { ($x:ident, $v:expr, $idx:expr, $type:ty) => { let $x:$type = $v[$idx].clone().parse().unwrap(); }; ( $($x:ident:$t:ty),* ) => { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let input:Vec = s.trim() .split_whitespace() .map(|e| e.parse().ok().unwrap()) .collect(); let mut idx:i64 = -1; $( idx += 1; read!($x, input, idx as usize, $t); )* }; } fn main() { read!(sa:String, pa:String, _xa:String); read!(sb:String, pb:String, _xb:String); let pa:Vec = pa.chars().map(|x| x.to_string().parse().unwrap()).collect(); let pb:Vec = pb.chars().map(|x| x.to_string().parse().unwrap()).collect(); let ans = if pa.len() > pb.len() { sa } else if pa.len() < pb.len() { sb } else if pa > pb { sa } else if pa < pb { sb } else { "-1".to_string() }; println!("{}", ans); }