loop do
    n = gets.to_i
    break if n == 0
    k = gets.split.map(&:to_i)
    s = gets.strip
    puts s.codepoints.map.with_index{|c,i|
        if c.between?(65,90)
            ch = c - k[i%n]
            if ch < 65
                ch += 58
            end
        else
            ch = c - k[i%n]
            if ch < 97
                ch -= 6
            end
        end
        ch = ch.chr
    }.join
end