program main
	implicit none
	character(100010) :: s
	integer :: K, temp, i
	
	read(*, *) s
	read(*, *) K
	
	temp = 0
	do i = 1, len_trim(s)
		temp = temp + surch(s(i:i))
	end do
	if(K >= temp) then
		do i = 1, len_trim(s)
			s(i:i) ="a"
		end do
		s(len_trim(s):len_trim(s)) = surch_out(mod(K,26))
	else
		do i = 1, len_trim(s)
			if(K-surch(s(i:i)) >= 0) then
				K = K - surch(s(i:i))
				s(i:i) ="a"
			end if
		end do
		s(len_trim(s):len_trim(s)) = surch_out(mod((26-(surch(s(len_trim(s):len_trim(s)))-mod(K,26))),26))
	end if
	
	write(*, *) trim(s)



	
	contains
	integer function surch(moji)
		character(1) :: moji
		if(moji == "a")  surch = 0
		if(moji == "b")  surch = 25
		if(moji == "c")  surch = 24
		if(moji == "d")  surch = 23
		if(moji == "e")  surch = 22
		if(moji == "f")  surch = 21
		if(moji == "g")  surch = 20
		if(moji == "h")  surch = 19
		if(moji == "i")  surch = 18
		if(moji == "j")  surch = 17
		if(moji == "k")  surch = 16
		if(moji == "l")  surch = 15
		if(moji == "m")  surch = 14
		if(moji == "n")  surch = 13
		if(moji == "o")  surch = 12
		if(moji == "p")  surch = 11
		if(moji == "q")  surch = 10
		if(moji == "r")  surch = 9
		if(moji == "s")  surch = 8
		if(moji == "t")  surch = 7
		if(moji == "u")  surch = 6
		if(moji == "v")  surch = 5
		if(moji == "w")  surch = 4
		if(moji == "x")  surch = 3
		if(moji == "y")  surch = 2
		if(moji == "z")  surch = 1
	end function surch
	
	character(1) function surch_out(kazu)
		integer :: kazu
		if(kazu == 0)  surch_out = "a"
		if(kazu == 1)  surch_out = "b"
		if(kazu == 2)  surch_out = "c"
		if(kazu == 3)  surch_out = "d"
		if(kazu == 4)  surch_out = "e"
		if(kazu == 5)  surch_out = "f"
		if(kazu == 6)  surch_out = "g"
		if(kazu == 7)  surch_out = "h"
		if(kazu == 8)  surch_out = "i"
		if(kazu == 9)  surch_out = "j"
		if(kazu == 10)  surch_out = "k"
		if(kazu == 11)  surch_out = "l"
		if(kazu == 12)  surch_out = "m"
		if(kazu == 13)  surch_out = "n"
		if(kazu == 14)  surch_out = "o"
		if(kazu == 15)  surch_out = "p"
		if(kazu == 16)  surch_out = "q"
		if(kazu == 17)  surch_out = "r"
		if(kazu == 18)  surch_out = "s"
		if(kazu == 19)  surch_out = "t"
		if(kazu == 20)  surch_out = "u"
		if(kazu == 21)  surch_out = "v"
		if(kazu == 22)  surch_out = "w"
		if(kazu == 23)  surch_out = "x"
		if(kazu == 24)  surch_out = "y"
		if(kazu == 25)  surch_out = "z"
	end function surch_out
end program main