let s = read_line () |> Bytes.of_string in
let k = read_int () in
let n = Bytes.length s in
let aa = int_of_char 'a' in
let rec loop i rest =
    if i = n then print_endline @@ Bytes.to_string s else
        let add = if i = n - 1 then rest else (
            let p = int_of_char (Bytes.get s i) - aa in
            if p = 0 then 0 else
                if rest >= 26 - p then 26 - p else 0
        )
        in
        let p = int_of_char (Bytes.get s i) - aa in
        let p = (p + add) mod 26 in
        let () = Bytes.set s i (char_of_int (p + aa)) in
        loop (i + 1) (rest - add)
in
loop 0 k