alph = ('a'..'z').to_a + ('A'..'Z').to_a
index = Hash[*alph.zip(0..51).flatten]

loop {
    n = gets.to_i
    break if n == 0

    keys = gets.split.map(&:to_i)
    s = gets.chomp

    keys.cycle.with_index{|k, i|
        break if i >= s.size
        s[i] = alph[(index[s[i]] - k) % 52]
    }
    puts s
}