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>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define bFOR(i,n1,n2) for(ll i=n1;i>=n2;i--)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef long long int ll;
typedef pair<ll,ll> Pi;
typedef tuple<ll,ll,ll> Tu;
const int INF=(ll)(1LL<<30)-1;
const double INFd=100000000000.0;
const double PI=3.14151926535;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
const ll tMOD=(ll)998244353;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
int dx[4]={0,-1,0,1},dy[4]={-1,0,1,0};
int mdx[8]={0,1,0,-1,1,1,-1,-1},mdy[8]={-1,0,1,0,1,-1,1,-1};


template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

char sol(int t,char c){
    int res;
    if('a'<=c&&c<='z')res=c-'a';
    else res=c-'A'+26;
    char ans;
    res=(res-t+52)%52;
    if(0<=res&&res<26)ans='a'+res;
    else ans='A'+(res-26);
    return ans;
}
int main(){
    int n;
    int k[110];
    string s;
    while(true){
        cin>>n;
        if(n==0)break;
        REP(i,n)
            cin>>k[i];
        cin>>s;
        string ans="";
        REP(i,s.size()){
            cout<<sol(k[i%n],s[i]);
        }
        cout<<endl;
    }
    return 0;
}

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

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> ppi;

#define INF 1000000000



int main(){
  int n;
  while(scanf("%d", &n), n){
    vector<int> k(n);
    rep(i,n){
      scanf("%d", &k[i]);
    }
    char s[103];
    scanf("%s", s);

    int len=strlen(s);
    rep(i,len){
      if(s[i]>='a' && s[i]<='z'){
	s[i]=s[i]-k[i%n];
	if(s[i]<'a'){
	  s[i]+='Z'-'a'+1;
	  if(s[i]<'A') s[i]+='z'-'A'+1;
	}
      } else {
	s[i]=s[i]-k[i%n];
	if(s[i]<'A'){
	  s[i]+='z'-'A'+1;
	  if(s[i]<'a') s[i]+='Z'-'a'+1;
	}
      }
    }

    cout<<s<<endl;

  }
  return 0;
}

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

using namespace std;

int main()
{
    const auto stations = [] {
        vector<char> stations(52);
        iota(begin(stations), begin(stations) + 26, 'a');
        iota(begin(stations) + 26, end(stations), 'A');
        return stations;
    }();
    while (true) {
        int n;
        cin >> n;
        if (n == 0) {
            return 0;
        }

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

        string s;
        cin >> s;

        // repeat key vector
        while (keys.size() < s.size()) {
            vector<int> temp(keys);
            copy(begin(keys), end(keys), back_inserter(temp));
            swap(keys, temp);
        }

        auto decrypt = [&stations](char c, int key) {
            auto stationIndex = 'a' <= c && c <= 'z' ? c - 'a' : c - 'A' + 26;
            // 52's complement
            auto minus = stations.size() - key;
            auto decryptedIndex = (stationIndex + minus) % stations.size();
            return stations[decryptedIndex];
        };

        for (size_t i = 0; i < s.size(); ++i) {
            cout << decrypt(s[i], keys[i]);
        }
        cout << endl;
    }
}