let ($) f g x = f (g x)

let rec read n = if n = 0 then [] else (Scanf.scanf "%d\n" (fun x -> x) :: read (n - 1))

let rec take n = function
  | [] -> []
  | hd :: tl -> if n <= 0 then [] else hd :: take (n - 1) tl

let _ =
  let lst = read 10 in
  List.iter (Printf.printf "%d\n") ((take 3 $ List.sort (fun x y -> compare y x)) lst)