#include<bits/stdc++.h>
#include<iostream>
#define ll long long
using namespace std;
int n, m, k, x, j, i, t[502], vt[502];
string s, st[501], a;
int main()
{
cin >> n >> m >> k >> x;
cin >> s;
for (i = 1; i <= m; i++)
{
cin >> a;
sort(a.begin(), a.end());
for (j = 0; j < a.size(); j++)
if (a[j] != a[j + 1]) st[i] += a[j];
// cout<<st[i]<<" ";
}
t[m + 1] = 1;
for (i = m; i >= 1; i--)
{
t[i] = t[i + 1] * st[i].size();
}
// for (i=1;i<=m+1;i++)cout<<t[i]<<" ";
// cout<<endl;
if (t[1] == x)
{
for (i = 1; i <= m; i++) vt[i] = st[i].size();
}
else
{
i = 1;
while (x > 0)
{
if (x >= t[i + 1])
{
vt[i] = x / t[i + 1];
if (x % t[i + 1] != 0)
{
x = x % t[i + 1];
vt[i]++;
}
else
{
for (j = i + 1; j <= m; j++) vt[j] = st[j].size();
x = 0;
}
}
else vt[i] = 1;
i++;
}
}
int d = 0;
for (i = 0; i < s.size(); ++i) {
if (s[i] == '#') {
++d;
s[i] = st[d][vt[d] - 1];
}
}
cout << s;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2luY2x1ZGU8aW9zdHJlYW0+CiNkZWZpbmUgbGwgbG9uZyBsb25nCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCBuLCBtLCBrLCB4LCBqLCBpLCB0WzUwMl0sIHZ0WzUwMl07CnN0cmluZyBzLCBzdFs1MDFdLCBhOwppbnQgbWFpbigpCnsKCWNpbiA+PiBuID4+IG0gPj4gayA+PiB4OwoJY2luID4+IHM7Cglmb3IgKGkgPSAxOyBpIDw9IG07IGkrKykKCXsKCQljaW4gPj4gYTsKCQlzb3J0KGEuYmVnaW4oKSwgYS5lbmQoKSk7CgkJZm9yIChqID0gMDsgaiA8IGEuc2l6ZSgpOyBqKyspCgkJCWlmIChhW2pdICE9IGFbaiArIDFdKSBzdFtpXSArPSBhW2pdOwoJCS8vIGNvdXQ8PHN0W2ldPDwiICI7Cgl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