fn main() { let stdin = std::io::read_to_string(std::io::stdin()).unwrap(); let mut stdin = stdin.split_ascii_whitespace(); let h_self: u16 = stdin.next().unwrap().parse().unwrap(); let n: usize = stdin.next().unwrap().parse().unwrap(); let h_other: Vec = (0..(n - 1)) .map(|_| stdin.next().unwrap().parse().unwrap()) .collect(); use std::io::Write; std::io::stdout() .write_all(output(solve(h_self, h_other)).as_bytes()) .unwrap(); } fn solve(h_self: u16, h_other: Vec) -> usize { h_other.into_iter().filter(|&h| h > h_self).count() + 1 } fn output(ans: usize) -> String { ans.to_string() + match ans % 10 { 1 => "st\n", 2 => "nd\n", 3 => "rd\n", _ => "th\n", } }