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 <stdio.h>
#include <string>
#include <vector>

#define loop(lp) for(int lp2 = 0; lp2 < lp; lp2 ++) 
#define ascent(i,a,b) for(int i = a; i < b; i ++)

#define pb push_back

using namespace std;

string list = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main() {
  int n;
  while(cin >> n, n) {
    vector<int> k;
    loop(n) {
      int tmp;
      cin >> tmp;
      k.pb(tmp);
    }

    string s;
    cin >> s;

    // A = 65,Z =  91
    // a = 97,z = 123;
    
    int cnt = 0;
    ascent(i, 0, s.length()) {
      int c;
      if('A' <= s[i] && s[i] <= 'Z') {
	c = 26 + s[i] - 'A';
      }
      else if('a' <= s[i] && s[i] <= 'z') {
	c = s[i] - 'a';
      }
    
      //   cout << " " << c << " " << k[cnt%n] << " " << list[(52 + c-k[cnt%n])%52] << endl;
      s[i] = list[(52 + c-k[cnt%n])%52];
      cnt ++;
    }

    cout << s << endl;
  }
  return 0;
}

C++: #ifndef _WIN32
#include<iostream>
#endif 

#include<cmath>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;

#define FOR(i,bg,ed) for(int i = (bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)
struct cww {
	cww() {
		ios::sync_with_stdio(false);
		cin.tie(0);
	}
}star;
template<typename T>
istream & operator>> (istream &is, vector<T>&v) {
	for (auto &it : v)is>> it;
	return is;
}
char f(char c) {
	if (c == 'a')return 'Z';
	if (c == 'A')return 'z';
	return c - 1;
}
int main() {
	int n;
	while (cin >> n, n) {
		vector<int> k(n);
		cin >> k;
		string s;
		cin >> s;
		int id = 0;
		for (auto &c : s) {
			REP(i,k[id]) {
				c = f(c);
			}
			id++;
			id %= n;

		}
		cout << s << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define pi M_PI
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int mod(int x, int y){
    return x % y + (x % y < 0 ? y : 0);
}

int main() {
    int n;
    string station = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    int m = station.length();
    map<char, int> mp;
    REP(i,m){
        mp[station[i]] = i;
    }
    while (cin >> n && n){
        VI k(n);
        REP(i,n) cin >> k[i];
        string s;
        cin >> s;
        REP(i,s.length()){
            int x = mp[s[i]];
            s[i] = station[mod(x-k[i%n], m)];
        }
        cout << s << endl;
    }

    return 0;
}

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

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

typedef long long ll;
using namespace std;
int mod = 1000000007;

int main(void){
    char moji[52];
    rep(i, 26){
        moji[i] = 'A' + i;
    }
    rep(i, 26){
        moji[i+26] = 'a' + i;
    }
    int N;
    string S;
    while(true){
        string res = "";
        cin >> N;
        if(N == 0) break;
        vector<int> K(N);
        rep(i, N) cin >> K[i];
        cin >> S;
        int lenS = S.length();
        rep(i, lenS){
            //0 -> A 51 -> z
            int A;
            if(S[i] <= 'Z') A = S[i] - 'A';
            else A = S[i] - 'a' + 26;
            A -= K[i % N];
            if(A < 0) A += 52;
            res += moji[A];
        }
        cout << res << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(int)(a); (i)<(int)(b); ++(i))
#define rFor(i, a, b) for(int (i)=(int)(a)-1; (i)>=(int)(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<int, lint> pil;
typedef pair<lint, lint> pll;
template<class T>bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T>bool chmin(T &a, const T &b){if(a>b){a=b; return true;} return false;}

constexpr lint mod = 1e9+7;
constexpr lint INF = mod*mod;
constexpr int MAX = 100010;

int main(){
    int n;
    string t;
    for(char c='a'; c<='z'; ++c) t += c;
    for(char c='A'; c<='Z'; ++c) t += c;
    t += t;
    while(scanf("%d", &n) && n){
        int K[n];
        rep(i, n) scanf("%d", &K[i]);
        string s;
        cin >> s;
        int cur = 0;
        for(char &c: s){
            int idx = 0;
            rrep(i, t.size())if(t[i] == c){
                idx = i;
                break;
            }
            c = t[idx-K[cur]];
            (cur += 1) %= n;
        }
        cout << s << "\n";
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)

string station = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int n;
int main() {
    while(cin>>n) {
        if(n==0) return 0;
        vector<int> vec(n);
        rep(i,n) {
            int a; cin>>a;
            vec[i]=a;
        }
        string ss;
        cin>>ss;
        rep(i,ss.size()) {
            int a = i % vec.size();
            int t = station.find(ss[i])-vec[a];
            if(t<0) t += station.size();
            t %= station.size();
            cout<<station[t];
        }
        cout<<endl;

    }

    return 0;
}