n=int(eval(input()))

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

B=[0]*(n+1)

B[n//2+1:]=A[n//2+1:]

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

  B[i]=(sum([B[j] for j in range(2*i, n+1, i)])+A[i])&1

res=[]

for i in range(n+1):

  if B[i]==1:

    res.append(i)

print((len(res)))

if res:

  print((*res))

    
N=int(eval(input()))

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

a.insert(0, 0)

b=[0 for _ in range(N+1)]

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

    s=0

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

        s=s^b[j]

    b[i]=s^a[i]

ans=[]

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

    if b[i]==1:

        ans.append(i)

print((len(ans)))

if len(ans):

    print((" ".join(map(str, ans))))

n = int(eval(input()))
A = [0] + list(map(int, input().split()))
B = [0] * (n + 1)
B[n // 2 + 1 :] = A[n // 2 + 1 :]
for i in range(n // 2, 0, -1):
    B[i] = (sum([B[j] for j in range(2 * i, n + 1, i)]) + A[i]) & 1
res = []
for i in range(n + 1):
    if B[i] == 1:
        res.append(i)
print((len(res)))
if res:
    print((*res))

N = int(eval(input()))
a = list(map(int, input().split()))
a.insert(0, 0)
b = [0 for _ in range(N + 1)]
for i in range(N, 0, -1):
    s = 0
    for j in range(i, N + 1, i):
        s = s ^ b[j]
    b[i] = s ^ a[i]
ans = []
for i in range(1, N + 1):
    if b[i] == 1:
        ans.append(i)
print((len(ans)))
if len(ans):
    print((" ".join(map(str, ans))))

-n = int(eval(input())) -A = [0] + list(map(int, input().split())) -B = [0] * (n + 1) -B[n // 2 + 1 :] = A[n // 2 + 1 :] -for i in range(n // 2, 0, -1): -    B[i] = (sum([B[j] for j in range(2 * i, n + 1, i)]) + A[i]) & 1 -res = [] -for i in range(n + 1): -    if B[i] == 1: -        res.append(i) -print((len(res))) -if res: -    print((*res)) +N = int(eval(input())) +a = list(map(int, input().split())) +a.insert(0, 0) +b = [0 for _ in range(N + 1)] +for i in range(N, 0, -1): +    s = 0 +    for j in range(i, N + 1, i): +        s = s ^ b[j] +    b[i] = s ^ a[i] +ans = [] +for i in range(1, N + 1): +    if b[i] == 1: +        ans.append(i) +print((len(ans))) +if len(ans): +    print((" ".join(map(str, ans))))