fn main() { let mut input = String::new(); std::io::Read::read_to_string(&mut std::io::stdin(), &mut input).ok(); let input: Vec = input .split_whitespace() .map(|n| n.parse().unwrap()) .collect(); let h = input[0]; let mut hh = input[2..].to_vec(); hh.sort_unstable(); hh.reverse(); match hh.iter().position(|&h_| h_ < h).or(Some(hh.len())) { Some(n) if n % 10 == 0 => println!("{}st", n + 1), Some(n) if n % 10 == 1 => println!("{}nd", n + 1), Some(n) if n % 10 == 2 => println!("{}rd", n + 1), Some(n) => println!("{}th", n + 1), _ => unreachable!(), } }