#include #include using namespace std; using ll = long long; #define rep(i, s, t) for (ll i = s; i < (ll)(t); i++) template bool chmin(T &x, T y) { return x > y ? (x = y, true) : false; } template bool chmax(T &x, T y) { return x < y ? (x = y, true) : false; } struct io_setup { io_setup() { ios::sync_with_stdio(false); std::cin.tie(nullptr); cout << fixed << setprecision(15); } } io_setup; int main(){ int n; cin>>n; vector a(n); rep(i,0,n) cin>>a.at(i); vector b; vector>> ck; rep(i,0,n){ int x=a.at(i); vector v; int ct=0; for(int y:b){ if(chmin(x,x^y)) v.push_back(ct); ct++; } if(x==0){ vector ans; ans.push_back(i); int m=b.size(); vector us(m,0); for(int d:v) us.at(d)^=1; while(!us.empty()){ if(us.back()){ auto[dd,tv]=ck.back(); ans.push_back(dd); for(int d:tv) us.at(d)^=1; } us.pop_back(); ck.pop_back(); } m=ans.size(); cout<