// #include // Temp fix for gcc13 global pragma // #pragma GCC target("avx2,bmi2,popcnt,lzcnt") // #pragma GCC optimize("O3,unroll-loops") #include // #include using namespace std; #if __cplusplus >= 202002L using namespace numbers; #endif #ifdef LOCAL #include "Debug.h" #else #define debug_endl() 42 #define debug(...) 42 #define debug2(...) 42 #define debugbin(...) 42 #endif int main(){ cin.tie(0)->sync_with_stdio(0); cin.exceptions(ios::badbit | ios::failbit); int n; cin >> n; vector a(n); copy_n(istream_iterator(cin), n, a.begin()); n = min(n, 61); vector basis; for(auto bit = 0; bit < 60; ++ bit){ long long x = 0; for(auto i = 0; i < n; ++ i){ x |= (a[i] >> bit & 1) << i; } for(auto &b: basis){ x = min(x, b ^ x); } if(x == 0){ continue; } for(auto &b: basis){ b = min(b, b ^ x); } basis.push_back(x); } if((int)basis.size() == n){ cout << "-1\n"; return 0; } long long pivot = 0; for(auto &b: basis){ pivot |= 1LL << __lg(b); } for(auto i = 0; i < n; ++ i){ if(pivot >> i & 1){ continue; } vector res{i}; for(auto &b: basis){ if(b >> i & 1){ res.push_back(__lg(b)); } } ranges::sort(res); cout << (int)res.size() << "\n"; for(auto i: res){ cout << i + 1 << " "; } cout << "\n"; return 0; } assert(false); return 0; } /* */