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 <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
 
using namespace std;
 
#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,s,e) for(int i=(s); i<(e); i++)
#define pb(n) push_back((n))
#define mp(n,m) make_pair((n),(m))
#define all(r) r.begin(),r.end()
#define fi first
#define se second
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 

 
 
const int INF = 1000000;


char calc(char c, int n){
	char ret;
	
	ret = c - n;

	if(ret < 'A') ret += 26 + 'a' - 'A';
	else if(ret > 'Z' &&ret < 'a') ret += 26 + 'A' - 'a';

	return ret;
}

int main(){
	string s;
	int n;
	
	while(cin>>n){
		if(n == 0) break;
		vi v(n, 0);
		rep(i, n) cin>>v[i];
		cin>>s;

		for(int i = 0; i < s.size(); i++){
			s[i] = calc(s[i], v[i % v.size()]);
		}

		cout<<s<<endl;
	}
}

C++: #include <iostream>
#include <vector>
using namespace std;

int main(){
    int n;
    while(cin>>n,n){
        vector<int> a;
        for(int i=0,t;i<n;++i){
            cin>>t;
            a.push_back(t);
        }
        string s,ans;
        cin>>s;
				
				string TBL;
				for(char i='a';i<='z';++i) TBL += i;
				for(char i='A';i<='Z';++i) TBL += i;
				
        for(int i=0;i<s.size();++i){
            int x=a[i%a.size()];
            int p=TBL.find(s[i]);
            ans += TBL[(p-x+52)%52];
        }
        cout<<ans<<endl;
    }
}

C++: #include <cstdio>
#include <iostream>
#include <cmath>
#include <ctype.h>
#include <cstring> 
#include <sstream>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>

using namespace std;

int main()
{
	int n;
	while(1){
		cin >> n;
		if(n == 0) break;
		int key[200];
		char s[200], right_s[200], ch;
		for(int i = 0; i < n; i++){
			cin >> key[i];
		}
		ch = getchar();
		fgets(s, sizeof(s), stdin);
		int wronglist[200]={0}, rightlist[200];
		for(int i = 0; i < strlen(s)-1; i++){
			wronglist[i] = s[i] - 'A';
			if(wronglist[i] > 25) wronglist[i] -= 6;
			rightlist[i] = wronglist[i] - key[i%n];
			if(rightlist[i] < 0) rightlist[i] = 52 + rightlist[i];
			if(rightlist[i] > 25) rightlist[i] += 6;
			right_s[i] = rightlist[i] + 'A';
		}
		cout << right_s << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;

int key[1000];
char alpha[100];
int main(){
  int n,j;
  string s;
  for(int i=0;i<52;i++){
    if(i>=26)
      alpha[i] = 'A'+i+6;
    else  alpha[i] = 'A'+i;
  }
  //cout<<(int)'A'<<(int)'a'<<endl;
  while(cin>>n,n){
    string ans;
    j = 0;
    for(int i = 0;i<n;i++)cin>>key[i];
    cin>>s;
    int k = s.length();
    // cout<<s<<endl;
    for(int i = 0;i<k;i++){
      if(s[i]>='a')
	s[i] -= 6;
      if(s[i]-key[j]-'A'>=0)
	ans[i] = alpha[s[i] - key[j]-'A'];
      else{
	ans[i] = alpha[s[i]-key[j]-'A'+'z'-'A'-5];
      }
      if(j >= n-1) j = 0;
      else j++;
    }
    //    cout<<alpha[51];
    for(int i=0;i<k;i++)
      cout<<(char)ans[i];
    cout<<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<string>
#include<map>
using namespace std;

int K[101];
char l[52];
map<char, int> idx;

void solve(int n) {
    for (int i = 0; i < n; i++) {
        cin >> K[i];
        K[i] %= 52;
    }
    string S;
    cin >> S;
    char ans;
    for (int i = 0; i < S.size(); i++) {
        int now_idx = idx[S[i]];
        cout << l[(52 + now_idx - K[i % n]) % 52];
    }
    cout << endl;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    for (int i = 0; i < 26; i++) {
        l[i] = 'a' + i;
        idx[l[i]] = i;
    }
    for (int i = 26; i < 52; i++) {
        l[i] = 'A' + i - 26;
        idx[l[i]] = i;
    }
    int N;
    while (true) {
        cin >> N;
        if (N == 0) break;
        solve(N);
    }
    return 0;
}

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

int main(void){
    int n;
    while(cin >> n, n){
        vector<int> k;
        string s;
        for(int i=0; i < n; i++){
            int tmp; cin >> tmp;
            k.push_back(tmp);
        }
        cin >> s;

        for(int i=0; i < s.length(); i++){
            if      (s[i] - k[i%n] < 'A'){
                int rest = k[i%n] - (s[i] - 'A');
                printf("%c", 'z' - rest+1);
            }else if(s[i] >= 'a' && s[i] - k[i%n] < 'a'){
                int rest = k[i%n] - (s[i] - 'a');
                printf("%c", 'Z' - rest+1);
            }else{
                printf("%c", s[i] - k[i%n]);
            }
        }
        cout << endl;

    }
    return 0;
}

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

using namespace std; 

int main(){
  int n;
  vector<int> K(100);
  string s;
  string c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

  while(1){
    int l=0;
    cin>>n;
    if(n==0)break;
    for(int i=0;i<n;i++) cin>>K[i];
    for(int j=n;j<100;j++){
      int count=0;
      if(count==n)l=count=0;
      K[j]=K[l];
      l++;
      count++;
    }
    cin>>s;
    for(int i=0;i<s.size();i++){
      for(int j=0;j<c.size();j++){
	if(s[i]==c[j]){
	  if(j-K[i]<0){
	    s[i]=c[c.size()+j-K[i]];
	    break;
	  }else{
	    s[i]=c[j-K[i]];
	    break;
	  }
	}
      }
    }
    cout<<s<<endl;
    s.clear();
    K.clear();
  }
  
  return 0;
}