Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=list(map(int,input().split()))
A=[0]*N
B=[]
count=0
for i in range(N//2,N):
    if a[i]==1:
        A[i]=1
        B.append(i+1)
for i in range(N//2)[::-1]:
    asum=0 
    x=i+1
    for j in range(i,N,x):
        asum=asum+A[j]
    if asum%2!=a[i]:
        A[i]=1
        B.insert(0,i+1)
count=sum(A)
print(count)
if count!=0:
    print(*B)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
A=[0]*N
B=[]
for i in range(N//2,N):
    if a[i]==1:
        A[i]=1
        B.append(i+1)
for i in range(N//2)[::-1]:
    asum=0 
    x=i+1
    for j in range(i,N,x):
        asum=asum+A[j]
    if asum%2!=a[i]:
        A[i]=1
        B.append(i+1)
count=sum(A)
print(count)
if count!=0:
    print(*B)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=list(map(int,input().split()))
A=[0]*N
B=[]
count=0
for i in range(N//2,N):
    if a[i]==1:
        A[i]=1
        count=count+1
        B.append(i+1)
for i in range(N//2)[::-1]:
    asum=0 
    x=i+1
    for j in range(i,N,x):
        asum=asum+A[j]
    if asum%2!=a[i]:
        A[i]=1
        B.insert(0,i+1)
        count=count+1
print(count)
if count!=0:
    print(*B)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
A=[0]*N
B=[]
for i in range(N//2,N):
    if a[i]==1:
        A[i]=1
        B.append(i+1)
for i in range(N//2)[::-1]:
    asum=0 
    x=i+1
    for j in range(i,N,x):
        asum=asum+A[j]
    if asum%2!=a[i]:
        A[i]=1
        B.append(i+1)
count=sum(A)
print(count)
if count!=0:
    print(*B)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=list(map(int,input().split()))
A=[0]*N
B=[]
count=0
for i in range(N)[::-1]:
    asum=0
    x=i+1
    for j in range(i,N,x):
        asum=asum+A[j]
    if asum%2==a[i]:
        A[i]=0
    else:
        A[i]=1
        B.insert(0,i+1)
        count=count+1
print(count)
if count!=0:
    print(*B)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
A=[0]*N
B=[]
for i in range(N//2,N):
    if a[i]==1:
        A[i]=1
        B.append(i+1)
for i in range(N//2)[::-1]:
    asum=0 
    x=i+1
    for j in range(i,N,x):
        asum=asum+A[j]
    if asum%2!=a[i]:
        A[i]=1
        B.append(i+1)
count=sum(A)
print(count)
if count!=0:
    print(*B)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=list(map(int,input().split()))
A=[0]*N
B=[]
count=0
for i in range(N//2,N):
    if a[i]==1:
        A[i]=1
        count=count+1
        B.append(i+1)
for i in range(N//2)[::-1]:
    asum=0
    x=i+1
    for j in range(i,N,x):
        asum=asum+A[j]
    if asum%2==a[i]:
        A[i]=0
    else:
        A[i]=1
        B.insert(0,i+1)
        count=count+1
print(count)
if count!=0:
    print(*B)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
A=[0]*N
B=[]
for i in range(N//2,N):
    if a[i]==1:
        A[i]=1
        B.append(i+1)
for i in range(N//2)[::-1]:
    asum=0 
    x=i+1
    for j in range(i,N,x):
        asum=asum+A[j]
    if asum%2!=a[i]:
        A[i]=1
        B.append(i+1)
count=sum(A)
print(count)
if count!=0:
    print(*B)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=list(map(int,input().split()))
A=[0]*N
B=[]
count=0
for i in range(N//2,N):
    if a[i]==1:
        A[i]=1
        count=count+1
        B.append(i+1)
for i in range(N//2)[::-1]:
    asum=0
    for j in range(i,N):
        if (j+1)%(i+1)==0:
            asum=asum+A[j]
    if asum%2==a[i]:
        A[i]=0
    else:
        A[i]=1
        B.insert(0,i+1)
        count=count+1
print(count)
if count!=0:
    print(*B)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
A=[0]*N
B=[]
for i in range(N//2,N):
    if a[i]==1:
        A[i]=1
        B.append(i+1)
for i in range(N//2)[::-1]:
    asum=0 
    x=i+1
    for j in range(i,N,x):
        asum=asum+A[j]
    if asum%2!=a[i]:
        A[i]=1
        B.append(i+1)
count=sum(A)
print(count)
if count!=0:
    print(*B)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=list(map(int,input().split()))
A=[0]*N
B=[]
count=0
for i in range(N)[::-1]:
    asum=0
    for j in range(i,N):
        if (j+1)%(i+1)==0:
            asum=asum+A[j]
    if asum%2==a[i]:
        A[i]=0
    else:
        A[i]=1
        B.append(i+1)
        count=count+1
print(count)
if count!=0:
    print(*B)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
A=[0]*N
B=[]
for i in range(N//2,N):
    if a[i]==1:
        A[i]=1
        B.append(i+1)
for i in range(N//2)[::-1]:
    asum=0 
    x=i+1
    for j in range(i,N,x):
        asum=asum+A[j]
    if asum%2!=a[i]:
        A[i]=1
        B.append(i+1)
count=sum(A)
print(count)
if count!=0:
    print(*B)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=list(map(int,input().split()))
A=[0]*N
B=[]
count=0
for i in range(N)[::-1]:
    asum=0
    for j in range(i,N):
        asum=asum+A[j]
    if asum%2==a[i]:
        A[i]=0
    else:
        A[i]=1
        B.append(i+1)
        count=count+1
B.sort()
print(count)
if count!=0:
    print(*B)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
A=[0]*N
B=[]
for i in range(N//2,N):
    if a[i]==1:
        A[i]=1
        B.append(i+1)
for i in range(N//2)[::-1]:
    asum=0 
    x=i+1
    for j in range(i,N,x):
        asum=asum+A[j]
    if asum%2!=a[i]:
        A[i]=1
        B.append(i+1)
count=sum(A)
print(count)
if count!=0:
    print(*B)