def solve(): Q=int(input()) def bit(x,i): return (x>>i)&1 Ans=[] S=set() K=30; B=[0]*30 for q in range(Q): mode,*value=map(int,input().split()) if mode==1: x,=value if x in S: continue S.add(x) for i in range(K): if bit(x,i): B[i]+=1 elif mode==2: x,=value if x not in S: continue S.remove(x) for i in range(K): if bit(x,i): B[i]-=1 else: if S: ans=0 for i in range(K): if B[i]==len(S): ans|=1<