def main(A,N):

    A = [0] + A

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

        #print(inds[ind::ind+1])

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

            A[a] = 0

        else:

            A[a] = 1

        

    res = [x for x in range(0,N+1) if A[x]]

    print((len(res)))

    print((*res))



N = int(eval(input()))

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

    

main(A,N)
def main(A,N):

    A = [0] + A

    for a in range(N//2,0,-1):

        #print(inds[ind::ind+1])

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

            A[a] = 0

        else:

            A[a] = 1

        

    res = [x for x in range(0,N+1) if A[x]]

    print((len(res)))

    print((*res))



N = int(eval(input()))

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

    

main(A,N)

def main(A, N):
    A = [0] + A
    for a in range(N - 1, 0, -1):
        # print(inds[ind::ind+1])
        if sum(A[a::a]) % 2 == 0:
            A[a] = 0
        else:
            A[a] = 1
    res = [x for x in range(0, N + 1) if A[x]]
    print((len(res)))
    print((*res))


N = int(eval(input()))
A = [int(x) for x in input().split()]
main(A, N)

def main(A, N):
    A = [0] + A
    for a in range(N // 2, 0, -1):
        # print(inds[ind::ind+1])
        if sum(A[a::a]) % 2 == 0:
            A[a] = 0
        else:
            A[a] = 1
    res = [x for x in range(0, N + 1) if A[x]]
    print((len(res)))
    print((*res))


N = int(eval(input()))
A = [int(x) for x in input().split()]
main(A, N)

-    for a in range(N - 1, 0, -1): +    for a in range(N // 2, 0, -1):