module Main where
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BS
import Data.Maybe(fromJust)

main = do
  s <- getLine
  k <- read<$> getLine :: IO Int
  putStrLn $ solve s k

solve :: String -> Int -> String
solve s k = map (toEnum . (+a)) . rotate k . map (subtract a . fromEnum) $ s
  where
    a = fromEnum 'a'
    z = fromEnum 'z'
    rotate n [x] = [(x + n) `mod` 26]
    rotate n (x:xs)
      | x == 0     = x:rotate n xs
      | 26 - x <= n = 0:rotate (n - (26 - x)) xs
      | otherwise  = x:rotate n xs
