n = int(eval(input()))

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



ans = [0]*n



for i in reversed(list(range(n))):

  j = i+1

  b = 0

  while j <= n:

    b += ans[j-1]

    j += i+1

  if b%2 != l[i]:

    ans[i] = 1



print((sum(ans)))

print((' '.join(map(str, [i+1 for i, x in enumerate(ans) if x!= 0]))))
n = int(eval(input()))

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



B = [0]*n



for i in reversed(list(range(n))):

    j = i+1

    cnt = 0

    while j <= n:

        cnt += B[j-1]

        j += i+1

    if cnt%2 != A[i]:

        B[i] = 1



m = 0

ans = []

for i, b in enumerate(B):

    if b != 0:

        m += 1

        ans.append(i+1)

print(m)

if len(ans) > 0:

    print((*ans))
n = int(eval(input()))
l = list(map(int, input().split()))
ans = [0] * n
for i in reversed(list(range(n))):
    j = i + 1
    b = 0
    while j <= n:
        b += ans[j - 1]
        j += i + 1
    if b % 2 != l[i]:
        ans[i] = 1
print((sum(ans)))
print((" ".join(map(str, [i + 1 for i, x in enumerate(ans) if x != 0]))))

n = int(eval(input()))
A = list(map(int, input().split()))
B = [0] * n
for i in reversed(list(range(n))):
    j = i + 1
    cnt = 0
    while j <= n:
        cnt += B[j - 1]
        j += i + 1
    if cnt % 2 != A[i]:
        B[i] = 1
m = 0
ans = []
for i, b in enumerate(B):
    if b != 0:
        m += 1
        ans.append(i + 1)
print(m)
if len(ans) > 0:
    print((*ans))

-l = list(map(int, input().split())) -ans = [0] * n +A = list(map(int, input().split())) +B = [0] * n -    b = 0 +    cnt = 0 -        b += ans[j - 1] +        cnt += B[j - 1] -    if b % 2 != l[i]: -        ans[i] = 1 -print((sum(ans))) -print((" ".join(map(str, [i + 1 for i, x in enumerate(ans) if x != 0])))) +    if cnt % 2 != A[i]: +        B[i] = 1 +m = 0 +ans = [] +for i, b in enumerate(B): +    if b != 0: +        m += 1 +        ans.append(i + 1) +print(m) +if len(ans) > 0: +    print((*ans))