N = int(eval(input()))

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



B = [0]*N



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

  count = 0

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

    count += B[j]

    if count%2 == A[i]:

      B[i] = 0

    else:

      B[i] = 1



sum = sum(B)

if sum == 0:

  print((0))

else:

  print(sum)

  ans = []

  for i in range(N):

    if B[i] == 1:

      ans.append(i+1)

  print((*ans))

N = int(eval(input()))

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



B = [0]*N



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

  count = 0

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

    count += B[j]

  if count%2 == A[i]:

    B[i] = 0

  else:

    B[i] = 1



sum = sum(B)

if sum == 0:

  print((0))

else:

  print(sum)

  ans = []

  for i in range(N):

    if B[i] == 1:

      ans.append(i+1)

  print((*ans))

N = int(eval(input()))
A = list(map(int, input().split()))
B = [0] * N
for i in range(N - 1, -1, -1):
    count = 0
    for j in range(i, N, i + 1):
        count += B[j]
        if count % 2 == A[i]:
            B[i] = 0
        else:
            B[i] = 1
sum = sum(B)
if sum == 0:
    print((0))
else:
    print(sum)
    ans = []
    for i in range(N):
        if B[i] == 1:
            ans.append(i + 1)
    print((*ans))

N = int(eval(input()))
A = list(map(int, input().split()))
B = [0] * N
for i in range(N - 1, -1, -1):
    count = 0
    for j in range(i, N, i + 1):
        count += B[j]
    if count % 2 == A[i]:
        B[i] = 0
    else:
        B[i] = 1
sum = sum(B)
if sum == 0:
    print((0))
else:
    print(sum)
    ans = []
    for i in range(N):
        if B[i] == 1:
            ans.append(i + 1)
    print((*ans))

-        if count % 2 == A[i]: -            B[i] = 0 -        else: -            B[i] = 1 +    if count % 2 == A[i]: +        B[i] = 0 +    else: +        B[i] = 1