n=int(input()) a1=[] b1=[] for _ in range(n): a,b=map(int,input().split()) if a1 and a1[-1]!=a: prisjflkajfg a1.append(a) b1.append(b)