let rec read_lines n () = if n = 0 then [] else read_line () :: read_lines (n-1) ()
let n, l = Scanf.scanf "%d %d\n" @@ fun a b -> a, b
let s = List.fast_sort compare (read_lines n ())
let () = print_endline (List.fold_left (^) "" s)