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<iostream>
#include<math.h>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll INF=2e18;
ll n;
ll k[101];
string s;

int main(){
    while(cin>>n,n!=0){
        for(int i=0;i<n;i++){
            cin>>k[i];
        }
        cin>>s;
        string ans="";
        for(int i=0;i<s.length();i++){
            ans+=s[i];
            int K=k[i%n];
            if(K==52){
                K=0;
            }
            if(K>=26){
                K-=26;
                if(islower(ans[i]))ans[i]=toupper(ans[i]);
                else if(isupper(ans[i]))ans[i]=tolower(ans[i]);
            }
            if(islower(ans[i])){
                if(ans[i]-'a'<K){
                    ans[i]='Z'+1-(K-(ans[i]-'a'));
                }else{
                    ans[i]=ans[i]-K;
                }
            }
            else if(isupper(ans[i])){
                if(ans[i]-'A'<K){
                    ans[i]='z'+1-(K-(ans[i]-'A'));
                }else{
                    ans[i]=ans[i]-K;
                }
            }
        }
        cout<<ans<<endl;
    }
    
    return 0;
}

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

#pragma warning(disable : 4996)

using namespace std;

int n, k, r[100]; string S;

const string T = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main()
{
	while (true)
	{
		scanf("%d", &n);

		if (n == 0) break;

		for (int i = 0; i < n; i++)
		{
			scanf("%d", &r[i]);;
		}

		cin >> S;

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

			for (int j = 52; j < 104; j++)
			{
				if (S[i] == T[j]) key = j;
			}

			key -= r[i % n]; S[i] = T[key];
		}

		cout << S << endl;
	}

	return 0;
}

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

char list[52];

char Decoding(char c,int key){
  
  int num;
  
  if(c >= 'A' && c <= 'Z'){
    num=c-65;
  }else{
    num=c-71;
  }

  num=(num+51*key)%52;
  
  return list[num];
  
}
int main(){

  string str;
  int n;
  int key[52];

  for(int i=0 ; i+65 <= 90 ; i++)list[i]=i+65;
  for(int j=0 ; j+97 <= 122 ; j++)list[j+26]=j+97;

  while(1){
    
    cin >>n;
    if(n == 0)break;
    
    for(int i=0 ; i < n ; i++)cin >>key[i];
    
    cin >>str;
    
    for(int i=0 ; i < str.size() ; i++){
      cout <<Decoding(str[i],key[i%n]);
    }
    
    cout <<endl;
    
  }
  
  return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
// #define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>
#include <iomanip>    // 10????????? cout << setprecision(10) << double;
#include <queue>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef map<int, int> MAPII;
typedef multimap<int, char, greater<int> > MuMAPIC;
typedef vector<pair<int, int> > VPII;
typedef multimap<int, string, greater<int> > MuMIS;
typedef pair<int, int> P;
typedef pair<int, pair<P, P> > PP;

#define MP make_pair
#define FAST_IO  cin.tie(0); ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
//for gcc (???test)
// #define FOREACH_IT(it,c) for(typeof(c)::iterator it=(c).begin(); it!=(c).end(); ++it)
//for Visual Studio
#define foreach_it(type,it,c) for(type::iterator it=c.begin(),c_end=c.end();it!=c_end;++it)
// for Debug.
#define DUMP_VVI(b) FOR(i,0,b.size()){FOR(j,0,b[i].size())printf("%d ",b[i][j]);puts("");}
#define D_OUT(str,value) if(dbgF){cout<<str<<" : "<<value<<endl;}
// ??\??????push_back(d)???array[d]???????????????1??????§?????????
// int INPUT_INT() {int d;cin>>d;return d;}
template<class T>T IN() { T d; cin >> d; return d; }
// ??????§????¢??´????°???Greatest Common Divisor???
LL gcd(LL a, LL b) { return (b > 0) ? gcd(b, a%b) : a; }
// ?????°?????¢??????°???Least Common Multiple???
LL lcm(LL a, LL b) { return a / gcd(a, b) * b; }
// Y???´???????????????´?????????
bool uruu(LL Y) { return (((Y % 4 == 0 && Y % 100 != 0) || Y % 400 == 0) ? true : false); }

// vector???¨???
// vec[i][j]?????????????\????????\?????????¨??????vec???????????????????????????????????????.

#define INF 1000000

// ????????????????°???????????????§???

// ------------------- include, typedef, define END. -------------------



int main() {
	int n = 0;

	while (cin >> n, n) {
		VI k(n + 1, 0);
		string s;
		FOR(i, 0, n) {
			k[i] = IN<int>();
		}
		cin >> s;

		int j = -1;
		FOR(i, 0, s.length()) {
			j++;
			if (j >= n) {
				j = 0;
			}

			FOR(a, 0, k[j]) {
				s[i]--;
				if (s[i] == 96)s[i] = 90;
				if (s[i] == 64)s[i] = 122;
			}

			cout << s[i];
		}
		cout << endl;

	}

	return 0;
}