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<string>
#include<vector>

using namespace std;

int main()
{
	int n;
	while(cin >> n,n!=0)
	{
		vector<int> key(n);
		for(int i=0;i<n;i++)
			cin >> key[i];
		string s;
		cin >> s;
		int ss=s.size();

		for(int i=0;i<ss;i++)
		{
			int tmp;
			if('a'<=s[i] and s[i]<='z')
				tmp=s[i]-'a';
			else
				tmp=s[i]-'A'+(26);

			tmp-=(key[i%n]);
			while(tmp<0)
				tmp+=(2*('z'-'a'+1));
			tmp%=(2*('z'-'a'+1));

			if(tmp<26)
				s[i]=tmp+'a';
			else
				s[i]=tmp-26+'A';
			//if(s[i]<'A')s[i]+=(58);
			//else if(s[i]<'a') s[i]-=(6);
		}
		cout << s << endl;
	}

}

C++: #include <iostream>
#include <string>

using namespace std;

char decrypto(char c, int n) {
    if (n == 0) {
        return c;
    }
    if (c == 'a') {
        return decrypto('Z', n-1);
    }
    if (c == 'A') {
        return decrypto('z', n-1);
    }
    return decrypto(c-1, n-1);
}

int main() {
    int n;
    int k[100];
    string s;
    while (true) {
        cin >> n;
        if (n == 0) {
            return 0;
        }
        for (int i=0; i<n; i++) {
            cin >> k[i];
        }
        cin >> s;
        for (int i=0; i<(int)s.length(); i++) {
            cout << decrypto(s[i], k[i%n]);
        }
        cout << endl;
    }
}

C++: 
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2508

#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<climits>
#include<ctime>
#include<cstring>
#include<numeric>

#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;

using namespace std;

string eki = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main()
{
	int N;
	while(cin >> N && N)
	{
		vector<int> keys(N);
		rep(nth,N){
			cin >> keys[nth];
		}
		string S;
		cin >> S;
		
		string ans;
		int pos=0;
		rep( i, S.size() )
		{
			int num;
			if('a'<= S[i] && S[i] <= 'z'){
				num = S[i] - 'a';
			}
			else if('A' <= S[i] && S[i] <= 'Z'){
				num = S[i] - 39;
			}
			char res = eki[ ( num - keys[pos] + 52 ) % 52 ];
			pos = (pos+1)%N;
			ans += res;
		}
		cout << ans << endl;
	}
	return 0;
}

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


int main(){
	int n,a;
	int k[101];
	string s,moji = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	char c;
	while(1){
		cin >> n;
		if(n == 0)break;
		for(int i = 0;i < n;i++){
			cin >> k[i];
		}
		cin >> s;
		for(int i = 0;i < s.size();i++){
			c =  s[i];
			for(int j = 0;j < moji.size();j++){
				if(c == moji[j]){
					a = j - k[i%n];
					if(a < 0)a+=52;
					cout << moji[a];
					break;
				}
			}
		}
		cout << endl;
	}
	return 0;
}

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

int main() {
	int n;
	string s;
	while(1){
		cin>>n;
		if(n==0){ break;}
		int a[n];
		
		for(int i=0; i<n; i++){
			cin>>a[i];
		}
		cin>>s;
		int len=0;
		for(int i=0;;i++){
			if(s[i]=='\0')break;
			len++;
		}
		for(int i=0, j=0;i<len;j++,i++){
			if(j>=n) j=0;
			if(islower(s[i])){
				if((-'a'+s[i])<a[j]){
					s[i]+=(26-a[j]-32);
				}
				else s[i]-=a[j];
			}else{
				if((-'A'+s[i])<a[j]){
					s[i]+=(26-a[j]+32);
					
				}
				else s[i]-=a[j];
			}
		}
		cout<<s<<endl;
	}
}