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>
using namespace std;
 
int main(){
 
  int n, k[100], x, i, j;
  string sta="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", s;
 
  while(cin>>n, n){
    for(i=0;i<n;i++) cin>>k[i];
    cin>>s;
 
    for(i=0;i<s.size();i++){
      for(j=0;j<56;j++){
    if(s[i]==sta[j]){
      x=j-k[i%n];
      if(x<0){
        x+=52;
        break;
      }else break;
    }
      }
      cout<<sta[x];
    }
    cout<<endl;
  }
  return 0;
}

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>
#include <string>
using namespace std;
int main(){
	string alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	while( 1 ){
		int n;
		cin >> n;
		if( n == 0 ) break;
		int k[100];
		for( int i = 0; i < n; i++ ){
			cin >> k[i];
		}
		string s;
		cin >> s;
		int a = 0;
		string out;
		for( int i = 0; i < s.length(); i++ ){
			for( int j = 52; j < alpha.length(); j++ ){
				if( s[i] == alpha[j] ){
					out[a] = alpha[j-k[i%n]];
					cout << out[a++];
				}
			}
		}
		//out[a] = '\0';
		cout << out << endl;
	}
}

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

int main(){
  while(1){
    int n;
    cin >> n;
    if(n==0) break;

    vector<int> key(n);
    for(int i=0; i<n; i++){
      cin >> key[i];
    }
    string str;
    cin >> str;

    for(int i=0; i<str.size(); i++){
      for(int j=0; j < key[i%n]; j++){        
        if(str[i]=='a') str[i]='Z';
        else if(str[i]=='A') str[i]='z';
        else str[i]--;
      }
    }

    cout << str << endl;
  }

  return 0;
}

C++: #include<iostream>
#include<cmath>
#include<string>
#include<cstring>
#include<cstdlib>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int n;
	string s;
	char c[52];
	rep(i,26)c[i]=(char)(i+'a');
	loop(i,26,52)c[i]=(char)(i-26+'A');
	while(cin>>n,n){
		int key[n];
		rep(i,n)cin>>key[i];
		cin>>s;
		rep(i,s.size()){
			rep(j,52){
				if(s[i]==c[j]){
					s[i]=c[(j-key[i%n]+52)%52];
					break;
				}
			}
		}
		cout<<s<<endl;
	}
	return 0;
}