I=input for t in range(int(I())): x,y=map(int,I().split()) x|=((1<