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<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--)
#define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define pb            push_back
template<class T, class S> inline pair<T, S> mp(T x, S y){ return make_pair(x, y); }
template<class T, class S> inline bool minup(T& m, S x){ return m>(T)x ? (m=(T)x, true) : false; }
template<class T, class S> inline bool maxup(T& m, S x){ return m<(T)x ? (m=(T)x, true) : false; }

static const int    INF = 1000000000;
static const ll     MOD = 1000000007LL;
static const double EPS = 1E-12;

int n;
string s;
string sa = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

inline bool isLower(char c){ return 'a' <= c && c <= 'z'; }
inline bool isUpper(char c){ return 'A' <= c && c <= 'Z'; }

int main()
{
  while(cin >> n, n){
    vi k(n);
    rep(i, n) cin >> k[i];
    cin >> s;
    int p = 0;
    vrep(v, s){
      rep(i, sa.size()) if(*v == sa[i] && i - k[p] >= 0){
        cout << sa[i - k[p]];
        break;
      }
      p = (p + 1) % k.size();
    }
    cout << endl;
  }


  /*
  while(cin >> n, n){
    vi k(n);
    rep(i, n) cin >> k[i];
    cin >> s;
    int p = 0;
    vrep(v, s){
      if(isLower(*v)){
        if(isLower(*v - k[p])){
          cout << (char)(*v - k[p]);
        }
        else{
          cout << (char)('Z' - 'a' + *v - k[p] + 1);
        }
      }
      else{
        if(isUpper(*v - k[p])){
          cout << (char)(*v - k[p]);
        }
        else{
          cout << (char)('z' - 'A' + *v - k[p] + 1);
        }
      }
      p = (p + 1) % k.size();
    }
    cout << endl;
  }
  */
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

vector<char> cmap;
char getrev(char c,int kagi){
	int rst;
	REP(i,cmap.size()) if(cmap[i]==c) rst = i;
	if(rst-kagi<0) return cmap[rst-kagi+cmap.size()];
	else return cmap[rst-kagi];
}
int main(){
	for(int i='a';i<'z'+1;i++) cmap.pb(i);
	for(int i='A';i<'Z'+1;i++) cmap.pb(i);

	while(1){
		int n;
		cin >> n;
		int klist[100];
		REP(i,n){
			cin >> klist[i];
		}
		string ango;
		cin >> ango;
		int nowkagi = 0;
		REP(i,ango.size()){
			cout << getrev(ango[i],klist[nowkagi]);
			if(nowkagi==n-1) nowkagi = 0;
			else nowkagi++;
		}
		cout << endl;
	}
}

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

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

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

int main() {
  for(int n; cin >> n && n;) {
    vector<int> k(n);
    for(int i = 0; i < n; ++i) cin >> k[i];
    string s; cin >> s;
    for(int i = 0; i < s.size(); ++i) {
      cout << conv((conv(s[i]) - k[i%n] + 52) % 52);
    }
    cout << endl;
  }
  return 0;
}

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

int main() {

	int n;
	int key[100];
	
	while(cin >> n, n) {
		for (int i = 0; i < n; i++) {
			cin >> key[i];
		}
		
		string str;
		cin >> str;
		
		for (int i = 0; i < str.size(); i++) {
			char c;
			if (str[i] >= 'A' && str[i] <= 'Z') {
				c = str[i] - 'A';
			} else {
				c = str[i] - 'A' - 6;
			}
			c -= key[i % n];
			if (c < 0) c += 52;
			
			if (c >= 0 && c <= 25) {
				cout << (char)(c + 'A');
			} else {
				cout << (char)(c + 'A' + 6);
			}
		}
		cout << endl;
	}
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
using namespace std;
#define REP(i, a, n) for(int i=a; i<n; i++)

int main() {
	int n;
	char train[52];
	REP(i, 0, 26) train[i] = 'a' + i;
	REP(i, 0, 26) train[i + 26] = 'A' + i;
	
	while (cin >> n, n) {
		int k[101];
		string s;
		REP(i, 0, n) cin >> k[i];
		cin >> s;

		REP(i, 0, s.size()) {
			int key = i%n;
			int cnt = -1;
			REP(j, 0, 52) {
				if (train[j] == s[i]) {
					cnt = j;
					break;
				}
			}

			if (cnt - k[key] < 0) {
				cout << train[52 - (k[key] - cnt)];
			}
			else {
				cout << train[cnt - k[key]];
			}

		}
		cout << endl;
	}
	return 0;
}