#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
using namespace std;
int n;
int main()
{
	while(cin>>n,n)
	{
		int k[100];
		for(int i=0;i<n;i++)cin>>k[i];
		string s;cin>>s;
		for(int i=0;i<s.size();i++)
		{
			int now=k[i%n];
			if(now>=26)
			{
				now-=26;
				s[i]^=32;
			}
			if(s[i]<'a')
			{
				if(s[i]-'A'<now)
				{
					now-=s[i]-'A'+1;
					s[i]='z'-now;
				}
				else s[i]-=now;
			}
			else
			{
				if(s[i]-'a'<now)
				{
					now-=s[i]-'a'+1;
					s[i]='Z'-now;
				}
				else s[i]-=now;
			}
		}
		cout<<s<<endl;
	}
}
