#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); int n; cin >> n; vector a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } for (int i = 0; i < n; i++) { if (a[i] == 0) { cout << 1 << endl << i + 1 << endl; return 0; } } vector> basis; for (int i = 0; i < n; i++) { long long val = a[i]; long long idx = 1LL << i; for (auto [base, i] : basis) { if ((val ^ base) < val) { val ^= base; idx ^= i; } } if (val) { basis.push_back({val, idx}); } else { vector ans; for (int i = 0; i < 61; i++) { if (idx & (1LL << i)) { ans.push_back(i + 1); } } cout << ans.size() << endl; for (int i : ans) { cout << i << " "; } cout << endl; return 0; } } cout << -1 << endl; }