

n = int(eval(input()))

a = [0] + [int(i) for i in input().split()]

retval = [0] * (n+1)



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

    p = sum([retval[x] for x in range(i+i,n+1,i)])

    retval[i] = (p%2) ^ a[i]



print((sum(retval)))

print((" ".join(str(i) for i in range(1,n+1) if retval[i])))

def main():

    N = int(eval(input()))

    A = [int(i) for i in input().split()]

    B = [0]*N

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

        cur_sum = -B[i]

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

            cur_sum += B[j]

        if cur_sum % 2 != A[i] % 2:

            B[i] = 1

    # print(B)

    ans = [i+1 for i, b in enumerate(B) if b]

    print((len(ans)))

    if ans:

        print((*ans))





if __name__ == '__main__':

    main()

n = int(eval(input()))
a = [0] + [int(i) for i in input().split()]
retval = [0] * (n + 1)
for i in range(n, 0, -1):
    p = sum([retval[x] for x in range(i + i, n + 1, i)])
    retval[i] = (p % 2) ^ a[i]
print((sum(retval)))
print((" ".join(str(i) for i in range(1, n + 1) if retval[i])))

def main():
    N = int(eval(input()))
    A = [int(i) for i in input().split()]
    B = [0] * N
    for i in range(N)[::-1]:
        cur_sum = -B[i]
        for j in range(i, N, i + 1):
            cur_sum += B[j]
        if cur_sum % 2 != A[i] % 2:
            B[i] = 1
    # print(B)
    ans = [i + 1 for i, b in enumerate(B) if b]
    print((len(ans)))
    if ans:
        print((*ans))


if __name__ == "__main__":
    main()

-n = int(eval(input())) -a = [0] + [int(i) for i in input().split()] -retval = [0] * (n + 1) -for i in range(n, 0, -1): -    p = sum([retval[x] for x in range(i + i, n + 1, i)]) -    retval[i] = (p % 2) ^ a[i] -print((sum(retval))) -print((" ".join(str(i) for i in range(1, n + 1) if retval[i]))) +def main(): +    N = int(eval(input())) +    A = [int(i) for i in input().split()] +    B = [0] * N +    for i in range(N)[::-1]: +        cur_sum = -B[i] +        for j in range(i, N, i + 1): +            cur_sum += B[j] +        if cur_sum % 2 != A[i] % 2: +            B[i] = 1 +    # print(B) +    ans = [i + 1 for i, b in enumerate(B) if b] +    print((len(ans))) +    if ans: +        print((*ans)) + + +if __name__ == "__main__": +    main()