#35908: answer


1452945-9@g.puiching.edu.mo (sandy koya)

學校 : 不指定學校
編號 : 188268
來源 : [27.109.238.197]
最後登入時間 :
2023-07-23 11:53:37

ls2=[]
while True:
    try:
        ls=list(input().split())
        if ls[-1]=="0":
            if (ls[0] in ls2)==False:
                ls2.append(ls[0])
                print(ls[0])
    except:
        break