#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include using namespace std; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T &a, T b) { return ((a>b) ? (a = b, true) : (false));} #define rep(i,s,n) for(long long i=s;i<(long long)(n);i++) #define rrep(i,s,n) for(long long i=n-1;i>=s;i--) const long long inf = 1LL<<60; typedef long long ll; typedef long double ld; #define cmp [](pair a, pair b){return a.second P; typedef pair > PP; #define rll ll,vector,greater #define rP P,vector

,greater

const long double pi = 3.14159265358979; typedef unsigned long long ull; #define vll vector #define vvll vector> #define vvch vector> #define vch vector #define rPP PP,vector,greater #define vP vector

#define vvP vector> #define all(x) x.begin(), x.end() //bitの差集合 S & ~(1<> n; string s; cin >> s; vll p(n); rep(i,0,n) cin >> p[i], p[i]--; rep(i,0,n) cout << s[p[i]]; cout << endl; }