#include <bits/stdc++.h>
using namespace std;
const int N = 1234;
#define mp make_pair
char g[N][N];
int len, X, Y;
set <string> li;
void solve(int x, int y, string s){
if (g[x][y] == '*' || x < 1 || y < 1 || x > X || y > Y)
return ;
if (s.size() == len){
li.insert(s);
return ;
}
s += g[x][y];
solve(x+1, y, s);
solve(x-1, y, s);
solve(x, y+1, s);
solve(x, y-1, s);
}
int main()
{
string s;
cin >> X >> Y;
for (int i = 1; i<=X; i++){
cin >> s;
for(int j = 1; j<=Y; j++)
g[i][j] = s[j-1];
}
int x, y, l;
cin >> len >> x >> y;
solve(x, y, "");
for (auto e : li)
cout << e << endl;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmNvbnN0IGludCBOID0gMTIzNDsKI2RlZmluZSBtcCBtYWtlX3BhaXIKY2hhciBnW05dW05dOwppbnQgbGVuLCBYLCBZOwpzZXQgPHN0cmluZz4gbGk7CnZvaWQgc29sdmUoaW50IHgsIGludCB5LCBzdHJpbmcgcyl7CglpZiAoZ1t4XVt5XSA9PSAnKicgfHwgeCA8IDEgfHwgeSA8IDEgfHwgeCA+IFggfHwgeSA+IFkpCgkJcmV0dXJuIDsKCWlmIChzLnNpemUoKSA9PSBsZW4pewoJCWxpLmluc2VydChzKTsKCQlyZXR1cm4gOwoJfQoJcyArPSBnW3hdW3ldOwoJc29sdmUoeCsxLCB5LCBzKTsKCXNvbHZlKHgtMSwgeSwgcyk7Cglzb2x2ZSh4LCB5KzEsIHMpOwoJc29sdmUoeCwgeS0xLCBzKTsKfQppbnQgbWFpbigpCnsKCXN0cmluZyBzOwoJY2luID4+IFggPj4gWTsKCWZvciAoaW50IGkgPSAxOyBpPD1YOyBpKyspewoJCWNpbiA+PiBzOwoJCWZvcihpbnQgaiA9IDE7IGo8PVk7IGorKykKCQkJZ1tpXVtqXSA9IHNbai0xXTsKCX0KCWludCB4LCB5LCBsOwoJY2luID4+IGxlbiA+PiB4ID4+IHk7Cglzb2x2ZSh4LCB5LCAiIik7Cglmb3IgKGF1dG8gZSA6IGxpKQoJCWNvdXQgPDwgZSA8PCBlbmRsOwoJcmV0dXJuIDA7Cn0=