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 <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <map>
#define INF 1000000
 
using namespace std;
typedef long long ll;
 



char back(char a,int bnum){
	int lest;
	if('a'<=a && a<='z'){//こもじ
		if(a-bnum>='a'){
			return a-bnum;
		}else{
			lest=(a-'a'+1)-bnum;
			return 'Z'+lest;
		}
	}else if('A'<=a && a<='Z'){//おおもじ
		if(a-bnum>='A'){
			return a-bnum;
		}else{
			lest=(a-'A'+1)-bnum;
			return 'z'+lest;
		}
	}
}

int main(){
	while(1){
	int len;
	int n,k[101],key[101];
	cin>>n;
	if(n==0)break;

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

	int num=0;
	for(int i=0;i<101;i++){
		key[i]=k[num%(n)];
		num++;
	}
	for(int i=0;i<s.size();i++){
		s[i]=back(s[i],key[i]);
	}
	cout<<s<<endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

const int MAX_N = 100005;

int n;

int main()
{
    while(1){
        cin >> n;
        if(n == 0){
            break;
        }
        vector<int> v(n);
        for(int i=0;i<n;i++){
            cin >> v[i];
        }
        vector<char> vec;
        string s;
        cin >> s;
        for(int i=0;i<26;i++){
            vec.push_back((char)('a'+i));
        }
        for(int i=0;i<26;i++){
            vec.push_back((char)('A'+i));
        }
        for(int i=0;i<s.length();i++){
            int cnt;
            for(int j=0;j<52;j++){
                if(s[i] == vec[j]){
                    cnt = j;
                    break;
                }
            }
            cout << vec[(cnt+52-v[i%n])%52];
        }
        cout << "\n";
    }
}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <cassert>

using namespace std;


bool solve(){
	int n;
	cin>> n;
	if(!n) return false;
	vector<int> a(n);
	for(int i=0;i<n;i++){
		cin>> a[i];
	}
	string str;
	cin>> str;
	
	for(int i=0;i<str.size();i++){
		int k = a[i%n];
		k %= 26;
		char c = str[i];
		if(islower(c)){
			if(islower(c-k)){
				c -= k;
			}else{
				k -= c - 'a';
				c = 'Z' - (k - 1);
			}
		}else if(isupper(c)){
			if(isupper(c-k)){
				c -= k;
			}else{
				k -= c - 'A';
				c = 'z' - (k - 1);
			}
		}
		cout<< c;
	}
	cout<< endl;

	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	while(solve()){}

	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

const int MAX_N = 100005;

int n;

int main()
{
    while(1){
        cin >> n;
        if(n == 0){
            break;
        }
        vector<int> vec(n);
        for(int i=0;i<n;i++){
            cin >> vec[i];
        }
        string s;
        cin >> s;
        for(int i= 0;i < s.length();i++){
            int k = s[i] - 'a';
            if((int)(s[i] - 'a') >= 0){
                if((int)(s[i] - 'a') >= vec[i%n]){
                    cout << (char)(s[i] - vec[i%n]);
                }else{
                    cout << (char)('Z' - (vec[i%n] - k-1));
                }
            }else{
                if((int)(s[i] - 'A') >= vec[i%n]){
                    cout << (char)(s[i] - vec[i%n]);
                }else{
                    cout << (char)('z' - (vec[i%n] - k-1));
                }
            }
        }
        cout << "\n";
    }
}

C++: #include <bits/stdc++.h>

#define ALL(a) (a).begin(), (a).end()
#define llong long long

using namespace std;

signed main(){
	while(true){
		int n; cin >> n;
		if(n == 0)break;
		vector<int> k(n);
		for(auto &&e : k)cin >> e;
		string str; cin >> str;
		vector<int> s(str.size());
		for(size_t i = 0; i < str.size(); i++){
			if(islower(str[i])){
				s[i] = (int)(str[i] - 'a');
			}
			else{
				s[i] = (int)(str[i] - 'A'+26);
			}
		}
		for(size_t i = 0; i < s.size(); i++){
			int st = (s[i] + 52 - k[i%k.size()]) % 52;
			if(st >= 26){
				cout << (char)(st - 26 + 'A');
			}
			else{
				cout << (char)(st + 'a');
			}
		}
		cout << endl;
	}


	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int *k,i;
  char *s;
while(1){
  int n;
  s=new char[100];
  cin>>n;
  if(n==0)break;
  k= new int[n+1];
  for(i=1;i<=n;i++)cin>>k[i];
  cin>>s;
  for(i=0;s[i]!=0;i++){
    s[i]-=k[i%n+1];
    if(s[i]<'A')s[i]-='A'-'z'-1;
    else if(s[i]>'Z' && s[i]<'a')s[i]-=6;
  }
  cout<<s<<endl;

  delete s;
  delete k;
}

return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <stack>

using namespace std;

#define INF 1010001000
#define EPS 1e-10
#define rep(i, N) for (int i = 0; i < N; i++)
#define pb push_back

typedef pair<int, int> i_i;
typedef long long int llong;
typedef pair<llong, llong> ll_ll;
typedef struct edge {int f, t;}Edge;

void skip(int p, int s);
void decrement(int p);

int n;
string st;

int main()
{
    while (cin >> n, n) {
        vector<int> data(n);
        rep(i, n) {
            cin >> data[i];
        }
        cin >> st;
        for (int i = 0, j = 0; i < st.length(); i++, j++) {
            if (j == n) {
                j = 0;
            }
            skip(i, data[j]);
        }
        cout << st << endl;
    }
    return 0;
}

void skip(int p, int s)
{
    rep(i, s) {
        decrement(p);
    }
}

void decrement(int p)
{
    if (st[p] == 'A') {
        st[p] = 'z';
    } else if (st[p] == 'a') {
        st[p] = 'Z';
    } else {
        st[p]--;
    }
}