N=int(eval(input()))

lst = [int(s) for s in input().split()]

ans=[0]*N

result=[]

def now(num):

  res=0

  k=1

  while(k*num<=N):

    res=res+ans[k*num-1]

    k=k+1

  return res%2

for i in range(N):

  n=N-i

  x=lst[n-1]

  y=now(n)

  if(x!=y):

    ans[n-1]=1

    result.append(n)

result.sort()

print((len(result)))

if (len(result)!=0):

  print((' '.join(map(str, result))))
N=int(eval(input()))

binaly=[int(s) for s in input().split()]



boxes=[0 for _ in range(N)]

ans=set()



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

  if sum(boxes[i::i+1])%2!=binaly[i]:

    boxes[i]=1

    ans.add(i+1)

print((len(ans)))

print((*ans))
N = int(eval(input()))
lst = [int(s) for s in input().split()]
ans = [0] * N
result = []


def now(num):
    res = 0
    k = 1
    while k * num <= N:
        res = res + ans[k * num - 1]
        k = k + 1
    return res % 2


for i in range(N):
    n = N - i
    x = lst[n - 1]
    y = now(n)
    if x != y:
        ans[n - 1] = 1
        result.append(n)
result.sort()
print((len(result)))
if len(result) != 0:
    print((" ".join(map(str, result))))

N = int(eval(input()))
binaly = [int(s) for s in input().split()]
boxes = [0 for _ in range(N)]
ans = set()
for i in range(N - 1, -1, -1):
    if sum(boxes[i :: i + 1]) % 2 != binaly[i]:
        boxes[i] = 1
        ans.add(i + 1)
print((len(ans)))
print((*ans))

-lst = [int(s) for s in input().split()] -ans = [0] * N -result = [] - - -def now(num): -    res = 0 -    k = 1 -    while k * num <= N: -        res = res + ans[k * num - 1] -        k = k + 1 -    return res % 2 - - -for i in range(N): -    n = N - i -    x = lst[n - 1] -    y = now(n) -    if x != y: -        ans[n - 1] = 1 -        result.append(n) -result.sort() -print((len(result))) -if len(result) != 0: -    print((" ".join(map(str, result)))) +binaly = [int(s) for s in input().split()] +boxes = [0 for _ in range(N)] +ans = set() +for i in range(N - 1, -1, -1): +    if sum(boxes[i :: i + 1]) % 2 != binaly[i]: +        boxes[i] = 1 +        ans.add(i + 1) +print((len(ans))) +print((*ans))