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++: //C
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int main(){
	string d="";
	d.resize(52);
	for(int i=0;i<26;i++)d[i]='a'+i;
	for(int i=0;i<26;i++)d[i+26]='A'+i;
	int num;
	//cout<<d<<endl;
	while(true){
	cin>>num;
	if(num==0)break;
	string ans="",next;
	int key[200];
	for(int i=0;i<num;i++)cin>>key[i];
	cin>>next;
	for(int i=0;i<next.size();i++){
		int tmp;
		for(int j=0;j<52;j++)if(d[j]==next[i])tmp=j;
		int index;
		if(i==0)index=0;
		else index=i%num;
		tmp-=key[index];
		if(tmp<0)tmp+=52;
		cout<<d[tmp];
	}
	cout<<endl;
	}
	return 0;
}

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

using pii = pair<int,int>;
using ll = long long;
#define rep(i, j) for(int i=0; i < (int)(j); i++)
#define repeat(i, j, k) for(int i = (j); i < (int)(k); i++)
#define all(v) v.begin(),v.end()
#define debug(x) cerr << #x << " : " << x << endl

template<class T> bool set_min(T &a, const T &b) { return a > b  ? a = b, true : false; }
template<class T> bool set_max(T &a, const T &b) { return a < b  ? a = b, true : false; }
// vector
template<class T> istream& operator >> (istream &is , vector<T> &v) { for(T &a : v) is >> a; return is; }
template<class T> ostream& operator << (ostream &os , const vector<T> &v) { for(const T &t : v) os << "\t" << t; return os << endl; }
// pair
template<class T, class U> ostream& operator << (ostream &os , const pair<T, U> &v) { return os << "<" << v.first << ", " << v.second << ">"; }

const int INF = 1 << 30;
const ll INFL = 1LL << 60;


class Solver {
  public:
    bool solve() {
        int N; cin >> N;
        if(N == 0) return 0;
        vector<int> K(N); cin >> K;
        string S; cin >> S;
        string alpha;
        repeat(i, 'a', 'z' + 1) alpha.push_back(i);
        repeat(i, 'A', 'Z' + 1) alpha.push_back(i);
        string ans;
        rep(i, S.size()) {
            int n = isupper(S[i]) ? S[i] - 'A' + ('z' - 'a' + 1): S[i] - 'a';            
            int k = K[i % K.size()];
            n = (n - k + alpha.size()) % alpha.size();
            ans.push_back(alpha[n]);
        }
        cout << ans << endl;
        return 1;
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(Solver().solve());
    return 0;
}

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

int main()
{
  int n;
  for(;cin>>n,n;)
    {
      int k[n];
      for(int i=0;i<n;i++)
	cin>>k[i];
      string s;
      cin>>s;
      int key=0;
      for(int i=0;i<s.size();i++)
	{
	  
	  for(int j=0;j<k[key];j++)
	    { 
	      s[i]--;
	      if(s[i]=='a'-1)
		s[i]='Z';
	      if(s[i]=='A'-1)
		s[i]='z';      
	    }
	  key++;
	  if(key>=n)
	    key=0;
	}
      cout<<s<<endl;
    }

}

C++: #include <iostream>
#include <vector>
#include <string>
#include <map>

using namespace std;

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

map<char,char> itoc, ctoi;
int main(){
    int n;
    rep(i,26){
        itoc[i]='A'+i;
        itoc[i+26]='a'+i;
        ctoi['A'+i]=i;
        ctoi['a'+i]=i+26;
    }

    while(cin>>n,n){
        vector<int> key(n);
        rep(i,n) cin>>key[i];
        string m; cin>>m;
        rep(i,m.size()){
            int c=ctoi[m[i]];
            c=(c-key[i%(key.size())]+52)%52;
            cout<<itoc[c];
        }
        cout<<endl;
    }
}