s = io.read()
k = io.read("*n")
local n = #s
local t = {}
for i = 1, n - 1 do
  local b = s:byte(i) - 97
  if 0 < b then
    local need = 26 - b
    if need <= k then
      b = 0
      k = k - need
    end
  end
  t[i] = b
end
k = k % 26
do
  local b = s:byte(n) - 97
  b = (b + k) % 26
  t[n] = b
end
for i = 1, n do
  io.write(string.char(97 + t[i]))
end
io.write("\n")
