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 <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 = 0; i < l; i++){
		if(s[i] >= 'a' && s[i] <= 'z'){
			num[i] = s[i] - 'a';
		}
		else{
			num[i] = s[i] - '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 = 0; 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 - 1] = k[i - 1];
			}
			m += n;
		}
		decode(l, k, s, alph);
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int key[1000];
string s,ans[1000];
int main(void){
	while(1){
		int d;
		cin >>d;
		if(d==0)break;
		for(int i=0;i<d;i++){
			cin >>key[i];
		}
		cin >>s;
		for(int i=0;i<s.length();i++){
			int keynum=i%d;
			for(int j=0;j<key[keynum];j++){
				if(s[i]=='a'){
					s[i]='Z';
				}else if(s[i]=='A'){
					s[i]='z';
				}else{
					s[i]-=1;
				}
			}
		}
		cout << s <<endl;
	}
}

C++: //#define USE_CPP11
// #define USE_PRINTF

#include <iostream>
#include <iomanip>
#include <map>
#include <set>
#include <utility>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <numeric>
#include <complex>
#include <memory>
#include <sstream>

#ifdef USE_CPP11
#include <unordered_map>
#include <unordered_set>
#include <functional>
#endif

#define PRINT(obj) cout << obj << endl
#define REP(i, n) for(int (i) = 0; (i) < (n); i++)
#define SPACE " "

typedef long long ll;

const int INF = 1e9 + 10;

using namespace std;

namespace Scanner {
#ifdef USE_PRINTF
  int    nextInt()    { int    d; scanf("%d" , &d); return d; }
  float  nextFloat()  { float  f; scanf("%f" , &f); return f; }
  double nextDouble() { double f; scanf("%lf", &f); return f; }  
  string nextString() { string s; scanf("%s" , &s); return s; }
  ll     nextll()     { ll     l; scanf("%ll", &l); return l; }
#else
  int    nextInt()    { int    d; cin >> d; return d; }
  float  nextFloat()  { float  f; cin >> f; return f; }
  double nextDouble() { double f; cin >> f; return f; }  
  string nextString() { string s; cin >> s; return s; }
  ll     nextll()     { ll     l; cin >> l; return l; }
#endif

  string getLine() { 
    string input;
    getline(cin, input);
    return input;
  }
};

namespace myLibrary {
  vector<string> split(const string& str, char delim) {
    vector<string> ret;
    size_t current = 0, found;
    while ((found = str.find_first_of(delim, current)) != string::npos) {
      ret.push_back(string(str, current, found - current));
      current = found + 1;
    }
    ret.push_back(string(str, current, str.size() - current));
    return ret;
  }
  
#ifdef USE_CPP11
  ///
  /// higher-order functional
  /// This is something like map in haskell, python, etc.
  /// Sample usage:
  ///   vector<int> a = {1, 2, 3, 4, 5};
  ///   vector<int> b = myLibrary::_Map<int, int>(a, [](int n){
  ///     return n * n;
  ///   });
  /// Result:
  ///   b = 1, 4, 9, 16, 25
  ///
  template<typename T_IN, typename T_OUT, class Functor>
  vector<T_OUT> _Map(vector<T_IN> src, Functor func) {
    vector<T_OUT> ret;
    for (int i = 0; i < src.size(); i++) {
      ret.push_back(func(src[i]));
    }
    return ret;
  }
#endif

};

/// BEGIN //////////////////////////////////////////////////////////

int main() {
  while (true) {
    int n = Scanner::nextInt();
    if (n == 0) {
      break;
    }
    vector<int> key(n);
    
    REP(i, n) {
      int k = Scanner::nextInt();
      key[i] = k;
    }

    string s = Scanner::nextString();

    string ans = "";
    REP(i, s.size()) {
      char c = s[i] - key[i % key.size()];
      if (c < 65) {
        c += 58;
      }
      ans += c;
    }
    PRINT(ans);
  }

  return 0;
}
/// END   //////////////////////////////////////////////////////////

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

using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	while(true){
		int n;
		cin >> n;
		if(n == 0){ break; }
		vector<int> keys(n);
		for(int i = 0; i < n; ++i){ cin >> keys[i]; }
		string s;
		cin >> s;
		const int m = s.size();
		for(int i = 0; i < m; ++i){
			const int k = keys[i % n];
			int c = islower(s[i]) ? (s[i] - 'a') : (s[i] - 'A' + 26);
			c = ((c + 5200) - k) % 52;
			if(c < 26){
				c += 'a';
			}else{
				c = (c - 26) + 'A';
			}
			cout << static_cast<char>(c);
		}
		cout << endl;
	}
	return 0;
}