#include<iostream>
#include<map>
#include<string>
#include<vector>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef int Def;
typedef vector<Def> vi;
typedef pair<Def,Def> pii;
int main(){
	int n;
	while(cin>>n,n){
		vi in(n);
		rep(i,n)cin>>in[i];
		string s;
		cin>>s;
		rep(i,s.size()){
			int t=in[i%n];
			if(t>=26){
				t-=26;
				if(islower(s[i]))s[i]=toupper(s[i]);
				else s[i]=tolower(s[i]);
			}
			if(islower(s[i])){
				s[i]-=t;
				if(s[i]<'a')s[i]='Z'-('a'-s[i])+1;
			}else{
				s[i]-=t;
				if(s[i]<'A')s[i]='z'-('A'-s[i])+1;
			}
		}
		cout<<s<<endl;
	}
}

#include <cstdio>

using namespace std;

int main() {
  int n;
  while (scanf("%d", &n), n!=0) {
    int k[100];
    char s[101];
    for (int i=0;i<n;i++) scanf("%d", &k[i]);
    scanf("%s", s);
    for (int i=0;s[i]!='\0';i++) {
      int c = s[i];
      for (int j=0;j<k[i%n];j++) {
        if (c == 'a') c = 'Z';
        else if (c == 'A') c = 'z';
        else c--;
      }
      putchar(c);
    }
    putchar('\n');
  }
  return 0;
}