#include <bits/stdc++.h>
#define ll long long
#define fi first
#define sec second
#define N 1000005
using namespace std;
int n,m,k,x;
string st,t[505];
int v[505]={};
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    if(fopen("FWORD.INP","r"))
    {
        freopen("FWORD.INP","r",stdin);
        freopen("FWORD.OUT","w",stdout);
    }
    cin>>n>>m>>k>>x>>st;
    int i;
    for(i=1;i<=m;i++)
    {
        cin>>t[i];
        sort(t[i].begin(),t[i].end());
    }
    x--;
    i--;
    while(x>0)
    {
        v[i]=x%k;
        x/=k;
        i--;
    }
    i=0;
    for(int j=0;j<st.size();j++)
    {
        if(st[j]=='#')
        {
            i++;
            st[j]=t[i][v[i]];
        }
    }
    cout<<st;
    return 0;
}
