fun main(args:Array<String>?): Unit {
    val stations = (('A' .. 'Z') + ('a' .. 'z')).toCharArray()
    while(true){
        val n = readLine()!!.trim().toInt()
        if (n == 0) return
        val key = readLine()!!.trim().split(' ').map(String::toInt).toIntArray()
        val word = readLine()!!.trim().toCharArray()
        for (i in word.indices){
            word[i] = stations[(lowerBound(stations, word[i]) - key[i % key.size] + stations.size) % stations.size]
        }
        println(word.joinToString(""))
    }
}
fun lowerBound(array: CharArray, target: Char): Int {
    var left = 0
    var right = array.size
    while(left < right){
        val mid = (left + right) / 2
        if (array[mid] < target){
            left = mid + 1
        }else{
            right = mid
        }
    }
    return right
}
