#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int k[101];
char s[101];
int main() {
	vector<char>v;
	for (char c = 'a'; c <= 'z'; c++)v.push_back(c);
	for (char c = 'A'; c <= 'Z'; c++)v.push_back(c);
	int n;
	while (scanf("%d", &n), n) {
		rep(i, n)scanf("%d", &k[i]);
		scanf("%s", s);
		int len = strlen(s);
		rep(i, len) {
			s[i] = v[(find(v.begin(), v.end(), s[i]) - v.begin() + 52 - k[i%n]) % 52];
		}
		puts(s);
	}
}
#include <iostream>
#include <string>
using namespace std;

#define KEY_NUM 100

char process_key(char c, int key) {
    
    int num=0;
    //cout << "[" << c << "," << key << "," << num << "]";
    if ('a' <= c && c <= 'z') {
        num = 25 - (int)('z' - c);
    }
    if ('A' <= c && c <= 'Z') {
        num = 51 - (int)('Z' - c);
    }
    num = (num - key + 104) % 52;
    if ( 0 <= num && num <= 25) {
        c = 'a' + num;
    }
    if (26 <= num && num <= 51) {
        c = 'A' + (num - 26);
    }
    //cout << "[" << c << "," << key << "," << num << "]";
    return c;
}

int main(void) {
    string s;
    int n;
    int keys[KEY_NUM];
    while (cin >> n, n) {
        for (int i=0; i<n; i++) {
            cin >> keys[i];
        }
        cin >> s;
        //cout << n << endl;
        for (int i=0; i<s.size(); i++) {
            //cout << process_key(s[i], keys[i % n]) << "_";
            cout << process_key(s[i], keys[i % n]);
        }
        //cout << s << endl;
        cout << endl;
    }
}