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<vector>
#include <unordered_map>  
#include <algorithm>
#include <functional>
#include <map>
#include <string>
#include <sstream>
#include <cmath>
#include <float.h>
using namespace std;

void A();
void B();

int main() {
	unsigned int n, key[100], key_pos = 0;
	string s;
	int nyan;
	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 (s[i] >= 'a' && tmp < 'a' ) s[i] -= 6;
			if (tmp < 'A') tmp = 'z' - (key[key_pos] - (s[i] - '@' + 6));
			if (tmp > 'Z' && tmp < 'a') tmp -= 6;
			++key_pos;
			if (key_pos >= n) key_pos = 0;
			cout << tmp;
		}
		cout << endl;
		cin >> n;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

const string st = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
const int num = 52;

int main()
{
    int n;

    while (cin >> n, n) {
        string s;
        int k[105];
        int idx = 0;

        for (int i = 0; i < n; i++)
            cin >> k[i];
        cin >> s;

         for (int i = 0; i < s.size(); i++) {
             int tmp;
             if ('a' <= s[i] && s[i] <= 'z') 
                 tmp = (s[i] - 'a' - k[idx] + num) % num;
             else if ('A' <= s[i] && s[i] <= 'Z') 
                 tmp = (s[i] - 'A' - k[idx] + 26 + num) % num;

             cout << st[tmp];
             idx = (idx + 1) % n;
         }
         cout << endl;
    }

    return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
char V[53] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", T[105]; int t[999], n, i, j;
int main() {
	string S, U;
	while (true) {
		U = "";
		cin >> n;
		if (n == 0) { break; }
		for (i = 0; i < n; i++) { cin >> t[i]; }
		cin >> S;
		for (i = 0; i < S.size(); i++) {
			for (j = 0; j < 52; j++) {
				if (S[i] == T[j]) {
					U += T[(j - t[i%n] + 52) % 52];
				}
			}
		}
		cout << U << endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = int_fast64_t;
const int mod = 1e9 + 7;
const int inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;
#define fast() ios::sync_with_stdio(false), cin.tie(nullptr)
#define digit(N) cout << fixed << setprecision((N))
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string &s)
{
    return '"' + s + '"';
}

string to_string(const char *s)
{
    return to_string((string)s);
}

string to_string(bool b)
{
    return (b ? "true" : "false");
}

string to_string(vector<bool> v)
{
    bool first = true;
    string res = "{";
    for (int i = 0; i < static_cast<int>(v.size()); i++)
    {
        if (!first)
        {
            res += ", ";
        }
        first = false;
        res += to_string(v[i]);
    }
    res += "}";
    return res;
}

template <size_t N>
string to_string(bitset<N> v)
{
    string res = "";
    for (size_t i = 0; i < N; i++)
    {
        res += static_cast<char>('0' + v[i]);
    }
    return res;
}

template <typename A>
string to_string(A v)
{
    bool first = true;
    string res = "{";
    for (const auto &x : v)
    {
        if (!first)
        {
            res += ", ";
        }
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p)
{
    return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p)
{
    return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p)
{
    return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T)
{
    cerr << " " << to_string(H);
    debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

char calc(char c, int key)
{
    char r = c;
    if (key == 0)
        return c;
    if (c == 'A')
        r = 'z';
    else if (c == 'a')
        r = 'Z';
    else
        r--;
    return calc(r, key - 1);
}

int main()
{
    int N;
    while (cin >> N)
    {
        if (N == 0)
            return 0;

        vector<int> k(N);
        for (int i = 0; i < N; i++)
        {
            cin >> k[i];
        }

        string s;
        cin >> s;
        int index = 0;
        for (int i = 0; i < s.size(); i++)
        {
            index %= N;
            s[i] = calc(s[i], k[index]);
            index++;
        }

        cout << s << "\n";
    }
}