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;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
#define int ll

signed main(void)
{
  while(true) {
    int n, k[105];
    cin >> n;
    if(!n) break;
    REP(i, n) cin >> k[i];
    string s;
    cin >> s;
    int t[105];
    REP(i, s.size()) {
      if('a' <= s[i] && s[i] <= 'z') {
        t[i] = s[i] - 'a' + 1;
      } else {
        t[i] = s[i] - 'A' + 27;
      }
    }
    int cnt = 0;
    REP(i, s.size()) {
      t[i] -= k[cnt];
      if(t[i] <= 0) t[i] += 52;
      cnt++;
      if(cnt == n) cnt = 0;
    }
    //REP(i, s.size()) cout << t[i] << " "; cout << endl;
    REP(i, s.size()) {
      if(1 <= t[i] && t[i] <= 26) {
        cout << (char)('a' + t[i] - 1);
      } else {
        cout << (char)('A' + t[i] - 27);
      }
    }
    cout << endl;
  }

  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
const double PI = 3.14159265358979;
const double E = 2.718281828459045;
const double root2 = sqrt(2);
typedef pair<int, int> P;
typedef unsigned int ui;
int main() {
	int n;
	while (cin >> n) {
		if (n == 0)break;
		int k; int ke[100];
		for (int i = 0; i < n; i++) {
			cin >> k; ke[i] = k;
		}
		string s; cin >> s;
		int len = s.length();
		for (int i = 0; i < len; i++) {
			if ('a'<=s[i]&&s[i]<='z') {
				int t = s[i] - 'a';
				t -= ke[i%n];
				if (-26 <= t && t < 0) {
					char out = t + 26 + 'A';
					cout << out;
				}
				else {
					char out = (t + 52)%52 + 'a';
					cout << out;
				}
			}
			else {
				int t = s[i] - 'A';
				t -= ke[i%n];
				if (-26 <= t && t < 0) {
					char out = t + 26 + 'a';
					cout << out;
				}
				else {
					char out = (t + 52) % 52 + 'A';
					cout << out;
				}
			}
		}
		cout << endl;
	}
	return 0;
}

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

string l;
void make_l(){
  l = "";
  for(char c = 'a';c<='z';c++)l+=c;
  for(char c = 'A';c<='Z';c++)l+=c;
}
vector<int> k;
string s;
void init(){
  k.clear();
}

bool input(){
  int n;
  cin>>n;
  if(n==0)return false;
  k.resize(n);
  for(int i=0;i<k.size();i++){
    cin>>k[i];
  }
  cin>>s;
  return true;
}

string solve(){
  string res = "";
  for(int i=0;i<s.size();i++){
    char c = s[i];
    const int n = i%k.size();
    int cc = 0;
    while(c!=l[cc])cc++;
    cc -= k[n];
    cc += l.size();
    cc %= l.size();

    res += l[cc];
  }
  return res;
}

int main(){
  make_l();
  while(init(),input()){
    cout<<solve()<<endl;
  }
}

C++: #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define fi first
#define se second
#define pb push_back
#define rep(i, s, n) for (int i = s; i < n; i++)
#define rrep(i, s, n) for (int i = (n)-1; i >= (s); i--)
#define REP(i,n) for(int i = 0;i < n; i++)
#define all(a) a.begin(),a.end()
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
const long long MOD = 1000000007, INF = 1e18;

#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)
 
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}
template<typename T>vector<T>
make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
	return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
	for(auto &e:t) fill_v(e,v);
}



signed main(){
	IOS();
	vector<string>ans;
	vector<char>c(26*2);
	rep(i,0,26)c[i]='a'+i;
	rep(i,26,52)c[i]='A'+i-26;
	while(1){
		int N;
		cin>>N;
		if(!N)break;
		vector<int>a(N);
		REP(i,N)cin>>a[i];
		string s;
		cin>>s;
		string t="";
		rep(i,0,s.size()){
			int tmp;
			if('a'<=s[i]&&s[i]<='z')tmp=s[i]-'a';
			else tmp=s[i]-'A'+26;
			t+=c[(tmp-a[i%N]+52)%52];
		}
		ans.push_back(t);
	}
	for(auto e:ans){
		cout<<e<<endl;
	}
}

C++: #include <iostream>
#include <cstdio>
#define REP(i,n) for(int i=0;i<(n);i++)
using namespace std;

int main()
{
  
  while(1){
    int n;
    cin >> n;
    if(n == 0) break;
    int k[n];
    REP(i,n)
      cin >> k[i];
    string s;
    cin >> s;
    int x = 0;
    REP(i,(int)s.size()){
      if(s[i] >= 97)
        if(s[i] - k[x] < 97){
          if(k[x] - (s[i] - 97) >= 26){
            s[i] = 122 - (k[x] - (s[i] - 97) - 26) + 2;
          }else{
            s[i] = 90 - (k[x] - (s[i] - 97)) + 1;
          }
        }else{
          s[i] -= k[x];
        }
      else
        if(s[i] - k[x] < 65){
          if(k[x] - (s[i] - 65) >= 26){
            s[i] = 90 - (k[x] - (s[i] - 65)) + 2;
          }else{
            s[i] = 122 - (k[x] - (s[i] - 65)) + 1;
          }
        }else{
          s[i] -= k[x];
        }
      x++;
      x %= n;
    }
    cout << s << endl;
  }
}