Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

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

def make_divisors(n):
	divisors = set()
	for i in range(1, int(n**0.5)+1):
		if n % i == 0:
			divisors.add(i)
			if i != n // i:
				divisors.add(n//i)
	return divisors
	
A = make_divisors(a)
B = make_divisors(b)
S = A & B
cnt = 0
for _ in S:
	mk = make_divisors(_)
	MK = mk & S
	if len(MK) <= 2:
		cnt += 1
print(cnt)

### FIXED CODE ###

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

def make_divisors(n):
	divisors = set()
	for i in range(1, int(n**0.5)+1):
		if n % i == 0:
			divisors.add(i)
			if i != n // i:
				divisors.add(n//i)
	return divisors
	
A = make_divisors(a)
B = make_divisors(b)
S = A & B
#Sから素数だけを抽出してカウント
import math

def is_prime(n):
	if n == 1: return False
	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False
	return True
cnt = 1
for i in S:
	if is_prime(i) == True:
		cnt += 1

print(cnt)
### BUGGY CODE ###

# int(input()) # 入力が1つ
n, k = map(int, input().split()) # 入力が複数
nums = [int(i) for i in input().split()] # 配列で数字

nums = [0] + nums
for i in range(n):
    nums[i + 1] += nums[i]
ans = 0
for i in range(n + 1):
    for j in range(i + 1, n + 1):
        left = nums[i]
        right = nums[j]
        if (left - i) % k == (right - j) % k and j - i < k:
            ans += 1
print(ans)


### FIXED CODE ###

# int(input()) # 入力が1つ
from collections import defaultdict
n, k = map(int, input().split()) # 入力が複数
nums = [int(i) for i in input().split()] # 配列で数字

nums = [0] + nums
for i in range(n):
    nums[i + 1] = (nums[i] + nums[i + 1] + k - 1) % k
ans = 0
d = defaultdict(int)
for i in range(n + 1):
    ans += d[nums[i]]
    d[nums[i]] += 1
    if i - (k - 1) >= 0:
        d[nums[i - (k - 1)]] -= 1
print(ans)
### BUGGY CODE ###

from collections import Counter 
from collections import defaultdict
from collections import deque
from functools import reduce
import math
import itertools
import heapq

#n=int(input())
#n,m=list(map(int,input().split()))
#a=list(map(int,input().split()))
ceil=lambda x,y: (x+y-1)//y
input_list = lambda : list(map(int,input().split()))


#bfs内で処理すると使い回しが効かないのでsearch_color とか幅探索後の具体的な処理は別個にしたほうがいい
def bfs(s,n,node,c):
    
    side_num_arr=list(map(lambda x :len(x),node))
    l=max(side_num_arr)
    #print(l)
    queue=[-1 for _ in range(n)]
    now=0
    queue[now]=s
    ans=[-1 for _ in range(n)]
    ans[0]=[0]
    color_check=[[True for _ in range(l)] for _ in range(n)]
    color=[-1 for _ in range(n-1)]
    last_ind=1
    while last_ind<n:
        
        if now>=n:
            return []
        check[queue[now]]=True
        if side_num_arr[queue[now]]<=0:
            now+=1
            continue
        for i in node[queue[now]]:
            edge=i[0]
            
            ind=i[1]
            if side_num_arr[edge]<=0 or check[edge]==True:
                continue
            side_num_arr[edge]-=1
            side_num_arr[queue[now]]-=1
            queue[last_ind]=edge
            last_ind+=1
            check[edge]=True
            
            ans[edge]=queue[now]
            #color[ind]=search_color(queue[now],edge,color_check)
        now+=1
    return ans



n,m=input_list()
node=[[] for _ in range(n)]
for i in range(m):
    u,v=input_list()
    u-=1
    v-=1
    node[u].append([v,i])
    node[v].append([u,i])

#print(np.array(node))
check=[-1 for _ in range(n)]
check[0]=0
ans=bfs(0,n,node,check)
if len(ans)==0:
    print("No")
    exit()

print("Yes")
for each in ans[1:]:
    print(each+1)








### FIXED CODE ###

input_list = lambda : list(map(int,input().split()))


#bfs内で処理すると使い回しが効かないのでsearch_color とか幅探索後の具体的な処理は別個にしたほうがいい
def bfs(s,n,node):
    c=[-1 for _ in range(n)]
    c[0]=0
    
    side_num_arr=list(map(lambda x :len(x),node))
    #print(l)
    queue=[-1 for _ in range(n)]
    now=0
    queue[now]=s
    ans=[-1 for _ in range(n)]
    ans[0]=[0]
    last_ind=1
    while last_ind<n:
        
        if now>=n:
            return []
        c[queue[now]]=True
        if side_num_arr[queue[now]]<=0:
            now+=1
            continue
        for edge in node[queue[now]]:
            #edge=i[0]
            if side_num_arr[edge]<=0 or c[edge]==True:
                continue
            side_num_arr[edge]-=1
            
            queue[last_ind]=edge
            last_ind+=1
            c[edge]=True
            ans[edge]=queue[now]

        side_num_arr[queue[now]]=0
        now+=1
    return ans



n,m=input_list()
node=[[] for _ in range(n)]

for i in range(m):
    u,v=input_list()
    u-=1
    v-=1
    node[u].append(v)
    node[v].append(u)

#print(np.array(node))

ans=bfs(0,n,node)
if len(ans)==0:
    print("No")
    exit()

print("Yes")
for each in ans[1:]:
    print(each+1)
### BUGGY CODE ###

n,*p=map(int,open(0).read().split())
a=[]
cnt=0
for i in range(1,n):
  a.append(min(p[0:i]))  
for i,j in zip(a,p[1:]):
  if i<j:
    cnt+=1
print(n-cnt)    

### FIXED CODE ###

n,*p=map(int,open(0).read().split())
_min=max(p)
cnt=0
for i in p:
  _min=min(_min,i)
  if i>_min:
    cnt+=1
print(n-cnt)
### BUGGY CODE ###

n, h = map(int, input().split())
a = []
b = []
for i in range(n):
  p, q = map(int, input().split())
  a.append(p)
  b.append(q)
b.sort(reverse=1)
ans=0
m=max(a)
while(h>0 and len(b) != 0):
  if b[0] < m:
    break
  h-=b[0]
  b.pop(0)
  ans+=1
while(h>0):
  h-=m
  ans+=1
print(ans)

### FIXED CODE ###

from math import ceil
n, h = map(int, input().split())
a = []
b = []
for i in range(n):
  p, q = map(int, input().split())
  a.append(p)
  b.append(q)
b.sort(reverse=1)
ans=0
m=max(a)
for i in b:
  if i < m or h<=0:
    break
  h-=i
  ans+=1
if h>0:
  ans+=ceil(h/m)
print(ans)
### BUGGY CODE ###

one, zero, ng_one, card = map(int, input().split())

card_list = []
for i in range(one):
    card_list.append(1)
for i in range(zero):
    card_list.append(0)
for i in range(ng_one):
    card_list.append(-1)

print(sum(card_list[:card]))


### FIXED CODE ###

one,zero,ng_one,card = map(int, input().split())

if card < one:
    print(card)
elif card <= one+zero:
    print(one)
else:
    print(one - (card - one - zero))
### BUGGY CODE ###

N, A = map(int, input().split())
X = [int(x) - A for x in input().split()]
X0 = [0 for x in X if x == 0]
Xp = [x for x in X if x > 0]
Xm = [-x for x in X if x < 0]
limit = min(sum(Xp), sum(Xm))
R = [[0, 0] for x in range(limit + 1)]
def c(X, k):
  for i in range(2 ** len(X)):
    mask = bin(i)[2:]
    mask = [0 for m in range(len(X) - len(mask))] + [int(s) for s in mask]
    masked = sum([X[j] * mask[j] for j in range(len(X))])
    if masked <= limit:
      R[masked][k] += 1
c(Xp, 0)
c(Xm, 1)
print(sum([r[0] * r[1] for r in R]) * (2 ** len(X0)) - 1)

### FIXED CODE ###

from collections import Counter
N, A = map(int, input().split())
X = [int(x) - A for x in input().split()]
C = Counter([0])
for x in X:
  tmp = Counter()
  for i, c in C.items():
    tmp[i + x] += c
  C += tmp
print(C[0] - 1)
### BUGGY CODE ###

N, M = map(int,input().split())
LR = [list(map(int,input().split())) for i in range(M)]

l = [0] * N
count = 0
for i in range(M):
  for j in range(LR[i][1] - LR[i][0] + 1):
    l[LR[i][0]+j-1] += 1
else:
  for i in l:
    if i == M:
      count += 1
  else:
    print(count)
    

### FIXED CODE ###

N, M = map(int,input().split())
L = []
R = []
for i in range(M):
  l, r = map(int,input().split())
  L.append(l)
  R.append(r)

max_l = max(L)
min_r = min(R)
print(max(min_r - max_l + 1, 0))
### BUGGY CODE ###

N, M = list(map(int, input().split()))
S = list(map(int, input().split()))
T = list(map(int, input().split()))
MOD = 10 ** 9 + 7

DP = [[0] * M for _ in range(N)]

t = 0
for i in range(M):
  if S[0] == T[i]:
    t += 1
  DP[0][i] = t

for i in range(1, N):
  cnt = 0
  while cnt < M:
    if cnt == 0:
      DP[i][0] = DP[i - 1][0]
      if S[i] == T[0]:
        DP[i][0] += 1
    else:
      if S[i] == T[cnt]:
        DP[i][cnt] = (DP[i - 1][cnt] + 1 + DP[i][cnt - 1]) % MOD
      else:
        DP[i][cnt] = (DP[i - 1][cnt] + DP[i][cnt - 1] - DP[i - 1][cnt - 1]) % MOD
      while DP[i][cnt] < MOD:
        DP[i][cnt] += MOD
    cnt += 1

print((DP[-1][-1] + 1) % MOD)


### FIXED CODE ###

N, M = list(map(int, input().split()))
S = list(map(int, input().split()))
T = list(map(int, input().split()))
MOD = 10 ** 9 + 7

DP = [[0] * M for _ in range(N)]

t = 0
for i in range(M):
  if S[0] == T[i]:
    t += 1
  DP[0][i] = t

for i in range(1, N):
  cnt = 0
  while cnt < M:
    if cnt == 0:
      DP[i][0] = DP[i - 1][0]
      if S[i] == T[0]:
        DP[i][0] += 1
    else:
      if S[i] == T[cnt]:
        DP[i][cnt] = (DP[i - 1][cnt] + 1 + DP[i][cnt - 1]) % MOD
      else:
        DP[i][cnt] = (DP[i - 1][cnt] + DP[i][cnt - 1] - DP[i - 1][cnt - 1]) % MOD
      while DP[i][cnt] < MOD:
        DP[i][cnt] += MOD
    cnt += 1

print((DP[-1][-1] + 1) % MOD)
### BUGGY CODE ###

a = int(input())
b= [int(x) for x in input().split()]
c = a
for s in range(a-1):
  d = b[s]
  for t in range(s+1,a):
    if b[t]==0:
      c += 1
    elif d & b[t]:
      break
    else:
      d = d ^ b[t]
      c += 1
print(c)

### FIXED CODE ###

N = int(input())
A= [int(x) for x in input().split()]
A.append(0)
count = N
s = 0
t = 1
xor = A[0]
while s < N - 1:
  while t < N:
    if not A[t] or not (xor & A[t]):
      xor ^= A[t]
      t += 1
    else:
      break
  count += t - s - 1
  while s < t:
    xor ^= A[s]
    s += 1
    if xor & A[t]:
      count += t - s - 1
      continue
    else:
      break
  if s == t:
    xor = A[s]
    t += 1
print(count)
### BUGGY CODE ###

N,Q=(int(i) for i in input().split())
x=input()
a=[]
for i in range(0,Q):
  a.append([int(j) for j in input().split()])


for i in range(0,Q):
  answer=0
  l=x[a[i][0]-1:a[i][1]]
  for j in range(0,len(l)-1):
    if (l[j]=="A"):
      if (l[j+1]=="C"):
        answer+=1
  print(answer)

### FIXED CODE ###

N,Q=(int(i) for i in input().split())
x=input()
a=[]

j=0
s=[0]
t=0
while (j<N-1):
  if (x[j]=="A") and (x[j+1]=="C"):
    t+=1
    s.append(t)
  else:s.append(t)
  j+=1
for i in range(0,Q):
  a.append([int(j) for j in input().split()])
  p=s[a[i][1]-1]-s[a[i][0]-1]
  print(p)
### BUGGY CODE ###

def main():
    N = int(input())
    A = [int(input()) for i in range(N)]

    for j in range(N):
        ans = [x for i, x in enumerate(A) if i != j]
        print(max(ans))


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    n = int(input())
    As = [int(input()) for _ in range(n)]

    As_sort = sorted(As)
    second, first = As_sort[-2:]
    for i in range(n):
        if As[i] == first:
            print(second)
        else:
            print(first)


if __name__ == "__main__":
    main()
### BUGGY CODE ###

import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import bisect

n,k = map(int,input().split())
a = list(map(int,input().split()))
d = 1
for i in range(k):
    d = d*a[i]
b = [d]
for i in range(n-k):
    c = (b[-1]*a[k+i])//a[i]
    b.append(c)
for i in range(n-k):
    if b[i+1]>b[i]:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import bisect
mod = 10**9+7

n,k = map(int,input().split())
a = list(map(int,input().split()))
d = 1
mina = min(a)+1
for i in range(n-k):
    if a[i] < a[i+k]:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

import math

X = int(input())

def decompose(n):
	result = []
	half = math.floor(math.sqrt(n))
	i = 2
	while i <= half:
		if n % i == 0:
			result.append(i)
			n //= i
			half = math.floor(math.sqrt(n))
		else:
			i += 1
	if n > 1:
		result.append(n)
	return result

facts = decompose(X)

fact_table = {}
for f in facts:
	if f not in fact_table:
		fact_table[f] = 1
	else:
		fact_table[f] += 1

facts = list(fact_table.items())
facts.sort()

def find(num, n):
	if n >= len(facts):
		A = 0
		prev_x = None
		while True:
			B = A - num
			x = A ** 5 - B ** 5
			if x == X:
				return A, B
			elif (prev_x != None and x > prev_x) and x > X:
				break
			A += 1
			prev_x = x
	else:
		f, c = facts[n]
		for i in range(c + 1):
			ret = find(num, n + 1)
			if ret != None:
				return ret
			num *= f
	return None

A, B = find(1, 0)


print(A, B)


### FIXED CODE ###

import math

X = int(input())

def decompose(n):
	result = []
	half = math.floor(math.sqrt(n))
	i = 2
	while i <= half:
		if n % i == 0:
			result.append(i)
			n //= i
			half = math.floor(math.sqrt(n))
		else:
			i += 1
	if n > 1:
		result.append(n)
	return result

facts = decompose(X)

fact_table = {}
for f in facts:
	if f not in fact_table:
		fact_table[f] = 1
	else:
		fact_table[f] += 1

facts = list(fact_table.items())
facts.sort()

def bisearch_smallest(f, s, e = None):
	if e == None:
		e = s - 1
		s = 0
	else:
		e -= 1
	
	while s < e:
		m = (s + e) // 2
		if f(m):
			e = m
		else:
			s = m + 1
	
	if s == e and f(s):
		return s
	else:
		return -1

def find(num, n):
	if n >= len(facts):
		m = bisearch_smallest(lambda A: 5 * A ** 4 - 5 * (A - num) ** 4 >= 0, 0, 10 ** 9)
		i = bisearch_smallest(lambda A: A ** 5 - (A - num) ** 5 <= X, 0, m + 1)
		j = bisearch_smallest(lambda A: A ** 5 - (A - num) ** 5 >= X, m - 1, 10 ** 9)
		
		if i ** 5 - (i - num) ** 5 == X:
			return i, i - num
		if j ** 5 - (j - num) ** 5 == X:
			return j, j - num
	else:
		f, c = facts[n]
		for i in range(c + 1):
			ret = find(num, n + 1)
			if ret != None:
				return ret
			num *= f
	return None

A, B = find(1, 0)


print(A, B)
### BUGGY CODE ###

import fractions
N, M = map(int,input().split())
MIN = 0
MAX = 10**9
while MAX - MIN > 1:
    MID = (MAX+MIN)//2
    if M/MID > N:
        MIN = MID
    else:
        MAX = MID

for i in range(MAX,0,-1):
    if i == 1:
        print(i)
    else:
        if M % i == 0:
            print(i)
            exit()

### FIXED CODE ###

N,M = map(int,input().split())
MAX = int(M**(1/2))
ans = 0
for i in range(MAX,0,-1):
    if M % i == 0:
        j = M // i
        if j >= N:
            ans = max(ans,i)
        if i >= N:
            ans = max(ans,j)
print(ans)
### BUGGY CODE ###

def factorize(n, d):
  # if n == 0 or n == 1:
    # return []
    arr = []
    tmp = n
    while True:
      i = d[tmp]
      if i == 1:
        break
      #cnt=0
      while tmp%i==0:
        #cnt+=1
        tmp //= i
      arr.append(i)
    if tmp!=1:
      arr.append(tmp)
    if arr==[]:
      arr.append(n)
    return arr

def minimum_prime(n):
  # 試し割りをする際の最小の素数
  # エラトステネスの篩と同様の実装
    d = list(range(n+1))
    d[0] = 1
    for i in range(2, int(n**0.5) + 1):
        if d[i] != i:
          continue
        for j in range(i * 2, n + 1, i):
          if d[j] == j:
            d[j] = i
    return d  

def main():
  n = int(input())
  arr = list(map(int, input().split()))
  max_arr = max(arr)
  d = minimum_prime(max_arr)
  dp = [0]*(max_arr+1)
  
  
  searched = []
  for a in arr:
    if a != 1:
      primes = factorize(a, d)
      for p in primes:
        dp[p] += 1
  
  max_dp = max(dp)
  if max_dp < 2:
    print('pairwise coprime')
  elif max_dp == n:
    print('not coprime')
  else:
    print('setwise coprime')
    

main()

### FIXED CODE ###

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def factorize(n, d):
  # if n == 0 or n == 1:
    # return []
    arr = []
    tmp = n
    while True:
      i = d[tmp]
      if i == 1:
        break
      #cnt=0
      while tmp%i==0:
        #cnt+=1
        tmp //= i
      arr.append(i)
    if tmp!=1:
      arr.append(tmp)
    if arr==[]:
      arr.append(n)
    return arr

def minimum_prime(n):
  # 試し割りをする際の最小の素数
  # エラトステネスの篩と同様の実装
    d = list(range(n+1))
    d[0] = 1
    for i in range(2, int(n**0.5) + 1):
        if d[i] != i:
          continue
        for j in range(i * 2, n + 1, i):
          if d[j] == j:
            d[j] = i
    return d  

def main():
  n = int(input())
  arr = list(map(int, input().split()))
  max_arr = max(arr)
  d = minimum_prime(max_arr)
  dp = [0]*(max_arr+1)
  
  if gcd(*arr) != 1:
    print('not coprime')
    exit()
  
  searched = []
  for a in arr:
    if a != 1:
      primes = factorize(a, d)
      for p in primes:
        dp[p] += 1

  if max(dp) < 2:
    print('pairwise coprime')
  else:
    print('setwise coprime')
    

main()
### BUGGY CODE ###

h,n = map(int,input().split())
magic=[]
for i in range(n):
    a,b=map(int,input().split())
    magic.append([a,b])
dp = [1000000000000 for i in range(h+1)]
dp[0] = 0
for i in range(h):
    for a,b in magic:
        rest = min(i+a,h)
        dp[rest] = min(dp[rest],dp[i]+b)
print(dp[-1])

### FIXED CODE ###

h,n = map(int,input().split())
magic=[]
for i in range(n):
    a,b=map(int,input().split())
    magic.append([a,b])
dp = [1000000000000 for i in range(h+1)]
dp[0] = 0
for i in range(h):
    for a,b in magic:
        rest = min(i+a,h)
        dp[rest] = min(dp[rest],dp[i]+b)
print(dp[-1])
### BUGGY CODE ###

import math

def permod(n, r):
  return (math.factorial(n) // math.factorial(n - r)) % (10 ** 9 + 7)

def main():
  X,Y = map(int,input().split())
  
  if (X + Y) % 3 != 0:
    print(0)
    
  else:
    a = Y - (X + Y) // 3
    b = X - (X + Y) // 3
    
    total = a + b
    m = min(a,b)
    
    ans = permod(total,m)
    print(ans)
    
main()

### FIXED CODE ###

def cmb(n, k, mod, fac, infac):
  k = min(k,n-k)
  return fac[n] * infac[k] * infac[n-k] % mod

def tables(mod, n):
  fac = [1, 1] 
  infac = [1, 1] 
  inverse = [0, 1] 
  for i in range(2, n+1):
    fac.append((fac[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod // i)) % mod)
    infac.append((infac[-1] * inverse[-1]) % mod)
  return fac,infac

X,Y = map(int, input().split())

if X > Y:
  X, Y = Y, X

move = X + Y

if move % 3 != 0:
  print(0)
else:
  total = move // 3
  n = X - total
  
  if n < 0:
    print(0)
    
  else:
    MOD = 10 ** 9 + 7
    fac, infac = tables(MOD, total)
    ans = cmb(total, n, MOD, fac, infac)
    
    print(ans)
### BUGGY CODE ###

N = int(input())
X = input()
zero_pop = X.count('1') + 1
one_pop = X.count('1') - 1
def popcount(n):
    return bin(n).count('1')
memo = {0:0}
def f_count(n):
    if n in memo:
        return memo[n]
    memo[n] = f_count(n % popcount(n)) + 1
    return f_count(n % popcount(n)) + 1
for i in range(N):
    x = int(X, 2)
    if X[i] == '1' and X.count('1') == 1:
        print(0)
        continue
    if X[i] == '1':
        x -= 2 ** (N-1-i)
        x %= one_pop
    elif X[i] == '0':
        x += 2 ** (N-1-i)
        x %= zero_pop
    
    print(f_count(x) + 1)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)
N = int(input())
X = input()
zero_pop = X.count('1') + 1
one_pop = X.count('1') - 1
one_mod, zero_mod = 0, 0

for b in X:
    if one_pop != 0:
        one_mod = (one_mod * 2 + int(b)) % one_pop
    zero_mod = (zero_mod * 2 + int(b)) % zero_pop

pop = {0:0}
def popcount(n):
    if n in pop:
        return pop[n]
    pop[n] = popcount(n // 2) + n % 2
    return pop[n]
memo = {0:0}
def f_count(n):
    if n in memo:
        return memo[n]
    memo[n] = f_count(n % popcount(n)) + 1
    return memo[n]
one_p = {0:1}
def one_pow(n):
    if n in one_p:
        return one_p[n]
    one_p[n] = one_pow(n - 1) * 2 % one_pop
    return one_p[n]
zero_p = {0:1}
def zero_pow(n):
    if n in zero_p:
        return zero_p[n]
    zero_p[n] = zero_pow(n - 1) * 2 % zero_pop
    return zero_p[n]
for i in range(N):
    if X[i] == '1' and one_pop == 0:
        print(0)
        continue
    if X[i] == '1':
        x = one_mod
        x -= one_pow(N-1-i)
        x %= one_pop
    elif X[i] == '0':
        x = zero_mod
        x += zero_pow(N-1-i)
        x %= zero_pop
    
    print(f_count(x) + 1)
### BUGGY CODE ###

primes = [2]

def f(x):
  if x==1:
    return 1
  a = []
  ret = 1
  for i in primes:
    cnt = 0
    while x%i==0:
      x //= i
      cnt += 1
    if cnt!=0:
      a.append(cnt)
  if len(a)==0:
    primes.append(x)
    ret = 2
  else:
    for i in a:
      ret *= i+1
  return ret

n = int(input())
sum = 0
for i in range(1,n+1):
  sum += i * f(i)
print(sum)

### FIXED CODE ###

n = int(input())
ans = 0
for i in range(1,n+1):
  ans += i * (1+n//i) * (n//i) // 2
print(ans)
### BUGGY CODE ###

from collections import Counter

N = int(input())
words = [Counter(input()) for _ in range(N)]
ans = 0
def get_unique_list(seq):
    seen = []
    return [x for x in seq if x not in seen and not seen.append(x)]

counters_counts = [words.count(x) for x in get_unique_list(words) if words.count(x) > 1]

for count in counters_counts:
    ans += int((count * (count-1)) / 2)
print(ans)

### FIXED CODE ###

from collections import Counter

class hashabledict(dict):
    def __hash__(self):
        return hash(tuple(sorted(self.items())))

N = int(input())
words = [hashabledict(dict(Counter(input()))) for _ in range(N)]
ans = 0
counter_hash = {}
for counter in words:
    if counter not in counter_hash.keys():
        counter_hash[counter] = 1
    else:
        counter_hash[counter] += 1
 
for count in counter_hash.values():
    ans += int((count * (count-1)) / 2)
print(ans)
### BUGGY CODE ###

n = int(input())
for i in range(1,3501):
    for j in range(1,3501):
        for k in range(1,3501):
            if 4/n == 1/i+1/j+1/k:
                print(i,j,k)
                exit()

### FIXED CODE ###

a = int(input())
for b in range(1,3501):
    for c in range(1,3501):
        if ((4*b*c)/a)-c-b == 0:
            continue
        k = b*c/(((4*b*c)/a)-c-b)
        if k <= 0:
            continue
        if k == int(k):
            print(b,c,int(k))
            exit()
### BUGGY CODE ###

# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math

# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    N = inputInt()
    A = inputList()
    
    ans = [0 for i in range(N)]
    ans_cnt = 0
    ans_str = ""
    for i in range(N, 0, -1):
        cons = 0
        for j in range(i, N+1, i):
            cons ^= ans[j-1]
        if A[i-1] != cons:
            ans[i-1] = 1
            ans_cnt += 1
            ans_str = ans_str + str(i) + " "
            continue
        if A[i-1] != cons:
            ans[i-1] = 1
            ans_cnt += 1
            ans_str = ans_str + str(i) + " "
            continue
            
    print(ans_cnt)
    print(ans_str)
            	
if __name__ == "__main__":
	main()


### FIXED CODE ###

import sys
 
def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7
 
N=INT()
A=LIST()
 
# その位置にボールを入れるかを保持するA2
A2=[0]*N
B=[]
# 後ろから決めていく
for i in range(N-1, -1, -1):
    cur=i+1
    cnt=0
    # curの倍数を全部見に行く
    for j in range(cur*2, N+1, cur):
        cnt^=A2[j-1]
    # ボールを入れるべきかどうか
    if A[i]!=cnt:
        B.append(cur)
        A2[i]=1
 
print(len(B))
print(*B)