#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
using namespace std;
#define REP(i, a, n) for(int i=a; i<n; i++)

int main() {
	int n;
	char train[52];
	REP(i, 0, 26) train[i] = 'a' + i;
	REP(i, 0, 26) train[i + 26] = 'A' + i;
	
	while (cin >> n, n) {
		int k[101];
		string s;
		REP(i, 0, n) cin >> k[i];
		cin >> s;

		REP(i, 0, s.size()) {
			int key = i%n;
			int cnt = -1;
			REP(j, 0, 52) {
				if (train[j] == s[i]) {
					cnt = j;
					break;
				}
			}

			if (cnt - k[key] < 0) {
				cout << train[52 - (k[key] - cnt)];
			}
			else {
				cout << train[cnt - k[key]];
			}

		}
		cout << endl;
	}
	return 0;
}