import Data.Char
import Debug.Trace

main :: IO ()
main = do
    s <- getLine
    k <- readLn
    putStrLn $ solve s k

solve :: String -> Int -> String
solve [c] k
    | ord c + k `mod` 26  > 122 = [chr $ ord c +  k `mod` 26 - 26]
    | otherwise = [chr $ ord c + k]
solve (c:s) k
    | c == 'a' =  'a' : solve s k
    | ord 'z' - ord c + 1 <= k = 'a' : solve s (k - (ord 'z' - ord c + 1))
    | otherwise = c : solve s k
