N = int(eval(input()))

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

res = [0] * N

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

    tmp = 0

    for j in range(i * (N // i), i, -i):

        tmp += res[j - 1]

    if A[i - 1] != (tmp + res[i - 1]) % 2:

        res[i - 1] ^= 1

print((sum(res)))

ans = [i + 1 for i, v in enumerate(res) if v == 1]

if ans:

    print((*ans))

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)))

ans = [i for i, v in enumerate(A) if v]

print((*[i for i, v in enumerate(A) if v]))

N = int(eval(input()))
A = list(map(int, input().split()))
res = [0] * N
for i in range(N, 0, -1):
    tmp = 0
    for j in range(i * (N // i), i, -i):
        tmp += res[j - 1]
    if A[i - 1] != (tmp + res[i - 1]) % 2:
        res[i - 1] ^= 1
print((sum(res)))
ans = [i + 1 for i, v in enumerate(res) if v == 1]
if ans:
    print((*ans))

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)))
ans = [i for i, v in enumerate(A) if v]
print((*[i for i, v in enumerate(A) if v]))

-A = list(map(int, input().split())) -res = [0] * N +A = [0] + list(map(int, input().split())) -    tmp = 0 -    for j in range(i * (N // i), i, -i): -        tmp += res[j - 1] -    if A[i - 1] != (tmp + res[i - 1]) % 2: -        res[i - 1] ^= 1 -print((sum(res))) -ans = [i + 1 for i, v in enumerate(res) if v == 1] -if ans: -    print((*ans)) +    A[i] = sum(A[i::i]) % 2 +print((sum(A))) +ans = [i for i, v in enumerate(A) if v] +print((*[i for i, v in enumerate(A) if v]))