#include void f(char c, long long int n) { if ('a' <= c && c <= 'z') printf("%c", (c - 'a' + (char)(n % 26)) % 26 + 'a'); else if ('A' <= c && c <= 'Z') printf("%c", (c - 'A' + (char)(n % 26)) % 26 + 'A'); return; } int main() { char s[102]; scanf("%s", s); long long int n, i, j; char t[102] = "CpCzNkSuTbEoA"; scanf("%lld", &n); for (i = 0; s[i] != '\0'; i++) { if ('0' <= s[i] && s[i] <= '9') { if (n > 10) { for (j = 0; t[j] != '\0'; j++) f(t[j], n - 10 + (s[i] - '0')); } else if (s[i] + n > '9') { for (j = 0; t[j] != '\0'; j++) f(t[j], n - 10 + (s[i] - '0')); } else printf("%c", s[i] + n); } else f(s[i], n); } printf("\n"); return 0; }