n = int(eval(input()))

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

b = [0] * (n + 1)



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

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

        b[i] ^= b[j]

    b[i] ^= a[i]



print((sum(b)))

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

    if b[i] == 1:

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

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



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

    a[i] = sum(a[i::i]) % 2



print((sum(a)))

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

    if a[i] == 1:

        print(i)
n = int(eval(input()))
a = [0] + list(map(int, input().split()))
b = [0] * (n + 1)
for i in range(n, 0, -1):
    for j in range(i, n + 1, i):
        b[i] ^= b[j]
    b[i] ^= a[i]
print((sum(b)))
for i in range(1, n + 1):
    if b[i] == 1:
        print(i)

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

-b = [0] * (n + 1) -    for j in range(i, n + 1, i): -        b[i] ^= b[j] -    b[i] ^= a[i] -print((sum(b))) +    a[i] = sum(a[i::i]) % 2 +print((sum(a))) -    if b[i] == 1: +    if a[i] == 1: