n = gets.to_i
a = [nil] + gets.split.map(&:to_i)
b = [nil] + [0] * n

n.downto(1) do |i|
  sum = i.step(n,i).inject(:+){b[i]&1}
  b[i] = 1 if a[i] != sum
end
p b.count(1)
puts (1..n).select{|i| b[i] == 1}.join(' ')