/**
    HOANG HAI DANG
    --------------
    THCS NGUYEN DU
*/
#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define name if(fopen("FWORD.INP","r")) { freopen("FWORD.INP","r",stdin); freopen("FWORD.OUT","w",stdout); }
using namespace std;
int n,m,k,x;
string s,p[501];
int v[501]={};
int32_t main()
{
    #ifndef FWORD
    name;
    #endif // FWORD
    fast;
    int n,m,k,x;
    cin>>n>>m>>k>>x;
    cin>>s;
    int i,j;
    for(i=1;i<=m;i++)
    {
        cin>>p[i];
        sort(p[i].begin(),p[i].end());
    }
    x--; i=m;
    while(x>0)
    {
        v[i]=x%k;
        x/=k;
        i--;
    }
    i=0;
    for(j=0;j<s.size();j++)
        if(s[j]=='#')
        {
            i++;
            s[j]=p[i][v[i]];
        }
        cout<<s;
        return 0;
}
