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

from fractions import gcd
a, b = map(int, input().split())
g = gcd(a, b)
p = list()
for i in range(g-1):
  i += 2
  if g % (i) == 0:
    b = True
    for j in p:
      if (i) % j == 0:
        b = False
        break
    if b == True:
      p.append(i)
print(len(p)+1)

### FIXED CODE ###

from fractions import gcd

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

ans = 1

if g % 2 == 0:
  ans += 1
while g % 2 == 0:
  g /= 2

i = 3
while i * i <= g:
  if g % i == 0:
    ans += 1
  while g % i == 0:
    g /= i
  i += 2

if g != 1:
  ans += 1

print(ans)
### BUGGY CODE ###

A,B,K = map(int, input().split())
for i in range(K):
    if A >= 1:
        A -= 1
    elif B >= 1:
        B -= 1
print(A,B)

### FIXED CODE ###

A,B,K = map(int, input().split())
if A+B < K:
    print(0,0)
elif A >= K:
    print(A-K,B)
else:
    print(0,A+B-K)
### BUGGY CODE ###

import sys
input = sys.stdin.readline

def main():

    n, q = map(int, input().split())

    V = []

    for i in range(n):
        s, t, x = map(int, input().split())
        V.append((s-x, x, 1)) #1: insert
        V.append((t-x, x, 0)) #0: delete

    D = []
    for i in range(q):
        d = int(input())
        V.append((d, i, 2)) #2: query

    V.sort(key=lambda x:(x[0], x[2]))
    se = set()
    hq = []
    import heapq
    heapq.heapify(hq)
    ans = [-1]*q
    for t, v, p in V:
        if p == 1:
            se.add(v)
            heapq.heappush(hq, v)
        elif p == 0:
            se.remove(v)
        else:
            while hq and hq[0] not in se:
                heapq.heappop(hq)
            if hq:
                ans[v] = hq[0]

    for i in range(q):
        print(ans[i])

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():

    n, q = map(int, input().split())

    V = []

    for i in range(n):
        s, t, x = map(int, input().split())
        V.append((s-x, x, 1)) #1: insert
        V.append((t-x, x, 0)) #0: delete

    D = []
    for i in range(q):
        d = int(input())
        V.append((d, i, 2)) #2: query

    V.sort(key=lambda x:(x[0], x[2]))
    se = set()
    hq = []
    import heapq
    heapq.heapify(hq)
    ans = [-1]*q
    for t, v, p in V:
        if p == 1:
            se.add(v)
            heapq.heappush(hq, v)
        elif p == 0:
            se.discard(v)
        else:
            while hq and hq[0] not in se:
                heapq.heappop(hq)
            if hq:
                ans[v] = hq[0]

    for i in range(q):
        print(ans[i])

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

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

flag = False
for i in range(n - 1):
    for j in range(i + 1, n):
        if(a[i] == a[j]):
            flag = True
            break

    if(flag):
        break

if(flag):
    print('NO')
else:
    print('YES')

### FIXED CODE ###

def solve(n, a):
    a.sort()
    for i in range(n - 1):
        if(a[i] == a[i + 1]):
            return 'NO'

    return 'YES'

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

print(solve(n, a))
### BUGGY CODE ###

n,k=map(int,input().split())
a = list(map(int,input().split()))
di=10**9+7
a.sort()

maxl = a[k-1:]
minl = a[:n-k+1]

kai = [i for i in range(n+1)]
gya = [i for i in range(n+1)]
kai[0]=1
gya[0]=1
for i in range(1,n+1):
    kai[i]=kai[i-1]*kai[i]

for i in range(n+1):
    gya[i]=pow(gya[i],di-2,di)

for i in range(1,n+1):
    gya[i]*=gya[i-1]

for i in range(n-k+1):
    tmp=(kai[k-1+i]*gya[k-1]*gya[i])%di
    maxl[i]=(maxl[i]*tmp)%di

for i in range(n-k+1):
    tmp = (kai[n-1-i]*gya[k-1]*gya[n-i-k])%di
    minl[i] = (minl[i]*tmp)%di

su=0
for i in range(n-k+1):
    su = (su+maxl[i])%di
    su = (su-minl[i])%di
print(su)


### FIXED CODE ###

n,k=map(int,input().split())
a = list(map(int,input().split()))
di=10**9+7
a.sort()

maxl = a[k-1:]
minl = a[:n-k+1]

kai = [i for i in range(n+1)]
gya = [i for i in range(n+1)]
kai[0]=1
gya[0]=1
for i in range(1,n+1):
    kai[i]=(kai[i-1]*kai[i])%di

for i in range(n+1):
    gya[i]=pow(gya[i],di-2,di)

for i in range(1,n+1):
    gya[i]=(gya[i]*gya[i-1])%di

for i in range(n-k+1):
    tmp=(((kai[k-1+i]*gya[k-1])%di)*gya[i])%di
    maxl[i]=(maxl[i]*tmp)%di

for i in range(n-k+1):
    tmp = (((kai[n-1-i]*gya[k-1])%di)*gya[n-i-k])%di
    minl[i] = (minl[i]*tmp)%di

su=0
for i in range(n-k+1):
    su = (su+maxl[i])%di
    su = (su-minl[i])%di
print(su)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 13:15:15 2020

@author: liang
"""

"""
1.全探索 i,j,kを固定してそれぞれの番号を調べる => O(N^3)
2.全探索3桁の暗証番号000~999が文字列Sにあるか調べる =>O(N)
"""
"""
解1.コード　=> TLE
#使用済みリストを用意することで枝刈り
N = int(input())
S = list(map(int,input().split()))
num_used = [list() for i in range(10)]
numbers = list()
for i in range(N):
    for j in range(i+1, N):
        if S[j] in num_used[S[i]]:
            continue
        else:
            num_used[S[i]].append(S[j])
            for k in range(j+1,N):
                number = str(S[i]) + str(S[j]) + str(S[k])
                if number not in numbers:
                    numbers.append(number)
print(len(numbers))
"""
#解2コード => O(N)
N = int(input())
S = input()
ans = 0
for i in range(1000):
    a = i//100
    b = i%100//10 ###400//10 = 40
    c = i%10
    num = str(a) + str(b) + str(c) 
    flag = 0
    for j in range(N) :
        if S[j] == num[flag]:
            flag += 1
        if flag == 3:
            ans += 1
            break
print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 13:15:15 2020

@author: liang
"""

"""
1.全探索 i,j,kを固定してそれぞれの番号を調べる => O(N^3)
2.全探索3桁の暗証番号000~999が文字列Sにあるか調べる =>O(N)
"""
"""
解1.コード　=> TLE
#使用済みリストを用意することで枝刈り
N = int(input())
S = list(map(int,input().split()))
num_used = [list() for i in range(10)]
numbers = list()
for i in range(N):
    for j in range(i+1, N):
        if S[j] in num_used[S[i]]:
            continue
        else:
            num_used[S[i]].append(S[j])
            for k in range(j+1,N):
                number = str(S[i]) + str(S[j]) + str(S[k])
                if number not in numbers:
                    numbers.append(number)
print(len(numbers))
"""
#解2コード => O(N)
N = int(input())
S = input()
ans = 0
for i in range(1000):
#0で埋めるプログラム
#    a = i//100
#    b = i%100//10 ###400//10 = 40
#    c = i%10
#    num = str(a) + str(b) + str(c) 
    t = str(i).zfill(3) #0で埋めるメソッド
#フラグを立てて探す => O(N)    
#    flag = 0
#    for j in range(N) :
#        if S[j] == t[flag]:
#            flag += 1
#        if flag == 3:
#            ans += 1
    a = S.find(t[0])
    b = S.find(t[1],a+1)
    c = S.find(t[2],b+1)
    if a != -1 and b != -1 and c != -1:
        ans += 1
print(ans)
### BUGGY CODE ###

import collections
N, K = map(int, input().split())
A = list(map(int, input().split()))
a = collections.Counter(A)
c = len(A)
for i in range(K):
    try:
        c -= a.most_common()[i][1]
    except IndexError:
        print(c)
        exit()
print(c)


### FIXED CODE ###

import collections
N, K = map(int, input().split())
A = list(map(int, input().split()))
a = collections.Counter(A)
c = len(A)
#print(a.most_common(K))
S = a.most_common(K)
for i in range(K):
    try:
        c -= S[i][1]
    except IndexError:
        print(c)
        exit()
print(c)
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
mod = 10**9+7
sum = 0
for i in range(N-1):
    for j in range(i+1, N):
        sum += (A[i]*A[j])%mod
print(sum%mod)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
mod = 10 ** 9 + 7
cs = A[:]
for i in range(1, N):
	cs[i] += cs[i-1]
sum = 0
for i in range(0, N-1):
	sum += A[i] * (cs[-1] - cs[i])
print(sum % mod)
### BUGGY CODE ###

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

#最大公約数を求める
max_val = max(a, b)
min_val = min(a, b)

while(1):
  if max_val % min_val ==0:
    break
  else:
    tmp = max_val % min_val
    max_val = min_val
    min_val = tmp
    
#print(min_val)

list = []

for i in range(1, min_val//2 + 1):
  if (min_val % i == 0):
    list.append(i)
    
list.append(min_val)

for i in range(len(list)-1,0, -1): # 1は除外
  for j in range(i-1,0,-1):
 #   print("list[i],list[j]",list[i],list[j])
    if list[i] % list[j] == 0 and list[i] > 2:
      list[i] = 0

#print(list)
for i in range(len(list)-1 ,0,-1):
  if list[i]==0:
    list.pop(i)
      
#print(list)
sum = 0
for i in range(len(list)):
  for j in range(i,len(list)):
    if (list[j] % list[i]) == 1:
      sum += 1
 
print(len(list))

### FIXED CODE ###

import math

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

list_a = []
list_b = []
sqrt_a = math.sqrt(a)
sqrt_b = math.sqrt(b)


for i in range(2, int(sqrt_a) ):  
  if (a % (i) == 0):
    list_a.append( i )
    while( a % (i) == 0 ):
      a = a//(i)
if a > 1:
  list_a.append(a)
      
for i in range(2, int(sqrt_b) ):  
  if (b % (i) == 0):
    list_b.append( i )
    while( b % (i ) == 0 ):
      b = b//(i)
if b > 1:
  list_b.append(b)

#print(list_a)
#print(list_b)

set_a = set(list_a)
set_b = set(list_b)

set_ab = set_a & set_b
  
print(len(set_ab) + 1)
### BUGGY CODE ###

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

N = int(i[0])
A = int(i[1])
B = int(i[2])

l = []

while len(l) < N:
    for i in range(A):
        if len(l) == N:
            break
        l.append(0)

    for i in range(B):
        if len(l) == N:
            break
        l.append(1)
        
print(l.count(0))

### FIXED CODE ###

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

N = int(i[0])
A = int(i[1])
B = int(i[2])

count_blue = 0

syou = N // (A + B)
amari = N % (A + B)

if amari > A:
    count_blue = A * syou + A
else:
    count_blue = A * syou + amari

print(count_blue)
### BUGGY CODE ###

N, K = map(int, input().split())
A = [list(map(int, input().split())) for i in range(N)]
mod = 10**9+7

def matrixmul(A, B):
    n = len(A)
    C = []
    for i in range(n):
        c = []
        for j in range(n):
            num = 0
            for k in range(n):
                num = (A[i][k]*B[k][j] + num)%mod
            c.append(num)
        C.append(c)
    return C

def matrixpow(A, n):
    if n == 1:
        return A
    if n&1 == 1:
        return matrixmul(matrixpow(A, n-1), A)
    else:
        return matrixmul(matrixpow(A, n//2), matrixpow(A, n//2))
    
An = matrixpow(A, K)
ans = 0
for i in range(N):
    for j in range(N):
        ans = (An[i][j]+ans)%mod
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
A = [list(map(int, input().split())) for i in range(N)]
mod = 10**9+7

def matrixmul(A, B):
    n = len(A)
    C = []
    for i in range(n):
        c = []
        for j in range(n):
            num = 0
            for k in range(n):
                num = (A[i][k]*B[k][j] + num)%mod
            c.append(num)
        C.append(c)
    return C

now = [[1 if i == j else 0 for i in range(N)] for j in range(N)]        

while K:
    if K&1 == 1:
        now = matrixmul(now, A)
    K //= 2
    A = matrixmul(A, A)

ans = 0
for i in range(N):
    for j in range(N):
        ans = (now[i][j]+ans)%mod
print(ans)
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = int(0)
#一番チームで最弱のやつを取り出す
for i in range(n):
   ans = sum(a[n:3*n:2])
print(ans)
    

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = int(0)
#一番チームで最弱のやつを取り出す

ans = sum(a[n:3*n:2])
print(ans)
### BUGGY CODE ###

N,K=map(int,input().split())
P=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=[]
for i in range(N):
    score=[]
    B=[]
    count=1
    nex=P[i]-1
    point=C[nex]
    B.append(C[nex])
    score.append(point)
    while count<=K:
        if nex==i:
            break
        nex=P[nex]-1
        point+=C[nex]
        score.append(point)
        B.append(C[nex])
        count+=1
    if count==K:
        ans.append(max(score))
    else:
        if point<=0:
            ans.append(max(score))
        else:
            a=K//count
            b=K%count
            maxpoint=point*(a-1)
            for j in range(b):
                maxpoint+=B[j]
            c=maxpoint
            for j in range(count):
                if b+j<count:
                    c+=B[b+j]
                else:
                    c+=B[b+j-count]
                maxpoint=max(maxpoint,c)
            ans.append(maxpoint)
print(max(ans))

### FIXED CODE ###

N,K=map(int,input().split())
P=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=[]
for i in range(N):
    score=[]
    B=[]
    count=1
    nex=P[i]-1
    point=C[nex]
    B.append(C[nex])
    score.append(point)
    while count<=K:
        if nex==i:
            break
        nex=P[nex]-1
        point+=C[nex]
        score.append(point)
        B.append(C[nex])
        count+=1
    if count==K:
        ans.append(max(score))
    else:
        if point<=0:
            ans.append(max(score))
        else:
            a=K//count
            b=K%count
            maxpoint=point*(a-1)
            for j in range(b):
                maxpoint+=B[j]
            c=maxpoint
            for j in range(count):
                if b+j<count:
                    c+=B[b+j]
                else:
                    c+=B[b+j-count]
                maxpoint=max(maxpoint,c)
            ans.append(maxpoint)
print(max(ans))
### BUGGY CODE ###

def main():
    n = int(input())
    A = list(map(int, input().split()))
    A.sort()
    ans = 0

    for i in range(n):
        for j in range(n):
            if i == j:
                continue

            if A[i] % A[j] == 0:
                break

            if i < j:
                ans += 1
                break
        else:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n = int(input())
    A = list(map(int, input().split()))
    A.sort()
    D = [True] * (10**6 + 1)
    ans = 0

    for i, a in enumerate(A):
        if not D[a]:
            continue
        if (i < n-1 and a != A[i+1]) or i == n-1:
            ans += 1

        j = a
        while (j < 10**6 + 1):
            D[j] = False
            j += a

    print(ans)


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

k=int(input())
import math
d=0
for a in range(1,k+1):
    for b in range (1,k+1):
        for c in range (1,k+1):
            f=math.gcd(a,b)
            g=math.gcd(f,c)
            d+=g
print(d)

### FIXED CODE ###

k=int(input())
import math
d=0
for a in range(1,k+1):
    for b in range (1,k+1):
        f=math.gcd(a,b)
        for c in range (1,k+1):
            g=math.gcd(f,c)
            d+=g
print(d)
### BUGGY CODE ###

n,k=map(int,input().split())
A=list(map(int,input().split()))
for i in range(n-k+1):
  if i==0:
    temp=1
    for j in range(k):
      if A[j]!=1:
        temp*=A[j]
  else:
    newtemp=temp*A[i+k-1]//A[i-1]
    print("Yes" if newtemp>temp else "No")
    temp=newtemp

### FIXED CODE ###

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

n, m = map(int, input().split())
uv = [list(map(int, input().split())) for _ in range(m)]
s, t = map(int, input().split())

g = [[] for _ in range(3 * n)]

for u, v in uv:
    a = u - 1
    b = v - 1
    g[a].append(n + b)
    g[n+a].append(n*2 + b)
    g[n*2+a].append(b)

#print(g)

s -= 1
t -= 1
ans = 0
temp = [s]
while 1:
    ans += 1
    next = []
    for x in temp:
        next = next + g[x]
        g[x] = []
    if len(next) == 0:
        print(-1)
        exit()
    if t in next:
        print(ans // 3)
        exit()
    temp = [] + next


### FIXED CODE ###

n, m = map(int, input().split())
uv = [list(map(int, input().split())) for _ in range(m)]
s, t = map(int, input().split())

g = [set() for _ in range(3 * n)]

for u, v in uv:
    a = u - 1
    b = v - 1
    g[a].add(n + b)
    g[n+a].add(n*2 + b)
    g[n*2+a].add(b)

#print(g)

s -= 1
t -= 1
ans = 0
temp = set()
temp.add(s)
while 1:
    ans += 1
    next = set()
    for x in temp:
        for y in g[x]:
            next.add(y)
        g[x] = []
    if len(next) == 0:
        print(-1)
        exit()
    if t in next:
        print(ans // 3)
        exit()
    temp = next
### BUGGY CODE ###

import numpy as np

k = int(input())
sum = 0
for p in range(1,k+1):
    for q in range(1,k+1):
        for r in range(1,k+1):
            sum += np.gcd.reduce([p,q,r])

print(sum)

### FIXED CODE ###

import math

k = int(input())
sum = 0
gcds = [[0 for i in range(k)] for i in range(k)]
for p in range(1,k+1):
    for q in range(1,k+1):   
        gcds[p-1][q-1] = math.gcd(p,q)          
        for r in range(1,k+1):
            sum += math.gcd(gcds[p-1][q-1], r)
            


print(sum)
### BUGGY CODE ###

N,W=map(int,input().split())
w=[]
v=[]
maxV=0
for i in range(N):
    a,b=map(int,input().split())
    if maxV<b:
        maxV=b
    w.append(a)
    v.append(b)
#dp[n個目のアイテムまでで][V以上を達成する]=最小のw
#dp[0][v]=inf ゼロ個でｖは無理なので
#dp[0][0]=0と初期化する
#だからiの時dp[i][v]=min(dp[i-1][v],dp[i-1][V-v[i-1]]+w[i])である<-i-1なのはvとかにはゼロ個とかないので
#V-v[i]<0ならば、とれないので前者になるね！！
#これをi=0(は初期化でする)->nまでおこない、各iについてはとりうる最大のValueを考えるが
#これは最大で各アイテムについて最大のVがあってこれにアイテム数Nを掛けたものである
#つまりdpのサイズはdp[0->N][0->maxV*N]をとればよい

dp=[[float("inf") for i in range(maxV*(N+1))] for j in range(N+1)]
dp[0][0]=0

for i in range(1,N+1):
    for val in range(maxV*N+1):
        tmp1=dp[i-1][val]#とらない
        if val-v[i-1]<0:#この時、iこめの価値がおおきいので、これをとるだけで達成してしまう
            tmp2=w[i-1]#i=1の時、dp[0][val]=inf
        else:#i=1の時val-v[0]>0で無限になるので
            tmp2=dp[i-1][val-v[i-1]]+w[i-1]#
        res=min(tmp1,tmp2)
        dp[i][val]=res
#ここでW以下となるvalの最大値をたんさくする
max=0
for value in range(len(dp[N])):
    if dp[N][value]<=W:
        if value>max:
            max=value
print(max)


### FIXED CODE ###

def knap(N,W,weight,value):
    inf=float("inf")
    dp=[[-inf for i in range(W+1)] for j in range(N+1)]
    #各nについて初期化　以下で各ｗについて0この時０とする
    for i in range(W+1):#w+1とは0~w
        dp[0][i]=0
    for i in range(N):#each n 0~N-1
        for w in range(W+1):#w 0~w
            if weight[i]<=w:#=を入れないとぎりぎりの時が困る
                dp[i+1][w]=max(dp[i][w-weight[i]]+value[i],dp[i][w])
            else:
                dp[i+1][w]=dp[i][w]
   # print(dp)
    return dp[N][W]


n,W=map(int,input().split())
w=[]
v=[]
for i in range(n):
    a,b=map(int,input().split())
    w.append(a)
    v.append(b)
print(knap(n,W,w,v))
### BUGGY CODE ###

N, K = map(int, input().split())

if N == K:
    print(0)
elif N > K:
    if N % K == 0:
        print(0)
    else:
        SN = N
        PN = float('inf')
        while PN > N:
            PN = N
            N = abs(N-K)
        print(min(SN, PN))
        
else:
    SN = N
    PN = float('inf')
    while PN > N:
        PN = N
        N = abs(N-K)
    print(min(SN, PN))


### FIXED CODE ###

N, K = map(int, input().split())

# print(N % K)
# print(N % abs(N-K))

# SN = N
# PN = float('inf')
# while PN > N:
#     PN = N
#     N = abs(N-K)
#     print(PN, N)

if N == K:
    print(0)

elif N > K:
    val = N % K
    print(min(abs(val), abs(val-K)))
else:
    SN = N
    PN = float('inf')
    while PN > N:
        PN = N
        N = abs(N-K)
    print(min(SN, PN))
### BUGGY CODE ###

import math
n,p = map(int,input().split())
dum = math.floor(p**(1/n))+1
for i in range(dum,-1,-1):
    if p%(i**n) == 0:
        print(i)
        break

### FIXED CODE ###

n,p = map(int,input().split())
dum = round(p**(1/n))
for i in range(dum,-1,-1):
    if p%(i**n) == 0:
        print(i)
        break
### BUGGY CODE ###

n,k = input().split()
n = int(n)
k = int(k)
nums = [float(i)/2+0.5 for i in input().split()]
now_list = [sum(nums[i:i+k]) for i in range(n-k+1)]
print(max(now_list))

### FIXED CODE ###

n,k = input().split()
n = int(n)
k = int(k)
nums = [float(i)/2+0.5 for i in input().split()]
ma = sum(nums[0:k])
now = ma
for i in range(n-k):
  now = now - nums[i] + nums[i+k]
  if now>ma:
    ma = now
print(ma)
### BUGGY CODE ###

from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce


sys.setrecursionlimit(2147483647)
INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().rstrip().split()
def S(): return sys.stdin.readline().rstrip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]

mod=10**9+7




pair_flg=0
set_flg=0
n=I()
A=LI()
t_set=set()
s_set=set(range(2,n+1))
D=defaultdict(set)

for j in range(n):
    a=A[j]
    prime_set = D[A[j]]
    flg=0
    if not prime_set:
        for i in range(2, int(a ** 0.5) + 1):
            while a % i == 0:
                prime_set.add(i)
                a //= i
                if D[a]:
                    prime_set |= D[a]
                    flg=1
                    break
            if D[a] or a == 1 or flg:
                prime_set |= D[a]
                break
        if a != 1:
            prime_set.add(a)
        D[A[j]]=prime_set
    if prime_set&t_set:
        pair_flg=1
    t_set|=prime_set
    s_set&=prime_set


if not pair_flg:
    print("pairwise coprime")
elif not s_set:
    print("setwise coprime")
else:
    print("not coprime")




### FIXED CODE ###

from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from math import gcd
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, gcd
from operator import mul
from functools import reduce


sys.setrecursionlimit(2147483647)
INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().rstrip().split()
def S(): return sys.stdin.readline().rstrip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]

mod=10**9+7

n=I()
A=LI()
l=A[0]
num=[0]*(10**6+1)
for i in range(1,n):
    num[A[i]]+=1
    l=gcd(l,A[i])



if l!=1:
    print("not coprime")
    exit()


for j in range(2,10**6):
    ret=0
    for k in range(j,10**6+1,j):
        ret+=num[k]
    if ret>1:
        print("setwise coprime")
        exit()

print("pairwise coprime")
### BUGGY CODE ###

def main():
    N, K, Q = map(int, input().split())
    A = [int(input()) for _ in range(Q)]

    points = [K for _ in range(N)]

    for i in A:
        points = list(map(lambda x: x - 1, points))
        points[i - 1] += 1

    for i in points:
        if i <= 0:
            print("No")
        else:
            print("Yes")


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    N, K, Q = map(int, input().split())
    A = [int(input()) for _ in range(Q)]

    points = [K for _ in range(N)]
    points = list(map(lambda x: x - Q, points))

    for i in A:
        points[i - 1] += 1

    for i in points:
        if i <= 0:
            print("No")
        else:
            print("Yes")


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

n,a=map(int,input().split())
X=sorted(list(map(int,input().split())))
#x1...xjからk枚選んでxiの合計をsにするような選び方の総数
m=max(a,X[-1])
dp=[[[0 for j in range(m*n+1)] for k in range(n+1)]for s in range(n+1)]

dp[0][0][0]=1
for j in range(n+1):
  for k in range(n+1):
    for s in range(m*n+1):
      if j >=1 and s<X[j-1]:
        dp[j][k][s]=dp[j-1][k][s]
      elif j>=1 and k>=1 and s>=X[j-1]:
        dp[j][k][s]=dp[j-1][k][s]+dp[j-1][k-1][s-X[j-1]]
ans = 0
for k in range(1, n+1):
  ans += dp[n][k][k*a]
print(ans)

### FIXED CODE ###

from collections import Counter
n,a=map(int,input().split())
X=sorted(list(map(lambda x:int(x)-a,input().split())))
ans=Counter([0])
for x in X:
  tmp=Counter()
  for k,v in ans.items():
    tmp[k+x]+=v
  ans+=tmp
print(ans[0]-1)