n=int(input()) l=sum([input().split() for _ in [0]*n],[]) a=sorted(set(l[1::2])-set(l[::2]),key=l.index) print('\n'.join(a))