Limak is a little polar bear. He likes nice strings — strings of length n, consisting of lowercase English letters only.

The distance between two letters is defined as the difference between their positions in the alphabet. For example, $\operatorname{dist}(c, e) = \operatorname{dist}(e, c) = 2$, and $\operatorname{dist}(a, z) = \operatorname{dist}(z, a) = 25$.

Also, the distance between two nice strings is defined as the sum of distances of corresponding letters. For example, $\operatorname{dist}(a f, d b) = \operatorname{dist}(a, d) + \operatorname{dist}(f, b) = 3 + 4 = 7$, and $\text{dist(bear, roar)} = 16 + 10 + 0 + 0 = 26$.

Limak gives you a nice string s and an integer k. He challenges you to find any nice string s' that $\operatorname{dist}(s, s^{\prime}) = k$. Find any s' satisfying the given conditions, or print "-1" if it's impossible to do so.

As input/output can reach huge size it is recommended to use fast input/output methods: for example, prefer to use gets/scanf/printf instead of getline/cin/cout in C++, prefer to use BufferedReader/PrintWriter instead of Scanner/System.out in Java.


-----Input-----

The first line contains two integers n and k (1 ≤ n ≤ 10^5, 0 ≤ k ≤ 10^6).

The second line contains a string s of length n, consisting of lowercase English letters.


-----Output-----

If there is no string satisfying the given conditions then print "-1" (without the quotes).

Otherwise, print any nice string s' that $\operatorname{dist}(s, s^{\prime}) = k$.


-----Examples-----
Input
4 26
bear

Output
roar
Input
2 7
af

Output
db

Input
3 1000
hey

Output
-1

Difficulty: EASY
Tags: String algorithms

Greedy algorithms
Skill types: Greedy algorithms

Starter code:

Solutions:
(n, k) = map(int, input().split())
s = input()
ss = ''
sss = [ord(i) for i in s]
for i in range(0, n):
	k1 = 122 - sss[i]
	k2 = sss[i] - 97
	if k1 >= k2:
		go = sss[i] + min(k1, k)
		k -= min(k1, k)
		ss += chr(go)
	else:
		go = sss[i] - min(k2, k)
		k -= min(k2, k)
		ss += chr(go)
print(-1 if k else ss)


(n, k) = map(int, input().split())
s = input()
st = ''
for i in s:
	if i <= 'm':
		t = ord('z') - ord(i)
		if k >= t:
			k -= t
			st += 'z'
		elif k < t and k != 0:
			st += chr(ord(i) + k)
			k = 0
		elif k == 0:
			st += i
	else:
		t = abs(ord(i) - ord('a'))
		if k >= t:
			k -= t
			st += 'a'
		elif k < t and k != 0:
			st += chr(ord(i) - k)
			k = 0
		elif k == 0:
			st += i
if k != 0:
	print('-1')
else:
	print(st)


(n, k) = map(int, input().split())
s = list(input())
for i in range(n):
	if s[i] < 'm':
		a = min(k, ord('z') - ord(s[i]))
		s[i] = chr(ord(s[i]) + a)
		k -= a
	else:
		a = min(k, ord(s[i]) - ord('a'))
		s[i] = chr(ord(s[i]) - a)
		k -= a
if k:
	print('-1')
else:
	print(''.join(s))


(n, k) = list(map(int, input().split()))
s = input()
help = []
d = dict()
for i in range(ord('a'), ord('z') + 1):
	if abs(ord('a') - i) > abs(ord('z') - i):
		d[chr(i)] = [abs(ord('a') - i), 'a']
	else:
		d[chr(i)] = [abs(ord('z') - i), 'z']
help = 0
for i in s:
	help += d[i][0]
if help < k:
	print(-1)
else:
	ans = ''
	for i in s:
		if d[i][0] < k:
			ans += d[i][1]
			k -= d[i][0]
		else:
			for j in range(ord('a'), ord('z') + 1):
				if abs(ord(i) - j) == k:
					ans += chr(j)
					k -= abs(ord(i) - j)
					break
	print(ans)


(n, k) = map(int, input().split())
s = list(input())
ss = list(s)
kk = k
for i in range(n):
	z = ord('z') - ord(s[i])
	a = ord(s[i]) - ord('a')
	if k == 0:
		break
	if z > a:
		s[i] = chr(ord(s[i]) + min(k, z))
		k -= min(k, z)
	else:
		s[i] = chr(ord(s[i]) - min(k, a))
		k -= min(k, a)
sm = 0
for i in range(n):
	sm += abs(ord(s[i]) - ord(ss[i]))
if sm == kk:
	print(''.join(s))
else:
	print(-1)


(n, k) = map(int, input().split())
s = list(input())
for i in range(len(s)):
	if ord(s[i]) - ord('a') > ord('z') - ord(s[i]):
		to = 'a'
	else:
		to = 'z'
	if abs(ord(to) - ord(s[i])) < k:
		k -= abs(ord(to) - ord(s[i]))
		s[i] = to
	else:
		if to == 'z':
			s[i] = chr(ord(s[i]) + k)
		else:
			s[i] = chr(ord(s[i]) - k)
		k = 0
if k == 0:
	print(''.join(s))
else:
	print(-1)


(length, distance) = map(int, input().split())
word = input()
dist = 0
dsf = 0
for i in word:
	a = ord(i)
	dist += max(a - 97, 122 - a)
if dist < distance:
	print(-1)
else:
	newWord = ''
	for i in word:
		a = ord(i)
		if a < 109:
			if distance - dsf >= 122 - a:
				newWord += 'z'
				dsf += 122 - a
			else:
				newWord += chr(a + max(0, distance - dsf))
				dsf = dist
		elif distance - dsf >= a - 97:
			newWord += 'a'
			dsf += a - 97
		else:
			newWord += chr(a - max(0, distance - dsf))
			dsf = dist
	print(newWord)


(n, k) = map(int, input().split())
t = ''
for i in map(ord, input()):
	d = min(k, max(122 - i, i - 97))
	t += chr(i + d if i + d < 123 else i - d)
	k -= d
print(-1 if k else t)


(n, k) = map(int, input().split())
s = input()
a = []
for i in range(n):
	t = min(k, max(ord(s[i]) - ord('a'), ord('z') - ord(s[i])))
	if ord(s[i]) + t > ord('z'):
		a.append(chr(ord(s[i]) - t))
	else:
		a.append(chr(ord(s[i]) + t))
	k -= t
if k > 0:
	exit(print('-1'))
print(''.join(a))


s = input().split(' ')
n = int(s[0])
k = int(s[1])
s = input()
curval = k
answer = ''
for i in range(len(s)):
	d1 = ord(s[i]) - ord('a')
	d2 = ord('z') - ord(s[i])
	if curval > max(d1, d2):
		if d1 > d2:
			answer += 'a'
			curval -= d1
		else:
			answer += 'z'
			curval -= d2
	else:
		if d1 > d2:
			answer += chr(ord(s[i]) - curval)
		else:
			answer += chr(ord(s[i]) + curval)
		print(answer, s[i + 1:], sep='')
		curval = 0
		break
if curval:
	print(-1)


str = input()
(n, k) = str.split()
n = int(n)
k = int(k)
s = input()
p = ''
for i in range(0, n):
	flag = 1 if ord('z') - ord(s[i]) > ord(s[i]) - ord('a') else 0
	k -= ord('z') - ord(s[i]) if flag else ord(s[i]) - ord('a')
	p += 'z' if flag else 'a'
	if k < 0:
		p = p[:i] + (chr(ord(p[i]) + k) if flag else chr(ord(p[i]) - k))
		break
p += s[i + 1:]
print(p if k <= 0 else '-1')


(n, d) = input().split(' ')
text = input()
n = int(n)
d = int(d)
mainD = d
nice = ''
part = int(d / n)
if n * 25 < d:
	print(-1)
else:
	for i in range(n):
		num = ord(text[i]) - 96
		if num < 14:
			if d > 26 - num:
				d -= 26 - num
				num = 26
			else:
				num = abs(d + num)
				d = 0
		elif num > 13:
			if d > num - 1:
				d -= num - 1
				num = 1
			else:
				num = abs(d - num)
				d = 0
		nice += chr(num + 96)
	if d == 0:
		print(nice)
	else:
		print('-1')


(n, k) = map(int, input().split())
s = input()
s = list(s)
for i in range(n):
	if ord(s[i]) >= 110:
		m = min(ord(s[i]) - 97, k)
		k -= m
		s[i] = chr(ord(s[i]) - m)
	else:
		m = min(122 - ord(s[i]), k)
		k -= m
		s[i] = chr(ord(s[i]) + m)
if k > 0:
	print(-1)
else:
	print(''.join(s))


import bisect
from itertools import accumulate
import os
import sys
import math
from decimal import *
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
(n, k) = map(int, input().split())
s = input()
ans = ''
c = k
for i in range(0, len(s)):
	x = ord(s[i])
	c = min(k, max(122 - x, x - 97))
	k -= c
	if c + x > 122:
		ans += chr(x - c)
	else:
		ans += chr(x + c)
if k == 0:
	print(ans)
else:
	print(-1)


(n, k) = list(map(int, input().strip().split()))
s = str(input())
maxdist = {'a': 25, 'b': 24, 'c': 23, 'd': 22, 'e': 21, 'f': 20, 'g': 19, 'h': 18, 'i': 17, 'j': 16, 'k': 15, 'l': 14, 'm': 13, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
res = []
for i in range(n):
	m = maxdist[s[i]]
	if m <= k:
		if s[i] <= 'm':
			res.append('z')
		else:
			res.append('a')
		k -= m
	elif k > 0:
		if s[i] <= 'm':
			res.append(chr(ord(s[i]) + k))
		else:
			res.append(chr(ord(s[i]) - k))
		k = 0
	else:
		res.append(s[i])
if k == 0:
	print(''.join(res))
else:
	print(-1)


import math

def facts(n):
	ans = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			ans.append(i)
			ans.append(n // i)
	ans = sorted(list(dict.fromkeys(ans)))
	if ans[-1] == n:
		ans = ans[:-1]
	return ans
(n, k) = map(int, input().split())
s = str(input())
cnt = 0
pnt = 0
ans = ''
while k > 0 and pnt < n:
	sub = 0
	dif = ord(s[pnt]) - ord('a')
	sub = max(-dif, -k, -26)
	if dif < 13:
		dif = ord('z') - ord(s[pnt])
		sub = min(dif, k, 26)
	k -= abs(sub)
	ans += chr(ord(s[pnt]) + sub)
	pnt += 1
if k == 0:
	if pnt < n:
		ans += s[pnt:]
	print(ans)
else:
	print(-1)


(a, b) = map(int, input().split())
s = input()
if b / a > 25:
	print(-1)
else:
	ans = ''
	c = 0
	for i in s:
		if b == 0:
			ans += s[c:]
			break
		idx = ord(i) - 97
		if idx >= 13:
			if b > idx:
				ans += 'a'
				b -= idx
			else:
				ans += chr(idx + 97 - b)
				b = 0
		elif b > 25 - idx:
			ans += 'z'
			b -= 25 - idx
		else:
			ans += chr(idx + 97 + b)
			b = 0
		c += 1
	if b == 0:
		print(ans.lower())
	else:
		print(-1)


def read():
	return [int(s) for s in input().split()]

def whichmax(a, b):
	xs = [a, b]
	m = max(xs)
	return (m, xs.index(m))

def dist(c, d):
	return abs(ord(d) - ord(c))
(n, k) = read()
s = input()
tab = [0] * n
for i in range(n):
	(m, j) = whichmax(dist('a', s[i]), dist('z', s[i]))
	if m <= k:
		tab[i] = ['a', 'z'][j]
		k = k - m
	else:
		sign = [-1, 1][j]
		tab[i] = chr(ord(s[i]) + sign * k)
		k = 0
result = ''.join(tab)
print(result if k == 0 else -1)


(n, k) = map(int, input().split())
s = input()
ss = list()
for i in range(len(s)):
	c = ord(s[i]) - 97
	if c > 25 - c:
		m = min(k, c)
		ss.append(chr(c - m + 97))
	else:
		m = min(k, 25 - c)
		ss.append(chr(c + m + 97))
	k -= m
if k > 0:
	print(-1)
else:
	for i in ss:
		print(i, end='')


(s, k) = map(int, input().split())
strin = list(input())
newStr = strin
d = 0
m = ord('m')
a = ord('a')
z = ord('z')
i = 0
while i < s and d < k:
	diff = 0
	c = ord(strin[i])
	if c <= m:
		diff = z - c
	else:
		diff = a - c
	if abs(diff) + d <= k:
		d += abs(diff)
		newStr[i] = chr(c + diff)
	else:
		if c <= m:
			c += k - d
		else:
			c -= k - d
		d += abs(k - d)
		newStr[i] = chr(c)
	i += 1
if d == k:
	print(''.join(newStr))
else:
	print('-1')


def STR():
	return list(input())

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def MAP2():
	return map(float, input().split())

def LIST():
	return list(map(int, input().split()))

def STRING():
	return input()
import string
import sys
from heapq import heappop, heappush
from bisect import *
from collections import deque, Counter, defaultdict
from math import *
from itertools import permutations, accumulate
dx = [-1, 1, 0, 0]
dy = [0, 0, 1, -1]
l = list(string.ascii_lowercase)
d = {}
for i in range(26):
	d[l[i]] = i
(n, k) = MAP()
s = STR()
s2 = ''
for i in range(n):
	x = s[i]
	if k <= 0:
		s2 += x
	else:
		v = []
		mx = -1
		c = ''
		for j in l:
			y = j
			if x != y:
				r = abs(d[x] - d[y])
				if r <= k:
					if r > mx:
						mx = r
						c = y
		s2 += c
		k -= mx
if k > 0:
	print('-1')
else:
	print(''.join(s2))


import sys

def dist(a, b):
	return abs(ord(a[0]) - ord(b[0]))
nums = [int(i) for i in input().split(' ')]
word = input()
word = [c for c in word]
total = nums[1]
if len(word) * 25 < total:
	print('-1')
	sys.exit(0)
for (i, _) in enumerate(word):
	c = word[i]
	dz = dist(c, 'z')
	da = dist(c, 'a')
	if dz > da:
		if total < dz:
			word[i] = chr(ord(c) + total)
			print(''.join(word))
			sys.exit(0)
		else:
			total -= dz
			word[i] = 'z'
	if da > dz:
		if total < da:
			word[i] = chr(ord(c) - total)
			print(''.join(word))
			sys.exit(0)
		else:
			total -= da
			word[i] = 'a'
	if total == 0:
		break
	if total < 0:
		print('SOMETHING HAS GONE HORRIBLY WRONG', total)
if total != 0:
	print('-1')
else:
	print(''.join(word))


(n, k) = map(int, input().split())
s = input()
res = ''
flag = 0
index = 0
for i in range(n):
	x = max(ord(s[i]) - ord('a'), ord('z') - ord(s[i]))
	if x <= k:
		if x == ord(s[i]) - ord('a'):
			res = res + chr(ord(s[i]) - x)
			k = k - x
		elif x == ord('z') - ord(s[i]):
			res = res + chr(ord(s[i]) + x)
			k = k - x
	else:
		if ord(s[i]) + k > 122:
			res = res + chr(ord(s[i]) - k)
		else:
			res = res + chr(ord(s[i]) + k)
		k = 0
	if k == 0:
		flag = 1
		index = i
		break
if flag == 1:
	res = res + s[index + 1:n]
	print(res)
elif k != 0:
	print(-1)
else:
	print(res)


(n, k) = map(int, input().split())
s = input()
new = ''
for i in range(n):
	if k > max(ord(s[i]) - ord('a'), ord('z') - ord(s[i])):
		if ord(s[i]) - ord('a') > ord('z') - ord(s[i]):
			new += 'a'
			k -= ord(s[i]) - ord('a')
		else:
			new += 'z'
			k -= ord('z') - ord(s[i])
	else:
		if chr(ord(s[i]) + k) <= 'z':
			new += chr(ord(s[i]) + k)
		else:
			new += chr(ord(s[i]) - k)
		k = 0
		new += s[i + 1:]
		break
if k == 0:
	print(new)
else:
	print(-1)


letters = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8, 'i': 9, 'j': 10, 'k': 11, 'l': 12, 'm': 13, 'n': 14, 'o': 15, 'p': 16, 'q': 17, 'r': 18, 's': 19, 't': 20, 'u': 21, 'v': 22, 'w': 23, 'x': 24, 'y': 25, 'z': 26}

def dist(string1, string2):
	if len(string1) == len(string2):
		if len(string1) == 1:
			return abs(letters[string1] - letters[string2])
		elif len(string1) > 1:
			letters1 = list(string1)
			letters2 = list(string2)
			sum = 0
			for i in range(0, len(letters1)):
				distance = dist(letters1[i], letters2[i])
				sum += distance
			return sum

def find_string(n, k, string1):
	nums = {1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h', 9: 'i', 10: 'j', 11: 'k', 12: 'l', 13: 'm', 14: 'n', 15: 'o', 16: 'p', 17: 'q', 18: 'r', 19: 's', 20: 't', 21: 'u', 22: 'v', 23: 'w', 24: 'x', 25: 'y', 26: 'z'}
	string1 = [item for item in string1]
	for i in range(0, n):
		dist1 = letters['z'] - letters[string1[i]]
		dist2 = letters[string1[i]] - letters['a']
		if dist1 > dist2:
			if k < dist1:
				dist1 = k
			D = letters[string1[i]] + dist1
			L = nums[D]
			string1[i] = L
			k -= dist1
		else:
			if k < dist2:
				dist2 = k
			D = letters[string1[i]] - dist2
			L = nums[D]
			string1[i] = L
			k -= dist2
		if not k:
			break
	if k > 0:
		print(-1)
	else:
		word = ''.join(string1)
		print(word)

def main():
	(n, k) = map(int, input().split())
	string1 = input()
	find_string(n, k, string1)
main()


(n, k) = map(int, input().split())
s = input()
ans = ''
for j in range(n):
	a = ord(s[j]) - 97
	z = 25 - a
	if a > z:
		v = min(a, k)
		ans += chr(ord(s[j]) - v)
		k -= v
	else:
		v = min(z, k)
		ans += chr(ord(s[j]) + v)
		k -= v
print(ans if k == 0 else -1)


def mp():
	return map(int, input().split())

def lt():
	return list(map(int, input().split()))

def pt(x):
	print(x)

def ip():
	return input()

def it():
	return int(input())

def sl(x):
	return [t for t in x]

def spl(x):
	return x.split()

def aj(liste, item):
	liste.append(item)

def bin(x):
	return '{0:b}'.format(x)

def listring(l):
	return ' '.join([str(x) for x in l])

def printlist(l):
	print(' '.join([str(x) for x in l]))
(n, k) = mp()
s = ip()
i = 0
result = ''
while k > 0:
	if i == n:
		break
	t = ord(s[i])
	if t >= 110:
		if k < t - 97:
			result += chr(t - k)
			k = 0
		else:
			result += 'a'
			k -= t - 97
	elif k < 122 - t:
		result += chr(t + k)
		k = 0
	else:
		k -= 122 - t
		result += 'z'
	i += 1
if k != 0:
	print(-1)
else:
	m = n - len(result)
	for i in range(m):
		result += s[n - m + i]
	print(result)


(n, k) = input().split()
n = int(n)
k = int(k)
s = input()
ans = ''
hasAnswer = False
for i in range(n):
	if k == 0:
		hasAnswer = True
		break
	m = ord(s[i])
	if m <= 109:
		if k >= 122 - m:
			k -= 122 - m
			ans += 'z'
		else:
			if m + k < 122:
				ans += chr(m + k)
			else:
				ans += chr(m - k)
			hasAnswer = True
			break
	if m >= 110:
		if k >= m - 97:
			k -= m - 97
			ans += 'a'
		else:
			if m + k < 122:
				ans += chr(m + k)
			else:
				ans += chr(m - k)
			hasAnswer = True
			break
if hasAnswer or k == 0:
	print(ans + s[len(ans):])
else:
	print(-1)


(n, k) = list(map(int, input().split()))
s = input()
ans = []
for i in range(len(s)):
	if k > 0:
		da = ord(s[i]) - ord('a')
		dz = ord('z') - ord(s[i])
		if k == da:
			ans.append('a')
			k -= da
		elif k == dz:
			ans.append('z')
			k -= dz
		elif k > dz and k > da:
			if dz > da:
				ans.append('z')
				k -= dz
			else:
				ans.append('a')
				k -= da
		elif k < da:
			ans.append(chr(ord(s[i]) - k))
			k = 0
		elif k < dz:
			ans.append(chr(ord(s[i]) + k))
			k = 0
	else:
		ans.append(s[i])
if k > 0:
	print(-1)
else:
	print(''.join(ans))


import math
from math import *
(il, k) = map(int, input().split(' '))
s = input()
s2 = ''
for i in range(len(s)):
	l = ord(s[i]) - ord('a')
	r = ord('z') - ord(s[i])
	m = max(l, r)
	if k >= m:
		k -= m
		if l > r:
			s2 += chr(ord(s[i]) - l)
		else:
			s2 += chr(ord(s[i]) + r)
	elif k == 0:
		s2 += s[i]
	else:
		if l > r:
			s2 += chr(ord(s[i]) - k)
		else:
			s2 += chr(ord(s[i]) + k)
		k = 0
if k > 0:
	print(-1)
else:
	print(s2)


(n, k) = map(int, input().split())
s = input()
pzbl = []
for i in range(n):
	pzbl.append(max(ord(s[i]) - 97, 122 - ord(s[i])))
if k > sum(pzbl):
	print(-1)
else:
	ans = ''
	req = k
	for i in range(n):
		if req == 0:
			ans += s[i]
		elif req >= pzbl[i]:
			req -= pzbl[i]
			if 122 - ord(s[i]) > ord(s[i]) - 97:
				ans += 'z'
			else:
				ans += 'a'
		elif req < pzbl[i]:
			c = req
			req = 0
			if ord(s[i]) + c <= 122:
				ans += chr(ord(s[i]) + c)
			elif ord(s[i]) - c >= 97:
				ans += chr(ord(s[i]) - c)
	print(ans)


(n, k) = list(map(int, input().split()))
s = input()
s1 = [s[i] for i in range(n)]
i = 0
while k > 0 and i < n:
	c = ord(s[i])
	d1 = abs(ord('a') - c)
	d2 = abs(ord('z') - c)
	if k >= d1 >= d2:
		s1[i] = 'a'
	elif k >= d2 >= d1:
		s1[i] = 'z'
	elif c - k >= ord('a'):
		s1[i] = chr(c - k)
	else:
		s1[i] = chr(c + k)
	i += 1
	k -= max(d1, d2)
if k > 0:
	ans = -1
else:
	ans = ''.join(map(str, s1))
print(ans)


(n, k) = map(int, input().split())
s = input()
ans = ''
c = k
for i in range(0, len(s)):
	x = ord(s[i])
	c = min(k, max(122 - x, x - 97))
	k -= c
	if c + x > 122:
		ans += chr(x - c)
	else:
		ans += chr(x + c)
if k == 0:
	print(ans)
else:
	print(-1)


(n, k) = list(map(int, input().split()))
s = list(input())
f = lambda x: ord(x) - ord('a') + 1
alphabets = list('abcdefghijklmnopqrstuvwxyz')
memo = {i + 1: alphabets[i] for i in range(26)}
for i in range(n):
	char = s[i]
	if f(char) > 13:
		far = 'a'
	else:
		far = 'z'
	left = k - abs(f(char) - f(far))
	if left < 0:
		if f(char) > 13:
			s[i] = memo[f(char) - k]
		else:
			s[i] = memo[f(char) + k]
		k = 0
		break
	else:
		s[i] = far
		k = left
if k == 0:
	print(''.join(s))
else:
	print(-1)


from sys import stdin, stdout
(a, b) = map(int, stdin.readline().split())
c = stdin.readline()
z = list(c)
for i in range(a):
	x = ord(c[i])
	k = min(b, max(x - 97, 122 - x))
	b -= k
	if x + k <= 122:
		z[i] = chr(x + k)
	else:
		z[i] = chr(x - k)
if b:
	stdout.write('-1')
else:
	stdout.write(''.join(z))


import sys
(n, k) = map(int, sys.stdin.readline().split())
s = sys.stdin.readline().strip()
ans = ''
for i in s:
	a = ord('z') - ord(i)
	b = ord(i) - ord('a')
	if k == 0:
		ans += i
		continue
	if a >= b:
		if a >= k:
			ans += chr(ord(i) + k)
			k = 0
		else:
			ans += 'z'
			k = k - a
	elif b >= k:
		ans += chr(ord(i) - k)
		k = 0
	else:
		ans += 'a'
		k = k - b
if k == 0:
	print(ans)
else:
	print(-1)


(n, k) = map(int, input().split())
s = input()

def main(n, k, s):
	maxi = 0
	for i in range(len(s)):
		g1 = ord(s[i]) - ord('a')
		g2 = ord('z') - ord(s[i])
		maxi += max(g1, g2)
	if maxi < k:
		print(-1)
	else:
		for i in range(len(s)):
			g1 = ord(s[i]) - ord('a')
			g2 = ord('z') - ord(s[i])
			if max(g1, g2) <= k:
				k -= max(g1, g2)
				if ord(s[i]) - ord('a') > ord('z') - ord(s[i]):
					print('a', end='')
				else:
					print('z', end='')
			else:
				if 'a' <= chr(ord(s[i]) + k) <= 'z':
					print(chr(ord(s[i]) + k), end='')
				else:
					print(chr(ord(s[i]) - k), end='')
				k = 0
main(n, k, s)


(n, k) = map(int, input().split())
s = list(input())

def dist(a, b):
	return abs(ord(a) - ord(b))
for i in range(n):
	if k > 0:
		(dz, da) = (dist(s[i], 'z'), dist(s[i], 'a'))
		if dz > da:
			s[i] = chr(min(ord('z'), ord(s[i]) + k))
			k -= dz
		else:
			s[i] = chr(max(ord('a'), ord(s[i]) - k))
			k -= da
print(-1 if k > 0 else ''.join(s))


(n, k) = map(int, input().split())
s = input()
s1 = []
for char in s:
	if k < ord('z') - ord(char):
		s1.append(chr(ord(char) + k))
		k = 0
	elif k < ord(char) - ord('a'):
		s1.append(chr(ord(char) - k))
		k = 0
	else:
		if ord('z') - ord(char) > ord(char) - ord('a'):
			s1.append('z')
		else:
			s1.append('a')
		k -= max(ord('z') - ord(char), ord(char) - ord('a'))
if k == 0:
	print(''.join(s1))
else:
	print(-1)


(n, k) = map(int, input().split())
s = input()
alth = 'abcdefghijklmnopqrstuvwxyz'
num2 = 0
s2 = ''
for i in s:
	num2 = alth.find(i)
	if k == 0:
		s2 += i
	elif num2 > 12:
		num3 = min(num2, k)
		s2 += alth[num2 - num3]
		k -= num3
	else:
		num3 = min(25 - num2, k)
		s2 += alth[num2 + num3]
		k -= num3
if k > 0:
	print(-1)
else:
	print(s2)


(n, k) = map(int, input().split())
s = input()
l = ''
for letter in s:
	if letter < 'n':
		k -= 25 - ord(letter) % 97
		if k <= 0:
			l += chr(122 + k)
			break
		l += 'z'
	else:
		k -= ord(letter) % 97
		if k <= 0:
			l += chr(97 - k)
			break
		l += 'a'
if k > 0:
	print(-1)
else:
	l += s[len(l):]
	print(l)


(n, k) = input().split()
n = int(n)
k = int(k)
str0 = input()
list0 = []
for each in str0:
	list0.append(ord(each) - ord('a') + 1)
res = ''
for each in list0:
	if each > 13.5:
		k -= each - 1
		if k >= 0:
			res += 'a'
		elif k + each - 1 > 0:
			res += chr(each - (k + each - 1) + ord('a') - 1)
		else:
			res += chr(each + ord('a') - 1)
	else:
		k -= 26 - each
		if k >= 0:
			res += 'z'
		elif k + 26 - each > 0:
			res += chr(ord('a') - 1 + each + k + 26 - each)
		else:
			res += chr(ord('a') + each - 1)
if k > 0:
	print(-1)
else:
	print(res)


import sys
max_dist = [0] * 26
dist = [['*'] * 26 for _ in range(26)]
for cc in range(26):
	max_dist[cc] = max(cc, 25 - cc)
	for i in range(max_dist[cc] + 1):
		dist[cc][i] = chr(cc - i + 97) if cc >= i else chr(cc + i + 97)
(n, k) = map(int, sys.stdin.buffer.readline().decode('utf-8').split())
s = sys.stdin.buffer.readline().decode('utf-8').rstrip()
ans = [''] * n
for (i, cc) in enumerate(map(ord, s)):
	d = min(k, max_dist[cc - 97])
	ans[i] = dist[cc - 97][d]
	k -= d
if k:
	print(-1)
else:
	sys.stdout.buffer.write(''.join(ans).encode('utf-8'))


def val(k):
	i = ord(k)
	if abs(97 - i) > 122 - i:
		return 97 - i
	return 122 - i
(inf, n) = input().split()
string = input()
ans = ''
k = int(n)
i = 0
while k > 0 and i < len(string):
	p = val(string[i])
	v = p
	if abs(v) > k:
		v = k
		if p < 0:
			v = -k
	ans = ans + chr(ord(string[i]) + v)
	k = k - abs(v)
	i = i + 1
ans = ans + string[i:]
if k > 0:
	print(-1)
else:
	print(ans)


def main():
	(n, k) = map(int, input().split())
	l = list(input())
	for (i, c) in enumerate(l):
		x = ord(c)
		if x < 110:
			if k + x < 123:
				l[i] = chr(x + k)
				break
			l[i] = 'z'
			k -= 122 - x
		else:
			if x - k > 96:
				l[i] = chr(x - k)
				break
			l[i] = 'a'
			k -= x - 97
	else:
		print(-1)
		return
	print(''.join(l))
main()


alph = 'abcdefghijklmnopqrstuvwxyz'
(n, k) = map(int, input().split())
s = input()
res = ''
for c in s:
	if k > 0:
		r = ord('z') - ord(c)
		l = ord(c) - ord('a')
		if r >= l:
			if k >= r:
				res += 'z'
				k -= r
			else:
				res += chr(ord(c) + k)
				k = 0
		elif k >= l:
			res += 'a'
			k -= l
		else:
			res += chr(ord(c) - k)
			k = 0
	else:
		res += c
print(res if k == 0 else -1)


import sys
(n, k) = map(int, input().split())
str = input()
a = list((max(int(ord(c) - ord('a')), int(ord('z') - ord(c))) for c in str))

def isalpha(x):
	return 'a' <= x and x <= 'z'
if sum(a) < k:
	print(-1)
	exit()
for i in range(len(str)):
	if k >= a[i]:
		print('a' if int(ord(str[i]) - ord('a')) == a[i] else 'z', end='')
		k -= a[i]
	else:
		print(chr(ord(str[i]) - k) if isalpha(chr(ord(str[i]) - k)) else chr(ord(str[i]) + k), end='')
		k = 0


(n, k) = map(int, input().split())
s = input()
ans = ''
for i in s:
	a = ord('z') - ord(i)
	b = ord(i) - ord('a')
	if k == 0:
		ans += i
		continue
	if a >= b:
		if a >= k:
			ans += chr(ord(i) + k)
			k = 0
		else:
			ans += 'z'
			k = k - a
	elif b >= k:
		ans += chr(ord(i) - k)
		k = 0
	else:
		ans += 'a'
		k = k - b
if k == 0:
	print(ans)
else:
	print(-1)


import sys
(n, k) = map(int, input().split())
line = list(input())
for i in range(n):
	if ord('z') - ord(line[i]) >= ord(line[i]) - ord('a'):
		s = ord('z') - ord(line[i])
		if s >= k:
			line[i] = chr(ord(line[i]) + k)
			print(''.join(line))
			sys.exit()
		else:
			line[i] = 'z'
			k -= s
	else:
		s = ord(line[i]) - ord('a')
		if s >= k:
			line[i] = chr(ord(line[i]) - k)
			print(''.join(line))
			sys.exit()
		else:
			line[i] = 'a'
			k -= s
print(-1)


import sys
l = list(map(int, input().split()))
n = l[0]
k = l[1]
s = list(input())
l = [0] * n
p = 0
for i in range(n):
	l[i] = [max(abs(ord('z') - ord(s[i])), abs(ord('a') - ord(s[i]))), i, 'a']
	if abs(ord('z') - ord(s[i])) > abs(ord('a') - ord(s[i])):
		l[i][2] = 'z'
	p += l[i][0]
if k > p:
	print(-1)
	sys.exit()
else:
	c = 0
	l.sort(reverse=True)
	h = [0] * n
	while k != 0:
		if l[c][0] >= k:
			h[c] = k
			k = 0
		else:
			h[c] = l[c][0]
			k -= h[c]
			c += 1
for i in range(c + 1):
	if l[i][2] == 'z':
		k = ord(s[l[i][1]])
		k += h[i]
		s[l[i][1]] = chr(k)
	else:
		k = ord(s[l[i][1]])
		k -= h[i]
		s[l[i][1]] = chr(k)
st = ''.join(s)
print(st)


(n, k) = map(int, input().split())
s = list(input())
d = 0
for i in range(len(s)):
	if s[i] <= 'm':
		p = min(k, ord('z') - ord(s[i]))
		s[i] = chr(ord(s[i]) + p)
		k -= p
	else:
		q = min(k, ord(s[i]) - ord('a'))
		s[i] = chr(ord(s[i]) - q)
		k -= q
print(-1 if k > 0 else ''.join(s))


(n, k) = map(int, input().split())
st = input()
ans = ''
i = 0
while i < n and k > 0:
	if abs(ord(st[i]) - 97) > abs(ord(st[i]) - 122):
		ans += chr(max(97, ord(st[i]) - k))
		k -= ord(st[i]) - ord(ans[-1])
	else:
		ans += chr(min(122, ord(st[i]) + k))
		k -= ord(ans[-1]) - ord(st[i])
	i += 1
if k == 0:
	print(ans + st[i:])
else:
	print(-1)


(n, k) = map(int, input().split())
s = input()
r = ''
for i in range(len(s)):
	if k != 0:
		ch = ord(s[i])
		if abs(97 - ch) > abs(122 - ch):
			if ord(s[i]) - k < 97:
				r += 'a'
				k -= abs(97 - ord(s[i]))
			else:
				x = ord(s[i]) - k
				r += chr(x)
				k -= abs(ord(s[i]) - x)
		elif ord(s[i]) + k > 122:
			r += 'z'
			k -= 122 - ord(s[i])
		else:
			x = ord(s[i]) + k
			r += chr(x)
			k -= abs(ord(s[i]) - x)
	else:
		r += s[i]
if k > 0:
	print(-1)
else:
	print(r)


[n, k] = input().split(' ')
s = input()
ss = ''
n = int(n)
k = int(k)
MaxD = [[0, 0]] * n
SumMaxD = 0
SumMinD = 0
for i in list(range(0, n)):
	xl = -97 + ord(s[i])
	xh = 122 - ord(s[i])
	if xl > xh:
		MaxD[i] = [xl, -1]
		SumMaxD = SumMaxD + xl
	else:
		MaxD[i] = [xh, 1]
		SumMaxD = SumMaxD + xh
if SumMaxD < k:
	print(-1)
else:
	for i in range(0, n):
		if MaxD[i][0] < k:
			ss = ss + chr(ord(s[i]) + MaxD[i][0] * MaxD[i][1])
			k = k - MaxD[i][0]
		else:
			ss = ss + chr(ord(s[i]) + k * MaxD[i][1])
			k = 0
print(ss)


import sys
import bisect
from bisect import bisect_left as lb
input_ = lambda : sys.stdin.readline().strip('\r\n')
from math import log
from math import gcd
from math import atan2, acos
from random import randint
sa = lambda : input_()
sb = lambda : int(input_())
sc = lambda : input_().split()
sd = lambda : list(map(int, input_().split()))
se = lambda : float(input_())
sf = lambda : list(input_())
flsh = lambda : sys.stdout.flush()
mod = 10 ** 9 + 7
gp = []
cost = []
dp = []
mx = []
ans1 = []
ans2 = []
special = []
specnode = []
a = 0
kthpar = []

def dfs(root, par):
	if par != -1:
		dp[root] = dp[par] + 1
	for i in range(1, 20):
		if kthpar[root][i - 1] != -1:
			kthpar[root][i] = kthpar[kthpar[root][i - 1]][i - 1]
	for child in gp[root]:
		if child == par:
			continue
		kthpar[child][0] = root
		dfs(child, root)

def hnbhai():
	(n, k) = sd()
	s = list(sa())
	tot = []
	for i in range(n):
		tot.append((s[i], i))
	tot.sort()
	ans = [''] * n
	temp = k
	for (e, i) in tot:
		diff1 = abs(ord(e) - ord('a'))
		diff2 = abs(ord(e) - ord('z'))
		if diff1 > diff2:
			ans[i] = chr(-min(diff1, temp) + ord(e))
			temp -= min(diff1, temp)
		else:
			ans[i] = chr(min(diff2, temp) + ord(e))
			temp -= min(diff2, temp)
	if temp > 0:
		print(-1)
		return
	print(''.join(ans))
for _ in range(1):
	hnbhai()


(n, k) = map(int, input().split())
s = input()
a_code = ord('a')
z_code = ord('z')
if k == 0:
	print(s)
else:
	s1 = ''
	i = 0
	while k != 0 and i < n:
		letter_code = ord(s[i])
		a_distantion = letter_code - a_code
		z_distantion = z_code - letter_code
		if k < a_distantion and k < z_distantion:
			s1 += chr(letter_code + k)
			k = 0
		elif a_distantion > z_distantion:
			if k >= a_distantion:
				s1 += 'a'
				k -= a_distantion
			else:
				s1 += chr(letter_code - k)
				k = 0
		elif k >= z_distantion:
			s1 += 'z'
			k -= z_distantion
		else:
			s1 += chr(letter_code + k)
			k = 0
		i += 1
	if i != n:
		s1 += s[i:]
	if k == 0:
		print(s1)
	else:
		print(-1)


import sys
input = sys.stdin.readline
(n, k) = map(int, input().split())
s = list(input().rstrip())
(mi, ma) = (0, 0)
for i in s:
	j = ord(i) - 97
	ma += max(j, 25 - j)
if not k <= ma:
	ans = -1
	print(ans)
	exit()
ans = []
for i in s:
	j = ord(i) - 97
	if j < 13:
		m = min(25 - j, k)
		j += m
		k -= m
	else:
		m = min(j, k)
		j -= m
		k -= m
	ans.append(chr(j + 97))
print(''.join(ans))


(_, k) = list(map(int, input().split(' ')))
s = input()
ans = list(s)
for i in range(len(ans)):
	temp = max(abs(ord(ans[i]) - ord('z')), abs(ord(ans[i]) - ord('a')))
	if k >= temp:
		k -= temp
	else:
		temp = k
		k = 0
	jp = chr(ord(ans[i]) + temp)
	jm = chr(ord(ans[i]) - temp)
	ans[i] = jp if ord(jp) <= ord('z') else jm
	if k == 0:
		break
if k == 0:
	print(''.join(ans))
else:
	print(-1)


def check(s, k):
	ans = 0
	for i in range(len(s)):
		ans += abs(ord(s[i]) - ord(k[i]))
	return ans
(n, k) = list(map(int, input().split()))
s = input()
cnt = 0
for i in s:
	cnt += max(ord('z') - ord(i), ord(i) - ord('a'))
if k > cnt:
	print(-1)
	return
else:
	ans = ''
	cr = 0
	while k != 0:
		ps1 = ord(s[cr]) - ord('a')
		ps2 = ord('z') - ord(s[cr])
		if ps1 > k:
			ans += chr(ord(s[cr]) - k)
			k = 0
		elif ps2 > k:
			ans += chr(ord(s[cr]) + k)
			k = 0
		elif ps2 >= ps1:
			ans += 'z'
			k -= ps2
		else:
			ans += 'a'
			k -= ps1
		cr += 1
ans += s[len(ans):]
print(ans)


(N, K) = map(int, input().split())
S = input()
dmax = [0 for _ in range(N)]
for i in range(N):
	dmax[i] = max(abs(ord(S[i]) - 97), abs(25 - ord(S[i]) + 97))
dsum = sum(dmax)
if dsum < K:
	print(-1)
else:
	j = 0
	for i in range(dsum + 1):
		if dsum == K:
			break
		if dmax[j] == 0:
			j += 1
		dmax[j] -= 1
		dsum -= 1
	res = []
	for i in range(N):
		if ord(S[i]) - 97 + dmax[i] < 26:
			res.append(chr(ord(S[i]) + dmax[i]))
		else:
			res.append(chr(ord(S[i]) - dmax[i]))
	print(''.join(res))


(n, k) = map(int, input().split())
A = input()
max_dist = 0
for i in range(len(A)):
	max_dist += max([ord(A[i]) - ord('a'), ord('z') - ord(A[i])])
result = ''
if k > max_dist:
	result = '-1'
else:
	for i in range(len(A)):
		dist_to_a = ord(A[i]) - ord('a')
		dist_to_z = ord('z') - ord(A[i])
		if dist_to_a > dist_to_z:
			d = min(dist_to_a, k)
			k -= d
			result += chr(ord(A[i]) - d)
		else:
			d = min(dist_to_z, k)
			k -= d
			result += chr(ord(A[i]) + d)
print(result)


(n, k) = map(int, input().split())
s = input()
s = [i for i in s]
for i in range(n):
	a = ord('z') - ord(s[i])
	b = ord(s[i]) - ord('a')
	if a > b:
		if k < a:
			a = k
		s[i] = chr(ord(s[i]) + a)
		k -= a
	else:
		if k < b:
			b = k
		s[i] = chr(ord(s[i]) - b)
		k -= b
	if not k:
		break
if k > 0:
	print(-1)
else:
	s = ''.join(s)
	print(s)


def char_dist(a, b):
	d = ord(a) - ord(b)
	if d < 0:
		d = -d
	return d

def mutate_char(c, delta):
	return chr(ord(c) + delta)

def max_mutate_char(c, max_dist):
	dist2a = char_dist(c, 'a')
	dist2z = char_dist(c, 'z')
	if dist2z > dist2a:
		delta = min(dist2z, max_dist)
		absdelta = delta
	else:
		delta = -min(dist2a, max_dist)
		absdelta = -delta
	return (mutate_char(c, delta), absdelta)

def main():
	(n, k) = [int(i) for i in input().split()]
	s = input()
	new_s = []
	need_mutation = True
	for c in s:
		if need_mutation:
			(new_c, delta) = max_mutate_char(c, k)
			k -= delta
			if k <= 0:
				need_mutation = False
		else:
			new_c = c
		new_s.append(new_c)
	if need_mutation:
		print(-1)
	else:
		print(''.join(new_s))
main()


import sys

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline().strip('\n')
hh = 'abcdefghijklmnopqrstuvwxyz'
(n, k) = map(int, input().split())
s = input()
ans = []
for i in range(n):
	if k != 0:
		if ord(s[i]) - 97 > 122 - ord(s[i]):
			x = ord(s[i]) - 97
			if k >= x:
				ans.append(hh[x - hh.find(s[i])])
				k -= x
			else:
				ans.append(hh[hh.find(s[i]) - k])
				k = 0
		else:
			x = 122 - ord(s[i])
			if k >= x:
				ans.append(hh[x + hh.find(s[i])])
				k -= x
			else:
				ans.append(hh[hh.find(s[i]) + k])
				k = 0
	else:
		ans.append(s[i])
if k == 0:
	print(*ans, sep='')
else:
	print(-1)


(n, k) = map(int, input().split())
s = list(input())
flag = 0
for i in range(n):
	(x, y) = (ord('z') - ord(s[i]), ord(s[i]) - ord('a'))
	if x > y:
		if x > k:
			x = k
		s[i] = chr(x + ord(s[i]))
		k -= x
	else:
		if y > k:
			y = k
		s[i] = chr(ord(s[i]) - y)
		k -= y
	if k == 0:
		print(''.join(s))
		break
else:
	print(-1)


(n, k) = map(int, input().split())
s = [i for i in input()]
for i in range(n):
	if ord('z') - ord(s[i]) >= ord(s[i]) - ord('a'):
		q = min(k, ord('z') - ord(s[i]))
		k -= q
		s[i] = chr(ord(s[i]) + q)
	else:
		q = min(k, ord(s[i]) - ord('a'))
		k -= q
		s[i] = chr(ord(s[i]) - q)
if k > 0:
	print(-1)
else:
	print(''.join(s))


import collections
import math
(n, k) = map(int, input().split())
s = input()
ss = []
t = 0
for i in range(len(s)):
	t += max(abs(ord('a') - ord(s[i])), abs(ord('z') - ord(s[i])))
if k > t:
	print(-1)
	exit(0)
else:
	for i in range(len(s)):
		if k == 0:
			ss.append(s[i])
			continue
		(x, y) = (abs(ord('a') - ord(s[i])), abs(ord('z') - ord(s[i])))
		if x >= y:
			if k >= x:
				ss.append('a')
				k -= x
			else:
				ss.append(chr(ord(s[i]) - k))
				k = 0
		elif k >= y:
			ss.append('z')
			k -= y
		else:
			ss.append(chr(ord(s[i]) + k))
			k = 0
print(''.join(ss))


p = input().rstrip().split(' ')
s = input().rstrip()
x = list(s)
W = int(p[1])
l = []
for i in range(0, len(x)):
	if W == 0:
		l.append(x[i])
	else:
		t = abs(ord(x[i]) - ord('z'))
		T = abs(ord(x[i]) - ord('a'))
		if t >= T:
			if t <= W:
				l.append('z')
				W = W - t
			else:
				F = chr(ord(x[i]) + W)
				W = 0
				l.append(F)
		elif T <= W:
			l.append('a')
			W = W - T
		else:
			F = chr(ord(x[i]) - W)
			W = 0
			l.append(F)
if W != 0:
	print(-1)
else:
	C = ''.join(l)
	print(C)


from collections import deque as de
import math
from math import sqrt as sq
from math import floor as fl
from math import ceil as ce
from sys import stdin, stdout
import re
from collections import Counter as cnt
from functools import reduce
from itertools import groupby as gb
from bisect import bisect_left as bl, bisect_right as br

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

class My_stack:

	def __init__(self):
		self.data = []

	def my_push(self, x):
		return self.data.append(x)

	def my_pop(self):
		return self.data.pop()

	def my_peak(self):
		return self.data[-1]

	def my_contains(self, x):
		return self.data.count(x)

	def my_show_all(self):
		return self.data

	def isEmpty(self):
		return len(self.data) == 0
arrStack = My_stack()

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def binarytodecimal(n):
	return int(n, 2)

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def get_prime_factors(number):
	prime_factors = []
	while number % 2 == 0:
		prime_factors.append(2)
		number = number / 2
	for i in range(3, int(math.sqrt(number)) + 1, 2):
		while number % i == 0:
			prime_factors.append(int(i))
			number = number / i
	if number > 2:
		prime_factors.append(int(number))
	return prime_factors

def get_frequency(list):
	dic = {}
	for ele in list:
		if ele in dic:
			dic[ele] += 1
		else:
			dic[ele] = 1
	return dic

def Log2(x):
	return math.log10(x) / math.log10(2)

def getProduct(n):
	product = 1
	while n != 0:
		product = product * (n % 10)
		n = n // 10
	return product

def lcm(x, y):
	lcm = x * y // math.gcd(x, y)
	return lcm

def isPowerOfTwo(n):
	return math.ceil(Log2(n)) == math.floor(Log2(n))

def checkisap(list):
	d = list[1] - list[0]
	for i in range(2, len(list)):
		temp = list[i] - list[i - 1]
		if temp != d:
			return False
	return True

def primes_method5(n):
	out = {}
	sieve = [True] * (n + 1)
	for p in range(2, n + 1):
		if sieve[p]:
			out[p] = 1
			for i in range(p, n + 1, p):
				sieve[i] = False
	return out

def ceildiv(x, y):
	return (x + y - 1) // y

def di():
	return map(int, input().split())

def ii():
	return int(input())

def li():
	return list(map(int, input().split()))

def si():
	return list(map(str, input()))

def indict():
	dic = {}
	for (index, value) in enumerate(input().split()):
		dic[int(value)] = int(index) + 1
	return dic

def frqdict():
	dic = {}
	for (index, value) in enumerate(input()):
		if value not in dic:
			dic[value] = 1
		else:
			dic[value] += 1
	return dic
(n, k) = di()
s = si()
dic1 = {1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h', 9: 'i', 10: 'j', 11: 'k', 12: 'l', 13: 'm', 14: 'n', 15: 'o', 16: 'p', 17: 'q', 18: 'r', 19: 's', 20: 't', 21: 'u', 22: 'v', 23: 'w', 24: 'x', 25: 'y', 26: 'z'}
dic2 = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8, 'i': 9, 'j': 10, 'k': 11, 'l': 12, 'm': 13, 'n': 14, 'o': 15, 'p': 16, 'q': 17, 'r': 18, 's': 19, 't': 20, 'u': 21, 'v': 22, 'w': 23, 'x': 24, 'y': 25, 'z': 26}
if k == 0:
	print(*s, sep='')
else:
	ans = ''
	ch = 1
	for i in range(n):
		if ch:
			temp1 = abs(1 - dic2[s[i]])
			temp2 = abs(26 - dic2[s[i]])
			mx = max(temp1, temp2)
			mn = min(k, mx)
			if mn == k:
				ch = 0
				if dic2[s[i]] + k <= 26:
					ans += dic1[dic2[s[i]] + k]
				else:
					ans += dic1[dic2[s[i]] - k]
			else:
				if mx == temp1:
					ans += 'a'
				else:
					ans += 'z'
				k -= mx
		else:
			ans += s[i]
	if ch:
		print(-1)
	else:
		print(ans)


(a, b) = map(int, input().split())
str1 = input()
str2 = ''
for i in range(0, a):
	x = ord(str1[i])
	x = x - 97
	if x <= 12:
		z = min(25 - x, b)
		zz = x + z + 97
		str3 = chr(zz)
		str2 = str2[0:] + str3[0:]
		b = b - z
	else:
		z = min(x - 0, b)
		zz = x - z + 97
		str3 = chr(zz)
		str2 = str2[0:] + str3[0:]
		b = b - z
if b > 0:
	print(-1)
else:
	print(str2)


(n, k) = map(int, input().split())
s = input()
pt = 0
for x in s:
	pt += max(abs(122 - ord(x)), abs(97 - ord(x)))
if pt < k:
	print(-1)
	exit()
ans = ''
i = 0
while i < n and k > 0:
	x = s[i]
	ord_x = ord(x)
	diff = max(abs(122 - ord_x), abs(97 - ord_x))
	q = min(k, diff)
	k -= q
	if ord_x + q <= 122:
		ans += chr(ord_x + q)
	else:
		ans += chr(ord_x - q)
	i += 1
ans += s[i:n]
print(ans)


(n, k) = map(int, input().strip().split(' '))
s = input()
s = list(s)
l = ''
if k > 25 * n:
	print(-1)
else:
	for j in range(n):
		c1 = ord(s[j]) - ord('a')
		c2 = ord('z') - ord(s[j])
		if k == 0:
			l += s[j]
		elif c1 >= c2:
			if c1 <= k:
				l += 'a'
				k -= c1
			else:
				l += chr(ord(s[j]) - k)
				k = 0
		elif c2 <= k:
			l += 'z'
			k -= c2
		else:
			l += chr(ord(s[j]) + k)
			k = 0
	if k == 0:
		print(l)
	else:
		print(-1)


from string import ascii_lowercase

def read_list():
	return [int(i) for i in input().split()]

def new_list(n):
	return [0 for i in range(n)]

def new_matrix(n, m=0):
	return [[0 for i in range(m)] for i in range(n)]

def index(s):
	return ascii_lowercase.index(s)

def add(s, k):
	return ascii_lowercase[ascii_lowercase.index(s) + k]

def sub(s, k):
	return ascii_lowercase[ascii_lowercase.index(s) - k]
(n, k) = read_list()
s = input()
answ = ''
for i in range(n):
	if k <= 0:
		answ += s[i]
		continue
	j = index(s[i])
	if j <= 12:
		if k > 25 - j:
			answ += 'z'
			k -= 25 - j
		else:
			answ += add(s[i], k)
			k = 0
	elif k > j:
		answ += 'a'
		k -= j
	else:
		answ += sub(s[i], k)
		k = 0
if k > 0:
	print(-1)
else:
	print(answ)


(n, k) = map(int, input().split())
s = input()
a = []
for i in s:
	a.append(ord(i) - 97)
p = ''
for i in range(n):
	c = max(a[i], 25 - a[i])
	if k >= c:
		if a[i] == c:
			p += 'a'
			k -= a[i]
		else:
			p += 'z'
			k -= 25 - a[i]
	else:
		c = min(a[i], 25 - a[i])
		if a[i] == c:
			p += chr(a[i] + k + 97)
			k = 0
		else:
			p += chr(a[i] - k + 97)
			k = 0
if k > 0:
	print(-1)
else:
	print(p)


(n, k) = map(int, input().split(' '))
s = list(input())
if k <= n:
	for i in range(k):
		s[i] = chr(ord(s[i]) - 1) if s[i] != 'a' else chr(ord(s[i]) + 1)
	print(''.join(s))
else:
	acc = 0
	for i in range(n):
		if ord(s[i]) <= ord('m'):
			if k - acc <= ord('z') - ord(s[i]):
				s[i] = chr(ord(s[i]) + k - acc)
				acc = k
			else:
				acc += ord('z') - ord(s[i])
				s[i] = 'z'
		elif k - acc <= ord(s[i]) - ord('a'):
			s[i] = chr(ord(s[i]) - k + acc)
			acc = k
		else:
			acc += ord(s[i]) - ord('a')
			s[i] = 'a'
	if acc < k:
		print(-1)
	else:
		print(''.join(s))


(n, k) = [int(x) for x in input().split()]
s = input()
D = [('a', ord(c) - 97) if ord(c) > 109 else ('z', 122 - ord(c)) for c in s]
maxdist = sum((d[1] for d in D))
if k > maxdist:
	print(-1)
else:
	(t, q) = (0, k)
	while q > 0:
		q -= D[t][1]
		t += 1
	ans = ''.join((D[i][0] for i in range(t - 1))) + (chr(122 + q) if D[t - 1][0] == 'z' else chr(97 - q)) + s[t:]
	print(ans if t > 0 else s)


from math import *
(n, k) = map(int, input().split())
s = list(input())
maxx = 0
ans = s[:]
for i in range(n):
	if s[i] <= 'm':
		maxx += ord('z') - ord(s[i])
		ans[i] = 'z'
	else:
		maxx += ord(s[i]) - ord('a')
		ans[i] = 'a'
i = 0
while i < n and maxx != k:
	x = ord(ans[i])
	while x != ord(s[i]):
		if ans[i] == 'a':
			x += 1
		else:
			x -= 1
		maxx -= 1
		if maxx == k:
			break
	ans[i] = chr(x)
	i += 1
if maxx != k:
	print(-1)
else:
	print(''.join(ans))


from sys import stdin, stdout

def main():
	(n, k) = map(int, stdin.readline().split())
	s = stdin.readline()
	ans = []
	for i in range(n):
		max_diff1 = ord('z') - ord(s[i])
		max_diff2 = ord(s[i]) - ord('a')
		if max_diff1 > max_diff2:
			max_diff = max_diff1
			max_ch = 'z'
			min_max_diff = max_diff2
			min_max_ch = 'a'
		else:
			max_diff = max_diff2
			max_ch = 'a'
			min_max_diff = max_diff1
			min_max_ch = 'z'
		if k >= max_diff:
			k -= max_diff
			ans.append(max_ch)
		elif k > 0:
			if ord('a') <= ord(s[i]) + k <= ord('z'):
				ans.append(chr(ord(s[i]) + k))
			elif ord('a') <= ord(s[i]) - k <= ord('z'):
				ans.append(chr(ord(s[i]) - k))
			k = 0
		else:
			ans.append(s[i])
	if k > 0:
		stdout.write('-1\n')
	else:
		stdout.write(''.join(ans))
		stdout.write('\n')
main()


(n, size) = map(int, input().split())
s = input()
ans = []
for f in s:
	if ord(f) - ord('a') > ord('z') - ord(f) and ord(f) - ord('a') < size:
		ans.append('a')
		size -= ord(f) - ord('a')
	elif ord('z') - ord(f) > ord(f) - ord('a') and ord('z') - ord(f) < size:
		ans.append('z')
		size -= ord('z') - ord(f)
	elif ord(f) - ord('a') >= size:
		ans.append(chr(ord(f) - size))
		size = 0
		break
	else:
		ans.append(chr(ord(f) + size))
		size = 0
		break
if size:
	print('-1')
else:
	ans.extend(s[len(ans):])
	print(''.join(ans))


nums = input().split()
n = int(nums[0])
k = int(nums[1])
s = input()

def dist(a, b):
	return abs(ord(a) - ord(b))
output = ''
distance = k
for ch in s:
	if distance > max(dist(ch, 'a'), dist(ch, 'z')):
		new_char = 'a' if dist(ch, 'a') > dist(ch, 'z') else 'z'
		distance -= dist(ch, new_char)
		output += new_char
	else:
		new_char = chr(ord(ch) - distance) if dist(ch, 'a') > dist(ch, 'z') else chr(ord(ch) + distance)
		distance -= dist(ch, new_char)
		output += new_char
	if distance == 0:
		break
if distance != 0:
	print(-1)
else:
	d = n - len(output)
	l = len(output)
	if d > 0:
		for i in range(l, l + d):
			output += s[i]
	print(output)


(size, dist) = map(int, input().split())
(userString, alpha) = (input(), 'abcdefghijklmnopqrstuvwxyz')
capt = ''
for x in userString:
	num = ord(x)
	diff = max(122 - num, num - 97)
	if dist == 0:
		capt += x
	elif dist - diff < 0:
		if num - 97 + dist < 26:
			capt += alpha[num - 97 + dist]
		elif num - 97 - dist > -1:
			capt += alpha[num - 97 - dist]
		else:
			print(-1)
			exit()
		dist = 0
	else:
		dist -= diff
		if num - 97 + diff < 26:
			capt += alpha[num - 97 + diff]
		elif num - 97 - diff > -1:
			capt += alpha[num - 97 - diff]
print(capt if not dist else -1)


[n, k] = input().split(' ')
s = input()
s = list(s)
n = int(n)
k = int(k)
SumMaxD = 0
for i in list(range(0, n)):
	xl = -97 + ord(s[i])
	xh = 122 - ord(s[i])
	if xl > xh:
		if xl < k:
			s[i] = chr(ord(s[i]) - xl)
			k = k - xl
		else:
			s[i] = chr(ord(s[i]) - k)
			k = 0
			break
		SumMaxD = SumMaxD + xl
	else:
		if xh < k:
			s[i] = chr(ord(s[i]) + xh)
			k = k - xh
		else:
			s[i] = chr(ord(s[i]) + k)
			k = 0
			break
		SumMaxD = SumMaxD + xh
if k > 0:
	print(-1)
else:
	print(''.join(s))


(n, k) = map(int, input().split())
s = input()
ans = []
for i in range(n):
	x = min(k, max(ord(s[i]) - ord('a'), ord('z') - ord(s[i])))
	k -= x
	if x + ord(s[i]) > ord('z'):
		ans.append(chr(ord(s[i]) - x))
	else:
		ans.append(chr(ord(s[i]) + x))
if k:
	print(-1)
else:
	print(''.join(ans))


import math
a = 'abcdefghijklmnopqrstuvwxyz'
(x, y) = map(int, input().split())
s = input()
ss = str()
for j in range(0, len(s)):
	z = a.find(s[j])
	st = y
	if 25 - z >= z - 0:
		y -= min(25 - z, y)
		z += min(25 - z, st)
		z %= 26
	else:
		y -= min(z - 0, y)
		z -= min(z - 0, st)
		if z < 0:
			z += 26
	ss += a[z]
if y > 0:
	print('-1\n')
else:
	print(ss)


(n, k) = map(int, input().split())
s = input()
ans = ''
for i in range(n):
	left_dist = ord(s[i]) - ord('a')
	right_dist = ord('z') - ord(s[i])
	mn = 0
	if left_dist > right_dist:
		mn = min(left_dist, k)
		ans += chr(ord(s[i]) - mn)
	else:
		mn = min(right_dist, k)
		ans += chr(ord(s[i]) + mn)
	k -= mn
if k:
	print(-1)
else:
	print(ans)


(n, k) = map(int, input().split())
s = input()
ans = []
for x in s:
	da = abs(ord(x) - ord('a'))
	dz = abs(ord(x) - ord('z'))
	if da > dz and da <= k:
		ans.append('a')
		k -= da
	elif dz > da and dz <= k:
		ans.append('z')
		k -= dz
	elif k > 0:
		for y in 'abcdefghijklmnopqrstuvwxyz':
			if abs(ord(y) - ord(x)) == k:
				ans.append(y)
				k = 0
				break
	else:
		ans.append(x)
if k != 0:
	print(-1)
else:
	print(''.join(ans))


import sys
from bisect import bisect_right as rb
from collections import deque
from queue import PriorityQueue
from math import *
input_ = lambda : sys.stdin.readline().strip('\r\n')
ii = lambda : int(input_())
il = lambda : list(map(int, input_().split()))
ilf = lambda : list(map(float, input_().split()))
ip = lambda : input_()
fi = lambda : float(input_())
ap = lambda ab, bc, cd: ab[bc].append(cd)
li = lambda : list(input_())
pr = lambda x: print(x)
prinT = lambda x: print(x)
f = lambda : sys.stdout.flush()
mod = 10 ** 9 + 7
(n, k) = il()
s = li()
ans = []
for i in s:
	if i < 'm':
		mn = min(k, ord('z') - ord(i))
		ans.append(chr(ord(i) + mn))
		k -= mn
	else:
		mn = min(k, ord(i) - ord('a'))
		ans.append(chr(ord(i) - mn))
		k -= mn
if k != 0:
	print(-1)
	exit(0)
print(''.join(ans))