Harryxun/stf_run huggingface dataset:
import numpy as np
import sys

input = sys.stdin.readline


N = int(input())

S = input()

color =list("RGB")

#色がRGBの３色ないとき
for x in color:
    if x not in S:
        print(0)
        exit()

r = 0
g = 0
b = 0
for i in range(len(S)):
    if S[i] == color[0]:
        r+=1
    elif S[i] == color[1]:
        g+=1
    elif S[i] == color[2]:
        b+=1

all = r*g*b

sub = 0
for i in range(N):
    for j in range(i+1,N):
        k = 2*j - i
        #kがN以上の位置にある
        if k >= N:
            continue

        #同じ色がある
        if S[i] == S[j] or S[j] == S[k] or S[k] == S[i] :
            continue
        sub+=1

print(all - sub)
        




### FIXED CODE ###

import sys

input = sys.stdin.readline


N = int(input())

S = input()

color =list("RGB")

#色がRGBの３色ないとき
for x in color:
    if x not in S:
        print(0)
        exit()

r = 0
g = 0
b = 0
for i in range(len(S)):
    if S[i] == color[0]:
        r+=1
    elif S[i] == color[1]:
        g+=1
    elif S[i] == color[2]:
        b+=1

all = r*g*b

sub = 0
for i in range(N):
    for j in range(i+1,N):
        k = 2*j - i
        #kがN以上の位置にある
        if k >= N:
            continue

        #同じ色がある
        if S[i] == S[j] or S[j] == S[k] or S[k] == S[i] :
            continue
        sub+=1

print(all - sub)
import sys
input=sys.stdin.readline

n=int(input())
G=[[] for i in range(n)]
for i in range(n-1):
    u,v,w=map(int,input().split())
    u-=1
    v-=1
    G[u].append([v,w])
    G[v].append([u,w])

A=[0]*n
def dfs(s,p=-1):
    for g in G[s]:
        if g[0]!=p:
            A[g[0]]=A[s]+g[1]
            dfs(g[0],s)

dfs(0)
for a in A:
    if a%2==0:
        print(0)
    else:
        print(1)

### FIXED CODE ###

import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**8)

n=int(input())
G=[[] for i in range(n)]
for i in range(n-1):
    u,v,w=map(int,input().split())
    u-=1
    v-=1
    G[u].append([v,w])
    G[v].append([u,w])

A=[0]*n
def dfs(s,p=-1):
    for g in G[s]:
        if g[0]!=p:
            A[g[0]]=A[s]+g[1]
            dfs(g[0],s)

dfs(0)
for a in A:
    if a%2==0:
        print(0)
    else:
        print(1)
import math
N=int(input())
for i in range(int(math.sqrt(N)) , int(math.sqrt(2*N))+1):
    if (i*(i+1))//2 >= N:
        ansmax=i
        dif=(i*(i+1))//2 - N

for j in range(1,ansmax+1):
    if j!=dif:
        print(j)

### FIXED CODE ###

import math
N=int(input())
for i in range(int(math.sqrt(N)) , int(math.sqrt(2*N+1))+100):
    if (i*(i+1))//2 >= N:
        ansmax=i
        dif=(i*(i+1))//2 - N
        break

for j in range(1,ansmax+1):
    if j!=dif:
        print(j)
h1,m1,h2,m2,k = map(int,input().split())
if m2 < m1:
	m2 += 60
    h2 -= 1
m = m2-m1
h = h2-h1

if 60*h+m <= k:
	print(60*h+m)
else:
	print(k)

### FIXED CODE ###

h1,m1,h2,m2,k = map(int,input().split())
if h2 < h1:
    h2 += 24
if m2 < m1:
    m2 += 60
    h2 -= 1
print((h2-h1)*60+m2-m1-k)
while True:
    s = raw_input()
    if s == "-":
        break
 
    for i in range(int(raw_input())):
        h = int(raw_input())
        s = s[h:] + s[0:h]
 
    print(s)

### FIXED CODE ###

import sys
 
def shuffle( cards ):
    h = int( sys.stdin.readline() )
    cards = cards[ h : ] + cards[ 0 : h ]
    return cards
 
while True:
    cards = sys.stdin.readline().rstrip()
    if '-' == cards:
        break
    m = int( sys.stdin.readline() )
    for i in range( m ):
        cards = shuffle( cards )
    print( cards )
N = int(input())
strX = input()

decX = int(strX,2)
cnt = strX.count('1')

pop_p = decX % (cnt + 1)
pop_m = decX % (cnt - 1)

for i in range(0,N):
  if strX[i] == '0':
    pop = (pop_p + (2**(N-1-i) % (cnt + 1))) % (cnt + 1)
    Ans = 1
    
  elif strX[i] == '1' and cnt == 1:
    pop = 0
    Ans = 0
    
  else:
    pop = (pop_m - (2**(N-1-i) % (cnt - 1))) % (cnt - 1)
    Ans = 1
  
  while pop > 0:
    wkcnt = bin(pop).count('1')
    pop = pop % wkcnt
    Ans += 1
  
  print(Ans)


### FIXED CODE ###

N = int(input())
strX = input()

#10進数に変換
decX = int(strX,2)

#1の数をカウント
pop_c = strX.count('1')

# X % popcount+1
f_p = decX % (pop_c + 1)

# X % popcount-1(0になる時は0)
if pop_c == 1:
  f_m = 0
else:
  f_m = decX % (pop_c - 1)

for i in range(0,N):
  if strX[i] == '0':
    pop_a = (f_p + pow(2,(N-1-i),(pop_c + 1))) % (pop_c + 1) 
    Ans = 1
    
  elif pop_c == 1:
    pop_a = 0
    Ans = 0
    
  else:
    pop_a = f_m - (pow(2,(N-1-i),(pop_c - 1)))
    if pop_a < 0:
      pop_a = pop_a + pop_c - 1
    Ans = 1
  
  while pop_a > 0:
    wkpop = bin(pop_a).count('1')
    pop_a = pop_a % wkpop
    Ans += 1
  
  print(Ans)
=> 0, 1, 2
s=input()
l=len(s)
T=753
c=[None]*(l-2)
for s in range(l-2):
	c[s]=abs(int(s[s:(s+3)])-T)
print(min(c))

### FIXED CODE ###

s=input()
l=len(s)
T=753
c=[None]*(l-2)
for sp in range(l-2):
	c[sp]=abs(int(s[sp:(sp+3)])-T)
print(min(c))
tmp = list(map(int, input().split()))
x = tmp[0]
y = tmp[1]
z = tmp[2]
k = tmp[3]
a = sorted(list(map(int, input().split())), reverse=True)
b = sorted(list(map(int, input().split())), reverse=True)
c = sorted(list(map(int, input().split())), reverse=True)

log = [[[False for _ in range(z)] for _ in range(y)] for _ in range(x)]

cnt = 0
h = []
heapq.heappush(h, (-(a[0]+b[0]+c[0]), 0, 0, 0))
while len(h) != 0 and cnt < k: 
  tmp = heapq.heappop(h)
  print(-tmp[0])
  cnt += 1
  if tmp[1]+1 < x and log[tmp[1]+1][tmp[2]][tmp[3]] == False:
    heapq.heappush(h, (-(a[tmp[1]+1]+b[tmp[2]]+c[tmp[3]]), tmp[1]+1, tmp[2], tmp[3]))
    log[tmp[1]+1][tmp[2]][tmp[3]] = True
  if tmp[2]+1 < y and log[tmp[1]][tmp[2]+1][tmp[3]] == False:
    heapq.heappush(h, (-(a[tmp[1]]+b[tmp[2]+1]+c[tmp[3]]), tmp[1], tmp[2]+1, tmp[3]))
    log[tmp[1]][tmp[2]+1][tmp[3]] = True
  if tmp[3]+1 < z and log[tmp[1]][tmp[2]][tmp[3]+1] == False:
    heapq.heappush(h, (-(a[tmp[1]]+b[tmp[2]]+c[tmp[3]+1]), tmp[1], tmp[2], tmp[3]+1))
    log[tmp[1]][tmp[2]][tmp[3]+1] = True

### FIXED CODE ###

tmp = list(map(int, input().split()))
x = tmp[0]
y = tmp[1]
z = tmp[2]
k = tmp[3]
a = sorted(list(map(int, input().split())), reverse=True)
b = sorted(list(map(int, input().split())), reverse=True)
c = sorted(list(map(int, input().split())), reverse=True)

ansl = []
for p in range(x):
  if p > k:
    break
  for q in range(y):
    if p * q > k:
      break
    for r in range(z):
      if p * q * r > k:
        break
      ansl.append(a[p] + b[q] + c[r])

ansl.sort(reverse=True)

for i in range(k):
  print(ansl[i])
#input x,n and p as intergers. p acts as an array
x,n=int(input()).split()
p=int([]).split()
length=len(p)

#define the closest number
def closestnum(p,length):
    return p[min(range(length))]
#print when x is not it p
for x not in p:
    print(round(closestnum(p,length)))
    
    


### FIXED CODE ###

import math

if __name__ == "__main__":
    x, n = map(int, input().split())
    a = set(map(int, input().split()))
    p = q = x
    while True:
        if p not in a and q not in a:
            print(min(p, q))
            quit(0)
        if p not in a:
            print(p)
            quit(0)
        elif q not in a:
            print(q)
            quit(0)
        else:
            p -= 1
            q += 1
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

N, M = ISI()
ab = [list(ISI()) for _ in range(N)]
cd = [list(ISI()) for _ in range(M)]
for i in range(N):
    min = 100
    for j in range(M):
        n = abs(ab[i][0] - cd[j][0]) +  abs(ab[i][1] - cd[j][1])
        if min > n:
            min = n
            point = j+1
    print(point)

### FIXED CODE ###

import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

N, M = ISI()
ab = [list(ISI()) for _ in range(N)]
cd = [list(ISI()) for _ in range(M)]
for i in range(N):
    min = 1000000000000
    for j in range(M):
        n = abs(ab[i][0] - cd[j][0]) +  abs(ab[i][1] - cd[j][1])
        if min > n:
            min = n
            point = j+1
    print(point)
from collections import defaultdict
import sys
sys.setlimitrecursion(100000000)
def main():
    #入力
    N, Q = (int(_) for _ in input().split())
    edge = [[int(_) for _ in input().split()] for __ in range(N-1)]
    query = [[int(_) for _ in input().split()] for __ in range(Q)]

    tree = defaultdict(list)
    for a, b in edge:
        tree[a].append(b)
        tree[b].append(a)

    cc = [0] * (N+1)
    seen = [False] * (N+1)

    for p, x in query:
        cc[p] += x

    def dfs(x):
        for p in tree[x]:
            if seen[p] == False:
                seen[p] = True
                cc[p] += cc[x]
                dfs(p)
        return

    seen[1] = True
    dfs(1)

    print(*cc[1:])
    return

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline #for input speed
sys.setrecursionlimit(10**6) #for deep recursion
n, q = map(int, input().split())

tree_index = [[] for _ in range(n)]
for i in range(n-1):
  a,b = map(int, input().split())
  a -= 1
  b -= 1
  tree_index[a].append(b) # a<bとは限らないため、双方向にする
  tree_index[b].append(a)
ans = [0] * n
for i in range(q):
  p, x = map(int, input().split())
  ans[p-1] += x
def dfs(cur, par):
    for chl in tree_index[cur]:
      if chl == par: #parentとchildが等しい時はスキップ
        continue
      ans[chl] += ans[cur] 
      dfs(chl, cur)
dfs(0, -1)
print(*ans)
#from fractions import gcd
from math import gcd
import numpy as np
#import sys
#input = sys.stdin.readline
mod = 10**9+7

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

lcm=1
for s in A:
    lcm = s*lcm//gcd(lcm, s)

ans = lcm*np.sum([pow(s,mod-2,mod) for s in A])%mod
#ans = sum([lcm//s % mod for s in A]) % mod

print(int(ans))

### FIXED CODE ###

from fractions import gcd
#from math import gcd
import numpy as np
import sys
input = sys.stdin.readline
mod = 10**9+7

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

lcm = 1
for s in A:
    lcm = s*lcm//gcd(lcm, s)

ans = lcm*sum([pow(s, mod-2, mod) for s in A]) % mod
#ans = sum([lcm//s % mod for s in A]) % mod

print(int(ans%mod))
import bisect
import fractions

n,x = map(int,input().split())
s = list(map(int,input().split()))

s.sort()
index = bisect.bisect_left(s,x)
s.insert(index,x)

if n == 1:
    print(s[1]-s[0])
    exit()

for i in range(len(s)-1):
    tmp = s[i+1] - s[i]
    if tmp%2 != 0:
        print(1)
        exit()
    ans = fractions.gcd(tmp,ans)

print(ans)

### FIXED CODE ###

import fractions as math

n,x = map(int,input().split())
s = list(map(int,input().split()))

a = []
for i in s:
    a.append(abs(i-x))

tmp = a[0]
for i in range(1,len(a)):
    tmp = math.gcd(tmp,a[i])

print(tmp)
n,k=input().split()
s=input()
k=int(k)-1
s[k]=chr(ord(s[k])+32)
print(s)

### FIXED CODE ###

n,k=input().split()
s=input()
k=int(k)-1
for i,c in enumerate(s):
	if i==k:c=chr(ord(c)+32)
	print(c,end='')
A, B, C, D = map(int, input().split())
if C/B <= A/D || C/B <= 1:
	print("Yes")
else:    
	print("No")

### FIXED CODE ###

A, B, C, D = map(int, input().split())
print("Yes" if (A+D-1)//D >= (C+B-1)//B else "No")
from decimal import *
a,b=map(float, input().split(" "))
b = Decimal(b) * 100
print((int)(a*b/100))

### FIXED CODE ###

from decimal import *
a,b = map(Decimal, input().split())
print(int(a*b))
from copy import deepcopy
S = list(input())
T = list(input())
s_num = len(S)
t_num = len(T)
S_copy = deepcopy(S)
if s < t:
  print('UNRESTORABLE')
else:
  for i in range(s_num-t_num, -1, -1):
    s_key = S[i:i+t_num]
    judge = 0
    for s, t in zip(s_key, T):
      if s=='?':
        judge += 1
      elif s == t:
        judge += 1
    if judge == t_num:
      S_copy[i:i+t_num] = T
  if S == S_copy:
    print('UNRESTORABLE')
  else:
    for i in S_copy:
      if i == '?':
        print('a', end='')
      else:
        print(i, end='')

### FIXED CODE ###

from copy import deepcopy
S = input()
T = input()
s_num = len(S)
t_num = len(T)
ans = []
if s_num < t_num:
  print('UNRESTORABLE')
else:
  for i in range(s_num-t_num+1):
    s_key = S[i:i+t_num]
    judge = 0
    for s, t in zip(s_key, T):
      if s=='?':
        judge += 1
      elif s == t:
        judge += 1
    if judge == t_num:
      tmp = S[:i] + T + S[i+t_num:]
      tmp = tmp.replace('?', 'a')
      ans.append(tmp)
  if ans:
    print(sorted(ans)[0])
  else:
    print('UNRESTORABLE')
a = input(a)
b = input(b)
s = a * b
if s % 2 == 0:
    print('Even')
else:
	print('Odd')  

### FIXED CODE ###

a, b = map(int, input().split())
if (a*b) % 2:
    print("Odd")
else:
    print("Even")
nums = list(map(int, input().split()))
n = nums[0]
a = nums[1]
b = nums[2]

if a == 0:
    print(0)
elif b == 0:
    print(n)
else:
   print(n / (a+b) * a)

### FIXED CODE ###

list = str(input())

if list == 'AAA' or list == 'BBB' or len(list) != 3:
    print("No")
else : 
    print("Yes")
s = str(input())
if s == "AAA" or s == "BBB":
    input("No")
else:
    input("Yes")


### FIXED CODE ###

s = str(input())
if s == "AAA" or s == "BBB":
    print("No")
else:
    print("Yes")
n=input()
s=[]
s[0]=2
s[1]=1
for i in range(2,86):
    s[i] = s[i-2]+s[i-1]
    if i==n-1:
        print(s[i])
        exit()


### FIXED CODE ###

n=int(input())
s=[]
s.append(2)
s.append(1)
if n==1:
    print('1')
    exit()
else:
    for i in range(2,87):
        k = s[i-2]+s[i-1]
        s.append(k)
        if i==n:
            print(s[i])
            exit()
n = int(input())
x = sorted(map(int, input().split()))
x1, x2 = x[n//2-1], x[n//2]
for i, xx in enumerate(x):
　if xx <= x1:
　　print(x2)
　else:
　　print(x1)


### FIXED CODE ###

n=int(input())
x=list(map(int,input().split()))
N=int(n/2)
y=sorted(x)
a=y[N-1]
b=y[N]
for j in range(n):
    if x[j]<=a:
        print(b)
    else:
        print(a)
(n, m) = [int(i) for i in input().split()]
 A = [[]]
 b = []
 for i input range(n):
     A.append([int(j) for j in input().split()])
  
 for i in range(m):
     b.append(int(input()))
  
 c = []
 for i in range(n):
     s = 0
     for j in range(m)
           s += A[n][m] * b[m]

### FIXED CODE ###

(n, m) = [int(i) for i in input().split()]
A = []
b = []
for i in range(n):
    A.append([int(j) for j in input().split()])
   
for r in range(m):
    b.append(int(input()))
   
for i in range(n):
    s = 0
    for j in range(m):
        s += A[i][j] * b[j]
    print(s)
ef main():
    HAIKU = [5, 7, 5]
    v = list(map(int, input().split()))
    return equal_list(v, HAIKU)


def equal_list(lst1, lst2):
    lst = lst1.copy()
    for element in lst2:
        try:
            lst.remove(element)
        except ValueError:
            break
    else:
        if not lst:
            return "YES"
    return "NO"


if __name__ == "__main__":
    print(main())


### FIXED CODE ###

def equal_list(lst1, lst2):
    lst = lst1.copy()
    for element in lst2:
        try:
            lst.remove(element)
        except ValueError:
            break
    else:
        if not lst:
            return "YES"
    return "NO"


HAIKU = [5, 7, 5]
v = list(map(int, input().split()))
print(equal_list(v, HAIKU))
from itertools import count, takewhile
 
x, y = map(int, input().split())
 
print(max(takewhile(lambda i: (x*(2**i) <= y,  count())))

### FIXED CODE ###

from itertools import count, takewhile

x, y = map(int, input().split())

print(sum(1 for _ in takewhile(lambda z: z <= y, (x*(2**i) for i in count()))))
def resolve():
    N = int(input())
    hs = list(map(int, input().split(" ")))
    dps = [None] * N

    def rec(dest):
        if dest == 0:
            return 0
        if dest == 1:
            return abs(hs[1]-hs[0])

        if dps[dest] is None:
            dps[dest] = min(rec(dest-1)+abs(hs[dest]-hs[dest-1]), rec(dest-2)+abs(hs[dest]-hs[dest-2]))
        
        return dps[dest]

    print(rec(N-1))

if __name__ == '__main__':
    resolve()

### FIXED CODE ###

def resolve():
    N = int(input())
    hs = list(map(int, input().split(" ")))
    dps = [0] * N

    dps[0] = 0
    dps[1] = abs(hs[1] - hs[0])
    for i in range(2, N):
        dps[i] = min(dps[i-1]+abs(hs[i]-hs[i-1]), dps[i-2]+abs(hs[i]-hs[i-2]))
    
    print(dps[-1])

if __name__ == '__main__':
    resolve()
N = input()
test = list(map(int,input()))

for _ in range(input()):
  a,b = int(input()).split()
  test[a] = b
  print(sum(test))

### FIXED CODE ###

N = int(input())
test = list(map(int,input().split()))
M = int(input()) 
  
for _ in range(M):
  a,b = map(int,input().split())
  print(sum(test) - test[a-1] + b)
N,M,C = list(map(int,input().split()))
b = input()
count = 0
for i in  range(N):
	a = input()
	s = 0
	for j in range(M)
		s += a[j]*b[j]
	if s>C:
		count+=1
print(count)


### FIXED CODE ###

N,M,C = list(map(int,input().split()))
b = list(map(int,input().split()))
count = 0
for i in  range(N):
	a = list(map(int,input().split()))
	s = 0
	for j in range(M):
		s += a[j]*b[j]
	if s+C>0:
		count+=1
print(count)
N,M = map(int,input().split())
A = []
for i in range(N):
  a = int(input()) 
  if a >= 1/(4*M):
    A.append(a)

if len(A)>=M:
  print("Yes")
else:
  print("No")
    

### FIXED CODE ###

N,M = map(int,input().split())
A = list(map(int,input().split()))
new_A = []
for i in range(N):
  if A[i] >= sum(A)/(4*M):
    new_A.append(A[i])

if len(new_A)>=M:
  print("Yes")
else:
  print("No")
import math

A,B = map(int, input().split())
ans = int(0)
N = math.floor(math.log2(B)+1)

A_mod = A % 4
B_mod = B % 4
if A_mod < 2:
  if B_mod ==1 or B_mod == 2:
    ans += 1
else:
  if B_mod ==3 or B_mod == 0:
    ans += 1

for i in range(2,N+1):
  A_mod = A % (2**i)
  B_mod = B % (2**i)
  if A_mod < 2**(i-1):
    if B_mod >= 2**(i-1):
      ans += ((B_mod+1)%2)*(2**(i-1))
  else:
    if B_mod < 2**(i-1):
      ans += (A_mod%2)*(2**(i-1))
    else:
      ans += ((A_mod+B_mod+1)%2)*(2**(i-1))

print(ans)

### FIXED CODE ###

import math

A,B = map(int, input().split())
ans = int(0)
if B==0:
  ans = 0
else:
  N = math.floor(math.log2(B)+1)
  
  A_mod = A % 4
  B_mod = B % 4
  if A_mod < 2:
    if B_mod ==1 or B_mod == 2:
      ans += 1
  else:
    if B_mod ==3 or B_mod == 0:
      ans += 1

  for i in range(2,N+1):
    A_mod = A % (2**i)
    B_mod = B % (2**i)
    if A_mod < 2**(i-1):
      if B_mod >= 2**(i-1):
        ans += ((B_mod+1)%2)*(2**(i-1))
    else:
      if B_mod < 2**(i-1):
        ans += (A_mod%2)*(2**(i-1))
      else:
        ans += ((A_mod+B_mod+1)%2)*(2**(i-1))

print(ans)
import sys

def solve():
    c = int(raw_input())
    for i in range(c):
        n = int(raw_input())
        data = map(int, raw_input())
        u,d = 0,0
        for i in range(n - 1):
            if i % 2 == 0:
                if data[i + 1] - data[i] > u:
                    u = data[i + 1] - data[i]
            else:
                if data[i + 1] - data[i] > d:
                    d = data[i + 1] - data[i]
    print u,d

if __name__ == "__main__":
    solve()

### FIXED CODE ###

import sys

def solve():
    c = int(raw_input())
    for i in range(c):
        n = int(raw_input())
        data = map(int, raw_input().split())
        u,d = 0,0
        for i in range(len(data) - 1):
                if data[i + 1] - data[i] > 0 and data[i + 1] - data[i] > u:
                        u = data[i + 1] - data[i] 
                elif data[i + 1] - data[i] < 0 and data[i] - data[i + 1] > d :
                        d = data[i] - data[i + 1]
        print u,d
if __name__ == "__main__":
    solve()
# E

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

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

def fast_factorization_init(N):
    res=list(range(N))
    for i in range(2,N):
        if i*i>N:
            break
        for j in range(i*i,N,i):
            if res[j]==j:
                res[j]=i
        if res[i]<i:
            continue
    return res            
    
min_factors=fast_factorization_init(N)
def fast_factorization(n):
    res=[]
    while n>1:
        res.append(min_factors[n])
        n//=min_factors[n]
    return res

res2=1
P=[]
for i in range(N):
    if i!=0:
        res1=gcd(A[i],res1)
    else:
        res1=A[0]
    fact=fast_factorization(A[i])
    if res2!=0:
        for p in P:
            if A[i]%p==0:
                res2=0
                break
    for p in fact:
        P.append(p)
if res2==1:
    print('pairwise coprime')
elif res1==1:
    print('setwise coprime')
else:
    print('not coprime')

### FIXED CODE ###

# E

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

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

def fast_factorization_init(N):
    res=list(range(N))
    for i in range(2,N):
        if i*i>N:
            break
        for j in range(i*i,N,i):
            if res[j]==j:
                res[j]=i
        if res[i]<i:
            continue
    return res            
    
min_factors=fast_factorization_init(10**6+10)
def fast_factorization(n):
    res=[]
    while n>1:
        res.append(min_factors[n])
        n//=min_factors[n]
    return list(set(res))

res2=0
P=[]
for i in range(N):
    if i!=0:
        res1=gcd(A[i],res1)
    else:
        res1=A[0]
    P += fast_factorization(A[i])

if len(set(P))==len(P):
    res2=1

if res2==1:
    print('pairwise coprime')
elif res1==1:
    print('setwise coprime')
else:
    print('not coprime')
l = int(input()
print((l/3)**3)

### FIXED CODE ###

l = int(input())
print((l/3)**3)
n, m = input().split()
a = map(int,input().split())
for k in range(m):
  a.sort()
  s, t = input().split()
  for i in range(s)
  	if a[i] < t:
      a[i] = t
    else:
      break
ans = 0
for v in range(n):
  ans = a[v]
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline
n,m = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
b = [list(map(int,input().split())) for p in [0]*m]
b.sort(key=lambda q: -q[1])
#print(a)
#print(b)

c = 0
for s in b:
	for t in [0]*s[0]:
		#print(s)
		if c + 1 > n:
			break
		if s[1] <= a[c]:
			break
		a[c] = s[1]
		c += 1
		#print(a)
	else:
		continue
	break
print(sum(a))
n=int(input());print(n(n+1)//2)

### FIXED CODE ###

n=int(input());print(n*(n+1)//2)
H, W = map(int, input().split())
G = []

for i in range(H):
  line = input()
  if line != '.' * W:
    G.append(line)

H = len(G)
ans = []

for i in range(W):
  flg = False
  tmp = ''
  for j in range(H):
    if G[j][i] == '.':
      flg = False
    else:
      flg = True
    tmp += G[j][i]
  if tmp != '.' * H:
    ans.append(tmp)

for i in range(len(ans[0])):
  tmp = ''
  for j in range(H):
    tmp += ans[j][i]
  print(tmp)

### FIXED CODE ###

H, W = map(int, input().split())
G = []

for i in range(H):
  line = input()
  if line != '.' * W:
    G.append(line)

H = len(G)
ans = []

for i in range(W):
  flg = False
  tmp = ''
  for j in range(H):
    if G[j][i] == '.':
      flg = False
    else:
      flg = True
    tmp += G[j][i]
  if tmp != '.' * H:
    ans.append(tmp)

for i in range(H):
  tmp = ''
  for j in range(len(ans)):
    tmp += ans[j][i]
  print(tmp)
s = list(input())
acgt = ['A','C','G','T']
tmp = ''
ans = []
for i in range(len(s)):
    if s[i] in acgt:
        tmp+=s[i]
    else:
        ans.append(tmp)
        tmp = ''
print(len(max(ans)))


### FIXED CODE ###

s = input()
acgt = ['A','C','G','T']
cnt = 0
ans = 0
for i in range(len(s)):
    if s[i] in acgt:
        cnt+=1
    else:
        ans = max(ans,cnt)
        cnt = 0
ans = max(ans,cnt)
print(ans)
x = int(input())
s = 0
j = 0
for i in range(1..x+1):
  s += i
  j += 1
  if s >= x:
    print(j)
    break

### FIXED CODE ###

x = int(input())
s = 0
j = 0
for i in range(1,x+1):
  s += i
  j += 1
  if s >= x:
    print(j)
    break