#include <bits/stdc++.h>
using namespace std;

#define for_(i,a,b) for(int i=(a);i<(b);++i)

int main() {
	string L = "";
	for_(i,0,26) L += char('a' + i);
	for_(i,0,26) L += char('A' + i);
	
	int n;
	while (cin >> n, n) {
		vector< int > k(n);
		for_(i,0,n) cin >> k[i];
		
		string s;
		cin >> s;
		
		int m = s.size();
		for_(i,0,m) {
			int pos = L.find(s[i]);
			s[i] = L[(pos - k[i%n] + 52) % 52];
		}
		cout << s << endl;
	}
}
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INF INT_MAX // 2147483647
#define INFLL LLONG_MAX // 9223372036854775807
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define per(i, n) for(ll i=((ll)(n))-1; i>=0; i--)
#define perf(i, n) for(ll i=((ll)(n)); i>0; i--)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(15);
template<class T>bool chmax(T &a, const T &b){ if(a<b){ a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if(b<a){ a=b; return 1; } return 0; }
using namespace std;

int main(){
    Init();
    ll n, t, sum = 0; cin >> n >> t;
    ll pt; cin >> pt;
    rep(i, n-1){
        ll np; cin >> np;
        if(np-pt >= t) sum += t;
        else sum += np-pt;
        pt = np;
    }
    sum += t;
    cout << sum << endl;
}