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 <vector>
#include <list>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <cstdio>
#include <climits>
#include <complex>
#include <cstdint>
#include <tuple>

#define M_PI       3.14159265358979323846

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }
inline int readInt() { int x; scanf("%d", &x); return x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
struct Edge {
    int to, cost;
    Edge(int to, int cost): to(to), cost(cost) {}
};

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<Edge>> AdjList;
AdjList graph;

const int INF = 100000000;

LL N, M;

map<int, char> mp;

int main() {
    //cout << fixed << setprecision(15);
    int n;
    while(cin >> n){
        if(n == 0) break;
        vector<int> v;
        REP(i, n){
            int a = readInt();
            v.push_back(a);
        }

        string s; cin >> s;

        int cnt=0;
        for(int i=0; i<s.size(); ++i){
            int num = v[cnt%n];

            char c = s[i];
            int next;

            if(c>='A' && c<='Z'){
                next = (s[i]-'A')-num;
                if(next>=0){
                    s[i] = (char)(next+'A');
                }else{
                    int ababa=0;
                    while(next<0){
                        next += 26;
                        ababa++;
                    }
                    if(ababa%2==0) {
                        s[i] = (char) (next + 'A');
                    }else{
                        s[i] = (char) (next + 'a');
                    }
                }
            }else{
                next = s[i]-'a' -num;
                if(next>=0){
                    s[i] = (char)(next+'a');
                }else{
                    int ababa=0;
                    while(next<0){
                        next += 26;
                        ababa++;
                    }
                    if(ababa%2==0) {
                        s[i] = (char) (next + 'a');
                    }else{
                        s[i] = (char) (next + 'A');
                    }
                }
            }


            cnt++;
        }
        cout << s << endl;
    }
    return 0;
}

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

char unlock(char ld,int key){
	if(96<ld)ld-=6;
	ld-=key;
	if(90<ld)ld+=6;
	if(ld<65)ld+=58;
	return ld;
}

int main(){
	while(true){
		int n;
		vector<int>key;
		vector<int>::iterator ki;
		string data;
		cin>>n;
		if(n==0)break;
		key.resize(n);
		ki=key.begin();
		for(int i=0;i<n;i++)cin>>key[i];
		cin>>data;
		for(string::iterator di=data.begin();di!=data.end();++di){
			*di=unlock(*di,*ki);
			ki++;
			if(ki==key.end())ki=key.begin();
		}
		cout<<data<<endl;
	}
	return 0;
}

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

int main() {
	int n;
	while (cin >> n, n) {
		int key[102];
		for (int i = 0;i < n;i++) {
			cin >> key[i];
		}
		string h = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
		string s;
		cin >> s;

		for (int i = 0;i < s.size();i++) {
			if (s[i] >= 'a'&&s[i] <= 'z') {
				int a = s[i]-'a';
				a -= key[i%n];
				a %= 52;
				if (a < 0)a += 52;
				s[i] = h[a];
			}
			else {
				int a = s[i] - 'A' + 26;
				a -= key[i%n];
				a %= 52;
				if (a < 0)a += 52;
				s[i] = h[a];
			}
		}
		cout << s << endl;
	}
	return 0;
}

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

const int MAX_N=101;

int n,j;
vector<int> keys(MAX_N);
string s,alp="";

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    for (int i=0;i<26;++i) alp+='a'+i;
    for (int i=0;i<26;++i) alp+='A'+i;
    while(cin >> n,n){
        for (int i=0;i<n;++i) cin >> keys[i];
        cin >> s;
        for (int i=0;i<s.size();++i){
            for (j=0;j<52;++j) if (s[i]==alp[j]) break;
            j=(j+52-keys[i%n])%52;
            s[i]=alp[j];
        }
        cout << s << '\n';
    }
}