# sort()/sorted()函数实现
while True:
    try:
        num=int(input())
        stack=[]
        for i in range(num):
            stack.append(input())
        print("\n".join(sorted(stack)))
    except:
        break