/**
 * Created by hiroqn on 13/10/06.
 */
var fs = require('fs'),
    length = fs.fstatSync(process.stdin.fd).size,
    buffer = new Buffer(length),
    bytesRead = fs.readSync(process.stdin.fd, buffer, 0, length, 0),
    input = buffer.toString('utf8', 0, bytesRead).split('\n');

var CODE_A = 'A'.charCodeAt(0),
    CODE_Z = 'Z'.charCodeAt(0),
    CODE_a = 'a'.charCodeAt(0),
    CODE_z = 'z'.charCodeAt(0),
    DIFF = CODE_Z - CODE_a;

function solve(n, kList, str) {
  var k = 0, code, result = '';
  for (var i = 0, l = str.length; i < l; i++) {
    code = str.charCodeAt(i);
    if (CODE_A <= code && code <= CODE_Z) {
      code -= CODE_A;// 0->A,25->Z
    } else {
      code = code - CODE_a + 26;
    }
//    console.log(code)
    if (code < kList[k]) {
      code = code + 52 - kList[k];
    } else {
      code -= kList[k];
    }
    if (code < 26) {
      result += String.fromCharCode(code + CODE_A);
    } else {
      result += String.fromCharCode(code - 26 + CODE_a);
    }
//    code -= kList[k];
    k++;
    k %= n;

  }
  return result;
}

while (input[0] !== '0') {
  var nKeys = input.shift() - 0,
      keyList = input.shift().split(' ').map(function (i) {
        return i - 0;
      }),
      str = input.shift();
  console.log(solve(nKeys, keyList, str));
}