program main
	implicit none
	character(100010) :: s
	integer :: K, i
	
	read(*, *) s
	read(*, *) K
	
	do i = 1, len_trim(s)
		if(K-search(s(i:i)) >= 0) then
			K = K - search(s(i:i))
			s(i:i) ="a"
		end if
	end do
	s(len_trim(s):len_trim(s)) = search_out(mod((26-(search(s(len_trim(s):len_trim(s)))-mod(K,26))),26))
	
	write(*, *) trim(s)
	
	contains
	integer function search(moji)
		character(1) :: moji
		if(moji == "a")  search = 0
		if(moji == "b")  search = 25
		if(moji == "c")  search = 24
		if(moji == "d")  search = 23
		if(moji == "e")  search = 22
		if(moji == "f")  search = 21
		if(moji == "g")  search = 20
		if(moji == "h")  search = 19
		if(moji == "i")  search = 18
		if(moji == "j")  search = 17
		if(moji == "k")  search = 16
		if(moji == "l")  search = 15
		if(moji == "m")  search = 14
		if(moji == "n")  search = 13
		if(moji == "o")  search = 12
		if(moji == "p")  search = 11
		if(moji == "q")  search = 10
		if(moji == "r")  search = 9
		if(moji == "s")  search = 8
		if(moji == "t")  search = 7
		if(moji == "u")  search = 6
		if(moji == "v")  search = 5
		if(moji == "w")  search = 4
		if(moji == "x")  search = 3
		if(moji == "y")  search = 2
		if(moji == "z")  search = 1
	end function search
	
	character(1) function search_out(kazu)
		integer :: kazu
		if(kazu == 0)  search_out = "a"
		if(kazu == 1)  search_out = "b"
		if(kazu == 2)  search_out = "c"
		if(kazu == 3)  search_out = "d"
		if(kazu == 4)  search_out = "e"
		if(kazu == 5)  search_out = "f"
		if(kazu == 6)  search_out = "g"
		if(kazu == 7)  search_out = "h"
		if(kazu == 8)  search_out = "i"
		if(kazu == 9)  search_out = "j"
		if(kazu == 10)  search_out = "k"
		if(kazu == 11)  search_out = "l"
		if(kazu == 12)  search_out = "m"
		if(kazu == 13)  search_out = "n"
		if(kazu == 14)  search_out = "o"
		if(kazu == 15)  search_out = "p"
		if(kazu == 16)  search_out = "q"
		if(kazu == 17)  search_out = "r"
		if(kazu == 18)  search_out = "s"
		if(kazu == 19)  search_out = "t"
		if(kazu == 20)  search_out = "u"
		if(kazu == 21)  search_out = "v"
		if(kazu == 22)  search_out = "w"
		if(kazu == 23)  search_out = "x"
		if(kazu == 24)  search_out = "y"
		if(kazu == 25)  search_out = "z"
	end function search_out
end program main