N, *a = list(map(int, open(0).read().split()))



dp = [0] * N

for i in reversed(list(range(N))):

    cnt = sum(dp[i::i + 1])

    if cnt % 2 == a[i]:

        dp[i] = 0

    else:

        dp[i] = 1

            

if True:

    b_bin = [i + 1 for i in range(N) if dp[i] > 0]

    print((len(b_bin)))

    print((*b_bin))

else:

    print((-1))
N, *A = list(map(int, open(0).read().split()))



x = [0] * (N + 1)

ans = []

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

    tmp = 0

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

        tmp += x[j]



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

        x[i] += 1

        ans.append(i)



print((len(ans)))

if ans:

    print((*ans))



N, *a = list(map(int, open(0).read().split()))
dp = [0] * N
for i in reversed(list(range(N))):
    cnt = sum(dp[i :: i + 1])
    if cnt % 2 == a[i]:
        dp[i] = 0
    else:
        dp[i] = 1
if True:
    b_bin = [i + 1 for i in range(N) if dp[i] > 0]
    print((len(b_bin)))
    print((*b_bin))
else:
    print((-1))

N, *A = list(map(int, open(0).read().split()))
x = [0] * (N + 1)
ans = []
for i in reversed(list(range(1, N + 1))):
    tmp = 0
    for j in range(i, N + 1, i):
        tmp += x[j]
    if tmp % 2 != A[i - 1]:
        x[i] += 1
        ans.append(i)
print((len(ans)))
if ans:
    print((*ans))

-N, *a = list(map(int, open(0).read().split())) -dp = [0] * N -for i in reversed(list(range(N))): -    cnt = sum(dp[i :: i + 1]) -    if cnt % 2 == a[i]: -        dp[i] = 0 -    else: -        dp[i] = 1 -if True: -    b_bin = [i + 1 for i in range(N) if dp[i] > 0] -    print((len(b_bin))) -    print((*b_bin)) -else: -    print((-1)) +N, *A = list(map(int, open(0).read().split())) +x = [0] * (N + 1) +ans = [] +for i in reversed(list(range(1, N + 1))): +    tmp = 0 +    for j in range(i, N + 1, i): +        tmp += x[j] +    if tmp % 2 != A[i - 1]: +        x[i] += 1 +        ans.append(i) +print((len(ans))) +if ans: +    print((*ans))