#include using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) void solve() { ll n; cin >> n; vector> a(n), b(n); rep(i, n) { ll x; cin >> x; rep(j, 60) a[i].push_back((x >> j) & 1); b[i].push_back(i); } vector used(n, false); rep(j, 60) { ll k = -1; rep(i, n) { if (!used[i] && a[i][j]) { k = i; used[k] = true; break; } } if (k == -1) continue; rep(i, n) { if (!used[i] && a[i][j]) { rep(j2, 60) a[i][j2] ^= a[k][j2]; for (const auto x : b[k]) { b[i].push_back(x); } } } } rep(k, n) { ll cnt = 0; rep(j, 60) cnt += a[k][j]; if (cnt > 0) continue; sort(b[k].begin(), b[k].end()); cout << b[k].size() << '\n'; rep(i, b[k].size()) cout << (i ? " " : "") << b[k][i] + 1; cout << '\n'; return; } cout << "-1\n"; } int main() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); int T = 1; for (int t = 0; t < T; t++) { solve(); } return 0; }