while True:
try:
num=int(input())
stack=[]
for i in range(num):
stack.append(input())
print("\n".join(sorted(stack)))
except:
break
while True:
try:
num=int(input())
stack=[]
for i in range(num):
stack.append(input())
print("\n".join(sorted(stack)))
except:
break