n=int(input()) l=[input().split() for _ in [0]*n] b,a=[list(i) for i in zip(*l)] a=[x for x in a if x not in b] a=sorted(set(a), key=a.index) print('\n'.join(a))