#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef long long LL; typedef double db; #define _Zero(a) memset(a,0,sizeof(a)) #define _Neg1(a) memset(a,-1,sizeof(a)) #define _Inf(a) memset(a,0x3f,sizeof(a)) #define _NegInf(a) memset(a,0xcf,sizeof(a)) #define _Rep(i,a,b) for(int (i)=(a);(i)<=(b);i++) #define _Dep(i,a,b) for(int (i)=(a);(i)>=(b);i--) #define _Out(a) cerr<<(#a)<<" = "<<(a)<void test(T x,Args...args){cerr<>1)%MOD : qpow(a*a%MOD,b>>1))%MOD :1; } ll qpow(ll a, ll b, ll c) {return b?((b&1)?a*qpow(a*a%c,b>>1)%c : qpow(a*a%c,b>>1)) % c: 1; } ll gcd(ll a, ll b){return b?gcd(b,a% b): a; } int sign(db x) { return x<-EPS ? -1: x>EPS; } int dbcmp(db l, db r) { return sign(l - r); } struct Linear_Basis { LL b[63],nb[63],tot; void init() { tot=0; memset(b,0,sizeof(b)); memset(nb,0,sizeof(nb)); } bool ins(LL x) { printf("(%lld)",x); for(int i=62;i>=0;i--) if (x&(1LL<0; } LL Max(LL x) { LL res=x; for(int i=62;i>=0;i--) res=max(res,res^b[i]); return res; } LL Min(LL x) { LL res=x; for(int i=0;i<=62;i++) if (b[i]) res^=b[i]; return res; } void rebuild() { for(int i=62;i>=0;i--) for(int j=i-1;j>=0;j--) if (b[i]&(1LL<=0;i--) if (k&(1LL<>1; int fg=0; //printf("<%d>",x); bitset<32> bs=x; for(int i=30;i>=0;i--) { if(xx[i]&&bs[i])fg=1; else if(xx[i]==0&&(bs[i]||fg))xx[i]=1,ans+=1<>1; int fg=0; // printf("<%d>",x); bitset<32> bs=x; for(int i=30; i>=0; i--) { if(xx[i]&&bs[i]) fg=1; else if(xx[i]==0&&(bs[i]||fg)) xx[i]=1,ans+=1<