fn main() { let vec: Vec = reads(3); let abc = ["A","B","C"]; let mut vec = vec.iter().zip(abc.iter()).collect::>(); vec.sort_by(|a,b|b.cmp(a)); let ans = vec.iter().map(|&(_,c)|c).collect::>(); print_vec(&ans, "\n"); } fn read() -> T { let mut buf = String::new(); std::io::stdin().read_line(&mut buf).ok(); buf.trim().parse::().ok().unwrap() } fn reads(n: usize) -> Vec { let mut vec: Vec = vec![]; for _ in 0 .. n { vec.push(read()); } vec } fn print_vec(vec: &Vec, sep: &str) { let out = vec.iter().map(|e| e.to_string()).collect::>().as_slice().join(sep); println!("{}", out); }