N = int(input())

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

B = [0]*N

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

  s = A[i-1]

  k = i*2

  while k<=N:

    s ^= B[k-1]

    k += i

  if s==1:

    B[i-1] = s

if sum(B)==0:

  print(0)

else:

  print(sum(B))

  for i in range(N):

    if B[i]==1:

      print(i+1,end=' ')

N = int(eval(input()))

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

lis = [0]*(N+1)

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

  k = i*2

  cnt = 0

  while k<=N:

    cnt ^= lis[k]

    k += i

  lis[i] = cnt^A[i-1]

print((lis.count(1)))

ans = []

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

  if lis[i]==1:

    ans.append(i)

if len(ans):

  print((*ans))
N = int(input())
A = list(map(int, input().split()))
B = [0] * N
for i in range(N, 0, -1):
    s = A[i - 1]
    k = i * 2
    while k <= N:
        s ^= B[k - 1]
        k += i
    if s == 1:
        B[i - 1] = s
if sum(B) == 0:
    print(0)
else:
    print(sum(B))
    for i in range(N):
        if B[i] == 1:
            print(i + 1, end=" ")

N = int(eval(input()))
A = list(map(int, input().split()))
lis = [0] * (N + 1)
for i in range(N, 0, -1):
    k = i * 2
    cnt = 0
    while k <= N:
        cnt ^= lis[k]
        k += i
    lis[i] = cnt ^ A[i - 1]
print((lis.count(1)))
ans = []
for i in range(1, N + 1):
    if lis[i] == 1:
        ans.append(i)
if len(ans):
    print((*ans))

-N = int(input()) +N = int(eval(input())) -B = [0] * N +lis = [0] * (N + 1) -    s = A[i - 1] +    cnt = 0 -        s ^= B[k - 1] +        cnt ^= lis[k] -    if s == 1: -        B[i - 1] = s -if sum(B) == 0: -    print(0) -else: -    print(sum(B)) -    for i in range(N): -        if B[i] == 1: -            print(i + 1, end=" ") +    lis[i] = cnt ^ A[i - 1] +print((lis.count(1))) +ans = [] +for i in range(1, N + 1): +    if lis[i] == 1: +        ans.append(i) +if len(ans): +    print((*ans))