defmodule Main do
  def main do
    [n, _l] =
      IO.gets("")
      |> String.trim()
      |> String.split()
      |> Enum.map(&String.to_integer/1)

    IO.stream(:stdio, :line)
    |> Enum.take(n)
    |> Enum.map(&String.trim/1)
    |> Enum.sort()
    |> Enum.join()
  end
end