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++: #define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
#include<cmath>
#include<sstream>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<utility>
#include<iomanip>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<map>
#include<list>
#include<set>
#include<stdlib.h>
#include<time.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define repp(i,k,n) for(int i=k;i<(int)n;i++)
using namespace std;
const int dx[4] = { 0, 1, 0, -1 }, dy[4] = { 1, 0, -1, 0 };
const int dX[8] = { 0, 1, 1, 1, 0, -1, -1, -1 }, dY[8] = { 1, 1, 0, -1, -1, -1, 0, 1 };
struct XY
{
	int x;
	int y;
};
vector<long long> Prime;
void SieveOfEratosthenes(long long e) //setup vector<long long>Prime(~x)
{
	bool *x=new bool[e];
	for (long long i = 0; i <= e; i++)x[i] = false;
	for (long long i = 2; i <= e; i++)
	{
		if (x[i]);
		else
		{
			Prime.push_back(i);
			for (long long l = i; l <= e; l += i)x[l] = true;
		}
	}
	return;
}
int StringToInt(string a)
{
	stringstream ss;
	int x;
	ss << a;
	ss >> x;
	return x;
}
string IntToString(int a)
{
	stringstream ss;
	string x;
	ss << a;
	ss >> x;
	return x;
}
int GetRandom(int MIN, int MAX)
{
	static int flag=0;
	if (flag == 0)
	{
		srand((unsigned int)time(NULL));
		flag = 1;
	}
	return MIN + (int)(rand()*(MAX - MIN + 1.0) / (1.0 + RAND_MAX));
}
int in()
{
	int x;
	cin >> x;
	return x;
}
void outl(string a)
{
	cout << a << endl;
	return;
}
void outl(int a)
{
	cout << a << endl;
	return;
}
void out(string a)
{
	cout << a;
	return;
}
void out(int a)
{
	cout << a;
	return;
}
/*
(char)'1' - (int)48 = (int)1;
???1111181
 (char)A=(int)65
 (char)a=(int)97
*/
////////////////////////////////////////////////////
vector<char> al;

int main()
{
	
	rep(i, 26)
	{
		al.push_back(i + 97);
	}
	rep(i, 26)
	{
		al.push_back(i + 65);
	}
	rep(i, 51)al.push_back(al[i]);
	rep(i, 51)al.push_back(al[i]);
	rep(i, 51)al.push_back(al[i]);
	int n;
	while (cin >> n&&n)
	{
		int r, l;
		vector<int> a;
		string b;
		rep(i,n)a.push_back(in());
		rep(i, n)a.push_back(a[i]);
		rep(i, n)a.push_back(a[i]);
		cin >> b;
		b += "a";
		
		for (int i = 0; i < b.size()-1; i++)
		{
			for (r = 0;; r++)if (al[r] == b[i])break;
			cout << al[r - a[i] + 103];
		}
		
		cout << endl;

	
		
	}


}

C++: #include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <string.h>
using namespace std;

#define ISEQ(c) (c).begin(), (c).end()
typedef long long ll;

int main() {
  vector<char> list;
  for (char c = 'a'; c <= 'z'; c++) {
    list.push_back(c);
  }
  for (char c = 'A'; c <= 'Z'; c++) {
    list.push_back(c);
  }
  int num = list.size();
  while (true) {
    int n;
    cin >> n;
    if (n == 0) break;
    vector<int> key(n);
    for (int i = 0; i < n; i++)
      cin >> key[i];
    string s;
    cin >> s;
    int len = s.size();
    int index = 0;
    for (int i = 0; i < len; i++) {
      int k = 0;
      for (int j = 0; j < num; j++) {
	if (list[j] == s[i]) {
	  k = j;
	  break;
	}
      }
      s[i] = list[(k-key[index]+num)%num];
      index = (index + 1) % n;
    }
    cout << s << endl;
  }
}

C++: #include <iostream>
#include <cstdio>
#define REP(i,n) for(int i=0;i<(n);i++)
using namespace std;

int main()
{
  
  while(1){
    int n;
    cin >> n;
    if(n == 0) break;
    int k[n];
    REP(i,n)
      cin >> k[i];
    string s;
    cin >> s;
    int x = 0;
    REP(i,(int)s.size()){
      if(s[i] >= 97)
        if(s[i] - k[x] < 97){
          if(k[x] - (s[i] - 97) >= 26){
            s[i] = 122 - (k[x] - (s[i] - 97) - 26) + 1;
          }else{
            s[i] = 90 - (k[x] - (s[i] - 97)) + 1;
          }
        }else{
          s[i] -= k[x];
        }
      else
        if(s[i] - k[x] < 65){
          if(k[x] - (s[i] - 65) >= 26){
            s[i] = 90 - (k[x] - (s[i] - 65)) + 1;
          }else{
            s[i] = 122 - (k[x] - (s[i] - 65)) + 1;
          }
        }else{
          s[i] -= k[x];
        }
      x++;
      x %= n;
    }
    cout << s << endl;
  }
}

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

using namespace std; 

string list = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main()
{
	int n, l, p;
	string s, ans;

	while(cin >> n){
		if(n==0){return 0;}
		ans = "";
		int* key = new int[n];
		for(int i=0; i<n; i++){ cin >> key[i];}
		cin >> s;
		l = s.length();
		for(int i=0; i<l; i++){ 
			p = list.find(s.substr(i,1)) - key[i%n];
			if(p<1){ p+=104; p=p%52;}
			ans += list.substr(p,1);
		}
		cout << ans << endl;
		delete[] key;
	}	
}

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

using namespace std;

const int MAX_N = 108;

int main() {
	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;
}