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<cstdio>
#include<algorithm>

using namespace std;

int main(void) {
    char list[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

    while(true) {
        int n,k[200];
        char s[150];

        scanf("%d", &n);
        if(!n) break;

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

        scanf("%s",s);

        for(int i=0; s[i]; i++) {
            printf("%c", list[((lower_bound(list, list+52, s[i])-s)-k[i%n])%52]);
        }
        printf("\n");
    }
    return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<bitset>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<queue>
#include<vector>
using namespace std;

#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL

int main() {
	string S = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	int k[100];
	for (int n; cin >> n&&n;) {
		for (int i = 0; i < n; i++) {
			cin >> k[i];
		}
		string s; cin >> s;
		for (int i = 0; i < s.size(); i++) {
			if (s[i] > 'a') {
				int d = s[i] - 'a' + 26;
				cout << S[(d - k[i%n] + 52) % 52];
			}
			else {
				int d = s[i] - 'A';
				cout << S[(d - k[i%n] + 52) % 52];
			}
		}
		cout << endl;
	}
	return 0;
}

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

int main() {
	const string tmp = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	const int mod = 52;
	for(int n; cin >> n, n;) {
		vector<int> k(n);
		for(int i = 0; i < n; ++i)
			cin >> k[i];

		string s;
		cin >> s;

		for(int i = 0; i < (int)s.size(); ++i) {
			int pos = tmp.find(s[i]);
			pos = (pos - k[i % n] + mod) % mod;
			s[i] = tmp[pos];
		}

		cout << s << endl;
	}

	return EXIT_SUCCESS;
}

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

int main() {
	int n;
	while(cin >> n && n){
		int k[101] = {0};
		for(int i = 0; i < n; ++i){
			cin >> k[i];
		}
		char s[128];
		scanf("%s", s);
		for(int i = 0; i < strlen(s); ++i){
			if(k[i % n]){
				if(s[i] - k[i % n] < 64){
					s[i] = s[i] - k[i % n] + 58;
				}
				else if(90 < s[i] - k[i % n] && s[i] - k[i % n] < 97){
					s[i] = s[i] - k[i % n] - 6;
				}
				else{
					s[i] -= k[i % n];
				}
			}
		}
		printf("%s\n", s);
	}
	/*printf("%d\n", 'A');
	printf("%d\n", 'Z');
	printf("%d\n", 'a');
	printf("%d\n", 'z');*/
	return 0;
}

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

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

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
  int i,j,n,k[100],l,len,h;
  string s,out;
  char data[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'};
  while(1){
    out="";
    cin >> n;
    if(n==0) break;
    for(i=0;i<n;i++){
      cin >> k[i];
    }
    cin >> s;
    len=s.size();
    for(i=0,l=0;i<len;i++,l++){
      if(l==n) l=0;
      for(j=0;j<52;j++){
    if(s[i]==data[j]){
      if(j-k[l]<0){
        h=k[l]-j;
        out+=data[52-h];
      }
      else out+=data[j-k[l]];
    }
      }
    }
    cout << out << endl;
  }
  return 0;
}

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

int main(){
  while(1){
    int n;
    cin>>n;
    int a;
    if(n==0)break;
    vector<int> k(n);
    string s;
    for(int i=0;i<n;i++)cin>>k[i];
    cin>>s;
    for(int i=0;i<s.size();i++){
      if(k[i%n]<=26){
        a=s[i]-k[i%n];
        if(a<'A'&&s[i]>='A'&&s[i]<='Z'){
           a+='z'-'A'+1;
         }else if(a<'a'&&s[i]>='a'&&s[i]<='z')a-='a'-'Z'-1;
      }else{
        a=s[i]+(52-k[i%n]);
        if(a>'z'&&s[i]>='z'&&s[i]>='a'){
          a-='z'-'A'+1;
        }else if(a>'Z'&&s[i]<='Z'&&s[i]>='A')a+='a'-'Z'-1;
      }
      //putchar(a);
      char A=a;
      cout<<A;
    }
    cout<<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<strstream>
#include<stack>
#include<utility>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cmath>
#include<climits>
#include<map>
#include<string>
#include<sstream>

using namespace std;

#define mp make_pair
#define rep(i,n) for( int i = 0; i < n; i++ )
typedef long long int ll;

int main()
{
	int n;
	while( cin >> n, n )
	{
		vector<int> v(n);
		rep(i,n)
		{
			cin >> v[i];
		}
		string s;
		cin >> s;

		int v_i = 0;
		for( int i = 0; i < s.size(); i++)
		{
			if( v_i > n-1 ){
				v_i = 0;
			}
			rep(j,v[v_i])
			{
				s[i]--;
				if( s[i] == 64 ){
					s[i] = 'z';
				}
				if( s[i] == 96 ){
					s[i] = 'Z';
				}
			}
			v_i++;
		}
		cout << s << endl;
	}
	return 0;
}