using System;
namespace BoardGame
{
class Program
{
static void Main(string[] args)
{
// Read input
string[] dimensions = Console.ReadLine().Split();
int H = int.Parse(dimensions[0]);
int W = int.Parse(dimensions[1]);
char[][] board = new char[H][];
for (int i = 0; i < H; i++)
{
board[i] = Console.ReadLine().ToCharArray();
}
string[] coordinates = Console.ReadLine().Split();
int y = int.Parse(coordinates[0]);
int x = int.Parse(coordinates[1]);
// Modify the board
if (board[y][x] == '.')
{
board[y][x] = '#';
}
else if (board[y][x] == '#')
{
board[y][x] = '.';
}
// Output the modified board
for (int i = 0; i < H; i++)
{
Console.WriteLine(new string(board[i]));
}
}
}
}