#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;
}