N = int(input())

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



b = [0] * (N + 1)

half = N // 2

b[half + 1:] = A[half:]

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

    s = sum([b[j] for j in range(i * 2, N + 1, i)]) % 2

    if s != A[i - 1]:

        b[i] = 1

s = sum(b)

if s % 2 != A[0]:

    b[1] = 1

    s += 1

print(s)

for i, b_ in enumerate(b[:]):

    if b_ == 1:

        print(i, end=" ")

N = int(eval(input()))

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



b = [0] * (N + 1)

half = N // 2

b[half + 1:] = A[half:]

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

    s = sum([b[j] for j in range(i * 2, N + 1, i)]) % 2

    if s != A[i - 1]:

        b[i] = 1

s = sum(b)

if s % 2 != A[0]:

    b[1] = 1

    s += 1

print(s)

print((*[i for i in range(1, N + 1) if b[i] == 1]))
N = int(input())
A = list(map(int, input().split()))
b = [0] * (N + 1)
half = N // 2
b[half + 1 :] = A[half:]
for i in range(half, 1, -1):
    s = sum([b[j] for j in range(i * 2, N + 1, i)]) % 2
    if s != A[i - 1]:
        b[i] = 1
s = sum(b)
if s % 2 != A[0]:
    b[1] = 1
    s += 1
print(s)
for i, b_ in enumerate(b[:]):
    if b_ == 1:
        print(i, end=" ")

N = int(eval(input()))
A = list(map(int, input().split()))
b = [0] * (N + 1)
half = N // 2
b[half + 1 :] = A[half:]
for i in range(half, 1, -1):
    s = sum([b[j] for j in range(i * 2, N + 1, i)]) % 2
    if s != A[i - 1]:
        b[i] = 1
s = sum(b)
if s % 2 != A[0]:
    b[1] = 1
    s += 1
print(s)
print((*[i for i in range(1, N + 1) if b[i] == 1]))

-N = int(input()) +N = int(eval(input())) -for i, b_ in enumerate(b[:]): -    if b_ == 1: -        print(i, end=" ") +print((*[i for i in range(1, N + 1) if b[i] == 1]))