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: al = [chr(c) for c in range(ord('A'), ord('Z') + 1)] + [chr(c) for c in range(ord('a'), ord('z') + 1)] 

def f1(c):
    if 'A' <= c <= 'Z':
        return ord(c) - ord('A')
    return ord(c) - ord('a') + ord('Z') - ord('A') + 1
while True:
    if not int(input()):
        break
    k = list(map(int, input().split()))
    s = list(map(f1, input()))
    print(''.join([al[c - k[i % len(k)]]  for i, c in enumerate(s)]))

Python: a = []
for i in range(26):
    a.append(chr(97+i))
for i in range(26):
    a.append(chr(65+i))

while 1:
    n = int(input())
    if n == 0: break
    k = list(map(int, input().split()))
    s = input()
    for i in range(len(s)):
        print(a[(a.index(s[i]) - k[i%n])%52], end='')
    print()

Python: import string 
letters = string.ascii_letters

while True:
    n = int(input())
    if n == 0:
        exit(0)
    k = list(map(int, input().split()))
    s = input()
    
    res = ""
    i = 0
    for x in s:
        res += letters[letters.find(x) - k[i]]
        i = (i + 1) % n

    print(res)

Python: while 1:
    n = int(input())
    k_line = list(map(int, input().split()))
    s = input()
    if (n == 0):
        break;
    alpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
    k_line *= (-(-len(s) // len(k_line)))
    s = [alpha[(alpha.index(c) + 52*10 - k_line[num])%52] for num, c in enumerate(s)]

    print("".join(s))

Python: abc = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"

while True:
    n = int(input())
    if n == 0:
        break

    k = list(map(int, input().split()))
    s = str(input())
    for itr, c in enumerate(s):
        idx = abc[(abc.find(c) - k[itr % n] + 52) % 52]
        print(idx, 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
        elif n-a<65:
            n+=58
        n-=a
        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: def main():
    while True:
        n = int(input())
        if n == 0:
            return
        kk = list(map(int,input().split()))
        S = input()
        ans = ""
        for i,s in enumerate(S):
            if s.islower():
                k = (ord(s)-ord('a')-kk[i%len(kk)])
                if k < -26:
                    ans += chr(ord('a')+k%26)
                elif k < 0:
                    ans += chr(ord('A')+k%26)
                else:
                    ans += chr(ord('a')+k)
            if s.isupper():
                k = (ord(s)-ord('A')-kk[i%len(kk)])
                if k < -26:
                    ans += chr(ord('A')+k%26)
                elif k < 0:
                    ans += chr(ord('a')+k%26)
                else:
                    ans += chr(ord('A')+k)
        print(ans)

if __name__ == '__main__':
    main()

Python: import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    rr = []
    s = string.ascii_letters

    while True:
        n = I()
        if n == 0:
            break
        a = LI()
        l = len(a)
        t = S()
        r = ''
        for i in range(len(t)):
            c = t[i]
            b = a[i%n]
            ci = s.index(c)
            r += s[ci-b]
        rr.append(r)

    return '\n'.join(map(str, rr))


print(main())

Python: "王様の視察"
while True:
    N = int(input())
    if N == 0:
        break
    K = list(map(int, input().split()))
    S = str(input())

    ans = ""
    station = list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
    station_position = {}
    search_station = {}
    # 双方向の辞書を作成する
    for i, s in enumerate(station, start=1):
        station_position.setdefault(i)
        station_position[i] = s  # keyが数字で、バリューが文字
        search_station[s] = i  # keyが文字で、バリューが数字
    i = 0
    for s in S:
        encryption = search_station[s]  # 数字
        encryption -= K[i]
        if encryption <= 0:
            encryption += 52
        ans += station_position[encryption]
        i += 1
        if i == len(K):
            i = 0
    print(ans)

Python: a = ord("a")
A = ord("A")
dic1 = {}
dic2 = {}
for i in range(26):
  dic1[i] = chr(a + i)
  dic2[chr(a + i)] = i
  dic1[i + 26] = chr(A + i)
  dic2[chr(A + i)] = i + 26
while True:
  n = int(input())
  if n == 0:break
  klst = list(map(int, input().split())) * 100
  s = input()
  ans = ""
  for c, k in zip(s, klst):
    ans += dic1[(dic2[c] - k) % 52]
  print(ans)

Python: word_list=[]
for i in range(97,123):
    word_list.append(chr(i))
for i in range(65,91):
    word_list.append(chr(i))
l_w_l=len(word_list)
while 1:
    n=int(input())
    if n==0:break
    li=list(map(int,input().split()))
    s=input()
    ans=""
    for i in range(len(s)):
        w_k=word_list.index(s[i])-li[i%n]
        while w_k<0:w_k+=l_w_l
        ans+=word_list[w_k]
    print(ans)