Two bears are playing tic-tac-toe via mail. It's boring for them to play usual tic-tac-toe game, so they are a playing modified version of this game. Here are its rules.

The game is played on the following field. [Image] 

Players are making moves by turns. At first move a player can put his chip in any cell of any small field. For following moves, there are some restrictions: if during last move the opposite player put his chip to cell with coordinates (x_{l}, y_{l}) in some small field, the next move should be done in one of the cells of the small field with coordinates (x_{l}, y_{l}). For example, if in the first move a player puts his chip to lower left cell of central field, then the second player on his next move should put his chip into some cell of lower left field (pay attention to the first test case). If there are no free cells in the required field, the player can put his chip to any empty cell on any field.

You are given current state of the game and coordinates of cell in which the last move was done. You should find all cells in which the current player can put his chip.

A hare works as a postman in the forest, he likes to foul bears. Sometimes he changes the game field a bit, so the current state of the game could be unreachable. However, after his changes the cell where the last move was done is not empty. You don't need to find if the state is unreachable or not, just output possible next moves according to the rules.


-----Input-----

First 11 lines contains descriptions of table with 9 rows and 9 columns which are divided into 9 small fields by spaces and empty lines. Each small field is described by 9 characters without spaces and empty lines. character "x" (ASCII-code 120) means that the cell is occupied with chip of the first player, character "o" (ASCII-code 111) denotes a field occupied with chip of the second player, character "." (ASCII-code 46) describes empty cell.

The line after the table contains two integers x and y (1 ≤ x, y ≤ 9). They describe coordinates of the cell in table where the last move was done. Rows in the table are numbered from up to down and columns are numbered from left to right.

It's guaranteed that cell where the last move was done is filled with "x" or "o". Also, it's guaranteed that there is at least one empty cell. It's not guaranteed that current state of game is reachable.


-----Output-----

Output the field in same format with characters "!" (ASCII-code 33) on positions where the current player can put his chip. All other cells should not be modified.


-----Examples-----
Input
... ... ...
... ... ...
... ... ...

... ... ...
... ... ...
... x.. ...

... ... ...
... ... ...
... ... ...
6 4

Output
... ... ... 
... ... ... 
... ... ... 

... ... ... 
... ... ... 
... x.. ... 

!!! ... ... 
!!! ... ... 
!!! ... ... 


Input
xoo x.. x..
ooo ... ...
ooo ... ...

x.. x.. x..
... ... ...
... ... ...

x.. x.. x..
... ... ...
... ... ...
7 4

Output
xoo x!! x!! 
ooo !!! !!! 
ooo !!! !!! 

x!! x!! x!! 
!!! !!! !!! 
!!! !!! !!! 

x!! x!! x!! 
!!! !!! !!! 
!!! !!! !!! 


Input
o.. ... ...
... ... ...
... ... ...

... xxx ...
... xox ...
... ooo ...

... ... ...
... ... ...
... ... ...
5 5

Output
o!! !!! !!! 
!!! !!! !!! 
!!! !!! !!! 

!!! xxx !!! 
!!! xox !!! 
!!! ooo !!! 

!!! !!! !!! 
!!! !!! !!! 
!!! !!! !!! 




-----Note-----

In the first test case the first player made a move to lower left cell of central field, so the second player can put a chip only to cells of lower left field.

In the second test case the last move was done to upper left cell of lower central field, however all cells in upper left field are occupied, so the second player can put his chip to any empty cell.

In the third test case the last move was done to central cell of central field, so current player can put his chip to any cell of central field, which is already occupied, so he can move anywhere. Pay attention that this state of the game is unreachable.

Difficulty: MEDIUM

Solutions:
a = [[None] * 9 for i in range(9)]
for k in range(3):
	for i in range(3):
		sl = input().split()
		for j in range(3):
			for l in range(3):
				a[k * 3 + i][j * 3 + l] = sl[j][l]
	if k != 2:
		tmp = input()
(x, y) = map(int, input().split())
x -= 1
y -= 1
bx = x % 3
by = y % 3
ok = False
for i in range(bx * 3, bx * 3 + 3):
	for j in range(by * 3, by * 3 + 3):
		if a[i][j] == '.':
			ok = True
			a[i][j] = '!'
if not ok:
	for i in range(9):
		for j in range(9):
			if a[i][j] == '.':
				a[i][j] = '!'
for k in range(3):
	for i in range(3):
		for j in range(3):
			for l in range(3):
				print(a[k * 3 + i][j * 3 + l], end='')
			print(' ', end='')
		print()
	print()


a = [[''] * 9 for i in range(9)]
for i in range(3):
	for j in range(3):
		q = input()
		q = q.replace(' ', '')
		for p in range(9):
			a[i * 3 + j][p] = q[p]
	if i != 2:
		q = input()
(x, y) = [int(i) for i in input().split()]
(x1, y1) = (x, y)
while x1 > 3:
	x1 -= 3
while y1 > 3:
	y1 -= 3
x1 -= 1
y1 -= 1
ch = False
for i in range(3):
	for j in range(3):
		if a[i + x1 * 3][j + y1 * 3] == '.':
			ch = True
		if ch and a[i + x1 * 3][j + y1 * 3] == '.':
			a[i + x1 * 3][j + y1 * 3] = '!'
if not ch:
	for i in range(9):
		for j in range(9):
			if a[i][j] == '.':
				a[i][j] = '!'
for i in range(3):
	for j in range(3):
		for p in range(3):
			for q in range(3):
				print(a[i * 3 + j][p * 3 + q], end='')
			print(' ', end='')
		print()
	print()


a = [0] * 9

def check(x, y):
	nonlocal a
	for i in range(3):
		for j in range(3):
			if a[i + x * 3][j + y * 3] == '.':
				return True
	return False

def yall():
	nonlocal a
	for i in range(9):
		for j in range(9):
			if a[i][j] == '.':
				a[i][j] = '!'

def nall(x, y):
	nonlocal a
	for i in range(3):
		for j in range(3):
			if a[i + x * 3][j + y * 3] == '.':
				a[i + x * 3][j + y * 3] = '!'
for i in range(9):
	b = [j for j in input().split()]
	a[i] = [b[k][j] for k in range(3) for j in range(3)]
	if i % 3 == 2 and i != 8:
		input()
(x, y) = [int(i) for i in input().split()]
x1 = (x - 1) % 3
y1 = (y - 1) % 3
if check(x1, y1):
	nall(x1, y1)
else:
	yall()
for i in range(9):
	for j in range(9):
		print(a[i][j], end='')
		if j % 3 == 2:
			print(' ', end='')
	if i % 3 == 2:
		print()
	print()


field = [[0] for i in range(11)]
for i in range(11):
	field[i] = input().replace(' ', '')
save = field
field = []
for i in range(11):
	if save[i] != '':
		field.append([])
		for j in range(9):
			field[len(field) - 1].append(save[i][j])
(x, y) = map(int, input().split())
(x, y) = (x - 1, y - 1)
x1 = x % 3 * 3 + 1
y1 = y % 3 * 3 + 1
mark = False
for i in range(-1, 2):
	for j in range(-1, 2):
		if field[x1 + i][y1 + j] == '.':
			mark = True
			field[x1 + i][y1 + j] = '!'
if not mark:
	for i in range(9):
		for j in range(9):
			if field[i][j] == '.':
				field[i][j] = '!'
for i in range(9):
	for j in range(9):
		print(field[i][j], end='')
		if (j + 1) % 3 == 0:
			print(end=' ')
	if (i + 1) % 3 == 0:
		print()
	print()


from math import ceil
s = [list(input().replace(' ', '')) for i in range(3)]
input()
s += [list(input().replace(' ', '')) for i in range(3)]
input()
s += [list(input().replace(' ', '')) for i in range(3)]
(y, x) = [int(k) for k in input().split(' ') if k]
(yb, xb) = (ceil(y / 3), ceil(x / 3))
y -= (yb - 1) * 3 + 1
x -= (xb - 1) * 3 + 1
y *= 3
x *= 3
found = 0
for dy in range(3):
	for dx in range(3):
		if s[y + dy][x + dx] == '.':
			found = 1
			s[y + dy][x + dx] = '!'
if not found:
	for y in range(9):
		for x in range(9):
			if s[y][x] == '.':
				s[y][x] = '!'
for y in range(3):
	for x in range(3):
		print(s[y][x], end='')
	print(' ', end='')
	for x in range(3, 6):
		print(s[y][x], end='')
	print(' ', end='')
	for x in range(6, 9):
		print(s[y][x], end='')
	print(' ')
print()
for y in range(3, 6):
	for x in range(3):
		print(s[y][x], end='')
	print(' ', end='')
	for x in range(3, 6):
		print(s[y][x], end='')
	print(' ', end='')
	for x in range(6, 9):
		print(s[y][x], end='')
	print(' ')
print()
for y in range(6, 9):
	for x in range(3):
		print(s[y][x], end='')
	print(' ', end='')
	for x in range(3, 6):
		print(s[y][x], end='')
	print(' ', end='')
	for x in range(6, 9):
		print(s[y][x], end='')
	print(' ')


a = [[[['.'] * 3 for i in range(3)] for i in range(3)] for i in range(3)]
for i in range(3):
	s = input().split()
	for j in range(3):
		for h in range(3):
			ch = s[j][h]
			a[0][j][i][h] = ch
x = input()
for i in range(3):
	s = input().split()
	for j in range(3):
		for h in range(3):
			ch = s[j][h]
			a[1][j][i][h] = ch
x = input()
for i in range(3):
	s = input().split()
	for j in range(3):
		for h in range(3):
			ch = s[j][h]
			a[2][j][i][h] = ch
(x, y) = map(int, input().split())
x = x % 3 - 1
y = y % 3 - 1
fl = True
for i in range(3):
	for j in range(3):
		if a[x][y][i][j] == '.':
			fl = False
			a[x][y][i][j] = '!'
if fl:
	for x in range(3):
		for y in range(3):
			for i in range(3):
				for j in range(3):
					if a[x][y][i][j] == '.':
						a[x][y][i][j] = '!'
for i in range(3):
	for j in range(3):
		print(*a[0][j][i], sep='', end=' ')
	print()
print()
for i in range(3):
	for j in range(3):
		print(*a[1][j][i], sep='', end=' ')
	print()
print()
for i in range(3):
	for j in range(3):
		print(*a[2][j][i], sep='', end=' ')
	print()


a = []
for i in range(11):
	b = []
	s = input().split()
	if not s:
		continue
	for k in s:
		for i in range(3):
			b.append(k[i])
	a.append(b)
(x, y) = map(int, input().split())
x = (x - 1) % 3
y = (y - 1) % 3
fl = False
for i in range(x * 3, x * 3 + 3):
	for j in range(y * 3, y * 3 + 3):
		if a[i][j] == '.':
			a[i][j] = '!'
			fl = True
if not fl:
	for i in range(9):
		for j in range(9):
			if a[i][j] == '.':
				a[i][j] = '!'
for i in range(3):
	for j in range(3):
		for k in range(3):
			for c in range(3):
				print(a[i * 3 + j][k * 3 + c], end='')
			print(' ', end='')
		print()
	print()


field = []
for i in range(3):
	(a1, a2, a3) = ([], [], [])
	for j in range(3):
		s = list(input())
		a1.append(s[:3])
		a2.append(s[4:7])
		a3.append(s[8:11])
	if i != 2:
		s = input()
	row = [a1, a2, a3]
	field.append(row)
(x, y) = map(int, input().split())
x -= 1
y -= 1
(x, y) = (x % 3, y % 3)
isset = False
for i in range(3):
	for j in range(3):
		if field[x][y][i][j] == '.':
			isset = True
			field[x][y][i][j] = '!'
if not isset:
	for x in range(3):
		for y in range(3):
			for i in range(3):
				for j in range(3):
					if field[x][y][i][j] == '.':
						field[x][y][i][j] = '!'
for i in range(3):
	for j in range(3):
		for k in range(3):
			print(*field[i][k][j], sep='', end=' ')
		print()
	print()


def prnt(p):
	for i in p:
		for i3 in range(3):
			for i2 in i:
				for i4 in i2[i3]:
					print(i4, end='')
				print(' ', end='')
			print()
		print()
p = []
for y1 in range(3):
	p.append([[], [], []])
	for y2 in range(3):
		s = input()
		if not s:
			s = input()
		s = s.split()
		for i in range(3):
			p[y1][i].append(list(s[i]))
crds = list(map(int, input().split()))
crds[0] -= 1
crds[1] -= 1
x1 = crds[0] // 3
y1 = crds[1] // 3
y2 = crds[0] % 3
x2 = crds[1] % 3
have_space = False
for i in p[y2][x2]:
	for i2 in i:
		if i2 == '.':
			have_space = True
			break
if have_space:
	for i in range(len(p[y2][x2])):
		for i2 in range(len(p[y2][x2][i])):
			if p[y2][x2][i][i2] == '.':
				p[y2][x2][i][i2] = '!'
else:
	for i1 in range(3):
		for i2 in range(3):
			for i3 in range(3):
				for i4 in range(3):
					if p[i1][i2][i3][i4] == '.':
						p[i1][i2][i3][i4] = '!'
prnt(p)


g = [[], [], [], [], [], [], [], [], []]
for i in range(3):
	s = input().split()
	g[0].append(' '.join((j for j in s[0])).split())
	g[1].append(' '.join((j for j in s[1])).split())
	g[2].append(' '.join((j for j in s[2])).split())
la = input()
for i in range(3):
	s = input().split()
	g[3].append(' '.join((j for j in s[0])).split())
	g[4].append(' '.join((j for j in s[1])).split())
	g[5].append(' '.join((j for j in s[2])).split())
la = input()
for i in range(3):
	s = input().split()
	g[6].append(' '.join((j for j in s[0])).split())
	g[7].append(' '.join((j for j in s[1])).split())
	g[8].append(' '.join((j for j in s[2])).split())
z = input().split()
z[0] = int(z[0])
z[1] = int(z[1])
z[0] %= 3
z[1] %= 3
x = z[0]
y = z[1]
ref = 0
if x == 1 and y == 1:
	ref = 0
if x == 1 and y == 2:
	ref = 1
if x == 1 and y == 0:
	ref = 2
if x == 2 and y == 1:
	ref = 3
if x == 2 and y == 2:
	ref = 4
if x == 2 and y == 0:
	ref = 5
if x == 0 and y == 1:
	ref = 6
if x == 0 and y == 2:
	ref = 7
if x == 0 and y == 0:
	ref = 8

def check(g):
	for i in g:
		for j in i:
			if j == '.':
				return True
	return False
if check(g[ref]):
	for i in range(3):
		for j in range(3):
			if g[ref][i][j] == '.':
				g[ref][i][j] = '!'
else:
	for i in range(9):
		for j in range(3):
			for k in range(3):
				if g[i][j][k] == '.':
					g[i][j][k] = '!'
ans = ''
for i in range(3):
	for j in range(3):
		ans += g[i][0][j]
	ans += ' '
print(ans)
ans = ''
for i in range(3):
	for j in range(3):
		ans += g[i][1][j]
	ans += ' '
print(ans)
ans = ''
for i in range(3):
	for j in range(3):
		ans += g[i][2][j]
	ans += ' '
print(ans)
ans = ''
print()
for i in range(3, 6, 1):
	for j in range(3):
		ans += g[i][0][j]
	ans += ' '
print(ans)
ans = ''
for i in range(3, 6, 1):
	for j in range(3):
		ans += g[i][1][j]
	ans += ' '
print(ans)
ans = ''
for i in range(3, 6, 1):
	for j in range(3):
		ans += g[i][2][j]
	ans += ' '
print(ans)
ans = ''
print()
for i in range(6, 9, 1):
	for j in range(3):
		ans += g[i][0][j]
	ans += ' '
print(ans)
ans = ''
for i in range(6, 9, 1):
	for j in range(3):
		ans += g[i][1][j]
	ans += ' '
print(ans)
ans = ''
for i in range(6, 9, 1):
	for j in range(3):
		ans += g[i][2][j]
	ans += ' '
print(ans)