N, L = list(map(int, input().split()))

S = []

s = ""

for _ in range(N):

    S.append(eval(input()))

    

S.sort()

    

for i in range(N):

    s += S[i]

    

print(s)

    
N, L = list(map(int, input().split()))

S = [eval(input()) for _ in range(N)]

s = ""

  

S.sort()

    

for i in range(N):

    s += S[i]

    

print(s)

    
N, L = list(map(int, input().split()))
S = []
s = ""
for _ in range(N):
    S.append(eval(input()))
S.sort()
for i in range(N):
    s += S[i]
print(s)

N, L = list(map(int, input().split()))
S = [eval(input()) for _ in range(N)]
s = ""
S.sort()
for i in range(N):
    s += S[i]
print(s)

-S = [] +S = [eval(input()) for _ in range(N)] -for _ in range(N): -    S.append(eval(input()))