n = gets.to_i

as = gets.split.map &:to_i

count = 0
result = []

n.downto(1){ |x|
	(x * 2).step(n, x){ |i|
		as[x - 1] ^= as[i - 1]
	}
	
	if as[x - 1] == 1 then
		result << x
		count += 1
	end
}

puts count
puts result.sort.join(" ")
