#include <bits/stdc++.h>
using namespace std;

string words;
int numberStruct;

void structLatter(int currentLatter)
{
    if(abs(numberStruct)%26==0)
    {
        return;
    }

    if(numberStruct<0)
    {
        for(int currentMove=1; currentMove<=abs(numberStruct)%26; currentMove++)
        {
            if(words[currentLatter]=='z')
            {
                words[currentLatter]='a';
            }
            else if(words[currentLatter]=='Z')
            {
                words[currentLatter]='A';
            }
            else
            {
                words[currentLatter]++;
            }
        }
    }
    else
    {
        for(int currentMove=1; currentMove<=numberStruct%26; currentMove++)
        {
            if(words[currentLatter]=='a')
            {
                words[currentLatter]='z';
            }
            else if(words[currentLatter]=='A')
            {
                words[currentLatter]='Z';
            }
            else
            {
                words[currentLatter]--;
            }
        }
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    getline(cin, words);
    cin >> numberStruct;

    for(int currentLatter=0; currentLatter<words.length(); currentLatter++)
    {
        if(words[currentLatter]>='a' && words[currentLatter]<='z' || words[currentLatter]>='A' && words[currentLatter]<='Z')
        {
            structLatter(currentLatter);
        }
    }

    cout << words;
    return 0;
}
