let rec take l n = if n == 0 then [] else match l with
    | [] -> []
    | (x::xs) -> x :: take xs (n-1)

let () =
    let rec read n ls = match n with
        | 0 -> ls
        | otherwise -> begin
            let s = read_line () in
            let x = int_of_string s in
            read (n-1) (x :: ls)
        end
    in
    let data = read 10 [] in
    let sorted = (List.sort compare data) in
    let taken = take (List.rev sorted) 3 in 
    List.iter (Printf.printf "%d\n") taken