#ifdef ONLINE_JUDGE #pragma GCC optimize(3, "Ofast", "inline") #endif #include #include #include #define rt return #define pi pair #define pl pair #define pu pair #define int long long #define ll long long #define ull unsigned long long #define endl '\n' #define Endl endl #define all(x) x.begin(), x.end() #define all1(x) next(x.begin()), x.end() #define lll __int128_t #define ulll __uint128_t using namespace std; const int maxn = 1e5 + 50; const int mod = 998244353; const ll maxl = 2e18 + 5; const int maxi = 1e9 + 7; struct LinearBase { // ????? idx?1?? // ????? idx?0?? int N; vector base; vector> idx; int iffzero = 0; LinearBase() { N = 105; base.resize(102); } LinearBase(int n) { N = n + 5; base.resize(n + 20); idx.resize(n + 20); } void clear() { N = 0; base.clear(); } bool insert(ull x, int dx) { set st; st.insert(dx); assert(N != 0); for (int i = 62; i >= 0; i--) { if (!(x & (1ull << i))) continue; if (!base[i]) { base[i] = x; idx[i] = st; return 1; } x ^= base[i]; for (auto j : idx[i]) { if (st.contains(j)) { st.erase(j); } else st.insert(j); } if (x == 0) { iffzero = 1; return false; } } return 1; } void goass() { assert(N != 0); sort(base.begin(), base.end(), greater()); int row = 0; for (int i = 62; i >= 0; i--) { for (int j = row; j < N; j++) { if ((1ull << i) & base[j]) { swap(base[j], base[row]); swap(idx[j], idx[row]); } } if (!((1ull << i) & base[row])) continue; for (int j = 0; j < N; j++) { if (j == row) continue; if ((1ull << i) & base[j]) { base[j] ^= base[row]; } } row++; } } void printbi(ull x) { for (int j = 62; j >= 0; j--) { if ((1ull << j) & x) { cerr << 1; } else cerr << 0; } cerr << endl; } void print() { assert(N != 0); for (int i = 0; i < N; i++) { for (int j = 62; j >= 0; j--) { if ((1ull << j) & base[i]) { cerr << 1; } else cerr << 0; } cerr << endl; } cerr << endl; } }; void init() { } void solve() { int n; cin >> n; vector a(n + 1); for (int i = 1; i <= n; i++) cin >> a[i]; LinearBase lb(105); set ans; vector ans2; for (int i = 1; i <= n; i++) { if (a[i] == 0) ans2.push_back(i); else if (!lb.insert(a[i], i)) { // lb.goass(); ans.insert(i); ull x = a[i]; for (int j = 62; j >= 0; j--) { if (!(x & (1ull << j))) continue; x ^= lb.base[j]; if (lb.idx[j].size()) { for (auto k : lb.idx[j]) { if (ans.contains(k)) { ans.erase(k); } else ans.insert(k); } } } break; } } // ranges::sort(ans); if (ans2.size() >= 1) { cout << ans2.size() << endl; for (int i = 0; i < ans2.size(); i++) { cout << ans2[i] << " \n"[i == ans2.size() - 1]; } } else if (ans.size()) { cout << ans.size() << endl; for (auto i : ans) { cout << i << " "; } } else { cout << -1 << endl; } } signed main() { #ifndef ONLINE_JUDGE freopen("1.txt", "r", stdin); freopen("2.txt", "w", stdout); #endif std::ios::sync_with_stdio(0); std::cin.tie(0); int __ = 1; // std::cin >> __; init(); while (__--) { solve(); // cerr<<"TIME"<