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>
#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) + 1;
          }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)) + 1;
          }else{
            s[i] = 122 - (k[x] - (s[i] - 65)) + 1;
          }
        }else{
          s[i] -= k[x];
        }
      x++;
      x %= n;
    }
    cout << s << endl;
  }
}

C++: #include <cstdio>
#include <utility>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#define REP(i,n) for(int i=0;i<n;i++)
typedef long long ll;
using namespace std;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef vector<string> vs;

int main() 
{
	char a[52] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
	
	int n;
	while(cin >> n && n!=0)
	{
		int b[100]={};
		REP(i,n){cin >> b[i];} //カギ
		
		char c[100]={}; //文字
		cin >> c;
		
		
		REP(i,sizeof(c))
		{
			REP(j,52)
			{
				if(c[i]==a[j])
				{
					cout << a[( j - b[(i +n)% n] +52) % 52];
					break;
				}
			}
		}
		cout << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main(){
  int n;
  while(cin >> n,n){
    int k[n];
    for(int i=0;i<n;i++) cin >> k[i];
    string s;
    cin >> s;
    int j=0;
    for(int i=0;i<s.size();i++){
      if(j==n)j=0;
      s[i]-=k[j];
      if(s[i]<65)s[i]+=58;
      if(s[i]>90&&s[i]<97)s[i]-=6;
      j++;
    

    }
  cout << s << endl;
  }
}

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

int main(){
	int n,k[100];
	string s;
	while(cin>>n,n){
		rep(i,n) cin>>k[i];
		cin>>s;
		rep(i,s.size()){
			char a;
			int S=s[i],K=min(k[i%n],52-k[i%n]);
			if('a'<=S&&S<='z'){
				if('a'<=S-K&&S-K<='z'){
					a=S-K;
				}else if(S-K<'a'){
					a='Z'+1-'a'+S-K;
				}else{
					a='A'-1+S-K-'z';
				}
			}else{
				if('A'<=S-K&&S-K<='Z'){
					a=S-K;
				}else if(S-K<'A'){
					a='z'+1-'A'+S-K;
				}else{
					a='a'-1+S-K-'Z';
				}
			}
			cout<<a;
		}
		cout<<endl;
	}
}

C++: #include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <numeric>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <functional>
#include <complex>

using namespace std;

const int INF = (1<<30) - 1;

string table = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n;
    while(cin >> n, n){
        vector<int> key(n);
        for(int i=0; i<n; i++)
            cin >> key[i];
        string s;
        cin >> s;
        for(int i=0; i<s.size(); i++){
            char &c = s[i];
            c = table[(table.find_first_of(c)-key[i%n]+52)%52];
        }
        cout << s << endl;
    }
    
    return 0;
}

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

int main()
{
	int N;
	string chipher;

	while(cin >> N)
	{
		if (N == 0) { break; }
		vector<int> keys(N);

		for(int i = 0; i < N; i++) {
			cin >> keys[i];
		}
		cin >> chipher;
		//cout << chipher;
		
		for(int i = 0; i < chipher.size(); i++)
		{
			char ans;
			int ii = i % keys.size();
			int diff_i;
			bool upper = true;
			if ('a' <= chipher[i] && chipher[i] <= 'z') {
				diff_i = chipher[i] - 'a';
				upper = false;
			}
			else if ('A' <= chipher[i] && chipher[i] <= 'Z') {
				diff_i = chipher[i] - 'A';
				upper = true;
			}
			int left_diff_i = diff_i - keys[ii];
			//cout << left_diff_i << " ";
			
			//int left_diff_i = diff_i - keys[ii];
			if (left_diff_i < 0) {
				while(left_diff_i < 0) {
					left_diff_i = 26 + left_diff_i;
				}
			}
			else {
				ans = left_diff_i;
			}

			if (upper) {
				cout << (char)('A'+left_diff_i);
			}
			else {
				cout << (char)('a'+left_diff_i);
			}


		}
		cout << endl;
	}
	return EXIT_SUCCESS;
}