#include int ri() { int n; scanf("%d", &n); return n; } int main() { std::string s; std::cin >> s; int64_t n; std::cin >> n; std::string res; for (auto i : s) { if (isupper(i)) { res.push_back((i - 'A' + n) % 26 + 'A'); } else if (islower(i)) { res.push_back((i - 'a' + n) % 26 + 'a'); } else if (i - '0' + n >= 10) { int64_t left = n - (10 - (i - '0')); std::string tmp = "CpCzNkSuTbEoA"; for (auto &j : tmp) { if (isupper(j)) j = (j - 'A' + left) % 26 + 'A'; else j = (j - 'a' + left) % 26 + 'a'; } res += tmp; } else res.push_back(i + n); } std::cout << res << std::endl; return 0; }