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 <bits/stdc++.h>
typedef long long LL;
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

using namespace std;
int main(void)
{
  map<int,char> itoc;
  REP(i,26) itoc[i]=i+'A';
  REP(i,26) itoc[i+26]=i+'a';
  map<char,int> ctoi;
  REP(i,26) ctoi[i+'A']=i;
  REP(i,26) ctoi[i+'a']=i+26;
  for(;;){
    int n;
    cin >> n;
    if(!n) return 0;
    vector<int> key;
    key.resize(n);
    REP(i,n) cin >> key[i];
    string code;
    cin >> code;
    REP(i,code.size())
      code[i]=itoc[(ctoi[code[i]]-key[i%key.size()]+52)%52];
    cout << code << endl;
  }
}

C++: #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f

#include <iostream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
  
using namespace std;
  
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P> PP;
  
static const double EPS = 1e-8;
  
static const int tx[] = {0,1,0,-1};
static const int ty[] = {-1,0,1,0};

static const string stations = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

int main(){

  int n;
  while(~scanf("%d",&n)){
    if(n==0) break;

    int back_dist[101];
    for(int i=0;i<n;i++){
      scanf("%d",back_dist+i);
    }
    string str;
    cin >> str;

    int back_idx = 0;
    for(int i=0;i<str.size();i++){
      int pos = lower_bound(stations.begin(),stations.end(),str[i]) - stations.begin();
      str[i] = stations[(pos - back_dist[back_idx] + stations.size()) % stations.size()];
      back_idx++;
      back_idx %= n;
    }

    cout << str << endl;
  }
}

C++: #include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "iomanip"
#include "random"

using namespace std;

const long long int MOD = 1000000007;
const long double EPS = 0.00000001;
const long double PI = 3.1415926535897932384626433;

long long int N, M, K, H, W, L, R;



int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> N;
	while (N) {
		vector<int>num(N);
		for (int i = 0; i < N; i++) {
			cin >> num[i];
		}
		string s;
		cin >> s;
		K = s.size();
		for (int i = 0; i < K; i++) {
			for (int j = 0; j < num[i%N]; j++) {
				s[i]--;
				if (s[i] == char('a' - 1)) {
					s[i] = 'Z';
				}
				if (s[i] == char('A' - 1)) {
					s[i] = 'z';
				}
			}
			cout << s[i];
		}
		cout << endl;
		cin >> N;
	}
	return 0;
}

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

using namespace std;

int main(void){
	//FILE* fp_in = freopen("data.txt", "r", stdin);

	vector<char> sta;
	for(int i = 0; i < 26; i++)
		sta.push_back('a'+i);
	for(int i = 0; i < 26; i++)
		sta.push_back('A'+i);

	while(1) {
		int n;
		cin >> n;
		if( n == 0 ) break;

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

		string s;
		cin >> s;
		vector<int> v;
		for(int i = 0; i < s.length(); i++) {
			for(int j = 0; j < sta.size(); j++) {
				if( s.at(i) == sta.at(j) ) {
					v.push_back(j);
					break;
				}
			}
		}

		vector<int> ans;
		int indx = 0;
		for(int i = 0; i < v.size(); i++) {
			int tmp = v.at(i) - key.at(indx);
			indx = ( indx + 1 ) % key.size();
			if( tmp < 0 ) tmp += sta.size();
			ans.push_back( tmp );
		}

		for(int i = 0; i < ans.size(); i++) 
			cout << sta.at( ans.at(i) );
		cout << endl;
	}

	//while(1){}

	return 0;
}

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

using namespace std;

#define NMAX 100

int main(){

	int n;
	int k[NMAX];
	string s;
	string sta("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
	int ans;

	while(1){
		cin>>n;
		if(n==0) break;
		for(int i=0;i<n;i++) cin>>k[i];
		cin>>s;
		for(int i=0;i<s.size();i++){
			ans=sta.find(s[i]);
			ans-=k[i%n];
			if(ans<0) ans+=sta.size();
			s[i]=sta[ans];
		}
		cout<<s<<endl;
	}

}

C++: #include <bits/stdc++.h>
using namespace std;
const int M = 52;

int k[100];

int main()
{
	int ctoi[256];
	char itoc[52];
	for (int i = 0; i < 26; i++){
		ctoi['A' + i] = i;
		itoc[i] = 'A' + i;
	}
	for (int i = 0; i < 26; i++){
		ctoi['a' + i] = 26 + i;
		itoc[26 + i] = 'a' + i;
	}
	
	int n;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> k[i];
	}
	
	string s;
	cin >> s;
	for (int i = 0; i < s.size(); i++){
		s[i] = itoc[(ctoi[s[i]] - k[i % n] + M) % M];
	}
	cout << s << endl;
}

C++: #include <bits/stdc++.h>
using namespace std;
const int M = 52;

int k[100];

int main()
{
	int ctoi[256];
	char itoc[52];
	for (int i = 0; i < 26; i++){
		ctoi['A' + i] = i;
		itoc[i] = 'A' + i;
	}
	for (int i = 0; i < 26; i++){
		ctoi['a' + i] = 26 + i;
		itoc[26 + i] = 'a' + i;
	}
	
	int n;
	while (cin >> n, n){
		for (int i = 0; i < n; i++){
			cin >> k[i];
		}
		
		string s;
		cin >> s;
		for (int i = 0; i < s.size(); i++){
			s[i] = itoc[(ctoi[s[i]] - k[i % n] + M) % M];
		}
		cout << s << endl;
	}
	
	return 0;
}