#line 1 "/workspaces/compro/lib/template.hpp"


#line 1 "/workspaces/compro/lib/io/vector.hpp"
#include <iostream>
#include <vector>

#ifndef IO_VECTOR
#define IO_VECTOR

template <class T> std::ostream &operator<<(std::ostream &out, const std::vector<T> &v) {
  int size = v.size();
  for (int i = 0; i < size; i++) {
    std::cout << v[i];
    if (i != size - 1)
      std::cout << " ";
  }
  return out;
}

template <class T> std::istream &operator>>(std::istream &in, std::vector<T> &v) {
  for (auto &el : v) {
    std::cin >> el;
  }
  return in;
}

#endif
#line 4 "/workspaces/compro/lib/template.hpp"
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define coutd(n) cout << fixed << setprecision(n)
#define ll long long int
#define vl vector<ll>
#define vi vector<int>
#define MM << " " <<

using namespace std;

template <class T> void chmin(T &a, T b) {
  if (a > b)
    a = b;
}

template <class T> void chmax(T &a, T b) {
  if (a < b)
    a = b;
}

// 重複を消す。計算量はO(NlogN)
template <class T> void unique(std::vector<T> &v) {
  std::sort(v.begin(), v.end());
  v.erase(std::unique(v.begin(), v.end()), v.end());
}


#line 2 "main.cpp"

string solve(string S, ll N) {
  ll num = min(10LL, N);
  string ans = S;
  REP(i, num) {
    int len = ans.length();
    string tmp;
    REP(j, len) {
      if (ans[j] == '9') {
        tmp += "CpCzNkSuTbEoA";
      } else if ('0' <= ans[j] && ans[j] <= '8') {
        tmp.push_back(ans[j] + 1);
      } else if ('a' <= ans[j] && ans[j] <= 'z') {
        int po = (ans[j] - 'a' + 1) % 26;
        tmp.push_back('a' + po);
      } else if ('A' <= ans[j] && ans[j] <= 'Z') {
        int po = (ans[j] - 'A' + 1) % 26;
        tmp.push_back('A' + po);
      }
    }
    ans = tmp;
  }

  N -= 10;
  if (N < 0) {
    return ans;
  }

  int len = ans.length();
  REP(i, len) {
    if ('a' <= ans[i] && ans[i] <= 'z') {
      ll po = (N + ans[i] - 'a') % 26;
      ans[i] = 'a' + po;
    } else if ('A' <= ans[i] && ans[i] <= 'Z') {
      int po = (N + ans[i] - 'A') % 26;
      ans[i] = 'A' + po;
    }
  }
  return ans;
}

// generated by online-judge-template-generator v4.7.1 (https://github.com/online-judge-tools/template-generator)
int main() {
  string S;
  ll N;
  std::cin >> S >> N;
  auto ans = solve(S, N);
  std::cout << ans << std::endl;
  return 0;
}