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 <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define STI(s) atoi(s.c_str())
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;
const double EPS = 1e-9;



int main(void) {

    while(1){
        int n;
        cin>>n;
        if(!n)break;
        vi v(n);
        rep(i,n){
            cin>>v[i];
            v[i]%=52;
        }
        string s;
        cin>>s;
        rep(i,s.size()){
            int d = v[i%n];
            if(s[i]>='a'&&s[i]<='z'){
                if(s[i]-'a'-d>=0){
                    s[i]-=d;
                }else{
                    d-=s[i]-'a'+1;
                    if(d>=26){
                        d-=26;
                        s[i]='z'-d;
                    } else {
                        s[i]='Z'-d;
                    }
                }
            }
            else if(s[i]>='A'&&s[i]<='Z'){
                if(s[i]-'A'-d>=0){
                    s[i]-=d;
                }else{
                    d-=s[i]-'A'+1;
                    if(d>=26){
                        d-=26;
                        s[i]='Z'-d;
                    } else {
                        s[i]='z'-d;
                    }
                }
            }
        }
        fin(s);
    }
}

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

using namespace std;

const string station = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main() {
  int n;
  while(cin>>n && n!=0) {
    int tmp;
    vector<int> keys;
    for(int i=0; i<n; i++) {
      cin>>tmp;
      keys.push_back(tmp);
    }
    string tmpS, str;
    getline(cin, tmpS);
    getline(cin, str);
    //cout<<"!"<<str<<endl;
    int usingKey = 0;
    string ans;
    //cout<<"!"<<keys.size();
    for(int i=0; i<str.length(); i++) {
      //cout<<"keys="<<keys[usingKey];
      int now = station.find(str[i]);
      ans += station[(now-keys[usingKey]+52)%52];
      //ans += str[i];
      usingKey++;
      //cout<<"nextkeys="<<keys[usingKey];
      if(usingKey == keys.size()) {
	usingKey = 0;
	//cout<<"TRUE";
      }
    }
    //cout<<str<<endl;
    cout<<ans<<endl;
  }
}

C++: #include<bits/stdc++.h>
using namespace std;

string str, k_list;
int k[111];

int main(){
  /*
  for (int i = 0; i < 26; i++) {
    str += (char)('a' + i);
  }
  for (int i = 26; i < 52; i++) {
    str += (char)('a' + i);
  }
  */

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

    cin>>k_list;
    int size = k_list.length();

    for (int i = 0; i < size; i++) {
      if('a' <= k_list[i] && k_list[i] <= 'z') {
        if ('a' <= k_list[i] - k[i%n] && k_list[i] - k[i%n] <= 'z') {
          cout<<(char)(k_list[i] - k[i%n]);
        } else {
          cout<<(char)(k_list[i] - k[i%n] - 'a' + 'Z' + 1);
        }
      } else {
        if('A' <= k_list[i] - k[i%n] && k_list[i] - k[i%n] <= 'Z') {
          cout<<(char)(k_list[i] - k[i%n]);
        } else {
          cout<<(char)(k_list[i] - k[i%n] - 'A' + 'z' + 1);
        }
      }
    }
    cout<<endl;
  }



}