Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	io := NewIo()
	defer io.Flush()
	for {
		n := io.NextInt()
		if n == 0 {
			break
		}
		k := make([]int, n)
		for i := 0; i < n; i++ {
			k[i] = io.NextInt()
		}
		const st = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
		s := io.NextLine()
		for i, cnt := 0, 0; i < len(s); i, cnt = i+1, (cnt+1)%n {
			idx := strings.IndexRune(st, rune(s[i]))
			c := st[(idx-k[cnt]+52)%52]
			io.Printf("%c", c)
		}
		io.Println()
	}
}

// I/O template
type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

func NewIo() *Io {
	return &Io{
		reader: bufio.NewReader(os.Stdin),
		writer: bufio.NewWriter(os.Stdout),
	}
}

func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

func (io *Io) NextLine() string {
	var buff []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buff = append(buff, line...)
		if !isPrefix {
			break
		}
	}
	return string(buff)
}

func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	s := io.tokens[io.nextToken]
	io.nextToken++
	return s
}

func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) NextFloat() float64 {
	i, err := strconv.ParseFloat(io.Next(), 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}

func (io *Io) Printf(format string, a ...interface{}) {
	fmt.Fprintf(io.writer, format, a...)
}

func (io *Io) PrintIntSlice(a []int) {
	b := make([]interface{}, 0, len(a))
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func (io *Io) PrintStringSlice(a []string) {
	b := make([]interface{}, 0, len(a))
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func Log(name string, value interface{}) {
	fmt.Fprintf(os.Stderr, "%s=%+v\n", name, value)
}

func ExampleIo() {
	io := NewIo()
	defer io.Flush()
	a := make([]int, 0, 3)
	a[0], a[1], a[2] = io.NextInt(), io.NextInt(), io.NextInt()
	io.Println(a)
	io.PrintIntSlice(a)
	Log("io", a)
}

C++: /*
Hokudai Practice Contest 2014
A - King's Inspection

ティツァツ」テヲツウツ陛ッツシツ堙」ツつキテ」ツδ淌」ツδ・テ」ツδャテ」ツδシテ」ツつキテ」ツδァテ」ツδウ
テヲツ崢クテ」ツ?凝」ツつ古」ツ?ヲテ」ツ??」ツつ凝」ツδォテ」ツδシテ」ツδォテ」ツ?ォテ・ツセツ禿」ツ?」テ」ツ?ヲテ・ツセツゥテ・ツ?ε」ツ?凖」ツつ凝」ツ??」ツ?妥」ツ??
テ」ツδォテ」ツδシテ」ツδォテ」ツつ津・ツ?催ァツ渉セテ」ツ?凖」ツつ凝」ツ?淌」ツつ?」ツ?ォテ」ツ?ッテ」ツδェテ」ツつケテ」ツδ暗」ツ?ョテ・ツセツェテァツ陳ーテ」ツつ?ヲツ鳴?・ツュツ療」ツ?ョテ・ツセツェテァツ陳ーテ」ツつ津・ツ?催ァツ渉セテ」ツ?凖」ツつ凝・ツソツ?ィツヲツ?」ツ?古」ツ?づ」ツつ凝」ツ??
(M-1)+1 -> 0, 0-1 -> (M-1)テ」ツ??」ツ?ィテ」ツ?ェテ」ツつ凝」ツつ暗」ツ??」ツ?ォテ」ツ?凖」ツつ凝」ツ?ォテ」ツ?ッテ」ツ??・ツ可ーテ、ツスツ?%)テ」ツつ津ァツ板ィテ」ツ??」ツつ古」ツ?ーテ」ツつ暗」ツ??」ツ??

テヲツ卍づゥツ鳴禿ィツィツ暗ァツョツ療ゥツ?湘ッツシツ唹(|s|)
テァツゥツコテゥツ鳴禿ィツィツ暗ァツョツ療ゥツ?湘ッツシツ唹(n + |s|)
*/

#include<iostream>
#include<cctype>
using namespace std;

//a-zA-z -> テゥツ??ァツ閉ェ
int toInt(char a){
  if(islower(a))return a-'a';
  return a-'A'+26;
}

//テゥツ??ァツ閉ェ -> a-zA-Z
char toChar(int a){
  if(a<26)return 'a'+a;
  return 'A'+a-26;
}

//テゥツァツ?ヲツ閉ー
const int M = 52;

int main(){
  int n,k[100];
  string s;

  while(cin >> n,n){
    for(int i=0;i<n;i++)cin >> k[i];
    cin >> s;

    for(int i=0;i<(int)s.size();i++){
      //テ・ツセツェテァツ陳ーテ」ツつ津」ツつキテ」ツδ淌」ツδ・テ」ツδャテ」ツδシテ」ツつキテ」ツδァテ」ツδウテ」ツ?凖」ツつ凝」ツ?ォテ」ツ?ッmodテ」ツつ津、ツスツソテ」ツ?暗」ツ?ーティツ可ッテ」ツ??
      int tmp = toInt(s[i]) - k[i%n];
      //ティツイツ?ヲツ閉ーテ」ツつづ」ツ?づ」ツつ甘・ツセツ療」ツつ凝・ツ?エテ・ツ青暗」ツ?ョテ・ツョツ嘉・ツ?ィテ」ツ?ェmodテ」ツ?ョテ・ツ渉姪」ツつ甘ヲツ鳴ケテ」ツ?ッ((x%mod) + mod)%mod
      tmp = ((tmp%M) + M) % M;
      cout << toChar(tmp);
    }
    cout << endl;
  }
}

C++: #include <bits/stdc++.h>
using namespace std;


int main(){

	  while(1){
			int n; cin >> n;
			if(!n) break;

			vector<int> k(n);
			for(int i=0; i<n; i++) cin >> k[i];
			string s; cin >> s;

			int key=0;
			for(int i=0; i<s.size(); i++){

				  char ans = s[i];
				  for(int j=0; j<k[key]; j++){
						ans--;
						if( ans == 'a'-1 ) ans = 'Z';
						if( ans == 'A'-1 ) ans = 'z';
				  }
				  cout << ans ;
				  key++;
				  if( key == n ) key=0;
			}
			cout << endl;
	  }

}

C++: #define	_USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cctype>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <string>
#include <set>
#include <complex>
#include <utility>
#include <numeric>
#define  rep(i,n) for(int i=0;i<(n);i++)
#define  REP(i,a,n) for(int i=a;i<(n);i++)
#define  rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define  VI	vector<int>
#define	 VS vector<string>
#define  all(a) (a).begin(),(a).end()
#define  debug(x) cout<<#x<<": "<<x<<endl

using namespace std;
typedef long long int ll;
typedef string::const_iterator State;
typedef pair<int,int> P;
class ParseError {};
const ll INF=1LL<<50;
char fi[101][101];
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
double EPS = 1e-14;
const int MAX_V=100;
const int MAX_N=100;
char o[3]={'+','-','*'};
#define md 1000003



int bow[353][353]={0};
double add(double a,double b){
	if(abs(a+b)<EPS*(abs(a)+abs(b)))
	return 0;
	return a+b;
}

/*struct P{
	double x,y;
	P(){}
		P(double x,double y):x(x),y(y){
		}
		P operator + (P p){
			return P(add(x,p.x),add(y,p.y));
		}
		P operator - (P p){
			return P(add(x,-p.x),add(y,-p.y));
		}
		P operator *(double d){
			return P(x*d,y*d);
		}
		double dot(P p){
			return add(x*p.x,y*p.y);
		}
		double det(P p){
			return add(x*p.y,-y*p.x);
		}
};

bool cmp_x(const P& p,const P& q){
	if(p.x!=q.x) return p.x<q.x;
	return p.y<q.y;
}

vector<P> convex_hull(P* ps, int n){
	sort(ps,ps+n,cmp_x);
	int k=0;
	vector<P> 	qs(n*2);
	
	rep(i,n){
		while(k>1&&(qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])<=0)
			k--;
		qs[k++]=ps[i];
	}
	for(int i=n-2,t=k;i>=0;i--){
		while(k>t&&(qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])<=0)
		k--;
		qs[k++]=ps[i];
	}
	qs.resize(k-1);
	return qs;
}

int n,m;
vector<double> p;
P ps[101];
*/
//char c[520][520];
long long mod=1000000007;
long long pow(ll i,ll j){
	ll tmp=1;
	while(j){
		if(j%2) tmp=tmp*i%mod;
		i=i*i%mod;
		j/=2;
	}
	return tmp;
}

int expression(State&);
int term(State&);
int factor(State&);
int number(State&);
int expression(State &begin){
	int ret = term(begin);
	
	for(;;){
		if(*begin == '+'){
			begin++;
			ret += term(begin);
		}
		else if(*begin == '-'){
			begin++;
			ret -= term(begin);
		}
		else
			break;
	}
	return ret;
}

int term(State &begin){
	int ret = factor(begin);
	
	for(;;){
		if(*begin=='*'){
			begin++;
			ret *= factor(begin);
		}
		else if(*begin=='/'){
			begin++;
			ret /= factor(begin);
		}
		else
			break;
	}
	return ret;
}

int factor(State &begin){
	int ret;
	if(*begin == '('){
		begin++;
		ret = expression(begin);
		begin++;
	}
	else
	ret = number(begin);
	
	return ret;

}

int number(State &begin){
	int ret =0;
	
	while(isdigit(*begin)){
		ret*=10;
		ret+=*begin - '0';
		begin++;
	}
	return ret;
}



int main(void){
	
	int n;
	
	while(cin>>n,n!=0){
		vector<int> c(n);
		
		for(int i=0;i<n;i++){
			cin>>c[i];
		}
		
		string s;
		cin>>s;
		
		int k=0;
		for(int i=0;i<s.size();i++){
			if(s[i]>='A'&&s[i]<='Z'){
				if(s[i]-'A'<c[k%n]){
					int tmp=c[k%n]-(s[i]-'A'+1);
					s[i]='z'-tmp;
				}
				else
					s[i]=s[i]-c[k%n];
			}
			else if(s[i]>='a'&&s[i]<='z'){
				if(s[i]-'a'<c[k%n]){
					int tmp=c[k%n]-(s[i]-'a'+1);
					s[i]='Z'-tmp;
				}
				else
					s[i]=s[i]-c[k%n];
			}
				k++;
			}
		cout<<s<<endl;
		}
		
	
	
		
}