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(void)
{
  int key[100];
  int n;
  string str;
  while(cin>>n,n)
  {
    for(int i = 0;i<n;i++)
      cin>>key[i];
    cin>>str;
    for(int i = 0;i<str.length();i++)
    {
      for(int j = 0;j<key[i%n];j++)
      {  
        str[i] = str[i] - 1;
        if(str[i] < 'a' && str[i]>'Z')
          str[i] = 'Z'+(str[i] - 'a')+1;
        if(str[i] < 'A')
         str[i] = 'z'+(str[i] - 'A')+1;
      }
    }
  
    cout<<str<<endl;
  }
  return 0;
}

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

int main(){
	int n,k[100];
	string s;
	while(cin>>n,n){
		rep(i,n) cin>>k[i];
		cin>>s;
		rep(i,s.size()){
			char a;
			int S=s[i],K=min(k[i%n],52-k[i%n]);
			if(K!=k[i%n])K*=-1;
			if('a'<=S&&S<='z'){
				if('a'<=S-K&&S-K<='z'){
					a=S-K;
				}else if(S-K<'a'){
					a='Z'+1-'a'+S-K;
				}else{
					a='A'-1+S-K-'z';
				}
			}else{
				if('A'<=S-K&&S-K<='Z'){
					a=S-K;
				}else if(S-K<'A'){
					a='z'+1-'A'+S-K;
				}else{
					a='a'-1+S-K-'Z';
				}
			}
			cout<<a;
		}
		cout<<endl;
	}
}

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

C++: #include <map>
#include <set>
#include <list>
#include <cstdio>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <cctype>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

using namespace std;

#define fr first
#define sc second
#define mp make_pair

typedef long long int64;
typedef pair< int, int > iP;
typedef pair< iP, int > iiP;

const int INF = 2 << 28;
const double EPS = 1e-10;

int main() {

    int n;
    string list = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    while(cin >> n, n) {
        string s;
        vector< int > k(n);
        for(int i = 0; i < n; i++)
            cin >> k[i];
        cin >> s;

        for(int i = 0; i < s.size(); i++) {
            s[i] = list[(list.find(s[i]) - k[i % n] + list.size()) % list.size()];
        }
        cout << s << endl;
    }
}

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

const string st = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main() {
  for (int n; cin >> n, n;) {
    vector<int> k(n);
    REP(i, n) cin >> k[i];
    string s;
    cin >> s;
    string ans;
    REP(i, s.length()) {
      int p;
      REP(j, 52) {
        if (st[j] == s[i]) p = j;
      }
      ans += st[(p - k[i % n] + 52) % 52];
    }
    cout << ans << endl;
  }
}

C++: #include <iostream>
#include <cstdio>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
using namespace std;

int main(void){
	vector<char> ma;
	map<char, int> key_map;
	for(int i=0; i<26; i++){
		ma.push_back('a' + i);
		key_map['a' + i] = i;
	}
	for(int i=0; i<26; i++){
		ma.push_back('A' + i);
		key_map['A' + i] = 26 + i;
	}


	while(1){
		int n;
		vector<int> key;
		vector<char> ans;
		string list;
		cin >> n;
		if(n == 0) break;

		for(int i=0; i<n; i++){
			int t;
			cin >> t;
			key.push_back(t);
		}
		cin >> list;

		for(int i=0; i<list.size(); i++){
			int size = key.size();
			int key_i = i;
			if(i >= size) key_i = i % size;
			//cout << key_map[list[i]]  << endl;
			//cout << (key_map[list[i]] + 52 - key[key_i])%52  << endl;
			
			char ch = ma[(key_map[list[i]] + 52 - key[key_i] ) % 52];
			ans.push_back(ch);
		}

		for(int i=0; i<ans.size(); i++){
			cout << ans[i];
		}
		puts("");

	}


	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>
#include <bitset>
#include <time.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = (1LL << 31) - 1;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1
#define MAX_N 100100 * 3

int n;

string table = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main() {
	while (cin >> n&&n) {
		string s;
		int num[110];
		REP(i, n) {
			cin >> num[i];
		}
		cin >> s;
		int cnt = 0;
		REP(i, s.size()) {
			FOR(j, table.size() / 2, table.size()) {
				//cout << table[j];
				if (table[j] == s[i]) {
					s[i] = table[j - num[cnt]];
					break;
				}
			}
			cnt++;
			if (cnt == n)cnt = 0;
		}
		cout << s << endl;
	}
}