#include <bits/stdc++.h>

#define ALL(a) (a).begin(), (a).end()
#define llong long long

using namespace std;

signed main(){
	while(true){
		int n; cin >> n;
		if(n == 0)break;
		vector<int> k(n);
		for(auto &&e : k)cin >> e;
		string str; cin >> str;
		vector<int> s(str.size());
		for(size_t i = 0; i < str.size(); i++){
			if(islower(str[i])){
				s[i] = (int)(str[i] - 'a');
			}
			else{
				s[i] = (int)(str[i] - 'A'+26);
			}
		}
		for(size_t i = 0; i < s.size(); i++){
			int st = (s[i] + 52 - k[i%k.size()]) % 52;
			if(st >= 26){
				cout << (char)(st - 26 + 'A');
			}
			else{
				cout << (char)(st + 'a');
			}
		}
		cout << endl;
	}


	return 0;
}


