There are N empty boxes arranged in a row from left to right. The integer i is written on the i-th box from the left (1 \leq i \leq N).  For each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.  We say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:    * For every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.  Does there exist a good set of choices? If the answer is yes, find one good set of choices.
import sys,math,copy
input = sys.stdin.readline

N=int(input().strip())
An=[int(x) for x in input().strip().split()]
Bn=[-1 for _ in range(N)]
Sum=0
for i in range(N-1,-1,-1):
    temp=0
    c=2
    index=(i+1)*c
    while index <= N:
        temp=temp^An[index-1]
        c+=1
        index+=(i+1)

    ball=An[i] ^ temp
    Sum+=ball
    Bn[i]= str(ball)


print(Sum)
if Sum!=0:
    print(' '.join(Bn))


import sys,math,copy
input = sys.stdin.readline

N=int(input().strip())
An=[int(x) for x in input().strip().split()]
Bn=[-1 for _ in range(N)]
Sum=0
for i in range(N-1,-1,-1):
    temp=0
    index=(i+1)*2
    while index <= N:
        temp=temp^Bn[index-1]
        index+=(i+1)

    ball= An[i] ^ temp
    Sum+=ball
    Bn[i]= ball

print(Sum)
if Sum!=0:
    ans=[str(x+1) for x in range(N) if Bn[x]==1]
    print(' '.join(ans))