import sys

N = int(sys.stdin.readline().rstrip())

string_list = []

for i in range(N):
    string = sys.stdin.readline().rstrip()
    string_list.append(string)

string_list.sort(key = lambda item: (len(item), item))

print(string_list[0])
for i in range(len(string_list) - 1):
    if (string_list[i] != string_list[i + 1]):
        print(string_list[i + 1])
3af1ead9b3abe707aefa84f9fe1e9d3457b392bc
<mask token>

<mask token>
for i in range(N):
    string = sys.stdin.readline().rstrip()
    string_list.append(string)
string_list.sort(key=lambda item: (len(item), item))
print(string_list[0])
for i in range(len(string_list) - 1):
    if string_list[i] != string_list[i + 1]:
        print(string_list[i + 1])

<mask token>
N = int(sys.stdin.readline().rstrip())
string_list = []
for i in range(N):
    string = sys.stdin.readline().rstrip()
    string_list.append(string)
string_list.sort(key=lambda item: (len(item), item))
print(string_list[0])
for i in range(len(string_list) - 1):
    if string_list[i] != string_list[i + 1]:
        print(string_list[i + 1])

import sys
N = int(sys.stdin.readline().rstrip())
string_list = []
for i in range(N):
    string = sys.stdin.readline().rstrip()
    string_list.append(string)
string_list.sort(key=lambda item: (len(item), item))
print(string_list[0])
for i in range(len(string_list) - 1):
    if string_list[i] != string_list[i + 1]:
        print(string_list[i + 1])

import sys

N = int(sys.stdin.readline().rstrip())

string_list = []

for i in range(N):
    string = sys.stdin.readline().rstrip()
    string_list.append(string)

string_list.sort(key = lambda item: (len(item), item))

print(string_list[0])
for i in range(len(string_list) - 1):
    if (string_list[i] != string_list[i + 1]):
        print(string_list[i + 1])