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 LOG(...) fprintf(stderr, __VA_ARGS__)
//#define LOG(...)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define RFOR(i, a, b) for (int i = (int)(b - 1); i >= (int)(a); --i)
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define RREP(i, n) for (int i = (int)(n - 1); i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SZ(a) ((int)(a).size())
#define BIT(x, i) (((x) >> (i)) & 1)
#define SQ(x) ((x) * (x))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

int main() {
    string table = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    int n;
    while (cin >> n, n) {
        vi key(n);
        string s;
        REP(i, n) cin >> key[i];
        cin >> s;
        REP(i, SZ(s)) cout << table[(table.find(s[i]) - key[i%n] + 52) % 52];
        cout << endl;
    }
}

C++: #include<cstdio>
using namespace std;
typedef long long ll;

ll n, k[100];
char s[101];

char next(char c, char d) {
  if (d == 0) return c;
  if ('a' <= c && c <= 'z') {
    char temp = c - 'a' + 1;
    if (temp <= d) return next('Z', d - temp);
    return c - d;
  } else {
    char temp = c - 'A' + 1;
    if (temp <= d) return next('z', d - temp);
    return c - d;
  }
}

int main() {
  while (scanf("%lld", &n), n) {
    for (ll i = 0; i < n; i++) scanf("%lld", &k[i]);
    scanf("%s", s);
    for (ll i = 0; s[i] != 0; i++) {
      printf("%c", next(s[i], (char)k[i%n]));
    }
    printf("\n");
  }
}

C++: // {{{ include
#include <cstdio>
#include <cmath>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
// }}}

using namespace std;

typedef long long ll;
inline int in(){int x;scanf("%d",&x);return x;}

int key[128];

char getPrev(char C, int p) {
  const string table = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  return table[(table.find(C) + table.size() - p) % table.size()];
}

int main()
{
  int N;
  while (N = in()){
    for (int i = 0; i < N; i++) key[i] = in();
    string S;
    cin >> S;
    for (int i = 0, i_len = S.size(); i < i_len; i++){
      putchar(getPrev(S[i], key[i % N]));
    }
    puts("");
  }

  return 0;
}

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

using namespace std;

signed main(){

   while(1){
      int n;
      cin>> n;
      if(!n) break;

      vector<int> key;
      for(int i=0; i<n; i++){
         int k;
         cin>> k;
         key.push_back(k);
      }
      string s;
      cin>> s;
      while(key.size()<s.size()){
         for(int i=0; i<n; i++) key.push_back(key[i]);
      }

      vector<char> alp;
      for(char c='a'; c<='z'; c++) alp.push_back(c);
      for(char C='A'; C<='Z'; C++) alp.push_back(C);

      string answer;
      for(int i=0; i<s.size(); i++){
         char c=s[i];
         for(int j=0; j<alp.size(); j++){
            if(alp[j]==c){
               answer+=(alp[(j-key[i]+52)%52]);
            }
         }
      }
      
      cout<< answer<< endl;
   }

   return 0;
}

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

using namespace std;

int n, k, r[100]; string S;

const string T = "abcdefghijklmnpoqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnpoqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main()
{
	while (true)
	{
		scanf("%d", &n);

		if (n == 0) break;

		for (int i = 0; i < n; i++)
		{
			scanf("%d", &r[i]);;
		}

		cin >> S;

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

			for (int j = 52; j < 104; j++)
			{
				if (S[i] == T[j]) key = j;
			}

			key -= r[i]; S[i] = T[key];
		}

		cout << S << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <cstring>
#include <cmath>

using namespace std;

int main(int argc, char *argv[]) {
  string table = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

  while (true) {
    int num, *keys;
    string s;

    if (cin >> num, num == 0) {
      break;
    }
    keys = new int[num];
    for (int i = 0; i < num; i++) {
      cin >> keys[i];
    }
    cin >> s;

    for (int i = 0, len = s.length(); i < len; i++) {
      int index;
      if ('a' <= s[i] && s[i] <= 'z') {
        index = s[i] - 'a' - keys[i % num];
      } else {
        index = s[i] - 'A' + 26 - keys[i % num];
      }
      index = (index < 0 ? index + table.length() : index);
      s[i] = table[index];
    }
    cout << s << endl;
    delete keys;
  }
  return 0;
}

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

using namespace std;

int main(void)
{
	int n;
	string s;
	string ans;
	char temp;

	int i1,i2;

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

		vector<int> k(n);

		for(i1=0;i1<n;i1++){
			cin>>k[i1];
		}
		cin>>s;

		ans="";
		for(i1=0;i1<s.size();i1++){
			temp=s[i1];
			for(i2=0;i2<k[i1%n];i2++){
				temp--;
				if(temp==('a'-1)) temp='Z';
				if(temp==('A'-1)) temp='z';
			}
			ans+=temp;
		}

		cout<<ans<<endl;
	}
	return 0;
}