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 <map>

using namespace std;
int n;
int a[110];
string station ="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
int main(){
  map<char,int> place;
  for(int i = 0;i < station.length();i++){
    place[station[i]] = i;
  }
  while(cin>>n,n){
    string str;
    for(int i = 0;i < n;i++){
      cin>>a[i];
    }
    cin>>str;
    string ans ="";
    int pos = 0;
    for(int i = 0;i < str.length();i++){
      char c;
      int x = place[str[i]];
      if(x - a[pos] >= 0){
	ans += station[x - a[pos]];
      }else{
	ans += station[station.length() + (x - a[pos])];
      }
      pos =(pos + 1)%n;
    }
    cout <<ans<<endl;

  }
return 0;
}

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


int n;
int key[110];
string str;

char x[60];

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

    for(int i= 0; i < n ; i++)
      cin >> key[i];

    cin >> str;
    for(int i = 0,j = 0; i < str.size() ; i++,j++){
      if(i % n == 0) j = 0;
      
      char tmp = str[i] - key[j]; 
   
      if(str[i] - key[j] < 'A' ){
	str[i] += 52 + 6;
      }
      if(str[i] >= 'a' && str[i] - key[j] < 'a') str[i] -= 6;
      str[i] -= key[j];
    }
    cout << str << endl;
  }

  return 0;
}

C++: #include "bits/stdc++.h"

#define REP(i,n) for(ll i=0;i<n;++i)
#define RREP(i,n) for(ll i=n-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<n;++i)
#define RFOR(i,m,n) for(ll i=n-1;i>=m;--i)
#define ALL(v) (v).begin(),(v).end()
#define PB(a) push_back(a)
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define DUMP(v) REP(i, (v).size()) { cout << v[i]; if (i != v.size() - 1)cout << " "; else cout << endl; }
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

const int dx[8] = { 1,1,0,-1,-1,-1,0,1 };
const int dy[8] = { 0,1,1,1,0,-1,-1,-1 };


using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll max(ll a, int b) { return max(a, ll(b)); }
ll max(int a, ll b) { return max(ll(a), b); }
///(?´????????`)(?´????????`)(?´????????`)(?´????????`)(?´????????`)(?´????????`)///
char prev(char c) {
	if (c == 'a')return 'Z';
	if (c == 'A')return 'z';
	else return c - 1;
}
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	while (1) {
		int n;
		cin >> n;
		if (!n)break;
		vi v(n);
		REP(i, n)cin >> v[i];
		string s;
		cin >> s;
		REP(i, s.size()) {
			char c = s[i];
			REP(j, v[i%n])c = prev(c);
			cout << c;
		}
		cout << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
#define N 100

int main(){
        int i=0, key[N], count=0;
        string keymoji;

        cin >> i;
        while(i != 0){
                for(int j=0; j<i; j++){
                        cin >> keymoji;
                        key[j] = (keymoji[0]-'0')*10+keymoji[1]-'0';
                }
                //for(int j=0; j<i; j++){
                //      key[j] = keymoji[j*2]-'0';
                //}
                string eki;
                cin >> eki;
                for(int j=0; j<eki.size(); j++){
                        if(eki[j] <= 'Z'){
                                eki[j] -= key[j%i];
                                if(eki[j] < 'A'){
                                        eki[j] = 'z'+1-('A'-eki[j]);
                                        if(eki[j] < 'a'){
                                                eki[j] = 'Z'+1-('a'-eki[j]);
                                        }
                                }
                        }else{
                                if(eki[j]-key[j%i] < 'a'){
                                        eki[j] -= key[j%i]+('a'-'Z'-1);
                                        if(eki[j] < 'A'){
                                                eki[j] += 'z'-'A'+1;
                                        }
                                }else{
                                        eki[j] -= key[j%i];
                                }
                        }
                }
                cout << eki << endl;
                cin >> i;
        }


}

C++: #include<iostream>
#include<string>
#include<cstdio>
using namespace std;

int main(){

  int n;
  int d[1000];
  int l;
  string s;

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

    l = 0;
    for(int i=0;i<s.size();i++){
      char c = s[i]-d[(l++)%n];
      if(c < 'A') c = 'z'-('A'-c-1);
      if(c < 'a' && c > 'Z') c = 'Z'-('a'-c-1);
      cout << c;
    }

    cout << endl;
  }

}

C++: #include <iostream>
#include <string>
using namespace std;

string str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main(int argc, const char * argv[]) {
    while(1){
        int n; cin >> n;
        if(!n) break;
        
        int back[100] = {0};
        for(int i = 0; i < n; i++){
            cin >> back[i];
        }
        
        string memo; cin >> memo;
        for(int i = 0; i < memo.size(); i++){
            int idx = str.find(memo[i]) - back[i%n];
            if(idx < 0) idx += str.size();
            cout << str[idx];
        }
        cout << endl;
        
    }
}