Harryxun/stf_run huggingface dataset:
a = int(input())

N = [1,2,3,4,5,6,7,8,9]

For  x  in  range(a):
  tmp = N[x]
  if tmp%10 != 0:
    N.append(tmp*10+tmp%10-1)
  N.append(tmp*10+tmp%10)
  if tmp%10 != 9:
    N.append(tmp*10+tmp%10+1)
print(N[a-1])


### FIXED CODE ###

k = int(input())
lunlun = [0] * 100
lunlun[1] = [1, 2, 3, 4, 5, 6, 7, 8, 9]
i = 1

for _ in range(9):
    n = len(lunlun[i])
    lunlun[i+1] = []
    for x in lunlun[i]:
        r = x%10
        if r > 0:
            lunlun[i+1].append(10*x + r-1)
        lunlun[i+1].append(10*x + r)
        if r < 9:
            lunlun[i+1].append(10*x + r+1)
    i += 1

for i in range(1, 11):
    for j in range(len(lunlun[i])):
        k -= 1
        if k == 0:
            print(lunlun[i][j])
            exit()
n = input()
m = [0] * n
max = [0] * n
kijun = [0] * n
rieki = [0] * n
max_rieki = 0
for i in xrange(n):
 m[i] = raw_input()


for i in xrange(n-1):
 max[i] = m[i+1]
 kijun[i] = m[i]
 for j in xrange(i+1,n):
  if max[i] < m[j]:
      max[i] = m[j]
 rieki[i] = max[i] - kijun[i]
max_rieki = rieki[0]
for i in xrange(1,n):
  if rieki[i] > max_rieki:
   max_rieki = rieki[i]
print max_rieki

### FIXED CODE ###

n = input()
m = [0] * n
max_rieki = -1000000000



for i in xrange(n):
 m[i] = input()

min_rieki = m[0]
for i in xrange(1,n): 
  if max_rieki < m[i] - min_rieki:
     max_rieki = m[i] - min_rieki
  if min_rieki > m[i]:
     min_rieki = m[i]

print max_rieki
n,m = map(int,input().split())
a = list(map(int,input().split()))
l = []
for i in range(m):
    bc = list(map(int,input().split()))
    l.append(bc)
l.sort(key=lambda x:x[1],reverse=True)
a.sort()
b = 0
for i in range(m):
    count = 0
    while a[b] < l[i][1] and count < l[i][0]:
        a[b] = l[i][1]
        b = b + 1
        count = count + 1
    if i < m-1:
        if a[b] >= l[i+1][1]:
            break
print(sum(a))

### FIXED CODE ###

n,m = map(int,input().split())
a = list(map(int,input().split()))
l = []
for i in range(m):
    bc = list(map(int,input().split()))
    l.append(bc)
l.sort(key=lambda x:x[1],reverse=True)
a.sort()
b = 0
for i in range(m):
    count = 0
    while a[b] < l[i][1] and count < l[i][0]:
        a[b] = l[i][1]
        b = b + 1
        count = count + 1
        if b == n:
            break
    if b == n:
        break
    else:
        if i < m-1:
            if a[b] >= l[i+1][1]:
                break
print(sum(a))
k=int(input())
x,y=map(int,input().split())
d=abs(x)+abs(y)
if k%2==0 and d%2!=0:
  print(-1)
else:
  ans=[]
  if d<k and d%2==1:
    n=3
    td=k-d
    if y>=0:
      ans.append((x,y+td))
      ans.append((x+(k-td//2),y+td//2))
      ans.append((x,y))
    else:
      ans.append((x,y-td))
      ans.append((x+(k-td//2),y-td//2))
      ans.append((x,y))
  elif d<k and d%2==0:
    n=2
    if abs(x)>=abs(y):
      m=(abs(x)-abs(y))//2
      tk=k-m
      if x<0:
        m*=-1
      if y<0:
        tk*=-1
      ans.append((m,tk))
    else:
      m=(abs(y)-abs(x))//2
      tk=k-m
      if y<0:
        m*=-1
      if x<0:
        tk*=-1
      ans.append((tk,m))
    ans.append((x,y))
  print(n)
  for tx,ty in ans:
    print(tx,ty)

### FIXED CODE ###

def editarr(x,y,arr):
  if abs(x)>=abs(y):
    for i in range(len(arr)):
      arr[i][0],arr[i][1]=arr[i][1],arr[i][0]
  if x<0:
    for i in range(len(arr)):
      arr[i][0]*=-1
  if y<0:
    for i in range(len(arr)):
      arr[i][1]*=-1

k=int(input())
x,y=map(int,input().split())
ans=[]
tx=abs(x)
ty=abs(y)
if tx>=ty:
  tx,ty=ty,tx
if k%2==0 and (tx+ty)%2!=0:
  print(-1)
else:
  if tx+ty<k:
    if (tx+ty)%2==0:
      m=(ty-tx)//2
      ans.append([k-m,m])
    else:
      td=k-(tx+ty)
      ans.append([tx,ty+td])
      ans.append([tx+(k-td//2),ty+td//2])
    ans.append([tx,ty])
    n=len(ans)
  elif ty-(k-tx%k)<k and (ty-(k-tx%k))%2!=0:
    if tx<k and ty<k:
      if (2*k-(tx+ty))%2==0:
        td=2*k-(tx+ty)
        ans.append([tx+td//2,k-(tx+td//2)])
        ans.append([tx,ty])
      else:
        ans.append([tx,k-tx])
        td=ty-(k-tx)
        ans.append([tx+(k-td//2),ans[-1][1]+td//2])
        ans.append([tx,ty])
      n=len(ans)
    else:
      if tx+ty<2*k:
        if (2*k-(tx+ty))%2==0:
          td=2*k-(tx+ty)
          ans.append([tx+td//2,k-(tx+td//2)])
          ans.append([tx,ty])
        else:
          ans.append([tx,k-tx])
          td=ty-(k-tx)
          ans.append([tx+(k-td//2),ans[-1][1]+td//2])
          ans.append([tx,ty])
        n=len(ans)
      else:
        ans.append([0,0])  
  else:
    ans.append([0,0])
    for i in range(tx//k):
      ans.append([ans[-1][0]+k,0])
    if ans[-1][0]!=tx:
      ans.append([tx,k-abs(tx-ans[-1][0])])
    td=ty-ans[-1][1]
    if td%k==0:
      flag=True
    else:
      flag=False
    for i in range(td//k):
      if flag==False and (ty-ans[-1][1])%2==0 and (ty-ans[-1][1])<=2*k:
          break
      ans.append([tx,ans[-1][1]+k])
    if ans[-1][1]!=ty:
      td=ty-ans[-1][1]
      ans.append([tx+(k-td//2),ans[-1][1]+td//2])
      ans.append([tx,ty])
    ans.pop(0)
    n=len(ans)
  editarr(x,y,ans)
  print(n)
  for a,b in ans:
    print(a,b)
max_v = 1000000000
min_v = -1000000000

N = input()
data = []
for i in range(N):
    data.append(input())

for r in data:
    max_v = max(max_v, r - min_v)                                               
    min_v = min(min_v, r)
    
print(max_v)

### FIXED CODE ###

n = int(input())
data = [int(input()) for i in range(n)]

min_value = data.pop(0)
earn_value = -1000000000000
for d in data:
    earn_value = max(d - min_value, earn_value)
    min_value = min(d, min_value) 
print(earn_value)
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 11 14:44:47 2018
ABC046C
@author: maezawa
"""
import math
n = int(input())
ti, ai = list(map(int, input().split()))
vp = ti + ai
tp = ti
ap = ai
for i in range(1,n):
    t, a = list(map(int, input().split()))
    if ti == t and ai == a:
        continue
    ti = t
    ai = a
    niv = vp/(ti+ai)
    nit = tp/ti
    nia = ap/ai
    ni = math.ceil(max(niv, nit, nia))
    vi = ni*(ti+ai)
    #print(ni, vi)
    tp = ni*ti
    ap = ni*ai

print(vi)

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sat Aug 11 14:44:47 2018
ABC046C
@author: maezawa
"""
import math
n = int(input())
tp = 1
ap = 1
for i in range(n):
    ti, ai = list(map(int, input().split()))
    #nit = math.ceil(tp/ti)
    #nia = math.ceil(ap/ai)
    nit = -tp//ti
    nia = -ap//ai
    ni = max(-nit, -nia)
    vi = ni*(ti+ai)
    #print(ni, vi)
    tp = ni*ti
    ap = ni*ai

print(vi)
N,T = map(int,input().split())

min = 1001
for ii in ranga(N):
  c,t = map(int,input().split())
  if t <= T:
    min = t if min > t
   
if t == 1001:
  print('TLE')
else:
  print(min)

### FIXED CODE ###

N,T = map(int,input().split())

min = 1001
for ii in range(N):
  c,t = map(int,input().split())
  if t <= T and min > c:
    min = c
   
if min == 1001:
  print('TLE')
else:
  print(min)
S_ = input()
T = input()
loop = len(S_) - len(T) + 1
stringlist = []

# check S_ in T
for n in range(loop):
    chance = True
    for i in range(len(T)):
        if S_[n+i] == T[i] or S_[n+i] == "?":
            pass
        else:
            chance = False
            break

    if chance:
        tmp = S_[:n] + T + S_[n+len(T):]
        stringlist.append(tmp)

if len(stringlist) == 0:
    print(UNRESTORABLE)
else:
    stringlist.sort()
    String = stringlist[0]
    S = ""
    for i in range(len(S_)):
        if String[i] == "?":
            S += "a"
        else:
            S += String[i]

print(S)





### FIXED CODE ###

S_ = input()
T = input()
loop = len(S_) - len(T) + 1
stringlist = []

# check S_ in T
for n in range(loop):
    chance = True
    for i in range(len(T)):
        if S_[n+i] == T[i] or S_[n+i] == "?":
            pass
        else:
            chance = False
            break

    if chance:
        tmp = S_[:n] + T + S_[n+len(T):]
        stringlist.append(tmp)

if len(stringlist) == 0:
    print("UNRESTORABLE")
else:
    stringlist.sort()
    String = stringlist[0]
    S = ""
    for i in range(len(S_)):
        if String[i] == "?":
            S += "a"
        else:
            S += String[i]
    print(S)
print("A"+"RB"[input()<1200]+"C")

### FIXED CODE ###

print("ABC" if int(input())<1200 else "ARC")
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

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

sa = set(a)
sa = list(sa)

if len(sa)>3:
    print('No')
    exit()

if len(sa)==3:
    aa = sa[0]
    bb = sa[1]
    cc = sa[2]
    if a.count(aa) != n/3 or a.count(bb) != n/3 or a.count(cc) != n/3:
        print('No')
        exit()
    if aa^bb^cc!=0:
        print('No')
        exit()

if len(sa)==2:
    aa = sa[0]
    bb = sa[1]
    if bb != 0 and aa != 0:
        print('No')
        exit()
    else:
        if bb ==0:
            zero =bb
        else:
            aa = bb
    if a.count(zero) != n/3 or a.count(aa)!=n/3*2:
        print('No')
        exit()

if len(sa)==1:
    aa = sa[0]

    if aa != 0:
        print('No')
        exit()

print('Yes')



### FIXED CODE ###

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

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

sa = set(a)
sa = list(sa)

if len(sa)>3:
    print('No')
    exit()

if len(sa)==3:
    aa = sa[0]
    bb = sa[1]
    cc = sa[2]
    if a.count(aa) != n/3 or a.count(bb) != n/3 or a.count(cc) != n/3:
        print('No')
        exit()
    if aa^bb^cc!=0:
        print('No')
        exit()

if len(sa)==2:
    aa = sa[0]
    bb = sa[1]
    if bb != 0 and aa != 0:
        print('No')
        exit()
    else:
        if aa==0:
            aa = bb
    if a.count(0) != n/3 or a.count(aa)!=n/3*2:
        print('No')
        exit()

if len(sa)==1:
    aa = sa[0]
    if aa != 0:
        print('No')
        exit()

print('Yes')
import math
ABCDE = [int(input()) for _ in range(5)]
print(
    sum([10 * math.ceil(_ / 10)
         for _ in ABCDE]) + min([_ % 10 for _ in ABCDE if _ % 10]) - 10)


### FIXED CODE ###

import math
ABCDE = [int(input()) for _ in range(5)]
print(
    sum([10 * math.ceil(_ / 10)
         for _ in ABCDE]) + min([10] + [_ % 10 for _ in ABCDE if _ % 10]) - 10)
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
import math

def lcm(a,b):
    return (a*b)//gcd(a,b)

A,B,C,D = map(int,input().split())
r = (B - A + 1)
M = math.ceil(r/C) + math.ceil(r/D)
N = math.ceil(r/lcm(C,D))
print(r-M+N)

### FIXED CODE ###


import math
from  fractions import gcd

def lcm(a,b):
    return (a*b)//gcd(a,b)

A,B,C,D = map(int,input().split())
d_cnt = B//D-(A-1)//D
c_cnt = B//C-(A-1)//C
cd = lcm(C,D)
cd_cnt = B//cd-(A-1)//cd
print(B-A+1-(c_cnt+d_cnt-cd_cnt))
h,w=map(int,input().split())
lis=[]
for i in range(h):
  lis.append(list(input()))
for i in range(0,len(lis)):
  i=len(lis)-i-1
  count=0
  for j in range(0,len(lis[0])):
    if lis[i][j]==".":
      count+=1
  if count==len(lis[0]):
    lis.pop(i)

for i in range(0,len(lis[0])):
  i=len(lis)-i-1
  count=0
  for j in range(0,len(lis)):
    if lis[j][i]==".":
      count+=1
  if count==len(lis):
    for k in range(len(lis)):
      lis[k].pop(i)

for i in range(len(lis[0])):
  moji=""
  for j in range(len(lis)):
    moji+=lis[i][j]
  print(moji)
    

### FIXED CODE ###

h,w=map(int,input().split())
lis=[]
for i in range(h):
  lis.append(input())
tate=[]
yoko=[]
for i in range(0,w):
  for j in range(0,h):
    if lis[j][i]=="#":
      tate.append(i)
      break

for i in range(0,h):
  for j in range(0,w):
    if lis[i][j]=="#":
      yoko.append(i)
      break

for x in yoko:
  for y in tate:
    if y != tate[len(tate)-1]:
      print(lis[x][y],end="")
    else:
      print(lis[x][y])
N = int(input())
A = list(map(int, input().split()))
P=round(sum(A)/N)
B=0
for i in range(N):
  B=B+(A[i]-P)**2
print(B)


### FIXED CODE ###

N,R=map(int, input().split()) 
if N>=10:
    print(R)
if 0<=N<10:
    print(R+100*(10-N))
N=int(input())
T=[int(input()) for _ in range(N)]
T=list(set(T))
print(T)

def gcd(a,b):
  if b==0:
    return a
  else:
    return gcd(b,a%b)

ans=T[0]
for i in range(N):
  #print(ans)
  ans=ans*T[i]//gcd(ans,T[i])
print(ans)

### FIXED CODE ###

N=int(input())
T=[int(input()) for _ in range(N)]
T=list(set(T))
N=len(T)
#print(T)

def gcd(a,b):
  if b==0:
    return a
  else:
    return gcd(b,a%b)

ans=T[0]
for i in range(N):
  #print(ans)
  ans=ans*T[i]//gcd(ans,T[i])
print(ans)
s1,s2,s3=input().split('/')
if s1<2018:print('Heisei')
elif s1=='2019' and s2<='04':print('Heisei')
else:print('TBD')

### FIXED CODE ###

s=input().split('/')
if int(s[0])<2018:print('Heisei')
elif int(s[0])==2019 and int(s[1])<=4:print('Heisei')
else:print('TBD')
import heapq
def main():
    N, Q = map(int, input().split())
    ls = []
    lt = []
    for _ in range(N):
        s, t, x = map(int, input().split())
        ls.append((s-x, x))
        lt.append((t-x, x))
    heapq.heapify(ls)
    heapq.heapify(lt)
    dl = set()
    m = 0
    for i in range(Q):
        d = int(input())
        if len(ls) > 0 and ls[0][0] > d:
            while len(lt) > 0 and lt[0][0] <= d:
                t, x = heapq.heappop(lt)
                dl.remove(x)
        elif len(ls) > 0:
            while len(lt) > 0 and lt[0][0] <= ls[0][0]:
                t, x = heapq.heappop(lt)
                dl.remove(x)
            while len(ls) > 0 and ls[0][0] <= d:
                s, x = heapq.heappop(ls)
                dl.add(x)
                while len(lt) > 0 and lt[0][0] <= s:
                    t, x = heapq.heappop(lt)
                    dl.remove(x)
            while len(lt) > 0 and lt[0][0] <= d:
                t, x = heapq.heappop(lt)
                dl.remove(x)
        else:
            while len(lt) > 0 and lt[0][0] <= d:
                t, x = heapq.heappop(lt)
                dl.remove(x)
        if not dl:
            print('-1')
        else:
            if m not in dl:
                m = min(dl)
            print(min(dl))
main()


### FIXED CODE ###

import heapq
def main():
    N, Q = map(int, input().split())
    l = []
    for _ in range(N):
        s, t, x = map(int, input().split())
        l.append((s-x, 1, x))
        l.append((t-x, 0, x))
    for i in range(Q):
        d = int(input())
        l.append((d, 2, i))
    r = [-1] * Q
    l.sort()
    h = []
    se = set()
    for a, b, c in l:
        if b == 0:
            se.remove(c)
        elif b == 1:
            se.add(c)
            heapq.heappush(h, c)
        else:
            while h and h[0] not in se:
                heapq.heappop(h)
            r[c] = h[0] if h else -1
    print('\n'.join(map(str, r)))
            
main()
if __name__ == '__main__':
    A, B, K = map(int, input().split())

    cnt = 0
    for i in range(1, min(A, B)):
        if A % i == 0 and B % i == 0:
            cnt += 1
        if cnt == K:
            answer = i
            break

    print(answer)

### FIXED CODE ###

if __name__ == '__main__':
    A, B, K = map(int, input().split())

    answer = 1
    cnt = 0
    for i in range(min(A, B), 1, -1):
        if A % i == 0 and B % i == 0:
            cnt += 1
        if cnt == K:
            answer = i
            break

    print(answer)
a = [int(i) for i in input().split("")]
if a[0] == a[1]:
    print(2 * a[0])
else:
    print(2 * max(a) - 1)

### FIXED CODE ###

a = [int(i) for i in input().split(" ")]
if a[0] == a[1]:
    print(2 * a[0])
else:
    print(2 * max(a) - 1)
S = list(input())
K = int(input())
n = len(S)

#(方針)Sの「先頭(の連続)」と「末尾(の連続)」が同じ文字ならそこも連続に
#2連続→1回で置換できる,3連続→1回で置換できる,　「N連続→N//2回で置換できる」

A = [] #連続でちぎるようのリスト
count = 1
for i in range(n): 
 if(i != 0):
  if(S[i]== tmp): count += 1
  if((S[i] != tmp)or(i == n-1)):
    A.append([tmp,count])
    count = 1
 tmp = S[i]
if(n == 1): A.append(S[0],1)

ans = 0
for i in range(len(A)):
  if((i != 0)and(i != len(A)-1)):
   ans += (A[i][1]//2)*K
     
if(len(A) == 1):
   ans += (A[0][1]*K)//2  
elif(A[0][0] == A[-1][0]):
   ans += (A[0][1]//2) + (A[-1][1]//2) + ((A[0][1]+A[-1][1])//2)*(K-1) #最初の二項 : 結合後の先頭と末尾分 
elif(A[0][0] != A[-1][0]):
   ans += (A[0][1]//2)*K  
   ans += (A[-1][1]//2)*K
print(ans)     

### FIXED CODE ###

S = list(input())
K = int(input())
n = len(S)

#(方針)Sの「先頭(の連続)」と「末尾(の連続)」が同じ文字ならそこも連続に
#2連続→1回で置換できる,3連続→1回で置換できる,　「N連続→N//2回で置換できる」

A = [] #連続でちぎるようのリスト
count = 1
for i in range(n): 
 if(i != 0):
  if(S[i]== tmp): count += 1
  if((S[i] != tmp)or(i == n-1)):
    A.append([tmp,count])
    count = 1
 tmp = S[i]
if(n == 1): A.append([S[0],1])

ans = 0
for i in range(len(A)):
  if((i != 0)and(i != len(A)-1)):
   ans += (A[i][1]//2)*K
     
if(len(A) == 1):
   ans += (A[0][1]*K)//2  
elif(A[0][0] == A[-1][0]):
   ans += (A[0][1]//2) + (A[-1][1]//2) + ((A[0][1]+A[-1][1])//2)*(K-1) #最初の二項 : 結合後の先頭と末尾分 
elif(A[0][0] != A[-1][0]):
   ans += (A[0][1]//2)*K  
   ans += (A[-1][1]//2)*K
print(ans)
for qi in range(Q):
    out = 0
    for i in range(m):
        if(l[i]>=p[qi] and r[i]<=q[qi]):
            out += 1
    print(out)

### FIXED CODE ###

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

l=[]
r=[]
for j in range(m):
    l_tmp, r_tmp = list(map(int, input().split()))
    l.append(l_tmp)
    r.append(r_tmp)

p=[]
q=[]
for k in range(Q):
    p_tmp, q_tmp = list(map(int, input().split()))
    p.append(p_tmp)
    q.append(q_tmp)
    
su = [[0 for _ in range(n+1)] for __ in range(n+1)]

def sumTable(L, R):
    for i in range(m):
        su[L[i]][R[i]] += 1
    
    for i in range(1,n+1):
        for j in range(1, n+1):
            su[i][j] += su[i-1][j]
            su[i][j] += su[i][j-1]
            su[i][j] -= su[i-1][j-1]

def getSum(ll,rr):
    ans = su[rr][rr] - su[rr][ll-1] -su[ll-1][rr] + su[ll-1][ll-1]
    return ans
  
sumTable(l,r)

import copy
ss = copy.copy(su)

for qi in range(Q):
    su = copy.copy(ss)
    print(getSum(p[qi], q[qi]))
n = int(input())
a = list(map(int,input().split()))

a_2 = [0 for i in range(n)]
for i in range(n):
    a_2[a[i]-1] += 1

al = []
for i in a_2:
    pass
#    al.append(int(i * (i-1) / 2))

for i in range(n):
    f = a[i]
    t = a_2[f-1] - 1
    print(int(sum(al)-(al[f-1]-t*(t-1)/2)))
    


### FIXED CODE ###

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

a_2 = [0 for i in range(n)]
for i in range(n):
    a_2[a[i]-1] += 1

al = [0 for i in range(n)]
c = 0
for i in a_2:
    if i > 1:
        al[c] += i * (i-1) / 2
    c += 1

sine = sum(al)
for i in range(n):
    f = a[i]
    t = a_2[f-1] - 1
    print(int(sine-(al[f-1]-t*(t-1)/2)))
import numpy as np
n,k = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [(10**4)*(10**5)]*n
dp[0]=0
for i in range(n-1):
    loop = min(k+1,n-i)
    for j in range(1,loop):
        dp[i+j] = min(dp[i+j],dp[i]+np.abs(h[i]-h[i+j])) 
print(dp[n-1])  

### FIXED CODE ###

n,k = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [(10**4)*(10**5)]*n
dp[0]=0
for i in range(n-1):
    loop = min(k+1,n-i)
    for j in range(1,loop):
        dp[i+j] = min(dp[i+j],dp[i]+abs(h[i]-h[i+j])) 
print(dp[n-1])
length, width = int(input()).split()
x, y = int(input()).split()

print((length-x) * (width-y))

### FIXED CODE ###

length, width = input().split()
length, width = int(length),int(width)
x, y = input().split()
x,y = int(x),int(y)
 
print((length-x) * (width-y))
s = input()

if 'RRR' in s:
    ans = 3
elif 'RR' in s:
    ans = 2
elif 'R' in s:
    ans = 1
print(ans)

### FIXED CODE ###

s = input()
ans = 0
if 'RRR' in s:
    ans = 3
elif 'RR' in s:
    ans = 2
elif 'R' in s:
    ans = 1
print(ans)
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 24 20:53:22 2020

@author: NEC-PCuser
"""

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return fact[n] * factinv[r] * factinv[n-r] % mod


p = 10 ** 9 + 7
N = 10 ** 6  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用
 
for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

if __name__ == '__main__':
    K = int(input())
    n = len(input())
    mod = 10**9+7 #出力の制限
    #25 25 a 25 25 25 b 25 25  c  26 26
    
    ans = 0
    for i in range(0, K + 1):
        ans1 = (((25 ** i) % (mod)) * cmb(n + i - 1, n - 1, mod)) % mod
        ans2 = (26 ** (K - i)) % mod
        ans += (ans1 * ans2) % mod
    
    print(ans)
        

### FIXED CODE ###

n = int(input())
s = input()
 
S = len(s)
mod = 10 ** 9 + 7
 
tmp_ans = pow(26, n, mod)
div = pow(26, -1, mod)
 
ans = tmp_ans
 
for i in range(1, n+1):
    tmp_ans = (tmp_ans * 25 * div) % mod
    tmp_ans = ((tmp_ans * (S-1+i)) * pow(i, -1, mod)) % mod
    ans = (ans + tmp_ans) % mod
 
ans %= mod
 
print(ans)
from math import ceil,sqrt,gcd,log,floor
from collections import deque
def ii(): return int(input())
def si(): return input()
def mi(): return map(int,input().strip().split(" "))
def li(): return list(mi())
def msi(): return map(str,input().strip().split(" "))
def lsi(): return list(msi())
#for _ in range(ii()):
n=ii()
print(n//2+n%2)

### FIXED CODE ###

n=int(input())
print(n//2+n%2)
N = input()
l = list(map(int,N))
i = 0
#ans = l[0] - 1 + (len(l)-1)*9 #暫定の答え

if int(N) < 9:
    ans  = 0
elif l.count(9) >= len(l)-1:
    if l[len(l)-1] != 9:
        spot = 8
    else:
        spot = min(l)

else:
    while True:
        if l[i] < 9 and i < len(l)-1:
            spot = l[i] - 1
            break
        else:
            i += 1 
ans = spot + (len(l)-1)*9
print(ans)


### FIXED CODE ###

N = input()
l = list(map(int,N))
i = 0
#ans = l[0] - 1 + (len(l)-1)*9 #暫定の答え

if int(N) < 9:
    ans  = int(N)

elif l.count(9) >= len(l)-1:
    if l[len(l)-1] != 9:
        spot = 8
    else:
        spot = min(l)
    ans = spot + (len(l)-1)*9

else:
    while True:
        if l[i] < 9 and i < len(l)-1:
            spot = l[i] - 1
            break
        else:
            i += 1 
    ans = spot + (len(l)-1)*9

print(ans)
print(len(set(input.split())))

### FIXED CODE ###

print(len(set(input().split())))
from math import gcd


N, X = map(int, input().split())
x = list(map(int, input().split()))

x.append(X)
x.sort()

last = x[0]
ans = abs(x[0] - x[1])
for i in x[1:]:
    ans = gcd(ans, abs(last - i))
    last = i

print(ans)


### FIXED CODE ###

from fractions import gcd


N, X = map(int, input().split())
x = list(map(int, input().split()))

x.append(X)
x.sort()

last = x[0]
ans = abs(x[0] - x[1])
for i in x[1:]:
    ans = gcd(ans, abs(last - i))
    last = i

print(ans)
N,Y=map(int, input().split())
result = [-1,-1,-1]
for i in range(N):
    for j in range(N):
        k = N - i + j 
        sum = 10000*i + 5000* j + 1000*k
        if Y == sum:
            result = [i, j, k]
            break
print(" ".join(result))


### FIXED CODE ###

N,Y=map(int, input().split())
result = ["-1","-1","-1"]
for i in range(N+1):
    for j in range(N-i+1):
        k = N - (i + j) 
        x = 10000 * i + 5000 * j + 1000 * k
        if Y == x:
            result = [str(i), str(j), str(k)]
            break
print(" ".join(result))
n=input()
a=map(int,raw_input().split())
a.reverse()
for i in a
   print i

### FIXED CODE ###

n=input()
a=map(int,raw_input().split())
a.reverse()
for i in a:
   print i,