#include <bits/stdc++.h>
#define ll long long
#define N 1000003
#define ok "FWORD"
#define fi first
#define se second
#define pb push_back
#define pii pair <int,int>
#define mp make_pair
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define name if (fopen(ok".INP","r")){ freopen(ok".INP","r",stdin); freopen(ok".OUT","w",stdout);}
using namespace std;
int n,m,k,x;
string s,a[N],st;
ll t=1;
int main()
{
    fast name
    cin>>n>>m>>k>>x>>s;
    for (int i=1;i<=m;i++)
    {
        cin>>a[i];
        sort(a[i].begin(),a[i].end());
    }
    x--;
    for (int i=m;i>=1;i--)
    {
        int tg=x/t%a[i].length();
        st+=a[i][tg];
        s[s.find('#')]='.';
        t*=a[i].size();
    }
    int h=st.size()-1;
    for (int i=0;i<n;i++)
    {
        if (s[i]=='.')
        {
            cout<<st[h];
            h--;
        }
        else cout<<s[i];
    }
    return 0;
}
