n=int(eval(input()))

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



m=0

ans=[]

c=[0]*(n+1)

for i in reversed(list(range(1,n+1))):

  if a[i]%2!=c[i]%2:

    m+=1

    ans.append(i)

    j=1

    r=set()

    while j*j<=i:

      if i%j==0:

        r.add(j)

        r.add(i//j)

      j+=1

    for j in r:

      c[j]+=1

      c[j]%=2

        

print(m)

print((*sorted(ans)))       
n=int(eval(input()))

a=list(map(int,input().split()))



ans=[]

b=[0]*n

for i in reversed(list(range(n))):

  if sum(b[i::i+1])%2!=a[i]:

    b[i]+=1

    ans.append(i+1)

        

print((sum(b)))

print((*sorted(ans)))       

n = int(eval(input()))
a = [0] + list(map(int, input().split()))
m = 0
ans = []
c = [0] * (n + 1)
for i in reversed(list(range(1, n + 1))):
    if a[i] % 2 != c[i] % 2:
        m += 1
        ans.append(i)
        j = 1
        r = set()
        while j * j <= i:
            if i % j == 0:
                r.add(j)
                r.add(i // j)
            j += 1
        for j in r:
            c[j] += 1
            c[j] %= 2
print(m)
print((*sorted(ans)))

n = int(eval(input()))
a = list(map(int, input().split()))
ans = []
b = [0] * n
for i in reversed(list(range(n))):
    if sum(b[i :: i + 1]) % 2 != a[i]:
        b[i] += 1
        ans.append(i + 1)
print((sum(b)))
print((*sorted(ans)))

-a = [0] + list(map(int, input().split())) -m = 0 +a = list(map(int, input().split())) -c = [0] * (n + 1) -for i in reversed(list(range(1, n + 1))): -    if a[i] % 2 != c[i] % 2: -        m += 1 -        ans.append(i) -        j = 1 -        r = set() -        while j * j <= i: -            if i % j == 0: -                r.add(j) -                r.add(i // j) -            j += 1 -        for j in r: -            c[j] += 1 -            c[j] %= 2 -print(m) +b = [0] * n +for i in reversed(list(range(n))): +    if sum(b[i :: i + 1]) % 2 != a[i]: +        b[i] += 1 +        ans.append(i + 1) +print((sum(b)))