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++: #define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <functional>
#include <sstream>
#include <cmath>
#include <set>
#include <map>
#include <stack>
using namespace std; 

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>=(b);i--)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
#define len(x) ((int)(x).size())
#define tmax(a,b,c) max((a),max((b),(c)))
#define tmin(a,b,c) min((a),min((b),(c)))
#define debug(x) cerr << #x << " is " << x << endl;

typedef pair<int, int> Pii;
typedef map<int, int> Mii;
typedef vector<int> Vi;
typedef long long ll;
const int inf = 2e9;
const ll ll_inf = 1e17;
const int mod = 1e9 + 7;
const long double eps = 1e-10;

int k[110];

int main()
{
	while (1) {
		int n; cin>>n;
		if (n==0) break;
		memset(k,0,sizeof(k));
		rep(i,0,n) cin >> k[i];
		string s; cin>>s;

		int j = 0;
		rep(i,0,len(s)) {
			int x=0;
			if (s[i] <= 'Z') x = s[i]-'A'+26;
			else x = s[i]-'a';
			//cout << x << endl;

			x = (x + 52 - k[j]) % 52;
			if (x <= 25) s[i] = 'a'+x;
			else s[i] = 'A'+(x-26);
			j++;
			if (j==n) j=0;
		}
		cout << s << endl;
	}

	return 0;
}

C++: // King's Inspection

#include <iostream>
#include <cstring>
#include <vector>
#include <cstdio>

using namespace std;

int main() {
    int n;
    int now=0;
    int k[102];
    string station;
    string ans;
    string alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    
    while(1) {
      // Input
        cin>>n;
        if(n == 0) {
            break;
        }
        for(int i=0; i<n; i++) {
            cin>>k[i];
        }
        cin.ignore();
        ansNum = 0;

	// Output
	now = 0;
	getline(cin>>station);

	for(int i=0; i<station.length(); i++) {
	    int tmp;
	    tmp = alpha.find(station[i]);
	    ans[i] = alpha[(tmp-k[now]+52)%52];
	    now++;
            if(now == n) {
                now = 0;
            }
	}
        for(int i=0; i<station.length(); i++) {
            cout<<ans[i];
        }
        cout<<endl;
    }
}

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

int main  ()
{
    int n;
    while (cin >> n, n) {
        vector<int> v(n);
        for (auto &i : v) cin >> i;
        string str;
        cin >> str;
        for (int i = 0; i < str.size(); i++) {
            if ('A' <= str[i] && str[i] <= 'Z') {
                int t = (str[i] - 'A' - v[i % v.size()]) % 26;
                if (t >= 0) {
                    cout << (char)('A' + t);
                } else {
                    cout << (char)('z' + t + 1);
                }
            } else {
                int t = (str[i] - 'a' - v[i % v.size()]) % 26;
                if (t >= 0) {
                    cout << (char)('a' + t);
                } else {
                    cout << (char)('Z' + t + 1);
                }
            }
        }
        cout << endl;
    }

    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define BIG 1000000010
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
typedef long long int ll;


int main(){
  int n;
  int k[100];
  int num;
  string s;
  string ans;
  int alp[52];
  rep(i,52){
    if(i<26) alp[i]=i+65;
    else alp[i]=i+71;
  }
  while(1){
    cin>>n;
    if(n==0) break;
    rep(i,n){
      cin>>k[i];
    }
    cin>>s;
    ans="0";
    rep(i,s.size() ){
      rep(j,52){
	if(alp[j]==s[i]) num=j;
      }
      int a=(num-k[i%n]+520)%52;
      //cout<<a<<endl;
      ans+=alp[a];
      //cout<<ans<<endl;
    }
    repi(i,1,ans.size()){
      cout<<ans[i];
    }
    cout<<endl;
  }

  return 0;
}

C++: #include<iostream>
#include<map>
#include<string>
#include<vector>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef int Def;
typedef vector<Def> vi;
typedef pair<Def,Def> pii;
int main(){
	int n;
	while(cin>>n,n){
		vi in(n);
		rep(i,n)cin>>in[i];
		string s;
		cin>>s;
		rep(i,s.size()){
			int t=in[i%n];
			if(t>=26){
				t-=26;
				if(islower(s[i]))s[i]=toupper(s[i]);
				else s[i]=tolower(s[i]);
			}
			if(islower(s[i])){
				s[i]-=t;
				if(s[i]<'a')s[i]='Z'-('a'-s[i])+1;
			}else{
				s[i]-=t;
				if(s[i]<'A')s[i]='z'-('A'-s[i])+1;
			}
		}
		cout<<s<<endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); ++i)

const string a = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main() {
    for (int n; cin >> n, n;) {
        vector<int> k(n);
        for (int& e : k) cin >> e;
        string s, t = ""; cin >> s;
        rep(i, s.size()) t += a[(s[i] - (s[i] < 'a' ? 'A' + 26 : 'a') + 52 - k[i % n]) % 52];
        cout << t << endl;
    }
}