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,a;
	int k[101];
	string s;
	char c;
	while(1){
		cin >> n;
		if(n == 0)break;
		for(int i = 0;i < n;i++){
			cin >> k[i];
		}
		cin >> s;
		for(int i = 0;i < s.size();i++){
		c =  s[i] - k[i%n];
		a = c;
		if(a < 65){
			a += 58;
			c = a;
		}
		else if(a > 90 && 97 > a){
			a -= 6;
			c = a;
		}
		cout << c;
		}
		cout << endl;
	}
	//for(int i = 65;i <= 123;i++){
	//	c = i;
	//	cout << c << " " << i <<endl;
	//}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <map>
#include <math.h>
#include <complex>

using namespace std;

char decode(char s,int k){

    //cout<<s<<endl;

    for(int i=0;i<k;i++){
        if(s=='a') s='Z';
        else if(s=='A') s='z';
        else s=s-1;
        //cout<<s<<endl;
    }

      return s;

}

int main(){

    int n;
   
    while(cin>>n,n){

        string s;
        int k[100];

        for(int i=0;i<n;i++){
            cin>>k[i];
        }

        cin>>s;

        for(int i=0;i<s.size();i++){
            cout<<decode(s[i],k[i%n]);
        }

        cout<<endl;

    }

    return 0;
}

C++: #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>

using namespace std;

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

#define all(v) v.begin(),v.end()
#define INF 1<<30
#define mp make_pair
#define pb push_back

#define fi first
#define se second

#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

typedef long long ll;

char mozi[53];
int main(){
	while(1){
		int n;
		int ikey[110] = {0};
		cin>>n;
		if(n==0) break;
		rep(i,n){
			cin>>ikey[i];
		}
		int tmm=0;
		rep(i,52){
			if(i==26) tmm+=6;
			mozi[i]='A'+tmm;
			tmm++;
		}
		// rep(i,52){
		// 	cout<<mozi[i]<<"*";
		// }
		string skey;
		cin>>skey;
		string ans = "";
		rep(i,skey.size()){
			if(char(skey[i]>='a')){
				skey[i] = char(char(skey[i])-6);
			}
			// cout << char(char(skey[i])-'A'+(52*2-ikey[i%n])%52)<< endl;
			ans += mozi[(char(skey[i])-'A'+(52*2-ikey[i%n]))%52];
		}
		cout<<ans<<endl;

	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	string ab("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
	while(cin >> n , n){
		vector<int> k(n);
		for(int i=0;i<n;i++){
			cin >> k[i];
		}
		string s;
		cin >> s;
		for(int unsigned i = 0;i<s.size();i++){
			int x = 0;
			for(int j=0;j<52;j++){
				if(ab[j] == s[i]) x = j;
			}
			cout << ab[(x - k[i%n] + 52)%52];
		}
		cout << endl;
	}
	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }

/*
 <url:>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

vector<char> station(26*2);
void init(){
    iota(station.begin(),station.begin()+26,0);
    for(int i = 0; i < 26;i++) station[i] += 'a';
    iota(station.begin()+26,station.end(),0);
    for(int i = 0; i < 26;i++) station[i+26] += 'A';
}
string solve(ll n){
    vector<int> k(n); for(auto& in:k) cin >> in;
    string s; cin >> s;
    for(int i = 0; i < s.length();i++){
        auto it = find(station.begin(),station.end(),s[i]);
        s[i] = station[((it-station.begin()) + 52*100 - k[i%n])%52];
    }
    return s;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    ll n;
    init();
    while(cin >> n,n){
        cout << solve(n) << endl;
    }
    return 0;
}

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

int key[10000];
char alpha[100];
int main(){
  int n,j;
  int i;
  string s;
  for(i=0;i<52;i++){
    if(i>=26)
      alpha[i] = 'A'+i+6;
    else  alpha[i] = 'A'+i;
  }
  while(cin>>n,n){
    string ans;
    j = 0;
    for(i = 0;i<n;i++)cin>>key[i];
    cin>>s;
    int k = s.length();
    for(i = 0;i<k;i++){
      if(s[i]>='a')
	s[i] -= 'a'-'Z'-1;
      if(s[i]-key[j]-'A'>=0)
	s[i] = alpha[s[i] - key[j]-'A'];
      else{
	s[i] = alpha[s[i]-key[j]-'A'+52];
      }
      if(j >= n-1) j = 0;
      else j++;
    }
    cout<<s;
    cout<<endl;
  }
  return 0;
}