'use strict'

function main(inp) {
  inp = inp.trim().split('\n')
  const N = Number(inp.shift())
  inp = inp[0].split(' ').map(n => Number(n));
  inp.unshift(0)

  let ans = []

  for (let i = N; i > 0; i--) {
    let count = 0
    for (let j = 0; j < ans.length; j++) {
      if (ans[j] % N === 0) count++
    }
    if (inp[i] > 1) return console.log(-1)
    if (count % 2 !== inp[i]) ans.unshift(i)
  }
  if (ans.length) {
    console.log(ans.length)
    console.log(ans.join(' '))
  } else {
    console.log(0)
  }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
