#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
using namespace std;

int main(void){
	int N;
	while(cin >> N, N) {
		vector<int> back(N);
		for (int i = 0; i < N; i++) {
			cin >> back[i];
		}

		string list;
		cin.ignore();
		getline(cin, list);

		int bi = 0;
		for (int i = 0; i < list.size(); i++) {
			int n = back[bi];
			while (n > 0) {
				if (list[i] == 'a')
					list[i] = 'Z';
				else if (list[i] == 'A')
					list[i] = 'z';
				else
					list[i] = list[i] - 1;

				n--;
			}

			bi = (bi + 1) % N;
		}
		cout << list << endl;
	}
}