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
//------------------------------------------
#include <bits/stdc++.h> // only for GCC

using namespace std;

//typedef
//------------------------------------------
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

//container util
//------------------------------------------
#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair

//repetition
//------------------------------------------
#define loop(i,a,b) for(ull i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define iter(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define riter(i,c) for(auto i=(c).rbegin(); i!=(c).rend(); ++i)

//constant
//--------------------------------------------
const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

// output vector
// ------------------------------------------
namespace std {
    template<typename T>ostream&operator<<(ostream&os, vector<T>const&v){
        iter(it,v) os<<*it<<(it+1==v.end()?"":",");
        return os;
    }
    template<typename T, typename U>ostream&operator<<(ostream&os,const pair<T,U>&p){
        return os << "[" << p.dirst << "," << p.second << "]";
    }
}

//clear memory
// ------------------------------------------
#define clr(a,i) memset((a), (i) ,sizeof(a))

int main(){
   int n;
   while(cin >> n && n){
      vi a(n);
      rep(i,n){
         cin >> a[i];
      }
      string s;
      cin >> s;
      rep(i,s.size()){
         rep(j,a[i%n]){
            s[i]--;
            if(s[i]<'A') s[i]='z';
            else if(s[i]<'a'&&s[i]>'Z') s[i]='Z';
         }
      }
      cout << s << endl;
   }
}

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

using namespace std;

const int MAX_N = 108;

int main() {
	while (true) {
	int n;
	int ns[MAX_N];
	string s;
	
	cin >> n;
	if (n == 0) return 0;
	for (int i = 0; i < n; ++i) {
		cin >> ns[i];
	}
	cin >> s;
	for (int i = 0; i < s.size(); ++i) {
		char station = s[i] - ns[i%n];
		if (station > 'Z' && station < 'a') {
			station = 'Z' - ('a' - station) + 1;
		} else if (station < 'A') {
			station = 'z' - ('A' - station) + 1; 
		}
		cout << station;
	}
	cout << endl;
	}

	return 0;
}

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

int toInt(char a){
  if(islower(a))return a-'a';
  return a-'A'+26;
}

char toChar(int a){
  if(a<26)return 'a'+a;
  return 'A'+a-26;
}

const int M = 52;

int main(){
  int n,k[100];
  string s;

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

    for(int i=0;i<s.size();i++){
      int tmp = toInt(s[i]) - k[i%n];
      tmp = ((tmp%M) + M) % M;
      cout << toChar(tmp);
    }
    cout << endl;
  }
}

C++: #include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>

using namespace std;
#define int long long int
const int INF = 1001001001001001LL;
const int MOD = 1000000007;



signed main(){

    char alpha[60];
    int id = 0;
    map<char, int> to_id;
    for(char c = 'a'; c <= 'z'; c++){
        alpha[id] = c;
        to_id[c] = id;
        id++;

    }

    for(char c = 'A'; c <= 'Z'; c++){
        alpha[id] = c;
        to_id[c] = id;
        id++;
    }

    while(1){
        int n; cin >> n;
        if(!n) break;
        vector<int> k(n);
        for(int i = 0; i < n; i++) cin >> k[i];
        string s; cin >> s;

        for(int i = 0; i < (int)s.size(); i++){
            int id = i % n;
            int id2 = to_id[s[i]];
            id2 -= k[id];
            id2 = (id2 + 52) % 52;
            s[i] = alpha[id2];
        }

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

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

int main(){

    while(1){
        int n;
        cin >> n;
        vector<int> a(n);
        if(n==0)break;
        for(int i=0;i<n;i++){
            cin >> a[i];
        }
        string s;
        cin >> s;
        string al="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
        string ans="";
        for(int i=0;i<s.size();i++){
            for(int j=(int)al.size()-1;j>50;j--){
                if(s[i]==al[j]){
                    ans+=al[j-a[i%n]];
                    break;
                }
            }
        }
        cout << ans << endl;
    }

    return 0;
}

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

int main(){
  while(1){
    int n;
    cin>>n;
    int a;
    if(n==0)break;
    vector<int> k(n);
    string s;
    for(int i=0;i<n;i++)cin>>k[i];
    cin>>s;
    for(int i=0;i<s.size();i++){
      if(k[i%n]<=26){
        a=s[i]-k[i%n];
        if(a<65&&s[i]>=65&&s[i]<=90){
           a+=58;
         }else if(a<97&&s[i]>=97&&s[i]<=122)a-=6;
      }else{
        a=s[i]+(52-k[i%n]);
        if(a>122&&s[i]>=122&&s[i]>=97){
          a-=58;
        }else if(a>90&&s[i]<=90&&s[i]>=65)a+=6;
      }
      putchar(a);
      //cout<<" "<<a<<" "<<k[i%k.size()]<<" "<<s[i]<<endl;
    }
    cout<<endl;
  }
  return 0;
}