import Foundation

let str = readLine(stripNewline: true)
var no_oper = Int(readLine(stripNewline: true)!)!

let characterString = str!
var str_arr = Array(str!.characters)
print(str_arr)
var numbers: [Int] = Array<Int>()
var count_dict = [Int: [Int]]()

for (i, character) in characterString.utf8.enumerate() {
    let stringSegment: String = "\(character)"
    let anInt: Int = Int(stringSegment)! % 97
    
    print(anInt)
    if anInt != 0 {
        if (26 - anInt) < no_oper {
            numbers.append(0)
            no_oper -= (26 - anInt)
        } else {
            numbers.append(anInt)
        }
    } else {
        numbers.append(anInt)
    }
}

numbers[numbers.count - 1] = (numbers[numbers.count - 1] + no_oper) % 26

print(numbers)
var str_arr2 = [Character]()
var string = ""
for number in numbers {
    let char = Character(UnicodeScalar(number + 97))
    string.append(char)
}

print("\(string)")