N = gets.to_i
a = Array.new(N + 1, 0)
b = Array.new(N + 1 ,0)

gets.split.map(&:to_i).each.with_index(1) do |num, i|
  a[i] = num
end

N.downto(1) do |i|
  sum = 0

  i.step(N, i) do |j|
    sum += a[j]
  end

  b[i] = sum % 2
end

b.shift
b.reject!(&:zero?)
puts b.size
puts b.join(" ")
