import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

def main():

    N = int(readline())

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

    table = [0 for _ in range(N+1)]     

    def S(a, i):

        res = 0

        j = i

        while i <= N:

            res += a[i]

            i += j

        return res%2



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

        x = S(table, i)

        table[i] = (S(table, i)+a[i])%2



    m = sum(table)

    print(m)

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

        if table[i]:

            print(i, end=' ')

if __name__ == '__main__':

    main()

import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

def main():

    N = int(readline())

    A = [0] + [int(i) for i in readline().split()]

    table = [0 for _ in range(N+1)] 

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

        table[i] = (sum(table[::i])+A[i])%2

    print(sum(table))

    for i in range(N):

        if table[i+1]:

            print(i+1, end=' ')

if __name__ == '__main__':

    main()

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():
    N = int(readline())
    a = [0] + [int(i) for i in readline().split()]
    table = [0 for _ in range(N + 1)]

    def S(a, i):
        res = 0
        j = i
        while i <= N:
            res += a[i]
            i += j
        return res % 2

    for i in reversed(range(1, N + 1)):
        x = S(table, i)
        table[i] = (S(table, i) + a[i]) % 2
    m = sum(table)
    print(m)
    for i in range(1, N + 1):
        if table[i]:
            print(i, end=" ")


if __name__ == "__main__":
    main()

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():
    N = int(readline())
    A = [0] + [int(i) for i in readline().split()]
    table = [0 for _ in range(N + 1)]
    for i in [int(i) for i in range(1, N + 1)][::-1]:
        table[i] = (sum(table[::i]) + A[i]) % 2
    print(sum(table))
    for i in range(N):
        if table[i + 1]:
            print(i + 1, end=" ")


if __name__ == "__main__":
    main()

-    a = [0] + [int(i) for i in readline().split()] +    A = [0] + [int(i) for i in readline().split()] - -    def S(a, i): -        res = 0 -        j = i -        while i <= N: -            res += a[i] -            i += j -        return res % 2 - -    for i in reversed(range(1, N + 1)): -        x = S(table, i) -        table[i] = (S(table, i) + a[i]) % 2 -    m = sum(table) -    print(m) -    for i in range(1, N + 1): -        if table[i]: -            print(i, end=" ") +    for i in [int(i) for i in range(1, N + 1)][::-1]: +        table[i] = (sum(table[::i]) + A[i]) % 2 +    print(sum(table)) +    for i in range(N): +        if table[i + 1]: +            print(i + 1, end=" ")