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

s=[eval(input()) for i in range(N)]

s=sorted(s)

print(("".join(s)))



n,l=list(map(int,input().split()))

s=[eval(input()) for i in range(n)]

print(("".join(sorted(s))))

N, L = list(map(int, input().split()))
s = [eval(input()) for i in range(N)]
s = sorted(s)
print(("".join(s)))

n, l = list(map(int, input().split()))
s = [eval(input()) for i in range(n)]
print(("".join(sorted(s))))

-N, L = list(map(int, input().split())) -s = [eval(input()) for i in range(N)] -s = sorted(s) -print(("".join(s))) +n, l = list(map(int, input().split())) +s = [eval(input()) for i in range(n)] +print(("".join(sorted(s))))