/* -*- coding: utf-8 -*- * * 2895.cc: No.2895 Zero XOR Subset - yukicoder */ #include #include using namespace std; /* constant */ const int BN = 60; const int MAX_N = BN + 1; /* typedef */ using ll = long long; /* global variables */ ll as[MAX_N], bs[MAX_N]; /* subroutines */ inline int biti(ll a, int i) { return (a >> i) & 1; } /* main */ int main() { int n; scanf("%d", &n); n = min(BN + 1, n); for (int i = 0; i < n; i++) scanf("%lld", as + i); for (int i = 0; i < n; i++) bs[i] = (1LL << i); for (int i = 0, u = 0; u < n && i < BN; i++) { if (! biti(as[u], i)) { for (int v = u + 1; v < n; v++) if (biti(as[v], i)) { swap(as[u], as[v]); swap(bs[u], bs[v]); break; } } if (biti(as[u], i)) { for (int v = u + 1; v < n; v++) if (biti(as[v], i)) as[v] ^= as[u], bs[v] ^= bs[u]; u++; } } int xi = -1; for (int i = 0; xi < 0 && i < n; i++) if (as[i] == 0) xi = i; if (xi >= 0) { ll bx = bs[xi]; int m = 0; for (int i = 0; i < BN; i++) if (biti(bx, i)) bs[m++] = i; printf("%d\n", m); for (int i = 0; i < m; i++) printf("%lld%c", bs[i] + 1, (i + 1 < m) ? ' ' : '\n'); } else puts("-1"); return 0; }