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

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;
typedef long long ll;

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

        string s;
        cin >> s;

        rep(i,s.size()) {
            int j = i%n;
            for(int k=v[j];k>0;k--) {
                if(s[i] == 'a') s[i] = 'Z';
                else if(s[i] == 'A') s[i] = 'z';
                else s[i]--;
            }
        }

        cout << s << endl;
    }

    return 0;
}

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

using namespace std;

int main() {
	int n;
	
	string abc = "abcdefghijklmnopqrstuvwxyz";
	string abc2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

	string abc3 = abc + abc2 + abc + abc2;

	while (cin >> n) {
		if (n == 0) {
			break;
		}
		vector<int> key(n);
		for (int i = 0; i < n; i++) {
			cin >> key[i];
		}
		string s;
		cin >> s;

		string ans;

		int sz = abc3.size();

		for (int i = 0; i < s.size(); i++) {
			for (int j = sz - 1; j >= 0; j--) {
				if (s[i] == abc3[j]) {
					ans += abc3[j - key[i%n]];
					break;
				}
			}
		}
		cout << ans << endl;
	}

	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(int 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] -= 6;
      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'-5];
      }
      if(j >= n) 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 key[1000];
char alpha[100];
int main(){
  int n,j;
  int i;
  string s;
  for(int 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();
    // cout<<s<<endl;
    for(i = 0;i<k;i++){
      if(s[i]>='a')
	s[i] -= 6;
      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'-5];
      }
      if(j >= n-1) j = 0;
      else j++;
    }
    //    cout<<alpha[51];
    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 n;
  cin >> n;
  while(n!=0){
    int k[101]={},i,j;
    for(i=0;i<n;i++) cin >> k[i];
    string str;
    cin >> str;
    for(i=0;i<str.size();i++){
      str[i]-=k[i%n];
      if(str[i]<'A') str[i]='z'+'A'-str[i]+1;
      else if(str[i]>'Z'&&str[i]<'a') str[i] = 'Z' - 'a' + str[i] +1;
      cout << str[i];
    }
    cout << endl;
    cin>>n;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;


int main(){

	int n;
	int k[100];
	char data[53] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

	string s;

	/*
	cout<<"A"<<(int)'A'<<endl;
	cout<<"Z"<<(int)'Z'<<endl;
	cout<<"a"<<(int)'a'<<endl;
	*/

	while(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++){
			
			int num = s.at(i)-'A';
			if(s.at(i)>='a'){
				num -=6;
			}

			num -=k[i%n];

			if(num<0) num+=52;
			else if(num>52) num-=52;

			cout<<data[num];
		}

		cout<<endl;
	}

	return 0;
}

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

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

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

int main() {
	ios::sync_with_stdio(false);
	while(true) {
		string S; getline(cin, S);
		if(S == ".") break;
		stack<char> stk;
		bool ok = true;
		for(int i = 0; i < (int)S.size(); ++i) {
			if(S[i] == '[') {
				stk.push(S[i]);
			}
			if(S[i] == '(') {
				stk.push(S[i]);
			}
			if(S[i] == ']') {
				if(stk.empty() == false && stk.top() == '[') {
					stk.pop();
				}
				else {
					ok = false;
					break;
				}
			}
			if(S[i] == ')') {
				if(stk.empty() == false && stk.top() == '(') {
					stk.pop();
				}
				else {
					ok = false;
					break;
				}
			}
		}
		if(stk.empty() == false) ok = false;
		cout << (ok ? "yes" : "no") << endl;
	}
}