#P376. 【例65.2】 清除地雷

【例65.2】 清除地雷

Description

On an n×mn × m map, there are some mines represented by 11, while other areas without mines are represented by 00. If a mine is detonated, its blast range will destroy the land in the surrounding eight positions and the land where the mine is located. If there are mines in its eight surrounding positions, these mines will trigger a chain reaction and continue to detonate. The land after the explosion is represented by 22. Please write a program to output the appearance of the map after detonating a specific mine.

Input Format

The input consists of n+2n + 2 lines:
The first line contains two integers: nn (1n1001≤n≤100), mm (1m1001≤m≤100), indicating the size of the map is n×mn×m.
Lines 22 to n+1n+1 each contain mm characters, representing the appearance of the map.
Line n+2n+2 contains two integers: xx (1xn1≤x≤n), yy (1ym1≤y≤m), indicating the coordinates of the specified starting (detonation) point on the map. If the specified coordinates are land, there is no need to detonate any mines.

Output Format

Output nn lines, each containing mm numbers, representing the appearance of the map after the explosion.

Sample

5 5
10100
01000
00000
00000
00001
1 1
22220
22220
22200
00000
00001