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 <bits/stdc++.h>

using namespace std;

int toint(char c)
{
    if (c >= 'A') {
        return 26 + c - 'A';
    }
    return c - 'a';
}

char tochr(int i)
{
    if (i >= 26) {
        return 'A' + (char)(i - 26);
    } else {
        return 'a' + (char)(i);
    }
}

char decode(char c, int i)
{
    const int j = toint(c);
    char ch;
    if (j >= i) {
        ch = tochr(j - i);
    } else {
        ch = tochr(j + 52 - i);
    }
    if (ch == '`') {
        return 'Z';
    }
    return ch;
}

int main()
{
    while (true) {
        int n;
        cin >> n;
        if (n == 0) {
            break;
        }
        vector<int> k(n);
        for (int i = 0; i < n; i++) {
            cin >> k[i];
        }
        string s;
        cin >> s;
        for (int i = 0; i < s.size(); i++) {
            cout << decode(s[i], k[i % n]);
        }
        cout << 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;

void A();
void B();

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] - '@'));
			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;
}

void 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;

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] - '@'));
			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 <iostream>
#include <vector>
#include <string>
using namespace std;

int main  ()
{
    int n;
    while (cin >> n, n) {
        vector<int> v(n);
        for (auto &i : v) cin >> i;
        string str;
        cin >> str;
        for (int i = 0; i < str.size(); i++) {
            if ('A' <= str[i] && str[i] <= 'Z') {
                int t = (str[i] - 'A' - v[i % v.size()]);
                if (t >= 0) {
                    cout << (char)('A' + t);
                } else if (t > -26) {
                    cout << (char)('z' + t + 1);
                } else {
                    cout << (char)('Z' + (t % 26) + 1);
                }
            } else {
                int t = (str[i] - 'a' - v[i % v.size()]);
                if (t >= 0) {
                    cout << (char)('a' + t);
                } else if (t > -26) {
                    cout << (char)('Z' + t + 1);
                } else {
                    cout << (char)('z' + (t % 26) + 1);
                }
            }
        }
        cout << endl;
    }

    return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	int n;
	cin >> n;
	int k[100];
	char s[101];
	while (n != 0) {
		for (int i = 0; i < n; i++) cin >> k[i];
		cin >> s;
		int j = 0;
		for (int i = 0; s[i] != '\0'; i++) {
			if (s[i] >= 'a') s[i] -= 6;
			s[i] -= k[j];
			if (s[i] < 'A') s[i] += 52;
			j++;
			if (j == n) j = 0;
		}
		for (int i = 0; s[i] != '\0'; i++) {
			if (s[i] > 'Z') s[i] += 6;
		}
		
		cout << s << endl;
	cin >> n;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> TUPLE;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;

string al = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    int n;
    while (cin >> n, n) {
        vector<int> k(n);
        rep(i, n) cin >> k[i];
        string s;
        cin >> s;
        string t = "";
        rep(i, s.size()) {
            int id;
            if ('a' <= s[i] && s[i] <= 'z') {
                id = s[i] - 'a';
            } else {
                id = s[i] - 'A' + 26;
            }
            t += al[(id - k[i % n] + 52) % 52];
        }
        cout << t << endl;
    }
}

C++: #include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(){
  int n;
  string s,list="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  while(cin >>n && n){
    vector < int > key(n);
    for(int i=0;i<n;i++) cin >> key[i];
    cin >> s;
    for(int i=0;i<s.size();i++) cout << list[(list.find(s[i])-key[i%n]+52)%52];
    cout << endl;
  }
}