# ABC134D - Preparing Boxes

# Better ver.

def main():

    n = int(eval(input()))

    A = [0] + list(map(int, input().rstrip().split()))

    ans = []  # answer "in any order"

    ans_append = ans.append

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

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

        if A[i]:

            ans_append(i)

    print((len(ans)))

    print((*ans))





if __name__ == "__main__":

    main()
# ABC134D - Preparing Boxes

def main():

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

    A = [0] + A

    for i in range(N // 2, 0, -1):  # second half: no multiples

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

    ans = [i for i, j in enumerate(A) if j]

    print((len(ans)))

    print((*ans))





if __name__ == "__main__":

    main()
# ABC134D - Preparing Boxes
# Better ver.
def main():
    n = int(eval(input()))
    A = [0] + list(map(int, input().rstrip().split()))
    ans = []  # answer "in any order"
    ans_append = ans.append
    for i in range(n, 0, -1):
        A[i] = sum(A[i::i]) % 2
        if A[i]:
            ans_append(i)
    print((len(ans)))
    print((*ans))


if __name__ == "__main__":
    main()

# ABC134D - Preparing Boxes
def main():
    N, *A = list(map(int, open(0).read().split()))
    A = [0] + A
    for i in range(N // 2, 0, -1):  # second half: no multiples
        A[i] = sum(A[i::i]) % 2
    ans = [i for i, j in enumerate(A) if j]
    print((len(ans)))
    print((*ans))


if __name__ == "__main__":
    main()

-# Better ver. -    n = int(eval(input())) -    A = [0] + list(map(int, input().rstrip().split())) -    ans = []  # answer "in any order" -    ans_append = ans.append -    for i in range(n, 0, -1): +    N, *A = list(map(int, open(0).read().split())) +    A = [0] + A +    for i in range(N // 2, 0, -1):  # second half: no multiples -        if A[i]: -            ans_append(i) +    ans = [i for i, j in enumerate(A) if j]