Option Strict On
Imports System.Console
Imports System.Collections.Generic

Module Program
    Sub Main()
        Dim N As Integer = NextInt()
        Dim L As Integer = NextInt()
        Dim S As String() = New String() {}

        For i As Integer = 0 To N - 1
            ReDim Preserve S(UBound(S) + 1)
            S(UBound(S)) = ReadLine()
        Next

        Array.Sort(S)
        WriteLine(String.Join("", S))
    End Sub

    Function NextInt() As Integer
        Return CInt(NextString())
    End Function

    Function NextString() As String
        Dim result As New List(Of String)
        Do
            Dim tmp As Integer = Read()
            If tmp < 0 Then Exit Do
            Dim nextChar As Char = Chr(tmp)

            If Not Char.IsWhiteSpace(nextChar) Then
                result.Add(nextChar)
            ElseIf nextChar <> vbCr Then
                Exit Do
            End If
        Loop
        Return String.Join("", result)
    End Function

End Module
