N = gets.to_i
a = gets.split.map(&:to_i)

b = a.dup
ans = []

(N-1).downto(0) do |i|
  if i > N / 2
    ans << i+1 if a[i] == 1
  else
    cnt = 0
    i.step(N-1, i+1) do |j|
      cnt += 1 if b[j] == 1
    end
    if cnt % 2 == a[i]
      if b[i] == 1
        ans << i+1
      end
    else
      if b[i] == 1
        b[i] = 0
      else
        b[i] = 1
        ans << i+1
      end
    end
  end
end

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