from sys import stderr

N = int(eval(input()))

A = [int(i) for i in input().split()]



B = [0] * N



for i in range(N // 2, N):

    B[i] = A[i]



for i in reversed(list(range(N // 2))):

    s = sum(B[i::i + 1])

    B[i] = (A[i] - s) % 2



ans = [i + 1 for i, b in enumerate(B) if b == 1]

print((len(ans)))

if ans:

    print((*ans))
N = int(eval(input()))

A = [int(i) for i in input().split()]



B = [0] * N

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

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



ans = [i + 1 for i, b in enumerate(B) if b == 1]

print((len(ans)))

print((*ans))
from sys import stderr

N = int(eval(input()))
A = [int(i) for i in input().split()]
B = [0] * N
for i in range(N // 2, N):
    B[i] = A[i]
for i in reversed(list(range(N // 2))):
    s = sum(B[i :: i + 1])
    B[i] = (A[i] - s) % 2
ans = [i + 1 for i, b in enumerate(B) if b == 1]
print((len(ans)))
if ans:
    print((*ans))

N = int(eval(input()))
A = [int(i) for i in input().split()]
B = [0] * N
for i in reversed(list(range(N))):
    B[i] = (A[i] - sum(B[i :: i + 1])) % 2
ans = [i + 1 for i, b in enumerate(B) if b == 1]
print((len(ans)))
print((*ans))

-from sys import stderr - -for i in range(N // 2, N): -    B[i] = A[i] -for i in reversed(list(range(N // 2))): -    s = sum(B[i :: i + 1]) -    B[i] = (A[i] - s) % 2 +for i in reversed(list(range(N))): +    B[i] = (A[i] - sum(B[i :: i + 1])) % 2 -if ans: -    print((*ans)) +print((*ans))