def divs(n):

    res = []

    i = 1

    while i**2 <= n:

        if n%i == 0: 

            res.append(i)

            if i**2 != n:

                res.append(n//i)

        i+=1 

    return res





def main():

    n = int(eval(input()))

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

    if sum(al_0) == 0:

        print((0))

        return



    al = [0] + al_0

    divs_cnts = [0]*(n+1)

    ans = []

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

        if divs_cnts[i]%2 != al[i]%2:

            ans.append(i)

            div_l = divs(i)

            for d in div_l:

                divs_cnts[d] += 1



    print((len(ans)))

    print((*ans))





if __name__ == "__main__":

    main()
N = int(eval(input()))

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



al = [0] + al # 1-index

multi_cnts = [0]*(N+1)

ans = []

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

    if multi_cnts[n] != al[n]:

        ans.append(n)

        for i in range(1, int(n**0.5)+1):

            if n%i == 0:

                multi_cnts[i]+=1

                multi_cnts[i]%=2

                if i*i != n:

                    multi_cnts[n//i]+=1

                    multi_cnts[n//i]%=2





print((len(ans)))

if ans: print((*ans))
def divs(n):
    res = []
    i = 1
    while i**2 <= n:
        if n % i == 0:
            res.append(i)
            if i**2 != n:
                res.append(n // i)
        i += 1
    return res


def main():
    n = int(eval(input()))
    al_0 = list(map(int, input().split()))
    if sum(al_0) == 0:
        print((0))
        return
    al = [0] + al_0
    divs_cnts = [0] * (n + 1)
    ans = []
    for i in range(n, 0, -1):
        if divs_cnts[i] % 2 != al[i] % 2:
            ans.append(i)
            div_l = divs(i)
            for d in div_l:
                divs_cnts[d] += 1
    print((len(ans)))
    print((*ans))


if __name__ == "__main__":
    main()

N = int(eval(input()))
al = list(map(int, input().split()))
al = [0] + al  # 1-index
multi_cnts = [0] * (N + 1)
ans = []
for n in range(N, 0, -1):
    if multi_cnts[n] != al[n]:
        ans.append(n)
        for i in range(1, int(n**0.5) + 1):
            if n % i == 0:
                multi_cnts[i] += 1
                multi_cnts[i] %= 2
                if i * i != n:
                    multi_cnts[n // i] += 1
                    multi_cnts[n // i] %= 2
print((len(ans)))
if ans:
    print((*ans))

-def divs(n): -    res = [] -    i = 1 -    while i**2 <= n: -        if n % i == 0: -            res.append(i) -            if i**2 != n: -                res.append(n // i) -        i += 1 -    return res - - -def main(): -    n = int(eval(input())) -    al_0 = list(map(int, input().split())) -    if sum(al_0) == 0: -        print((0)) -        return -    al = [0] + al_0 -    divs_cnts = [0] * (n + 1) -    ans = [] -    for i in range(n, 0, -1): -        if divs_cnts[i] % 2 != al[i] % 2: -            ans.append(i) -            div_l = divs(i) -            for d in div_l: -                divs_cnts[d] += 1 -    print((len(ans))) +N = int(eval(input())) +al = list(map(int, input().split())) +al = [0] + al  # 1-index +multi_cnts = [0] * (N + 1) +ans = [] +for n in range(N, 0, -1): +    if multi_cnts[n] != al[n]: +        ans.append(n) +        for i in range(1, int(n**0.5) + 1): +            if n % i == 0: +                multi_cnts[i] += 1 +                multi_cnts[i] %= 2 +                if i * i != n: +                    multi_cnts[n // i] += 1 +                    multi_cnts[n // i] %= 2 +print((len(ans))) +if ans: - - -if __name__ == "__main__": -    main()