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)
}

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

char_list = list(map(chr,range(ord('a'),ord('z')+1)))
char_list += list(map(chr,range(ord('A'),ord('Z')+1)))
while True:
    n = int(input())
    if n == 0:
        break
    keys = list(map(int,input().split(" ")))
    sentence = input()
    for i in range(len(sentence)):
        if sentence[i].isupper():
            j = ord(sentence[i]) - ord('A') + 26
        else:
            j = ord(sentence[i]) - ord('a')
        print(char_list[j-keys[i%len(keys)]],end="")
    print()

Python: def reset(n_lis,chr_lis):
    k = len(n_lis)
    for i in range(len(chr_lis)):
        n = ord(chr_lis[i])
        a = n_lis[i%k]
        """
 #       print(n_lis)
       # if  n>96 and n-a<97:
            n -= 6
        if n-a<65:
            n+=58
        n-=a
        chr_lis[i]=chr(n)
"""
        c_type = True
        n -= 64
        if n > 27:
            n -=32
            c_type = False
        n -= a
        if n<1:
            n+=26
            c_type=not(c_type)
        if n<1:
            n+=26
            c_type=not(c_type)
        
        if c_type:
            n+=64
        else:
            n+=96
        
        chr_lis[i]=chr(n)


    for ch in chr_lis:
        print(ch,end='')
    print()

while True:
    if input()=='0':
        break
    n_lis = [int(i) for i in input().split(' ')]
    c_lis = [i for i in input()]
    reset(n_lis,c_lis)

Python: alpha = list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")

while 1:
    n = int(input())
    if n == 0:
        break
    K = list(map(int, input().split()))
    S = list(input())

    ans = ""
    for i, s in enumerate(S):
        diff = K[i % len(K)]
        if diff <= 0:
            num = 52 + diff
        else:
            num = diff
        ans += alpha[alpha.index(s)-num]

    print(ans)

Python: while 1:
    n=int(input())
    if n==0:break
    a=list(map(int,input().split()))
    s=list(input())
    for i in range(len(s)):
        for j in range(a[i%n]):
            if s[i]=='A':s[i]='a'
            elif s[i]=='a':s[i]='Z'
            else:s[i]=s[i]=chr(ord(s[i])-1)
    print(*s,sep='')

Python: while True :
    n = int(input())
    if n == 0 :
        break
    key = list(map(int, input().split()))
    station = list(input())
    
    i = 0
    j = 0
    while True :
        if i == len(station) :
            break
        if j == len(key) :
            j = 0
        if 97 <= ord(station[i]) <= 122 :
            x = ord(station[i]) - key[j]
            if 71 <= x <= 96 :
                x -= 6
            elif 45 <= x <= 70 :
                x += 52
        elif 65 <= ord(station[i]) <= 90 :
            x = ord(station[i]) - key[j]
            if 39 <= x <= 64 :
                x += 58
            elif 13 <= x <= 38 :
                x += 52
        print(chr(x), end="")
        
        i += 1
        j += 1
    print()

Python: while 1:
    n=int(input())
    if n==0:break
    a=list(map(int,input().split()))
    s=list(input())
    for i in range(len(s)):
        for j in range(a[i%n]):
            if s[i]=='A':s[i]='z'
            elif s[i]=='a':s[i]='Z'
            else:s[i]=s[i]=chr(ord(s[i])-1)
    print(*s,sep='')

Python: d = ''
for i in range(26):
    d += chr(ord('a') + i)
for i in range(26):
    d += chr(ord('A') + i)

def decode(c,key):
    i = d.find(c)
    return d[(i-key) % 52]

while True:
    N = int(input())
    if N == 0: break
    ks = list(map(int,input().split()))
    S = input()
    ans = ''
    for i,c in enumerate(S):
        ans += decode(c, ks[i%N])
    print(ans)

Python: def horizontal_input(T=str):
    return list(map(T,input().split()))

def vertical_input(n,T=str,sep=False,septype=tuple):
    data=[]
    if sep:
        for i in range(n):
            data.append(septype(map(T,input().split())))
    else:
        for i in range(n):
            data.append(T(input()))
    return data

d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
while 1:
    n=int(input())
    if n==0:
        break
    data=horizontal_input(int)
    s=input()
    ans=[]
    i=0
    for c in s:
        ans.append(d[d.find(c)-data[i]])
        i=(i+1)%len(data)
    print(''.join(ans))

Python: from itertools import cycle
f=lambda a,b:[chr(i) for i in range(a,b)]
c=(f(97,123)+f(65,91))[::-1]
c*=2
while int(input()):
    l=cycle(map(int,input().split()))
    s=input()
    print("".join([c[c.index(i)+j] for (i,j) in zip(s,l)]))

Python: alphabet = ["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"]
while True:
    n = int(input())
    if n == 0:
        break
    else:
        k = [int(k) for k in input().split()]
        s = list(input())
        for i in range(1,len(s)+1):
            if (i) % len(k) == 0:
                s[i-1] = alphabet[alphabet.index(s[i-1])-k[len(k)-1]]
            else:
                s[i-1] = alphabet[alphabet.index(s[i-1])-k[i % len(k)-1]]
        print("".join(s))

Python: # from sys import exit

alp = ['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']
alp += [a.upper() for a in alp]
id = [i for i in range(0, 52)]
alp2num = dict(zip(alp, id))
num2alp = dict(enumerate(alp))
while(True):
    N = int(input())
    if N == 0:
        exit()
    k = [int(n) for n in input().split()]
    S = input()
    L = len(S)
    for i in range(L):
        id = alp2num[S[i]]-k[i % N] % 52
        if id < 0:
            id += 52
        print(num2alp[id], end="")
    print()