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 <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const ll MOD=1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
const double eps=1e-10;

int dx[]={1, 0, -1, 0};
int dy[]={0, -1, 0, 1};

int main(){
    string pat = "";
    for(int i=0; i<26; i++){
        pat += ('a' + i);
    }
    for(int i=0; i<26; i++){
        pat += ('A' + i);
    }

    while(1){
        int n; cin>>n;
        if(n == 0) return 0;
        vector<int> k(n);
        for(int i=0; i<n; i++) cin>>k[i];
        string s; cin>>s;

        int cnt = 0;
        string ans = "";
        for(int i=0; i<s.size(); i++){
            for(int j=0; j<52; j++){
                if(s[i] == pat[j]){
                    ans += pat[(j - k[(cnt++) % n] + 52) % 52];
                    break;
                }
            }
        }

        cout << ans << endl;
    }
}

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

#define rep(idx, max)			for(int idx = 0, idx##Max = (max); idx < idx##Max; idx ++)
#define rrep(idx, min, max)	for(int idx = (min), idx##Max = max; idx < idx##Max; idx ++)
#define erep(idx, min, max)	for(int idx = (min), idx##Max = max; idx <= idx##Max; idx ++)

#define rev(idx, max)			for(int idx = (max) - 1; idx >= 0; idx --)
#define rrev(idx, min, max)	for(int idx = (max) - 1, idx##Min = (min); idx >= idx##Min; idx --)
#define erev(idx, min, max)	for(int idx = (max), idx##Min = (min); idx >= idx##Min; idx --)

#define foreach(it, obj)	for(auto it = obj.begin(), it##End = obj.end(); it >= it##End; it ++)

using namespace std;

int main()
{
	static char stationID[]	= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	int n;
	int	key[128];
	int	ids[128];
	string enc;
	while(cin >> n, n)
	{
		rep(i, n)	{	::scanf("%d", key + i);	}
		
		cin >> enc;
		rep(i, enc.size())
		{
			ids[i] = ('a' <= enc[i] && enc[i] <= 'z') ? (enc[i] - 'a') : (enc[i] - 'A' + 26);
		}
		rep(i, enc.size())	{	enc[i] = stationID[(52 + ids[i] - key[i % n]) % 52];	}
		cout << enc << endl;
	}
	return(0);
}

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

int main() {
	int n;
	while(cin >> n && n){
		int k[101] = {0};
		for(int i = 0; i < n; ++i){
			cin >> k[i];
		}
		char s[128];
		scanf("%s", s);
		for(int i = 0; i < strlen(s); ++i){
			if(k[i % n]){
				if(s[i] - k[i % n] <= 64 && s[i] <= 90){
					s[i] = s[i] - k[i % n] + 52;
					if(90 < s[i] && s[i] < 97)
						s[i] += 6;
				}
				else if(70 < s[i] - k[i % n] && s[i] - k[i % n] < 97 && s[i] >= 97){
					s[i] = s[i] - k[i % n] - 6;
				}
				else if(s[i] >= 97 && s[i] - k[i % n] <= 70){
					s[i] = 52 + s[i] - k[i % n];
				}
				else{
					s[i] -= k[i % n];
				}
			}
		}
		printf("%s\n", s);
	}
	/*printf("%d\n", 'A');
	printf("%d\n", 'Z');
	printf("%d\n", 'a');
	printf("%d\n", 'z');
	printf("%d\n", '@');*/
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(x) x.begin(),x.end()

char sub(char ch,int x){
    if('a'<=ch && ch<='z'){
        if(ch-x<'a')return ('Z'+1-('a'-(ch-x)));
    }else{
        if(ch-x<'A')return ('z'+1-('A'-(ch-x)));
    }
    return ch-x;
}

int main(){
    int n;
    while(cin>>n){
        vi key;
        if(n==0)return 0;
        rep(i,n){
            int tmp;
            cin>>tmp;
            key.pb(tmp);
        }
        string s;
        cin>>s;
        int len=s.size();
        rep(i,len){
            cout<<sub(s[i],key[i%key.size()]);
        }
        cout<<endl;
        
        
    }
    
    return 0;
}

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

using namespace std;

typedef long long ll;

ll n,m;
ll y[200];

bool solve(){
	cin >> n;
	if(n == 0)return false;
	ll x[200];
	for(int i=0;i<n;i++){
		cin >> x[i];
	}
	char s[200];
	cin >> s;
	m = strlen(s);
	int num = 0;
	for(int i=0;i<m;i++){
		if(s[i] >= 'a'){
			num = s[i] - 71;
		}else{
			num = s[i] - 65;
		}
		if(num - x[i%n] >= 0){
			cout << (char)(y[num - x[i%n]]);
		}else{
			cout << (char)(y[num - x[i%n] + 52]);
		}
	}
	cout << endl;
	return true;

}

int main(){
	for(int i=0;i<26;i++){
		y[i] = 65 + i;
	}
	for(int i=26;i<52;i++){
		y[i] = 97 + i - 26;
	}
	while(solve()){}
}

C++: #include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define REP(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;
const int MAX_N=100;
int k[MAX_N];
int n;
string s;
void solve(){
  int p=0, u,l;
  for(char c:s){
    u=c-'A';
    l=c-'a';
    if(l>=0){
      l-=k[p];
      if(l<-26)cout<<(char)(l+'a'+52);
      else if(l<0)cout<<(char)(l+'A'+26);
      else cout<<(char)(l+'a');
    }else{
      u-=k[p];
      if(u<-26)cout<<(char)(u+'A'+52);
      else if(u<0)cout<<(char)(u+'a'+26);
      else cout<<char(u+'A');
    }
    p=(p+1)%n;
  }
  cout<<endl;
}
int main(){ _;
  while(cin>>n,n!=0){
    REP(i,n)cin>>k[i];
    cin>>s;
    solve();
  }
}