n=int(eval(input()))

a=[0]+list(map(int,input().split()))

b=[]

c=[0]*(n+1)

for i in range(n,0,-1):

  cnt=0

  t=i

  while t<=n:

    cnt+=c[t]

    t+=i

  if cnt%2!=a[i]:

    c[i]=1

    b.append(i)

b.sort()

if len(b)>0:

  print((len(b)))

  print((*b))

else:

  print((0))

  

n=int(eval(input()))

a=[0]+list(map(int,input().split()))

b=[0]*(n+1)

for i in range(n,0,-1):

  s=0

  t=i

  while t<=n:

    s+=b[t]

    t+=i

  if s%2==a[i]:

    pass

  else:

    b[i]=1

ans=0

c=[]

for i,bb in enumerate(b):

  if bb>0:

    ans+=bb

    c.append(i)

if ans>0:

  print(ans)

  print((*c))

else:

  print((0))
n = int(eval(input()))
a = [0] + list(map(int, input().split()))
b = []
c = [0] * (n + 1)
for i in range(n, 0, -1):
    cnt = 0
    t = i
    while t <= n:
        cnt += c[t]
        t += i
    if cnt % 2 != a[i]:
        c[i] = 1
        b.append(i)
b.sort()
if len(b) > 0:
    print((len(b)))
    print((*b))
else:
    print((0))

n = int(eval(input()))
a = [0] + list(map(int, input().split()))
b = [0] * (n + 1)
for i in range(n, 0, -1):
    s = 0
    t = i
    while t <= n:
        s += b[t]
        t += i
    if s % 2 == a[i]:
        pass
    else:
        b[i] = 1
ans = 0
c = []
for i, bb in enumerate(b):
    if bb > 0:
        ans += bb
        c.append(i)
if ans > 0:
    print(ans)
    print((*c))
else:
    print((0))

-b = [] -c = [0] * (n + 1) +b = [0] * (n + 1) -    cnt = 0 +    s = 0 -        cnt += c[t] +        s += b[t] -    if cnt % 2 != a[i]: -        c[i] = 1 -        b.append(i) -b.sort() -if len(b) > 0: -    print((len(b))) -    print((*b)) +    if s % 2 == a[i]: +        pass +    else: +        b[i] = 1 +ans = 0 +c = [] +for i, bb in enumerate(b): +    if bb > 0: +        ans += bb +        c.append(i) +if ans > 0: +    print(ans) +    print((*c))