Harryxun/stf_run huggingface dataset:
import fraction as m

a, b = map(int, input().split())

lcd = []
cd = m.gcd(a, b)
lcd.append(cd)

t1 = a
t2 = b
cd1 = cd
cd2 = cd

if cd > 1:
    while True:
        m1 = t1 % cd1
        m2 = t2 % cd2
        if m1 > 0 and m2 > 0:
            break
        if m1 == 0:
            c = t1 // cd1
            lcd.append(c)
            t1 = c
        if m2 == 0:
            c = t2 // cd2
            lcd.append(c)
            t2 = c

    lcd = list(set(lcd))
    lcd.append(1)
    lcd.sort()

ans = 0

lns = len(lcd)
i = 0
while i < lns:
    j = i + 1
    while j < lns:
        if m.gcd(lcd[i], lcd[j]) > 1:
            lcd.pop(j)
            lns = len(lcd)
        j += 1
    lns = len(lcd)
    i += 1

print(len(lcd))

### FIXED CODE ###

import fractions as m

a, b = map(int, input().split())

lcd = []
cd = m.gcd(a, b)

while cd % 2 == 0:
    lcd.append(2)
    cd //= 2

f = 3
while f * f <= cd:
    if cd % f == 0:
        lcd.append(f)
        cd //= f
    else:
        f += 2
if cd != 1:
    lcd.append(cd)

lcd.append(1)

lcd = list(set(lcd))

print(len(lcd))
N,X = list(map(int,input().split()))
M = [int(input()) for i in range(N)]
diff  = X - sum(M)
print(N+diff//min(M))


### FIXED CODE ###

S = str(input())
count = S.count('o')

print(700 + count*100)
s = input()
if "Sunny" == s:
    pirnt("Cloudy")
elif "Cloudy" == s:
    print("Rainy")
else:
    print("Sunny")

### FIXED CODE ###

s = input()
if "Sunny" == s:
    print("Cloudy")
elif "Cloudy" == s:
    print("Rainy")
else:
    print("Sunny")
s, w = map(int, input().split())

if(s>w):
    print('safe')
else
    print('unsafe')

### FIXED CODE ###

s, w = map(int, input().split())

if (w>=s):
    print('unsafe')
else:
    print('safe')
a,b,c=map(int,input().split())
d=0
e=[int(x) for x in input().split()]
g=0
for i in range(a-1):
    d+=int(e[i])
for i in range(b):
    if (d+i)/a>=c:
        print(i)
        g=1
        break
if g==0:
    print(-1)

### FIXED CODE ###

a="abcdefghijklmnopqrstuvwxyz"
b=input()
c=0
while True:
    if b==a[c]:
        print(a[c+1])
        break
    c+=1
N = int(input())
A = int(input())
N_500 = N%500
if A >= N_500 :
  print('Yes')
else :
  pritn('No')

### FIXED CODE ###

N = int(input())
A = int(input())
N_500 = N%500
if A >= N_500 :
  print('Yes')
else :
  print('No')
n = int(input())

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

s = sum(lt)
ans = 0
for a in lt:
  s = s - a
  ans+= (a*s)%mod 
print(ans%mod)

### FIXED CODE ###

mod = pow(10, 9)+7
n = int(input())
lt = [int(x) for x in input().split()]

s = sum(lt)
ans = 0
for a in lt:
  s = s - a
  ans+= (a*s)%mod 
print(ans%mod)
import sys

for str in sys.stdin:
    rev = ""
    for x in range(len(str),0,-1):
        rev=rev+str[x-1]
　　print rev

### FIXED CODE ###

s=raw_input()
rev = ""
for x in xrange(len(s),0,-1):
    rev=rev+s[x-1]
print rev
N=int(input())

ANS=[0]*5
flag=0

if N<100000:
    if N<10000:
        if N<1000:
            if N<100:
                if N<10:
                    ANS[0]=int(N/10)
                    flag=flag+1
                ANS[1]=9
                flag=flag+1
            ANS[2]=9+N-100+1
            flag=flag+1
        ANS[3]=909
        flag=flag+1
    ANS[4]=9+900+N-10000+1
    flag=flag+1
elif N==100000:
    print(90909)

if flag==5:
    print(ANS[0])
if flag==4:
    print(ANS[1])
if flag==3:
    print(ANS[2])
if flag==2:
    print(ANS[3])
if flag==1:
    print(ANS[4])

### FIXED CODE ###

x=input().split()

y=[0]*3

for i in range(3):
  y[i]=int(x[i])

ans=(y[2]-(y[0]-y[1]))

if ans>0:
  print(ans)
  
elif ans<=0:
  print(0)
import math
a,b,x=map(int,input().split())
y=2*x/(a**2)-b
z=2*x/(a*b)
phai=0
ans=90
if z>a:
    phai=math.atan(a/(b-y))
    phai=math.degrees(phai)
    ans-=phai
else:
    phai=math.atan(z/b)
    phai=math.degrees(phai)
    ans-=phai
print(ans)

### FIXED CODE ###

import math
a,b,x=map(int,input().split())
y=2*x/(a**2)-b
z=2*x/(a*b)
phai=0
ans=90
if x==b*a**2:
   ans=0
else:
    if z>a:
        phai=math.atan(a/(b-y))
        phai=math.degrees(phai)
        ans-=phai
    else:
        phai=math.atan(z/b)
        phai=math.degrees(phai)
        ans-=phai
print(ans)
N,M=map(int,input().split())
mod=1000000007
f=[False]*(N+1)
for _ in range(M):
    i=int(input())
    f[i]=True
dp=[0 for _ in range(N+1)]

if f[1] and f[2]:
    print(0)
    exit()
elif f[1]:
    dp[1]=0;dp[2]=1
elif f[2]:
    dp[1]=1;dp[2]=0
else:
    dp[1]=1;dp[2]=2

for i in range(3,N+1):
    if f[i]:
        dp[i]=0
    else:
        dp[i]=dp[i-1]+dp[i-2]
print(dp[N]%mod)

### FIXED CODE ###

N,M=map(int,input().split())
mod=1000000007
f=[False]*(N+1)
for _ in range(M):
    i=int(input())
    f[i]=True
dp=[0 for _ in range(N+1)]

if N==1:
    if f[1]:
        print(0)
    else:
        print(1)
else:
    if f[1] and f[2]:
        print(0)
        exit()
    elif f[1]:
        dp[1]=0;dp[2]=1
    elif f[2]:
        dp[1]=1;dp[2]=0
    else:
        dp[1]=1;dp[2]=2

    for i in range(3,N+1):
        if f[i]:
            dp[i]=0
        else:
            dp[i]=dp[i-1]+dp[i-2]
    print(dp[N]%mod)
cards = []
mark = ["S","H","C","D"]
for i in (mark):
    for j in range(1,14):
        cards.append( i + " " + str(j) )
print(cards)
n = int(input())
for i in range(n+1):
    a = input()
    cards.remove(a)
print(cards)

### FIXED CODE ###

cards = list()
mark = ["S","H","C","D"]
for i in (mark):
    for j in range(1,14):
        cards.append( i + " " + str(j) )
n = int(input())
for i in range(n):
    a = input()
    cards.remove(a)
if len(cards) > 0:
    print("\n" .join(cards))
s = list(input())

for i in range(4):
    if s[i] == s[i+1]:
        print("Bad")
        exit()

print("Good")

### FIXED CODE ###

a = input()
for i in range(3):
    if a[i] == a[i+1]:
        print("Bad")
        quit()
print("Good")
n = input()
l = len(n)

# print(l)
temp=''
ans=0

if l==1:
	# print(int(n))
else:
	for i in range(1,l):
		if i%2==1:
			temp='9'
			temp+='0'*(i-1)
			ans+=int(temp)
			# print(ans)

	if l%2==1:
		ans+=(int(n)-int('9'*(l-1)))

print(ans)

### FIXED CODE ###

n = input()
l = len(n)

# print(l)
temp=''
ans=0

if l==1:
	print(int(n))
else:
	for i in range(1,l):
		if i%2==1:
			temp='9'
			temp+='0'*(i-1)
			ans+=int(temp)
			# print(ans)

	if l%2==1:
		ans+=(int(n)-int('9'*(l-1)))

	print(ans)
num,total = map(int,input().split())
for i in range(num+1):
    for j in range(num+1):
        if i*10000 + j*5000 + (numsi-j)*1000 == total:
            print(i,j,num-i-j)
            exit()
print("-1 -1 -1")


### FIXED CODE ###

n, y = map(int, input().split())
for i in range(n + 1):
    for j in range(n - i + 1):
        if i * 10000 + j * 5000 + (n - i - j) * 1000 == y:
            print(i, j, n - i - j)
            exit()
print("-1 -1 -1")
import itertools

n, m, q = map(int, input().split())

nums = []
for _ in range(q):
    nums.append(list(map(int, input().split())))

total = 0

l = [1,2,3,4,5,6,7,8,9,10]
for v in itertools.combinations_with_replacement(l, n):
    scores = []
    for a,b,c,d in nums:
        if v[b-1]-v[a-1] == c:
            scores.append(d)
        else:
            scores.append(0)
    if total <= sum(scores):
        total = sum(scores)

print(total)


### FIXED CODE ###

k = int(input())
a, b = map(int, input().split())

n = a//k
if a <= (n+1)*k <= b or a <= n * k <=b:
    print("OK")
else:
    print("NG")
N = int(input())
A = list(map(int, input().split()))

setA = set(A)
result = 0

if N == 1:
    print(0)
else:
    for i in range(N):
        tmp = A[i]
        A[i] = 0
        setA = set(A)
        A[i] = tmp
        if 1 in setA:
            continue

        for a in setA:
            if A[i] % a == 0:
                break
        else:
            result += 1

    print(result)


### FIXED CODE ###

from collections import Counter
N = int(input())
A = list(map(int, input().split()))

sorted_A = sorted(A)
result = 0
c = Counter(sorted_A)
# 倍数を管理するテーブル
lendp = sorted_A[-1] + 1
dp = [0] * lendp

for a in sorted_A:
    dp[a] += 1
    if dp[a] == 1:
        b = a * 2
        while b < lendp:
            dp[b] += 2
            b += a

print(dp.count(1))
import sys
sys.setrecursionliit(10**5)
def 解():
    iN,iK,iL = [int(_) for _ in input().split()]
    aD = [[int(_) for _ in sLine.split()] for sLine in sys.stdin.readlines()]
    a道 = aD[0:iK]
    a鉄道 = aD[iK:]

    d道 = {}
    d鉄道 = {}
    for i in range(1,iN+1):
        d道[i] = {i}
        d鉄道[i] ={i}

    for p,q in a道:
        d道[p].add(q)
        d道[q].add(p)
    for r,s in a鉄道:
        d鉄道[r].add(s)
        d鉄道[s].add(r)

    def fdfs(d,iS):
        dsVisited=set()
        def digRoute(iT):
            for i in d[iT] - dsVisited:
                dsVisited.add(i)
                digRoute(i)
        digRoute(iS)
        return dsVisited

    aRet = []
    for i in range(1,iN+1):
        aRet.append(str(len(fdfs(d道,i) & fdfs(d鉄道,i))))
    print( " ".join(aRet))
解()

### FIXED CODE ###

#Union-Find木の構築
import sys
def 解():
    iN,iK,iL = [int(_) for _ in input().split()]
    aD = [[int(_) for _ in sLine.split()] for sLine in sys.stdin.readlines()]

    def buildTree(a):
        aT = [0]*(iN+1)
        for p,q in a:
            rp = getRoot(aT,p)
            rq = getRoot(aT,q)
            thisRoot = max(rp,rq,q)
            aT[p] = thisRoot
            aT[q] = thisRoot
            aT[rp] = thisRoot #これで Union してるつもり
            aT[rq] = thisRoot
        return aT
    def getRoot(a,i): #find みんな小さい方に合わせるならデカい方に合わせてみよう
        if a[i] == i or a[i] == 0:
            if a[i] == 0 : a[i] = i
            return i
        elif i < a[i] :
            a[i] = getRoot(a,a[i])
            return a[i]
    #   else:
    #       print("! ",i,a[i])

    aT道 = buildTree(aD[0:iK])
    aT鉄道 = buildTree(aD[iK:])
    aRet = []
    dRet = {}
    for i in range(1,iN+1):
        # いやはやこんなもんもキーになるのか。
        Comb = (getRoot(aT道,i), getRoot(aT鉄道,i))
        aRet.append(Comb)
        if Comb in dRet:
            dRet[Comb] += 1
        else:
            dRet[Comb] = 1
    print(" ".join([str(dRet[_]) for _ in aRet]))

解()
import math
a, b = list(map(int, input().split()))
number = 0
if a == 1:
    number = 0
elif b >  a:
    number = math.ceil((b - a) / (a - 1))
else:
    number = 0
number += 1
print(number)

### FIXED CODE ###

forecasts     = input()
real_weathers = input()

correct_number = 0
for date in range(len(forecasts)):
    if forecasts[date] == real_weathers[date]:
        correct_number += 1
print(correct_number)
import copy
N, K = map(int,input().split())
a = list(map(int,input().split()))
# まず累積和で美しさを全列挙
S = [0]*N
S[0] = a[0]
for k in range(1,N):
    S[k] = S[k-1] + a[k]
S = [0] + S
T = []
for k in range(N):
    for l in range(k+1,N+1):
        T.append(S[l]-S[k])
U = []
C = [0]*32
for e in T:
    t = []
    for d in range(32,-1,-1):
        if e >= 2**d:
            t.append(1)
            C[d] += 1
            e -= 2**d
        else:
            t.append(0)
    U.append(t[::-1])
d = -1
for k in range(31,-1,-1):
    if C[k] >= K:
        d = k
        break
if d == -1:
    print(0)
    exit(0)
ans = 2**d
V = []
for e in U:
    if e[d] == 1:
        V.append(e[:d+1][::-1])

W = copy.deepcopy(V)
for k in range(1,d+1):
    n = []
    for e in W:
        if e[k] == 1:
            n.append(e)
    if len(n) >= K:
        ans += 2**(d-k)
        W = copy.deepcopy(n)
    else:
        break

print(ans)


### FIXED CODE ###

N, K = map(int,input().split())
a = list(map(int,input().split()))
S = [0]*N
S[0] = a[0]
for k in range(1,N):
    S[k] = S[k-1] + a[k]
S = [0] + S
T = []
for k in range(N):
    for l in range(k+1,N+1):
        T.append(S[l]-S[k])
ans = 0
for d in range(41,-1,-1):
    c = 0
    for e in T:
        if (ans+2**d)&e == ans+2**d:
            c += 1
    if c >= K:
        ans += 2**d
print(ans)
l =input().split()

l[0] = A
l[1] = B
if B%A == 0:
    print(A+B)
else:
    print(B-A)

### FIXED CODE ###

l =input().split()

A = int(l[0])
B = int(l[1])

if B%A == 0:
    print(A+B)
else:
    print(B-A)
n, m = map(int, input().split())
ex = [0 for i in range(n)]
fri = {}

for i in range(m):
    a, b = map(int, input().split())
    if ex[a-1] == 0 and ex[b-1] == 0:
        if a > b:
            a, b = b,a
        ex[a-1] = a
        ex[b-1] = a
        fri[a] = [a, b]
    elif ex[a-1] == 0:
        ex[a-1] = ex[b-1]
        fri[ex[b-1]].append(a)
    elif ex[b-1] == 0:
        ex[b-1] = ex[a-1]
        fri[ex[a-1]].append(b)
    elif ex[a-1] == ex[b-1]:
        continue
    else:
        shozoku = min(ex[a-1], ex[b-1])
        mu = max(ex[a-1], ex[b-1])
        fri[shozoku].extend(fri.pop(mu))

ans = 0
for key in fri:
    ans = max(ans, len(fri[key]))
print(ans)

### FIXED CODE ###

n, m = map(int, input().split())
ex = [0 for i in range(n)]
fri = {}

for i in range(m):
    a, b = map(int, input().split())
    if ex[a-1] == 0 and ex[b-1] == 0:
        if a > b:
            a, b = b, a
        ex[a-1] = a
        ex[b-1] = a
        fri[a] = [a, b]
    elif ex[a-1] == 0:
        ex[a-1] = ex[b-1]
        fri[ex[b-1]].append(a)
    elif ex[b-1] == 0:
        ex[b-1] = ex[a-1]
        fri[ex[a-1]].append(b)
    elif ex[a-1] == ex[b-1]:
        continue
    else:
        shozoku = min(ex[a-1], ex[b-1])
        mu = max(ex[a-1], ex[b-1])
        for j in range(len(fri[mu])):
            ex[fri[mu][j]-1] = shozoku
        fri[shozoku].extend(fri.pop(mu))

ans = 1
for key in fri:
    ans = max(ans, len(fri[key]))
print(ans)
n,k=input().split()
n=int(n)
k=int(k)
s=[int(i) for i in input().split()]
dp=[]
for i in range(n):
    dp.append(10003)
dp[0] = 0
dp[1]=abs(s[0]-s[1])
for i in range(2,n):
    for j in range(1,k+1):
        if i-j >= 0:
            dp[i] = min(dp[i],(abs(s[i]-s[i-j])+dp[i-j]))
        else:
            break
print(dp[-1])

### FIXED CODE ###

n=int(input())

s=input().split(' ')

s=[int(i) for i in s]

dp = [10001]*100000

dp[0] = 0

dp[1] = abs(s[1] - s[0])

for i in range(2,n):
    
    dp[i] = min(dp[i-1] + abs(s[i]-s[i-1]), dp[i-2] + abs(s[i]-s[i-2]))

print(dp[n-1])
#coding:utf-8
K = int(input())
ten = K // 10
sur = K % 10
for i in range(ten+1):
    K += 1
    ten = K // 10
    sur = K % 10
    if i == ten:
        for j in range(1, sur+1):
            moji = "{}".format(j) + "9" * i
            print(moji)
    else:
        for j in range(1,10):
            moji = "{}".format(j) + "9" * i
            print(moji)


### FIXED CODE ###

#coding:utf-8

s = input()
num = 0
for i in s:
    if i == "+":
        num += 1
    else:
        num -= 1
print(num)
a = int(input().strip())

tmp = []
res = []
ind = 1

def bar(foo,hoge):
    if(foo == 0):
        return
    if foo == 1:
        res.append(1)
        return
    elif foo == 2:
        res.append(2)
        return
    for i in reversed(range(hoge)):
        if (tmp[i] <= foo):
            res.append(i + 1)
            bar(foo - (i + 1) , i)
            return
        
        
    
for i in range(10000000):
    ind = ind + i
    tmp.append(ind)
    if ind >= a :
        bar(a, i + 1 )
        break
for i in res:
    print(i)


### FIXED CODE ###

a = int(input().strip())
import sys
sys.setrecursionlimit(1000000)
tmp = []
res = []
ind = 1

def bar(foo,hoge):
    if(foo == 0):
        return
    if foo == 1:
        res.append(1)
        return
    elif foo == 2:
        res.append(2)
        return
    for i in reversed(range(hoge)):
        if (tmp[i] <= foo):
            res.append(i + 1)
            bar(foo - (i + 1) , i)
            return
        
        
    
for i in range(10000000):
    ind = ind + i
    tmp.append(ind)
    if ind >= a :
        bar(a, i + 1 )
        break
for i in res:
    print(i)
h, w = map(int, input().split())
s = [_input() + '#' for _ in range(h)]
s.append('#' * (w + 1))
t = [[-1] * w for _ in range(h + 1)]
tstart = [-1] * (w + 1)
for i in range(h + 1):
  ystart = -1
  for j in range(w + 1):
    if s[i][j] == '#':
      if ystart != -1:
        for k in range(ystart, j):
          t[i][k] += j - ystart
        ystart = -1
      if tstart[j] != -1:
        for k in range(tstart[j], i):
          t[k][j] += i - tstart[j]
        tstart[j] = -1
    else:
      if ystart == -1:
        ystart = j
      if tstart[j] == -1:
        tstart[j] = i
print(_max(map(_max, t)))


### FIXED CODE ###

h, w = map(int, input().split())
s = [input() + '#' for _ in range(h)]
s.append('#' * w)

yoko = [[0] * w for _ in range(h)]
for i in range(h):
  if s[i][0] == '.':
    start = 0
  else:
    start = -1
  for j in range(1, w + 1):
    if s[i][j] == '#':
      if start != -1:
        for k in range(start, j):
          yoko[i][k] = j - start
        start = -1
    else:
      if start == -1:
        start = j

tate = [[0] * w for _ in range(h)]
for i in range(w):
  if s[0][i] == '.':
    start = 0
  else:
    start = -1
  for j in range(1, h + 1):
    if s[j][i] == '#':
      if start != -1:
        for k in range(start, j):
          tate[k][i] = j - start
        start = -1
    else:
      if start == -1:
        start = j
result = 0
for i in range(h):
  for j in range(w):
    t = yoko[i][j] + tate[i][j] - 1
    if t > result:
      result = t

print(result)
N = int(input())
d = {}
if N % 2 == 0:
    for i in range(N//2):
        d[2*i+1] = 0
else:
    for i in range(N//2+1):
        d[2*i] = 1
A = list(map(int,input()))
x = 1
for i in range(A):
    if d[A[i]] >= 2:
        x = 0
        break
    else:
        d[A[i]] += 1
y = 1
if N % 2 == 1:
    if d[0] != 1:
        y = 0
ans = (2**(N//2))*x*y
print(ans)

### FIXED CODE ###

N = int(input())
d = {}
if N % 2 == 0:
    for i in range(N//2):
        d[2*i+1] = 0
else:
    for i in range(N//2+1):
        d[2*i] = 0
A = list(map(int,input().split()))
x = 1
for i in range(N):
    if A[i] in d:
        if d[A[i]] >= 2:
            x = 0
            break
        else:
            d[A[i]] += 1
    else:
        x = 0
        break
y = 1
if N % 2 == 1:
    if d[0] != 1:
        y = 0
e = 10**9 + 7
ans = (2**(N//2))*x*y%e
print(ans)
# coding:utf-8
while True:
    line = raw_input().split()
    a = int(line[0])
    op = line[1]
    b = int(line[2])
    answer = 0
    if op == '+':
        answer = a + b
    elif op == '-':
        answer = a - b
    elif op == '*':
        answer = a * b
    elif op == '/':
        answer = a / b
    elif op == '?' and a == 0 and b == 0:
        break
    print "%d" % answer

### FIXED CODE ###

# coding:utf-8
while True:
    line = raw_input().split()
    a = int(line[0])
    op = line[1]
    b = int(line[2])
    answer = 0
    if op == '+':
        answer = a + b
    elif op == '-':
        answer = a - b
    elif op == '*':
        answer = a * b
    elif op == '/':
        answer = a / b
    elif op == '?':
        break
    print "%d" % answer
def solve():
    N = int(input())
    A = list(map(int,input().split()))

    sm = sum(A)
    agg = 0
    idx = 0
    mid = sm / 2
    while agg < mid:
        agg += A[idx]
        idx += 1
    
    ans = min(abs(agg-mid) / 0.5, abs(agg-A[idx]-mid)/0.5)
    
    print(int(ans))

if __name__ == '__main__':
    solve()

### FIXED CODE ###

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

    sm = sum(A)
    agg = 0
    idx = 0
    mid = sm / 2
    shrink_cnt = sm - N
    while agg < mid and idx < N-1:
        
        agg += A[idx]
        idx += 1
    
    oneleft = agg
    oneright = sm - oneleft 
    twoleft = agg-A[idx-1]
    tworight = sm - twoleft
    ans = min(abs(oneleft-oneright), abs(twoleft-tworight))

    print(int(ans))

if __name__ == '__main__':
    solve()
n, m = map(int, raw_input().split())

yueshu = []
for i in range(1, int(m**0.5)+1):
    if m % i == 0:
        yueshu.insert(0, m/i)
        if i >= n:
            print m / i
            break
for i in range(int(m**0.5)+1, m):
    if m % i == 0:
        if i >= n:
            print m / i
            break





### FIXED CODE ###

n, m = map(int, raw_input().split())

yueshu = []
state = 0
if m % n == 0:
    print m / n
else:
    for i in range(1, int(m**0.5)+1):
        if m % i == 0:
            yueshu.insert(0, m/i)
            if i >= n:
                print m / i
                state = 1
                break
    if state == 0:
        for i in yueshu:
            if m % i == 0:
                if i >= n:
                    print m / i
                    state = 1
                    break
    if state == 0:
        print 1
MOD = 10**9 + 7
MOD_t_MAX = 10**6 + 10

fac  = [None] * MOD_t_MAX
finv = [None] * MOD_t_MAX
inv  = [None] * MOD_t_MAX
def MOD_COM_init():
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MOD_t_MAX):
        fac[i] = fac[i - 1] * i % MOD
        inv[i] = MOD - inv[MOD%i] * (MOD // i) % MOD
        finv[i] = finv[i - 1] * inv[i] % MOD
def MOD_COM(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD

def main():
    k = int(input())
    s = input()
    n = len(s)
    MOD_COM_init()
    ans = 0
    pow_26 = [None]*(k+1)
    pow_25 = [None]*(k+1)
    pow_26[0] = 1
    pow_25[0] = 1
    for i in range(1, k+1):
        pow_26[i] = pow_26[i-1] * 26 % MOD
        pow_25[i] = pow_25[i-1] * 25 % MOD
    for i in range(k+1):
        x, y = i, k-i
        tmp = 1
        tmp *= pow_25[x] * MOD_COM(x + n-1, n-1)
        tmp *= pow_26[y]
        ans += tmp % MOD
    print(ans % MOD)

if __name__ == "__main__":
    main()

### FIXED CODE ###

MOD = 10**9 + 7
MOD_t_MAX = 2*10**6 + 10

fac  = [None] * MOD_t_MAX
finv = [None] * MOD_t_MAX
inv  = [None] * MOD_t_MAX
def MOD_COM_init():
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MOD_t_MAX):
        fac[i] = fac[i - 1] * i % MOD
        inv[i] = MOD - inv[MOD%i] * (MOD // i) % MOD
        finv[i] = finv[i - 1] * inv[i] % MOD
def MOD_COM(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD

def main():
    k = int(input())
    s = input()
    n = len(s)
    MOD_COM_init()
    ans = 0
    a = 1
    b = pow(26, k, MOD)
    for i in range(k+1):
        ans += a * MOD_COM(i + n-1, n-1) * b % MOD
        a *= 25
        b *= inv[26]
        a %= MOD
        b %= MOD
    print(ans % MOD)

if __name__ == "__main__":
    main()
a = list(map(int,input()))

print(max(a) * 9 + sum(a))


### FIXED CODE ###

a = list(map(int,input().split()))
 
print(max(a) * 9 + sum(a))
# coding: utf-8
# Your code here!
# coding: utf-8
# Your code here!
N=int(input())
A=list(map(int,input().split()))

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

a=2*N
b=sum([A[i]*2 for i in range(N)])

x1=b//a
x2=-(-b//a)
x0=min(x1,x2)-1
x3=max(x1,x2)+1
X=[x0,x1,x2,x3]

ans=10**18
def count(num):
    temp=0
    for i in range(N):
        temp+=abs(A[i]-num)
    return temp

for x in X:
    ans=min(count(x),ans)

print(ans)



### FIXED CODE ###

# coding: utf-8
# Your code here!
N=int(input())

l=[]
for i in range(N):
    l.append(list(map(int,input().split())))

dis=[[0]*(N) for i in range(N-1)]
#print(dis)

for i in range(N-1):
    for j in range(i+1,N):
        if l[i][0]-l[j][0]>0:
            dis[i][j]=[(l[i][0]-l[j][0]),(l[i][1]-l[j][1])]
        elif l[i][0]-l[j][0]<0:
            dis[i][j]=[-(l[i][0]-l[j][0]),-(l[i][1]-l[j][1])]
        else:
            dis[i][j]=[(l[i][0]-l[j][0]),abs(l[i][1]-l[j][1])]

temp=0
for i in range(N-1):
    for item in dis[i]:
        if item!=0:
            temp=max(sum(x.count(item) for x in dis),temp)

#print(l)
#print(dis)
print(N-temp)
a,b=map(input().split())
if a==b:
    print("Yes")
else:
    print("No")    
    

### FIXED CODE ###

a,b=map(int,input().split())
if a==b:
    print("Yes")
else:
    print("No")