module Main where
import Control.Monad
import Control.Applicative
import Data.Maybe
import Data.List
import qualified Text.Printf
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString as BC

------------------------------------------

main :: IO ()
main = do
  s <- getLine
  k <- readInt
  putStrLn $ go s k

go :: String -> Int -> String
go [] k = ""
go (x:[]) k = [toEnum $ (fromEnum x - fromEnum 'a' + k) `mod` 26 + fromEnum 'a']
go (x:xs) k =
  let countA = 26 - (fromEnum x - fromEnum 'a') in
  if k < countA
  then x : go xs k
  else 'a' : go xs (k - countA)


------------------------------------------

{- Int input -}

parseInt :: BC.ByteString -> Int
parseInt = fst . fromJust . BC.readInt

parseInts :: BC.ByteString -> [Int]
parseInts = map parseInt <$> BC.words

readInt :: IO Int
readInt = parseInt <$> BC.getLine

readInts :: IO [Int]
readInts = parseInts <$> BC.getLine

{- Double Formatting -}

doubleFormat :: Double -> String
doubleFormat = Text.Printf.printf "%.12f"
