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 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 <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,x,n) for(int i=(x);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define int long long
using namespace std;
const int MOD=1e9+7;
const int INF=1e15;

signed main(){
  int n;
  while(cin>>n,n){
    vector<int> a(n);
    rep(i,n)cin>>a[i];
    string s;
    cin>>s;
    rep(i,s.size()){
      char tmp=(char)s[i]-a[i%n];
      //cout<<"tmp="<<tmp<<endl;
      if('a'<=tmp&&tmp<='z'){
        cout<<tmp;
      }else if('A'<=tmp&&tmp<='Z'){
        cout<<tmp;
      }else if(tmp<'A'){
        int len=a[i%n]-(s[i]-'A')-1;
        cout<<(char)('z'-len);
      }else {
        int len=a[i%n]-(s[i]-'a')-1;
        cout<<(char)('Z'-len);
      }
    }
    cout<<endl;
  }
 return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
#include<cmath>
#include<sstream>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<utility>
#include<iomanip>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<map>
#include<list>
#include<set>
#include<stdlib.h>
#include<time.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define repp(i,k,n) for(int i=k;i<(int)n;i++)
using namespace std;
const int dx[4] = { 0, 1, 0, -1 }, dy[4] = { 1, 0, -1, 0 };
const int dX[8] = { 0, 1, 1, 1, 0, -1, -1, -1 }, dY[8] = { 1, 1, 0, -1, -1, -1, 0, 1 };
struct XY
{
	int x;
	int y;
};
vector<long long> Prime;
void SieveOfEratosthenes(long long e) //setup vector<long long>Prime(~x)
{
	bool *x=new bool[e];
	for (long long i = 0; i <= e; i++)x[i] = false;
	for (long long i = 2; i <= e; i++)
	{
		if (x[i]);
		else
		{
			Prime.push_back(i);
			for (long long l = i; l <= e; l += i)x[l] = true;
		}
	}
	return;
}
int StringToInt(string a)
{
	stringstream ss;
	int x;
	ss << a;
	ss >> x;
	return x;
}
string IntToString(int a)
{
	stringstream ss;
	string x;
	ss << a;
	ss >> x;
	return x;
}
int GetRandom(int MIN, int MAX)
{
	static int flag=0;
	if (flag == 0)
	{
		srand((unsigned int)time(NULL));
		flag = 1;
	}
	return MIN + (int)(rand()*(MAX - MIN + 1.0) / (1.0 + RAND_MAX));
}
int in()
{
	int x;
	cin >> x;
	return x;
}
void outl(string a)
{
	cout << a << endl;
	return;
}
void outl(int a)
{
	cout << a << endl;
	return;
}
void out(string a)
{
	cout << a;
	return;
}
void out(int a)
{
	cout << a;
	return;
}
/*
(char)'1' - (int)48 = (int)1;
???1111181
 (char)A=(int)65
 (char)a=(int)97
*/
////////////////////////////////////////////////////
vector<char> al;

int main()
{
	
	rep(i, 26)
	{
		al.push_back(i + 97);
	}
	rep(i, 26)
	{
		al.push_back(i + 65);
	}
	while(al.size()<1000)rep(i, 52)al.push_back(al[i]);
	int n;
	while (cin >> n&&n)
	{
		int r, l;
		vector<int> a;
		string b;
		rep(i,n)a.push_back(in());
		while(a.size()<150)rep(i, n)a.push_back(a[i]);
		cin >> b;
		b += "a";
		
		for (int i = 0; i < b.size()-1; i++)
		{
			for (r = 0;; r++)if (al[r] == b[i])break;
			cout << al[r - a[i] + 312];
		}
		
		cout << endl;

	
		
	}


}

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

int main(){
	while(1){
		int n;
		cin>>n;
		if(n==0) break;
		int a[100];
		lp(i,n){
			cin>>a[i];
		}
		int count=0;
		char x;
		scanf("%c",&x);
		while(1){
			scanf("%c",&x);
			if('A'<=x&&'z'>=x){
				lp(i,a[count]){
					x--;
					if(x==64) x=122;
					if(x==96) x==90;
				}
				cout<<x;
				count++;
				if(count==n) count=0;
			}
			else break;
		}
		cout<<endl;
	}
	return 0;
}