Harryxun/stf_run huggingface dataset:
N=input()
flag=False
while flag:
   for i in range(-119:119:1):
    for j in range(-119:119:1):
       if i**5-j**5==x:
        flag=True
        print("{}{}",format(i,j))
        break
        
    if flag:
      break
      

### FIXED CODE ###

x=int(input())
for i in range(-1000,1000,1):
  for j in range(-1000,1000,1):
    if i**5-j**5==x:
      print(i,j)
      exit()
a,b.c = map(int,input().split())
if a < b:
  if c < b:
    print("OK")
  else:
    print("NO")
else:
  if c < a:
    print("OK")
  else:
    print("NO")

### FIXED CODE ###

a, b, c = map(int,input().split())
if a > c > b or b > c > a :
  print('Yes')
else :
  print('No')
import math
k = int(input())
ans = 0

for i in range(1,k+1):
	for j in range(i+1,k+1):
      	for k in range(j+1,k+1):
          	ans += math.gcd(i,math.gcd(j,k))
print(ans)

### FIXED CODE ###

import math
k = int(input())
ans = 0
if k < 3:
    for i in range(1,k+1):
        for j in range(1,k+1):
            for n in range(1,k+1):
                ans += math.gcd(i,math.gcd(j,n))
else: 
    #i*j
    for n in range(1,k+1):
        for i in range(1,k+1):
            ans += math.gcd(n,i)
            for j in range(i+1,k+1):            
                ans += 2*(math.gcd(math.gcd(i,j),n))

    '''
        for i in range(1,k+1):
            for j in range(i+1,k+1):
                for k in range(j+1,k+1):
                    ans += math.gcd(i,math.gcd(j,k))
    '''
print(ans)
N,M=list(map(int,input().split()))

g=[[] for i in range(M+1)]

for i in range(M):
	a,b=list(map(int,input().split()))
	g[a].append(b)
	g[b].append(a)

from collections import deque

queue = deque([1])
d = [None] * (N+1)
d[1] = 0
while queue:
	v = queue.popleft()
	for i in g[v]:
		if d[i] is None:
			d[i] = v
			queue.append(i)

print("Yes")
for i in range(2,N+1):
	print(d[i])

### FIXED CODE ###

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

g=[[] for i in range(N+1)]

for i in range(M):
	a,b=list(map(int,input().split()))
	g[a].append(b)
	g[b].append(a)

from collections import deque

queue = deque([1])
d = [None] * (N+1)
while queue:
	v = queue.popleft()
	for i in g[v]:
		if d[i] is None:
			d[i] = v
			queue.append(i)

print("Yes")
for i in range(2,N+1):
	print(d[i])
S = input()

ACGT = []
tmp = ""
for s in S:
    if s == "A" or s == "C" or s == "G" or s == "T":
        tmp += s
    else:
        ACGT.append(tmp)
        tmp = ""

print(len(sorted(ACGT, key=lambda x: len(x))[len(ACGT)-1]))


### FIXED CODE ###

S = list(input())
ACGT = []
tmp = ""
for i, s in enumerate(S):
    if s == "A" or s == "C" or s == "G" or s == "T":
        tmp += s
        if i == len(S)-1:
            ACGT.append(tmp)
            break
    else:
        ACGT.append(tmp)
        tmp = ""

print(len(sorted(ACGT, key=lambda x: len(x))[len(ACGT)-1]))
#D

def dig(n, scn, count):
    global sc
    #global checed

    if scn == -1:
        scn = 0
    else:
        return
    
    scn = count + c[n]
    sc[n] = scn
    #checked.append(n)
    
    for i in E[n]:
        #if not(i in checked):
        dig(i, sc[i], scn)

        


#XXX=[int(x) for x in Input.split()]

n,q = (int(x) for x in input().split())
#n,q = XXX[0:2]

E = [[] for i in range(n+1)]
for i in range(n-1):
    a,b = (int(x) for x in input().split())
    #a,b = XXX[i*2+2:i*2+4]
    #A.append(a)
    #B.append(b)
    E[a].append(b)
    E[b].append(a)

P = []
X = []
for i in range(q):
    p,x = (int(x) for x in input().split())
    #p,x = XXX[i*2+n*2:i*2+n*2+2]
    P.append(p)
    X.append(x)

c = [0]*(n+1)
for i in range(len(P)):
    c[P[i]]+=X[i]

sc = [-1]*(n+1)
#sc = [0]*(n+1)
#checked = []

dig(1,-1,0)
result = map(str, sc[1:])
print(" ".join(result))
    

### FIXED CODE ###

#D
       


#XXX=[int(x) for x in Input.split()]

n,q = (int(x) for x in input().split())
#n,q = XXX[0:2]

E = [[] for i in range(n+1)]
for i in range(n-1):
    a,b = (int(x) for x in input().split())
    #a,b = XXX[i*2+2:i*2+4]
    #A.append(a)
    #B.append(b)
    E[a].append(b)
    E[b].append(a)

P = []
X = []
for i in range(q):
    p,x = (int(x) for x in input().split())
    #p,x = XXX[i*2+n*2:i*2+n*2+2]
    P.append(p)
    X.append(x)

c = [0]*(n+1)
for i in range(len(P)):
    c[P[i]]+=X[i]

#sc = [-1]*(n+1)
sc = [0]*(n+1)
checked = [False]*(n+1)
stac = [1]

#dig(1,-1,0)

while stac:
    th = stac.pop()
    sc[th] += c[th]
    checked[th] = True
    
    for i in E[th]:
        if checked[i] == False:
            sc[i] += sc[th]
            stac.append(i)

result = map(str, sc[1:])
print(" ".join(result))
import sympy
A,B,C,D=map(int,input().split())
X=0
L=0
M=0
N=0
E=C*D/sympy.gcd(C,D)
if A%C==0 or B%C==0:
    L=(B-A)//C+1
else:
    L=(B-A)//C

if A%D==0 or B%D==0:
    M=(B-A)//D+1
else:
    M=(B-A)//D
if B-A>=E:
    if A%E==0 or B%E==0:
        N=(B-A)//E+1
    else:
        N=(B-A)//E
else:
    if A%E==0 or B%E==0:
        N=(B-A)//E+2
    else:
        N=(B-A)//E+1
X=B-A+1-L-M+N
print(int(X))

### FIXED CODE ###

import fractions
A,B,C,D=map(int,input().split())
E=C*D//fractions.gcd(C,D)
X=0
Y=0
X=A-1-(A-1)//C-(A-1)//D+(A-1)//E
Y=B-B//C-B//D+B//E
print(Y-X)
sum = input()

if len(sum) < 2:
    print('0')
else:
    last_2_digit = sum[-2:]
    upper_digit = sum[:-2]

    if last_2_digit == '00':
        print('1')
    else:
        required_num = int(last_2_digit) // 5 + 1
        if int(upper_digit) >= required_num:
            print('1')
        else:
            print('0')


### FIXED CODE ###

sum = input()

if len(sum) < 3:
    print('0')
else:
    last_2_digit = sum[-2:]
    upper_digit = sum[:-2]

    if last_2_digit == '00':
        print('1')
    else:
        required_num = (int(last_2_digit) - 1) // 5 + 1
        # print(upper_digit, last_2_digit, required_num)
        if int(upper_digit) >= required_num:
            print('1')
        else:
            print('0')
K = int(input.strip())
num1 = K // 2
num2 = K - num1
print(num1 * num2)

### FIXED CODE ###

K = int(input().strip())
num1 = K // 2
num2 = K - num1
print(num1 * num2)
b=[1]*2**31
for i in range(3,46341,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
print(sum(b[int(input())]for _ in[0]*int(input())))


### FIXED CODE ###

b=[1]*500000
for i in range(3,999,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
def p(x):
 if x<5*1e5:return b[x]
 x=2*x+1
 for i in range(3,int(x**.5+1),2):
  if x%i==0:return 0
 return 1
print(sum(p(int(input()))for _ in[0]*int(input())))
n=int(input())
l=[int(c) for c in input().splt()]
ans=0
mod=10**9+7
for i in range(60):
  s=sum(a>>i&1 for a in l)
  ans+=s*(n-s)<<i%mod
  ans%=mod
print(ans)

### FIXED CODE ###

n=int(input())
l=[int(c) for c in input().split()]
ans=0
mod=10**9+7
for i in range(60):
  s=sum(a>>i&1 for a in l)
  ans+=s*(n-s)<<i%mod
  ans%=mod
print(ans)
import math
N, Ma, Mb = map(int, input().split())
cost = [[0] * 10 for _ in range(10)]
for _ in range(N):
    a, b, c = map(int, input().split())
    a -= 1
    b -= 1
    cost[a][b] = c

min_cost = 10 ** 9 + 7
for k in range(N):
    for i in range(N):
        for j in range(N):
            g = math.gcd(i + 1 + k + 1, k + 1 + j + 1)
            if (i + 1 + k + 1) // g == Ma and (k + 1 + j + \
                1) // g == Mb and cost[i][k] + cost[k][j] != 0:
                # print(cost[i][k] + cost[k][j])
                min_cost = min(min_cost, cost[i][k] + cost[k][j])


if min_cost == 10 ** 9 + 7:
    print(-1)
else:
    print(min_cost)


### FIXED CODE ###

N, Ma, Mb = map(int, input().split())

sum_a = 0
sum_b = 0
A = []
B = []
C = []
for _ in range(N):
    a, b, c = map(int, input().split())
    sum_a += a
    sum_b += b
    A.append(a)
    B.append(b)
    C.append(c)

inf = 10 ** 9 + 7
# 3次元dpを考える
dp = [[[inf] * (sum_b + 1) for _ in range(sum_a + 1)] for _ in range(N + 1)]

dp[0][0][0] = 0
for i in range(N):
    for sa in range(sum_a):
        for sb in range(sum_b):
            if sa - A[i] >= 0 and sb - B[i] >= 0:
                dp[i + 1][sa][sb] = min(dp[i][sa - A[i]]
                                        [sb - B[i]] + C[i], dp[i][sa][sb])
            else:
                dp[i + 1][sa][sb] = min(dp[i][sa][sb], dp[i + 1][sa][sb])

ans = inf
for i in range(1, sum_a + 1):
    for j in range(1, sum_b + 1):
        if Ma * j == Mb * i:
            ans = min(ans, dp[N][i][j])

print(ans if ans != inf else -1)
d,g = map(int,input().split())
po = [0]
co = [0]
for i in range(d):
    p,c = map(int,input().split())
    po.append(p)
    co.append(c)

# f(g,i) :　残りG点で、i番目の問題を最大いくつ選べるか
# i番目の問題をn問解いて、
# その得点sがGより小さかったら、f(G-s,i-1)をnに加える。
# ここでiをデクリメントするのは、完全に解く問題より高い得点の問題を
# 中途半端に解くことが最適な問題の選び方ではないため。
# i == 0 の時は float('inf') を返す。（解けない場合）
def f(G,i):
    if i == 0:
        return float("inf")
    n = min(G//(i * 100),po[i])
    s = 100 * i * n 
    if n == po[i]:
        s += c[i]
    if s < G:
        n += f(G-s,i-1)
    return min(n,f(G,i-1))

print(f(g,d))

### FIXED CODE ###

d,g = map(int,input().split())
po = [0]
co = [0]
for i in range(d):
    p,c = map(int,input().split())
    po.append(p)
    co.append(c)

# f(g,i) :　残りG点で、i番目の問題を最大いくつ選べるか
# i番目の問題をn問解いて、
# その得点sがGより小さかったら、f(G-s,i-1)をnに加える。
# ここでiをデクリメントするのは、完全に解く問題より高い得点の問題を
# 中途半端に解くことが最適な問題の選び方ではないため。
# i == 0 の時は float('inf') を返す。（解けない場合）
def f(G,i):
    if i == 0:
        return float("inf")
    n = min(G//(i * 100),po[i])
    s = 100 * i * n 
    if n == po[i]:
        s += co[i]
    if s < G:
        n += f(G-s,i-1)
    return min(n,f(G,i-1))

print(f(g,d))
n,k=map(int,input().split())
p=list(map(int,input().split()))
p.sort()
if n>k:
    s=p[0]+p[1]+p[2]
    print(s)
elif n==k:
    print(sum(p))


### FIXED CODE ###

n,k=map(int,input().split())
p=list(map(int,input().split()))
p.sort()
if n==k and k==len(p):
        print(sum(p))
        exit()

if n>k:
    s=0
    for i in range(k):
        s+=p[i]
        
print(s)
a,b,c,d=map(int,input().split())
al = b-a+1
# cで割り切れる個数
x = int(b/c) -int((a-1)/c)
# dで割り切れる個数
y = int(b/d) -int((a-1)/d)
# cdの最小公倍数
lcm_xy = int(c*d/math.gcd(c,d))
# cdの最小公倍数で割り切れる個数
xy = int(b/lcm_xy) -int((a-1)/lcm_xy)
#print(x,y,xy,al)
print(al-(x+y-xy))

### FIXED CODE ###

s = input()
if s[0]==s[1] or s[1]==s[2] or s[2]==s[3]:
  print('Bad')
else:
  print('Good')
from bisect import bisect.bisect_right
A, B, Q = map(int, input().split())
INF = 10 ** 18
s = [-INF] + [int(input()) for i in range(A)] + [INF]
t = [-INF] + [int(input()) for i in range(B)] + [INF]
for q in range(Q):
    x = int(input())
    b, d = bisect.bisect_right(s, x), bisect.bisect_right(t, x)
    #print(b,d)
    res = INF
    for S in [s[b - 1], s[b]]:
        for T in [t[d - 1], t[d]]:
            d1, d2 = abs(S - x) + abs(T - S), abs(T - x) + abs(S - T)
            res = min(res, d1, d2)
    print(res)


### FIXED CODE ###

import bisect
A, B, Q = map(int, input().split())
INF = 10 ** 18
s = [-INF] + [int(input()) for i in range(A)] + [INF]
t = [-INF] + [int(input()) for i in range(B)] + [INF]
for q in range(Q):
    x = int(input())
    b, d = bisect.bisect_right(s, x), bisect.bisect_right(t, x)
    #print(b,d)
    res = INF
    for S in [s[b - 1], s[b]]:
        for T in [t[d - 1], t[d]]:
            d1, d2 = abs(S - x) + abs(T - S), abs(T - x) + abs(S - T)
            res = min(res, d1, d2)
    print(res)
import sys
for x in sys.stdin:
 a,b,c=list(map(int,x.split()))
 print(['YES','NO'][len(set(range(1,21-sum(a,b)))-{a,b,c})/7<.5])


### FIXED CODE ###

import sys
for x in sys.stdin:
 a,b,c=map(int,x.split())
 print(['YES','NO'][len({*range(1,21-a-b)}-{a,b,c})<3.5])
# coding: utf-8
import time
import re
import math

def main():
    A,B,K = map(int,input().split())
    ls=set([])
    for a in range(K):
        ls.append(A + a)
        ls.append(B - K +1+ a)
    ls.sort()
    for a in ls:
        print(a)
main()

### FIXED CODE ###

# coding: utf-8
import time
import re
import math

def main():
    A,B,K = map(int,input().split())
    ls=[]
    for a in range(K):
        ls.append(A + a)
        ls.append(B - K +1+ a)
    ls=set(ls)
    ls=sorted(ls)
    for a in ls:
        if (a>=A and a<=B):print(a)
main()
# -*- coding: utf-8 -*-

str = raw_input()
nums = []
for i in range(1,len(str)):
    count = 0
    chars = []
    
    for c in str[0:i]:
        if not c in chars and c in str[i:len(str)]:
            chars.append(c)
            count +=1
    nums.append(count)
print max(nums)


### FIXED CODE ###

# -*- coding: utf-8 -*-
raw_input()
str = raw_input()
nums = []
for i in range(1,len(str)):
    count = 0
    chars = []
    
    for c in str[0:i]:
        if not c in chars and c in str[i:len(str)]:
            chars.append(c)
            count +=1
    nums.append(count)
print max(nums)
a = list(map(int,inptu().split()))
print(len(set(a)))


### FIXED CODE ###

a = list(map(int,input().split()))
print(len(set(a)))
s = input()
t = input()
n = len(s)
for i in range(n):
  if s[i] != t[i]:
    print("No")
    return 0
print("Yes")


### FIXED CODE ###

import sys
s = input()
t = input()
n = len(s)
for i in range(n):
  if s[i] != t[i]:
    print("No")
    sys.exit()
print("Yes")
num = list(map(int,input().split()))
for m in num:
  n = 1
  total = n * m
t = total % 2
if t == 0:
    print("Even")
  else:
    print("Odd")

### FIXED CODE ###

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

counter = 0


while h_L != []:

    for i in range(n):
        if h_L[i] == 0:
            counter += 1
            break
        else:
            h_L[i] -= 1

    if h_L[0] == 0:
        h_L.pop(0)

print(counter-1)

### FIXED CODE ###

import sys
sys.setrecursionlimit(20000)

n = int(input())
h_L = list(map(int,input().split()))

counter = 0


def devzero(l,moji=0):
    return_L,tmp = [],[]
    for val in l:
        if val != moji:
            tmp.append(val)
            #print(tmp)
        elif val == moji:
            return_L.append(tmp)
            tmp = []
    return_L.append(tmp)

    return return_L

def rec(L):
    global counter

    if L == []:
        return
    if 0 not in L:
        L = [i-1 for i in L]
        counter += 1
    L = devzero(L,moji=0)
    for val in L:
        rec(val)

if __name__=="__main__":
    rec(h_L)
    print(counter)
x = 753
s = int(input())
ans=100
for i in range(len(s)-2):
	if(abs(x-int(s[i:i+3]))<ans):
		ans=abs(x-int(s[i:i+3))
print(ans)

### FIXED CODE ###

x = 753
s = input()
ans=10**10
for i in range(len(s)-2):
	if(abs(x-int(s[i:i+3]))<ans):
		ans=abs(x-int(s[i:i+3]))
print(ans)
import collections



def XORC(a,b,p):
    for i in range(len(a)):
        if (int(a[i])+int(b[i]))%2 == int(p[i]):
            continue
        else:
            return False
        
    return True
            
def Solve():
    N=int(input())
    AL=[("0"*34+bin(int(x))[2:])[-33:] for x in input().split()]

    ALC=collections.Counter(AL)

    keys=list(ALC.keys())
    vals=list(ALC.values())

    if len(keys)>3:
        return 'No'
    if len(keys)==1:
        if "1" in keys[0]:
            return 'No'
        return 'Yes'
    
    if len(keys)==2:
        if "1" in keys[0] and "1" in keys[1]:
            return 'No'
        
        if vals[0]==vals[1]*2 and "1" not in keys[0]:
            return 'Yes'
        
        if vals[0]*2==vals[1] and "1" not in keys[1]:
            return 'Yes'
        
        return 'No'
    if len(keys)==3:
        stop
        if vals[0]==vals[1]==vals[2]:
            if XORC(keys[0],keys[1],keys[2]) and XORC(keys[0],keys[2],keys[1]) and XORC(keys[1],keys[2],keys[0]):
                return 'Yes'
        
        return 'No'
print(Solve())


### FIXED CODE ###

import collections



def XORC(a,b,p):
    for i in range(len(a)):
        if (int(a[i])+int(b[i]))%2 == int(p[i]):
            continue
        else:
            return False
        
    return True
            
def Solve():
    N=int(input())
    AL=[("0"*34+bin(int(x))[2:])[-33:] for x in input().split()]

    ALC=collections.Counter(AL)

    keys=list(ALC.keys())
    vals=list(ALC.values())

    if len(keys)>3:
        return 'No'
    if len(keys)==1:
        if "1" in keys[0]:
            return 'No'
        return 'Yes'
    
    if len(keys)==2:
        if "1" in keys[0] and "1" in keys[1]:
            return 'No'

        if vals[0]*2==vals[1] and ("1" not in keys[0]):
            return 'Yes'
        
        if vals[0]==vals[1]*2 and ("1" not in keys[1]):
            return 'Yes'
        
        return 'No'
    if len(keys)==3:
        if vals[0]==vals[1]==vals[2]:
            if XORC(keys[0],keys[1],keys[2]) and XORC(keys[0],keys[2],keys[1]) and XORC(keys[1],keys[2],keys[0]):
                return 'Yes'
        
        return 'No'
print(Solve())
N = int(input)
A = [int(x) for x in input().split(" ")]

from itertools import combinations

mod = 1000000007  # 丁度いい大きさの素数だけで意味は特にない。
s = 0
for c in combinations(A, 2):
    s += c[0] * c[1]

print(s % mod)

### FIXED CODE ###

N = int(input())
A = [int(x) for x in input().split(" ")]

from itertools import combinations

mod = 1000000007  # 丁度いい大きさの素数だけで意味は特にない。

s = 0
ans = 0
for n in A:
    s += n
    s %= mod

for i in range(N):
    s -= A[i]
    ans += A[i] * s
    ans %= mod

print(ans)
a=input()
if a=="SSS":
  print(0)
elif a="RRR":
  print(3)
elif a="RRS" or a="SRR":
  print(2)
else:
  print(1)


### FIXED CODE ###

a=input()
if a=="SSS":
  print(0)
elif a=="RRR":
  print(3)
elif a=="RRS" or a=="SRR":
  print(2)
else:
  print(1)
def get_longest_count(X, Y):
  count = 0
  while len(X) > 0 and len(Y) > 0:
    if X[-1] != Y[-1]:
      return count + max(get_longest_count(X[:-1], Y), get_longest_count(X, Y[:-1]))
    else:
      X = X[:-1]
      Y = Y[:-1]
      count += 1
  return count

for i in range(int(input())):
  X = input()
  Y = input()
  print(get_longest_count(X, Y))

### FIXED CODE ###

def get_longest_count(X, Y):
  offsets = [0]
  for y in Y:
    tmp = offsets[:]
    for i, o in enumerate(offsets):
      j = X.find(y, o)
      if j < 0: break
      if i < len(offsets) - 1:
        tmp[i + 1] = min(offsets[i + 1], j + 1)
      else:
        tmp.append(j + 1)
    offsets = tmp
  return len(offsets) - 1

for i in range(int(input())):
  X = input()
  Y = input()
  print(get_longest_count(X, Y))
import sys
import functools
import operator

def main():
   s = sys.stdin.readline().rstrip()
   h = int(len(s) / 2)
   n = functools.reduce(operator.add, map(lambda x: 0 if(s[x] == s[-1-x]) else 1, range(0, h)))
   print(n)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
import functools
import operator

def main():
   s = sys.stdin.readline().strip()
   h = int(len(s) / 2)
   n = functools.reduce(operator.add, map(lambda x: 0 if(s[x] == s[-1-x]) else 1, range(0, h)), 0)
   print(n)

if __name__ == '__main__':
    main()
while True:
    a = list(map(str, input().split()))
    if a[0] == "0":
        break
    elif int(a[1]) <= 30:
        print(" ".join(a))
    elif int(a[1]) == 31 and int(a[2]) <= 4:
        print(" ".join(a))
    else:
        a[0] = "?"
        s = int(a[1])
        s -= 30
        a[1] = str(s)
        print(" ".join(a))


### FIXED CODE ###

while True:
    a = list(map(str, input().split()))
    if a[0] == "#":
        break
    elif int(a[1]) <= 30:
        print(" ".join(a))
    elif int(a[1]) == 31 and int(a[2]) <= 4:
        print(" ".join(a))
    else:
        a[0] = "?"
        s = int(a[1])
        s -= 30
        a[1] = str(s)
        print(" ".join(a))
A, B = map(int, input().split())




import fractions
def common_divisors(a, b):
    a = fractions.gcd(a, b)
    divisors =  [d for d in range(2, a // 2 + 1) if a % d == 0] + [a]
    if not 1 in divisors:
        divisors.append(1) 
    return divisors, a


from collections import deque
CommonDivs.reverse()
q = deque(CommonDivs)
ans = [q.pop()]
max_n = max(CommonDivs)
while len(q) > 0:
    a = q.pop()
    ans.append(a)
    if max_n/2 < a:
        break
    for _ in range(len(q)):
        b = q.pop()
        if b % a != 0:
            q.appendleft(b)
            
print(len(ans)+len(q))

### FIXED CODE ###

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


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

import math

def is_prime(n):
    if n == 1: return True

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True

import fractions
x = fractions.gcd(A, B)
divisors = make_divisors(x)
ans = 0
for d in divisors:
    if is_prime(d):
        ans += 1
print(ans)
def dig_check(i,d):
    for k in [int(j) for j in str(i)]:
        if k in d:
            return False
    return True


N,K = input.split()
N = int(N)

d = [int(i) for i in input.split()]

for i in range(10001):
    if i > N :
        if dig_check(i,d):
            print(i)
            break


### FIXED CODE ###

def dig_check(i,d):
    for k in [int(j) for j in str(i)]:
        if k in d:
            return False
    return True


N,K = input().split()
N = int(N)

d = [int(i) for i in input().split()]

for i in range(100001):
    if i >= N :
        if dig_check(i,d):
            print(i)
            break
N,K=map(int,input().split())
td=[[int(a) for a in input().split()]for i in range(N)]

td=sorted(td,key=lambda x:-x[1])

ans=0
eat=[]
noteat=[]
for t,d in td[:K]:
  ans+=d
  if t not in eat:
    eat.append(t)
  else:
    noteat.append(d)
temp_result=ans+sum(eat)**2
max_result=temp_result

for t,d in td[K:]:
  if not noteat:
    break
  if t not in eat:
    temp_result+=2*len(eat)+1
    temp_result+=d-noteat.pop()
    eat.add(t)
    max_result=max(max_result,temp_result)
print(max_result)
 


### FIXED CODE ###

a,b,c=map(int,input().split())
arr=sorted([a,b,c])
print(int(arr[0]*arr[1]/2))
a,b,c = map(int,input().split())
import sympy
if sympy.sqrt(a)+sympy.sqrt(b) < sympy.sqrt(c):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a,b,c = map(int,input().split())
if c-a-b < 0:
    print('No')
elif (c-a-b)**2-4*a*b > 0:
    print('Yes')
else:
    print('No')
N = int(input())
S = input()
Q = int(input())
Ks= list(map(int, input().split()))

anss = []
for K in Ks:
    cnt_d, cnt_m, sum_dm, ans = 0,0,0,0
    for i in range(N):
        if i-K>=0:
            if S[i-K]=="D":
                cnt_d -= 1
                sum_dm -= cnt_m
            elif S[i-K]=="M":
                cnt_m -= 1

        if S[i]=="D":
            cnt_d += 1
        elif S[i]=="M":
            sum_dm += cnt_d
            cnt_m += 1
        elif S[i]=="C":
            ans += sum_dm
    anss.append(ans)
    
for a in anss:
  print(a)

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
ave = sum(a)/N
for i in range(len(a)):
    a[i] = abs(a[i]-ave)

mina, minid = 1e9,-1
for i in range(len(a)):
    if mina>=a[N-1-i]:
        mina, minid = a[N-1-i], N-1-i
print(minid)
import collections
mod = 10 ** 9 + 7
N, M = map(int, input().split())
a = collections.deque([])
for _ in range(M):
    a_m = int(input())
    if len(a) > 0 and a_m == a[-1] + 1:
        print(0)
        exit()
    a.append(a_m)

dp = [1]

if len(a) > 0 and 1 != a[0]:
    dp.append(1)
else:
    dp.append(0)
    a.popleft()

for i in range(2, N + 1):
    if len(a) > 0:
        if i != a[0]:
            tmp = dp[0] + dp[1]
        else:
            tmp = 0
            a.popleft()
    else:
        tmp = dp[0] + dp[1]
    dp[0] = dp[1]
    dp[1] = tmp

print(dp[-1] % mod)


### FIXED CODE ###

import collections
mod = 10 ** 9 + 7
N, M = map(int, input().split())
a = collections.deque([])
for _ in range(M):
    a_m = int(input())
    if len(a) > 0 and a_m == a[-1] + 1:
        print(0)
        exit()
    a.append(a_m)

dp = [1]

if len(a) > 0:
    if 1 != a[0]:
        dp.append(1)
    else:
        dp.append(0)
        a.popleft()
else:
    dp.append(1)

for i in range(2, N + 1):
    if len(a) > 0:
        if i != a[0]:
            tmp = dp[0] + dp[1]
        else:
            tmp = 0
            a.popleft()
    else:
        tmp = dp[0] + dp[1]
    dp[0] = dp[1]
    dp[1] = tmp

print(dp[-1] % mod)