let s = read_line ()
let k = ref @@ read_int ()
let f c = Char.(chr @@ (code c - 97 + !k) mod 26 + 97)
let _ = String.(mapi (fun i c -> let d = (123 - Char.code c) mod 26 in if i = length s - 1 then f c else if d < !k then (k := !k - d; 'a') else c) s) |> print_endline