#line 1 "main.cpp" #include #include using namespace std; using lint = long long; string f(const string& s) { string t; for (auto c : s) { if (islower(c)) { t.push_back((c - 'a' + 1) % 26 + 'a'); } else if (isupper(c)) { t.push_back((c - 'A' + 1) % 26 + 'A'); } else { if (c < '9') { t.push_back(c + 1); } else { t += "CpCzNkSuTbEoA"; } } } return t; } void solve() { string s; lint n; cin >> s >> n; for (int t = 0; t < 10 && n > 0; ++t, --n) s = f(s); for (auto& c : s) { if (islower(c)) { c = (c - 'a' + n) % 26 + 'a'; } else { c = (c - 'A' + n) % 26 + 'A'; } } cout << s << "\n"; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); solve(); return 0; }