N = int(eval(input()))

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

b = set([i for i in range(N//2 + 1, N + 1) if a[i] == 1])



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

    k, temp = 2, 0

    while k * i < N + 1:

        if k * i in b:

            temp += 1

        k += 1

    if temp % 2 != a[i]:

        b.add(i)



if len(b) > 0:

    print((len(b)))

    print((' '.join(list(map(str, sorted(list(b)))))))

else:

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

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

b = set([i for i in range(N//2 + 1, N + 1) if a[i] == 1])



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

    if sum([1 for k in range(2, N//i + 1) if k*i in b]) % 2 != a[i]:

        b.add(i)



if len(b) > 0:

    print((len(b)))

    print((' '.join(list(map(str, sorted(list(b)))))))

else:

    print((0))
N = int(eval(input()))
a = [0] + list(map(int, input().split()))
b = set([i for i in range(N // 2 + 1, N + 1) if a[i] == 1])
for i in range(N // 2, 0, -1):
    k, temp = 2, 0
    while k * i < N + 1:
        if k * i in b:
            temp += 1
        k += 1
    if temp % 2 != a[i]:
        b.add(i)
if len(b) > 0:
    print((len(b)))
    print((" ".join(list(map(str, sorted(list(b)))))))
else:
    print((0))

N = int(eval(input()))
a = [0] + list(map(int, input().split()))
b = set([i for i in range(N // 2 + 1, N + 1) if a[i] == 1])
for i in range(N // 2, 0, -1):
    if sum([1 for k in range(2, N // i + 1) if k * i in b]) % 2 != a[i]:
        b.add(i)
if len(b) > 0:
    print((len(b)))
    print((" ".join(list(map(str, sorted(list(b)))))))
else:
    print((0))

-    k, temp = 2, 0 -    while k * i < N + 1: -        if k * i in b: -            temp += 1 -        k += 1 -    if temp % 2 != a[i]: +    if sum([1 for k in range(2, N // i + 1) if k * i in b]) % 2 != a[i]: