let n =
	Scanf.sscanf (read_line ()) "%d" (fun n -> n)

let str =
	let rec loop lst n =
		if n = 0 then lst
		else loop ((read_line ()) :: lst) (n - 1)
	in
	loop [] n

let () =
	List.sort compare str
	|> String.concat ""
	|> print_endline
