fn main() { let mut xx = String::new(); std::io::stdin().read_line(&mut xx).ok(); let xx: Vec<&str> = xx.split_whitespace().collect(); match xx[0].len().cmp(&xx[1].len()) { std::cmp::Ordering::Greater => println!("{}", xx[0]), std::cmp::Ordering::Less => println!("{}", xx[1]), std::cmp::Ordering::Equal => { for (a, b) in xx[0].chars().zip(xx[1].chars()) { match (a, b) { ('4', '7') => println!("{}", xx[0]), ('7', '4') => println!("{}", xx[1]), (a, b) if a > b => println!("{}", xx[0]), (a, b) if a < b => println!("{}", xx[1]), _ => continue, } return; } } } }