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 <cctype>
#include <utility>
#include <string>
#include <vector>
using namespace std;

#define gcu getchar_unlocked
#define pcu putchar_unlocked
#define _T template <typename T>
#define _HT template <typename H, typename... T>
#define _il inline
#define _in _il int in
#define _sc _il bool scan
_T T in(int c){T n=0;bool m=false;while(isspace(c)){c=gcu();}if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m?-n:n;}
_in() {return in<int>(gcu());}
_T T scan(T &n){int c=gcu();return c==EOF?false:(n=in<T>(c),true);}
_sc(char &c){c=gcu();gcu();return c!=EOF;}
#ifdef _GLIBCXX_STRING
_sc(string &s){int c;s="";
	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
#endif
_HT _sc(H &h, T&&... t){return scan(h)&&scan(t...);}
#define _vo _il void out
#define _vl _il void outl
_vo(bool b) {pcu('0'+b);}
_vo(const char *s){while(*s)pcu(*s++);}
_vo(char c){pcu(c);}
#ifdef _GLIBCXX_STRING
_vo(string s){for(char c:s)pcu(c);}
#endif
_T _vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
_vl(){out('\n');}
#ifdef _GLIBCXX_VECTOR
_T _vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);outl();}
#endif
_HT _vo(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename... T> _vl(T&&... t){out(move(t)...);outl();}

struct T {
	int a[256];
	char b[52];
	constexpr T() : a(), b() {
		int i = 0;
		for (int c = 'a'; c <= 'z'; c++) a[c] = i++;
		for (int c = 'A'; c <= 'Z'; c++) a[c] = i++;
		i = 0;
		for (; i < 26; i++) b[i] = 'a' + i;
		for (; i < 52; i++) b[i] = 'A' - 26 + i;
	}
};

int main() {
	constexpr T t;
	for (int n; (n = in());) {
		vector<int> k(n);
		for (int &x: k)
			x = in();
		string s;
		scan(s);
		int i = 0;
		for (int c: s)
			out(t.b[(52 + t.a[c] - k[i++ % k.size()]) % 52]);
		outl();
	}
}

C++: #include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>

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

typedef int long long ll;
using namespace std;
typedef pair<int, int> P;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const ll MOD = 1e9 + 7;
static const int MAX = 100;
static const int INF = (1 << 23);

int main() {

    char alpha[52];
    rep(i,26){alpha[i]=char('a'+i);}
    for(int i=26;i<52;i++){alpha[i]=char('A'+(i-26));}


    int n;
    while(true){
        cin>>n;
        string ans;
        if(n==0)break;
        vector<int> v(n);
        string s;
        rep(i,n)cin>>v[i];
        cin>>s;
        int key=0;
        rep(i,s.size()){
            if(key==n)key=0;
            char x=s[i];
            int ind=0;
            while(true){
                if(x==alpha[ind])break;
                ind++;
            }

            for(int j=0;j<v[key];j++){
                ind--;
                if(ind<0)ind=51;
            }
            ans+=alpha[ind];
            key++;
        }
        cout<<ans<<endl;





    }
    return 0;
}

C++: /*
Hokudai Practice Contest 2014
A - King's Inspection

テ「ツ可、テδ堙δ?つーテつーテδ淌「ツ?「テ「ツ按妥「ツ?「テッツャツづ「ツ?「テδづ「ツ?「テδ湘つーテつコテ「ツ?「テ「ツ按妥「ツ?「テδ?「ツ?「テδ?
テ篠ゥテδ津つァテつエテつァテδ湘つァテ「ツ按?つァテつァテつァテδ偲「ツ?「テδ偲つーテつコテ「ツ?「テδ偲つァテδ?篠ゥテδヲテつァテ「ツ按堙つァテ「ツ按?「ツ?ヲテつクテ「ツ按湘つオテつァテ渉?つァテδ偲つァテつソテつァテつアテつーテつ」
テ「ツ?「テδ偲つーテつコテ「ツ?「テδ偲つァテδ堙「ツ按ォテ「ツ按?「ツ按湘篠ゥテつァテ渉?つァテδ偲つァテδクテつァテつキテつァテδ?つァテ?禿「ツ?「テδ催「ツ?「テ渉?「ツ?「テつサテつァテ?津篠ゥテ「ツつャテつ・テ?津つァテ「ツ?ーテつ?「ツ按湘つェテ仰凖つァテ?津篠ゥテ「ツつャテつ・テ?津つァテδ堙「ツ按ォテ「ツ按?「ツ按湘篠ゥテつァテ渉?つァテδ偲「ツ?ヲテつィテδ陛「ツ猟甘つァテつィテつァテつ「テつァテδ偲つーテつ」
(M-1)+1 -> 0, 0-1 -> (M-1)テつーテつーテつァテつサテつァテつ?つァテδ偲つァテδ凝つァテつカテつァテδ?つァテ渉?つァテδ偲つァテδ?つァテ?禿つーテつ「テδヲテδ催δ陛δヲ(%)テつァテδ堙δ陛「ツ?氾つァテつァテつァテδ湘つァテ「ツ?禿つァテδ凝つァテつァテつーテつ」

テつェテ仰崚つ・テδキテ「ツ按妥「ツ猟甘つェテつェテ?津δεつーテδ欅(|s|)
テ「ツ按づ?アテつ・テδキテ「ツ按妥「ツ猟甘つェテつェテ?津δεつーテδ欅(n + |s|)
*/

#include<iostream>
#include<cctype>
using namespace std;

//a-zA-z -> テ篠ゥテδ?つサテδキ
int toInt(char a){
  if(islower(a))return a-'a';
  return a-'A'+26;
}

//テ篠ゥテδ?つサテδキ -> a-zA-Z
char toChar(int a){
  if(a<26)return 'a'+a;
  return 'A'+a-26;
}

//テつアテδソテδクテδ?
const int M = 52;

int main(){
  int n,k[100];
  string s;

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

    for(int i=0;i<(int)s.size();i++){
      //テ篠ゥテ「ツつャテつ・テ?津つァテδ堙「ツ?「テ「ツ按妥「ツ?「テッツャツづ「ツ?「テδづ「ツ?「テδ湘つーテつコテ「ツ?「テ「ツ按妥「ツ?「テδ?「ツ?「テδ崚つァテ渉?つァテδ偲つァテδ?つァテ?杜odテつァテδ堙つェテつサテつァテつョテつァテ「ツ?禿?津「ツ?ヲテつァテつァ
      int tmp = toInt(s[i]) - k[i%n];
      //テ「ツ?ヲテδ暗δクテδ凖つァテ「ツ?堙つァテつ「テつァテδ催「ツ按?つソテつァテδ偲δヲテδ湘渉?δ?つァテ?津「ツ按榲つャテつ。テつ・テつァテつ?odテつァテ?津つコテδ凝つァテδ催つ?仰敕つァテ??(x%mod) + mod)%mod
      tmp = ((tmp%M) + M) % M;
      cout << toChar(tmp);
    }
    cout << endl;
  }
}

C++: #include <iostream>
#include <string>
using namespace std;
 
#define KEY_NUM 52
 
char process_key(char c, int key) {
 
    int num=0;
    //cout << "[" << c << "," << key << "," << num << "]";
    if ('a' <= c && c <= 'z') {
        num = 25 - (int)('z' - c);
    }
    if ('A' <= c && c <= 'Z') {
        num = 51 - (int)('Z' - c);
    }
    num = (num - key) % 52;
    if ( 0 <= num && num <= 25) {
        c = 'a' + num;
    }
    if (26 <= num && num <= 51) {
        c = 'A' + (num - 26);
    }
    //cout << "[" << c << "," << key << "," << num << "]";
    return c;
}
 
int main(void) {
    string s;
    int n;
    int keys[KEY_NUM];
    while (cin >> n, n) {
        for (int i=0; i<n; i++) {
            cin >> keys[i];
        }
        cin >> s;
        //cout << n << endl;
        for (int i=0; i<s.size(); i++) {
            //cout << process_key(s[i], keys[i % n]) << "_";
            cout << process_key(s[i], keys[i % n]);
        }
        //cout << s << endl;
        cout << endl;
    }
}