#include <iostream>
#include <vector>
#include <string>
using namespace std;

char Decryption(int k, char s) {
  char station[] = {'a','b','c','d','e','f','g','h','i','j','k','l','m',
                    'n','o','p','q','r','s','t','u','v','w','x','y','z',
                    'A','B','C','D','E','F','G','H','I','J','K','L','M',
                    'N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
  int num;

  for(int i = 0; i < 52; i++) {
    if(s >= 'a' && s <= 'z')
      num = s - 'a';
    else
      num = s - 39;
  }
  return station[(52 + num - k) % 52];
}

int main() {
  vector<int> K;
  int n;
  string s_in;
  string s_out;

  while(1) {
    cin >> n;
    if(n == 0)
      break;

    for(int i = 0; i < n; i++) {
      int k;
      cin >> k;
      K.push_back(k);
    }

    cin >> s_in;

    for(int i = 0; i < s_in.size(); i++) {
      s_out += Decryption(K[i%n], s_in[i]);
    }

    cout << s_out << endl;

    s_out.erase();
    K.clear();
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define lp(i,n) for(int i=0;i<n;i++)

int main(){
	while(1){
		int n;
		cin>>n;
		if(n==0) break;
		int a[100];
		lp(i,n){
			cin>>a[i];
		}
		int count=0;
		char x;
		scanf("%c",&x);
		while(1){
			scanf("%c",&x);
			if('A'<=x&&'z'>=x){
				lp(i,a[count]){
					x--;
					if(x==64) x=122;
					if(x==96) x=90;
				}
				cout<<x;
				count++;
				if(count==n) count=0;
			}
			else break;
		}
		cout<<endl;
	}
	return 0;
}
