There are N empty boxes arranged in a row from left to right. The integer i is written on the i-th box from the left (1 \leq i \leq N).  For each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.  We say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:    * For every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.  Does there exist a good set of choices? If the answer is yes, find one good set of choices.
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
for i in range(n,1,-1):
  if a[i-1]==1:
    
      
      for j in range(1,i+1):
        if i%j==0:
          b[i//j-1]+=1
          b[i//j-1]%=2
          
          
if sum(b)%2!=a[0]:
  b[0]+=1
t=sum(b)
print(t)
if t>0:
  
  print(' '.join(map(str,b)))
  



n,*a=map(int,open(0).read().split())
b=[0]*n
for i in range(1,n+1)[::-1]:
  if not sum(b[i-1::i])%2==a[i-1]:
    b[i-1]=1
print(sum(b))
print(*[i+1 for i,b_i in enumerate(b) if b_i==1])
