import sys

stack = []
for x in sys.stdin:
    if x.strip():
        stack.append(int(x.strip()))
stack.reverse()
        
while stack:
    li = set()
    num = stack.pop()
    for i in range(num):
        li.add(stack.pop())
    li = sorted(li)
    for x in li:
        print(x)