d1 = {}
lines = []
while True: #一直获取直到获取不到
    try:
        lines.append(int(input()))
    except:
        break

lines_len = len(lines) #遍历输入的数字
i = 0
while i < lines_len:
    next_i = i + 1 + lines[i]  #设置一下index的索引位置
    d1[lines[i]] = sorted(set(lines[i+1:next_i])) #将数组的个数作为key,对应的随意数列表作为value 
    i = next_i
for _, values in d1.items():# 遍历字典,打印字典内容
    for value in values:
        print(value)