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 _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
#define REP(i,a,b) for(i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
#define ll long long
#define ull unsigned ll
typedef long double ld;
#define ALL(a) (a).begin(),(a).end()
#define ifnot(a) if(not a)
#define dump(x)  cerr << #x << " = " << (x) << endl
using namespace std;

void reader(int &a) { scanf("%d", &a); }
void reader(double &a) { scanf("%lf", &a); }
void reader(char a[]) { scanf("%s", a); }
void reader(char &a) { scanf(" %c", &a); }
void reader(ll &a) { scanf("%lld", &a); }
void reader(ull &a) { scanf("%llu", &a); }
// void reader(string& a){cin >> a;};
template<class T, class U> void reader(T& t, U& u) { reader(t); reader(u); }
template<class T, class U, class V> void reader(T& t, U& u, V& v) { reader(t); reader(u); reader(v); }

void writer(const int a, char c) { printf("%d", a); putchar(c); }
void writer(const ll a, char c) { printf("%lld", a); putchar(c); }
void writer(const ull a, char c) { printf("%llu", a); putchar(c); }
void writer(const double a, char c) { printf("%.20lf", a); putchar(c); }
void writer(const char a[]) { printf("%s", a); };
void writer(const char a[], char c) { printf("%s", a); putchar(c); };
void writer(const char a, char c) { putchar(a); putchar(c); };
template<class T> void writerLn(T t) { writer(t, '\n'); }
template<class T, class U> void writerLn(T t, U u) { writer(t, ' '); writer(u, '\n'); }
template<class T, class U, class V> void writerLn(T t, U u, V v) { writer(t, ' '); writer(u, ' '); writer(v, '\n'); }
template<class T> void writerArr(T x[], int n) { int i; if (!n) { putchar('\n'); return; }rep(i, n - 1) writer(x[i], ' '); writer(x[n - 1], '\n'); }
template<class T> void writerVec(vector<T> x) { int n = x.size(); int i; if (!n) { putchar('\n'); return; }rep(i, n - 1) writer(x[i], ' '); writer(x[n - 1], '\n'); }

vector<string> split(const string &str, char sep) { vector<string> v; stringstream ss(str); string buffer; while (getline(ss, buffer, sep)) { v.push_back(buffer); }return v; }
// #define int ll
bool test = 1;
int dx[] = { 0,1,0,-1 };
int dy[] = { 1,0,-1,0 };
#define MAX 300000
//.....................
ull mod = (int)1e9 + 7;

struct Rank {
	int num;
	int AC_cnt;
	int t;
	bool operator < (const Rank& r) const {
		if (AC_cnt < r.AC_cnt) return true;
		if (AC_cnt == r.AC_cnt) {
			if (t > r.t) return true;
			if (t == r.t) {
				if (num < r.num) return true;
			}
		}
		return false;
	}
};

signed main(void)
{
	int i, j, k;
	while (1) {
		int n;
		cin >> n;
		if (n == 0) return 0;
		int k[100];
		rep(i, n) {
			cin >> k[i];
		}
		string s;
		cin >> s;
		rep(i, s.size()) {
			int num = tolower(s[i])-'a';
			if (isupper(s[i])) num += 26;
			num -= k[i%n];
			if (num < 0) num += 52;
			s[i] = 'a' + num % 26;
			if (num >= 26) s[i] = toupper(s[i]);
		}
		cout << s << endl;
	}
	return 0;
}

C++: // 2017-02-21
#include <iostream>
#include <string>
using namespace std;

int main() {
	int n;
	while (cin >> n, n) {
		int k[100];
		string s;
		for (int i = 0; i < n; i++) {
			cin >> k[i];
		}
		cin >> s;
		for (int i = 0; i < s.length(); i++) {
			char d;
			if (s[i] >= 'A' && s[i] <= 'Z') {
				d = s[i] - 'A';
			} else {
				d = s[i] - 'a' + 26;
			}
			d = (52 + d - k[i % n]) % 52;
			if (d < 26) {
				s[i] = d + 'A';
			} else {
				s[i] = d + 'a' - 26;
			}
		}
		cout << s << endl;
	}
	return 0;
}

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

class Solve {
private:
public:
    bool is_last_;
    Solve()
    {
        int n;
        std::cin >> n;
        if (n == 0)
        {
            is_last_ = true;
            return;
        }
        std::vector<int> k(n);
        for (auto& e: k) std::cin >> e;
        std::string s;
        std::cin >> s;
        for (int i{}; i < (int)s.size(); i++)
        {
            int p{(52 - k[i % n])};
            if ('a' <= s[i] && s[i] <= 'z')
                p += s[i] - 'a';
            else
                p += s[i] - 'A' + 26;
            p %= 52;
            if (p < 26) putchar('a' + p);
            else putchar('A' + p - 26);
        }
        putchar('\n');
    }
};

int main()
{
    while (!Solve().is_last_);
}

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;
            s[i] = s[i]>25?s[i]+'A'-26:s[i]+'a';
        }
        puts(s);
	}

	return 0;
}