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

// ?????¬???????????¬??????
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n; ++i)
#define REPI(i,x,n) for(int i=x; i<=(int)n; ++i)
#define ILP while(true)
#define FOR(i,c) for(__typeof((c).begin())!=(c).begin(); i!=(c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#pragma endregion

// ???
#pragma region TYPE_DEF
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long double> vld;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<string> vs;
#pragma endregion

// Effective std
#pragma region ESTD
template<typename C, typename T> int count(C& c, T t) { return count(ALL(c), t); }
template<typename C, typename F> int count_if(C& c, F f) { return count_if(ALL(c), f); }
template<typename C, typename T> void erase(C& c, T t) { remove(ALL(c), t), c.end(); }
template<typename C> void remove(vector<C>& c, unsigned int index) { c.erase(c.begin()+index); }
template<typename C, typename T, typename U> void replace(C& c, T t, U u) { replace(ALL(c), t, u); }
template<typename C, typename F, typename U> void replace_if(C& c, F f, U u) { (ALL(c), f, u); }
template<typename C> void reverse(C& c) { reverse(ALL(c)); }
template<typename C> void sort(C& c) { sort(ALL(c)); }
template<typename C, typename Pred> void sort(C& c, Pred p) { sort(ALL(c), p); }
#pragma endregion

// ?????°
#pragma region CONST_VAL
constexpr int PI = (2*acos(0.0));
constexpr int EPS = (1e-9);
constexpr int MOD = (int)(1e9+7);
constexpr int INF = 100000000;
#pragma endregion

#define int long long


signed main()
{
    int n;
    while(cin>>n, n) {
        vector<int> v(n);
        for(int i=0; i<n; ++i) cin >> v[i];
        string s;
        cin >> s;

        string ans = "";
        int cnt = 0;
        for(int i=0; i<s.size(); ++i) {
            char c = s[i];
            if(cnt>=v.size()) cnt = 0;
            for(int j=0; j<v[cnt]; ++j) {
                if(c=='a') c = 'Z';
                else if(c=='A') c = 'z';
                else c--;
            }
            ans += c;
            cnt++;
        }
        cout << ans << endl;
    }
    return 0;
}

C++: #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;
    }
}

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

char calc(char a,int i){
	int b=static_cast<int>(a);
	b-=i;
	if(b<65)b+=58;
	else if(b<97&&b>90)b-=6;
	a=static_cast<char>(b);
	return a;
}

int main(){
	int n,key[101];
	std::string str;
	while(std::cin>>n,n){
		for(int i=0;i<n;i++)std::cin>>key[i];
		std::cin>>str;
		for(int i=0;i<str.size();i++){
			if(i>=n)key[i]=key[i-n];
			str[i]=calc(str[i],key[i]);
		}
		std::cout<<str<<std::endl;
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
#include <unordered_map>  
#include <algorithm>
#include <functional>
#include <map>
#include <string>
#include <sstream>
#include <cmath>
#include <float.h>
using namespace std;

int main() {
	unsigned int n, key[100], key_pos = 0;
	string s;
	cin >> n;
	while (n != 0) {
		for (unsigned int i = 0; i < n; ++i) {
			cin >> key[i];
		}
		cin >> s;
		key_pos = 0;
		for (unsigned int i = 0; i < s.length(); ++i) {
			char tmp = s[i] - key[key_pos];
			if (tmp < 'A') tmp = 'z' - (key[key_pos] - (s[i] - '@'));
			else if (s[i] > 'Z' && tmp < 'a') tmp -= 6;
			++key_pos;
			if (key_pos >= n) key_pos = 0;
			cout << tmp;
		}
		cout << endl;
		cin >> n;
	}
	return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <cstring>

using namespace std;

int num[108];

void decode(int l, int k[108], char s[108], char alph[56])
{	
	for(int i = 0; i < l; i++){
		if(s[i] >= 'a' && s[i] <= 'z'){
			num[i] = s[i] - 'a';
		}
		else{
			num[i] = s[i] - 'A' + 26;
		}
		if(num[i] - k[i] < 0){
			num[i] += 52 - k[i];
		}
		else{
			num[i] -= k[i];
		}
		cout << alph[num[i]];
	}
	puts("");
}


int main()
{
	int n, m, l;
	int k[108];
	char s[108];
	char alph[56];
	
	for(int i = 0; i < 26; i++){
		alph[i] = 'a' + i;
	}
	for(int i = 0; i < 26; i++){
		alph[i + 26] = 'A' + i;
	}

	
	while(scanf("%d", &n) != EOF){
		if(n == 0) break;
		for(int i = 0; i < n; i++){
			cin >> k[i];
		}
		cin >> s;
		
		m = n;
		l = strlen(s);
		while(l > m){
			for(int i = 1; i <= n; i++){
				k[m + i - 1] = k[i - 1];
			}
			m += n;
		}
		decode(l, k, s, alph);
	}
	return 0;
}