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<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define BIG 1000000010
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
typedef long long int ll;


int main(){
  int n;
  int k[100];
  string s;
  string ans;
  while(1){
    cin>>n;
    if(n==0) break;
    rep(i,n){
      cin>>k[i];
    }
    cin>>s;
    ans="0";
    rep(i,s.size() ){
      int a=s[i]-k[i%n];
      if(a<65 && a>38) a+=58;
      else if(a<97 && a>90) a-=6;
      else if(a<37) a+=52;
      ans+=a;
    }
    repi(i,1,ans.size()){
      cout<<ans[i];
    }
    cout<<endl;
  }

  return 0;
}

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

int n;
int k[101];
int main(void){
	while(1){
		scanf("%d",&n);
		if(n==0)break;
		for(int i=0;i<n;i++){
			scanf("%d",&k[i]);
		}
		string str;
		cin >> str;
		for(int i=0;i<str.size();i++){
			int d=k[i%n];
			for(int j=0;j<d;j++){
				if(str[i]=='A')str[i]='z';
				else if(str[i]=='a')str[i]='Z';
				else str[i]--;
			}
		}
		cout << str << 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>
using namespace std;

int main(){
    
    string str = "abcdefghijklmnopqrstuvwxyzABCDEFFGHIJKLMNOPQRSTUVWXYZ";
    str = str + str + str;
    cout << str[53] << str[105] << endl;
    while(1){
        int n; cin >> n;
        if(!n) break;
        vector<int> key(n);
        for(int i = 0; i < n; i++){
            cin >> key[i];
        }

        string s; cin >> s;
        int j = 0;
        int idx;
        for(int i = 0; i < s.size(); i++){
            for(int k = 53; k <= 105; k++){
                if(s[i] == str[k]) idx = k;
            }
            //cout << idx << " " << key[j];
            idx -= key[j];
            s[i] = str[idx];
            j++;
            if(j == n) j = 0;
        }

        cout << s << endl;
    }

    return 0;
}

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

char foo(char ch){
  if(ch >= 'a' && ch <= 'z')return ch -'a';
  else return ch - 'A'+26;
}

int main(){
  int n, k[200], si, i;
  char temp[200];
  string str;

  for(i =  0; i < 26; i++){temp[i+52] = temp[i] = 'a'+ i;}
  for(; i < 52; i++){ temp[i+52]=  temp[i] = 'A'+ i-26;}
  while(cin>>n && n){
    int now = 0;
    for(int i = 0; i < n; i++)cin>>k[i];
    cin>>str;
    si = str.size();
    for(int i = 0; i < si; i++){
      cout<<temp[foo(str[i])+52-k[now++]];
      if(now == n)now = 0;
    }
    cout<<endl;
  }
  return 0;
}