Harryxun/stf_run huggingface dataset:
R,G,B,N = map(int,input().split())
cnt = 0
for r in range(3001):
  for g in range(3001):
    V = r * R + g * G 
    if N >= V and (N - V) % == 0:
        cnt += 1
    else:
        continue
print(cnt)

### FIXED CODE ###

R,G,B,N = map(int,input().split())
cnt = 0
for r in range((N // R) + 1):
    for g in range((N - (r * R)) // G + 1):
        V = N - (r * R + g * G)
        if V >= 0 and V % B == 0:
            cnt += 1
print(cnt)
N, M = map(int, input().split())

A = [[0] * 2 for i in range(M)]

for i in range(M):
    A[i][0], A[i][1] = input().split()


AC = [0] * M
WA = [0] * M

for j in range(M)[::-1]:
    if A[j][1] == 'AC' and (A[j][0] in AC) is False:
        AC[j] = A[j][0]
    elif A[j][1] == 'WA' and (A[j][0] in AC) is True:
        WA[j] = A[j][0]

print(len(AC) - AC.count(0), len(WA) - WA.count(0))


### FIXED CODE ###

C = input()

L = list('abcdefghijklmnopqrstuvwxyz')

for i in range(26):
    if C == L[i]:
        print(L[i + 1])
        break
A = inout()
print('Bad' if A[i] == A[i+1] for i in range(4) else 'Good') 

### FIXED CODE ###

S=list(input())
c=0
for i in range(3):
    if S[i]==S[i+1]:
        c+=1
print('Bad' if c>0 else 'Good')
t = int(input())
if t >=30 print("Yes")
else print("No")

### FIXED CODE ###

t = int(input())
if t >= 30:
  print("Yes")
else :
  print("No")
N,M = map(int,input().split())
 
m = []
for i in range(M):
    m.append(list(map(int,input().split())))
for i in range(10**N):
    a = str(i)
    
    if i >= 10**(N-1):
            
        for j in range(M):
            try:
                
                if a[m[j][0]-1] == str(m[j][1]):
                    True
                
                else:
                    break
            except:
                break
                
            if j == M-1:
                print(i)
                exit() 
if M==0:
    if N == 1:
        print(0)
    else:
        print(10**(N-1))
        
if M==1:
    if N == 1:
        if m == [[1,0]]
            print(0)
            exit()
        
else :
    print(-1)

### FIXED CODE ###

N,M = map(int,input().split())
 
m = []
for i in range(M):
    m.append(list(map(int,input().split())))
for i in range(10**N):
    a = str(i)
    
    if i >= 10**(N-1):
            
        for j in range(M):
            try:
                
                if a[m[j][0]-1] == str(m[j][1]):
                    True
                
                else:
                    break
            except:
                break
                
            if j == M-1:
                print(i)
                exit()
                
if M==0:
    if N == 1:
        print(0)
        
    else:
        print(10**(N-1))
        
    exit()

elif M==1:
    if N == 1:
        m == [[1,0]]
        print(0)
        exit()


print(-1)
N=int(input())
from decimal import Decimal
P=input().split()
for i in range(0,len(P)):
    P[i]=Decimal(P[i])
import numpy
P=numpy.array(P)

result =numpy.prod(P)
 
if result>pow(10, 18):
    print(-1)
else:
    print(result)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
A.sort()
B=1
for i in A:
  B*=i
  if(B>10**18):
    B=-1
    break
print(B)
n, a, b = map(int, input().split())
c = 0
d = a+b
if a==0 and b==0:
    print(0)
elif a==0:
    print(0)
elif b==0:
    print(a)
else:   
    q, mod = divmod(n, d)      
    print(q*a + mod)

### FIXED CODE ###

S = input()
if S[0] == S[1] and S[1] == S[2]:
  print('No')
else:
  print('Yes')
a,b=map(int,input().split())
s=sorted([input() for i in range(n)])
print(*s,sep="")

### FIXED CODE ###

n,l=map(int,input().split())
s=sorted([input() for i in range(n)])
print(*s,sep="")
n, k = map(int, input().split())
a = list(map(int, input().split()))

d = [-1] * (n+1)
ls = 0
le = 0

def dfs(i, t):
  global d, ls, le
  if d[i] != -1:
    ls = i
    return False
  d[i] = t
  ret = dfs(a[i-1], t+1)
  if ret == False:
    le = i

dfs(1, 0)

#print(d)
#print(ls, le)
ld = d[ls]

ans = 0
if k <= d[le]:
  ans = d.index(k)
else:
  t = (k-ld) % (d[le] - d[ls] + 1)
  t += d[ls]
  ans = d.index(t)

print(ans)


### FIXED CODE ###

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

v = 1
s = [-1] * (n+1)
d = []
l = 0
c = 0

while s[v] == -1:
  s[v] = len(d)
  d.append(v)
  v = a[v-1]
l = s[v]
c = len(d) - s[v]

if k < l:
  print(d[k])
else:
  k -= l
  k %= c
  print(d[l+k])
import numpy
mod=10**9+7
n,m=map(int,input().split())
s=list(map(int,input().split()))
t=list(map(int,input().split()))
dp=[[0]*(m+1) for i in range(n+1)]
for i in range(n+1):
    dp[i][0]=1
for i in range(m+1):
    dp[0][i]=1
for i in range(n):
    for j in range(m):
        #答え見たらここの添字間違えてただけ…
        #だけど、適当にダブりを引きたくなっただけなので全然方針としてだめ、要復習
        if s[i]==t[j]:
            dp[i+1][j+1]=(dp[i+1][j]+dp[i][j+1])%mod
        else:
            dp[i+1][j+1]=(dp[i+1][j]+dp[i][j+1]-dp[i][j])%mod
print(dp[n][m])
#print(numpy.array(dp))

### FIXED CODE ###

mod=10**9+7
n,m=map(int,input().split())
s=list(map(int,input().split()))
t=list(map(int,input().split()))
dp=[[0]*(m+1) for i in range(n+1)]
for i in range(n+1):
    dp[i][0]=1
for i in range(m+1):
    dp[0][i]=1
for i in range(n):
    for j in range(m):
        #答え見たらここの添字間違えてただけ…
        #だけど、適当にダブりを引きたくなっただけなので全然方針としてだめ、要復習
        if s[i]==t[j]:
            dp[i+1][j+1]=(dp[i+1][j]+dp[i][j+1])%mod
        else:
            dp[i+1][j+1]=(dp[i+1][j]+dp[i][j+1]-dp[i][j])%mod
print(dp[n][m])
import numpy as np
n,k = map(int, input().split())
As = list(map(int, input().split()))

def f(x):
    # サイズxで切る
    cnt = 0
    for a in As:
        # 斬らなければイケない本数
        cnt += int(np.ceil(a/x))-1
    # 斬らなければいけない本数がk本以下
    return cnt <= k

l = 10**-6
r = 10**9
while r-l > 10**-5:
    # print(l,r)
    m = (l+r)/2
    if f(m):
        r = m
    else:
        l = m
print(int(np.ceil(l)))

### FIXED CODE ###

n,k = map(int, input().split())
As = list(map(int, input().split()))

def f(x):
    # サイズxで切る
    cnt = 0
    for a in As:
        # 斬らなければイケない本数
        cnt += int((a-0.01)/x)
        if cnt > k:
            return False
    # 斬らなければいけない本数がk本以下
    return cnt <= k

l = 10**-2
r = 10**9
while r-l > 10**-1:
    m = (l*r)**0.5
    if f(m):
        r = m
    else:
        l = m
print(int(l)+1)
S = input()
T = input()
N = len(S)
M = len(M)
Ss = [0]*(N+1)
Ts = [0]*(M+1)
for i in range(N):
  if S[i] == "A":
    temp = 1
  else:
    temp = -1
  Ss[i+1] = Ss[i] + temp
for i in range(M):
  if T[i] == "A":
    temp = 1
  else:
    temp = -1
  Ts[i+1] = Ts[i] + temp
Q = int(input())
for i in range(Q):
  a, b, c, d = (int(i) for i in input().split())
  if a == b:
    print("NO")
    continue
  else:
    if (Ss[b] - Ss[a-1] - Ts[d] + Ts[c-1])%3==0:
      print("YES")
    else:
      print("NO")
      

### FIXED CODE ###

S = input()
T = input()
N = len(S)
M = len(T)
Ss = [0]*(N+1)
Ts = [0]*(M+1)
for i in range(N):
  if S[i] == "A":
    temp = 1
  else:
    temp = -1
  Ss[i+1] = Ss[i] + temp
for i in range(M):
  if T[i] == "A":
    temp = 1
  else:
    temp = -1
  Ts[i+1] = Ts[i] + temp
Q = int(input())
for i in range(Q):
  a, b, c, d = (int(i) for i in input().split())
  if (Ss[b] - Ss[a-1] - Ts[d] + Ts[c-1])%3==0:
    print("YES")
  else:
    print("NO")
# -*- coding: utf-8 -*-
import math
def main():
    a, b, x=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
    rev = 0
    if x > (a*a*b/2):
        print("lar")
        x = a*a*b - x
        print(90-math.degrees(math.atan(a*a*a/2/x)))
    else:
        print(math.degrees(math.atan(b*b*a/2/x)))

if __name__ == '__main__':
    main()

### FIXED CODE ###

# -*- coding: utf-8 -*-
import math
def main():
    a, b, x=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
    rev = 0
    if x == a*a*b:
        print(0)
    elif x > (a*a*b/2):
        #print("lar")
        x = a*a*b - x
        print(90-math.degrees(math.atan(a*a*a/2/x)))
    else:
        print(math.degrees(math.atan(b*b*a/2/x)))

if __name__ == '__main__':
    main()
N=int(input())
a=[int(i)-1 for i in input().split()]
count=[0]*N
for i in range(N):
  count[a[i]]+=1
  if count[a[i]]==2:
    D=a[i]
    break
flag=False
k=0
mod=10**9+7
for i in range(N+1):
  if a[i]==D and not flag:
    flag=True
  elif a[i]==D and flag:
    break
  elif flag:
    k+=1
    
Factorial=[1]*(N+1)
for i in range(1,N+1):
  Factorial[i]=Factorial[i-1]*(i)%mod
def power(x,y):
  if y==0:
    return 1
  elif y==1:
    return x%mod
  elif y%2==0:
    return power(x,y//2)**2%mod
  else:
    return (power(x,y//2)**2)*x%mod

inverseFactorial=[1]*(N+1)
inverseFactorial[N]=power(Factorial[N],mod-2)
for i in range(0,N)[::-1]:
  inverseFactorial[i]=(inverseFactorial[i+1]*(i+1))%mod
  
def comb(x,y):
  if x<y or y<0:
    return 0
  else:
    return (Factorial[x]*inverseFactorial[y]*inverseFactorial[x-y])%mod

dp=[[0]*3 for i in range(N+2)]
dp[0][0]=1

for i in range(N+1):
  dp[i+1][0]=comb(N-1,i+1)
  dp[i+1][1]=-comb(N-k-1,i)+2*dp[i][0]
  if i>=1:
    dp[i+1][2]=dp[i-1][0]
  print(sum(dp[i+1])%mod)


### FIXED CODE ###

N=int(input())
a=[int(i)-1 for i in input().split()]
count=[0]*N
for i in range(N+1):
  count[a[i]]+=1
  if count[a[i]]==2:
    D=a[i]
    break
flag=False
k=0
mod=10**9+7
for i in range(N+1):
  if a[i]==D and not flag:
    flag=True
  elif a[i]==D and flag:
    break
  elif flag:
    k+=1
    
Factorial=[1]*(N+1)
for i in range(1,N+1):
  Factorial[i]=Factorial[i-1]*(i)%mod
def power(x,y):
  if y==0:
    return 1
  elif y==1:
    return x%mod
  elif y%2==0:
    return power(x,y//2)**2%mod
  else:
    return (power(x,y//2)**2)*x%mod

inverseFactorial=[1]*(N+1)
inverseFactorial[N]=power(Factorial[N],mod-2)
for i in range(0,N)[::-1]:
  inverseFactorial[i]=(inverseFactorial[i+1]*(i+1))%mod
  
def comb(x,y):
  if x<y or y<0:
    return 0
  else:
    return (Factorial[x]*inverseFactorial[y]*inverseFactorial[x-y])%mod

dp=[[0]*3 for i in range(N+2)]
dp[0][0]=1

for i in range(N+1):
  dp[i+1][0]=comb(N-1,i+1)
  dp[i+1][1]=-comb(N-k-1,i)+2*dp[i][0]
  if i>=1:
    dp[i+1][2]=dp[i-1][0]
  print(sum(dp[i+1])%mod)
a,b = list(int(i) for i in input().split())
if a == 1:
    a = 14
if b == 1:
    b = 14
if a==b:
    print("Draw")
else:
    print("Alice" if a>b else "Bob")

### FIXED CODE ###

def read_str_list():
    return list(str(i) for i in input().split())
a,b = read_str_list()
if a == "H":
    print(b)
else:
    if b == "H":
        print("D")
    else:
        print("H")
import heapq
N,M = map(int,input().split(' '))
An = list(map(int,input().split(' ')))
heapq.heapify(An)
BC_list = []
for i in range(M):
    BC = list(map(int,input().split(' ')))
    BC_list.append(BC)
BC_list.sort(reverse=True,key=lambda x: x[1])
flag = False
decided_sum = 0
for val in BC_list:
    B = val[0]
    C = val[1]
    for i in range(B):
        tmp_min = heapq.heappop(An)
        if tmp_min > C:
            #heapq.heappush(An,tmp_min)
            decided_sum += tmp_min
            flag = True
            break
        decided_sum += C
        #heapq.heappush(An,C)
    if flag:
        break
print(decided_sum + sum(An))

### FIXED CODE ###

import heapq
N,M = map(int,input().split(' '))
An = list(map(int,input().split(' ')))
heapq.heapify(An)
BC_list = []
for i in range(M):
    BC = list(map(int,input().split(' ')))
    BC_list.append(BC)
BC_list.sort(reverse=True,key=lambda x: x[1])
flag = False
decided_sum = []
for val in BC_list:
    B = val[0]
    C = val[1]
    for i in range(B):
        tmp_min = heapq.heappop(An)
        if tmp_min > C:
            #heapq.heappush(An,tmp_min)
            decided_sum.append(tmp_min)
            flag = True
            break
        decided_sum.append(C)
        if len(An) == 0:
            flag = True
            break
    if flag:
        break
print(sum(decided_sum) + sum(An))
while True:
    N = int(input())
    if N == 0:
        break
    d = {}
    for n in range(N):
        num, p, q = map(int, input().split())
        if num in d:
            d[num][1] += (p*q) 
        else:
            d[num] = [n, p*q]
    else:
        fla = False
        for k, v in sorted(d.items(), key=lambda x[1][0]):
            if v[1] >= 1000000:
                print(k)
                fla = True
        else:
            if not fla:
                print('NA')

### FIXED CODE ###

while True:
    N = int(input())
    if N == 0:
        break
    d = {}
    for n in range(N):
        num, p, q = map(int, input().split())
        if num in d:
            d[num][1] += (p*q)
        else:
            d[num] = [n, p*q]
    else:
        fla = False
        for k, v in sorted(d.items(), key=lambda x: x[1][0]):
            if v[1] >= 1000000:
                print(k)
                fla = True
        else:
            if not fla:
                print('NA')
def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))

    l = []
    for _ in range(40):
        cnt = 0
        for i in range(n):
            if a[i] & 1:
                cnt += 1
            a[i] >>= 1
        l.append(cnt)

    pows = [1]
    for _ in range(39):
        pows.append(pows[-1] * 2)

    right = 40

    def solve(k, right):
        if right == 0:
            return 0

        left = k.bit_length()
        x = 0
        y = 0
        for i in range(left):
            if l[i] < n - l[i]:
                x += pows[i]
                y += (n - l[i]) * pows[i]
            else:
                y += l[i] * pows[i]
        for i in range(left, right):
            y += l[i] * pows[i]

        if x <= k:
            return y
        else:
            return max(y - (n-2*l[right-1]) * pows[right-1], (n - l[i]) * pows[right-1] + solve(k - pows[right-1], left-1))

    print(solve(k, right))

main()

### FIXED CODE ###

def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))

    l = []
    for _ in range(40):
        cnt = 0
        for i in range(n):
            if a[i] & 1:
                cnt += 1
            a[i] >>= 1
        l.append(cnt)

    pows = [1]
    for _ in range(39):
        pows.append(pows[-1] * 2)

    if k == 0:
        print(sum([l[i] * pows[i] for i in range(40)]))
        exit()

    # when it does not use the biggest bit of k
    ans1 = 0
    for i in range(k.bit_length() - 1):
        if l[i] < n - l[i]:
            ans1 += (n - l[i]) * pows[i]
        else:
            ans1 += l[i] * pows[i]
    for i in range(k.bit_length() - 1, 40):
        ans1 += l[i] * pows[i]

    # when it use the biggest bit of k
    ans2 = 0
    ans3 = 0
    for i in range(40):
        if l[i] < n - l[i]:
            if k & 1:
                ans2 += (n - l[i]) * pows[i]
            else:
                ans2 += l[i] * pows[i]
            ans3 += (n - l[i]) * pows[i]
        else:
            if k & 1:
                ans2 = ans3 + l[i] * pows[i]
            else:
                ans2 += l[i] * pows[i]
            ans3 += l[i] * pows[i]
        k >>= 1

    print(max(ans1, ans2))

main()
N = int(input())
d = lisat(int(input()) for i in range(N))
print(len(set(sortd(d))))

### FIXED CODE ###

N = int(input())
d = list(int(input()) for _ in range(N))
print(len(set(sorted(d))))
import numpy as np
X,N = map(int,input().split())

if N ==0:
    print(X)

else:
    p = list(map(int,input().split()))

    length =np.zeros(100)
    length =list(length)

    for i in range(len(length)):
        length[i]= abs(X-i)

    for i in range(N):
        length[p[i]]=1000

    ans = length.index(min(length))
    print(ans)


### FIXED CODE ###

import numpy as np
X,N = map(int,input().split())

if N ==0:
    print(X)

else:
    p = list(map(int,input().split()))

    length =np.zeros(102)
    length =list(length)

    for i in range(len(length)):
        length[i]= abs(X-i)

    for i in range(N):
        length[p[i]]=1000

    ans = length.index(min(length))
    print(ans)
x,a=map(int, input.split())
print(10 if x>=a else 0)

### FIXED CODE ###

x,a=map(int, input().split())
print('10' if x>=a else '0')
a = map(int,input())
print(a + a**2 + a**3)

### FIXED CODE ###

a = int(input())
print(a + a**2 + a**3)
n, k = map(int, input().split())
a = list(map(int, input().split()))

a.sort(key=lambda x:-x)

# パワーがi以上の人の数
s = [0 for _ in range(2*a[0]+1)]
for p in a:
    s[p] += 1
for i in range(2*a[0], 0, -1):
    s[i-1] += s[i]

def is_over(x):
    num = 0
    for p in a:
        num += s[max(x-p, 0)]
    return num >= k

ub = 2*a[0]+1
lb = 2*a[-1]
while ub-lb > 1:
    x = (ub+lb)//2
    if is_over(x):
        lb = x
    else:
        ub = x

# a[0]からa[i]の累積和
t = a[:]
for i in range(1, n):
    t[i] += t[i-1]
ans = 0
for p in a:
    # 左手固定
    u = s[max(x-p, 0)] # 握手すると閾値を超えるひとたち
    if u != 0:
        ans += p*u+t[u-1] # 1人目pとu回握手 + 右手はu人までと握手
        k -= u
ans += lb*k # 閾値上の人の処理
print(ans)


### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))

A.sort(reverse=True)
LB = A[-1] * 2  # 一回の握手で上がる幸福度の下限は、左手も右手もパワーが一番低い人を握った場合
UB = A[0] * 2   # 一回の握手で上がる幸福度の上限は、左手も右手もパワーが一番高い人を握った場合

# cgs[i] は パワーがi以上のゲストの数
cgs = [0] * (UB + 1)
for a in A:
    cgs[a] += 1
for i in range(UB, 0, -1):
    cgs[i - 1] += cgs[i]


# 組み合わせの数がM以上になる一回で発生する幸福度の閾値を二分探索する
def is_ok(n):
    m = 0
    for a in A:
        m += cgs[max(n - a, 0)]
    return m >= M


ok = LB
ng = UB + 1
while ng - ok > 1:
    m = (ok + ng) // 2
    if is_ok(m):
        ok = m
    else:
        ng = m

# cps[i] は A[0]～A[i] の累積和
cps = A[:]
for i in range(1, N):
    cps[i] += cps[i - 1]

result = 0
for a in A:
# 左手固定
    t = cgs[max(ok - a, 0)] # 握手すると閾値を超えるひとたち
    if t != 0:
        result += a * t + cps[t - 1] # 1人目pとu回握手 + 右手はu人までと握手
        M -= t
result += ok * M # 閾値上の人の処理
print(result)
def init():
    table = [True] * 1000001
    table[0] = False
    table[1] = False
    n = len(table)
    for i in range(2, n):
        for j in range(i + i, n, i):
            table[j] = False
    return table
    
def is_prime(p):
    if p == 0 or p == 1:
        return False
    for i in range(2, p - 1):
        if p % i == 0:
            return False
    return True

def solve(price, ps, is_prime):
    dp = []
    for i in range(len(ps)):
        dp.append([False] * (price + 1))

    dp[0][ps[0]] = True
    dp[0][0]     = True

    for i in range(1, len(ps)):
        for p in range(price + 1):
            if p >= ps[i]:
                dp[i][p] = dp[i - 1][p] or dp[i][p - ps[i]]
            else:
                dp[i][p] = dp[i - 1][p]

    p = -1
    for i in range(0, price + 1):
        if is_prime[i] and dp[len(ps) - 1][i]:
            p = i
    if p == -1:
        print("NA")
    else:
        print(p)
    
def main():
    table = init()
    while True:
        n, price = map(int,raw_input().split())
        if n == 0 and price == 0:
            return
        ps = []
        for i in range(n):
            ps.append(int(raw_input()))
        solve(price, ps, table)

main()

### FIXED CODE ###

from datetime import datetime
import math

def measure(f):
    measure_start = datetime.now()
    v = f()
    print(datetime.now() - measure_start)
    return v

input = raw_input
range = xrange
    
def init():
    table = [True] * 1000001
    table[0] = False
    table[1] = False
    n = len(table)

    def prime(p):
        for i in range(p + p, n, p):
            table[i] = False
    prime(2)
    prime(3)
    prime(5)
    prime(7)
    prime(11)
    prime(13)

    for i in range(2, int(math.sqrt(n) + 1)):
        if (i % 2 != 0 and i % 3 != 0 and i % 5 != 0 and
            i % 7 != 0 and i % 11 != 0 and i % 13 != 0):
            for j in range(i * i, n, i):
                table[j] = False
#    for i in range(len(table)):
#        if table[i]:
#            print(i)
    return table
    
def solve(price, ps, is_prime):
    dp = [0] * ((price >> 5) + 1)

    for i in range(0, price + 1,ps[0]):
        dp[i >> 5] |= 1 << (i & 31)
    dp[0] = 1
    
    for i in range(1, len(ps)):
        cur_p = ps[i]
        r = cur_p & 31
        rest = 0
        if cur_p >= 32:
            for p in range(cur_p, price + 1, 32):
                i1 = (p - cur_p) >> 5
                i2 = p >> 5
                v = dp[i1]
                dp[i2] |= (v << r) | rest
                rest = (v >> (32 - r)) & ((1 << r) - 1)
        else:
            for p in range(cur_p, price + 1):
                dp[p >> 5] |= (dp[(p - cur_p) >> 5] >> ((p - cur_p) & 31) & 1) << (p & 31)
            
    p = -1
    for i in range(0, price + 1):
        if is_prime[i] and (dp[i >> 5] >> (i & 31)) & 1 == 1:
            p = i
    if p == -1:
        print("NA")
    else:
        print(p)
    
def main():
    table = init()
    while True:
        n, price = map(int,input().split())
        if n == 0 and price == 0:
            return
        ps = []
        for i in range(n):
            ps.append(int(input()))
        solve(price, ps, table)

main()
N = int(input())
A = list(map(int, input().split()))
A.sort()
m = A[0]
R = int(A[-1]**0.5)

is_pairwise_coprime = True
is_setwise_coprime = True
checked = [0]*(R+2)
l = 0
for i in range(2, R+2):
    if checked[i]:
        continue
    
    while A[l] < i:
        l += 1
    
    if l == N-1:
        break
    
    tmp = 0
    for j in range(l, N):
        if A[j]%i == 0:
            tmp += 1

    if tmp > 1:
        is_pairwise_coprime = False
    if tmp == N:
        is_setwise_coprime = False
    
    if is_setwise_coprime == False:
        break
    
    n = i
    while n < R+2:
        checked[n] = 1
        n += i
    # print(checked, l)
if is_pairwise_coprime:
    print('pairwise coprime')
elif is_setwise_coprime:
    print('setwise coprime')
else:
    print('not coprime')

### FIXED CODE ###

from collections import defaultdict

N = int(input())
A = list(map(int, input().split()))

Ones = A.count(1)
R = max(A)
nums = [0]*(R+1)

# 素因数テーブルの作成
D = [0]*(R+1)
for i in range(2, R+1):
    if D[i]:
        continue
    n = i
    while n < R+1:
        if D[n] == 0:
            D[n] = i
        n += i

# 素因子をカウント
for a in A:
    tmp = a
    while tmp > 1:
        prime_factor = D[tmp]
        nums[prime_factor] += 1
        while tmp%prime_factor == 0:
            tmp //= prime_factor
y = max(nums)
if y < 2:
    print('pairwise coprime')
elif y-Ones < N:
    print('setwise coprime')
else:
    print('not coprime')
S = "".join(list(map(str,input().split())))
if S.count("5") == 2 and S.count("7") == 1:
  print("YES")
else:
  print("NO)

### FIXED CODE ###

S = "".join(list(map(str,input().split())))
if S.count("5") == 2 and S.count("7") == 1:
  print("YES")
else:
  print("NO")
n,k=map(int,input().split(" ")
if k==1:
    return 0
else:
    return n-k

### FIXED CODE ###

n,k= [int(i) for i in input().split()]
if k==1:
    print (0)
else:
    print (n-k)
= list(input())
str = ""
for i in range(len(s)):
    if s[i] == "0":
        str += "0"
    if s[i] == "1":
        str += "1"
        print(str)
    if s[i] == "B":
        if str == "":
            continue
        else:
            str = str[:-1]
print(str)

### FIXED CODE ###

s = input()

a = ''
for x in s:
    if x == '0':
        a += '0'
    elif x == '1':
        a += '1'
    else:
        if a != '':
            #a = list(a)
            a = a[:-1]

print(a)
s=input()
if s == 'Sunny':
    print('Cloudy')
elif s == 'Cloudy':
    print('Rainy')
eise:
    print('Sunny')

### FIXED CODE ###

s = input()
if s == "Sunny":
    print("Cloudy")
elif s == "Cloudy":
    print("Rainy")
elif s == "Rainy":
    print("Sunny")
N=int(input())
A=map(int,input().split())
listA = []

for num in range(N):
  if num == (list(A))[i]:
    listA.append(num)


### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))

B=[[A[i],i] for i in range(N)]
B.sort()

for i in B:
  print((i[1]+1))
S = int(input())
h = S//3600
s = S%60
m = (S - 3600*h - s)//60
print(h:m:s)


### FIXED CODE ###

S=int(input())
print(S//3600,S//60%60,S%60,sep=":")
a = input()
b = input()
print a * b + " " + (a + b) * 2

### FIXED CODE ###

a, b = raw_input().split(" ")
print str(int(a) * int(b)) + " " + str((int(a) + int(b)) * 2)