a=int(input())
b=list(map(int, input().split()))
cou,ju=0,0
ans=[]
while cou<a:
  i=1
  su=0
  while i*(cou+1)<a:
    su+=b[i*(cou+1)]
    i+=1
  if su%2!=b[cou]:
    ans+=[cou+1]
  cou+=1
if ans==[]:
  print("0")
else:
  s=""
  for i in ans:
    s+=str(i)+" "
  print(s)