let s = read_line () |> Bytes.of_string
let k = Scanf.sscanf (read_line ()) "%d" @@ fun k -> k

let s_len = Bytes.length s - 1
let a_code = int_of_char 'a'
let z_code = int_of_char 'z'

let rec loop pos res =
  let chr_code = int_of_char (Bytes.get s pos) in
  if pos = s_len then begin
    let chr = char_of_int (a_code + (chr_code - a_code + res) mod 26) in
    Bytes.set s s_len chr;
    print_endline @@ Bytes.to_string s
  end else if chr_code = a_code then loop (pos + 1) res
  else begin
    let t = z_code - chr_code + 1 in
    (* Printf.printf "%d\n" t; *)
    if t <= res then begin
      Bytes.set s pos 'a';
      loop (pos + 1) (res - t)
    end else loop (pos + 1) res
  end

let () = loop 0 k