peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n, c, k = map(int, input().split())
t = sorted([int(input()) for _ in range(n)])
l = 0
m = 0
ans = 0
for i in range(n):
    if l == 0:
        m = t[i]
        l += 1
    elif l < c:
        if m + k >= t[i]:
            l += 1
        else:
            ans += 1
            l = 1
            m = t[i]
    else:
        ans += 1
        l = 1
        m = t[i]
ans += 1
print(ans)
# Judge status: Accepted
import math
h=int(input())
w=int(input())
n=int(input())
if w>=h:
    print(math.ceil(n/w))
else:
    print(math.ceil(n/h))
# Judge status: Wrong Answer
n=int(input())
print(800*n-200*n//15)
# Judge status: Wrong Answer
# 入力をint型にする
N = int(input())

ans = 0
for i in range(1,N):
  if i%3!=0 and i%5!=0:
    ans += i

print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-

a, b = input().split()

A = ""
B = ""
for i in range(int(b)):
    A += a
for i in range(int(a)):
    B += b

if A < B:
    print(A)
else:
    print(B)
# Judge status: Accepted
N = int(input())

a = N%2
if a==0:
    print(0.5)
else:
    print((N//2+1)/N)
# Judge status: Wrong Answer
import sys
s = sys.stdin.readlines()
S = s[0]
Q = s[1]
Qs = s[2:]
 
for q in Qs:
  if len(q.strip()) == 1:
    S = S[::-1]
  else:
    F, C = q.strip().split()[1:3]
    if F == "1":
      S = C + S
    else:
      S += C
print(S)
# Judge status: Accepted
n, m = map(int, input().split())

q = m // 2

if n >= q:
    print(q)
else:
    m -= 2*n
    m //= 4
    print(n+m)
# Judge status: Accepted
w,h,n = map(int,input().split())
lists = [list(map(int,input().split())) for i in range(n)]
x1 = 0
x2 = w
y1 = 0
y2 = h
for x,y,a in lists:
    if a == 1:
        x1 = max(x1,x)
    elif a == 2:
        x2 = min(x2,x)
    elif a == 3:
        y1 = max(y1,y)
    elif a == 4:
        y2 = min(y2,y)
x = max(0,(x2 - x1))
y = max(0,(y2 - y1))
ans = max(0,x*y)
print(ans)
# Judge status: Wrong Answer
N = int(input())
cs = []
t1, x1, y1 = 0, 0, 0
ans = 'Yes'
for i in range(N):
  t2, x2, y2 = map(int, input().split())
  d = abs(x1-x2) + abs(y1-y2)
  if d > (t2 - t1) or d % 2 != (t2 - t1) % 2:
    ans = 'No'
print(ans)
# Judge status: Accepted
#B
K = int(input())
S = str(input())

L = len(S)
if L <= K:
    print(S)
else:
    ans = ""
    for i in range(K):
        ans+=S[i]
    ans+="..."
    print(ans)
# Judge status: Wrong Answer
a = int(input())
b = int(input())
c = int(input())
x = int(input())

rCnt = 0
ttla = 0
ttlb = 0

ia = 0
ib = 0
ic = 0

while ia <= a:
  ttla = 500 * ia
  ia = ia + 1
  while ib <= b:
    ttlb = 100 * ib
    ib = ib + 1
    while ic <= c:
      if ttla + ttlb + 50 * ic:
        rCnt = rCnt + 1
      ic = ic + 1

print(rCnt)
# Judge status: Accepted
s=int(input())
c=set([s])
i=1
while True:
  i+=1
  if s&1:
    s=3*s+1
  else:
    s//=2
  if s in c:
    print(i)
    break
  c.add(s)
# Judge status: Accepted
A, B = map(int, input().split())

Amin= A*100/8
AMAX= (A+1)*100/8
Bmin= B*100/10
BMAX= (B+1)*100/10

Alist=[0]*1257
Blist=[0]*1257
ANSlist=[10000]*1257

for i in range(1257):
    if Amin <=i <AMAX:
        Alist[i]=i

for i in range(1257):
    if Bmin <=i <BMAX:
        Blist[i]=i

for i in range(1257):
    if Alist[i]!=0 and Blist[i]!=0:
        ANSlist[i]=i

if min(ANSlist)==10000:
    print(-1)
else:
    print(min(ANSlist))
# Judge status: Wrong Answer
import numpy as np

n = int(input())

a = input().split(' ')

a = np.array(a).astype(int)


while a[a>0].shape[0] > 1:
  not_0_a = a[a!=0]
  min_ = not_0_a.min()#0じゃない最小値
  min_i = np.where(a == min_)#最小値のインデックス
  a = a % min_
  a[min_i[0][0]] = min_
  print(a)

  """
  if a[a>0].shape[0] == 1:
    not_0_a = a[a!=0]
    min_ = not_0_a.min()
  """
  
print(min_)
# Judge status: Accepted
def solve():
    X, Y = map(int, input().split())
    count = 0
    while X <= Y:
        count += 1
        X *= 2;
    print(count)
if __name__ == "__main__":
    solve()
# Judge status: Wrong Answer
n,k,q = map(int,input().split())
points = [k]*n
for i in range(q):
    winner = int(input())
    for j in range(n):
        points[j] -= 1
    points[winner - 1] += 1
for i in points:
    if i > 0:
        print("YES")
    else:
        print("NO")
# Judge status: Accepted
n=int(input())
w=list(map(int,input().split()))
s=[0]
for i in w:
    s.append(s[-1]+i)
ss=s[-1]
ans=10**20
for i in range(n+1):
    ans=min(ans,abs((ss-s[i])-s[i]))
print(ans)
# Judge status: Accepted
from collections import Counter

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

ans = 0
for i in range(1,N):
    temp = 0
    left = S[:i]
    right = S[i:]
    left_words = Counter(left)
    right_words = Counter(right)
    for key1 in left_words.keys():
        for key2 in right_words.keys():
            if key1 == key2:
                temp += 1
    if temp > ans:
        ans = temp
print(ans)
# Judge status: Accepted
S = list(input())
s = 0
num = 0
ans = 0
for i in range(len(S)):
    if i < num:
        continue
    for j in range(1,len(S)-i+1):
        if S[i:i+j] != s:
            s = S[i:i+j]
            num = i+j
            ans += 1
            break
print(ans)
# Judge status: Accepted
def main():
    length = int(input())
    numbers = list(map(int, input().split()))
    even_num = 0
    odd_num = 0
    multiple_of_4 = 0
    for num in numbers:
        if not num % 4:
            multiple_of_4 += 1
        elif not num % 2:
            even_num += 1
        else:
            odd_num += 1
    if multiple_of_4 >= odd_num or (multiple_of_4 + 1 >= odd_num and even_num == 0):
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()
# Judge status: Accepted
S = list(map(str, input().rstrip()))

for i, s in enumerate(S):
    if s=="A":
        start = i
        break

for i, s in enumerate(S[::-1]):
    if s=="Z":
        end = i
        break

print(len(S[start:len(S)-end]))
# Judge status: Accepted
A,B = map(int,input().split())

if A <= 8 and B<=8:
    print("Yay!")
else:
    print(":(")
# Judge status: Accepted
n = int(input())
s = input()
if n % 2 != 0:
  print("No")
else:
  T = s[0:n//2]
  if T + T == s:
    print("Yes")
  else:
    print("No")
# Judge status: Accepted
N,M = map(int,input().split())
if N==1:
    nmax=M
else:
    nmax = 1
    for i in range(2,int(M**0.5)+1):
        if M%i==0 and M//i>=N:
            nmax = max(nmax,i)
        if M%i==0 and i>=N:
            nmax = max(nmax,M//i)
print(nmax)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
l = [0] * 9
for i in a:
    if i >= 3200:
        l[8] += 1
    else:
        l[i // 400] += 1
mi = 0
ma = 0
for i in l[:8]:
    if i > 0:
        mi += 1
        ma += 1
if l[8] > 0:
    ma += l[8] 
if sum(l[:8]) == 0:
    print(1, l[8])
    exit()
print(mi, ma)
# Judge status: Accepted
s = input()
if s[-1] == 's':
    print(s + 'es')
else:
    print(s + 's')
# Judge status: Wrong Answer
s = input()
ans = cnt = 0
s_ = s[0]
for s_i in s:
    if s_i == s_:
        cnt += 1
        ans += cnt
    else:
        s_ = s_i
        ans += cnt
        cnt = 0
print(ans)
# Judge status: Accepted
c = input()
print("vowel" if c in "aiueo" else "consonant")
# Judge status: Wrong Answer
n = int(input())
r = [input().split() for _ in range(n)]

for i in range(n):
    r[i].append(i+1)
r.sort(key=lambda x:x[1],reverse=True)
r.sort(key=lambda x:x[0])
for i in range(n):
    print(r[i][2])
# Judge status: Accepted
print("".join(s[0] for s in input().split()))
# Judge status: Accepted
n,r = map(int,input().split())

if(n>10):
    print(r)
else:
    print(r+(10-n)*100)
# Judge status: Wrong Answer
import math

A,B,C=map(int,input().split())
X=math.sqrt(A)
Y=math.sqrt(B)
Z=math.sqrt(C)
if X+Y-Z<0:
	print("Yes")
else:
	print("No")
# Judge status: Accepted
import itertools
import math
import fractions
import functools
n = int(input())
b = list(map(int, input().split()))
a = [0]*n
a[0] = b[0]
for i in range(1,n-1):
    a[i] = min(b[i-1],b[i])

a[n-1]=b[n-2]
print(sum(a))
# Judge status: Accepted
n = int(input())
s = [input() for i in range(n)]
print(len(set(s)))
# Judge status: Accepted
n,m=map(int,input().split())
num=[]
ans=[""]*m
numcount=[1]*n
count=1
for i in range(m):
    p,y=map(int,input().split())
    num.append([p,y,i])
stry= lambda val: val[1]
num.sort(key=stry)
for i in range(m):
    p=str(num[i][0])
    y=str(numcount[int(num[i][0])-1])
    numcount[int(num[i][0])-1]+=1
    ans[num[i][2]]="0"*(6-len(p))+p+"0"*(6-len(y))+y
for i in range(m):
    print(ans[i])
# Judge status: Wrong Answer
a,b,c,k = map(int,input().split())

if abs(a-b) > 10**18:
    print('Unfair')
    exit()
print(a-b)
# Judge status: Accepted
N,M = map(int,input().split())
if M//2 <= N:
  ans = M//2
  print(ans);exit()
A = N*2+M
ans = A//4
print(ans)
# Judge status: Wrong Answer
N = int(input())
l = [int(x) for x in range(1,N+1)]

total_num,max_num = 0,0

if N == 1:
  print(1)
  exit()
  
for i in range(1,N):
  total_num += i
  if total_num >= N:
    max_num = i
    break

if total_num == N:
  for i in range(max_num):
    print(i+1)
else:
  ng_num = total_num - N
  for j in range(max_num):
    if j+1 != ng_num:
      print(j+1)
# Judge status: Wrong Answer
N=int(input())
a=list(map(int,input().split()))
box=[0]*N
for i in range(N, 0,-1):
    sm = 0
    for j in range(i, N+1, i):
        sm += box[j-1]
    print(i, sm)
    box[i-1] = (sm % 2) ^ a[i-1]
print(sum(box))
print(*box)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)

sm=[]
count=0
for i in range(3*N):
    if count==N:
        break
    if i%2==1:
        sm.append(A[i])
        count+=1

ans=sum(sm)
print(ans)
# Judge status: Wrong Answer
K,X = map(int,input().split())

if 500*K <= X:
  print("No")
else:
  print("Yes")
# Judge status: Accepted
x = int(input())

ans = (x//11)*2
remainder = x%11
if remainder == 0:
    print(ans)
elif 1 <= remainder <= 6:
    print(ans+1)
else:
    print(ans+2)
# Judge status: Accepted
n, x, y = map(int, input().split())
a = [0]*(n-1)
for i in range(1, n):
    for j in range(i+1, n+1):
        b = min(j-i, abs(x-i)+1+abs(y-j))
        a[b-1] += 1
print(*a, sep="\n")
# Judge status: Accepted
def ABC_71_A():
    X,A,B = map(int, input().split())
    
    if abs(X-A) <= abs(X-B):
        print('A')
    else:
        print('B')

if __name__ == '__main__':

    ABC_71_A()
# Judge status: Wrong Answer
import heapq
n, m = map(int, input().split())
a = list(map(int, input().split()))
heapq.heapify(a)
bc = [list(map(int, input().split())) for _ in range(m)]
bc.sort(key = lambda x: x[1], reverse = True)

for i in range(m):
    if a[bc[i][0] - 1] >= bc[i][1]:
        break
    else:
        cnt = 0
        while cnt < bc[i][0]:
            heapq.heapreplace(a, bc[i][1])
            cnt += 1

print(sum(a))
# Judge status: Accepted

n=int(input())
h=list(map(int,input().split()))
li=[0]*n
li[1]=abs(h[1]-h[0])
for i in range(2,n):
    li[i]=min(li[i-1]+abs(h[i]-h[i-1]),li[i-2]+abs(h[i]-h[i-2]))
##print(li)
print(li[n-1])
# Judge status: Accepted
a,b,c=map(int,input().split())
print(["No","Yes"][a>c>b or a<c<b])
# Judge status: Accepted
A, B, C, X = [int(input()) for i in range(4)]
print(sum(500*a+100*b+50*c == X for a in range(A+1) for b in range(B+1) for c in range(C+1)))
# Judge status: Accepted
n=int(input())
s=input()
countwhite=[0]*(n+1)
for i in range(n):
    if s[i]==".":
        countwhite[i+1]=countwhite[i]+1
    else:
        countwhite[i+1]=countwhite[i]
ans=10**8
for i in range(n+1):
    change=i-countwhite[i]+(countwhite[-1]-countwhite[i])
    ans=min(ans,change)
print(ans)
# Judge status: Accepted
n,k=map(int,input().split())
x=list(map(int,input().split()))

ans=float('inf')
for i in range(n-k+1):
    nowx=(x[i],x[i+k-1])
    if nowx[0]>=0 and nowx[-1]>=0:
        ans=min(ans, nowx[-1])
    elif nowx[0]<=0 and nowx[-1]<=0:
        ans=min(ans, abs(nowx[0]))
    elif nowx[0]<0 and nowx[-1]>=0:
        ans=min(ans, 2*abs(nowx[0])+nowx[-1], abs(nowx[0])+2*nowx[-1])
print(ans)
# Judge status: Accepted
a,b,x = map(int, input().split())

a_div=0
b_div = b//x
if a!=0:
    a_div = (a-1)//x
    count = b_div-a_div
else:
    count = b_div-a_div+1
print(count)
# Judge status: Wrong Answer
paramN, paramK = list(map(lambda x: int(x), input().split(' ')))
paramA = list(map(lambda x: int(x), input().split(' ')))

route = [0] * (paramN + 1)
route[0] = 1
for i in range(1, paramN + 1):
    route[i] = paramA[route[i - 1] - 1]

loop_start = 0
history = [False] * paramN
for i, r in enumerate(route):
    if history[r - 1]:
        loop_start = i
        break
    else:
        history[r - 1] = True

x = route[loop_start]
loop_start_0 = route.index(x)

y = paramK - loop_start_0
z = y % (loop_start - loop_start_0)
print(route[loop_start_0 + z])
# Judge status: Accepted
n=int(input())
s=input()
w=s.count("W")
e=s.count("E")
t=0
ans=n
for i in range(n):
    if s[i]=="E":
        e-=1
    tmp=e+t
    if tmp<ans:
        ans=tmp
    if s[i]=="W":
        t+=1
print(ans)
# Judge status: Accepted
n, a, b = map(int, input().split(' '))

if a == 0:
  print('0')
else:
  base = (n//(a+b))*a
  
  n = n%(a+b)
  
  base += min(n, a)
  
  print(base)
# Judge status: Accepted
n,k,s = map(int, input().split())
if s == 10**9:
    ansl = []
    for i in range(n):
        if i < k:
            ansl.append(s)
        else:
            ansl.append(1)
    print(*ansl)

else:
    ansl = []
    for i in range(n):
        if i < k:
            ansl.append(s)
        else:
            ansl.append(10**9)
    print(*ansl)
# Judge status: Accepted
S = [int(i) for i in input()]
K = int(input())

ans = 1
if K<=len(S):
    for i in S[:K]:
        if i!=1:
            ans=i
            break
else:
    for i in S:
        if i!=1:
            ans=i
            break
print(i)
# Judge status: Accepted
n = int(input())
L = list(map(int,input().split()))
if sum(L)-max(L) > max(L):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n=int(input())
for x in range(60000):
  if int(x*1.08)==n:
    print(x)
    exit()
print(":(")
# Judge status: Wrong Answer
n = input()
if n:
    print("1")
else:
    print("0")
# Judge status: Accepted
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = int(input())
check_list = []
for i in range(n):
    d1, d2 = map(int, input().split())
    if d1 == d2:
        check_list.append(1)
    else:
        check_list.append(0)
flag = 0
for i in range(n - 2):
    if sum(check_list[i:(i+3)]) == 3:
        flag = 1
        break
if flag:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


a,b,c = map(int, input().split())
ans = min(a*b*(c%2), a*(b%2)*c, (a%2*b*c))
print(ans)
# Judge status: Accepted
n,m=map(int,input().split())
l=sorted([list(map(int,input().split())) for _ in range(n)])
ans=0
for a,b in l:
    if b<m:
        ans+=(a*b)
        m-=b
    else:
        ans+=(a*m)
        break
print(ans)
# Judge status: Accepted
K, X = map(int, input().split())
if 500 * K >= X:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b=[int(str1) for str1 in input().split()]
if (a*b)%2==0:
    print("Even")
else:
    print("Odd")
# Judge status: Accepted
D,V,T = map(int,input().split())
time = D / V
if time <= T:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N = int(input())

x = N * 800
y = N // 15 * 200

answer = x - y
# print(x, y)
print(answer)
# Judge status: Accepted
n = int(input())
s = [input() for i in range(n)]
r = "Yes"
if len(set(s)) != n:
    r = "No"
else:
    for i in range(1, n):
        if s[i - 1][-1] != s[i][0]:
            r = "No"
print(r)
# Judge status: Wrong Answer
a, b, x = map(int, input().split())
if x<=a or a+b<=x:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
X, Y = map(int, input().split())
for i in range(1, X + 1):
    if Y == (i * 2 + (X - i) * 4):
        print('Yes')
        break
else:
    print('No')
# Judge status: Accepted
n=int(input())
for i in range(n+1):
  if i==0:
    a=2
  elif i==1:
    b=1
  else:
    a,b=b,a+b
print(b)
# Judge status: Wrong Answer
n = int(input())
lis = list(map(int, input().split()))
a = 1
for i in range(n):
    a = a * lis[i]
    if a > 1000000000000000000:
        a = -1
        break
print(a)
# Judge status: Accepted
a,b,c=map(int,input().split())

if c*a<=b:
  print(c)
else:
  print(b//a)
# Judge status: Wrong Answer
n = int(input())
l = [int(a) for a in input().split()]
l.sort()
print(l)
count=0
for i in range(n):
    for j in range(i+1, n):
        for k in range(j+1, n):
            if((l[i]+ l[j] > l[k] )&( l[i] != l[j] != l[k])):
                count += 1
print(count)
# Judge status: Accepted
N=int(input())
num=[2,1]
for i in range(2,87):
    num.append(num[-1]+num[-2])
print(num[N])
# Judge status: Accepted
import sys
#sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from random import randint
d=int(input().rstrip())
c=[int(i)for i in input().split()]
s=[[int(i)for i in input().split()]for _ in range(d)]
last=[0]*26
for i in range(d):
    print(randint(1,26))
# Judge status: Accepted
import math
a, b = input().split()
num = int(a + b)
li = []
for i in range(1000):
    li.append(i ** 2)
if (num in li):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n, T = map(int, input().split())

index = -1
min_c = 9999
for i in range(n):
    c, t = map(int, input().split())
    # print(f'{c} {t}')
    
    if t <= T and min_c > c:
        index = i + 1
        min_c = c
    # print(min_c)
        
if index == -1:
    print('TLE')
else:
    print(min_c)
# Judge status: Accepted
C = list(map(int, input().split()))

a = C[0]
b = C[1]
c = C[2]

print(str(c) + " " + str(a) + " " + str(b))
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

cnt = 0

flag = True

while flag == True:
    for i in range(n):
        if a[i]%2:
            flag = False
            cnt -= 1
        a[i] = a[i]//2
    cnt += 1
print(cnt)
# Judge status: Accepted
N, x = map(int,input().split())
a = list(map(int,input().split()))
ans = 0
if a[0] > x:
    ans += a[1]
    a[1] = 0
    ans += (a[0] - x)
    a[0] = x
elif (a[0] + a[1]) > x:
    ans += (a[0] + a[1] - x)
    a[1] = x - a[0]
for i in range(2,N):
    if (a[i - 1] + a[i]) > x:
        ans += (a[i - 1] + a[i] - x)
        a[i] = x - a[i - 1] 
print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
hhh = list(map(int, input().split()))
hhh.sort()
print(sum(hhh[:-K]) if K > 0 else sum(hhh))
# Judge status: Accepted
import bisect
def LI():
  return list(map(int,input().split()))

N,M,K = map(int,input().split())
A = LI()
B = LI()

cumA = [0]
for a in A:
  cumA.append(cumA[-1]+a)

cumB = [0]
for b in B:
  cumB.append(cumB[-1]+b)

res = 0
for i in range(N+1):
  cuma = cumA[i]
  if cuma > K: continue
  rem = K-cuma
  deskb = bisect.bisect_right(cumB, rem)-1

  res = max(res, i+deskb)

print(res)
# Judge status: Accepted
n, m = map(int,input().split())

if m//n == m/n:
    print(m//n)
else:
    ans = 1
    for i in range(2,min(m,10**8+1)):
        if m-i*(n-1) < i:
            break
        if m%i == 0:#from (M-i*(N-1))%i==0
            ans = i
    print(ans)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

for i in range(n-1):
    #if a[i] < 0 and abs(a[i]) > abs(a[i+1]):
    #    a[i] *= -1
    #    a[i+1] *= -1
    if a[i] < 0:
        a[i] *= -1
        a[i+1] *= -1

#if abs(a[-1]) > abs(a[-2]):
#    a[-1] *= -1
#    a[-2] *= -1

print(sum(a))
# Judge status: Wrong Answer
n,m=map(int,input().split())
a=[input() for i in range(n)]
b=[input() for i in range(m)]
#print(a,b)
ans=0
cnt=0
for i in range(n-m+1):
  for j in range(n-m+1):
    cnt=0
    for k in range(m):
      if b[k]!=a[i+k][j:j+m]:
        break
      cnt+=1
      #print(a[i+k][j:j+m],b[k],a[i+k][j:j+m]==b[k])
    if cnt==m:
      ans+=1
    if ans>0:
      break
  if ans>0:
    break
  
print("Yes" if ans>0 else "No",ans)
# Judge status: Accepted
a,b = map(int,input().split())

ans=0
for i in range(a,b+1):
    if i==int(str(i)[::-1]):
        ans+=1
print(ans)
# Judge status: Wrong Answer
x,k,d= map(int,input().split())
import sys
z = abs(x) // d
if z <= k:
    y = abs(x) - d * z


else:
    y = abs(x) - d * k
if x == d:
    if k % 2 == 0:
        y = x
    else:
        y = 0


print(y)
# Judge status: Accepted
S = input()
K = int(input())
N = len(S)
A = [0]*N

ans = ""
for i in range(N):
  A[i] = (ord("z") - ord(S[i]) + 1) % 26
  if i != N-1:
    if K >= A[i]:
      K -= A[i]
      ans += "a"
    else:
      ans += S[i]
  else:
    K = K % 26
    s = ord(S[i]) + K
    if s > ord("z"):
      s -= 26
    ans += chr(s)
    
print(ans)
# Judge status: Accepted
k,x = map(int,input().split())

if k*500>=x:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n = int(input())
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))

ans = 0
for i in range(n):
    tmp = sum(A1[:i+1])
    tmp += sum(A2[i:])
    ans = max(ans, tmp)
print(ans)
# Judge status: Wrong Answer
N, M = map(int,input().split())

if N == 1:
    if M == 1:
        print(1)
    else:
        print(M-2)
else:
    print((N-2)*(M-2))
# Judge status: Accepted
S = input()
T = input()
s = sorted(map(S.count, set(S)))
t = sorted(map(T.count, set(T)))
print("Yes" if(s == t) else "No")
# Judge status: Accepted
A,B=map(int,input().split())

for x in range(B*20):
    if int(0.08*x)==A and int(0.1*x)==B:
        print(x)
        break
    if x==B*20-1:
        print(-1)
# Judge status: Accepted
a,b,k = map(int,input().split())
if a+b <= k:
  print(0,0)
elif a < k:
  print(0,a+b-k)
else:
  print(a-k,b)
# Judge status: Wrong Answer
a,b=input().split()
print(a+b)
# Judge status: Wrong Answer
a,b=map(int, input().split())
if (9-a)*(9-b)*(a-1)*(b-1)<0:
  print(-1)
else:
  print(a*b)
# Judge status: Accepted
d = [-1, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1]
x, y = tuple(map(int, input().split()))
if d[x] == d[y]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N = int(input())
S = input()

ans = 0
tmp = 0
for i in S:
  if i == 'I':
    tmp += 1
  else:
    tmp -= 1
  ans = max(ans, tmp)
print(ans)
# Judge status: Accepted
def p_b():
    N, T = map(int, input().split())
    ans = 10 ** 9
    for _ in range(N):
        c, t = map(int, input().split())
        if t <= T:
            ans = min(ans, c)
    print(ans if ans != 10 ** 9 else "TLE")
    
p_b()
# Judge status: Wrong Answer
S = list(input())
C = S[2:-1]
if S[0] == "A" and "C" in C and C.count("C") == 1:
    S.remove("A")
    S.remove("C")
    print(S)
    T="".join(S)
    print(T)
    Y=T.lower()
    if T == Y:
        print("AC")
    else:
        print("WA")
else:
    print("WA")
# Judge status: Accepted
a, b, c = map(int, input().split())
print((a-c)//(b+c))
# Judge status: Accepted
s=input()
ans=753
for i in range(0,len(s)-3+1):
    ans=min(abs(int(s[i:i+3])-753),ans)
print(ans)
# Judge status: Accepted
a = input('')
if a.count('5') == 2 and a.count('7') ==1:
	print('YES')
else:
	print('NO')
# Judge status: Wrong Answer
S,T = map(str,input().split())
A,B = map(int,input().split())
U = input()
if S == U:
  print(str(A-1) + '' + str(B))
else:
  print(str(A) + '' + str(B-1))
# Judge status: Accepted
N,K = map(int, input().split())
A = list(map(int, input().split()))

count = 0

for i in range(N - K):
  kake_A = A[i]
  kake_B = A[i + K]
  if kake_A >= kake_B:
    print('No')
  else:
    print('Yes')
# Judge status: Accepted
x = int(input())

y = x // 11
z = x % 11

if z == 0:
    print(y * 2)
elif z <= 6:
    print(y * 2 + 1)
else:
    print(y * 2 + 2)
# Judge status: Accepted
N, A, B = map(int, input().split())
cnt = 0
for i in range(1, N+1):
    sum = 0
    num = i
    while num > 0:
        sum += num % 10
        num //= 10
    if A <= sum <= B:
        cnt += i
print(cnt)
# Judge status: Accepted
sx,sy,tx,ty = map(int,input().split())
x = tx - sx
y = ty - sy
print("U"*y+"R"*x+"D"*y+"L"*(x+1)+"U"*(y+1)+"R"*(x+1)+"D"+"R"+"D"*(y+1)+"L"*(x+1)+"U")
# Judge status: Accepted
s=input()

print("2018"+s[4:])