n=int(eval(input()))



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



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

    if sum(A[::i])%2!=A[i]:

        A[i]^=1

        

print((sum(A)))

if sum(A)!=0:

    for i,a in enumerate(A):

        if a==1:

            print(i)
n=int(eval(input()))



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



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

    if sum(A[::i])%2!=A[i]:

        if A[i]==0:

            A[i]=1

        else:

            A[i]=0

        

print((sum(A)))

if sum(A)!=0:

    for i,a in enumerate(A):

        if a==1:

            print(i)
n = int(eval(input()))
A = [0] + list(map(int, input().split()))
for i in reversed(list(range(1, n + 1))):
    if sum(A[::i]) % 2 != A[i]:
        A[i] ^= 1
print((sum(A)))
if sum(A) != 0:
    for i, a in enumerate(A):
        if a == 1:
            print(i)

n = int(eval(input()))
A = [0] + list(map(int, input().split()))
for i in reversed(list(range(1, n + 1))):
    if sum(A[::i]) % 2 != A[i]:
        if A[i] == 0:
            A[i] = 1
        else:
            A[i] = 0
print((sum(A)))
if sum(A) != 0:
    for i, a in enumerate(A):
        if a == 1:
            print(i)

-        A[i] ^= 1 +        if A[i] == 0: +            A[i] = 1 +        else: +            A[i] = 0