Harryxun/stf_run huggingface dataset:
N = int(input())
num_list = [[int(item) for item in input().split()] for _ in range(N)]
num_list.sort(key=lambda x: x[0]) 
# print(num_list)

temp_max = num_list[0][0] + num_list[0][1]
cnt = 1

for x, l in num_list:
    if x - l >= temp_max:
        cnt += 1
        temp_max = x + l
        # print(x, l, cnt, temp_max)


temp_max2 = num_list[1][0] + num_list[1][1]
cnt2 = 1

for x, l in num_list[1:]:
    if x - l >= temp_max2:
        cnt2 += 1
        temp_max2 = x + l
        # print(x, l, cnt, temp_max)

if cnt2 > cnt:
    cnt, cnt2 = cnt2, cnt
print(cnt)

### FIXED CODE ###

N = int(input())
num_list = [[int(item) for item in input().split()] for _ in range(N)]
num_list2 = []
for x, l in num_list:
    num_list2.append([x-l, x+l])

num_list2.sort(key=lambda x: x[1]) 
# print(num_list2)

temp_max = num_list2[0][1]
cnt = 1

for l, h in num_list2:
    if l >= temp_max:
        cnt += 1
        temp_max = h

print(cnt)
# coding: utf-8
# Your code here!

import fractions
import sys

N, M = map(int, input().rstrip().split(' '))
S = [x for x in input()]
T = [x for x in input()]

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
    
L = lcm(N, M)

dp = [-1] * L
for i, s in enumerate(S):
    dp[i*L//N] = s
    
for i, t in enumerate(T):
    if dp[i*L//M] != -1 and dp[i*L//M] != t:
        print(-1)
        sys.exit()
print(L)


### FIXED CODE ###

# coding: utf-8
# Your code here!

import fractions
import sys
from collections import defaultdict

N, M = map(int, input().rstrip().split(' '))
S = [x for x in input()]
T = [x for x in input()]

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

L = lcm(N, M)

dp = defaultdict(lambda: -1)

for i, s in enumerate(S):
    dp[i*L//N] = s

for i, t in enumerate(T):
    if dp[i*L//M] != -1:
        if dp[i*L//M] != t:
            print(-1)
            sys.exit()
print(L)
N = int(input())
array=[int(n) for n in input().split()]
lst=[]
for i in range(N+1):
    left_array=array[:N+i]
    l = sorted(left_array)[-N:]
    right_array=array[N+i:]
    r = sorted(right_array)[:N]
    ans = sum(l)-sum(r)
    lst.extend(ans)
print(lst)

### FIXED CODE ###

N = int(input())
array = [int(n) for n in input().split()]
import copy
import heapq
lst = [None for i in range(N + 1)]
left_lst = copy.deepcopy(lst)
right_lst = copy.deepcopy(lst)
left_array = array[:N]
right_array= [-n for n in array[-N:]]
l_sum = sum(left_array)
r_sum = sum(right_array)
heapq.heapify(left_array)
heapq.heapify(right_array)
left_lst[0] = l_sum
right_lst[0] = r_sum

for k in range(N, 2 * N):
    new_a, new_b = array[k], array[-k - 1]*-1
    heapq.heappush(left_array,new_a)
    heapq.heappush(right_array,new_b)
    old_a = heapq.heappop(left_array)
    l_sum += (new_a - old_a)
    left_lst[k - N + 1] = l_sum
    old_b = heapq.heappop(right_array)
    r_sum += (new_b - old_b)
    right_lst[k - N + 1] = r_sum
lst = [ a + b for a, b in zip(left_lst, list(reversed(right_lst)))]
print(max(lst))
n, m = map(int, input().split())
A = list(map(int, input().split()))

all_vote = sum(A)

cnt = 0

for a in A:
    #if a >= all_vote / (4*m):
    if a * 4 * m >= all_vote    #小数になる可能性をなくした
        cnt += 1
if cnt >= m:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n, m = map(int, input().split())
A = list(map(int, input().split()))

all_vote = sum(A)

cnt = 0

for a in A:
    #if a >= all_vote / (4*m):
    if a * 4 * m >= all_vote:   #小数になる可能性をなくした
        cnt += 1
if cnt >= m:
    print('Yes')
else:
    print('No')
N=int(input())
A = list(map(int,input().split()))
lis = [0]*200000
ans=1
num_zero=0
mod = 1000000007
for i in A:
  lis[i]+=1
  if i!=0:
    ans*=lis[i-1]
    lis[i-1]-=1
    ans%=mod
    if lis[i-1]<0:
      ans=0
      break
    
  else:
    num_zero+=1

if num_zero>=2:
  mul = 6
  
elif num_zero = 0:
  mul = 0

else:
  mul = 3
  
print((ans*mul)%mod)

### FIXED CODE ###

N=int(input())
A = list(map(int,input().split()))
lis = [0]*200000
ans=1
num_zero=0
mod = 1000000007
for i in A:
  lis[i]+=1
  if i!=0:
    ans*=lis[i-1]
    lis[i-1]-=1
    ans%=mod
    if lis[i-1]<0:
      ans=0
      break
    
  else:
    num_zero+=1

if (num_zero==2)or(num_zero==3):
  mul = 6
  
elif num_zero==1:
  mul = 3

else:
  mul = 0
  
print((ans*mul)%mod)
import math

r = int(input())

large = r ** 2 * math.pi
length = r * 2 * math.pi

print(large,end=' ')
print(length)

### FIXED CODE ###

import math
r = float(input())

area = r * r * math.pi
length = r * 2 * math.pi

print("{0:.6f}".format(area),end=' ')
print("{0:.6f}".format(length))
A,B = [int(i) for i in input().split(' ')]

0<=A
B<=10**9

if A%2==0 AND B%2==0:
  print((A+B)/2)
elif A%2 !=0 AND B%2 !=0:
  print((A+B)/2)
else:
  print('IMPOSSIBLE')

### FIXED CODE ###

A,B = [int(i) for i in input().split(' ')]

0<=A
B<=10**9

if (A+B)%2 == 0:
  print((A+B)//2)
else:
  print('IMPOSSIBLE')
N = int(input())
A = list(map(int, input().split()))
cnt = 0
from collections import Counter
B=A.Counter
if B.most_common[0][1] <= 1:
	print('YES')
else:
	print('NO')

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
cnt = 0
from collections import Counter
B=Counter(A)
C=B.most_common()
if C[0][1] <= 1:
	print('YES')
else:
	print('NO')
A = int(input())

B = int(input())

if A<10 and B<10:
	print(A*B)
else:
	print(int(-1))

### FIXED CODE ###

a,b=map(int,input().split())
 
if a<=9 and b <=9:
  print(a*b)
else:
  print(-1)
#計算量爆発で死ぬパターン

D = 1000000007
n, m = map(int, input().split())
a = [0] * (10**5 + 1)
for i in range(m):
    a[int(input())] += 1

# 初期値
s0 = 1
if (a[1] == 1):
    s1 = 0
else:
    s1 = 1


def calc(n):
    if (n == 0):
        return s0
    elif (n == 1):
        return s1
    elif(a[n] == 1):
        return 0
    else:
        return (calc(n-1) + calc(n - 2) % D

print(s[n])

### FIXED CODE ###

#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
D = 1000000007
n, m = map(int, input().split())
a = [0] * (10**5 + 1)
for i in range(m):
    a[int(input())] += 1

# 初期値
s = [0] * (n + 1)
s[0] = 1
if (a[1] == 1):
    s[1] = 0
else:
    s[1] = 1

# 暫定結果を格納する配列


def calc(n):
    if(a[n] == 1):
        return 0
    else:
        return (s[n - 1] + s[n - 2]) % D


def solver(n):
    for i in range(2, n + 1):
        s[i] = calc(i)


solver(n)
print(s[n])
a,b,k=map(int,input().split())
c=max(a,b)
l=[]
for i in range(c):
	if a%i==0 and b%i==0:
		l.append(i)
print(l[k-1])

### FIXED CODE ###

a,b,k=map(int,input().split())
c=max(a,b)
l=[]
for i in range(1,c+1):
	if a%i==0 and b%i==0:
		l.append(i)
l.sort(reverse=True)
print(l[k-1])
R,G,B,N =map(int,input().split())

cnt =0
    
for r in range((int(N/R)+1)):
    
    for g in range((int(N/G)+1)):
        
        if r*R+g*G > N:
            continue
            
        temp = N - r*R-g*G
            
        if temp%B ==0:
            cnt+=1
    
print(cnt)
            

### FIXED CODE ###

R,G,B,N =map(int,input().split())

cnt =0
    
for r in range(int(N/R)+1):
  ball = N-r*R 
  for g in range(int(ball/G)+1):
    res = N- (r*R+g*G)
    if  res >=0 and res%B ==0:
      cnt+=1
    
print(cnt)
S=list(input())
abc=list("abcdefghijklmnopqrstuvwxyz")
idx={}
for i in range(26):
    idx[abc[i]]=i
D=[0]*26
for s in S:
    D[idx[s]]+=1

if len(S)!=26:
    for i in range(26):
        if D[idx[abc[i]]]==0:
            ans="".join(S)+abc[i]
            break
        
else:
    ans=-1
    now=S[-1]
    for i in range(len(S)-1, 0,-1):
        if idx[S[i]]> idx[S[i-1]]:
            now=sorted(list(now))
            #print(now)
            for j,n in enumerate(now):
                if idx[n]>idx[S[i-1]]:
                    pre=n

                break

            ans="".join(S[:i-1])+pre
            break


        else:
            now=str(now)
            now+=S[i-1]

print(ans)

### FIXED CODE ###

S=list(input())
N=len(S)
abc=list("abcdefghijklmnopqrstuvwxyz")
D={}
for a in abc:
    D[a]=0
idx={}
for i in range(26):
    idx[abc[i]]=i

for s in S:
    D[s]+=1
L=[]
for k,v in D.items():
    if v==0:
        L.append(k)

L=sorted(L)
if len(L)==0:
    lis=[]
    for i in range(25,-1,-1):
        s=S[i]
        lis.append(s)
        if i!=0:
            if idx[s]>idx[S[i-1]]:
                break
    if len(lis)==26:
        print(-1)
        exit()

    lis=sorted(lis)
    for l in lis:
        if idx[S[i-1]]<idx[l]:
            add=l
            break
    ans="".join(S[:i-1])+add
    print(ans)

        
else:
    print("".join(S)+L[0])
#yzxwvutsrqponmlkjihgfedcba
read=input();
A,B=read.spilt(' ')
A=int(A)
B=int(B)
if A>=0 and A<=5:
  print(0);
elif A>5 and A<=12:
  print(B/2);
else:
  print(B);

### FIXED CODE ###

read=input();
A,B=read.split(' ')
A=int(A)
B=int(B)
if A>12:
  print(B);
elif A>5:
  print(int(B/2));
else:
  print(0);
num_list = list(map(int, input().split()))
count = 0

for i in range(3):
  count += num_list[i]

print(count)


### FIXED CODE ###

s = input()
print(s.count("1"))
s = str(input())
n = int(input())
s.upper()
print(s.count('ABC')) if len(s)==n

### FIXED CODE ###

N = int(input())
S = str(input())
print(S.count("ABC"))
N,K=map(int,input().split())
H=list(map(int,input().split()))
dp=[0]*N
for i in range(K):
  dp.append(10**9)
  H.append(10**9)

for i in range(N-1):
  dp[i+1]=min(*[dp[i-j]+abs(H[i-j]-H[i+1]) for j in range(K)])

print(str(dp[N-1]))

### FIXED CODE ###

N,K=map(int,input().split())
H=list(map(int,input().split()))
dp=[0]*N

for i in range(N-1):
  A=[]
  for j in range(K):
    if i-j>=0:
      A.append(dp[i-j]+abs(H[i-j]-H[i+1]))
  dp[i+1]=min(A)

print(dp[N-1])
import sys; readline = sys.stdin.readline
from collections import deque
from collections import Counter

N = int(readline())
A = list(map(int, readline().split()))
B = list(map(int, readline().split()))

A, B = zip(*sorted(zip(A, B), key=lambda x:x[1]))

A_s = sorted(A)
B_s = sorted(B)

no = "No"
yes = "Yes"

for i in range(len(A_s)):
    if A_s[i] > B_s[i]:
        print(no)
        exit(0)

for i in range(1, len(A_s)):
    if A_s[i] < B_s[i - 1]:
        print(yes)
        exit(0)

si2i = sorted(range(len(A)), key=lambda x:A[i])

a = 0
count = 0
while True:
    a = si2i[a]
    if a == 0:
        break
    count += 1

if count <= N - 2:
    print(yes)
    assert False
else:
    print(no)

### FIXED CODE ###

import sys; readline = sys.stdin.readline
from collections import deque
from collections import Counter

N = int(readline())
A = list(map(int, readline().split()))
B = list(map(int, readline().split()))

A, B = zip(*sorted(zip(A, B), key=lambda x:x[1]))

A_s = sorted(A)
B_s = sorted(B)

no = "No"
yes = "Yes"

for i in range(len(A_s)):
    if A_s[i] > B_s[i]:
        print(no)
        exit(0)

for i in range(1, len(A_s)):
    if A_s[i] < B_s[i - 1]:
        print(yes)
        exit(0)

si2i = sorted(range(len(A)), key=lambda x:A[x])

a = 0
count = 0
while True:
    a = si2i[a]
    if a == 0:
        break
    count += 1

if count <= N - 2:
    print(yes)
else:
    print(no)
import math
K = int(input())
if K==2: print(K)
else:
if K%2 ==0:K+=1
        while True:
                flg =0
                N = int(math.sqrt(K))
        
                for i in range(2,N):
                        if K%i == 0:
                        
                                flg = 1
                                break
                if flg == 0:
                        print(K)
                        break
                K+=2

### FIXED CODE ###

import math
K = int(input())
if K==2: print(K)
else:
        if K%2 ==0:
                K+=1
        while True:
                flg =0
                N = int(math.sqrt(K))
        
                for i in range(2,N):
                        if K%i == 0:
                        
                                flg = 1
                                break
                if flg == 0:
                        print(K)
                        break
                K+=2
A, B, C, D = map(int, input().split())

import numpy as np

from_1_a = (A-1)//C +(A-1)//D - (A-1)//np.lcm(C,D)
from_1_b = B//C + B//D - B//np.lcm(C,D)

baisu_c_or_d = from_1_b -from_1_a
among = B -A  +1


print(among - baisu_c_or_d)


### FIXED CODE ###

from fractions import gcd

A, B, C, D = map(int, input().split())
l = C * D // gcd(C, D)
x = (A - 1) - (A - 1) // C - (A - 1) // D + (A - 1) // l
y = B - B // C - B // D + B // l
print(y - x)
S = input()
T = input()
code = S
match = 0
maxmatch = 0
maxmatchloc = -1
hasmatch = False
if (len(T) <= len(S)):
        for x in range(len(S)-(len(T)-1)):
            match = 0
            for i in range(len(T)):                
                if (S[x+i] == T[i]):
                    if (maxmatch == -1):
                        maxmatch = 0
                    match += 1
                if (S[x+i] != T[i] and S[x+i] != '?'):
                    maxmatch = -1
                    break
            if (maxmatch == -1 and hasmatch == false):
                continue
            #if match
            if (match >= maxmatch and maxmatch != -1 and match < len(T)):
                hasmatch = True 
                maxmatch = match
                maxmatchloc = x
        #Building the code#
        for x in range(len(S)):
            if (S[x] == '?'):
                code = code[:x] + 'a' + code[x+1:] 
        if (maxmatch == 0):
            code = code[:len(S)-len(T)] + T
            print(code)
        elif(maxmatchloc >= 0):
            code = code[:maxmatchloc] + T + code[maxmatchloc + len(T):]
            print(code)
        elif(maxmatchloc == -1):
            print('UNRESTORABLE')
        else:
            print('UNRESTORABLE')
else:
    print('UNRESTORABLE')

### FIXED CODE ###

def search(S,T):
    match = 0
    maxmatch = 0
    maxmatchloc = -1
    for x in range(len(S)-(len(T)-1)):
        match = 0
        if (S[x] == T[0] or S[x] == '?'):
            for i in range(0,len(T)):
                ##print(S[x+i] + '-' + T[i])
                if (S[x+i] == T[i] or S[x+i] == "?"):
                    match += 1
                else:
                    ##print("Entered!")
                    match = 0
                    break
            if (match >= maxmatch and match != 0):
                ##print("ENTERED")
                maxmatchloc = x
                maxmatch = match
        ##print('At x = ' + str(x) + ': maxmatchlocation is ' + str(maxmatchloc) + ' match is ' + str(match) + ' maxmatch is' + str(maxmatch))
    return maxmatchloc

S = input()
T = input()
code = S
if '?' in S:
    if (len(T) <= len(S)):
        startpoint = search(S,T)
        for x in range(len(S)):
            if (S[x] == '?'):
                code = code[:x] + 'a' + code[x+1:] 
        if(startpoint >= 0):
            code = code[:startpoint] + T + code[startpoint + len(T):]
            print(code)
        else:
            print('UNRESTORABLE')
    else:
        print('UNRESTORABLE')
else:
    print(S)
def xgcd(a, b):
    x0, y0, x1, y1 = 1, 0, 0, 1
    while b != 0:
        q, a, b = a // b, b, a % b
        x0, x1 = x1, x0 - q * x1
        y0, y1 = y1, y0 - q * y1
    return a, x0, y0

def modinv(a, m):
    g, x, y = xgcd(a, m)
    return x % m

import math
N = int(input())
M = 10 ** 9 + 7
A = list(map(int,input().split()))
ans = 0
lcm = A[0]
for i in range(1,N):
    lcm = (lcm * A[i] // int(math.gcd(lcm,A[i] )) ) % M

print (lcm)
for i in range(N):
    print((modinv(A[i],M) * lcm) % M)
    ans = (ans + modinv(A[i], M) * lcm) % M 
           
print (ans)

### FIXED CODE ###

import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**18
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())

    N = NI()
    A = LI()
    d = [0] * (max(A)+1)

    for x in A:
        for i in range(2,int(math.sqrt(x))+1):
            cnt = 0
            while x % i == 0:
                cnt += 1
                x //= i
            d[i] = max(d[i],cnt)
            if x == 1: break
        else:
            d[x] = max(1,d[x])
    m = 1
    for i in range(2,len(d)):
        m = (m * i ** d[i]) % MOD
    ans = 0
    for x in A:
        ans += (m * pow(x,MOD-2,MOD)) % MOD
    print(ans % MOD)


if __name__ == '__main__':
    main()
# @author 

import sys

class DBlueAndRedBalls:
    def solve(self):
        MOD = 10 ** 9 + 7
        MAX_N = 2001
        C = [[0] * MAX_N for _ in range(MAX_N)]
        for i in range(MAX_N):
            C[0][i] = 1
        for i in range(1, MAX_N):
            C[i][i] = 1
            for j in range(i + 1, MAX_N):
                C[i][j] = (C[i][j - 1] + C[i - 1][j - 1]) % MOD

        n, k = [int(_) for _ in input().split()]
        ans = [0] * (k + 1)
        if n == k:
            for i in range(1, k + 1):
                ans[i] = 1
        else:
            ans[1] = n - k + 1
            for i in range(2, min(n - k + 1, k) + 1):
                ans[i] = (C[i - 1][k - 1] * C[i - 1 - 1][n - k - 1] +
                          2 * (sum(C[i - 1][k - 1] * C[i - 1 - 1][n - k - ext - 1] for ext in range(1, n - k - i + 1 + 1))) +
                          sum((ext - 1) * C[i - 1][k - 1] * C[i - 1 - 1][n - k - ext - 1] for ext in range(2, n - k - i + 1 + 1))) % MOD

        for x in ans[1:]:
            print(x)

solver = DBlueAndRedBalls()
input = sys.stdin.readline

solver.solve()


### FIXED CODE ###

# @author 

import sys

class AFiftyFifty:
    def solve(self):
        s = list(input().strip())
        s.sort()
        print("Yes" if (s[0] == s[1] and s[2] == s[3] and s[0] != s[2]) else "No")


solver = AFiftyFifty()
input = sys.stdin.readline

solver.solve()
r,D,x2000 = map(int, input().split())
next_value = algae(x2000)
for i in range(10):
    #next_value = algae(x2000)
    print(next_value)
    next_value = algae(next_value)

### FIXED CODE ###

r,D,x2000 = map(int, input().split())
def algae(x2000):
    #for i in range(10):
        ans = r * x2000 - D
        #new_ans = algae(r, D, ans)
        
        return ans
      
next_value = algae(x2000)
for i in range(10):
    print(next_value)
    next_value = algae(next_value)
def find_lcd(A,B):
  if A==B:
    return A
  else:
    return find_lcd(min(A,B), abs(A-B))
  
def find_num_prime(X):
  if X==1:
    return 1
  count = 1 # 1
  i=2
  sqrt_org=int(X**0.5)
  while X != 1:
    if i**2 > X:
      count += 1
      break
    if X%i == 0:
      count += 1
      while X%i == 0:
        #print(str(X)+' '+str(i))
        X = X/i
    if i== 2:
      i += 1
    else:
      i += 2
  return count
  
A,B = map(int, input().split())
lcd=find_lcd(A,B)
#print(lcd)
print(find_num_prime(lcd))

### FIXED CODE ###

def find_lcd(A,B):
  if A==1 or B==1:
    return 1
  if A==B:
    return A
  else:
    return find_lcd(min(A,B), abs(A-B))
  
def find_num_prime(X):
  if X==1:
    return 1
  count = 1 # 1
  i=2
  sqrt_org=int(X**0.5)
  while X != 1:
    if i**2 > X:
      count += 1
      break
    if X%i == 0:
      count += 1
      while X%i == 0:
        #print(str(X)+' '+str(i))
        X = int(X/i)
    if i== 2:
      i += 1
    else:
      i += 2
  return count
  
A,B = map(int, input().split())
lcd=find_lcd(A,B)
#print(lcd)
print(find_num_prime(lcd))
def factorize(n):
    a=[]
    while n%2==0:
        a.append(2)
        n//=2
    f=3
    while f*f<=n:
        if n%f==0:
            a.append(f)
            n//=f
        else:
            f+=2
    if n!=1:
        a.append(n)
    return a
def r(a):
    ll,l=[],1
    for i in range(len(a)-1):
        if a[i]==a[i+1]:
            l+=1
        else:
            ll.append([l,a[i]])
            l=1
    ll.append([l,a[-1]])
    return ll
n,p=map(int,input().split())
a=r(factorize(p))
b=1
for i in a:
    b*=i[1]**(i[0]//n)
print(b)

### FIXED CODE ###

def factorize(n):
    if n==1:
        return [1]
    a=[]
    while n%2==0:
        a.append(2)
        n//=2
    f=3
    while f*f<=n:
        if n%f==0:
            a.append(f)
            n//=f
        else:
            f+=2
    if n!=1:
        a.append(n)
    return a
def r(a):
    ll,l=[],1
    for i in range(len(a)-1):
        if a[i]==a[i+1]:
            l+=1
        else:
            ll.append([l,a[i]])
            l=1
    ll.append([l,a[-1]])
    return ll
n,p=map(int,input().split())
a=r(factorize(p))
b=1
for i in a:
    b*=i[1]**(i[0]//n)
print(b)
N = input()
A=input().split()

s=int(A[0])/int(N)
if (s+1)*N>A[1]:
    print('NG')
else:
    print('OK')

### FIXED CODE ###

N = int(input())
A=input().split()

s=int(A[0])//N
if int(A[0])%N==0:
    print('OK')
else:
    if (s+1)*N>int(A[1]):
        print('NG')
    else:
        print('OK')
N = int(input())
A = list(map(int, input().split()))


if N == 2:
    print(max(A[0], A[1]))
else:
    m = min(A)

    ans = -1
    for i in range(1, m+1):
        count = 0
        for n in range(N):
            if count > 1:
                break
            if A[n] % i != 0:
                count += 1
        if count <= 1 and i > ans:
            ans = i

    print(ans)

### FIXED CODE ###

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

ans = 0
for i in range(1, T+1):
    if i % A == 0:
        ans += B
print(ans)
import sys
sys.setrecursionlimit(200001)
N,Q = map(int,input().split())
ab = [ list(map(int,input().split())) for i in range(N-1) ]
px = [ list(map(int,input().split())) for i in range(Q) ]
dic = {}
dic2={}
dic3={}

for i in range(N):
    dic[i+1] = []
    dic2[i+1] = 0
for i in range(N-1):
    tmp1 = ab[i][0]
    tmp2 = ab[i][1]
    dic[tmp1].append(tmp2)
for i in range(Q):
    tmp1 = px[i][0]
    tmp2 = px[i][1]
    dic2[tmp1] += tmp2
def rec(now_node,prevval):
    nowval = prevval + dic2[now_node]
    dic3[now_node] = nowval
    for elem in dic[now_node]:
        rec(elem,nowval)
rec(1,0)
res = [str(dic3[i]) for i in range(1,N+1)]
print(' '.join(res))


### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
N,Q = map(int,input().split())
ab = [ tuple(map(int,input().split())) for i in range(N-1) ]
px = [ tuple(map(int,input().split())) for i in range(Q) ]
dic = {}
dic2=[0]*(N+1)
dic3=[0]*N

for i in range(N):
    dic[i+1] = []
for i in range(N-1):
    tmp1 = ab[i][0]
    tmp2 = ab[i][1]
    dic[tmp1].append(tmp2)
    dic[tmp2].append(tmp1)
ab=0
for i in range(Q):
    dic2[px[i][0]] += px[i][1]
px=0
def rec(now_node,prevval):
    nowval = prevval + dic2[now_node]
    dic3[now_node-1] = nowval
    tg_list = dic[now_node][:]
    for elem in tg_list:
        dic[elem].remove(now_node)
        rec(elem,nowval)
rec(1,0)
res = [str(dic3[i-1]) for i in range(1,N+1)]
print(' '.join(res))
while True:
    a=int(input('a='))
    b=int(input('b='))
    total=a*b
    if total%2==0:
        print('Even')
    else:
        print('Odd')

### FIXED CODE ###

a,b=map(int,input().split())
total=a*b
if total%2==0:
    print('Even')
else:
    print('Odd')
N = int(input())
A = list(map(int, input().split()))
A.sort()
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
    
    # iで割り切れるAiの個数を数える
    tmp = 0
    for j in range(l, N):
        if A[j]%i == 0:
            tmp += 1
    # 2個以上あればnot pairwise coprime
    # N個あれば not setwise coprime
    if tmp > 1:
        is_pairwise_coprime = False
    if tmp == N:
        is_setwise_coprime = False
    
    if is_setwise_coprime == False:
        break
    
    # iの倍数はチェック済みにする
    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')