'use strict'

const main = input => {
	const args = input.split('\n').map(arg => arg.split(' '))
	const n = parseInt(args[0][0], 10)
	const a = args[1].map(arg => parseInt(arg[0], 10))
	let t1 = n 
	let ans = -1

	for (let i = 0; i < n; i++) {
		for (let j = 0; j < Math.pow(2, Math.floor(n / (i + 1))); j++) {
			let cnt = 0

			for (let k = 0; k < j; k++) {
				if (j & (1 << k)) cnt++
			}

			if (cnt % 2 === a[i]) {
				if (i < t1) {
					t1 = i
					ans = j
				}
			}
		}
	}

	if (ans === -1) {
		console.log(-1)
	} else {
		const t2 = []

		for (let i = 0; i < (t1 + 1); i++) {
			t2.push((t1 + 1) * (i + 1))
		}

		console.log(t2.length)
		if (t2.length > 0) console.log(t2.join(' '))
	}
}

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