#include <iostream>
#include <cctype>
#include <vector>
#include <string>

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 now = 0;
		for (int c : s) {
			if (isupper(c)) {
				c -= 'A';
				(c -= k[now] - 52) %= 52;
				if (c >= 26) c = (c % 26) + 'a';
				else c += 'A';
			} else {
				c -= 'a';
				(c -= k[now] - 52) %= 52;
				if (c >= 26) c = (c % 26) + 'A';
				else c += 'a';
			}
			cout << (char)c;
			(now += 1) %= n;
		}
		cout << endl;
	}

	return 0;
}
