loop do
  n = gets.chomp.to_i
  break if n == 0

  keys = gets.chomp.split(' ').map(&:to_i)
  key_pos = 0
  station_list = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
  stations_pos = {}
  i = 0
  station_list.each_char do |station|
    stations_pos[station] = i
    i += 1
  end

  enc_stations = gets.chomp
  dec_stations = ''

  enc_stations.each_char do |enc_station|
    pos = stations_pos[enc_station]
    dec_stations << station_list[pos - keys[key_pos]]
    key_pos = key_pos + 1 == keys.size ? 0 : key_pos + 1
  end

  puts dec_stations
end