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