import math

N = int(eval(input()))

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

b = [0]*N

ans = []

for k in range(N,0,-1):

    if a[k-1]%2 != b[k-1]%2:

        ans.append(k)

        b[0] += 1

        b[k-1] += 1

        for l in range(2,math.floor(math.sqrt(k))+1):

            if k % l == 0:

                if l*l == k:

                    b[l-1] += 1

                else:

                    b[l-1] += 1

                    b[k//l-1] += 1

print((len(ans)))

if len(ans) > 0:

    print((*ans))

N = int(eval(input()))

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

ans = [0]*(N+1)

for k in range(N,0,-1):

    temp = 0

    l = k

    while l <= N:

        temp += ans[l]

        l += k

    if a[k] == 1 and temp%2 == 0:

        ans[k] = 1

    elif a[k] == 0 and temp%2 == 1:

        ans[k] = 1

b = []

for k in range(1,N+1):

    if ans[k] == 1:

        b.append(k)

print((len(b)))

print((*b))

import math

N = int(eval(input()))
a = list(map(int, input().split()))
b = [0] * N
ans = []
for k in range(N, 0, -1):
    if a[k - 1] % 2 != b[k - 1] % 2:
        ans.append(k)
        b[0] += 1
        b[k - 1] += 1
        for l in range(2, math.floor(math.sqrt(k)) + 1):
            if k % l == 0:
                if l * l == k:
                    b[l - 1] += 1
                else:
                    b[l - 1] += 1
                    b[k // l - 1] += 1
print((len(ans)))
if len(ans) > 0:
    print((*ans))

N = int(eval(input()))
a = [0] + list(map(int, input().split()))
ans = [0] * (N + 1)
for k in range(N, 0, -1):
    temp = 0
    l = k
    while l <= N:
        temp += ans[l]
        l += k
    if a[k] == 1 and temp % 2 == 0:
        ans[k] = 1
    elif a[k] == 0 and temp % 2 == 1:
        ans[k] = 1
b = []
for k in range(1, N + 1):
    if ans[k] == 1:
        b.append(k)
print((len(b)))
print((*b))

-import math - -a = list(map(int, input().split())) -b = [0] * N -ans = [] +a = [0] + list(map(int, input().split())) +ans = [0] * (N + 1) -    if a[k - 1] % 2 != b[k - 1] % 2: -        ans.append(k) -        b[0] += 1 -        b[k - 1] += 1 -        for l in range(2, math.floor(math.sqrt(k)) + 1): -            if k % l == 0: -                if l * l == k: -                    b[l - 1] += 1 -                else: -                    b[l - 1] += 1 -                    b[k // l - 1] += 1 -print((len(ans))) -if len(ans) > 0: -    print((*ans)) +    temp = 0 +    l = k +    while l <= N: +        temp += ans[l] +        l += k +    if a[k] == 1 and temp % 2 == 0: +        ans[k] = 1 +    elif a[k] == 0 and temp % 2 == 1: +        ans[k] = 1 +b = [] +for k in range(1, N + 1): +    if ans[k] == 1: +        b.append(k) +print((len(b))) +print((*b))