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;

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

int main(int argc, char *argv[])
{
  int n;
  while(cin >> n && n){
    vector<int> k(n);
    rep(i, n) cin >> k[i];
    string s;
    cin >> s;
    int idx = 0;
    for(auto c : s){
      int p = islower(c) ? c - 'a' : c - 'A' + 26;
      p -= k[idx];
      p %= 52;
      p += 52;
      p %= 52;
      cout << char(p < 26 ? p + 'a' : p-26 + 'A');
      idx = (idx + 1) % n;
    }
    cout << endl;
  }
  
  return 0;
}

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

using namespace std;

int main() {
	int n;

	while(true) {
		cin >> n;

		if(!n) {
			break;
		}

		vector< int > k(n);
		string str;
		string st = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
		vector< string > ans;

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

		int count = 0;

		for(int i = 0; i < str.size(); i++) {
			for(int j = 0; j < st.size(); j++) {
				if(str[i] == st[j]) {
					cout << st[(j - k[count] + 52) % 52];
					break;
				}
			}
			count++;
			if(count == k.size()) {
				count = 0;
			}
		}
		cout << endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
int key[101];

int main(){
  int n;
  while(cin>>n,n){
    for(int i=0;i<n;i++) cin>> key[i];
    string str;
  cin>>str;
  int idx=0;
  for(int i=0;i<str.size();i++){
    idx%=n;
    str[i]-=key[idx];
    while(1){
      if(str[i]<'A') str[i]='z'-('A'-str[i]-1);
      else if('a'<str[i]+key[idx]&&str[i]<'a') str[i]='Z'-('a'-str[i]-1);
      else break;
    }
    idx++;
  }
  cout <<str<<endl;
  }
  return 0;
}

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

using namespace std;

const int MAX_N = 108;

int main() {
	while (true) {
	int n;
	int ns[MAX_N];
	string s;
	
	cin >> n;
	if (n == 0) return 0;
	for (int i = 0; i < n; ++i) {
		cin >> ns[i];
	}
	cin >> s;
	for (int i = 0; i < s.size(); ++i) {
		char station = s[i] - ns[i%n];
		if (station > 'Z' && station < 'a') {
			station = 'Z' - ('a' - station) + 1;
		} else if (station < 'A') {
			station = 'z' - ('A' - station) + 1; 
		}
		cout << station;
	}
	cout << endl;
	}

	return 0;
}

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

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

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 10e9+9
#define EPS 1e-10
#define MAX_N 100100
#define MAX_M 100100

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;

int n, k[1000];
string s;

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

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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

using Tup = tuple<int64, int64, int64>;

vector<char> ch;
int32 toint[256] = {};

char back(char c, int32 x){
	int32 idx = toint[c];
	idx = (idx+52-x)%52;
	return ch[idx];
}

int main(void){
	REP(i, 26){
		ch.push_back((char)('a'+i));
		toint['a'+i] = ch.size()-1;
	}
	REP(i, 26){
		ch.push_back((char)('A'+i));
		toint['A'+i] = ch.size()-1;
	}

	int32 n;
	while(cin >> n && n){
		vector<int32> k(n);
		REP(i, n) cin >> k[i];
		string s;
		cin >> s;
		REP(i, s.size()){
			s[i] = back(s[i], k[i%n]);
		}
		cout << s << endl;
	}
}