import sys input = sys.stdin.readline Q=int(input()) S=set() A=[0]*32 ko=0 for tests in range(Q): X=list(map(int,input().split())) if X[0]==1: x=X[1] if x in S: pass else: S.add(x) ko+=1 for i in range(32): if x & (1<0 and ANS==-1: ANS=0 if A[i]>0 and A[i]==ko: ANS|=(1<