use std::io::*;
use std::str::*;

fn readw<T: FromStr, R: Read>(s: &mut R) -> Option<T> {
    let s = s.bytes().map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    if s.is_empty() {
        None
    } else {
        s.parse::<T>().ok()
    }
}

fn read<T: FromStr, R: Read>(s: &mut R) -> T {
    readw(s).unwrap_or_else(|| std::process::exit(0))
}

fn main() {
    let s = stdin();
    let s = s.lock();
    let s = &mut BufReader::new(s);

    loop {
        let (a, b, c): (u32, u32, u32) = (read(s), read(s), read(s));
        let mut v = [(a, 'A'), (b, 'B'), (c, 'C')];
        v.sort();
        v.reverse();
        for &x in &v {
            println!("{}", x.1);
        }
    }
}