program next_letter
  implicit none
  integer :: k, n, i, m
  character(100000) :: s
  read(*,*) s
  s = trim(adjustl(s))
  n = len_trim(s)
  read(*,*) k
  do i = 1, n
    m = ichar(s(i:i))-97
    if ((m.eq.0).or.(26-m.gt.k)) cycle
    s(i:i) = 'a'
    k = k - (26-m)
  end do
  if (k.ne.0) then
    m = ichar(s(n:n))-97
    m = mod(k+m,26)
    s(n:n) = achar(m+97)
  end if
  write(*,'(a)') trim(s)
  stop
end program next_letter