n = int(eval(input()))

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

b = [0] * (n + 1)

ls = []

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

    cnt = 0

    for j in range(i, n + 1, i):

        cnt += b[j]

    if a[i-1] != cnt % 2:

        b[i] = 1

        ls.append(i)

print((len(ls)))

if len(ls) != 0:

    print((*ls))

n = int(eval(input()))

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

ls = [0] * n

ans = []

for i in range(n-1, -1, -1):

    t = 0

    for j in range(i, n, (i + 1)):

        t += ls[j]

    if a[i] != t % 2:

        ans.append(i + 1)

        ls[i] = 1

print((len(ans)))

if len(ans) != 0:

    print((*ans))

n = int(eval(input()))
a = list(map(int, input().split()))
b = [0] * (n + 1)
ls = []
for i in range(n, 0, -1):
    cnt = 0
    for j in range(i, n + 1, i):
        cnt += b[j]
    if a[i - 1] != cnt % 2:
        b[i] = 1
        ls.append(i)
print((len(ls)))
if len(ls) != 0:
    print((*ls))

n = int(eval(input()))
a = list(map(int, input().split()))
ls = [0] * n
ans = []
for i in range(n - 1, -1, -1):
    t = 0
    for j in range(i, n, (i + 1)):
        t += ls[j]
    if a[i] != t % 2:
        ans.append(i + 1)
        ls[i] = 1
print((len(ans)))
if len(ans) != 0:
    print((*ans))

-b = [0] * (n + 1) -ls = [] -for i in range(n, 0, -1): -    cnt = 0 -    for j in range(i, n + 1, i): -        cnt += b[j] -    if a[i - 1] != cnt % 2: -        b[i] = 1 -        ls.append(i) -print((len(ls))) -if len(ls) != 0: -    print((*ls)) +ls = [0] * n +ans = [] +for i in range(n - 1, -1, -1): +    t = 0 +    for j in range(i, n, (i + 1)): +        t += ls[j] +    if a[i] != t % 2: +        ans.append(i + 1) +        ls[i] = 1 +print((len(ans))) +if len(ans) != 0: +    print((*ans))