l = []

counter = 0

ans_list = []



n = int(eval(input()))

b_list = [0 for _ in range(n)]

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



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

    index = n // i

    if index == 1: # 倍数がないとき

        b_list[i-1] = l[i-1]

    else:

        sum = 0

        for j in range(2, index+1):

            sum = sum + b_list[(i * j)-1]

        #print(l[i-1], sum)

        if l[i-1] != sum % 2:

            b_list[i-1] = 1



    if b_list[i-1] == 1:

        counter += 1

        ans_list.append(str(i))



#print(ans_list)

print(counter)

if ans_list != []:

    print((' '.join(sorted(ans_list))))

n = int(eval(input()))

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

ans_list = [0 for _ in range(n)]



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

    prev = 0

    index = i+1

    for j in range(2, n+1):

        if (index * j)-1 >= n: break

        prev += ans_list[(index * j)-1]

    if prev % 2 != a[i]:

        ans_list[i] = 1



print((sum(ans_list)))

if sum(ans_list) != 0:

    print((' '.join([str(i+1) for i, x in enumerate(ans_list) if x == 1])))

l = []
counter = 0
ans_list = []
n = int(eval(input()))
b_list = [0 for _ in range(n)]
l = list(map(int, input().split()))
for i in range(n, 0, -1):
    index = n // i
    if index == 1:  # 倍数がないとき
        b_list[i - 1] = l[i - 1]
    else:
        sum = 0
        for j in range(2, index + 1):
            sum = sum + b_list[(i * j) - 1]
        # print(l[i-1], sum)
        if l[i - 1] != sum % 2:
            b_list[i - 1] = 1
    if b_list[i - 1] == 1:
        counter += 1
        ans_list.append(str(i))
# print(ans_list)
print(counter)
if ans_list != []:
    print((" ".join(sorted(ans_list))))

n = int(eval(input()))
a = list(map(int, input().split()))
ans_list = [0 for _ in range(n)]
for i in range(n - 1, -1, -1):
    prev = 0
    index = i + 1
    for j in range(2, n + 1):
        if (index * j) - 1 >= n:
            break
        prev += ans_list[(index * j) - 1]
    if prev % 2 != a[i]:
        ans_list[i] = 1
print((sum(ans_list)))
if sum(ans_list) != 0:
    print((" ".join([str(i + 1) for i, x in enumerate(ans_list) if x == 1])))

-l = [] -counter = 0 -ans_list = [] -b_list = [0 for _ in range(n)] -l = list(map(int, input().split())) -for i in range(n, 0, -1): -    index = n // i -    if index == 1:  # 倍数がないとき -        b_list[i - 1] = l[i - 1] -    else: -        sum = 0 -        for j in range(2, index + 1): -            sum = sum + b_list[(i * j) - 1] -        # print(l[i-1], sum) -        if l[i - 1] != sum % 2: -            b_list[i - 1] = 1 -    if b_list[i - 1] == 1: -        counter += 1 -        ans_list.append(str(i)) -# print(ans_list) -print(counter) -if ans_list != []: -    print((" ".join(sorted(ans_list)))) +a = list(map(int, input().split())) +ans_list = [0 for _ in range(n)] +for i in range(n - 1, -1, -1): +    prev = 0 +    index = i + 1 +    for j in range(2, n + 1): +        if (index * j) - 1 >= n: +            break +        prev += ans_list[(index * j) - 1] +    if prev % 2 != a[i]: +        ans_list[i] = 1 +print((sum(ans_list))) +if sum(ans_list) != 0: +    print((" ".join([str(i + 1) for i, x in enumerate(ans_list) if x == 1])))