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++: //#pragma once
#include <stdio.h>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <sstream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cctype>


using namespace std;
#define modd 1000000007



typedef pair<long long, long long> pl;


typedef string::const_iterator State;
class ParseError {};




#define ll long long




class UnionFind {
public:
	vector <ll> par;
	vector <ll> siz;

	// Constructor
	UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL){
		for (ll i = 0; i < sz_; ++i) par[i] = i;
	}
	void init(ll sz_) {
		par.resize(sz_);
		siz.assign(sz_, 1LL);  // resize だとなぜか初期化されなかった
		for (ll i = 0; i < sz_; ++i) par[i] = i; // 初期では親は自分自身
	}

	// Member Function
	// Find
	ll root(ll x) { // 根の検索
		while (par[x] != x) {
			x = par[x] = par[par[x]]; // x の親の親を x の親とする
		}
		return x;
	}

	// Union(Unite, Merge)
	bool merge(ll x, ll y) {
		x = root(x);
		y = root(y);
		if (x == y) return false;

		// merge technique（データ構造をマージするテク．小を大にくっつける）
		if (siz[x] < siz[y]) swap(x, y);
		siz[x] += siz[y];
		par[y] = x;
		return true;
	}



	bool issame(ll x, ll y) { // 連結判定
		return root(x) == root(y);
	}

	ll size(ll x) { // 素集合のサイズ
		return siz[root(x)];
	}


};


class SegmentTree {
private:
	int n;
	vector <ll> node;

public:
	// 元の配列　v をセグメントツリーで表現する。
	SegmentTree(vector<ll> v) {
		//最下段のノード数は元配列のサイズ以上になる最小の2冪->これをnとおく。
		//セグ木全体で必要なノード数は2n-1個である。
		int sz = v.size();
		n = 1; 
		while (n < sz)n *= 2;

	}

};




long long N, M, K, a, b, c, d, e, H, W, L;
ll A[300005] = {};
ll B[300005] = {};
ll C[300005] = {};
bool f, ff;
string S;
set <long long>sll;
pl bufpl;
vector <long long>vl[100005];
vector <long long>vll;
vector <pl>vpl;
vector <string> vs;
set<ll> llset;
multiset<ll> llmset;


struct ST
{
	int kaisuu;
	int dan;
	int score;
	char situ[52][2][2];
	

	bool operator<(const ST& another) const
	{
		return dan < another.dan;//比較
	};

};



/*vector <ST> vst;
ST st[200005];
ST bufst;
bitset<5000> bits;*/


long long modinv(long long aa, long long mm) {
	long long bb = mm, uu = 1, vv = 0;
	while (bb) {
		long long tt = aa / bb;
		aa -= tt * bb; swap(aa, bb);
		uu -= tt * vv; swap(uu, vv);
	}
	uu %= mm;
	if (uu < 0) uu += mm;
	return uu;
}


ll minn, maxx;
double ansa;

string SS;
char ca;



int main() {



	for (int i = 0; i < 26; i++) {
		B[i] = 'A' + i;
	}
	for (int i = 0; i < 26; i++) {
		B[i + 26] = 'a' + i;
	}

	while (true) {


		cin >> N;

		if (N == 0) {
			break;
		}

		for (int i = 0; i < N; i++) {
			cin >> A[i];
		}


		cin >> SS;

		a = 0;
		f = false;

		for (int i = 0; i < SS.size(); i++) {

			if(SS[i]-'a'>=0){
				a = SS[i] - 'a';
				a += 26;
			}
			else {
				a = SS[i] - 'A';
			}
			a -= A[i % N];


			if (a < 0) {
				a += 52;
			}
			
			S += B[a];

		}


		cout << S << endl;

		S = "";
		SS = "";

	}

	return 0;

}

C++: // Last Change: 06/25/2019 19:16:03.
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

namespace NS {
void LoopUntilZeroInpput() {
  int hogegegege = 0;
  while (cin >> hogegegege && hogegegege != 0) {
  }
}
} // namespace NS

ll n;

char Fukugou(char c, int val) {
  // small
  if (c >= 97) {
    c -= val;
    if (c < 97) {
      c -= 6;
      if (c < 65) {
        c += 58;
      }
    }
  }
  // large
  else {
    c -= val;
    if (c < 65) {
      c += 58;
      if (c < 97) {
        c -= 6;
      }
    }
  }
  return c;
}

void Solve() {
  vector<int> k(n);
  string s;
  for (auto &&e : k) {
    cin >> e;
  }
  cin >> s;

  size_t sSize = s.size();
  string ans;
  int j = 0;
  for (size_t i = 0; i < sSize; ++i) {
    ans += Fukugou(s[i], k[j]);
    ++j;
    if (j == n) {
      j = 0;
    }
  }

  cout << ans << endl;
}

int main() {
  while (cin >> n and n > 0) {
    Solve();
  }
}

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


int n;
int key[1000];
string str;

char x[60];

int main(){
  
  while(1){
    cin >> n;
    if(n == 0) break;



    for(int i= 0; i < n ; i++)
      cin >> key[i];

    cin >> str;

    int size = str.size();
    //  cout << size <<" ";
    for(int i = 0,j = 0; i < size; i++,j++){
      if(i % n == 0){
	j = 0;
      }      
   
      for(int k = 0; k < key[j] ; k++){
	str[i]--;
	if(str[i]  < 'a' && str[i] > 'Z') str[i] -= 6;
	if(str[i] < 'A' ) str[i] += 52 + 6;

      }
      /*
	if(str[i] - key[j] < 'A' && str[i] <= 'Z' && ){
	str[i] += 52 + 6;
	}else  if(str[i] - key[j] < 'A' && str[i] >= 'a' ){
	str[i] += 52;
	}
	if(str[i] >= 'a' && str[i] - key[j] < 'a' && str[i] - key[j] > 'Z') str[i] -= 6;
	str[i] -= key[j];
	}

      */
          }
    cout << str << endl;
    
  }
  return 0;
  
}

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


using namespace std;


int main()
{
	int n;

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

		string s;cin >> s;
		string ans;
		for (int i = 0; i < s.size(); i++)
		{
			int t = s[i];
			for (int j = 0; j < k[i%n]; j++)
			{
				t--;
				if (t == 'a'-1)
					t = 'Z';
				if (t == 'A'-1)
					t = 'z';
				if (t == 'z'+1)
					t = 'A';
				if (t == 'Z'+1)
					t = 'a';
			}

			ans += t;
		}
		
		cout << ans << endl;
	}

	return 0;
}