N = int(eval(input()))



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



ball = [-1 for i in range(N)]



for i in range(N):

    num=N-i

    s = 0

    for i in range(N//num):

        if ball[(N//num - i)*num-1]!=-1:

            s+=ball[(N//num - i)*num-1]

        else:

            ball[(N//num - i)*num-1]=(a[num-1]-s)%2

ans = []

for i in range(N):

    if ball[i]==1:

        ans.append(i+1)



print((len(ans)))

if len(ans)!=0:

    print((*ans))
N = int(eval(input()))

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



b = [0]*N



for i in range(N):

    j = N-i

    k = 2*j

    context = 0

    while k<=N:

        context+=b[k-1]

        k+=j

    if context%2==a[j-1]:

        b[j-1]=0

    else:

        b[j-1]=1



M=sum(b)



ans = []

for i,v in enumerate(b):

    if v==1:

        ans.append(i+1)



print(M)

print((*ans))
N = int(eval(input()))
a = list(map(int, input().split()))
ball = [-1 for i in range(N)]
for i in range(N):
    num = N - i
    s = 0
    for i in range(N // num):
        if ball[(N // num - i) * num - 1] != -1:
            s += ball[(N // num - i) * num - 1]
        else:
            ball[(N // num - i) * num - 1] = (a[num - 1] - s) % 2
ans = []
for i in range(N):
    if ball[i] == 1:
        ans.append(i + 1)
print((len(ans)))
if len(ans) != 0:
    print((*ans))

N = int(eval(input()))
a = list(map(int, input().split()))
b = [0] * N
for i in range(N):
    j = N - i
    k = 2 * j
    context = 0
    while k <= N:
        context += b[k - 1]
        k += j
    if context % 2 == a[j - 1]:
        b[j - 1] = 0
    else:
        b[j - 1] = 1
M = sum(b)
ans = []
for i, v in enumerate(b):
    if v == 1:
        ans.append(i + 1)
print(M)
print((*ans))

-ball = [-1 for i in range(N)] +b = [0] * N -    num = N - i -    s = 0 -    for i in range(N // num): -        if ball[(N // num - i) * num - 1] != -1: -            s += ball[(N // num - i) * num - 1] -        else: -            ball[(N // num - i) * num - 1] = (a[num - 1] - s) % 2 +    j = N - i +    k = 2 * j +    context = 0 +    while k <= N: +        context += b[k - 1] +        k += j +    if context % 2 == a[j - 1]: +        b[j - 1] = 0 +    else: +        b[j - 1] = 1 +M = sum(b) -for i in range(N): -    if ball[i] == 1: +for i, v in enumerate(b): +    if v == 1: -print((len(ans))) -if len(ans) != 0: -    print((*ans)) +print(M) +print((*ans))