Harryxun/stf_run huggingface dataset:
s.w=map(int,input().split())
if s<=w:
  print('unsafe')
else:
  print('safe')

### FIXED CODE ###

def main():
    s,w=map(int,input().split())
    if s<=w:
      print('unsafe')
    else:
      print('safe')
main()
a, b, c = map(int, input().split())
n = max(int(b / a), 1)
p = 'NO'
s = set()
r = n * a % b

while r not in s:
    if r == c:
        p = 'YES'
        break
    else:
        s.append(r)
        n += 1
        r = n * a % b
print(p)


### FIXED CODE ###

a, b, c = map(int, input().split())
n = max(int(b / a), 1)
p = 'NO'
s = set()
r = n * a % b

while r not in s:
    if r == c:
        p = 'YES'
        break
    else:
        s.add(r)
        n += 1
        r = n * a % b
print(p)
N,M= list(map(int,input().split()))
end = []
start = []
for i in range(M):
    A,B = list(map(int,input().split()))
    end.append(B)
    start.append(A)
end_min = min(end)
start_max = max(start)
if start_max >= end_min:
    print(0)
else:
    print(end_min-start_end+1)

### FIXED CODE ###

N,M= list(map(int,input().split()))
end = []
start = []
for i in range(M):
    A,B = list(map(int,input().split()))
    end.append(B)
    start.append(A)
end_min = min(end)
start_max = max(start)
if start_max > end_min:
    print(0)
else:
    print(end_min-start_max+1)
import math
n = int(input())
print(2*n // math.gcd(2,n))

### FIXED CODE ###

n = int(input())
if n % 2:
    print(2*n)
else:
    print(n)
A, B, C = input()
print(max(int(A+B)+int(C),int(B+A)+int(C),int(A+C)+int(B), int(C+A)+int(B), int(B+C)int(A), int(C+B)+int(A)))

### FIXED CODE ###

nums = list(map(int, input().split()))
nums.sort(key=lambda x: -x)
print(int(str(nums[0]) + str(nums[1])) + nums[2])
dish = [int(input()) for d in range(5)]
tmp = 0
time = []
for index,d in enumerate(dish):
  if d % 10 != 0:
    d10 = ((d // 10) +1) * 10
    time.append(d10)
    if tmp <= (d10-d):
      tmp = d10 - d
      last = index  
  else:
    time.append(d)
del time[last]
print(sum(time)+dish[last])

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
dish = [a,b,c,d,e]
last = 0
for index,d in enumerate(dish):
  if d % 10 != 0:
    d10 = ((d // 10)+1) *10
    if last <= d10 - d:
      last = d10 - d
    dish[index] = d10
print(sum(dish)-last)
def Comb(n,k):
    comb_ans=1
    for i in range(1,k+1):
        comb_ans*=(n-i+1)/i
    comb_ans=int(comb_ans)
    return comb_ans

N=int(input())
A=list(map(int,input().split()))
ans=0
L=[0]*N
for i in range(N):
    L[A[i]-1]+=1
for i in range(len(C)):
    ans+=Comb(L[A[i]-1],2)
for i in range(N):
    pri=ans
    pri=ans-Comb(L[A[i]-1],2)+Comb(L[A[i]-1]-1,2)
    print(pri)

### FIXED CODE ###

from collections import Counter

def Comb(n,k):
    comb_ans=1
    for i in range(1,k+1):
        comb_ans*=(n-i+1)/i
    comb_ans=int(comb_ans)
    return comb_ans

N=int(input())
A=list(map(int,input().split()))
C=Counter()
C.update(A)
ans=0
L=[0]*N
for i in range(N):
    L[A[i]-1]+=1
Most=C.most_common()
#print(Most)
for i in range(len(C)):
    ans+=Comb(Most[i][1],2)
for i in range(N):
    pri=ans
    pri=ans-L[A[i]-1]+1
    print(pri)
N=int(input())
for h in range(1,3501):
    for n in range(1,3501):
        if 4/N-1/h-1/n==0:
            continue
        w=(N*h*n)/(4*h*n-N*n-h*N)
        if w==int(w) and w>=1:
            print(h,n,int(w))
            exit()


### FIXED CODE ###

N=int(input())
for h in range(1,3501):
    for n in range(1,3501):
        if 4*h*n-N*n-h*N==0:
            continue
        w=(N*h*n)/(4*h*n-N*n-h*N)
        if w==int(w) and w>=1:
            print(h,n,int(w))
            exit()
from functools import reduce

def main():
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]
    ans = []
    X, Y, Z, K = (int(_) for _ in input().split())
    A = list(int(_) for _ in input().split())
    A.sort()
    B = list(int(_) for _ in input().split())
    B.sort()
    C = list(int(_) for _ in input().split())
    C.sort()
    for a in A:
        for b in B:
            for i in range(min(len(C),3001)):
                ans.append(a + b + C[i])
    ans.sort()
    ans = ans[::-1]
    ans = ans[:K]
    print('\n'.join(map(str,ans)))

if __name__ == '__main__':
    main()


### FIXED CODE ###

from functools import reduce

def main():
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    a = int(input().rstrip())
    b = int(input().rstrip())
    c = int(input().rstrip())
    d = int(input().rstrip())
    e = int(input().rstrip())
    k = int(input().rstrip())
    if abs(a - b) >k or abs(a - c) >k  or abs(a - d) >k or abs(a - e) >k or abs(b - c) >k or abs(b - d) >k  or abs(b - e) >k or abs(c - d) >k or abs(c - e) >k or abs(d - e) >k:
        print(':(')
    else:
        print('Yay!')
        
if __name__ == '__main__':
    main()
a=[]
a.append(input())
print(a[0]**2-a[1])

### FIXED CODE ###

a=[]
for i in range(0,2):
  a.append(int(input()))
print(a[0]**2-a[1])
n = int(input())
s = map(str,input().split())
if s in 'Y':
  print('Four')
else:
  print('Three')

### FIXED CODE ###

n = int(input())
s = map(str,input().split())
if 'Y' in s:
  print('Four')
else:
  print('Three')
a,b=input().split()
c=a*b
if c%2==0:
  print("Even")
else:
  print("Odd")

### FIXED CODE ###

a,b=(int(x) for x in input().split())
c=a*b
if c%2==0:
  print("Even")
else:
  print("Odd")
n, x = map(int, input().split())
l = list(map(int, input().split()))
ans = 0
for i in range(1, n):
  if l[i] + l[i-1] > x:
    ans += (l[i] + l[i-1]) - x
    l[i] -= (l[i] + l[i-1]) - x
print(ans)

### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))
even = 0
e_sum = 0
odd = 0
o_sum = 0
for i in range(n):
  e_sum += l[i]
  if i % 2 == 0 and e_sum <= 0:
    even += abs(e_sum)+1
    e_sum = 1
  elif not i % 2 == 0 and e_sum >= 0:
    even += abs(e_sum)+1
    e_sum = -1

for i in range(n):
  o_sum += l[i]
  if i % 2 == 0 and o_sum >= 0:
    odd += abs(o_sum)+1
    o_sum = -1
  elif not i % 2 == 0 and o_sum <= 0:
    odd += abs(o_sum)+1
    o_sum = 1

print(min(even, odd))
S = input().strip()
print(min(int([S[i:i+3]) for i in range(0,len(S)-2,3)))

### FIXED CODE ###

print("YES" if int(input()) in [3,5,7] else "NO")
n=int(input())
la=sorted(list(map(int,input().split())))
lb=sorted(list(map(int,input().split())))
lc=sorted(list(map(int,input().split())))
def nib1(x,l):
  right=len(l)-1
  left=0
  mid=(right+left)//2
  while left<=right:
    mid=(right+left)//2
    if x<l[mid]:
      right=mid-1
    elif x>l[mid]:
      left=mid+1
    else:
      return mid
  mid=(right+left)//2
  return mid
c=0 
for i in range(n):
  c+=nib1(lb[i],la)*(n-1-nib(lb[i],lc))
print(c)  

### FIXED CODE ###

import bisect
n=int(input())
la=sorted(map(int,input().split()))
lb=sorted(map(int,input().split()))
lc=sorted(map(int,input().split()))
countb=[]
count1=0
for i in range(n):
  index=bisect.bisect_left(la,lb[i])
  countb.append(index)
countb2=[]
sum=0
for i in range(n):
  sum+=countb[i]
  countb2.append(sum)
ans=0
for i in range(n):
  index=bisect.bisect_left(lb,lc[i])
  if index==0:
    pass
  else:
    ans+=countb2[index-1]
print(ans)
S = input()
Q = int(input())
Q_list = list()
for i in range(Q):
    Q_list.append(input().split())

from collections import deque
def operate(i):
    global count, str_list
    if Q_list[i][0] == '1':
        count += 1
    else:
        if count % 2 == 0:
            if Q_list[i][1] == '1':
                str_list.appendleft(Q_list[i][2])
            else:
                str_list.append(Q_list[i][2])
        else:
            if Q_list[i][1] == '1':
                str_list.append(Q_list[i][2])
            else:
                str_list.appendleft(Q_list[i][2])

check = 0
for i in range(Q):
    if Q_list[i][0] == '1':
        check += 1

if check % 2 == 1:
    S_list = list(reversed(S_list))

str_list = deque()
str_list.append(S)
count = check%2
for i in range(Q):
    operate(i)
print(''.join(str_list))


### FIXED CODE ###

S = list(i for i in input())

if 'A' in S and 'B' in S:
  print('Yes')
else:
  print('No')
x,y=map(int,input().split())
ans=0
if x<y:
    if 0<=x:
        ans=abs(y-x)
    else:
        z=abs(x)
        ans=abs(y-x)
        if z<=y:
            b=ans(y-z)
            if b<ans:
                ans=1
                ans+=b
else:
    if 0<=y:
        z=-x
        ans+=1
        ans+=abs(y-z)
    else:
        y=-y
        ans+=1
        z=-x
        a=abs(y-x)
        b=abs(y-z)
        if b<a:
            ans+=1
            ans+=b
        else:
            ans+=a
print(ans)

### FIXED CODE ###

x, y = [int(x) for x in input().split()]

if x == 0:
    ans = abs(y) + (y < 0)
else:
    ans = 1 if (x < 0 and abs(x) < abs(y)) or (x > 0 and abs(x) > abs(y)) else 0
    ans += abs(abs(y) - abs(x))
    ans += 1 if (-1 if (x < 0 and abs(x) < abs(y)) or (x > 0 and abs(x) > abs(y)) else 1) * x * y < 0 else 0

print(ans)
S=str(input())
K=int(input())
if S[0]!= '1':
    print(S[0])
    exit()
    
else:
    count=0
    i=0
    while S[i] == '1':
        count += 1
        i += 1

if K <= count:
    print('1')
else:
    print(S[count])


### FIXED CODE ###

S=str(input())
K=int(input())

for i in range(K):
    if S[i] != '1':
        print(S[i])
        exit()
        
print(S[K-1])
import bisect
N, M = (int(i) for i in input().split()) 
PY = [[int(i) for i in input().split()] for i in range(M)] 
d = {}

for i in range(M):
  p, y = [int(i) for i in input().split()]
  if p not in d:
    d[p] = [y]
  else:
    #d[p] = (d[p] + [y])
    index = bisect.bisect_left(d[p], y)
    d[p].insert(index, y)

 #for x in d:
 # d[x].sort()

for p, y in PY:
  print('{}{}'.format(str(p).zfill(6), str(d[p].index(y) + 1).zfill(6)))9

### FIXED CODE ###

import bisect
N, M = (int(i) for i in input().split()) 
PY = [[int(i) for i in input().split()] for i in range(M)] 
D = [[] for _ in range(N)]

for i, (p, y) in enumerate(PY):
  D[p-1].append((y, i))

ans = [None] * M
output = [[] for _ in range(M)]
for i, d in enumerate(D):
  d.sort()
  for k, (y, j) in enumerate(d):
    ans[j] = (i, k)

for i, k in ans:
  print('{}{}'.format(str(i+1).zfill(6), str(k+1).zfill(6)))
import numpy as np
 
N,M=map(int, input().split())  
A=list(map(int, input().split())
 
sumA=np.sum(A)
remain=N-sumA
       
if remain>=0:
	print(remain)
else:
	print(-1)

### FIXED CODE ###

import numpy as np

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

suma=np.sum(A)
remain=N-suma

if remain>=0:
	print(remain)
else:
	print(-1)
n=int(input())
a=[int(x) for x in input().split()]
a.sort()
b=[x for x in a if x>0]
c=[x for x in a if x<=0]
if len(c)%2==0:
    s=sum(b)
    s-=sum(c)
    print(s)
else:
    c.append(b.pop(0))
    s=sum(b)
    s-=sum(c[:-2])
    if c[-1] > c[-2]*-1:
        s+=c[-1]
        s+=c[-2]
        print(s)
    else:
        s-=c[-1]
        s-=c[-2]
        print(s)


### FIXED CODE ###

n=int(input())
a=[int(x) for x in input().split()]
a.sort()
b=[x for x in a if x>0]
c=[x for x in a if x<=0]
if len(b)==0:
    if len(c)%2==0:
        print(sum(c)*-1)
    else:
        print(sum(c[:-1])*-1+c[-1])
elif len(c)%2==0:
    s=sum(b)
    s-=sum(c)
    print(s)
else:
    c.append(b.pop(0))
    s=sum(b)
    s-=sum(c[:-2])
    if c[-1] > c[-2]*-1:
        s+=c[-1]
        s+=c[-2]
        print(s)
    else:
        s-=c[-1]
        s-=c[-2]
        print(s)
def main():
    import sys
    import numpy as np
    ikimasu = sys.stdin.buffer.readline
    ini = lambda: int(ins())
    ina = lambda: list(map(int, ikimasu().split()))
    ins = lambda: ikimasu().strip()
    
    n = ini()
    tmp = ina()
    num,index = 0,0
    for i in range(n):
        if(abs(tmp[i])>num):
            num,index = tmp[i],i
    print(2n-2)
    if(num<=0):
        for i in range(n):
            if(i!=index):
                print(index+1,i+1)
        for i in range(n,1,-1):
            print(i,i-1)
    else:
        for i in range(n):
            if(i!=index):
                print(index+1,i+1)
        for i in range(1,n):
            print(i,i+1)


        
        
        


    
        


        


    




















if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    import sys
    import numpy as np
    ikimasu = sys.stdin.buffer.readline
    ini = lambda: int(ins())
    ina = lambda: list(map(int, ikimasu().split()))
    ins = lambda: ikimasu().strip()
    
    n = ini()
    tmp = ina()
    num,index = 0,0
    for i in range(n):
        if(abs(tmp[i])>num):
            num,index = abs(tmp[i]),i
    print(2*n-2)
    if(tmp[index]<=0):
        for i in range(n):
            if(i!=index):
                print(index+1,i+1)
        for i in range(n,1,-1):
            print(i,i-1)
    else:
        for i in range(n):
            if(i!=index):
                print(index+1,i+1)
        for i in range(1,n):
            print(i,i+1)


        
        
        


    
        


        


    




















if __name__ == "__main__":
    main()
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**7)
import bisect
import heapq
import itertools
import math
import numpy as np
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from math import gcd
from operator import add, itemgetter, mul, xor
def cmb(n,r,mod):
  bunshi=1
  bunbo=1
  for i in range(r):
    bunbo = bunbo*(i+1)%mod
    bunshi = bunshi*(n-i)%mod
  return (bunshi*pow(bunbo,mod-2,mod))%mod
mod = 10**9+7
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]

h,w = MI()
a = [list(input()) for i in range(h)]
d = deque()
dx = [1,-1,0,0]
dy = [0,0,1,-1]
dist = [[-1]*w for _ in range(h)]
for i in range(h):
    for j in range(w):
        if a[i][j] == "#":
            d.append([i,j])
            dist[i][j] = 0
while d:
    s = d.popleft()
    y= s[0]
    x= s[1]
    for i in range(4):
        nx = x + dx[i]
        ny = y + dy[i]
        if nx < 0 or ny < 0 or nx >= h or ny >= w:
            continue
        else:
            if dist[nx][ny] == -1:
                dist[nx][ny] = dist[x][y] + 1
                d.append([nx,ny])
ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans,dist[i][j])
print(ans)


### FIXED CODE ###

#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**7)
import bisect
import heapq
import itertools
import math
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from math import gcd
from operator import add, itemgetter, mul, xor
def cmb(n,r,mod):
  bunshi=1
  bunbo=1
  for i in range(r):
    bunbo = bunbo*(i+1)%mod
    bunshi = bunshi*(n-i)%mod
  return (bunshi*pow(bunbo,mod-2,mod))%mod
mod = 10**9+7
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]

h,w = MI()
a = [list(input()) for i in range(h)]
d = deque()
dx = [1,-1,0,0]
dy = [0,0,1,-1]
dist = [[-1]*w for _ in range(h)]
for i in range(h):
    for j in range(w):
        if a[i][j] == "#":
            d.append([i,j])
            dist[i][j] = 0
while d:
    s = d.popleft()
    x= s[0]
    y= s[1]
    for i in range(4):
        nx = x + dx[i]
        ny = y + dy[i]
        if nx < 0 or ny < 0 or nx >= h or ny >= w:
            continue
        else:
            if dist[nx][ny] == -1:
                dist[nx][ny] = dist[x][y] + 1
                d.append([nx,ny])
ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans,dist[i][j])
print(ans)
import sys
sys.setrecursionlimit(10**7)

readline = sys.stdin.buffer.readline
def readstr():return readline().rstrip().decode()
def readstrs():return list(readline().decode().split())
def readint():return int(readline())
def readints():return list(map(int,readline().split()))
def printrows(x):print('\n'.join(map(str,x)))
def printline(x):print(' '.join(map(str,x)))

n,m = readints()
x = readints()
modx = [i%m for i in x]

a = [0]*10**5
b = [0]*m
for i in range(n):
    a[x[i]]+=1
    b[modx[i]]+=1

ans = b[0]//2
b[0] = 0
y = m//2
if m%2==0:
    ans += b[m//2]//2
    b[m//2] = 0
else:
    y += 1
for i in range(1,y):
    c = min(b[i],b[m-i])
    b[i]-=c
    b[m-i]-=c
    ans += c
for i in range(n):
    if b[i%m]>1 and a[i]>1:
        c = min(b[i%m],a[i])//2
        ans += c
        b[i%m]-=c*2

print(ans)






### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

readline = sys.stdin.buffer.readline
def readstr():return readline().rstrip().decode()
def readstrs():return list(readline().decode().split())
def readint():return int(readline())
def readints():return list(map(int,readline().split()))
def printrows(x):print('\n'.join(map(str,x)))
def printline(x):print(' '.join(map(str,x)))

n,m = readints()
x = readints()
modx = [i%m for i in x]

a = [0]*(10**5+1)
b = [0]*m
for i in range(n):
    a[x[i]]+=1
    b[modx[i]]+=1

ans = b[0]//2
b[0] = 0
y = m//2
if m%2==0:
    ans += b[m//2]//2
    b[m//2] = 0
else:
    y += 1
for i in range(1,y):
    c = min(b[i],b[m-i])
    b[i] -= c
    b[m-i] -= c
    ans += c
for i in range(10**5+1):
    if b[i%m]>1 and a[i]>1:
        c = min(b[i%m],a[i])//2
        ans += c
        b[i%m] -= c*2

print(ans)
s = input()
print(s[0]+f'{len(s)-2}'+s[-1])

### FIXED CODE ###

s = input()
n = len(s) - 2
print(s[0]+str(n)+s[-1])
n,k=map(int,input().split())
d=list(input().split())
x=range(1,10000)[::-1]
for i in d:
  for j in x:
    if i in str(j):
      x.remove(j)
import bisect as bi
print(x[bi.bisect_left(x,n)])

### FIXED CODE ###

n,k=map(int,input().split())
d=list(input().split())
x=list(range(1,100000)[::-1])
for i in d:
  a=[]
  for j in x:
    if i not in str(j):
      a.append(j)
  x=a
import bisect as bi
x=x[::-1]
print(x[bi.bisect_left(x,n)])
import numpy as np

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

As = np.array([["." for n in range(N)] for nn in range(N)])
for n in range(N):
  As[n,:] = np.array(list(input()))
  
Bs = np.array([["." for n in range(M)] for nn in range(M)])
for m in range(M):
  Bs[m,:] = np.array(list(input()))
  
ok = False
for i in range(N-M):
  for j in range(N-M):
    if (As[i:i+M,j:j+M] == Bs).all():
      ok = True
      break
if ok:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

import numpy as np

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

As = np.array([["." for n in range(N)] for nn in range(N)])
for n in range(N):
  As[n,:] = np.array(list(input()))
  
Bs = np.array([["." for n in range(M)] for nn in range(M)])
for m in range(M):
  Bs[m,:] = np.array(list(input()))
  
ok = False
for i in range(N-M+1):
  for j in range(N-M+1):
    if (As[i:i+M,j:j+M] == Bs).all():
      ok = True
      break
if ok:
  print("Yes")
else:
  print("No")
from collections import defaultdict
import sys
input = sys.stdin.readline


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append(i)

    if temp != 1:
        arr.append(temp)

    return arr


def main():
    n = int(input())
    A = list(map(int, input().split()))
    fact_dict = defaultdict(int)
    for a in A:
        facts = factorization(a)
        for fact in facts:
            fact_dict[fact] += 1

    count = max(fact_dict.values())
    if count == 1:
        print("pairwise coprime")
    elif count != n:
        print("setwise coprime")
    else:
        print("not coprime")


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline


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

    counts = [0] * (10**6 + 1)
    for a in A:
        counts[a] += 1

    ans = 1
    for i in range(2, 10**6+1):
        co_primes = 0
        for j in range(i, 10**6+1, i):
            co_primes += counts[j]
        if ans < co_primes:
            ans = co_primes

    if ans == 1:
        print("pairwise coprime")
    elif ans < n:
        print("setwise coprime")
    else:
        print("not coprime")


if __name__ == "__main__":
    main()
n, q = map(int, input().split())
s = input()
for i in range(q):
    l, r = map(int, input().split())
    start_a = s[l-1:r].find('A')
    end_a = s[l-1:r].rfind('A')
    start_c = s[l-1:r].find("C")
    end_c = s[l-1:r].rfind("C")
    if start_a == end_a or start_a +1 == start_c:
        start = start_a
    elif start_a +1 < start_c:
        start = start_c +1
       
    if start_c == end_c or end_a +1 == end_c:
        end = end_c
    elif end_a +1 < end_c:
        end = end_a
        
    if start == -1 or end== -1 or end <= start:
        print(0)
        continue
    cand = s[l-1:r][start:end+1]
    print(cand.count("AC"))

### FIXED CODE ###

N, Q = map(int, input().split())
S = input()

t = [0] * (N)
for i in range(N-1):
    t[i+1] = t[i] + (1 if S[i:i+2]=="AC" else 0)

for j in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    # divisors.sort()
    return divisors


def is_prime(p):
    if p == 1:
        return False
    for i in range(2, int(p ** 0.5) + 1)
        if p % i == 0:
            return False
    return True


A, B = map(int, input().split())

g = gcd(A, B)
d = make_divisors(g)

ans = 1
for i in d:
    if is_prime(i):
        ans += 1

print(ans)

### FIXED CODE ###

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    # divisors.sort()
    return divisors


def is_prime(p):
    if p == 1:
        return False
    for i in range(2, int(p ** 0.5) + 1):
        if p % i == 0:
            return False
    return True


A, B = map(int, input().split())

g = gcd(A, B)
d = make_divisors(g)

ans = 1
for i in d:
    if is_prime(i):
        ans += 1

print(ans)
import string
count = {x: 0 for x in string.ascii_lowercase}
lines = ""

while True:
    try:
        lines += input().lower()
    except EOFError:
        break

for c in lines:
    if 'a' <= c <= 'z':
        count[c] += 1

for key, num in string.ascii_lowercase:
    print("{0} : {1}".format(key, count(key)))

### FIXED CODE ###

import string
count = {x: 0 for x in string.ascii_lowercase}
lines = ""

while True:
    try:
        lines += input().lower()
    except EOFError:
        break

for c in lines:
    if 'a' <= c <= 'z':
        count[c] += 1

for key in string.ascii_lowercase:
    print("{0} : {1}".format(key, count[key]))