fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let a: Vec = itr.next().unwrap().chars().collect(); let b: Vec = itr.next().unwrap().chars().collect(); if a.len() > b.len() { println!("{}", a.iter().collect::()); } else if a.len() < b.len() { println!("{}", b.iter().collect::()); } else { for i in 0..a.len() { match (a[i], b[i]) { ('4', '7') => println!("{}", a.iter().collect::()), ('7', '4') => println!("{}", b.iter().collect::()), (_, _) if a[i] > b[i] => println!("{}", a.iter().collect::()), (_, _) if a[i] < b[i] => println!("{}", b.iter().collect::()), _ => continue, } return; } } }