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++: #include <bits/stdc++.h>
using namespace std;

#define iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)+1):((m)-(n)+1)),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define all(a) a.begin(), a.end()
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef double Real;

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

template<class T>
ostream& operator<<(ostream& os, vector<T> v) {
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

int dx[] = { -1, 0, 1, 0 };
int dy[] = {  0, -1, 0, 1 };

char mae(char c, int n) {
  char d = c - n;
  if ('a' <= c && c <= 'z' && d < 'a') {
    d += 'Z' - 'a' + 1;
  }
  else if ('A' <= c && c <= 'Z' && d < 'A') {
    d += 'z' - 'A' + 1;
  }
  return d;
}

int main() {

  for (int n; cin >> n, n; ) {
    vector<int> xs(n);
    rep (i, n) cin >> xs[i];
    string s; cin >> s;
    rep (i, s.size()) {
      cout << mae(s[i], xs[i % n]);
    } cout << endl;
  }

  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

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

C++: #include <bits/stdc++.h>

#define loop(n, i) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define HERE cout << "HERE: " << __LINE__ << endl;
#define INSP(v) cout << v << " at " << __LINE__ << endl;

using namespace std;
typedef long long ll;


int main()
{
    vector<char> list(52, 0);
    char c = 'a';
    loop(26,i) list[i] = c+i;
    c = 'A';
    for(int i = 26; i<52; i++) list[i] = c+i-26;

    int n;
    while (cin >> n, n) {
        vector<int> k(n, 0);
        loop(n, i) cin >> k[i];
        string s; cin >> s;
        string ans = "";
        int ite = 0;
        for (auto c : s) {
            int i = distance(list.begin(), find(all(list), c));
            ans += i-k[ite] < 0 ?
                list[i-k[ite]+52] : list[i-k[ite]];
            ite = n==++ite? 0 : ite;
        }
        cout << ans << endl;
    }
}

C++: #include<iostream>
using namespace std;
int main(){
  int *k,count;
  char *s;
while(1){
  int n,i;
  s=new char[100];
  cin>>n;
  if(n==0)break;
  count=1
  k= new int[n+1];
  for(i=1;i<=n;i++)cin>>k[i];
  cin>>s;
  for(i=0;s[i]!=0;i++){
    s[i]-=k[count>n?count=0:count++];
    if(s[i]<'A')s[i]='z'-('A'-s[i]);
  }
  cout<<s<<endl;

  delete s;
  delete k;
}
return 0;
}

C++: #include<stdio.h>
#include<string.h>
#define rep(i,j) for(int i=0;i<(j);i++)
int main(){
	int n,k[1000],l;
	char s[101];
	for(;;){
	    scanf("%d",&n);
	    if(!n)break;
	    rep(i,n){
	        scanf("%d",k+i);
	        k[i] = 52 - k[i];
	    }
	    scanf("%s",s);
        l = strlen(s);
        rep(i,l){
            s[i] = s[i]>='a' ? s[i]-'a':s[i]-'A'-26;
            s[i] = (s[i]+k[i%n]+52)%52;
            s[i] = s[i]>25?s[i]+'A'-26:s[i]+'a';
        }
        puts(s);
	}

	return 0;
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>

using namespace std;

//conversion
//------------------------------------------
inline long toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline long toLong(string s) {long v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(long i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

const long double EPS = 1e-12;
const int INF = 10000;



int main(){
	int N;
	string lst="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	while(cin>>N){
		if(N==0)break;
		vector<int>ky(N);
		REP(i,N)cin>>ky[i];
		string str,res="";
		cin>>str;
		REP(i,SZ(str)){
			res+=lst[(52+lst.find(str[i])-ky[i%N])%52];
		}
		cout<<res<<endl;
	}
	return 0;
}