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

using namespace std;

char encode(char a,int k){
  a-=k;
  if('Z'<a && a<'a')a-=26+'a'-'A';
  else if(a<'A')a+=26+'a'-'A';
  while(!isupper(a) && !islower(a))a+=26;
  return a;
}

int main(void){

  int n;

  while(cin >> n,n){
    vector<int>k(n);
    for(int i=0;i<n;i++)cin >> k[i];
    string s;
    cin >> s;

    for(int i=0;i<s.size();i++){
      s[i]=encode(s[i],k[i%k.size()]);
    }
    cout << s << endl;
  }


  return 0;
}

C++: #include <bits/stdc++.h>
#include <stdint.h>

typedef uint32_t u32;
typedef uint64_t u64;

int stationid(char c) {
  if( 'A' <= c and c <= 'Z' ) return c - 'A';
  return c - 'a' + 26;
}

int main() {

  std::string table;
  for(char c = 'A'; c <= 'Z'; ++c) table += c;
  for(char c = 'a'; c <= 'z'; ++c) table += c;

  for(;;) {
    int n;
    std::cin >> n;
    if( n == 0 ) break;
    std::vector<int> k(n);
    std::string str;
    for(int& I : k) std::cin >> I;
    std::cin >> str;
    for(int i = 0; i < (int)str.size(); ++i) {
      std::cout << table[(stationid(str[i]) + 52 - k[i % n]) % 52];
    }
    std::cout << std::endl;
  }  
  
  return 0;
}

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

int main(){

int N;
while(1){
cin>>N;if(N==0)break;
int n[102]={};
for(int i=0;i<N;i++)
cin>>n[i];

string st;
char w;
string y="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
y=y+y+y;
cin>>st;
for(int i=0;i<st.size();i++)
{int d=n[i%N];
for(int j=y.size()-1;j>=0;j--)
	if(st[i]==y[j]){w=y[j-d];break;}
	cout<<w;
/*
w=(st[i]-d);
if(w<'a'&&st[i]>='a'){int a='a'-w;w='Z'-a+1;}
if(w<'A'){int a='A'-w;w='z'-a+1;}
//int H=atoi(w);
cout<<w;
*/
}
cout<<endl;
}
return 0;
}

C++: #! /usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys
import itertools
import math
from collections import Counter, defaultdict

class Main(object):
    
    def __init__(self):
        self.chars = ['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']

    def solve(self):
        '''
        insert your code
        '''
        while True:
            n = input()
            if n == 0:
                break
            k = map(int, raw_input().split())
            s = raw_input()
            ans = ''
            for i in range(len(s)):
                ans += self.chars[self.chars.index(s[i]) - k[i % len(k)]]
            print ans
        return None

if __name__ == '__main__':
    m = Main()
    m.solve()

C++: #include<bits/stdc++.h>
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,t;
    cin>>s;
    for(int i=0,j=0;i<s.size();++i,++j){
      if(j==n) j=0;
      if(s[i]-k[j]<'A') t+=(s[i]-k[j]+58);
      else if(s[i]>='a' && s[i]-k[j]<'a') t+=s[i]-k[j]-6;
      else t+=s[i]-k[j];
    }
    cout<<t<<endl;
  }
  return 0;
}

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

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

char conv(int x) {
  if(x < 26) return x + 'a';
  else return x - 26 + 'A';
}

int main() {
  for(int n; cin >> n && n;) {
    vector<int> k(n);
    for(int i = 0; i < n; ++i) cin >> k[i];
    string s; cin >> s;
    for(int i = 0; i < s.size(); ++i) {
      cout << conv((conv(s[i]) - k[i%n] + 52) % 52);
    }
    cout << endl;
  }
  return 0;
}