#include <bits/stdc++.h>

using namespace std;

int main() {
  int n;
  while (cin >> n, n) {
    vector<int> k(n);
    for (int i = 0; i < n; i++) {
      cin >> k[i];
    }
    string s;
    cin >> s;
    int keyid = 0;
    for (int i = 0; i < s.size(); i++) {
      char c = s[i];
      int cnt = k[keyid];
      while (0 < cnt) {
        if (c == 'a')
          c = 'Z';
        else if (c == 'A')
          c = 'z';
        else
          c--;
        cnt--;
      }
      s[i] = c;
      keyid = (keyid + 1) % n;
    }
    cout << s << endl;
  }

  return 0;
}
