#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <optional>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

int main() {
    string s;
    int64_t n;
    cin >> s >> n;
    while (n > 0) {
        string next_s;
        bool found = false;
        for (auto c : s) {
            if ('a' <= c && c <= 'z')
                next_s.push_back((c - 'a' + 1) % 26 + 'a');
            else if ('A' <= c && c <= 'Z')
                next_s.push_back((c - 'A' + 1) % 26 + 'A');
            else if ('0' <= c && c <= '8') {
                found = true;
                next_s.push_back(c + 1);
            } else {
                found = true;
                next_s += "CpCzNkSuTbEoA";
            }
        }
        --n;
        s = next_s;
        if (!found)
            break;
    }
    for (auto c : s) {
        char ans;
        if ('a' <= c && c <= 'z')
            ans = (c - 'a' + n % 26) % 26 + 'a';
        else if ('A' <= c && c <= 'Z')
            ans = (c - 'A' + n % 26) % 26 + 'A';
        else
            ans = c;
        cout << char(ans);
    }
    cout << endl;
    return 0;
}