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 <string>
#include <vector>
#include <cstdlib>

using namespace std;

int main() {
  while( 1 ) {
    int n;
    cin >> n;
    if( !n ) { return EXIT_SUCCESS; }

    vector<int> key;
    key.reserve( n );
    for( int i = 0; i < n; i++ ) {
      cin >> key[ i ];
    }

    string s, d;
    const string sts = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    int slen = sts.size();
    int invd[ 128 ];
    for( int i = 'a'; i <= 'z'; i++ ) {
      invd[ i ] = i - 'a';
    }
    for( int i = 'A'; i <= 'Z'; i++ ) {
      invd[ i ] = i - 'A' + slen / 2;
    }
    cin >> s;
    d = s;
    int len = s.size();

    for( int i = 0; i < len; i++ ) {
      int idx = ( i + n ) % n;
      d[ i ] = sts[ ( invd[ s[ i ] ] - key[ idx ] + slen ) % slen ];
    }
    cout << d << endl;
  }
}

C++: #include <bits/stdc++.h>
using namespace std;
#define lp(i,n) for(int i=0;i<n;i++)

int main(){
	while(1){
		int n;
		cin>>n;
		if(n==0) break;
		int a[100];
		lp(i,n){
			cin>>a[i];
		}
		int count=0;
		char x;
		scanf("%c",&x);
		while(1){
			scanf("%c",&x);
			if('a'<=x&&'Z'<=x){
				lp(i,a[count]){
					x--;
					if(x==64) x=122;
					if(x==96) x==90;
				}
				cout<<x;
				count++;
				if(count==n) count=0;
			}
			else break;
		}
		cout<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
  int n,k[101]={},s,i,j;
  cin >> n;
  while(n!=0){
    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]+=58;
      else if(str[i]>'Z'&&str[i]<'a') str[i] -= 6;
    }
    cout << str << endl;
    cin>>n;
  }
  return 0;
}

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

using namespace std;
vector<string> ans;

int main(){
	while(1){
		int n;
		cin >> n;
		if(n == 0) break;
		int k[100];
		for(int i = 0;i < n;i++) cin >> k[i];
		
		string s;
		cin >> s;
		
		string tans = s;
		for(int i = 0;i < s.size();i++){
			tans[i] = s[i] - k[i%n];
			if(tans[i] - 'A' < 0){
				tans[i] = 'z' + tans[i] - 'A' + 1;
			}else if(tans[i] - 'A' > 25 && tans[i] - 'a' < 0){
				tans[i] = 'Z' + tans[i] - 'a' + 1;
			}
		}
		ans.push_back(tans);
	}
	for(int i = 0;i < ans.size();i++)cout << ans[i] << endl;
	return 0;
}

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

int Decoding(char c,int key){
  
  int num;
  
  if(c >= 'A' && c <= 'Z'){
    num=c-65;
  }else{
    num=c-71;
  }
  
  num=(num+51*key)%52;
  
  return num;
  
}
int main(){

  char list[52];
  string str;
  int n;
  int key[100];
  
  for(int i=0 ; i+65 <= 90 ; i++)list[i]=i+65;
  for(int j=0 ; j+97 <= 122 ; j++)list[j+26]=j+97;
  
  while(1){
    
    cin >>n;
    if(n == 0)break;
    
    for(int i=0 ; i < n ; i++)cin >>key[i];
    
    cin >>str;
    
    for(int i=0 ; i < (int)str.size() ; i++){
      cout <<list[Decoding(str[i],key[i%n])];
    }
    
    cout <<endl;
    
  }
  
  return 0;
}

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

using namespace std;

int main(){
    while(true){
        int n;
        cin >> n;
        if(n==0)break;
        vector<int> key(n);
        for(int i=0;i<n;i++)cin >> key[i];
        string code;
        cin >> code;
        int c=0;
        string ans;
        for(int i=0;i<code.length();i++){
            char temp;
            temp=code[i]-key[c];
            if(temp<'A')temp='{'-('A'-temp);
            else if(temp<'a' && temp>'Z'){
                temp=temp-6;
            }
            ans.push_back(temp);
            c++;
            if(c==n)c=0;
        }
        cout << ans << endl;
    }
    return 0;
}

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

C++: #include <bits/stdc++.h>
using namespace std;
#define lp(i,n) for(int i=0;i<n;i++)

int main(){
	while(1){
		int n;
		cin>>n;
		if(n==0) break;
		int a[100];
		lp(i,n){
			cin>>a[i];
		}
		int count=0;
		char x;
		scanf("%c",&x);
		while(1){
			scanf("%c",&x);
			if('A'<=x&&'z'>=x){
				lp(i,a[count]){
					x--;
					if(x==64) x=122;
					if(x==96) x=90;
				}
				cout<<x;
				count++;
				if(count==n) count=0;
			}
			else break;
		}
		cout<<endl;
	}
	return 0;
}

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

using namespace std;

int main()
{
    int n;
    char conv[256];
    int conv2[256];
    
    for (int i = 0; i < 26; i++){
        conv[i] = 'a' + i;
        conv[i + 26] = 'A' + i;
        conv2['a' + i] = i;
        conv2['A' + i] = i + 26;
    }
    
    while (scanf("%d", &n) && n){
        int a[128];
        char s[128];
        
        for (int i = 0; i < n; i++) scanf("%d", &a[i]);
        
        scanf("%s", s);
        
        for (int i = 0; s[i]; i++){
            printf("%c", conv[(conv2[s[i]] - a[i % n] + 52) % 52]);
        }
        printf("\n");
    }
    
    return (0);
}