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 <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << #x << " = " << x << endl;


#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 100010

bool solve(){
  int n;
  int k[SIZE];
  char c[SIZE];
  
  scanf("%d",&n);
  
  if(n == 0) return false;

  for(int i=0;i<n;i++){
    scanf("%d",k+i);
  }

  scanf("%s",c);
  
  for(int i=0;c[i]!='\0';i++){

    for(int j=0;j<k[i%n];j++){
      if(c[i] == 'a')
        c[i] = 'Z';
      else if(c[i] == 'A')
        c[i] = 'z';
      else
        c[i]--;
    }
    
  }

  printf("%s\n",c);
  
  return true;

}

int main(){

  while(solve());
  
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
string check(int n){
    if (n==97) {
        return "a";
    } else if (n==98) {
        return "b";
    } else if (n==99) {
        return "c";
    } else if (n==100) {
        return "d";
    } else if (n==101) {
        return "e";
    } else if (n==102) {
        return "f";
    } else if (n==103) {
        return "g";
    } else if (n==104) {
        return "h";
    } else if (n==105) {
        return "i";
    } else if (n==106) {
        return "j";
    } else if (n==107) {
        return "k";
    } else if (n==108) {
        return "l";
    } else if (n==109) {
        return "m";
    } else if (n==110) {
        return "n";
    } else if (n==111) {
        return "o";
    } else if (n==112) {
        return "p";
    } else if (n==113) {
        return "q";
    } else if (n==114) {
        return "r";
    } else if (n==115) {
        return "s";
    } else if (n==116) {
        return "t";
    } else if (n==117) {
        return "u";
    } else if (n==118) {
        return "v";
    } else if (n==119) {
        return "w";
    } else if (n==120) {
        return "x";
    } else if (n==121) {
        return "y";
    } else if (n==122) {
        return "z";
    } else if (n==65) {
        return "A";
    } else if (n==66) {
        return "B";
    } else if (n==67) {
        return "C";
    } else if (n==68) {
        return "D";
    } else if (n==69) {
        return "E";
    } else if (n==70) {
        return "F";
    } else if (n==71) {
        return "G";
    } else if (n==72) {
        return "H";
    } else if (n==73) {
        return "I";
    } else if (n==74) {
        return "J";
    } else if (n==75) {
        return "K";
    } else if (n==76) {
        return "L";
    } else if (n==77) {
        return "M";
    } else if (n==78) {
        return "N";
    } else if (n==79) {
        return "O";
    } else if (n==80) {
        return "P";
    } else if (n==81) {
        return "Q";
    } else if (n==82) {
        return "R";
    } else if (n==83) {
        return "S";
    } else if (n==84) {
        return "T";
    } else if (n==85) {
        return "U";
    } else if (n==86) {
        return "V";
    } else if (n==87) {
        return "W";
    } else if (n==88) {
        return "X";
    } else if (n==89) {
        return "Y";
    } else {
        return "Z";
    }
}

int main(void){
    int n,k;
    string s;
    while (cin>>n) {
        if (n==0) {
            break;
        } else {
            std::deque<int> key;
            for (int i=0;i<n;i++) {
                cin>>k;
                key.emplace_back(k);
            }
            cin>>s;
            int itr=0;
            for (int j=0;j<s.size();j++) {
                if (itr>key.size()-1) {
                    itr=0;
                }
                int hoge=s.at(j);
                for (int l=0;l<key[itr];l++) {
                    hoge--;
                    if (hoge==96) {
                        hoge=90;
                    } else if (hoge==64) {
                        hoge=122;
                    }
                }
                cout<<check(hoge);
                itr++;
            }
            cout<<endl;
        }
    }
}

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

using namespace std;

int main() {
	string list = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	map<char, int> m;
	for (int i = 0; i < list.size(); ++i) m[list[i]] = i;

	int n;
	while ( cin >> n, n ) {
		int key[100];
		for (int i = 0; i < n; ++i) cin >> key[i];
		string str; cin >> str;
		string ans = "";
		for (int i = 0; i < str.size(); ++i) {
			ans += list[(m[str[i]] - key[i % n] + list.size()) % list.size()];
		}
		cout << ans << endl;
	}
}

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

using namespace std;

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