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>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = (1LL << 31) - 1;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1
#define MAX_N 100100 * 3

int n;

string table = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main() {
	while (cin >> n&&n) {
		string s;
		int num[110];
		REP(i, n) {
			cin >> num[i];
		}
		cin >> s;
		int cnt = 0;
		REP(i, s.size()) {
			FOR(j, table.size() / 2 - 1, table.size()) {
				if (table[j] == s[i]) {
					s[i] = table[j - num[cnt]];
					break;
				}
			}
			cnt++;
			if (cnt == n)cnt = 0;
		}
		cout << s << endl;
	}
}

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

int main() {
  int n;
  int key[100];
  string s;
  
  while(cin >> n, n) {
    for(int i = 0; i < n; i++) cin >> key[i];
    cin >> s;
    
    for(int i = 0; i < s.length(); i++) {
      int temp = key[i%n];
      while(temp--) {
	if(s[i] == 'a') s[i] = 'Z';
	else if(s[i] == 'A') s[i] = 'z';
	else s[i]--;
      }
    }

    cout << s << endl;
  }

  return 0;
}

C++: #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <valarray>
#include <vector>

#define EPS 1e-9
#define INF 1070000000LL
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(__typeof((X).begin()) it=(X).begin();it!=(X).end();it++)
#define ite iterator
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define pb push_back
#define sec second
#define sz(x) ((int)(x).size())

using namespace std;

struct timer{
	time_t start;
	timer(){start=clock();}
	~timer(){cerr<<1.*(clock()-start)/CLOCKS_PER_SEC<<" secs"<<endl;}
};

typedef istringstream iss;
typedef long long ll;
typedef pair<int,int> pi;
typedef stringstream sst;
typedef vector<int> vi;

int n,k[111];
string s;

int dec(char c){
	if(islower(c))return c-'a';
	return c-'A'+26;
}

char code(int x){
	if(x<26)return 'a'+x;
	return 'A'+x-26;
}

int main(){
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	
	while(cin>>n && n){
		rep(i,n)cin>>k[i];
		cin>>s;
		rep(i,sz(s)){
			int d=dec(s[i]);
			d=(d-k[i%n]+52)%52;
			cout<<code(d);
		}
		cout<<endl;
	}
}

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

string mj;

void set(){
    for(int i = 0 ; i < 26 ; i++) mj += 'a'+i;
    for(char i = 26 ; i < 52 ; i++) mj += 'A'+i-26;
}

char change(int t,char ch){
    int i;
    for(i = 0 ; i < 52 ; i++){
        if(mj[i] == ch) break;
    }
    i -= t;
    if(i < 0) i+= 52;
    
    return mj[i];
}


int main(){
    int n,a[MAX];
    
    set();
    
    while(cin >> n,n){
        for(int i = 0 ; i < n ; i++) cin >> a[i];
        string str ,tmp = "";
        int k = 0;
        cin >> str;
        for(int i = 0 ; i < str.size() ; i++){
            tmp += change(a[k++],str[i]);
            if(k >= n) k = 0;
        }
        cout << tmp << endl;
    }

    return 0;
}

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

int main(){

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

string st;
char y[102],w;
cin>>st;
for(int i=0;i<st.size();i++)
{int d=n[i%N];
w=(st[i]-d);
if(w<'a'&&st[i]>='a'){int a='a'-w;w='Z'-a+1;}
if(w<'A'){int a='A'-w;w='z'-a+1;}
//int H=atoi(w);
cout<<w;
}
cout<<endl;
}
return 0;
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    int n;
    while(cin >> n, n){
        int key[105];
        rep(i,n){
            cin >> key[i];
        }
        string s;
        cin >> s;
        rep(i,s.size()){
            rep(j, key[i % n]){
                if(s[i] == 'a'){
                    s[i] = 'Z';
                }else if(s[i] == 'A'){
                    s[i] = 'z';
                }else{
                    s[i]--;
                }
            }
        }
        cout << s << endl;
    }
}