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

int main(){
    int n;
    string s,tmp = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    while(cin >> n,n){
        vector <int> key(n+1);
        for(int i=0;i<n;i++) cin >> key[i];
        cin >> s;
        int len = 0;
        for(int i=0;i<s.size();i++){
            for(int j=0;j<tmp.size();j++){
                if(s[i] == tmp[j]) cout << ((j-key[len] < 0)? tmp[j-key[len]+tmp.size()]:tmp[j-key[len]]);
            }
            len++; if(len == n) len = 0;
        }
        cout << endl;
    }
}