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 <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cassert>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <complex>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <iterator>

using namespace std;

#define dump(n) cout<<"# "<<#n<<'='<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define iter(c) __typeof__((c).begin())
#define foreach(i,c) for(iter(c) i=(c).begin();i!=(c).end();++i)
#define all(c) (c).begin(),(c).end()
#define mp make_pair

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<string> vs;
typedef pair<int,int> pii;

const int INFTY=1<<29;
const double EPS=1e-9;

template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p){
	return os<<'('<<p.first<<','<<p.second<<')';
}
template<typename T>
ostream& operator<<(ostream& os,const vector<T>& a){
	os<<'[';
	rep(i,a.size()) os<<(i?" ":"")<<a[i];
	return os<<']';
}

int main()
{
	for(int n;cin>>n,n;){
		vi ks(n);
		rep(i,n) cin>>ks[i];
		string s; cin>>s;
		
		vi a(s.size());
		rep(i,a.size()) a[i]=islower(s[i])?s[i]-'a':26+s[i]-'A';
		rep(i,a.size()) a[i]=(a[i]-ks[i%ks.size()]+52)%52;
		rep(i,a.size()) s[i]=a[i]<26?'a'+a[i]:'A'+a[i]-26;
		
		cout<<s<<endl;
	}
}

C++: #include <iostream>
#include <string>
using namespace std;
int main() {
  int n;
  string s;
  while (cin >> n, n) {
    int K[n];
    for (int i = 0; i < n; ++i) cin >> K[i];
    cin >> s;
    for (int i = 0; i < s.size(); ++i) {
      if (s[i]-K[i%n] < 'a' && s[i] >= 'a') {
	s[i] = 'Z' - 'a' - K[i%n] + s[i] + 1;
	if (s[i] < 'A') s[i] = 'z' - 'A' + s[i] + 1;
      } else if (s[i]-K[i%n] < 'A' && s[i] >= 'A') {
	s[i] = 'z' - 'A' - K[i%n] + s[i] + 1;
	if (s[i] < 'a') s[i] = 'Z' - 'a' + s[i] + 1;
      }else s[i] -= K[i%n];
    }
    cout << s << endl;
  }
  return 0;
}

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

using namespace std;

int main(){
	int n;
	while(cin >> n, n){
		int num[100];
		string temp = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
		string input;

		for(int i=0; i < n; i++)
			cin >> num[i];

		cin >> input;

		for(int i=0; i < input.size(); i++){
			input[i] = temp[(temp.find(input[i])-num[i%n]+52)%52];
		}
		cout << input << endl;
	}
}

C++: #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  map<int, char> i2en;
  map<char, int> en2i;
  char a = 'a', A = 'A';
  FOR(i,0,26) i2en[i] = a++;
  FOR(i,26,52) i2en[i] = A++;
  a = 'a', A = 'A';
  FOR(i,0,26) en2i[a++] = i;
  FOR(i,26,52) en2i[A++] = i;
  int n;
  while(cin>>n,n) {
    int k[n]; FOR(i,0,n) cin >> k[i];
    int key = 0;
    string s; cin >> s;
    int len = s.length();
    string ans = "";
    FOR(i,0,len) {
      key %= n;
      ans += i2en[(en2i[s[i]]-k[key]+52)%52];
      key++;
    }
    cout << ans << '\n';
  }
  return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <string.h>

using namespace std;

int num[108];

void decode(int l, int k[108], char s[108], char alph[56])
{	
	for(int i = 1; i <= l; i++){
		if(s[i - 1] >= 'a' && s[i - 1] <= 'z'){
			num[i] = s[i - 1] - 'a';
		}
		else{
			num[i] = s[i - 1] - 'A' + 26;
		}
		if(num[i] - k[i] < 0){
			num[i] += 52 - k[i];
		}
		else{
			num[i] -= k[i];
		}
		cout << alph[num[i]];
	}
	puts("");
}


int main()
{
	int n, m, l;
	int k[108];
	char s[108];
	char alph[56];
	
	for(int i = 0; i < 26; i++){
		alph[i] = 'a' + i;
	}
	for(int i = 0; i < 26; i++){
		alph[i + 26] = 'A' + i;
	}

	
	while(scanf("%d", &n) != EOF){
		if(n == 0) break;
		for(int i = 1; i <= n; i++){
			cin >> k[i];
		}
		cin >> s;
		
		m = n;
		l = strlen(s);
		while(l > m){
			for(int i = 1; i <= n; i++){
				k[m + i] = k[i];
			}
			m += n;
		}
		decode(l, k, s, alph);
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<pint> vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=n-1;i>=(0);i--)
#define reps(i,f,n) for(ll i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define all(v) (v).begin(),(v).end()
#define eall(v) unique(all(v), v.end())
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll INFF = 1e18;

int n;
string m = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int findidx(char c) {
	rep(i, m.size())if(c == m[i]) return i;
}

void solve(void) {
	int k[110];
	string s;
	rep(i, n) cin >> k[i];
	cin >> s;
	string ans;
	rep(i, s.size()) {
		int idx = findidx(s[i]);
		idx = ((idx + 52) - k[i % n]) % 52;
		ans += m[idx];
	}
	cout << ans << endl;
}

int main(void) {
	// cout << m.size() << endl;
	while(1) {
		cin >> n;
		if(n == 0) break;
		solve();
	}
	return 0;
}