백준 1181번
# 입력 받기
N = int(input())
words = []

for _ in range(N):
    word = input()
    words.append(word)

words = list(set(words))
words.sort(key=lambda x: (len(x), x))

for word in words:
    print(word)

set = 중복 제거
sort(길이순, 사전순)