use std::collections::HashSet; use proconio::input; fn main() { input! { mut n:usize, a:[usize;n], } const D: usize = 60; for i in 0..n { if a[i] == 0 { println!("1\n{}", i + 1); return; } } let n = n.min(100); let mut mat = vec![vec![0; n]; D]; for i in 0..n { for j in 0..D { if a[i] & (1 << j) != 0 { mat[j][i] = 1; } } } // show(&mat); let mut rank = 0; let mut pivots = vec![]; for i in 0..n { let Some(id)=(rank..D).find(|&ii|mat[ii][i]==1)else{ continue; }; pivots.push((rank, i)); for j in 0..n { let tmp = mat[rank][j]; mat[rank][j] = mat[id][j]; mat[id][j] = tmp; } for ii in 0..D { if ii == rank || mat[ii][i] == 0 { continue; } for j in 0..n { mat[ii][j] ^= mat[rank][j]; } } rank += 1; // show(&mat); } if rank == n { println!("-1"); return; } let mut ans = HashSet::new(); for &(py, px) in pivots.iter() { for i in px..n { if mat[py][i] == 0 { continue; } ans.insert(i + 1); } } println!("{}", ans.len()); for i in ans { print!("{} ", i); } println!() }