Station = ('a'..'z').to_a + ('A'..'Z').to_a

while true do
  n = gets.to_i
  break if n == 0
  k = gets.split.map(&:to_i)
  s = gets.chomp
  answer = ""
  for i in 0...s.size do
    index = Station.index(s[i]) - k[i % k.size]
    answer += Station[index]
  end
  puts answer
end