#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define X first #define Y second #define pb push_back #define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X)) #define rrep(X,Y) for (int (X) = (Y-1);(X) >=0;--(X)) #define repe(X,Y) for ((X) = 0;(X) < (Y);++(X)) #define peat(X,Y) for (;(X) < (Y);++(X)) #define all(X) (X).begin(),(X).end() #define rall(X) (X).rbegin(),(X).rend() using namespace std; typedef long long ll; typedef pair pii; typedef pair pll; template using vv=vector>; template ostream& operator<<(ostream &os, const vector &t) { os<<"{"; rep(i,t.size()) {os< ostream& operator<<(ostream &os, const pair &t) { return os<<"("< > matl; typedef vector > matd; template vector operator*(const T &a,vector v){ rep(i,v.size()) v[i]=v[i]*a; return v; } template vector operator+(vector v,const vector &w){ rep(i,v.size()) v[i]=v[i]+w[i]; return v; } template vv matE(T n){ vv re(n,vector(n)); rep(i,n) re[i][i]=1; return re; } template vvmatE(const vv &mat){ vv re(mat.size(),vector(mat.size())); rep(i,mat.size()) re[i][i]=1; return re; } template vv transpose(const vv &a,vector> &re){ re.resize(a[0].size(),vector(a.size())); rep(i,a[0].size()) rep(j,a.size()) re[i][j]=a[j][i]; return re; } template T operator*(const vector &a,const vector &b){ T re(0); rep(i,a.size())re+=a[i]*b[i]; return re; } template vv operator*(const vv &a,const vv &b_){ vv b,re(a.size(),vector(b_[0].size())); transpose(b_,b); rep(i,a.size()) rep(j,b[0].size()) re[i][j]=a[i]*b[j]; return re; } template vv pow(vv a,ll n){ if(n==0)return matE(a); if(n%2) return a*pow(a,n-1); vv re; re=pow(a,n/2); return re*re; } bool hasInv(modInt n){return n.v!=0;}; bool hasInv(double n){return abs(n)>EPS;} template int gyohen(vv &a){ ll i,j,k,n=a.size(),agcd,m=a[0].size(),nul=0; T div(1); rep(i,min(n,m)){ int non0=-1; for(j=i-nul;j>n; vector v(n); rep(i,n) cin>>v[i]; vv a(n,vector(60,modInt(0))); rep(i,60)rep(j,n) if(v[j]>>i&1) a[j][i]=1; int d=gyohen(a); cout<<(1ll<