N=int(input()) X = [[int(i) for i in input(). split ()] for i in range(N)] d=X[0][1]-X[0][0] nd=1 i=0 while nd==1 and i