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 <cstdio>
#include <cstdlib>
#include <string>

using namespace std; 

string list = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main()
{
 int n, l, p;
 string s, ans;

 while(cin >> n){
	if(n==0){return 0;} ans = "";
	int* key = new int[n];
	for(int i=0; i<n; i++){cin >> key[i];}
	cin >> s; l=s.length();
	for(int i=0; i<l; i++){
		p = (list.find(s.substr(i,1))-key[i%n]+104)%52;
		ans += list.substr(p,1);
	}
	cout << ans << endl; delete[] key;
 }
}

C++: #include <iostream>
#include <vector>
using namespace std;

int main()
{
	int n;
	while (cin >> n, n) {
		vector<int> key(n);
		for (int i = 0; i < n; i++) {
			cin >> key[i];
		}
		string str;
		cin >> str;
		for (int i = 0; i < str.length(); i++) {
			if (str[i] >= 'a' && str[i] <= 'z') {
				if (str[i] - key[i % n] >= 'a')
					str[i] -= key[i % n];
				else {
					str[i] += 'A' - 'a' + 26 - key[i % n];
					if (str[i] < 'A')
						str[i] += 'a' - 'A' + 26;
				}
			}
			else {
				if (str[i] - key[i % n] >= 'A')
					str[i] -= key[i % n];
				else {
					str[i] += 'a' - 'A' + 26 - key[i % n];
					if (str[i] < 'a')
						str[i] += 'A' - 'a' + 26;
				}
			}
		}
		cout << str << endl;
	}
	return 0;
}

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

using namespace std;

string pat;

char change(char ch, int x)
{
    int p = pat.find(ch);
    return pat[(p - x + 52) % 52];
}

void make_pat()
{
    for (int i = 0; i < 26; i++) {
        pat += (char)('A' + i);
    }
    for (int i = 0; i < 26; i++) {
        pat += (char)('a' + i);
    }
}

int main()
{
    make_pat();
    
    int N;
    while (cin >> N, N) {
        vector<int> a(N);
        for (int i = 0; i < N; i++) {
            cin >> a[i];
        }
        string s;
        cin >> s;
        for (int i = 0; i < (int)s.size(); i++) {
            int x = a[i % N];
            cout << change(s[i], x);
        }
        cout << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;

int main(){
	char tbl[100] = "";
	int rtbl[128] = {};
	int x = 0;
	for(char c = 'a'; c <= 'z'; ++c){
		tbl[x] = c;
		rtbl[c] = x;
		++x;
	}
	for(char c = 'A'; c <= 'Z'; ++c){
		tbl[x] = c;
		rtbl[c] = x;
		++x;
	}

	int n;
	while(cin >> n, n){
		vector<int> k(n);
		for(int i = 0; i < n; ++i){
			cin >> k[i];
		}
		string s, t;
		cin >> s;

		x = 0;
		for(int i = 0; i < s.size(); ++i){
			t += tbl[(rtbl[s[i]] - k[x] + 52) % 52];
			x = (x + 1) % n;
		}
		cout << t << endl;
	}
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#pragma warning(disable:4996)
using namespace std;

const int My_Inf=2147483647;
const long long int My_LInf=9223372036854775807;

map<char, int>mp;
map<int, char>revmp;
int main() {
	for (int i = 0; i < 26; ++i) {
		revmp[i] = 'a' + i;
		mp['a' + i] = i;
	}
	for (int i = 0; i < 26; ++i) {
		revmp[i+26] = 'A' + i;
		mp['A' + i] = i+26;
	}
	while (1) {
		int N; cin >> N;
		if (!N)break;
		vector<int>backs;
		for (int i = 0; i < N; ++i) {
			int a; cin >> a; backs.emplace_back(a);
		}
		string st; cin >> st;
		int num = 0;
		for (int i = 0; i < st.size(); ++i) {
			int a(mp[st[i]]);
			a = a + 52 - backs[num];
			a %= 52;
			cout << revmp[a];
			num++;
			num %= N;
		}
		cout << endl;
	}
	return 0;
}