n = int(input())
l = []
for i in range(n):
    word = input()
    l.append(word)
print('\n'.join(sorted(l)))

sorted是列表中有数字按照大小排列,有字母按照ASII码进行排列