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 <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>

using namespace std;

int reverse_info[128];
char info[52];

void func(int N){
	int key[N],div;

	for(int i = 0; i < N; i++)scanf("%d",&key[i]);

	char buf[101];

	scanf("%s",buf);

	for(int i = 0; buf[i] != '\0'; i++){
		div = key[i%N];

		if(reverse_info[buf[i]] - div >= 0){
			printf("%c",info[reverse_info[buf[i]] - div]);
		}else{
			printf("%c",info[reverse_info[buf[i]] + 52 - div]);
		}
	}
	printf("\n");
}

int main(){

	int N;

	for(int i = 0; i <= 25; i++){
		info[i] = 'a' + i;
		reverse_info[info[i]] = i;
		info[26+i] = 'A' + i;
		reverse_info[info[26+i]] = 26+i;
	}

	while(true){
		scanf("%d",&N);
		if(N == 0)break;

		func(N);
	}

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

#define for_(i,a,b) for(int i=(a);i<(b);++i)

int main() {
	string L = "";
	for_(i,0,26) L += char('a' + i);
	for_(i,0,26) L += char('A' + i);
	
	int n;
	while (cin >> n, n) {
		vector< int > k(n);
		for_(i,0,n) cin >> k[i];
		
		string s;
		cin >> s;
		
		int m = s.size();
		for_(i,0,m) {
			int pos = L.find(s[i]);
			s[i] = L[(pos - k[i%n] + 52) % 52];
		}
		cout << s << endl;
	}
}

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] - '@'));
			else 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>
#include<cstdlib>
#include<sstream>
#include<queue>
#include<deque>
#include<cmath>
#include<algorithm>
#include<stack>
#include<map>
#include<set>
#include<iomanip>
#define INF 2147483647
#define lli long long int
#define MOD 1000000007

using namespace std;
typedef vector<int> vi;
typedef vector< vector<int> > vvi;
typedef pair<int,int> pii;
typedef vector<pair<int,int>> vpii;


//A???65 a???97
int main() {
	vector<char> eki(52);
	eki[0] = 65;
	eki[26] = 97;
	for (int i = 1; i < 26; i++){
		eki[i] = eki[i-1] + 1;
		eki[26+i] = eki[26+i-1] + 1;
	}

	while(1){
		int n; cin >> n;
		if (n == 0) break;
		vi key(n);
		for (int i = 0; i < n; i++){
			cin >> key[i];
		}

		string station; cin >> station;
		string ans = "";
		for (int i = 0; i < station.size(); i++){
			if (isupper(station[i])){
				ans += eki[(station[i]-'A'-key[i%n]+52)%52];
			}else{
				ans += eki[(station[i]-'a'+26-key[i%n]+52)%52];
			}
		}
		cout << ans << endl;

	}

	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
#include<random>
#include<ctime>
#include<set>
using namespace std;


const long long int mod=1000000007;
const long long int INF=99999999999999999;

long long int n;
char returneki[60];
map<char,long long int>eki;

int main() {
    cin>>n;
	for(char i='a';i<='z';i++){
		eki[i]=i-'a';
	}
	for(char i='A';i<='Z';i++){
		eki[i]=i-'A'+26;
	}
	for(int i=0;i<26;i++){
		returneki[i]='a'+i;
		returneki[i+26]='A'+i;
	}
	while(n!=0){
		long long int now=0,k[105];
		string str,res;
		for(int i=0;i<n;i++){
			cin>>k[i];
		}
		cin>>str;
		for(int i=0;i<str.length();i++){
			res+=returneki[(eki[str[i]]-k[now%n]+52)%52];
			now++;
		}
		cout<<res<<endl;
		cin>>n;
	}
	
}

C++: #include<bits/stdc++.h>
using namespace std;

#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
typedef pair<int,int> P;

//-----------------------------------------------------------------------

int n,k[100];
string str="abcdefghijklmnopqrstuvwxyz"
           "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
signed main()
{   
    cin.tie(0);
    ios::sync_with_stdio(false);

    str+=str;
    while(cin>>n,n)
    {   
        REP(i,n) cin>>k[i];
        string s; cin>>s;
        
        REP(i,s.size()){
            int j=0;
            while(s[i]!=str[j]) j++;
            cout<<str[j+52-k[i%n]];
        }
        cout<<endl;
    }
}

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

int main(void)
{
	 int n;
	 int k[52];
	 char s[100];
	 while(cin >> n && n != 0){
	 	for (int i = 0; i < n; ++i)
	 	{
	 		cin >> k[i];
	 	}
	 	k[n] = 0;
	 	cin >> s;
	 	int c = 0;
	 	for (int i = 0; s[i] != '\0'; ++i)
	 	{
	 		if((char)(s[i] - k[c]) < 'a' && (char)(s[i] - k[c]) > 'Z'){
	 			cout << (char)('Z' - (k[c] - (s[i] - 'a') - 1));
	 		}else if((char)(s[i] - k[c]) < 'A'){
	 			cout << (char)('z' - (k[c] - (s[i] - 'A') - 1));
	 		}else{
	 			cout << (char)(s[i] - k[c]);
	 		}
	 		c++;
	 		if(k[c] == 0){
	 			c = 0;
	 		}
	 	}
	 	cout << endl;
	 }
}