Harryxun/stf_run huggingface dataset:
tcd = input()

def dp(i, cnt, g, p):
    if g == p:
        if tcd[i] == "p":
            cnt -= 1
        g += 1

    else:
        if tcd[i] == "g":
            cnt += 1
        p += 1
    if i == len(tcd)-1:
        return cnt
    else:
        return dp(i+1, cnt, g, p)

print(dp(1, 0, 1, 0))

### FIXED CODE ###

tcd = input()

cnt = 0
for i in range(len(tcd)):
    if i%2 == 0:
        if tcd[i] == "p":
            cnt -= 1
    else:
        if tcd[i] == "g":
            cnt += 1
print(cnt)
def parse(l):
    name, time = l.split()
    return name, int(time)


n, quantum = map(int, input().split())
queue = list(parse(input()) for _ in range(n))
head = 0


def enqueue(x):
    global queue
    queue.append(x)


def dequeue():
    global head
    head += 1


total_time, count = 0, 0
while count < n:
    y = queue[head][1] - quantum
    if y <= 0:
        print(str(queue[head][0]) + " " + str(total_time + queue[head][1]))
        dequeue()
        total_time += y
        count += 1
    else:
        queue[head][1] -= quantum
        enqueue(queue[head])
        dequeue()

    total_time += quantum



### FIXED CODE ###

def parse(l):
    name, time = l.split()
    a = [name, int(time)]
    return a


n, quantum = map(int, input().split())
queue = []
for i in range(n):
    queue.append(parse(input()))
head = 0


def enqueue(x):
    global queue
    queue.append(x)


def dequeue():
    global head
    head += 1


total_time, count = 0, 0
while count < n:
    y = queue[head][1] - quantum
    if y <= 0:
        print(str(queue[head][0]) + " " + str(total_time + queue[head][1]))
        dequeue()
        total_time += y
        count += 1
    else:
        queue[head][1] -= quantum
        enqueue(queue[head])
        dequeue()

    total_time += quantum
N = int(input())
array = list(map(int, input().split()))
sameNum = [0]*(N)

for i in range(N):
    sameNum[array[i]-1] += 1

for k in range(1, N+1):
    answer = 0
    sameNumT = sameNum.copy()
    sameNumT[array[k-1]-1] -= 1
    for l in range(N):
        answer += sameNumT[l]*(sameNumT[l]-1)//2
    print(answer)




### FIXED CODE ###

N = int(input())
array = list(map(int, input().split()))
sameNum = [0]*(N)
sum = 0
# kを削除していないlistでの組み合わせを調べる
for i in range(N):
    sameNum[array[i]-1] += 1
for i in range(N):
    sum += sameNum[i]*(sameNum[i]-1)//2

for k in range(1, N+1):
    sumT = sum
    print(sumT - sameNum[array[k-1]-1] + 1)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from collections import deque 

cnt = 0
def include(x):
    global cnt
    s = str(x)
    if ('3' in s) and ('5' in s) and ('7' in s):
        cnt += 1  
     
def main():
    n = int(readline())
    dq = deque()
    dq.append(0)
    cnd = []
    dd = (3, 5, 7)
    while len(dq)>0:
        v = dq.popleft()
        for i in dd:
            if v*10+i>n:
                continue
            dq.append(v*10+i)
            cnd.append(v*10+i)
            include(v*10+i)
        if cnd[-1] > n:
            break
    print(cnt)
if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from collections import deque 

cnt = 0
def include(x):
    global cnt
    s = str(x)
    if ('3' in s) and ('5' in s) and ('7' in s):
        cnt += 1  
     
def main():
    n = int(readline())
    dq = deque()
    dq.append(0)
    cnd = [0]
    dd = (3, 5, 7)
    while len(dq)>0:
        v = dq.popleft()
        for i in dd:
            if v*10+i>n:
                continue
            dq.append(v*10+i)
            cnd.append(v*10+i)
            include(v*10+i)
        if cnd[-1] > n:
            break
    print(cnt)
if __name__ == '__main__':
    main()
N,X=map(int,input().split())
x=list(map(int,input().split()))
L=x+[X]
if N==1:
	print(abs(X-x[0]))
else:
	LL=[abs(L[i+1]-L[i]) for i in range(N)]
	def gcd(a,b):
		while b>0:
			a,b=b,a%b
		return a
	def GCD(LIST):
		if len(LIST)==2:
			return gcd(LIST[0],LIST[1])
		else:
			return(GCD([gcd(LIST[0],LIST[1])]+LIST[2::]))
	print(GCD(LL))

### FIXED CODE ###

from functools import reduce
N,X=map(int,input().split())
x=list(map(int,input().split()))
L=x+[X]
if N==1:
	print(abs(X-x[0]))
else:
	LL=[abs(L[i+1]-L[i]) for i in range(N)]
	def gcd(a,b):
		while b>0:
			a,b=b,a%b
		return a
	print(reduce(gcd,LL))
x=int(integer)
  if 400<=x<=599:
    print("8")
  elif 600<=x<=799:
    print("7")
  elif 800<=x<=999:
    print("6")
  elif 1000<=x<=1199:
    print("5")
  elif 1200<=x<=1399:
    print("4")
  elif 1400<=x<=1599:
    print("3")
  elif 1600<=x<=1799:
    print("2")
  elif 1800<=x<=1999:
    print("1")

### FIXED CODE ###

x=int(input())
if (x>=400 and x<=599):
  print("8")
elif (x>=600 and x<=799):
  print("7")
elif (x>=800 and x<=999):
  print("6")
elif (x>=1000 and x<=1199):
  print("5")
elif (x>=1200 and x<=1399):
  print("4")
elif (x>=1400 and x<=1599):
  print("3")
elif (x>=1600 and x<=1799):
  print("2")
elif (x>=1800 and x<=1999):
  print("1")
sum = 0
while 1:
   x = raw.input()
   sum = sum + 1
   if x == " 0 ":
      break
for i in range(0,sum):
   print 'Case %s: %s' %(i, x)

### FIXED CODE ###

sum = 0
while 1:
   x = raw_input()
   sum = sum + 1
   if x == '0':
      break
   print 'Case %s: %s' %(sum, x)
s_str = input()
# print(s_str)
# print(type(s_str))
# print()

# s_len = len(s_str)
# print(s_len)
# print(type(s_len))
# print()

list = []
for i in range(len(s_str)-1):
  s_new = s_str[i]
  # print('i=' + str(i))
  for j in range(i, len(s_str)):
    # print(s_new)
    if int(s_new) % 2019 == 0:
      # print('2019 * n number.')
      list.append(s_new)
    j = j + 1
    if j == len(s_str):
      break
    else:
      s_new = s_new + s_str[j]
  # print()
  i = i + 1

# print()
# print(list)
print(len(list))

### FIXED CODE ###

S, W = map(int, input().split())

if S <= W :
  print('unsafe')
else:
  print('safe')
N = input()
    S = input().split()
if 'Y' in S:
    print('Four')
else:
    print('Three')

### FIXED CODE ###

N = input()
S = input().split()
if 'Y' in S:
    print('Four')
else:
    print('Three')
def b(N, s):
    v = sum(s)
    for i in range(N, 0, -1):
        if v % 10 == 0:
            if s[i-1] % 10:
                v -= s[i-1]
            continue
        else:
            return a
    return 0
    
N = int(input())
s = []

for _ in range(N):
    s.append(int(input()))
    
s.sort(key=lambda x:-x)

print(b(N, s))

### FIXED CODE ###

def b(N, s):
    v = sum(s)
    for i in range(N, 0, -1):
        if v % 10 == 0:
            if s[i-1] % 10:
                v -= s[i-1]
            continue
        else:
            return v
    return 0
    
N = int(input())
s = []

for _ in range(N):
    s.append(int(input()))
    
s.sort(key=lambda x:-x)

print(b(N, s))
s = list(input())
t = list(input())
for i in range(len(s)):
  check = True:
    for j in range(len(s)):
      if t[j] != s[(i+j)%len(s)]:
        check = False
    if check:
      print("Yes")
      exit()
      
print("No")

### FIXED CODE ###

s = list(input())
t = list(input())
for i in range(len(s)):
  check = True
  for j in range(len(s)):
    if t[j] != s[(i+j)%len(s)]:
      check = False
  if check:
    print("Yes")
    exit()
      
print("No")
import itertools

n,m = map(int, input().split())
AB = []
ans = 0
for n in range(n):
    a,b = map(int,input().split())
    AB.append([a,b])
AB.sort()
A,B = zip(*AB)
A,B = list(A), list(B)

i = list(_ for _ in itertools.accumulate(B) if _ <= m)

B = B[:len(i)] + [m-i[-1]]
A = A[:len(B)]

ans = sum([a*b for a,b in zip(A,B)])
print(ans)

### FIXED CODE ###

import itertools

n,m = map(int, input().split())
AB = []
ans = 0
for n in range(n):
    a,b = map(int,input().split())
    AB.append([a,b])
AB.sort()
A,B = zip(*AB)
A,B = list(A), list(B)

i = list(_ for _ in itertools.accumulate(B) if _ <= m)
if i == []:
    ans = A[0]*m
else:
    B = B[:len(i)] + [m-i[-1]]
    A = A[:len(B)]

    ans = sum([a*b for a,b in zip(A,B)])
print(ans)
import heapq
n,m=map(int,input().split())
ab=[[0]*2 for _ in range(n)]


for i in range(n):
    ab[i]=list(map(int,input().split()))
ab.sort()
hq=[]
tmp=0
ans=0
for i in range(1,m+1):
    while tmp<n and ab[tmp][0]<=i:
        heapq.heappush(hq,-ab[tmp][1])
        tmq+=1
    if hq:
        ans-=heapq.heappop(hq)
print(ans)

### FIXED CODE ###

import heapq
n,m=map(int,input().split())
ab=[[0]*2 for _ in range(n)]


for i in range(n):
    ab[i]=list(map(int,input().split()))
ab.sort()
hq=[]
tmp=0
ans=0
for i in range(1,m+1):
    while tmp<n and ab[tmp][0]<=i:
        heapq.heappush(hq,-ab[tmp][1])
        tmp+=1
    if hq:
        ans-=heapq.heappop(hq)
print(ans)
n, h, d = map(int, input().split())
MOD = 10 ** 9 + 7


if n * h + h * d >= 10 ** 7:
    print(re)

# dp[i][j] := 高さiのブロックが最大高さでj個ある時の通り数
dp = [[0] * (n + 1) for i in range(h + 1)]
dp[0][n] = 1

# O(HN)
ru = [[0] * (n + 2) for i in range(h + 1)]
ru[0][n + 1] = 1
for i in range(h):
    # j = 0 -> j = 1 にする
    for diff in range(1, d + 1):
        if i + 1 - diff < 0:
            continue
        dp[i + 1][1] += ru[i + 1 - diff][n + 1]
        dp[i + 1][1] %= MOD

    # j - 1 -> j にする
    for j in range(2, n + 1):
        dp[i + 1][j] += dp[i + 1][j - 1] * j
        dp[i + 1][j] %= MOD

    for j in range(n + 1):
        ru[i + 1][j + 1] = ru[i + 1][j] + dp[i + 1][j]
        ru[i + 1][j + 1] %= MOD

print(dp[-1][-1] % MOD)

### FIXED CODE ###

n, h, d = map(int, input().split())
MOD = 10 ** 9 + 7


fact = [1] * (n + 1)
for i in range(n):
    fact[i + 1] = fact[i] * (i + 1)
    fact[i + 1] %= MOD

# fact_sum = fact[1] + fact[2] + ... + fact[n]
fact_sum = 0
for i in range(1, n + 1):
    fact_sum += fact[i]
    fact_sum %= MOD

dp = [0] * (h + 1)
ru = [0] * (h + 2)
dp[0] = 1
ru[1] = 1
for i in range(h):
    l = max(i + 1 - d, 0)
    dp[i + 1] += (ru[i + 1] - ru[l]) * fact_sum
    dp[i + 1] %= MOD
    ru[i + 2] = ru[i + 1] + dp[i + 1]
    ru[i + 2] %= MOD

print((dp[-1] * fact[n] * pow(fact_sum, MOD - 2, MOD)) % MOD)
a, b, h = (int(input()) for i in range(3))
  print((a+b)*h / 2)

### FIXED CODE ###

a, b, h= (int(input()) for _ in range(3))
print((a+b)*h // 2)
s=input()
t=input()
a,b={},{}
cnt=1

for i in range(len(s)):
    if s[i] not in a and t[i] not in b:
        a[s[i]]=cnt
        b[t[i]]=cnt
        ant+=1
    elif s[i] in a and t[i] in b and (a[s[i]]==b[t[i]]):
        pass
    else
        print("No")
        exit()
print("Yes")

### FIXED CODE ###

s=input()
t=input()
a,b={},{}
cnt=1
for i in s:
    if i not in a:
        a[i]=cnt
        cnt+=1
cnt=1
for i in t:
    if i not in b:
        b[i]=cnt
        cnt+=1

for i in range(len(s)):
    if a[s[i]]!=b[t[i]]:
        print("No")
        exit()
print("Yes")
def cmb(n, r, p):
  if (r < 0) or (n < r):
    return 0
  r = min(r, n - r)
  return fac[n]*finv[r]*finv[n-r]%p

def perm(n,r,p):
  if (r < 0) or (n < r):
    return 0
  return fac[n]*finv[n-r]%p

N = 31000
MOD = pow(10,9)+7

fac = [-1]*(N+1); fac[0] = 1; fac[1] = 1 #階乗
finv = [-1]*(N+1); finv[0] = 1; finv[1] = 1 #階乗の逆元
inv = [-1]*(N+1); inv[0] = 0; inv[1] = 1 #逆元
for i in range(2,N+1):
  fac[i] = fac[i-1]*i%MOD
  inv[i] = MOD - inv[MOD%i]*(MOD//i)%MOD
  finv[i] = finv[i-1]*inv[i]%MOD

M = int(input())
A = list(map(int,input().split()))
MAX = 60
L = [0]*MAX

for i in range(M):
  for j in range(MAX):
    if A[i]>>j&1:
      L[j] += 1
#print(L)
ans = 0
for i in range(MAX):
  base = pow(2,i)
  kosu = cmb(M,2,MOD)-cmb(L[i],2,MOD)-cmb(M-L[i],2,MOD)
  ans += base*kosu%MOD
print(ans%MOD)
  

### FIXED CODE ###

def cmb(n, r, p):
  if (r < 0) or (n < r):
    return 0
  r = min(r, n - r)
  return fac[n]*finv[r]*finv[n-r]%p

def perm(n,r,p):
  if (r < 0) or (n < r):
    return 0
  return fac[n]*finv[n-r]%p

N = 310000
MOD = pow(10,9)+7

fac = [-1]*(N+1); fac[0] = 1; fac[1] = 1 #階乗
finv = [-1]*(N+1); finv[0] = 1; finv[1] = 1 #階乗の逆元
inv = [-1]*(N+1); inv[0] = 0; inv[1] = 1 #逆元
for i in range(2,N+1):
  fac[i] = fac[i-1]*i%MOD
  inv[i] = MOD - inv[MOD%i]*(MOD//i)%MOD
  finv[i] = finv[i-1]*inv[i]%MOD

M = int(input())
A = list(map(int,input().split()))
MAX = 63
L = [0]*MAX

for i in range(M):
  for j in range(MAX):
    if A[i]>>j&1:
      L[j] += 1
#print(L)
ans = 0
for i in range(MAX):
  base = pow(2,i)
  kosu = cmb(M,2,MOD)-cmb(L[i],2,MOD)-cmb(M-L[i],2,MOD)
  ans += base*kosu%MOD
print(ans%MOD)
N = int(input())
p = [int(i) for i in input().split()]
ans = 1

if 0 in p:
  print(0)
  exit()
  
for i in range(N):
  ans*=p[i]
  if ans > 10 ** 18:
  print(-1)
  exit()
  
print(ans)

### FIXED CODE ###

N = int(input())
p = [int(i) for i in input().split()]
ans = 1

if 0 in p:
  print(0)
  exit()
  
for i in range(N):
  ans*=p[i]
  if ans > 10 ** 18:
    print(-1)
    exit()
print(ans)
def calc(a,b,f):
    if f==0:
        return a+b
    else:
        return a-b
s=input()
op=[0]*3
for i in range(2):
    tmp=calc(int(s[0]),int(s[1]),i)
    for j in range(2):
        tmp=calc(tmp,int(s[2]),j)
        for k in range(2):
            tmp=calc(tmp,int(s[3]),k)
            if tmp==7:
                ret=[i,j,k]
for i in range(3):
    if ret[i]==0:
        ret[i]="+"
    else:
        ret[i]="-"
for i in range(3):
    print(s[i]+ret[i],sep="",end="")
print(s[3]+"=7")

### FIXED CODE ###

def calc(a,b,f):
    a=int(a)
    b=int(b)
    if f==0:
        return a+b
    else:
        return a-b

s=input()
op=[0]*3
for i in range(2):
    a=calc(s[0],s[1],i)
    for j in range(2):
        b=calc(a,s[2],j)
        for k in range(2):
            c=calc(b,s[3],k)
            if c==7:
                ret=[i,j,k]               
for i in range(3):
    if ret[i]==0:
        ret[i]="+"
    else:
        ret[i]="-"
for i in range(3):
    print(s[i]+ret[i],sep="",end="")
print(s[3]+"=7")
from collections import defaultdict
import math

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

def sieve_of_eratosthenes(n):
    sieve = list(range(n+1))
    m = int(math.sqrt(n))
    for i in range(2, m + 1):
        if sieve[i] < i:
            continue
        for j in range(i * i, n + 1, i):
            if sieve[j] == j:
                sieve[j] = i
    return sieve

def factorize_by_sieve(x, sieve):
    factor = defaultdict(int)
    while sieve[x] != x:
        factor[sieve[x]] += 1
        x //= sieve[x]
    factor[x] += 1
    return factor

n = int(input())
a_list = list(map(int, input().split()))
a_list.sort()

sieve = sieve_of_eratosthenes(a_list[-1])
pairwise = True
setwise = True
primes = set()
x = a_list[0]
for a in a_list:
    x = gcd(x, a)
    if pairwise and a != 1:
        factor = factorize_by_sieve(a, sieve).keys()
        pairwise = primes.isdisjoint(factor):
        primes |= factor

if pairwise:
    print("pairwise coprime")
elif x == 1:
    print("setwise coprime")
else:
    print("not coprime")




### FIXED CODE ###

from collections import defaultdict

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

def sieve_of_eratosthenes(n):
    sieve = [0] * (n+1)
    sieve[0] = 1 #素数でない
    sieve[1] = 1 #素数でない
    for i in range(2, n):
        if sieve[i] == 0:
            for j in range(2, n // i + 1):
                sieve[i * j] = i
    return sieve

def factorize_by_sieve_of_eratosthenes(x, sieve):
    factor = defaultdict(int)
    while sieve[x]:
        factor[sieve[x]] += 1
        x //= sieve[x]
    factor[x] += 1
    return factor

n = int(input())
a_list = list(map(int, input().split()))
a_list.sort()

sieve = sieve_of_eratosthenes(a_list[-1])
pairwise = True
setwise = True
primes = set()
x = a_list[0]
for a in a_list:
    x = gcd(x, a)
    if pairwise and a != 1:
        factor = set(factorize_by_sieve_of_eratosthenes(a, sieve).keys())
        if not primes.isdisjoint(factor):
            pairwise = False
        else:
            primes |= factor

if pairwise:
    print("pairwise coprime")
elif x == 1:
    print("setwise coprime")
else:
    print("not coprime")
import numpy as np
n = int(input())
a = np.array(list(map(int, input().split())), dtype=np.int64)
mod = 10 ** 9 + 7
ans = [0] * 60
for x in a:
    x = bin(x)[2:].zfill(60)
    for i in range(60):
        ans[i] += int(x[i])
for i in range(60):
    ans[i] = ans[i] * (n - ans[i]) % mod
    ans[i] = ans[i] * pow(2, 59 - i, mod) % mod
ans_sum = 0
for x in ans:
    ans_sum = (ans_sum + x) % mod
print(ans_sum)

### FIXED CODE ###

import numpy as np
import sys
n = int(input())
a = np.array(sys.stdin.read().split(), dtype=np.int64)
mod = 10 ** 9 + 7
ans = 0
for i in range(63):
    b = (a >> i) & 1
    x = np.count_nonzero(b)
    x = x * (n - x)
    ans += x * pow(2, i, mod) % mod
print(ans % mod)
a = string(input())
n = 0
if a[0] == '1':
  n = n+1
if a[1] == '1':
  n = n+1
if a[2] == '1':
  n = n+1
  
print(n)

### FIXED CODE ###

a = input()
n = 0
if a[0] == '1':
  n = n+1
if a[1] == '1':
  n = n+1
if a[2] == '1':
  n = n+1
  
print(n)
s = input()
t = input()

result = 0
for i, v in enumerate(s):
  if t[i] !== v :
    result += 1
    
print(result)

### FIXED CODE ###

s = input()
t = input()

result = 0
for i, v in enumerate(s):
  if t[i] != v :
    result += 1
    
print(result)
import numpy as np
a = int(input())
b = np.array(list(map(int, input().split())))
b = np.prod(b)
if b > 10**18:
    print(-1)
else:print(b)


### FIXED CODE ###

a, b = map(int, input().split())
print(a*b)
import sys
sys.setrecursionlimit(100000000)
import math

M = 10**9 + 7
n = int(input())
a = list(map(int, input().split()))
p = a[0]
ans = 0
for i in range(1, n):
    p = p * a[i] // math.gcd(p, a[i])

for i in range(n):
    ans += p // a[i]
print(ans % M)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)
import collections
import math

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


def eratosthenes(n):  #エラトステネスの篩
    sieve = [True for _ in range(n + 1)]
    sieve[0] = False
    sieve[1] = False

    def _update(p):
        if sieve[p]:
            for i in range(p * 2, n + 1, p):
                sieve[i] = False

    if n > 1:
        _update(2)
    p = 3
    while p * p <= n:
        _update(p)
        p += 2
    return sieve


def factorize(n, primes):        # 素数の値をカウントする
    if n < 2:
        return dict()
    counter = collections.Counter()
    for p in primes:
        while n % p == 0:
            counter[p] += 1
            n //= p
        if n == 1:
            break
    if n > 1:
        counter[n] += 1
    return counter


if n == 1:
    print(1)
    exit()

sieve = eratosthenes(10 ** 3)
primes = [x for x, b in enumerate(sieve) if b]

lcm = collections.Counter()
for x in a:
    counter = factorize(x, primes)
    for p, k in counter.items():
        lcm[p] = max(lcm[p], k)
lcm_val = 1
for p, k in lcm.items():  # 各素因数と個数
    lcm_val *= pow(p, k, MOD)
    #lcm_val %= MOD       # 最小公倍数


res = 0
for x in a:
    res += lcm_val * pow(x, MOD - 2, MOD)  # 最小公倍数lcm_val / 各値x の余り 逆元をとる
    res %= MOD
print(res)
A, B = list(map(int, input().split()))
ans = [1,2,3]
ans.remove(A)
ans.remove(B)

print(ans[0])

### FIXED CODE ###

A = int(input())
B = int(input())
ans = [1,2,3]
ans.remove(A)
ans.remove(B)

print(ans[0])
x=int(input())
for a in range(200):
    for b in range(-200,200):
        if a**5-b**5=x:
            print(a,b)
            exit()

### FIXED CODE ###

x=int(input())
ma=200
for i in range(ma):
    for j in range(-ma,ma):
        if (i**5 - j**5) ==x:
            print(i,j)
            exit()
a=input()
b=input()
print(a+b)

### FIXED CODE ###

a,b=input().split()
print(b+a)
import sys
def input(): return sys.stdin.readline().rstrip()

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

A_max = A[-1]
prime = [[] for _ in range(A_max + 1)]
for i in range(2,A_max + 1):
    if prime[i] == []:
        n = i
        while n <= A_max:
            prime[n].append(i)
            n += i

li = [0] * (A_max + 1)
for a in A:
    for p in prime[a]:
        li[p] += 1

if max(li) == 1:
    print('pairwise coprime')
elif max(li) == N:
    print('not coprime')
else:
    print('setwise coprime')

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().rstrip()

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

A_max = max(A)
prime = [[] for _ in range(A_max + 1)]
for i in range(2,A_max + 1):
    if prime[i] == []:
        n = i
        while n <= A_max:
            prime[n].append(i)
            n += i

li = [0] * (A_max + 1)
for a in A:
    for p in prime[a]:
        li[p] += 1


if max(li) <= 1:
    print('pairwise coprime')
elif max(li) == N:
    print('not coprime')
else:
    print('setwise coprime')
n, T = map(int, input().split())
a = set()
min_ = 1000
for i in range(n):
    c, t = map(int, input().split())
    a.add(c)
    if t <= T and a[i] <= min_:
        min_ = a[i]
    a.remove(c)
if min_ == 1000:
    print('TLE')
else:
    print(min_)

### FIXED CODE ###

n = int(input())
if n == 1:
    print('Hello World')
else:
    a = int(input())
    b = int(input())
    print(a + b)
N = int(input())
S = input()

if N % 2 == 0 and S[0:N / 2] == S[N / 2 + 1:N - 1]:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N = int(input())
S = input()

if N % 2 == 0 and S[0:round(N / 2)] == S[round(N / 2):N]:
    print('Yes')
else:
    print('No')
N,M = map(int,input().split())
check = [0]*(N+1)
ac = 0
penalty = 0
for i in range(M):
  pi, si = input().split()
  pi = int(pi)
  if check[pi] == -1:
    continue
  if si == 'WA':
    check[pi] += 1
  else:
    ac += 1
    penalty += check[pi]
    check[pi] = -1
print(ac,wa)


### FIXED CODE ###

N,M = map(int,input().split())
check = [0]*N
ac = 0
penalty = 0
for i in range(M):
  pi, si = input().split()
  pi = int(pi)
  if check[pi-1] == -1:
    continue
  if si == 'WA':
    check[pi-1] += 1
  else:
    ac += 1
    penalty += check[pi-1]
    check[pi-1] = -1
print(ac,penalty)
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)

    return divisors

def main():
    n = int(input())

    count = n + 1

    ls = make_divisors(n)

    for i in range(len(ls)):
        if i % 2 != 0:
            continue
        if ls[i] + ls[i+1] < count:
            count = ls[i] + ls[i+1]

    print(count-2)

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    n = int(input())

    count = n + 1

    for i in range(1,int(n**0.5)+1):
        if n % i == 0 and n // i + i < count:
            count = n // i + i

    print(count-2)

if __name__ == '__main__':
    main()
N = int(input())
A = list(map(int, input().split()))
D = {}
for i in A:
    if i in D:
        D[i] += 1
    else:
        D[i] = 1
cnt = 0
for k in D.keys():
    if D[k] % 2:
        D[k] = 1
    else:
        D[k] = 2
        cnt += 1
print(len({*A}) - (cnt % 2))

### FIXED CODE ###

N = int(input())

if N < 11:
    d, m = divmod(N, 6)
    print(d + (m>0))
else:
    d, m = divmod(N, 11)
    a = (1 if m else 0) if m < 7 else 2
    print(d * 2 + a)
N,K=(int(x) for x in input().split())
A=list(map(int,input().split()))
count=0
for n in range(N):
    if A[n]>=K:
        count=count+1
S= [[0]*N for _ in range(N)]
for i in range (N-1):
    S[i][i+1]=A[i]+A[i+1]
    if S[i][i+1]>=K:
        count=count+1
    for j in range(i+2,N):
        S[i][j]=S[i][j-1]+A[j]
        if S[i][j]>=K:
            count=count+(N-j)
            break
print(count)


### FIXED CODE ###

W,H,x,y=(int(x) for x in input().split())
S=W*H/2
t=0
if x==W/2:
    if y==H/2:
        t=1
print(S,t)