#include using namespace std; // Gaussian Elimination 関数 pair> GaussianElimination(const vector& a, int n) { vector> basis; // 各成分の処理 for (int i = 0; i < n; i++) { long long value = a[i]; long long index = (1LL << i); // 既存のベースとの組み合わせ for (auto [base, ind] : basis) { if ((value ^ base) < value) { value ^= base; index ^= ind; } } // 線形従属ならば答えを出力 if (value == 0) { vector ans; for (int j = 0; j <= 60; j++) { if (index & (1LL << j)) { ans.emplace_back(j + 1); } } return {true, ans}; // 解が見つかる場合 } // 新しいベースの追加 basis.emplace_back(value, index); } return {false, {}}; // 解が存在しない場合 } int main() { int n; cin >> n; vector a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } // Gaussian Eliminationを使って解を求める auto [found, ans] = GaussianElimination(a, n); if (!found) { cout << -1 << endl; } else { cout << ans.size() << endl; for (int b : ans) { cout << b << " "; } cout << endl; } return 0; }