N = int(eval(input()))

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



ans = [0]*(N+1)



for i in range(1, N + 1)[::-1]:

    sum_ans = sum(ans[x] for x in range(i, N + 1, i))

    if sum_ans % 2 != A[i - 1]:

        ans[i] = 1

        

print((sum(ans)))

# print(ans)



prt = []

if sum(ans) > 0:

  for i, v in enumerate(ans):

    if v != 0:

      prt.append(i)

  print((*prt))

  
n = int(eval(input()))

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



box = [0] * n

ans = []



cnt = 0

for itr, val in enumerate(A[::-1]):

  idx = n - itr -1

  sums_mod2 = sum(box[idx::idx+1]) % 2

  if val != sums_mod2:

    box[idx] += 1

    cnt += 1

    ans.append(idx + 1)

    

print(cnt)

print((*ans))
N = int(eval(input()))
A = list(map(int, input().split()))
ans = [0] * (N + 1)
for i in range(1, N + 1)[::-1]:
    sum_ans = sum(ans[x] for x in range(i, N + 1, i))
    if sum_ans % 2 != A[i - 1]:
        ans[i] = 1
print((sum(ans)))
# print(ans)
prt = []
if sum(ans) > 0:
    for i, v in enumerate(ans):
        if v != 0:
            prt.append(i)
    print((*prt))

n = int(eval(input()))
A = list(map(int, input().split()))
box = [0] * n
ans = []
cnt = 0
for itr, val in enumerate(A[::-1]):
    idx = n - itr - 1
    sums_mod2 = sum(box[idx :: idx + 1]) % 2
    if val != sums_mod2:
        box[idx] += 1
        cnt += 1
        ans.append(idx + 1)
print(cnt)
print((*ans))

-N = int(eval(input())) +n = int(eval(input())) -ans = [0] * (N + 1) -for i in range(1, N + 1)[::-1]: -    sum_ans = sum(ans[x] for x in range(i, N + 1, i)) -    if sum_ans % 2 != A[i - 1]: -        ans[i] = 1 -print((sum(ans))) -# print(ans) -prt = [] -if sum(ans) > 0: -    for i, v in enumerate(ans): -        if v != 0: -            prt.append(i) -    print((*prt)) +box = [0] * n +ans = [] +cnt = 0 +for itr, val in enumerate(A[::-1]): +    idx = n - itr - 1 +    sums_mod2 = sum(box[idx :: idx + 1]) % 2 +    if val != sums_mod2: +        box[idx] += 1 +        cnt += 1 +        ans.append(idx + 1) +print(cnt) +print((*ans))