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 <vector>
#include <string>
using namespace std;

int main  ()
{
    int n;
    while (cin >> n, n) {
        vector<int> v(n);
        for (auto &i : v) cin >> i;
        string str;
        cin >> str;
        for (int i = 0; i < str.size(); i++) {
            if ('A' <= str[i] && str[i] <= 'Z') {
                int t = str[i] - 'A' - v[i % v.size()];
                if (t >= 0) {
                    cout << (char)('A' + t);
                } else {
                    cout << (char)('z' + t + 1);
                }
            } else {
                int t = str[i] - 'a' - v[i % v.size()];
                if (t >= 0) {
                    cout << (char)('a' + t);
                } else {
                    cout << (char)('Z' + t + 1);
                }
            }
        }
        cout << endl;
    }

    return 0;
}

C++: #include<cstdio>
#include<algorithm>

using namespace std;

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

    while(true) {
        int n,k[60];
        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 <bits/stdc++.h>

using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n;
  while(cin>>n,n){
      char a[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'};
      int k[n+1];
      for(int i=0;i<n;i++)cin>>k[i];
      string s;cin>>s;
      int len=s.length();
      for(int i=0;i<len;i++){
          int idx;
          if(s[i]>='a')  idx=(s[i]-'a');
          else idx=s[i]-'A'+26;
          idx=((idx+52-k[i%n])%52);
          cout<<a[idx];
      }
      cout<<endl;
  }
}

C++: #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f

#include <iostream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
  
using namespace std;
  
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P> PP;
  
static const double EPS = 1e-8;
  
static const int tx[] = {0,1,0,-1};
static const int ty[] = {-1,0,1,0};

static const string stations = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

int main(){

  int n;
  while(~scanf("%d",&n)){
    if(n==0) break;

    int back_dist[101];
    for(int i=0;i<n;i++){
      scanf("%d",back_dist+i);
    }
    string str;
    cin >> str;

    int back_idx = 0;
    for(int i=0;i<str.size();i++){
      int pos = lower_bound(stations.begin(),stations.end(),str[i]) - stations.begin();
      str[i] = stations[(pos - back_dist[back_idx] + stations.size()) % stations.size()];
      back_idx++;
      back_idx %= n;
    }

    cout << str << endl;
  }
}

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

using namespace std;

int main() {
	string abc = "ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba";
	abc += abc;
	int n;
	string a;
	int number[105] = {0};
	while (cin >> n) {
		if (n == 0) {
			break;
		}
		for (int i = 0; i < n; i++) {
			cin >> number[i];
		}
		cin >> a;
		int counter = 0;
		for (int i = 0; i < a.size(); i++) {
			for (int j = 0; j < 52; j++) {
				if (a[i] == abc[j]) {
					cout << abc[j+number[counter]];
				}
			}
			counter++;
			if (counter >= n) {
				counter = 0;
			}
		}
		cout << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	string map="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	int n,k[100];
	while(true){
	cin>>n;
	if(n==0)
		break;
	for(int i=0;i<n;i++)
		cin>>k[i];
	string s;
	cin>>s;
	for(int i=0;i<s.size();i++){
		int x;
		for(int j=0;j<map.size();j++){
			if(map[j]==s[i])
				x=j;
		}
		x-=k[i%n];
		if(x<0)
			x+=map.size();
		cout<<map[x];
	}
	cout<<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]<=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<<k[i%k.size()]<<" "<<a<<endl;
    }
    cout<<endl;
  }
  return 0;
}

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


int main(){
	int n,a;
	int k[101];
	string s;
	char c;
	while(1){
		cin >> n;
		if(n == 0)break;
		for(int i = 0;i < n;i++){
			cin >> k[i];
		}
		cin >> s;
		for(int i = 0;i < s.size();i++){
		c =  s[i] - k[i%n];
		a = c;
		if(a < 65){
			a += 58;
			c = a;
		}
		else if(a > 90 && 97 > a){
			a -= 6;
			c = a;
		}
		cout << c;
		}
		cout << endl;
	}
	//for(int i = 65;i <= 123;i++){
	//	c = i;
	//	cout << c << " " << i <<endl;
	//}
	return 0;
}