Scanf.scanf "%d %d" (fun n l ->
    let s = Array.init n (fun _ -> Scanf.scanf " %s" (fun s -> s)) in
    Array.sort compare s;

    let rec loop i acc =
        if i = n then acc else loop (i + 1) (acc ^ s.(i))
    in
    loop 0 "" |> print_endline
)