let () = let h, n = Scanf.scanf "%d %d " (fun h n -> h, n) in let n = n - 1 in let a = Array.init n (fun _ -> Scanf.scanf "%d " (fun i -> i)) in Array.fast_sort (fun x y -> y - x) a; let rec doit i = if i = n || h >= a.(i) then i + 1 else doit (i + 1) in let i = doit 0 in if i = 1 then print_endline "1st" else if i = 2 then print_endline "2nd" else if i = 3 then print_endline "3rd" else Printf.printf "%dth\n" i