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 <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;
			}
			int  now = s[i] - k[j];
			if (now>90&&now < 97)now -= 6;
			if (now < 65)now += 122 - 64;//z-@
			char nowc = now;
			cout << nowc;
		}
		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++){
			int tmp;
			cin >> tmp;
			key[i] = tmp % 52;
		}
		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 rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e12;
string str;

char change(char c, int k){
    int idx = 0;
    rep(i, 52, str.size()){
        if(str[i] == c){
            idx = i; break;
        }
    }
    return str[idx - k];
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    rep(i, 0, 26) str += 'a' + i;
    rep(i, 0, 26) str += 'A' + i;
    str += str;
    while(1){
        cin >> n;
        if(n == 0) break;
        vector<int> a(n);
        rep(i, 0, n) cin >> a[i];
        string s;
        cin >> s;
        rep(i, 0, s.size()){
            s[i] = change(s[i], a[i % n]);
        }
        cout << s << endl;
    }
}

C++: #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
typedef long long Int;
string str;
char b(char x){
	if(x == 'A')return 'z';
	if(x == 'a')return 'Z';
	return x - 1;
}

int main(){
	int a[1080], n;
	while(cin >> n, n){
		for(int i = 0;i < n;i++)cin >> a[i];
		cin >> str;
		for(int i = 0;i < str.size();i++){
			int c = str[i];
			for(int j = 0;j < a[i % n];j++)c = b(c);
			cout <<(char)c;
		}cout << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <numeric>
using namespace std;
typedef long long int ll;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    while(1){
        int n; cin >> n;
        if(n==0)break;
        vector<int> a(n);
        for(int i=0;i<n;i++){
            cin >> a[i];
        }
        string s; cin >> s;
        for(int i=0;i<s.size();i++){
            for(int j=0;j<a[i%n];j++){
                if(s[i]=='a')s[i]='Z';
                else if(s[i]=='A')s[i]='z';
                else s[i]--;
            }
        }
        cout << s << endl; 
    }
}