console.log((args=>{
  const [[N],a] = args.trim().split('\n').map(r=>r.split(' ').map(v=>v|0));
  const b = [];
  for ( let i = 0; i < N; i++ ) {
    let s = 0;
    for ( let j = i; j < N; j+=i+1 ) s ^= a[j];
    if ( s !== a[i] ) return '-1';
    else if ( s ) b.push(i+1);
  }
  return b.length + '\n' + b.join` `;
})(require('fs').readFileSync('/dev/stdin', 'utf8')));