import sys

input = sys.stdin.readline



def sumN(n,N,f):

	total = 0

	i = n

	while i < N:

		total += f[i]

		i += n+1



	if total % 2:

		return 1

	else:

		return 0



def main():

	N = int(eval(input()))

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

	ball = []

	ballNum = 0

	f = [0]*N



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

		if sumN(i,N,f) != (a[i] % 2):

			f[i] = 1

			ball.append(i+1)

			ballNum +=1



	if (sum(f) % 2) != (a[0] % 2):

		f[0] = 1

		ball.append(1)

		ballNum +=1



	print(ballNum)

	print((*ball))



if __name__ == "__main__":

	main()

import sys

input = sys.stdin.readline



def sumN(n,N,f):

	total = 0

	i = n

	while i < N:

		total += f[i]

		i += n+1



	if total % 2:

		return 1

	else:

		return 0



def main():

	N = int(eval(input()))

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

	ball = []

	ballNum = 0

	f = [0]*N



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

		if (sum(f[i::i+1])%2) != (a[i] % 2):

			f[i] = 1

			ball.append(i+1)

			ballNum +=1



	if (sum(f) % 2) != (a[0] % 2):

		f[0] = 1

		ball.append(1)

		ballNum +=1



	print(ballNum)

	print((*ball))



if __name__ == "__main__":

	main()

import sys

input = sys.stdin.readline


def sumN(n, N, f):
    total = 0
    i = n
    while i < N:
        total += f[i]
        i += n + 1
    if total % 2:
        return 1
    else:
        return 0


def main():
    N = int(eval(input()))
    a = list(map(int, input().split()))
    ball = []
    ballNum = 0
    f = [0] * N
    for i in reversed(list(range(1, N))):
        if sumN(i, N, f) != (a[i] % 2):
            f[i] = 1
            ball.append(i + 1)
            ballNum += 1
    if (sum(f) % 2) != (a[0] % 2):
        f[0] = 1
        ball.append(1)
        ballNum += 1
    print(ballNum)
    print((*ball))


if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline


def sumN(n, N, f):
    total = 0
    i = n
    while i < N:
        total += f[i]
        i += n + 1
    if total % 2:
        return 1
    else:
        return 0


def main():
    N = int(eval(input()))
    a = list(map(int, input().split()))
    ball = []
    ballNum = 0
    f = [0] * N
    for i in reversed(list(range(0, N))):
        if (sum(f[i :: i + 1]) % 2) != (a[i] % 2):
            f[i] = 1
            ball.append(i + 1)
            ballNum += 1
    if (sum(f) % 2) != (a[0] % 2):
        f[0] = 1
        ball.append(1)
        ballNum += 1
    print(ballNum)
    print((*ball))


if __name__ == "__main__":
    main()

-    for i in reversed(list(range(1, N))): -        if sumN(i, N, f) != (a[i] % 2): +    for i in reversed(list(range(0, N))): +        if (sum(f[i :: i + 1]) % 2) != (a[i] % 2):