import Data.Char
import Data.Array.Unboxed
import Debug.Trace
 
type Table = Array Char Int
type TableInf = Array Int Char
 
main :: IO ()
main = do
  s <- getLine
  n <- readLn :: IO Int
  let table = listArray ('a', 'z') [0..25] :: Table
  let table' = listArray (0, 25) ['a'..'z'] :: TableInf
  putStrLn $ solve table table' s n
 
solve :: Table -> TableInf -> String -> Int -> String
solve tab tab' str allNum = go str allNum
  where
    go [x] n = let m = tab ! x 
                   n' = (m + n `mod` 26) `mod` 26 in
                 [tab' ! n']
    go (x:xs) n = let m = tab ! x
                      n' = (26 - m) `mod` 26 in
                    if n' <= n
                       then 'a' : go xs (n - n')
                       else x : go xs n