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

using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	while(true){
		int n;
		cin >> n;
		if(n == 0){ break; }
		vector<int> keys(n);
		for(int i = 0; i < n; ++i){ cin >> keys[i]; }
		string s;
		cin >> s;
		const int m = s.size();
		for(int i = 0; i < m; ++i){
			const int k = keys[i % n];
			int c = islower(s[i]) ? (s[i] - 'a') : (s[i] - 'A' + 26);
			c = ((c + 5200) - k) % 52;
			if(c < 26){
				c += 'a';
			}else{
				c = (c - 26) + 'A';
			}
			cout << static_cast<char>(c);
		}
		cout << endl;
	}
	return 0;
}