n=int(eval(input()))

A=list(map(int,input().split()))[::-1]

B=[0]*n

for i in range(n):

  k=n-i

  if A[i]!=(B[k-1::k].count(1))%2:

    B[k-1]=1

    

o=B.count(1)

print(o)

P=[[i+1 for i, x in enumerate(B) if x ==1]]

if o!=0:

  print((*P[0]))

n=int(eval(input()))

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



B=[0 for i in range(n)]

B[n//2:]=A[n//2:]



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

    B[i-1]= (sum(B[i*2-1::i])%2 != A[i-1])



print((sum(B)))

for i,j in enumerate(B):

    if j==1:

        print((i+1))
n = int(eval(input()))
A = list(map(int, input().split()))[::-1]
B = [0] * n
for i in range(n):
    k = n - i
    if A[i] != (B[k - 1 :: k].count(1)) % 2:
        B[k - 1] = 1
o = B.count(1)
print(o)
P = [[i + 1 for i, x in enumerate(B) if x == 1]]
if o != 0:
    print((*P[0]))

n = int(eval(input()))
A = list(map(int, input().split()))
B = [0 for i in range(n)]
B[n // 2 :] = A[n // 2 :]
for i in range(n // 2, 0, -1):
    B[i - 1] = sum(B[i * 2 - 1 :: i]) % 2 != A[i - 1]
print((sum(B)))
for i, j in enumerate(B):
    if j == 1:
        print((i + 1))

-A = list(map(int, input().split()))[::-1] -B = [0] * n -for i in range(n): -    k = n - i -    if A[i] != (B[k - 1 :: k].count(1)) % 2: -        B[k - 1] = 1 -o = B.count(1) -print(o) -P = [[i + 1 for i, x in enumerate(B) if x == 1]] -if o != 0: -    print((*P[0])) +A = list(map(int, input().split())) +B = [0 for i in range(n)] +B[n // 2 :] = A[n // 2 :] +for i in range(n // 2, 0, -1): +    B[i - 1] = sum(B[i * 2 - 1 :: i]) % 2 != A[i - 1] +print((sum(B))) +for i, j in enumerate(B): +    if j == 1: +        print((i + 1))