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 <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <algorithm>

using namespace std;

int main (int argc, char *argv[]) {
    int n;
    string list = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    while (cin>>n, n) {
        int key[n] = {};
        string str;
        for (int i = 0; i < n; ++i) {
            cin>>key[i];
        }
        cin>>str;
        for (int i = 0; i < str.length(); ++i) {
            int num = i % n;
            int target = 0;
            for (int j = 0; j < list.length(); ++j) {
                if (str[i] == list[j]) {
                    target = j;
                    break;
                }
            }
            int lt = target - key[num];
            if (lt < 0) lt += 52; 
            str[i] = list[lt];
        }
        cout<<str<<endl;
    }
    return 0;
}

C++: #include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <ctime>
#include <iterator>
#include <bitset>
#include <numeric>
#include <list>
#include <iomanip>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <unordered_set>
#include <unordered_map>
#include <forward_list>

#define cauto const auto&
#else

#endif

using namespace std;


namespace{
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}


#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()


#define MOD 1000000007LL
#define EPS 1e-8
static const int INF=1<<24;
int a[300];
int b[300];

void mainmain(){
	int n;
	rep(i,26){
		a[i]='a'+i;
		a[i+26]='A'+i;
		b['a'+i]=i;
		b['A'+i]=i+26;
	}
	while(cin>>n,n){
		vint v(n);
		rep(i,n){
			cin>>v[i];
		}
		string s;
		cin>>s;
		int cnt=0;
		stringstream ss;
		rep(i,s.size()){
			cnt%=v.size();
			char t=b[s[i]];
			t=a[(t-v[cnt++]+52)%52];
			ss<<t;
		}
		string ans;
		ss>>ans;
		cout<<ans<<endl;
	}
}



}
main() try{
    mainmain();
}
catch(...){
}

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

#define repl(i,a,b) for(int (i)=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)

string alpha;

char rot(char c,int x){
  while(x>0){
    if(c=='A'){
      c='z';
    }else if(c=='a'){
      c='Z';
    }else{
      c--;
    }
    x--;
  }
  return c;
}

int main(){
  while(1){
    int n;
    cin>>n;
    if(n==0)break;
    vector<int> a(n);
    rep(i,n)cin>>a[i];

    string s;
    cin>>s;
    int m=s.size();

    string res;
    rep(i,m){
      res+=rot(s[i],a[i%n]);
    }
    cout<<res<<endl;
  }

  return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <iostream>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <set>
#define repl(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) (x).begin(), (x).end()
#define FILL(v, value) (v+(sizeof(v) / sizeof *(v)), value);
#define inf 999999999
#define dbg(x) cout<<#x<<":"<<x<<endl;
#define pb(a) push_back((a))
#define mp(a) make_pair((a))
#define sz(x) (int)(x).size()
#define pi 2*acos(0.0)
#define in scanf
#define out printf
#define fi first
#define se second
#define bit(n) (1LL<<(n))
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;

const int MOD=1000000007; // 10^9 + 7
const int dx[]={1,0,-1,0}, dy[]={0,-1,0,1};  // right, down, left, up


int main(int argc, char**argv){
	int n;
	while(1){
		cin >> n;
		if (n == 0) break;
		vi k;
		rep(i, n){
			int tmp;
			cin >> tmp;
			k.pb(tmp);
		}
		string s;
		cin >> s;

		rep(i, sz(s)){
			s[i] = s[i] - k[i];
		}
		cout << s << endl;

	}

	return 0;
}

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


string t1;
int main(){
	for(int i = 0 ; i < 26 ; i++) t1 += 'a'+i,t1 += 'A'+i;
	sort(t1.begin(),t1.end());
	rotate(t1.begin(),t1.begin()+26,t1.end());
	int n;
	while(cin >> n && n){
		vector<int> k(n);
		string s;
		for(int i = 0 ; i < n ; i++) cin >> k[i];
		cin >> s;
		for(int i = 0 ; i < s.size() ; i++){
			int p = k[i%n];
			int pos = t1.find(s[i]);
			int hoge = (pos - p) % 52 + 52;
			hoge %= 52;
			cout << t1[hoge];
		}
		cout << endl;
	}
}