N=int(eval(input()))

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

B=[0] * N

ans = []

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

    a = A[i-1]

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

        tmp = i * j

        if tmp > N:

            break

        a += B[tmp-1]

    if a % 2 == 1:

        ans.append(i)

    B[i-1] = a % 2

print((len(ans)))

for a in ans:

    print(a)
N=int(eval(input()))

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

ans = []

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

    a = A[i-1]

    for j in range(2, N+1):

        tmp = i * j

        if tmp > N:

            break

        a += A[tmp-1]

    if a % 2 == 1:

        ans.append(i)

    A[i-1] = a % 2

print((len(ans)))

for a in ans:

    print(a)
N = int(eval(input()))
A = list(map(int, input().split()))
B = [0] * N
ans = []
for i in reversed(list(range(1, N + 1))):
    a = A[i - 1]
    for j in range(1, N + 1):
        tmp = i * j
        if tmp > N:
            break
        a += B[tmp - 1]
    if a % 2 == 1:
        ans.append(i)
    B[i - 1] = a % 2
print((len(ans)))
for a in ans:
    print(a)

N = int(eval(input()))
A = list(map(int, input().split()))
ans = []
for i in reversed(list(range(1, N + 1))):
    a = A[i - 1]
    for j in range(2, N + 1):
        tmp = i * j
        if tmp > N:
            break
        a += A[tmp - 1]
    if a % 2 == 1:
        ans.append(i)
    A[i - 1] = a % 2
print((len(ans)))
for a in ans:
    print(a)

-B = [0] * N -    for j in range(1, N + 1): +    for j in range(2, N + 1): -        a += B[tmp - 1] +        a += A[tmp - 1] -    B[i - 1] = a % 2 +    A[i - 1] = a % 2