#include<iostream>
#include<cassert>
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int N;
	string S;
	cin>>N>>S;
	for(;N--;)
	{
		int P;cin>>P;
		cout<<S[P-1];
	}
	cout<<endl;
}