#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using mint = modint998244353;

random_device rnd;
mt19937 mt(rnd());
int RandInt(int a, int b) {
    return a + mt() % (b - a + 1);
}
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};

//    int TIMELIMIT = 2.8 * CLOCKS_PER_SEC;
//    int ti = clock();
//    while (clock() - ti < TIMELIMIT) {

int main(){
    int n;
    string s;
    cin>>n>>s;
    vector<int>p(n);
    rep(i,n)cin>>p[i];
    rep(i,n)p[i]--;
    rep(i,n)cout<<s[p[i]];
    cout<<endl;
    return 0;
}