import Control.Monad.State
import Data.Char

main = do
  s <- getLine
  k <- readLn :: IO Int

  putStrLn $ (`evalState` k) $ do
    let len = length s
    forM (zip [1..] s) $ \(i,c) -> do
      k' <- get
      if i == len && k' >= 0 then
        return $ chr ((ord c - ord 'a' + k') `mod` 26 + ord 'a')
        else
        if (ord 'z'+1) - ord c <= k' then do
          put $ k' - ((ord 'z'+1) - ord c)
          return $ 'a'
        else
          return c
  
