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 <cstdlib>
#include <string>
using namespace std;
#define N 100

int main(){
        int i=0, key[N], count=0;
        char keymoji;

        cin >> i;
        while(i != 0){
                for(int j=0; j<i; j++){
                        cin >> keymoji;
                        key[j] = keymoji-'0';
                }
                //for(int j=0; j<i; j++){
                //      key[j] = keymoji[j*2]-'0';
                //}
                string eki;
                cin >> eki;
                for(int j=0; j<eki.size(); j++){
                        if(eki[j] < 'Z'){
                                eki[j] -= key[j%i];
                                if(eki[j] < 'A'){
                                        eki[j] = 'z'+1-('A'-eki[j]);
                                        if(eki[j] < 'a'){
                                                eki[j] = 'Z'+1-('a'-eki[j]);
                                        }
                                }
                        }else{
                                if(eki[j]-key[j%i] < 'a'){
                                        eki[j] -= key[j%i]+('a'-'Z'-1);
                                        if(eki[j] < 'A'){
                                                eki[j] += 'z'-'A'+1;
                                        }
                                }else{
                                        eki[j] -= key[j%i];
                                }
                        }
                }
                cout << eki << endl;
                cin >> i;
        }


}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n,k[100];
  string s;
  while(cin>>n&&n){
    for(int i=0;i<n;i++)cin>>k[i];
    cin>>s;
    for(int i=0;i<s.size();i++)s[i]-=k[i%n];
    cout<<s<<endl;
  }
  return 0;
}

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

vector<int> keys;

int main(){
while(1){//start

	//init
	keys.clear();

	int n;
	cin >> n;
	if(n == 0) break;
	for(int i = 0; i < n; i++){
		int temp;
		cin >> temp;
		keys.push_back(temp);
	}

	//extend keys
	for(int i = 0; i < 101; i++){
		int temp = keys[i];
		keys.push_back(temp);
	}

	string s;
	cin >> s;
	for(int i = 0; i < (int)s.size(); i++){
		char c;
		if(islower(s[i])){
			int now_num = s[i] - 'a';
			if(now_num - keys[i] < 0){
				int temp = keys[i] - now_num;
				c = 'Z' - temp + 1;
				cout << c;
			}
			else{
				c = s[i] - keys[i];
				cout << c;
			}
		}
		else if(isupper(s[i])){
			int now_num = s[i] - 'A';
			if(now_num - keys[i] < 0){
				int temp = keys[i] - now_num;
				c = 'z' - temp + 1;
				cout << c;
			}
			else{
				c = s[i] - keys[i];
				cout << c;
			}
		}
	}
	cout << endl;

}//end

	return 0;
}

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

int enc(char c){
    if(islower(c))  return c-'a';
    else            return 26 + c - 'A';
}

char dec(int i){
    if(i <= 25) return 'a'+i;
    else        return 'A' + i-26;
}

int main(){
    int n;
    while(cin >> n, n){
        int key[n];
        for(int i = 0; i < n; i++)  cin >> key[i];
        string s;
        cin >> s;
        for(int i = 0; i < s.length(); i++){
            cout << dec((enc(s[i])+52-key[i%n])%52);
        }
        cout << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <map>
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 alpha;
        map<char, int> alphaM;
        int id = 0;
        for(char c = 'a'; c <= 'z'; c++) {
            alpha.push_back(c);
            alphaM[c] = id++;
        }
        for(char c = 'A'; c <= 'Z'; c++) {
            alpha.push_back(c);
            alphaM[c] = id++;
        }


        for(int i=0;i<s.size();++i){
            int x=a[i%a.size()];
            int id2 = alphaM[s[i]];
            ans += alpha[(id2-x+52)%52];
        }
        cout<<ans<<endl;
    }
}

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%k.size()]<=26){
        a=s[i]-k[i%k.size()];
        if(a<65&&s[i]>=65&&s[i]<=90){
           a+=58;
         }else if(a<97&&s[i]>=97&&s[i]<=122)a-=6;
      }else{
        a=s[i]+(52-k[i%k.size()]);
        if(a>122&&s[i]>=122&&s[i]>=97){
          a-=58;
        }else if(a>90&&s[i]<=90&&s[i]>=65)a+=6;
      }
      putchar(a);
      //cout<<" "<<a<<" "<<k[i%k.size()]<<" "<<s[i]<<endl;
    }
    cout<<endl;
  }
  return 0;
}

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

using namespace std;

int main(){
	
	while(1){
		int n;
		cin >> n;
		if(n==0) break;
		int pre[n];
		string str;
		for(int i=0;i<n;i++){
			cin >> pre[i];
		}

		cin >> str;
			
		for(int i=0;i<str.size();i++){	
			for(int j=pre[i%n];j>0;j--){
				str[i]--;
				if(str[i]<=('A'-1)) str[i]='z';	
				if(str[i]==96 ) str[i] = 'Z';
			}
		}
		cout << str << endl;
	}
}