# require 'pp'

$n = gets.to_i + 1

mods = [0] + gets.split.map(&:to_i)

# p nums

nums = Array.new($n, 0)

def count_right_ones(index, nums)
    mul = 1
    i = index * mul
    res = 0
    # puts "   count: start(#{index})"

    while i < $n
        # puts "   count: nums[#{i}] = #{nums[i]}"
        res += nums[i]
        mul += 1
        i = index * mul
    end
    return res
end

res = []

mods.each_with_index.reverse_each do |mod, i|
    next if i == 0
    # puts "==="
    ones = count_right_ones(i, nums)
    ones_mod = ones % 2
    if ones_mod != mod
        # puts ones
        # p [i, ones_mod, num]
        # p nums
        nums[i] = 1
        # p nums
        res << i
    end
    # puts "---"        
end

puts res.size
puts res.join(' ') if res.size > 0