ZS the Coder and Chris the Baboon are travelling to Udayland! To get there, they have to get on the special IOI bus. The IOI bus has n rows of seats. There are 4 seats in each row, and the seats are separated into pairs by a walkway. When ZS and Chris came, some places in the bus was already occupied.

ZS and Chris are good friends. They insist to get a pair of neighbouring empty seats. Two seats are considered neighbouring if they are in the same row and in the same pair. Given the configuration of the bus, can you help ZS and Chris determine where they should sit?


-----Input-----

The first line of the input contains a single integer n (1 ≤ n ≤ 1000) — the number of rows of seats in the bus.

Then, n lines follow. Each line contains exactly 5 characters, the first two of them denote the first pair of seats in the row, the third character denotes the walkway (it always equals '|') and the last two of them denote the second pair of seats in the row. 

Each character, except the walkway, equals to 'O' or to 'X'. 'O' denotes an empty seat, 'X' denotes an occupied seat. See the sample cases for more details. 


-----Output-----

If it is possible for Chris and ZS to sit at neighbouring empty seats, print "YES" (without quotes) in the first line. In the next n lines print the bus configuration, where the characters in the pair of seats for Chris and ZS is changed with characters '+'. Thus the configuration should differ from the input one by exactly two charaters (they should be equal to 'O' in the input and to '+' in the output).

If there is no pair of seats for Chris and ZS, print "NO" (without quotes) in a single line.

If there are multiple solutions, you may print any of them.


-----Examples-----
Input
6
OO|OX
XO|XX
OX|OO
XX|OX
OO|OO
OO|XX

Output
YES
++|OX
XO|XX
OX|OO
XX|OX
OO|OO
OO|XX

Input
4
XO|OX
XO|XX
OX|OX
XX|OX

Output
NO

Input
5
XX|XX
XX|XX
XO|OX
XO|OO
OX|XO

Output
YES
XX|XX
XX|XX
XO|OX
XO|++
OX|XO



-----Note-----

Note that the following is an incorrect configuration for the first sample case because the seats must be in the same pair.

O+|+X

XO|XX

OX|OO

XX|OX

OO|OO

OO|XX

Source: codeforces | Difficulty: EASY
Tags: Implementation

Complete search


Solutions:
n = int(input())
state = 0
List = []
for i in range(n):
	new = input()
	if 'OO' in new and state == 0:
		state = 1
		loc = i
		new = new.replace('OO', '++', 1)
	List.append(new)
if state == 1:
	print('YES')
	for ele in List:
		print(ele)
else:
	print('NO')


rows = int(input())
possible = False
result = ''
for index in range(rows):
	row = input()
	(first, second) = row.split('|')
	if not possible:
		if first == 'OO':
			row = '++|' + second
			possible = True
		elif second == 'OO':
			row = first + '|++'
			possible = True
	result += row + '\n'
if possible:
	print('YES')
	print(result)
else:
	print('NO')


N = int(input())
F = False
G = []
for _ in range(N):
	B = input()
	if not F and 'OO' in B:
		B = B.replace('OO', '++', 1)
		F = True
	G.append(B)
if F:
	print('YES')
	print('\n'.join(G))
else:
	print('NO')


n = eval(input())
A = [input() for i in range(n)]
flag = False
for i in range(n):
	if 'OO' in A[i]:
		print('YES')
		for j in range(n):
			if j != i:
				print(A[j])
			elif A[i][0:2] == 'OO':
				print('++' + A[i][2:])
			else:
				print(A[i][:3] + '++')
		break
else:
	print('NO')


n = int(input())
arr = []
for i in range(n):
	arr.append(input())
for i in range(len(arr)):
	if arr[i][:2] == 'OO':
		arr[i] = '++' + arr[i][2:]
		break
	if arr[i][3:] == 'OO':
		arr[i] = arr[i][:3] + '++'
		break
for i in arr:
	if i[:2] == '++' or i[3:] == '++':
		print('YES')
		for j in arr:
			print(j)
		exit()
print('NO')


n = int(input())
result = []
is_found = False
for i in range(n):
	inp = input().split('|')
	tmp = []
	for e in inp:
		if e == 'OO' and (not is_found):
			tmp.append('++')
			is_found = True
		else:
			tmp.append(e)
	result.append('|'.join(tmp))
print('YES\n' + '\n'.join(result) if is_found else 'NO')


N = int(input())
ans = []
temp = 0
for i in range(N):
	s = input().split('|')
	if s[0] == 'OO' and temp == 0:
		s[0] = '++'
		temp = 1
	elif s[1] == 'OO' and temp == 0:
		s[1] = '++'
		temp = 1
	ans.append(str(s[0]) + '|' + str(s[1]))
if temp == 0:
	print('NO')
else:
	print('YES')
	for i in ans:
		print(i)


n = int(input())
b = []
while n > 0:
	a = input().split('|')
	b.extend(a)
	n = n - 1
x = 0
y = ''
while x < len(b):
	if b[x] == 'OO':
		b[x] = '++'
		y = 'YES'
		break
	x = x + 1
z = ''
x = 0
xx = 1
while x < len(b) - 1:
	if x == len(b) - 2:
		xx = 0
	z = z + b[x] + '|' + b[x + 1] + xx * '\n'
	x = x + 2
if y == 'YES':
	print('YES')
	print(z)
else:
	print('NO')


n = int(input())
a = 'NO'
b = []
for i in range(n):
	d = input()
	if a == 'NO':
		if 'OO' in d:
			if d[0] == 'O' and d[1] == 'O':
				b.append('++' + d[2:])
				a = 'YES'
			else:
				b.append(d[:3] + '++')
				a = 'YES'
		else:
			b.append(d)
	else:
		b.append(d)
print(a)
if a == 'YES':
	for c in b:
		print(c)


import sys
input()
s = sys.stdin.read()
x = s.find('OO')
print('NO' if x < 0 else 'YES\n' + s[:x] + '++' + s[x + 2:])


from sys import stdin, maxsize
from collections import defaultdict
from math import ceil
(lines, line_index) = (stdin.readlines(), -1)
table = defaultdict(int)

def get_line():
	global lines, line_index
	line_index += 1
	return lines[line_index]

def main():
	n = int(get_line())
	ans = ''
	found = False
	for _ in range(n):
		s = get_line()
		if not found and 'OO' in s:
			s = s.replace('OO', '++', 1)
			found = True
		ans += s
	print('%s\n%s' % ('YES', ans) if found else 'NO')
main()


q = int(input())
places = ''
for _ in range(q):
	places += input() + '\n'
if 'OO' in places:
	print('Yes')
	print(places.replace('OO', '++', 1))
else:
	print('No')


n = int(input())
a = []
for i in range(n):
	a.append(input())
for i in range(n):
	if a[i][0] == 'O' and a[i][1] == 'O':
		a[i] = '++|' + a[i][3:]
		print('YES')
		for j in a:
			print(j)
		exit(0)
	if a[i][3] == 'O' and a[i][4] == 'O':
		a[i] = a[i][:2] + '|++'
		print('YES')
		for j in a:
			print(j)
		exit(0)
print('NO')


n = int(input())
arr = []
for i in range(n):
	arr.append(list(input().split('|')))
output = 'NO'
for i in range(n):
	if arr[i][0] == 'OO':
		arr[i][0] = '++'
		output = 'YES'
		break
	elif arr[i][1] == 'OO':
		arr[i][1] = '++'
		output = 'YES'
		break
print(output)
if output == 'YES':
	for i in range(n):
		print('|'.join(arr[i]))


n = int(input())
f = 0
li = []
for i in range(n):
	s = input()
	if s[0] == 'O' and s[1] == 'O' and (f == 0):
		s = list(s)
		s[0] = s[1] = '+'
		s = ''.join(s)
		f = 1
	elif s[3] == 'O' and s[4] == 'O' and (f == 0):
		s = list(s)
		s[4] = s[3] = '+'
		s = ''.join(s)
		f = 1
	li += [s]
if f == 1:
	print('YES')
	for i in li:
		print(i)
else:
	print('NO')


n = int(input())
l = []
b = False
for i in range(n):
	l.append(list(map(str, input().split('|'))))
for i in range(n):
	for j in range(2):
		if l[i][j] == 'OO':
			b = True
			l[i][j] = '++'
			break
	if b:
		break
if b:
	print('YES')
	for i in range(len(l)):
		print(l[i][0] + '|' + l[i][1])
else:
	print('NO')


l = []
cnt = int(0)
n = int(input())
for i in range(n):
	s = input()
	x = s
	if 'OO' in s[:2] and cnt == 0:
		x = '++' + s[2:]
		cnt = 1
	elif 'OO' in s[3:] and cnt == 0:
		x = s[:3] + '++'
		cnt = 1
	l += [x]
if cnt == 1:
	print('YES')
	for i in l:
		print(i)
else:
	print('NO')


l = []
flag = 0
seats_found = 0
n = int(input())
for i in range(n):
	s = input()
	s = [i for i in s]
	l.append(s)
	if s[0] == 'O' and s[1] == 'O' or (s[3] == 'O' and s[4] == 'O'):
		flag = 1
		if seats_found == 0:
			if s[0] == 'O' and s[1] == 'O':
				l[i][0] = '+'
				l[i][1] = '+'
			else:
				l[i][3] = '+'
				l[i][4] = '+'
			seats_found = 1
if flag == 0:
	print('No')
else:
	print('Yes')
	for i in range(n):
		for j in range(5):
			print(l[i][j], end='')
		print()


n = int(input())
l = []
t = 1
for i in range(n):
	s = input()
	if t == 1 and 'OO' in s:
		t = 0
		s = s.replace('OO', '++', 1)
		l.append(s)
	else:
		l.append(s)
if t == 0:
	print('YES')
	print(*l, sep='\n')
else:
	print('NO')


n = int(input())
output = ''
find = False
for i in range(n):
	text = input()
	if find:
		output += text + '\n'
		continue
	if text[0] == text[1] == 'O':
		find = True
		output += '++|' + text[3:] + '\n'
	elif text[3] == text[4] == 'O':
		find = True
		output += text[:2] + '|++' + '\n'
	else:
		output += text + '\n'
if find:
	print('YES')
	print(output)
else:
	print('NO')


n = int(input())
s = []
t = 0
for i in range(n):
	s.append(input())
for j in range(n):
	if 'OO' in s[j]:
		t += 1
		s[j] = s[j].replace('OO', '++', 1)
		break
if t == 0:
	print('NO')
else:
	print('YES')
	for k in range(n):
		print(s[k])


n = int(input())
a = [input() for _ in range(n)]
ans = 'NO'
for i in range(n):
	if 'OO|' in a[i]:
		ans = 'YES'
		a[i] = a[i].replace('OO|', '++|')
		break
	elif '|OO' in a[i]:
		ans = 'YES'
		a[i] = a[i].replace('|OO', '|++')
		break
print(ans)
if ans == 'YES':
	for i in a:
		print(i)


l = []
f = 0
a = int(input())
for i in [0] * a:
	x = input()
	if f == 0:
		(c, v) = x.split('|')
		if c == 'OO':
			c = '++'
			f = 1
			x = c + '|' + v
		elif v == 'OO':
			v = '++'
			f = 1
			x = c + '|' + v
		else:
			pass
	l.append(x)
if f == 1:
	print('YES')
	for c in range(a):
		print(l[c])
else:
	print('NO')


t = int(input())
arr = []
flag = False
for _ in range(t):
	temp = input()
	new_str = ''
	if temp[0:2] == 'OO' and (not flag):
		new_str = '++' + '|' + temp[3:]
	elif temp[3:] == 'OO' and (not flag):
		new_str = temp[0:2] + '|' + '++'
	if len(new_str) > 0:
		flag = True
		arr.append(new_str)
	else:
		arr.append(temp)
if flag:
	print('YES')
	print('\n'.join((i for i in arr)))
else:
	print('NO')


n = int(input())
go = 1
out = ''
while n:
	n = n - 1
	tmp = input()
	if tmp.find('OO') != -1 and go:
		tmp = tmp.replace('OO', '++', 1)
		go = 0
	out = out + tmp + '\n'
if go == 1:
	print('NO')
else:
	print('YES')
	print(out)


t = int(input())
lst = []
for t in range(t):
	lst.append(input())
q = 0
j = 0
for i in lst:
	if i[0] == 'O' and i[1] == 'O':
		print('YES')
		p1 = '++' + i[2:]
		q = 1
		break
	elif i[3] == 'O' and i[4] == 'O':
		print('YES')
		q = 1
		p1 = i[:3] + '++'
		break
	j += 1
if q == 0:
	print('NO')
else:
	for i in range(len(lst)):
		if i == j:
			print(p1)
		else:
			print(lst[i])


n = int(input())
lst = []
for i in range(n):
	lst.append(list(input()))
for i in range(n):
	if lst[i][0:2] == ['O', 'O']:
		lst[i][0:2] = ['+', '+']
		break
	elif lst[i][3:5] == ['O', 'O']:
		lst[i][3:5] = ['+', '+']
		break
else:
	print('NO')
	exit(0)
print('YES')
for i in range(n):
	print(''.join(lst[i]))


n = int(input())
output = ''
flag = 0
for i in range(n):
	inp = input().split('|')
	(inp1, inp2) = inp
	if not flag:
		if inp1 == 'OO':
			inp1 = '++'
			flag = 1
		elif inp2 == 'OO':
			inp2 = '++'
			flag = 1
	output += inp1 + '|' + inp2 + '\n'
if flag:
	print('YES')
	print(output)
else:
	print('No')


n = int(input())
seat = []
for nn in range(n):
	seat.append(input())
ok = False
for i in range(n):
	(a, b) = seat[i].split('|')
	if ok is False:
		if a == 'OO':
			a = '++'
			ok = True
		elif b == 'OO':
			b = '++'
			ok = True
	seat[i] = a + '|' + b
if ok is False:
	print('NO')
	return
else:
	print('YES')
	print('\n'.join(seat))


(n, b, L) = (int(input()), False, [])
for i in range(n):
	L.append(input().split('|'))
	if 'OO' in L[i] and (not b):
		L[i][L[i].index('OO')] = '++'
		b = True
print('YES' if b else 'NO')
if b:
	for i in range(n):
		print('|'.join(L[i]))


n = int(input())
buf = []
res = False
for _ in range(n):
	s = input()
	if not res:
		if s.startswith('OO'):
			s = '++' + s[2:]
			res = True
		elif s.endswith('OO'):
			s = s[:3] + '++'
			res = True
	buf.append(s)
print('YES\n' + '\n'.join(buf) if res else 'NO')


n = int(input())
b = []
c = 0
for i in range(n):
	a = input()
	if c == 1:
		b.append(a)
	elif c == 0:
		if 'OO' in a:
			b.append(a.replace('OO', '++', 1))
			c += 1
		else:
			b.append(a)
if c == 1:
	print('YES', *b, sep='\n')
else:
	print('NO')


n = int(input())
ans = []
found = False
for i in range(n):
	line = input().split('|')
	for j in range(len(line)):
		if line[j] == 'OO' and (not found):
			line[j] = '++'
			found = True
	ans.append(line)
if found:
	print('YES')
	for l in ans:
		print('|'.join(l))
else:
	print('NO')


n = int(input())
s = ''
for i in range(n):
	s += '\n' + input()
x = s.find('OO')
if x > 0:
	print('YES' + s[:x] + '++' + s[x + 2:])
else:
	print('NO')


import sys
input()
seats = sys.stdin.read()
index = seats.find('OO')
if index >= 0:
	print('YES\n' + seats[:index] + '++' + seats[index + 2:])
else:
	print('NO')


import re
n = int(input())
seats = []
found = False
for i in range(n):
	line = input()
	if not found and re.search('OO', line) != None:
		found = True
		line = re.sub('OO', '++', line, 1)
	seats.append(line)
if found:
	print('YES')
	for row in seats:
		print(row)
else:
	print('NO')


from sys import stdin, stdout, maxsize
from fractions import Fraction
import bisect, collections, heapq, itertools, operator
N = int(stdin.readline())
seats = []
possible = False
for n in range(N):
	seats.append(stdin.readline().strip('\n'))
	if not possible and 'OO' in seats[n]:
		possible = True
		seats[n] = seats[n].replace('OO', '++', 1)
if possible:
	print('YES')
	for row in seats:
		print(row)
else:
	print('NO')


n = int(input())
List_1 = []
c = 0
for row in range(n):
	List = [str(j) for j in input()]
	if List[1] == 'O' and List[0] == 'O' and (c == 0):
		List[0] = '+'
		List[1] = '+'
		c = 1
	elif List[4] == 'O' and List[3] == 'O' and (c == 0):
		List[3] = '+'
		List[4] = '+'
		c = 1
	for i in range(5):
		List_1.append(List[i])
if c == 1:
	print('YES')
	i = 0
	while i < 5 * n:
		print(List_1[i], end='')
		print(List_1[i + 1], end='')
		print(List_1[i + 2], end='')
		print(List_1[i + 3], end='')
		print(List_1[i + 4])
		i += 5
else:
	print('NO')


n = int(input())
i = 0
num = list()
while i < n:
	num.append(input())
	i += 1
arr = []
for i in num:
	count = 0
	for j in range(0, len(i)):
		if i[j] == '|':
			arr.append(i[count:j])
			count = j + 1
		elif j == len(i) - 1:
			arr.append(i[count:len(i)])
check = False
for i in range(0, len(arr)):
	if arr[i] == 'OO':
		check = True
		arr[i] = '++'
		break
if check is True:
	print('YES')
	for i in range(0, len(arr) - 1, 2):
		print(arr[i] + '|' + arr[i + 1])
else:
	print('NO')


n = int(input())
t = True
m = []
for i in range(n):
	l = input().split('|')
	if t:
		if 'OO' in l:
			k = l.index('OO')
			l[k] = '++'
			m.append('|'.join(l))
			t = False
		else:
			m.append('|'.join(l))
	else:
		m.append('|'.join(l))
if not t:
	print('YES')
	for i in range(n):
		print(m[i])
else:
	print('NO')


import time
n = int(input())
bus = []
flag = True
for i in range(n):
	x = list(input())
	if flag:
		if x[0] == 'O' and x[1] == 'O':
			x[0] = '+'
			x[1] = '+'
			flag = False
		elif x[3] == 'O' and x[4] == 'O':
			x[3] = '+'
			x[4] = '+'
			flag = False
	bus.append(x)
start = time.time()
if flag:
	print('NO')
else:
	print('YES')
	for i in range(n):
		for j in bus[i]:
			print(j, end='')
		print()
finish = time.time()


n = int(input())
s = []
fl = False
for i in range(n):
	s.append(input().split('|'))
	if not fl:
		if s[-1][0] == 'OO':
			fl = True
			s[-1][0] = '++'
		elif s[-1][1] == 'OO':
			fl = True
			s[-1][1] = '++'
if fl:
	print('YES')
	for i in s:
		print('|'.join(i))
else:
	print('NO')


n = int(input())
r = []
flag = 0
for _ in range(n):
	r.append(input())
for i in range(n):
	if r[i][:2] == 'OO':
		r[i] = '++' + r[i][2:]
		flag = 1
		break
	elif r[i][3:] == 'OO':
		r[i] = r[i][:3] + '++'
		flag = 1
		break
if flag == 1:
	print('YES')
	for i in range(n):
		print(r[i])
else:
	print('NO')


n = int(input())
found = False
output = list()
for i in range(n):
	s = list(input().split('|'))
	for j in range(len(s)):
		if 'OO' in s[j] and found is False:
			s[j] = s[j].replace('OO', '++')
			print('YES')
			found = True
	output.append('|'.join(s))
if found is False:
	print('NO')
else:
	print('\n'.join((str(s) for s in output)))


n = int(input())
(m, r) = ([], 1)
for _ in '0' * n:
	m.append(input().replace('OO', '++', r))
	r = min(r, 1 - m[-1].count('++'))
print(['YES', 'NO'][r])
if r:
	exit()
print(*m, sep='\n')


t = int(input())
a = list()
for _ in range(t):
	a.append(input())
flag = False
for i in range(t):
	if 'OO' in a[i]:
		a[i] = a[i].replace('OO', '++', 1)
		flag = True
		break
if flag:
	print('YES')
	for i in a:
		print(i)
else:
	print('NO')


n = int(input())
re = []
for i in range(n):
	re.append(list(input()))
f = False
for i in range(n):
	if re[i][0] == 'O' and re[i][1] == 'O':
		re[i][0] = re[i][1] = '+'
		f = True
		break
	if re[i][3] == 'O' and re[i][4] == 'O':
		re[i][3] = re[i][4] = '+'
		f = True
		break
if f:
	re = [''.join(x) for x in re]
	print('YES')
	for x in re:
		print(x)
else:
	print('NO')


n = int(input())
ar = [input().split('|') for i in range(n)]
flag = True
for i in range(n):
	if ar[i][0] == 'OO' and flag:
		flag = False
		ar[i][0] = '++'
	elif ar[i][1] == 'OO' and flag:
		flag = False
		ar[i][1] = '++'
if not flag:
	print('YES')
	for i in ar:
		print('|'.join(i))
else:
	print('NO')


n = int(input())
arr = []
for a in range(n):
	arr.append(input().split('|'))
answer = False
for j in range(len(arr)):
	if arr[j][0] == 'OO':
		arr[j][0] = '++'
		answer = True
		break
	elif arr[j][1] == 'OO':
		arr[j][1] = '++'
		answer = True
		break
if answer:
	print('YES')
	fin = ''
	for j in arr:
		fin += j[0] + '|' + j[1] + '\n'
	print(fin)
else:
	print('NO')


n = int(input())
rows = []
b = False
for i in range(n):
	row = input().split('|')
	if not b and 'OO' in row:
		row[row.index('OO')] = '++'
		b = True
	rows.append(row)
print('YES' if b else 'NO')
if b:
	for r in rows:
		print('|'.join(r))


n = int(input())
l = []
flag = 0
for i in range(n):
	s = input()
	if flag == 0:
		if 'OO' in s:
			s = s.replace('OO', '++', 1)
			flag = 1
	l.append(s)
if flag == 0:
	print('NO')
else:
	print('YES')
	for i in l:
		print(i)


n = int(input())
f = True
bus = []
for i in range(n):
	row = input()
	if 'OO' in row.split('|') and f:
		(a, b) = row.split('|')
		f = False
		if a == 'OO':
			a = '++'
		else:
			b = '++'
		row = a + '|' + b
	bus.append(row)
if f is False:
	print('YES')
	for row in bus:
		print(row)
else:
	print('NO')


import sys
input()
result = []
found = False
for line in sys.stdin:
	a = line.rstrip().split('|')
	if 'OO' in a and (not found):
		a[a.index('OO')] = '++'
		found = True
	result.append('|'.join(a))
if found:
	print('YES')
	for i in result:
		print(i)
else:
	print('NO', end='')


n = int(input())
seats = [input().split('|') for _ in range(n)]
ans = False
for s in seats:
	if not ans:
		if s[0] == 'OO':
			s[0] = '++'
			ans = True
		elif s[1] == 'OO':
			s[1] = '++'
			ans = True
if ans:
	print('YES')
	for s in seats:
		print(s[0] + '|' + s[1])
else:
	print('NO')


n = int(input())
found = False
data = ''
for i in range(n):
	row = input().split('|')
	if not found:
		if row[0] == 'OO':
			row[0] = '++'
			found = True
		elif row[1] == 'OO':
			row[1] = '++'
			found = True
	data += '|'.join(row) + '\n'
if found:
	print('YES')
	print(data)
else:
	print('NO')


n = int(input())
arrangement = ''
while n > 0:
	arrangement += input()
	if n > 1:
		arrangement += '\n'
	n -= 1
if 'OO' in arrangement:
	arrangement = arrangement.replace('OO', '++', 1)
	print('YES')
	print(arrangement)
else:
	print('NO')


n = int(input(''))
seats = []
seats1 = []
for i in range(n):
	a = input('')
	seats.append(a)
count = 0
count1 = 0
for i in range(len(seats)):
	if 'OO' in seats[i] and count == 0:
		b = seats[i].replace('OO', '++', 1)
		seats1.append(b)
		count = 1
		count1 = 1
	else:
		seats1.append(seats[i])
if count1 == 0:
	print('NO')
else:
	print('YES')
	for i in range(len(seats1)):
		print(seats1[i])


__author__ = 'Alexander'
import sys
inp = int(sys.stdin.readline().strip())
found = False
outp = []
for i in range(inp):
	line = sys.stdin.readline().strip()
	if not found and line[:2] == 'OO':
		line = '++' + line[2:]
		found = True
	if not found and line[3:] == 'OO':
		line = line[:3] + '++'
		found = True
	outp.append(line)
if not found:
	sys.stdout.write('NO')
else:
	sys.stdout.write('YES' + '\n')
	for i in range(inp):
		sys.stdout.write(outp[i] + '\n')


n = int(input())
a = []
flag = 0
for i in range(n):
	a.append(input().split('|'))
for j in range(n):
	if a[j][0] == 'OO':
		flag = 1
		a[j][0] = '++'
		break
	elif a[j][1] == 'OO':
		flag = 1
		a[j][1] = '++'
		break
if flag == 1:
	print('Yes')
	for x in range(n):
		print(*a[x], sep='|')
else:
	print('No')


import math
n = int(input())
a = [''] * n
for i in range(n):
	a[i] = str(input())
found = False
for i in range(n):
	if a[i][0] == 'O' and a[i][1] == 'O':
		found = True
		a[i] = '++{}'.format(a[i][2:])
		break
	elif a[i][3] == 'O' and a[i][4] == 'O':
		found = True
		a[i] = '{}++'.format(a[i][:3])
		break
if found:
	print('YES')
	for i in a:
		print(i)
else:
	print('NO')


def solve(mat, n):
	Flag = False
	for i in range(n):
		for j in range(2):
			if mat[i][j] == 'OO':
				Flag = True
				mat[i][j] = '++'
				return True
	return False
mat = []
n = int(input())
for i in range(n):
	(x, y) = map(str, input().split('|'))
	row = [x, y]
	mat.append(row)
if solve(mat, n):
	print('YES')
	for i in range(n):
		for j in range(2):
			if j == 0:
				print(mat[i][j], end='|')
			else:
				print(mat[i][j], end=' ')
		print()
else:
	print('NO')


n = int(input())
p = []
z = False
for y in range(n):
	k = input()
	p.append(k)
	s = list(k)
	s.pop(2)
	for x in range(0, 4, 2):
		if z == True:
			break
		if s[x] == 'O' and s[x + 1] == 'O':
			s[x] = '+'
			s[x + 1] = '+'
			s.insert(2, '|')
			s = ''.join(map(str, s))
			p[y] = s
			z = True
if z == True:
	print('YES')
	for x in p:
		print(x)
else:
	print('NO')


bus = []
n = int(input())
for i in range(n):
	row = input()
	bus += row.split(sep='|', maxsplit=2)
for i in range(2 * n):
	if bus[i] == 'OO':
		bus[i] = '++'
		break
if '++' in bus:
	print('YES')
	for i in range(0, 2 * n, 2):
		print(bus[i], bus[i + 1], sep='|')
else:
	print('NO')


n = int(input(''))
l = []
for p in range(0, n):
	(a, b) = input('').split('|')
	l.append(a)
	l.append(b)
if 'OO' in l:
	k = l.index('OO')
	l[k] = '++'
	print('YES')
	for j in range(0, 2 * n, 2):
		print(l[j] + '|' + l[j + 1])
else:
	print('NO')


r = []
c = False
for _ in range(int(input())):
	s = input()
	if not c and 'OO' in s:
		s = s[:s.find('OO')] + '++' + s[s.find('OO') + 2:]
		c = True
	r += [s]
if c:
	print('YES')
	for i in r:
		print(i)
else:
	print('NO')


n = int(input())
s = []
x = 'NO'
a = n - 1
for i in range(n):
	s.append(input())
	if 'OO' in s[i]:
		s[i] = s[i].replace('OO', '++', 1)
		a = i
		x = 'YES'
		break
for i in range(a + 1, n):
	s.append(input())
print(x)
if x == 'YES':
	for i in range(n):
		print(s[i])


n = int(input())
data = [[0] * 5 for i in range(n)]
e = 0
while e in range(n):
	s = input()
	s = list(s)
	data[e] = s
	e = e + 1
cnt = 0
cc = 0
b = 0
while b in range(n) and cc == 0:
	c = 0
	while c in range(5):
		if data[b][c] == 'O':
			if 0 < c + 1 <= 4:
				if data[b][c + 1] == 'O':
					data[b][c] = '+'
					data[b][c + 1] = '+'
					print('YES')
					cnt = 1
					cc = 1
					break
		c = c + 1
	b = b + 1
if cnt == 1:
	for x in data:
		x = ''.join(x)
		print(x)
else:
	print('NO')


def main():
	a = input()
	basic = []
	for _ in range(int(a)):
		basic.append(list(input()))
	flag = 0
	for i in basic:
		if i[0] == 'O' and i[1] == 'O':
			i[0] = '+'
			i[1] = '+'
			flag = 1
			break
		if i[3] == 'O' and i[4] == 'O':
			i[4] = '+'
			i[3] = '+'
			flag = 1
			break
	if flag == 1:
		print('YES')
		for i in basic:
			print(''.join((x for x in i)))
	else:
		print('NO')
main()


c = 1
A = []
for _ in range(int(input())):
	s = input()
	if s[0] == 'O' and s[1] == 'O' and c:
		A.append('++' + s[2:])
		c = 0
	elif s[3] == 'O' and s[4] == 'O' and c:
		A.append(s[:3] + '++')
		c = 0
	else:
		A.append(s)
if c:
	print('NO')
else:
	print('YES')
	print(*A, sep='\n')


n = int(input())
(bus, found) = ('', False)
for i in range(n):
	row = input()
	if not found and row[0] == 'O' and (row[1] == 'O'):
		found = True
		row = '++|' + row[3:5]
	elif not found and row[3] == 'O' and (row[4] == 'O'):
		found = True
		row = row[0:2] + '|++'
	bus += row + '\n'
if found:
	print('YES')
	print(bus[:-1])
else:
	print('NO')


n = int(input())
a = []
for i in range(n):
	a.append(input())
found = False
row = -1
while not found and row < n - 1:
	row += 1
	(es, sn) = (0, -1)
	while es < 2 and sn < 4:
		sn += 1
		if a[row][sn] == 'O':
			es += 1
			if es == 2:
				if sn == 1:
					hulp = '++' + a[row][2:]
				else:
					hulp = a[row][:3] + '++'
				a[row] = hulp
				found = True
		else:
			es = 0
if found:
	print('YES')
	for i in range(n):
		print(a[i])
else:
	print('NO')


s = []
n = int(input())
for i in range(n):
	s.append(input())
s = ' '.join(s)
if 'OO' in s:
	s = s.replace('OO', '++', 1)
	print('YES')
	print(*s.split(), sep='\n')
else:
	print('NO')


import re

def main():
	n = int(input())
	res = False
	rows = []
	for i in range(0, n):
		row_original = input()
		row_modified = re.sub('OO', '++', row_original, 1)
		if not res and row_modified != row_original:
			res = True
			rows.append(row_modified)
		else:
			rows.append(row_original)
	if res:
		print('YES')
		print('\n'.join(rows))
	else:
		print('NO')
main()


n = int(input())
f = 1
li = []
for i in range(n):
	x = str(input())
	if 'OO' in x and f == 1:
		x = x.replace('OO', '++', 1)
		f = 0
	li.append(x)
if f == 1:
	print('NO')
else:
	print('YES')
	for i in li:
		print(i)


k = int(input())
f = []
z = 0
for i in range(k):
	k = input()
	if k.find('OO') > -1 and z == 0:
		print('YES')
		r = k.replace('OO', '++', 1)
		f.append(r)
		z += 1
	else:
		f.append(k)
if z == 0:
	print('NO')
else:
	print(*f, sep='\n')


n = int(input())
lt = []
k = 0
c = 0
for i in range(n):
	a = list(input())
	lt.extend(a)
for i in range(n):
	if lt[k] == 'O' and lt[k + 1] == 'O':
		lt[k] = '+'
		lt[k + 1] = '+'
		c = 1
		break
	elif lt[k + 3] == 'O' and lt[k + 4] == 'O':
		lt[k + 3] = '+'
		lt[k + 4] = '+'
		c = 1
		break
	k = k + 5
if c == 0:
	print('NO')
else:
	print('YES')
	k = 0
	for i in lt:
		k += 1
		print(i, end='')
		if k == 5:
			k = 0
			print('')


sits = list()
for i in range(int(input())):
	sits.append(input())
sits = '\n'.join(sits)
if 'OO' not in sits:
	print('NO')
	raise SystemExit
print('YES')
sits = sits.replace('OO', '++', 1)
print(sits)


n = eval(input())
i = 0
L = []
new = 'NO'
while i < n:
	l = input()
	L = L + [l]
	i += 1
i = 0
while i < n and new == 'NO':
	s = str(L[i])
	if s[0] == s[1] and s[0] == 'O':
		new = 'YES'
		L[i] = '++' + s[2] + s[3] + s[4]
	elif s[3] == s[4] and s[3] == 'O':
		new = 'YES'
		L[i] = s[0] + s[1] + s[2] + '++'
	i += 1
if new == 'YES':
	print(new)
	i = 0
	while i < n:
		print(L[i])
		i += 1
else:
	print(new)


import sys
input()
seats = sys.stdin.read()
print('NO' if seats.find('OO') < 0 else 'YES\n' + seats.replace('OO', '++', 1))


n = int(input())
st = [input() for i in range(n)]
ans = False
for i in range(n):
	if st[i][0] + st[i][1] == 'OO':
		ans = True
		st[i] = '++' + st[i][2:]
		break
	if st[i][3] + st[i][4] == 'OO':
		ans = True
		st[i] = st[i][:3] + '++'
		break
if ans:
	print('YES')
	for s in st:
		print(s)
else:
	print('NO')


n = int(input())
n1 = []
c = 0
for i in range(n):
	s = str(input())
	if s[:2] == 'OO' and c == 0:
		n1.append('++' + s[2:5])
		c = 1
	elif s[-2:] == 'OO' and c == 0:
		n1.append(s[:3] + '++')
		c = 1
	else:
		n1.append(s)
if c == 1:
	print('YES')
	for i in range(n):
		print(n1[i])
else:
	print('NO')


n = int(input())
s = []
flag = True
for i in range(n):
	s.append(input())
for i in range(n):
	if s[i].find('OO') != -1:
		s[i] = s[i].replace('OO', '++', 1)
		flag = False
		break
if flag:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(s[i])


x = int(input())
ins = []
lp = 0
for i in range(x):
	x = input()
	x = list(x)
	ins.append(x)
for k in ins:
	if k[:2] == ['O', 'O']:
		k.pop(0)
		k.pop(0)
		k.insert(0, '+')
		k.insert(0, '+')
		lp += 1
		break
	elif k[3:] == ['O', 'O']:
		k.pop(3)
		k.pop(3)
		k.insert(4, '+')
		k.insert(4, '+')
		lp += 1
		break
	else:
		pass
if lp > 0:
	print('YES')
	for j in ins:
		print(''.join(j))
else:
	print('NO')


(n,) = map(int, input().split())
a = [input() for _ in range(n)]
res = False
for i in range(n):
	if a[i][:2] == 'OO':
		res = True
		a[i] = '++' + a[i][2:]
		break
	elif a[i][3:] == 'OO':
		res = True
		a[i] = a[i][:3] + '++'
		break
if res:
	print('YES')
	for s in a:
		print(s)
else:
	print('NO')


n = int(input())
rows = ''
for _ in range(n):
	rows += input() + '\n'
newr = rows.replace('OO', '++', 1)
if newr != rows:
	print('YES')
	print(newr)
else:
	print('NO')


h = 1
p = 'YES\n'
n = int(input())
while n:
	l = input().split('|')
	if l[0] == 'OO' and h:
		p += '++' + '|' + l[1] + '\n'
		h = 0
	elif l[1] == 'OO' and h:
		p += l[0] + '|' + '++' + '\n'
		h = 0
	else:
		p += l[0] + '|' + l[1] + '\n'
	n -= 1
print('NO') if h else print(p)


test = int(input())
line = []
for _ in range(test):
	line.append(input().split('|'))
flag = 0
for i in line:
	if i[0] == 'OO':
		i[0] = '++'
		flag = 1
		break
	elif i[1] == 'OO':
		i[1] = '++'
		flag = 1
		break
if flag == 0:
	print('NO')
else:
	print('YES')
	for i in line:
		print(i[0] + '|' + i[1])


n = int(input())
bus = []
answer = ''
for i in range(n):
	row = [char for char in input()]
	bus.append(row)
for row in bus:
	if answer == 'YES':
		break
	for j in range(len(row)):
		if j == len(row) - 1:
			continue
		elif row[j] == 'O' and row[j + 1] == 'O':
			row[j] = '+'
			row[j + 1] = '+'
			answer = 'YES'
			break
if answer == '':
	answer = 'NO'
print(answer)
if answer == 'YES':
	for k in range(len(bus)):
		print(''.join(bus[k]))


t = int(input())
s = 0
w = []
z = []
for i in range(t):
	a = input()
	if 'OO|OO' in a and s == 0:
		w.append('++|OO')
		s = 1
	elif 'OO' in a and s == 0:
		d = a.replace('OO', '++')
		w.append(d)
		s += 1
	else:
		w.append(a)
if s == 0:
	print('NO')
else:
	print('YES')
	for i in w:
		print(i)


t = int(input())
flag = 0
a = []
for i in range(t):
	s = input()
	p1 = s[0:2]
	p2 = s[3:]
	if flag != 1:
		if p1 == 'OO':
			p1 = '++'
			flag = 1
		elif p2 == 'OO':
			p2 = '++'
			flag = 1
	p = p1 + '|' + p2
	a.append(p)
if flag == 0:
	print('NO')
else:
	print('YES')
	for i in range(len(a)):
		print(a[i])


seats = []
count = 0
for _ in range(int(input())):
	seats.append(input())
for row in seats:
	if row[0] + row[1] == 'OO' or row[-1] + row[-2] == 'OO':
		count = 1
		x = seats.index(row)
		s = row.replace('OO', '++', 1)
		seats[x] = s
		break
if count == 1:
	print('YES')
	for seat in seats:
		print(seat)
else:
	print('NO')


def check(c):
	for i in range(len(c)):
		if c[i][0] == 'OO':
			c[i][0] = '++'
			return c
		if c[i][1] == 'OO':
			c[i][1] = '++'
			return c
	return 0
n = int(input())
c = []
for i in range(n):
	c.append(input().split('|'))
l = check(c)
if l == 0:
	print('NO')
else:
	print('YES')
	for i in range(len(l)):
		l[i] = '|'.join(l[i])
	for i in range(len(l)):
		print(l[i])


n = int(input())
s = []
for i in range(n):
	s.append(input())
f = 0
for i in range(n):
	if s[i].find('OO') != -1:
		s[i] = s[i].replace('OO', '++', 1)
		f = 1
		break
if f == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(s[i])


n = int(input())
row = list()
temp = True
for i in range(n):
	row.append(input())
	if 'OO' in row[i] and temp:
		row[i] = row[i].replace('OO', '++', 1)
		temp = False
if temp:
	print('NO')
else:
	print('YES')
	print(*[i for i in row], sep='\n')


n = int(input())
l = [[0 for i in range(5)] for j in range(n)]
for i in range(n):
	l[i][:] = list(input())
for i in range(n):
	if l[i][0] == 'O' and l[i][1] == 'O':
		l[i][0] = l[i][1] = '+'
		print('YES')
		for j in range(n):
			print(''.join(l[j][:]))
		break
	elif l[i][3] == 'O' and l[i][4] == 'O':
		l[i][3] = l[i][4] = '+'
		print('YES')
		for j in range(n):
			print(''.join(l[j][:]))
		break
else:
	print('NO')


n = int(input())
ip = []
good = False
for _ in range(n):
	ip.append(input().strip().split('|'))
for i in ip:
	if 'OO' in i:
		good = True
		if i[0] == 'OO':
			i[0] = '++'
		else:
			i[1] = '++'
		break
if good:
	print('YES')
	for i in range(n):
		print('|'.join(ip[i]))
else:
	print('NO')


n = int(input())
c = 0
f = 0
l1 = []
for i in range(n):
	l = list(input())
	for i in range(len(l) - 1):
		if l[i] == 'O' and l[i + 1] == 'O' and (c == 0):
			c = c + 1
			l[i] = '+'
			l[i + 1] = '+'
	l1.append(l)
if c == 0:
	print('NO')
else:
	print('YES')
	for i in l1:
		for t in i:
			print(t, end='')
		print()


is_debug = False
n = int(input())
found = False
nrs = []
for i in range(0, n):
	r = input().split('|')
	print(f'r={r}') if is_debug else ''
	nr = []
	for p in r:
		if p == 'OO' and (not found):
			nr.append('++')
			found = True
		else:
			nr.append(p)
	print(f'nr={nr}') if is_debug else ''
	nrs.append(nr)
print(f"{('YES' if found else 'NO')}")
if found:
	for nr in nrs:
		print(f"{'|'.join(nr)}")


n = int(input())
m = []
for i in range(n):
	s = list(input().split('|'))
	m.append(s[0])
	m.append(s[1])
if 'OO' in m:
	e = m.index('OO')
	print('YES')
	for i in range(0, len(m), 2):
		if i == e:
			print('++', m[e + 1], sep='|')
		elif i + 1 == e:
			print(m[e - 1], '++', sep='|')
		elif i != e:
			print(m[i], m[i + 1], sep='|')
else:
	print('NO')


t = input
p = print
r = range
n = int(t())
a = [''] * n
ans = 'NO'
for i in r(n):
	s = t()
	if 'OO' in s and ans == 'NO':
		ans = 'YES'
		s = s.replace('OO', '++', 1)
	a[i] = s
print(ans)
if ans == 'YES':
	for mya in a:
		p(mya)


n = int(input())
bus = list()
pair_of_seats = 1
for i in range(n):
	row = input()
	row_seats = list(row)
	if pair_of_seats != 0:
		if row_seats[0] + row_seats[1] == 'OO':
			bus.append('+' + '+' + row_seats[2] + row_seats[3] + row_seats[4])
			pair_of_seats -= 1
			continue
		if row_seats[3] + row_seats[4] == 'OO':
			bus.append(row_seats[0] + row_seats[1] + row_seats[2] + '+' + '+')
			pair_of_seats -= 1
			continue
	bus.append(row_seats[0] + row_seats[1] + row_seats[2] + row_seats[3] + row_seats[4])
if pair_of_seats == 0:
	print('YES')
	print('\n'.join(map(str, bus)))
else:
	print('NO')


n = int(input())
s = []
for i in range(n):
	string = input()
	s.append(string)
temp = False
for i in range(n):
	x = s[i].split('|')
	if x[0] == 'OO':
		s[i] = '++|' + x[1]
		temp = True
		break
	elif x[1] == 'OO':
		s[i] = x[0] + '|++'
		temp = True
		break
if temp == True:
	print('YES')
	for i in s:
		print(i)
else:
	print('NO')


n = int(input())
a = []
t = -1
c = 0
for i in range(n):
	s = input()
	if 'OO' in s and c == 0:
		s = s.replace('OO', '++')
		if s.count('++') > 1:
			s = s[0:3] + 'OO'
		a.append(s)
		t = i
		c = 1
	else:
		a.append(s)
if t == -1:
	print('NO')
else:
	print('YES')
	for i in a:
		print(i)


n = int(input())
B = []
for i in range(0, n):
	a = input()
	A = []
	for j in a:
		A.append(j)
	B.append(A)
c = 0
for l in range(0, n):
	b = 0
	for k in range(0, 5):
		if B[l][k] == 'O':
			b = b + 1
		elif B[l][k] == '|':
			b = 0
		if b == 2:
			B[l][k - 1] = '+'
			B[l][k] = '+'
			c = 1
			break
	if b == 2:
		break
if c == 1:
	print('YES')
	for m in range(0, n):
		s = ''
		for n in range(0, 5):
			s = s + B[m][n]
		print(s)
else:
	print('NO')


n = int(input())
rows = []
for _ in range(n):
	rows.append(input())
ret = 'NO'
for i in range(len(rows)):
	row = rows[i]
	if row[:2] == 'OO' or row[-2:] == 'OO':
		if row[:2] == 'OO':
			row = '++' + row[2:]
		elif row[-2:] == 'OO':
			row = row[:-2] + '++'
		ret = 'YES'
		rows[i] = row
		break
print(ret)
if ret == 'YES':
	for row in rows:
		print(row)


n = int(input())
g = [input() for h in range(n)]
b = 1
x = 0
y = 0
for i in g:
	if 'OO' in i:
		x = i.find('O')
		y = i.find('O', x + 1)
		if x + 1 == y:
			a = g.index(i)
			if y == 1:
				o = i[:x] + '+' + i[y:]
				o = o[:y] + '+' + o[2:]
				g[a] = o
			elif y == 4:
				o = i[:x] + '+' + i[y:]
				o = o[:y] + '+'
				g[a] = o
			print('YES')
			for q in g:
				print(q)
			break
		elif x + 2 == y:
			a = g.index(i)
			x = i.find('O', y + 1)
			o = i[:y] + '+' + i[x:]
			o = o[:x] + '+'
			g[a] = o
			print('YES')
			for q in g:
				print(q)
			break
		elif x + 3 == y:
			x = i.find('O', y + 2)
			a = g.index(i)
			o = i[:y] + '+' + i[x:]
			o = o[:x] + '+'
			g[a] = o
			print('YES')
			for q in g:
				print(q)
			break
	elif b == len(g):
		print('NO')
		break
	b += 1


a = int(input())
b = list()
c = 'NO'
d = 0
for i in range(a):
	b.append(str(input()))
	if 'OO' in b[i] and d == 0:
		c = 'YES'
		b[i] = b[i].replace('OO', '++', 1)
		d = 1
print(c)
if c == 'YES':
	for i in b:
		print(i)


n = int(input())
avt = []
yes = False
for i in range(n):
	s = input()
	if s[0] == 'O' and s[1] == 'O' or (s[3] == 'O' and s[4] == 'O'):
		if s[0] == 'O' and s[1] == 'O' and (not yes):
			s = '++' + s[2:]
			yes = True
		if s[3] == 'O' and s[4] == 'O' and (not yes):
			s = s[:3] + '++'
			yes = True
	avt.append(s)
if not yes:
	print('NO')
	exit()
else:
	print('YES')
for i in range(n):
	print(avt[i])


n = int(input())
res = ''
found = False
for i in range(n):
	row = input()
	pairs = [row[:2], row[3:]]
	if not found:
		if pairs[0] == 'OO':
			res += '++|' + pairs[1]
			found = True
		elif pairs[1] == 'OO':
			res += pairs[0] + '|++'
			found = True
		else:
			res += row
	else:
		res += row
	res += '\n'
print('YES\n' + res if found else 'NO')


def printArr(arr):
	for i in arr:
		print(i)
n = int(input())
seats = []
for i in range(n):
	seats.append(input())
found = False
for i in range(n):
	spl = seats[i].split('|')
	s0 = spl[0]
	s1 = spl[1]
	if 'OO' == s0:
		seats[i] = '++' + '|' + s1
		found = True
		break
	elif 'OO' == s1:
		seats[i] = s0 + '|' + '++'
		found = True
		break
if not found:
	print('NO')
else:
	print('YES')
	printArr(seats)


n = int(input())
l = []
o = 0
for i in range(n):
	s = str(input())
	if s.count('OO') >= 1 and o == 0:
		o += 1
		k = s.replace('OO', '++', 1)
		l.append(k)
	else:
		l.append(s)
if o == 1:
	print('YES')
	print('\n'.join([str(i) for i in l]))
else:
	print('NO')


(x, j) = (int(input()), [])
for i in range(x):
	j.append(input())
entered = False
final = []
for i in j:
	if 'OO' in i and (not entered):
		entered = True
		final.append(i.replace('OO', '++', 1))
	else:
		final.append(i)
if entered:
	print('YES')
	for i in final:
		print(i)
else:
	print('NO')


s = ''
for _ in range(int(input())):
	s += '\n' + input()
x = s.find('OO')
print(['YES' + s[:x] + '++' + s[x + 2:], 'NO'][x < 0])


n = int(input())
done = 0
ans = []
for i in range(0, n):
	s = input().split('|')
	cur = []
	for j in s:
		if not done and j == 'OO':
			cur.append('++')
			done = 1
		else:
			cur.append(j)
	ans.append(cur)
if not done:
	print('NO')
else:
	print('YES')
	for i in ans:
		print(i[0], i[1], sep='|')


n = int(input())
seats = [[0] * 5] * n
o = 0
for i in range(n):
	seats[i] = input()
for i in range(n):
	if 'OO' in seats[i]:
		o = 1
		seats[i] = seats[i].replace('OO', '++')
		if seats[i] == '++|++':
			seats[i] = '++|OO'
		break
if o == 1:
	print('YES')
	print('\n'.join(seats))
else:
	print('NO')


n = int(input())
ans = []
count = 0
for _ in range(n):
	s = input()
	ans.append(s)
for i in range(len(ans)):
	if 'OO' in ans[i]:
		ans[i] = ans[i].replace('OO', '++', 1)
		count = 1
		break
if count == 0:
	print('NO')
else:
	print('YES')
	for i in ans:
		print(i)


import re
n = int(input())
s = list()
message = 'NO'
pattern = 'OO'
for i in range(n):
	x = input()
	if re.search(pattern, x) and message == 'NO':
		message = 'YES'
		mod = re.sub(pattern, '++', x, 1)
		s.append(mod)
	else:
		s.append(x)
print(message)
if message == 'YES':
	for i in s:
		print(i)


n = int(input())
check = 0
arr = []
lst = []
for i in range(n):
	strn = input()
	arr.append(strn)
for i in range(n):
	if check == 0:
		if arr[i][:2] == 'OO':
			lst.append('++' + arr[i][2:])
			check = 1
		elif arr[i][3:] == 'OO':
			lst.append(arr[i][:3] + '++')
			check = 1
		else:
			lst.append(arr[i])
	else:
		lst.append(arr[i])
if check == 1:
	print('YES')
	for i in lst:
		print(i)
else:
	print('NO')


n = int(input())
flag = False
a = [[str(i) for i in input()] for j in range(n)]
for i in range(n):
	for j in range(len(a[i]) - 1):
		if a[i][j] == a[i][j + 1] and a[i][j] == 'O':
			print('YES')
			a[i][j] = '+'
			a[i][j + 1] = '+'
			for k in range(n):
				for h in a[k]:
					print(h, end='')
				print()
			exit()
			flag = True
if not flag:
	print('NO')


t = int(input())
l = []
done = False
for i in range(t):
	a = input()
	if a[0] == a[1] and (a[0] == 'O' and a[1] == 'O') and (not done):
		done = True
		l.append('++' + a[2] + a[3] + a[4])
	elif a[3] == a[4] and (a[3] == 'O' and a[4] == 'O') and (not done):
		done = True
		l.append(a[0] + a[1] + a[2] + '++')
	else:
		l.append(a)
if done:
	print('YES')
	for i in l:
		print(i)
else:
	print('NO')


import collections
n = int(input())
printt = False
stop = False
bus = []
for i in range(n):
	row = input()
	if not stop:
		if row[:2] in 'OO':
			printt = True
			stop = True
			row = '++' + row[2:]
			bus.append(row)
			continue
		if row[3:5] in 'OO':
			printt = True
			stop = True
			row = row[:3] + '++'
			bus.append(row)
			continue
	bus.append(row)
if printt:
	print('YES')
	for item in bus:
		print(item)
else:
	print('NO')


a = []
n = int(input())
t = 0
for i in range(n):
	s = input()
	if s[:2] == 'OO' and t == 0:
		a.append('++' + s[2:])
		t = 1
	elif s[3:] == 'OO' and t == 0:
		a.append(s[:3] + '++')
		t = 1
	else:
		a.append(s)
if t == 1:
	print('YES')
	for i in a:
		print(i)
else:
	print('NO')


n = int(input())
c = 0
cf = 0
l = []
for i in range(n):
	s = input()
	l.append(s)
for i in l:
	if i.count('OO') > 0:
		c += 1
if c > 0:
	print('YES')
else:
	print('NO')
for i in l:
	if c > 0:
		if i.count('OO') > 0 and cf == 0:
			i = i.replace('OO', '++', 1)
			print(i)
			cf += 1
		else:
			print(i)


n = int(input())
b = []
for i in range(n):
	a = input().split('|')
	b.append(a)
count = False
for i in range(n):
	if 'OO' in b[i]:
		b[i][b[i].index('OO')] = '++'
		count = True
		break
if count:
	print('YES')
	for i in b:
		print(str(i[0]) + '|' + str(i[1]))
else:
	print('NO')


n = int(input())
s = 0
L = []
for i in range(n):
	r = input()
	if r == 'OO|OO' and s == 0:
		r = '++|OO'
		s = 1
	if 'OO' in r and s == 0:
		s = 1
		r = r.replace('OO', '++')
	L.append(r)
if s == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(L[i])


n = int(input())
bus = ''
hasSeats = False
for i in range(n):
	row = input()
	if not hasSeats and 'OO' in row:
		hasSeats = True
		if row[0:2] == 'OO':
			row = '++' + row[2:5]
		elif row[3:5] == 'OO':
			row = row[0:3] + '++'
	bus += row + '\n'
if hasSeats:
	print('YES')
	print(bus)
else:
	print('NO')


number = int(input())
sits = [input() for s in range(number)]
cn = 0
for i in range(number):
	if sits[i].find('OO') != -1:
		rm = sits[i].replace('OO', '++', 1)
		(sits[i], cn) = (rm, 1)
		break
if cn == 1:
	print('YES')
	for q in range(number):
		print(sits[q])
else:
	print('NO')


n = int(input())
t = 0
d = ''
k = 0
for i in range(n):
	if i != n - 1:
		s = str(input())
		if s.count('OO') != 0:
			t += 1
		if s.count('OO') == 1 and t <= 1:
			s = s.replace('OO', '++')
			d = d + s + '\n'
		elif s.count('OO') == 2 and t <= 1:
			d = d + '++|OO' + '\n'
		else:
			d = d + s + '\n'
	else:
		s = str(input())
		if s.count('OO') != 0:
			t += 1
		if s.count('OO') == 1 and t <= 1:
			s = s.replace('OO', '++')
			d = d + s
		elif s.count('OO') == 2 and t <= 1:
			d = d + '++|OO'
		else:
			d = d + s
if t != 0:
	print('YES')
	print(d)
else:
	print('NO')


n = int(input())
a = []
for i in range(0, n):
	a.append(input().split('|'))
ans = 'NO'
for i in range(0, n):
	if a[i][0] == 'OO':
		a[i][0] = '++'
		ans = 'YES'
		break
	elif a[i][1] == 'OO':
		a[i][1] = '++'
		ans = 'YES'
		break
print(ans)
if ans == 'YES':
	for i in range(0, n):
		print(a[i][0] + '|' + a[i][1])


def trial():
	num = int(input())
	grid = []
	for i in range(num):
		string = list(input().rsplit(sep='|'))
		grid.append(string)
	replacement = '++'
	idx = 0
	idy = 0
	counter = 0
	for row in range(len(grid)):
		for col in range(2):
			if grid[row][col] == 'OO' and counter < 1:
				counter += 1
				grid[row].remove('OO')
				grid[row].insert(col, replacement)
				idx = row
				idy = col
				break
	if '++' == grid[idx][idy]:
		print('YES')
		for row in grid:
			print(f'{row[0]}|{row[1]}')
		return
	else:
		print('NO')
trial()


r = 0
ans = []
for i in range(int(input())):
	s = input().split('|')
	if (s[0] == 'OO' or s[1] == 'OO') and r == 0:
		if s[0] == 'OO':
			ans.append('++|' + s[1])
		else:
			ans.append(s[0] + '|++')
		r = 1
	else:
		ans.append(s[0] + '|' + s[1])
if r == 1:
	print('YES')
	for i in ans:
		print(i)
else:
	print('NO')


n = int(input())
inp = []
for i in range(n):
	inp.append(input())
for i in range(len(inp)):
	if 'OO' in inp[i]:
		new = inp[i].replace('OO', '++', 1)
		inp[i] = new
		print('YES')
		for j in inp:
			print(j)
		break
else:
	print('NO')


import sys
import math as mt
t = 1
for __ in range(t):
	n = int(input())
	l = []
	y = 0
	ind = -1
	for i in range(n):
		s = input()
		if s[0] == 'O' and s[1] == 'O' and (ind == -1):
			ind = i
			f = 1
		if s[3] == 'O' and s[4] == 'O' and (ind == -1):
			ind = i
			f = 2
		l.append(s)
	if ind == -1:
		print('NO')
	else:
		print('YES')
		for i in range(n):
			if i == ind:
				if f == 1:
					print('++', end='')
					print(l[i][2:])
				if f == 2:
					print(l[i][:3], end='')
					print('++')
			else:
				print(l[i])


a = int(input())
r = 0
d = 0
b = list()
while r < a:
	c = input()
	if 'OO' in c and d == 0:
		c = c.replace('OO', '++', 1)
		b.append(c)
		d = d + 1
	else:
		b.append(c)
	r = r + 1
r = 0
if d == 1:
	print('YES')
	while r < a:
		print(b[r])
		r = r + 1
else:
	print('NO')


a = int(input())
n = 0
b = []
while n < a:
	y = input()
	b.append(y)
	n += 1
i = 0
while i < a:
	if 'OO' in b[i]:
		b[i] = b[i].replace('OO', '++', 1)
		print('YES')
		for row in b:
			print(''.join(row))
		break
	i += 1
else:
	print('NO')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	l = []
	f = True
	for _ in range(n):
		s = S()
		if f:
			if s.count('OO') > 0:
				f = False
				s = s.replace('OO', '++', 1)
		l.append(s)
	if f:
		print('NO')
		exit()
	print('YES')
	for x in l:
		print(x)
main()


n = int(input())
s = []
flag = False
for k in range(n):
	s.append(str(input()))
	if s[-1][:2] == 'OO' and (not flag):
		s[-1] = '++' + s[-1][2:]
		flag = True
	elif s[-1][3:] == 'OO' and (not flag):
		s[-1] = s[-1][:3] + '++'
		flag = True
if flag:
	print('YES')
	for e in s:
		print(e)
else:
	print('NO')


n = int(input())
f = 'NO'
x = []
for i in range(n):
	a = input()
	if 'OO' in a and f == 'NO':
		z = a.index('OO')
		a = a[:z] + '++' + a[z + 2:]
		f = 'YES'
	x.append(a)
print(f)
if f == 'YES':
	for i in range(n):
		print(x[i])


n = int(input())
strings = []
flag = 0
for i in range(n):
	str = input()
	if flag == 0:
		if 'OO' in str:
			str = str.replace('OO', '++', 1)
			flag = 1
	strings.append(str)
if flag == 1:
	print('YES')
	for str in strings:
		print(str)
else:
	print('NO')


n = int(input())
t = False
kkk = []
for i in range(0, n):
	p = input().split('|')
	if t == False:
		for j in range(0, 2):
			if p[j] == 'OO':
				p[j] = '++'
				t = True
				break
	kkk.append(p[0])
	kkk.append(p[1])
if t == False:
	print('NO')
else:
	print('YES')
	for i in range(0, n):
		print('|'.join(kkk[2 * i:2 * i + 2]))


n = int(input())
a = []
(c, ind) = (0, -1)
for i in range(n):
	s = input()
	if c == 0:
		if s[0:2] == 'OO':
			c = 1
		elif s[3:5] == 'OO':
			c = 2
		ind = i
	a.append(s)
if c == 0:
	print('NO')
else:
	print('YES')
	for i in range(len(a)):
		if i == ind:
			if c == 1:
				print('++' + a[i][2:5])
			elif c == 2:
				print(a[i][0:3] + '++')
		else:
			print(a[i])


def main():
	flag = False
	n = int(input())
	ans = []
	for i in range(n):
		seats = input()
		if flag:
			ans.append(seats)
			continue
		if seats.find('OO') != -1:
			flag = True
			seats = seats.replace('OO', '++', 1)
		ans.append(seats)
	if flag:
		print('YES')
		for line in ans:
			print(line)
	else:
		print('NO')
main()


N = int(input())
data = [None] * N
row = -1
col = -1
for i in range(N):
	data[i] = input()
	if row == -1 and (data[i][:2] == 'OO' or data[i][-2:] == 'OO'):
		row = i
if row == -1:
	print('NO')
else:
	print('YES')
	for i in range(N):
		if i == row:
			if data[i][:2] == 'OO':
				print('++' + data[i][2:])
			else:
				print(data[i][:-2] + '++')
		else:
			print(data[i])


def findPair(tmp):
	if tmp[0] == 'O' and tmp[1] == 'O':
		tmp = list(tmp)
		tmp[0] = '+'
		tmp[1] = '+'
		return [True, ''.join(tmp)]
	if tmp[3] == 'O' and tmp[4] == 'O':
		tmp = list(tmp)
		tmp[3] = '+'
		tmp[4] = '+'
		return [True, ''.join(tmp)]
	return [False, tmp]
n = int(input())
confg = ''
isFound = False
for i in range(1, n + 1):
	tmp = input().rstrip()
	if not isFound:
		tmp = findPair(tmp)
		isFound = tmp[0]
	else:
		tmp = [True, tmp]
	confg += tmp[1] + '\n'
if isFound:
	print('YES')
	print(confg)
else:
	print('NO')


def checker(s):
	k = 0
	if s[:2] == 'OO' or s[3:] == 'OO':
		k = 1
	return k

def corrector(s):
	s = s.replace('OO', '++', 1)
	return s
n = int(input())
l = []
y = 0
a = 0
for i in range(n):
	l.append(input())
for i in range(len(l)):
	if checker(l[i]) == 1:
		a += i
		y = 1
		break
l[a] = corrector(l[a])
if y == 0:
	print('NO')
else:
	print('YES')
	for i in l:
		print(i)


n = int(input())
a = []
b = []
s1 = []
for i in range(0, n):
	s = str(input())
	a.append(s)
f = 0
for i in range(0, n):
	if 'OO' in a[i] and f != 1:
		f = 1
		s = a[i].split('|')
		k = s.index('OO')
		if k == 0:
			s1.append('++')
			s1.append('|')
			s1.append(s[1])
		else:
			s1.append(s[0])
			s1.append('|')
			s1.append('++')
		b.append(a[i].replace(a[i], ''.join(s1)))
	else:
		b.append(a[i])
if f == 1:
	print('YES')
	for i in range(0, n):
		print(b[i])
else:
	print('NO')


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
N = int(input())
A = []
for i in range(N):
	A.append(list(input()))
found = False
for i in range(N):
	row = A[i]
	if row[0:2] == ['O', 'O']:
		row[0:2] = ['+', '+']
		found = True
		break
	if row[3:5] == ['O', 'O']:
		row[3:5] = ['+', '+']
		found = True
		break
if found:
	print('YES')
	for row in A:
		print(''.join(row))
else:
	print('NO')


n = int(input())
seats = []
count = 0
for i in range(n):
	string = input()
	if 'OO' in string and count == 0:
		ind = string.count('OO')
		if ind > 1:
			x = '++' + string[2:]
			seats.append(x)
			count += 1
		else:
			seats.append(string.replace('OO', '++'))
			count += 1
	else:
		seats.append(string)
if count > 0:
	print('YES')
	for j in seats:
		print(j)
else:
	print('NO')


n = int(input())
lis = []
mark = 0
for i in range(n):
	s = input()
	if 'OO' in s and mark == 0:
		mark = 1
		s = s.replace('OO', '++', 1)
	lis.append(s)
if mark == 1:
	print('YES')
	for s in lis:
		print(s)
else:
	print('NO')


n = int(input())
k = []
for i in range(n):
	k.append(input())
for (i, j) in enumerate(k):
	if 'OO' in j:
		j = j.replace('OO', '++', 1)
		k[i] = j
		print('YES')
		print('\n'.join(k))
		exit()
print('NO')


n = int(input())
l = []
isseat = False
for i in range(n):
	l.append(input())
	if not isseat and 'OO' in l[i]:
		isseat = True
		l[i] = l[i].replace('OO', '++', 1)
if isseat:
	print('YES', '\n'.join(l), sep='\n')
else:
	print('NO')


n = int(input())
a = []
for i in range(n):
	a.append(input())
b = 0
for i in range(n):
	if a[i][0] == a[i][1] == 'O' and b < 1:
		a[i] = '++|' + a[i][3] + a[i][4]
		b = 1
	elif a[i][3] == a[i][4] == 'O' and b < 1:
		a[i] = a[i][0] + a[i][1] + '|++'
		b = 1
if b == 1:
	print('YES')
	for i in range(n):
		print(a[i])
	print()
else:
	print('NO')


n = int(input())
l = []
for i in range(n):
	p = input()
	l.append(p)
Q = []
g = True
for i in l:
	if i[0] == i[1] == 'O' and g:
		g = False
		w = '++' + i[2:]
		Q.append(w)
	elif i[3] == i[4] == 'O' and g:
		g = False
		w = i[:3] + '++'
		Q.append(w)
	else:
		Q.append(i)
if not g:
	print('YES')
	for i in Q:
		print(i)
else:
	print('NO')


n = int(input())
f = 0
b = []
for j in range(n):
	a = input().split('|')
	if f != 1 and a[0] == 'OO':
		a[0] = '++'
		f = 1
	if f != 1 and a[1] == 'OO':
		a[1] = '++'
		f = 1
	a = '|'.join(a)
	b.append(a)
if f == 1:
	print('YES')
	for i in range(n):
		print(b[i])
else:
	print('NO')


n = int(input())
l = []
f = 0
for i in range(n):
	s = input()
	if f == 0:
		if s[0] == 'O' and s[1] == 'O':
			l.append('++' + s[2:])
			f = 1
		elif s[3] == 'O' and s[4] == 'O':
			l.append(s[:3] + '++')
			f = 1
		else:
			l.append(s)
	else:
		l.append(s)
if f == 1:
	print('YES')
	for i in range(n):
		print(l[i])
else:
	print('NO')


n = int(input())
x = 0
L = []
for i in range(n):
	m = input()
	if x == 0:
		if m[0] == m[1] == 'O':
			m = '++' + m[2:]
			x = x + 1
		elif m[3] == m[4] == 'O':
			m = m[0:3] + '++'
			x = x + 1
	L.append(m)
if x == 0:
	print('NO')
else:
	print('YES')
	for i in L:
		print(i)


n = int(input())
h = []
o = True
for i in range(n):
	a = list(input().split('|'))
	if o:
		if a[0] == 'OO':
			a[0] = '++'
			o = False
		elif a[1] == 'OO':
			a[1] = '++'
			o = False
	h.append(a)
if not o:
	print('YES')
	for i in range(n):
		print('|'.join(h[i]))
else:
	print('NO')


import sys
n = int(input())
got = 0
newstr = ''
for i in range(n):
	str = input()
	for j in range(4):
		if str[j] == 'O' and str[j + 1] == 'O' and (got == 0):
			got = 1
			str = str[:j] + '++' + str[j + 2:]
	newstr += str
if got == 1:
	print('YES')
	for i in range(0, len(newstr), 5):
		word = ''
		for j in range(i, i + 5):
			word += newstr[j]
		print(word)
else:
	print('NO')


n = int(input())
l = []
for i in range(n):
	l.extend(list(input().split('|')))
if l.count('OO'):
	print('YES')
	l[l.index('OO')] = '++'
	for i in range(0, len(l), 2):
		print(l[i] + '|' + l[i + 1])
else:
	print('NO')


n = int(input())
a = []
cond = False
for i in range(n):
	a.append(list(input()))
	if a[i][0] == a[i][1] == 'O':
		if not cond:
			a[i][0] = '+'
			a[i][1] = '+'
			cond = True
	elif a[i][3] == a[i][4] == 'O':
		if not cond:
			a[i][3] = '+'
			a[i][4] = '+'
			cond = True
if cond:
	print('YES')
	for i in range(n):
		print(''.join(a[i]))
else:
	print('NO')


a = []
b = False
for _ in range(int(input())):
	if b:
		a += [input()]
	else:
		c = input()
		if 'OO' in c:
			a += [c.replace('OO', '++', 1)]
			b = True
		else:
			a += [c]
if b:
	print('YES')
	print('\n'.join(a))
else:
	print('NO')


i = input
a = []
n = int(i())
Flag = False
for j in range(n):
	a.append(i())
for j in range(n):
	if 'OO' in a[j]:
		Flag = True
		a[j] = a[j].replace('OO', '++', 1)
		break
if Flag:
	print('YES')
	for j in a:
		print(j)
else:
	print('NO')


x = int(input())
s1 = []
s2 = []
t = 0
for i in range(x):
	(a, b) = input().split('|')
	s1.append(a)
	s2.append(b)
for j in range(x):
	if s1[j][0] == s1[j][1] and s1[j][0] == 'O':
		s1[j] = '++'
		print('YES')
		t = t + 1
		break
	elif s2[j][0] == s2[j][1] and s2[j][0] == 'O':
		s2[j] = '++'
		print('YES')
		t = t + 1
		break
if t == 0:
	print('NO')
for i in range(len(s1)):
	if t == 0:
		break
	print(s1[i] + '|' + s2[i])


a = int(input())
c = ''
e = 0
for i in range(a):
	b = input()
	d = b.split('|')
	for j in range(2):
		if d[j] == 'OO' and e == 0:
			e += 1
			d[j] = '++'
		else:
			continue
	c += d[0] + '|' + d[1] + '\n'
if e != 0:
	print('YES')
	print(c)
else:
	print('NO')


a = []
na = False
for i in range(int(input())):
	st = input()
	if not na:
		if 'OO' in st:
			na = True
			st = st.replace('OO', '++', 1)
	a.append(st)
if na:
	print('YES')
	print(*a, sep='\n')
else:
	print('NO')


from sys import stdin
printf = lambda x: print(x, end='')
T = int(input())
lines = []
ans = []
for i in range(T):
	l = stdin.readline()
	lines.append(l)
flag = False
for (idx, line) in enumerate(lines):
	if line[:2] == 'OO':
		lines[idx] = '++|{}'.format(line[3:])
		flag = True
		break
	if line[3:-1] == 'OO':
		lines[idx] = '{}|++\n'.format(line[:2])
		flag = True
		break
if flag:
	printf('YES\n')
	for line in lines:
		printf(line)
else:
	printf('NO\n')


n = int(input())
bus = []
found = False
for i in range(n):
	s = input()
	if not found:
		(a, b) = s.split('|')
		if a == 'OO':
			found = True
			s = '++|' + b
		elif b == 'OO':
			found = True
			s = a + '|++'
	bus.append(s)
if not found:
	print('NO')
else:
	print('YES')
	for s in bus:
		print(s)


n = int(input())
bus = []
flag = 0
seats_found = 0
for i in range(0, n):
	s = input()
	s = [i for i in s]
	bus.append(s)
	if s[0] == 'O' and s[1] == 'O' or (s[3] == 'O' and s[4] == 'O'):
		flag = 1
		if seats_found == 0:
			if s[0] == 'O' and s[1] == 'O':
				bus[i][0] = '+'
				bus[i][1] = '+'
			else:
				bus[i][3] = '+'
				bus[i][4] = '+'
			seats_found = 1
if flag == 0:
	print('NO')
else:
	print('YES')
	for i in range(0, n):
		for j in range(0, 5):
			print(bus[i][j], end='')
		print()


lst = [input().split('|') for _ in range(int(input()))]
for i in lst:
	if i[0] == 'OO':
		i[0] = '++'
		print('YES')
		break
	elif i[1] == 'OO':
		i[1] = '++'
		print('YES')
		break
if not any([1 if '++' in i else 0 for i in lst]):
	print('NO')
else:
	for i in lst:
		print('|'.join(i))


n = int(input())
array = []
for i in range(n):
	x = input()
	array += [x]
stts = False
for i in range(n):
	for j in range(len(array[i]) - 1):
		if array[i][j] == 'O' and array[i][j + 1] == 'O':
			if j == 0:
				array[i] = '++|' + array[i][3:]
				stts = True
				break
			elif j == 3:
				array[i] = array[i][0:3] + '++'
				stts = True
				break
	if stts == True:
		break
if stts == False:
	print('NO')
else:
	print('YES')
	for i in array:
		print(i)


n = int(input())
arr = []
hay = False
for a in range(0, n):
	arr.append(str(input()))
arrc_ = arr
c = 0
for cad in arr:
	subarr = cad.split('|')
	izq = subarr[0]
	der = subarr[1]
	if izq == 'OO':
		hay = True
		arr[c] = '++|' + der
		break
	elif der == 'OO':
		arr[c] = izq + '|++'
		hay = True
		break
	c = c + 1
if hay:
	print('YES')
	for line in arr:
		print(line)
else:
	print('NO')


x = int(input())
m = []
for i in range(x):
	a = input()
	b = list(a)
	m.append(b)
v = 0
for i in range(x):
	if m[i][0] == 'O' and m[i][1] == 'O':
		m[i][0] = '+'
		m[i][1] = '+'
		print('YES', end='')
		for i in range(x):
			print()
			for j in range(5):
				print(m[i][j], end='')
		break
	elif m[i][3] == 'O' and m[i][4] == 'O':
		m[i][3] = '+'
		m[i][4] = '+'
		print('YES', end='')
		for i in range(x):
			print()
			for j in range(5):
				print(m[i][j], end='')
		break
	else:
		v += 1
if v == x:
	print('NO', end='')


def main():
	N = int(input())
	list1 = []
	yes = False
	for _ in range(N):
		i = input()
		list1.append(i)
		if 'OO' in i.split('|'):
			yes = True
	if not yes:
		print('NO')
	else:
		print('YES')
		result = []
		for i in list1:
			(a, b) = list(str(i).split('|'))
			if a == 'OO' and yes:
				result.append('++|' + b)
				yes = False
			elif b == 'OO' and yes:
				result.append(a + '|++')
				yes = False
			else:
				result.append(a + '|' + b)
		for i in result:
			print(i)
main()


n = int(input())
rows = []
ok = False
for i in range(n):
	rows.append(input())
	if not ok and 'OO' in rows[-1]:
		ok = True
		idx = rows[-1].index('OO')
		rows[-1] = rows[-1][:idx] + '++' + rows[-1][idx + 2:]
if ok:
	print('YES')
	for row in rows:
		print(row)
else:
	print('NO')


a = []
f = 0
hola = []
for i in range(int(input())):
	b = input()
	a.append(b)
for t in a:
	if 'OO' in t and f == 0:
		f = 1
		k = t.replace('OO', '++', 1)
		hola.append(k)
	else:
		hola.append(t)
if f == 1:
	print('YES')
	for it in hola:
		print(it)
else:
	print('NO')


n1 = int(input())
lst = []
lst1 = []
k = 0
for i in range(n1):
	n = input()
	lst.append(n)
for j in lst:
	if j[0] == 'O' and j[1] == 'O':
		s = '++' + '|' + j[3] + j[4]
		lst1.append(s)
		k = k + 1
		lst.remove(j)
		break
	elif j[3] == 'O' and j[4] == 'O':
		s = j[0] + j[1] + '|' + '++'
		lst1.append(s)
		k = k + 1
		lst.remove(j)
		break
	else:
		lst1.append(j)
if k == 0:
	print('NO')
else:
	print('YES')
	for z in lst1:
		print(z)
		if z in lst:
			lst.remove(z)
	for m in lst:
		print(m)


n = int(input())
answers = []
answer = False
for _ in range(n):
	s = str(input())
	if not answer and 'OO' in s:
		s = s.replace('OO', '++', 1)
		answer = True
	answers.append(s)
if answer:
	print('YES')
	print('\n'.join(map(str, answers)))
else:
	print('NO')


def main():
	n = int(input())
	z = -1
	finished = False
	rows = []
	for _ in range(n):
		r = list(input())
		flag = False
		for i in range(5):
			if r[i] == 'O':
				if flag == True and finished == False:
					finished = True
					r[i] = '+'
					r[z] = '+'
				flag = True
				z = i
			else:
				flag = False
		rows.append(''.join(r))
	if finished:
		print('YES')
		for r in rows:
			print(r)
	else:
		print('NO')
main()


t = int(input())
a = []
for _ in range(t):
	b = list(map(str, input().split('|')))
	a.append(b)
for i in range(t):
	if a[i][0] == 'OO':
		a[i][0] = '++'
		print('YES')
		break
	elif a[i][1] == 'OO':
		a[i][1] = '++'
		print('YES')
		break
	elif i == t - 1:
		print('NO')
		quit()
for x in range(t):
	print(a[x][0] + '|' + a[x][1])


n = int(input())
x = []
xnew = []
s = 0
for i in range(n):
	x.append(input())
for i in x:
	if s == 0 and 'OO' in i:
		i = i.replace('OO', '++', 1)
		s = s + 1
	xnew.append(i)
if s == 0:
	print('NO')
else:
	print('YES')
	for i in xnew:
		print(i)


n = int(input())
b = []
for i in range(n):
	a = list(input().split('|'))
	b.append(a[0])
	b.append(a[1])
	if 'OO' in a and '++' not in b:
		b[b.index('OO')] = '++'
if '++' in b:
	print('YES')
	for i in range(len(b) // 2):
		print(b[0] + '|' + b[1])
		b.pop(0)
		b.pop(0)
else:
	print('NO')


a = int(input())
k = [None] * a
add = 0
check = 0
for i in range(0, a):
	k[i] = input()
	if k[i].count('OO') > 0 and check == 0:
		k[i] = k[i].replace('OO', '++', 1)
		check = check + 1
	else:
		add = add + 1
if add == a:
	print('NO')
else:
	print('YES')
	for i in range(0, a):
		print(k[i])


n = int(input())
line = []
result = False
for i in range(n):
	string = input()
	if not result:
		if string[0] == 'O' and string[1] == 'O':
			string = '++' + string[2:]
			line += [string]
			result = True
		elif string[3] == 'O' and string[4] == 'O':
			string = string[:3] + '++'
			line += [string]
			result = True
		else:
			line += [string]
	else:
		line += [string]
if not result:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(line[i])


n = int(input())
d = {}
flag = 0
for i in range(n):
	s = input()
	x = ''
	if s[0] == 'O' and s[1] == 'O' and (flag == 0):
		flag = 1
		x = '++|' + s[3:5]
	elif s[3] == 'O' and s[4] == 'O' and (flag == 0):
		flag = 1
		x = s[:3] + '++'
	else:
		x = s
	d[i] = x
if flag == 0:
	print('NO')
else:
	print('YES')
	for i in d:
		print(d[i])


import sys
import math
input = sys.stdin.readline
ans = ''
count = 0
for _ in range(int(input())):
	line = input()
	if count:
		ans += line
	elif 'OO' in line:
		ans += line.replace('OO', '++', 1)
		count += 1
	else:
		ans += line
if count:
	print('YES')
	print(ans)
else:
	print('NO')


n = int(input())
a = [input() for i in range(n)]
ans = False
for i in range(n):
	if (a[i][0] == 'O' and a[i][1] == 'O') and (not ans):
		a[i] = '++' + a[i][2:]
		ans = True
		continue
	if (a[i][3] == 'O' and a[i][4] == 'O') and (not ans):
		a[i] = a[i][:3] + '++'
		ans = True
		continue
if ans:
	print('YES')
	for i in range(n):
		print(a[i])
else:
	print('NO')


n = int(input())
bus = []
founded = False
for i in range(n):
	row = input()
	if not founded:
		pair = row.split('|')
		if pair[0] == 'OO':
			row = '++' + row[2:]
			founded = True
		elif pair[1] == 'OO':
			row = row[0:3] + '++'
			founded = True
	bus.append(row)
if not founded:
	print('NO')
else:
	print('YES', *bus, sep='\n')


n = input()
lines = []
final_lines = []
count = 1
for i in range(int(n)):
	lines.append(input())
if any(('OO' in line for line in lines)):
	print('YES')
	for line in lines:
		if line.find('OO') == -1:
			final_lines.append(line)
		elif count == 1:
			final_lines.append(line.replace('OO', '++', 1))
			count -= 1
		else:
			final_lines.append(line)
	for line in final_lines:
		print(line)
else:
	print('NO')


n = int(input())
seats = []
for i in range(n):
	s = input()
	seats.append(s)
ava = False
for i in range(len(seats)):
	if seats[i] == 'OO|OO':
		ava = True
		seats[i] = '++|OO'
		break
	if 'OO' in seats[i]:
		ava = True
		seats[i] = seats[i].replace('OO', '++')
		break
if ava:
	print('YES')
	for i in seats:
		print(i)
else:
	print('NO')


n = int(input())
free_seats = 0
output = []
for i in range(n):
	s = input()
	if s.__contains__('OO'):
		free_seats += 1
	if free_seats == 1:
		s = s.replace('OO', '++', 1)
	output.append(s)
if free_seats > 0:
	print('YES')
	print('\n'.join(output))
else:
	print('NO')


a = int(input())
b = []
n = 0
o = 0
h = 0
for i in range(a):
	b.append(input().split('|'))
for i in range(a):
	if n == 0 and b[i][0] == 'OO':
		n += 1
		o = i
		h = 0
	elif n == 0 and b[i][1] == 'OO':
		n += 1
		o = i
		h = 1
if n == 1:
	print('YES')
	for t in range(a):
		if t == o:
			if h == 0:
				print('++', b[t][1], sep='|')
			elif h == 1:
				print(b[t][0], '++', sep='|')
		else:
			print(b[t][0], b[t][1], sep='|')
else:
	print('NO')


def solve():
	n = int(input())
	arr = []
	ans = 'NO'
	for i in range(n):
		arr.append(input())
		if 'OO|' in arr[i] and ans == 'NO':
			ans = 'YES'
			arr[i] = arr[i].replace('OO|', '++|')
		elif '|OO' in arr[i] and ans == 'NO':
			ans = 'YES'
			arr[i] = arr[i].replace('|OO', '|++')
	if ans == 'NO':
		print(ans)
	else:
		print(ans)
		for i in range(len(arr)):
			print(arr[i])
solve()


import sys
s = ''
for _ in range(int(input())):
	s += '\n' + input()
if 'OO' in s:
	sys.stdout.write('YES')
	print(s.replace('OO', '++', 1))
	sys.stdout.flush()
else:
	print('NO')


n = int(input())
bus = list(list())
for i in range(n):
	bus.append(list(input()))
hasPlace = False
for row in bus:
	if row[0] == row[1] and row[0] == 'O':
		hasPlace = True
		row[0] = row[1] = '+'
		break
	elif row[3] == row[4] and row[3] == 'O':
		hasPlace = True
		row[3] = row[4] = '+'
		break
if hasPlace:
	print('YES')
	for row in bus:
		for char in row:
			print(char, end='')
		print('')
else:
	print('NO')


rows = int(input())
config = [input() for x in range(rows)]
config = '\n'.join(config)
ronfig = config.replace('OO', '++', 1)
if config != ronfig:
	print('YES')
	print(ronfig)
else:
	print('NO')


n = int(input())
list = []
for i in range(n):
	list.append(input())
flag = 0
for i in range(n):
	ara = list[i]
	if ara[0:2] == 'OO':
		flag = 1
		list[i] = '++' + ara[2:5]
		break
	if ara[3:5] == 'OO':
		flag = 1
		list[i] = ara[0:3] + '++'
		break
if flag == 1:
	print('YES')
	for ara in list:
		print(ara)
else:
	print('NO')


n = int(input())
mas = []
pos = False
for i in range(n):
	x = input()
	if pos == False:
		if x[:2] == 'OO':
			pos = True
			x = '++' + x[2:]
			mas.append(x)
			continue
		elif x[3:] == 'OO':
			pos = True
			x = x[:3] + '++'
			mas.append(x)
		else:
			mas.append(x)
	else:
		mas.append(x)
if pos == False:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(mas[i])


n = int(input())
p = 0
myList = []
for i in range(n):
	c = list(input())
	if (c[0] == 'O' and c[1] == 'O' or (c[3] == 'O' and c[4] == 'O')) and p == 0:
		if c[3] == 'X' or c[4] == 'X':
			c[0] = '+'
			c[1] = '+'
			p = 1
		elif c[0] == 'X' or c[1] == 'X':
			c[3] = '+'
			c[4] = '+'
			p = 1
		else:
			c[0] = '+'
			c[1] = '+'
			p = 1
		myList.append(''.join(c))
	else:
		myList.append(''.join(c))
if p == 0:
	print('NO')
else:
	print('YES')
	print('\n'.join(myList))


from sys import stdin
input()
seats = ''.join(stdin.readlines())
flag = seats.find('OO') >= 0
print('YES' if flag else 'NO')
if flag:
	print(seats.replace('OO', '++', 1))


n = int(input())
str = ''
for i in range(n):
	str = str + input() + '\n'
	x = str.find('OO')
if 'OO' in str:
	print('YES')
	print(str[:x] + '++' + str[x + 2:])
else:
	print('NO')


import re
n = int(input())
a = []
founded = 0
for i in range(n):
	s = input()
	if founded == 0 and re.search('OO', s):
		s = re.sub('OO', '++', s, count=1)
		founded = 1
	a.append(s)
if founded:
	print('YES')
	for s in a:
		print(s)
else:
	print('NO')


import string
from sys import exit
t = int(input())
a = 0
v = []
while t > 0:
	s = input()
	p = 'OO'
	if a == 0:
		if p in s:
			s = s.replace('OO', '++', 1)
			a = 1
	v.append(s)
	t -= 1
if a == 0:
	print('NO')
	exit(0)
else:
	print('YES')
for i in range(len(v)):
	print(v[i])


c = 1
d = []
for i in range(int(input())):
	a = input()
	a = list(a)
	if a[:2] == ['O', 'O'] and c == 1:
		c = 0
		a[0] = '+'
		a[1] = '+'
		a = ''.join(a)
		d.append(a)
	elif a[3:] == ['O', 'O'] and c == 1:
		c = 0
		a[3] = '+'
		a[4] = '+'
		a = ''.join(a)
		d.append(a)
	else:
		a = ''.join(a)
		d.append(a)
if c == 0:
	print('YES')
	for i in d:
		print(i)
else:
	print('NO')


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest, nsmallest, _heapify_max, _heapreplace_max
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from fractions import Fraction
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
n = int(data())
result = False
mat = []
for i in range(n):
	arr = list(data())
	if not result:
		for j in range(4):
			if arr[j] == arr[j + 1] == 'O':
				(arr[j], arr[j + 1]) = ('+', '+')
				result = True
				break
	mat.append(arr)
if result:
	out('YES')
	for i in mat:
		out(''.join(i))
	exit()
out('NO')


n = int(input())
(two, one) = (list(), list())
(k, c) = (0, 0)
for i in range(n):
	one.append(input())
two = [i.split('|') for i in one]
one = [j for i in two for j in i]
for i in range(len(one)):
	if one[i] == 'OO' and c < 1:
		one[i] = '++'
		c += 1
if c:
	print('YES')
	while k <= len(one) - 2:
		print(one[k] + '|' + one[k + 1])
		k += 2
else:
	print('NO')


n = int(input())
k = False
A = [input() for i in range(n)]
for i in range(n):
	g = A[i].find('OO|OO')
	if g > -1:
		A[i] = A[i].replace('OO|OO', '++|OO')
		k = True
		break
	s = A[i].find('OO')
	if s > -1:
		A[i] = A[i].replace('OO', '++')
		k = True
		break
if k:
	print('YES')
	for i in A:
		print(i)
else:
	print('NO')


a = int(input())
b = []
c = 'NO'
for i in range(a):
	b.append(input())
	if b[-1][:2] == 'OO' and c == 'NO':
		c = 'YES'
		b[-1] = '++|' + b[-1][3:]
	if b[-1][3:] == 'OO' and c == 'NO':
		c = 'YES'
		b[-1] = b[-1][:2] + '|++'
print(c)
if c == 'YES':
	for i in range(a):
		print(b[i])


x = int(input())
free_seats = 0
bus = []
for _ in range(x):
	y = input()
	if free_seats == 0 and y.find('OO') != -1:
		y = y.replace('OO', '++', 1)
		free_seats = 1
	bus.append(y)
print(['NO', 'YES'][free_seats])
if free_seats == 1:
	print('\n'.join(bus))


n = int(input())
data = ''
F = False
for i in range(n):
	if not F:
		s = input()
		if 'OO|OO' in s:
			s = s.replace('OO|OO', '++|OO')
			F = True
		elif 'OO|' in s:
			s = s.replace('OO|', '++|')
			F = True
		elif '|OO' in s:
			s = s.replace('|OO', '|++', 1)
			F = True
		data += s + '\n'
		continue
	if F:
		s = input()
		data += s + '\n'
if F:
	print('YES')
	print(data)
else:
	print('NO')


n = int(input())
count = 0
arr = []
for i in range(n):
	a = input()
	if 'OO' in a:
		count = count + 1
	if count == 1:
		if 'OO|OO' in a:
			a = '++|OO'
		else:
			a = a.replace('OO', '++')
	arr.append(a)
if count >= 1:
	print('YES')
	for i in range(n):
		print(arr[i])
else:
	print('NO')


n = int(input())
a = 'NO'
s = ''
while n > 0:
	l = input()
	if a != 'YES':
		if l[0] == 'O' and l[1] == 'O':
			a = 'YES'
			s = s + '++' + l[2:] + '\n'
		elif l[3] == 'O' and l[4] == 'O':
			a = 'YES'
			s = s + l[0:3] + '++' + '\n'
		else:
			s = s + l[:] + '\n'
	else:
		s = s + l[:] + '\n'
	n -= 1
print(a)
if a == 'YES':
	print(s)


n = int(input())
i = 0
ss = []
while i < n:
	s = input()
	ss.append(s)
	if s[:2] == 'OO':
		ss[i] = '++|' + s[3:]
		break
	elif s[3:] == 'OO':
		ss[i] = s[:2] + '|++'
		break
	i += 1
if i == n:
	print('NO')
else:
	print('YES')
	for s in ss:
		print(s)
while i < n - 1:
	print(input())
	i += 1


n = int(input(''))
L = []
j = 0
mensaje = 'NO'
for k in range(n):
	(a, b) = input().split('|')
	L.append([a, b])
while j < n:
	if L[j][0] == 'OO':
		L[j][0] = '++'
		mensaje = 'YES'
		break
	elif L[j][1] == 'OO':
		L[j][1] = '++'
		mensaje = 'YES'
		break
	j += 1
print(mensaje)
if mensaje != 'NO':
	for k in L:
		print(k[0] + '|' + k[1])


s = []
answ = 0
n = int(input())
for i in range(n):
	s = s + list(input().split('/n'))
for i in range(n):
	if s[i][0] == 'O' and s[i][1] == 'O':
		answ = 1
		s[i] = '++' + s[i][2:]
		break
	if s[i][3] == 'O' and s[i][4] == 'O':
		answ = 1
		s[i] = s[i][:3] + '++'
		break
if answ == 1:
	print('YES')
	for i in range(n):
		print(s[i], end='\n')
else:
	print('NO')


l = []
for i in range(int(input())):
	s = input()
	l.append(s)
c = 0
for i in range(len(l)):
	if l[i][0] == l[i][1] == 'O':
		c = 1
		l[i] = '++' + l[i][2:]
		break
	elif l[i][3] == l[i][4] == 'O':
		c = 1
		l[i] = l[i][:3] + '++'
		break
if c == 0:
	print('NO')
else:
	print('YES')
	for i in l:
		print(i)


t = int(input())
arr = []
for i in range(t):
	arr.append(input())
for j in range(t):
	if arr[j][0:2] == 'OO':
		arr[j] = '++' + arr[j][2:]
		break
	elif arr[j][3:5] == 'OO':
		arr[j] = arr[j][0:3] + '++'
		break
else:
	print('NO')
	exit(0)
print('YES')
for k in arr:
	print(k)


n = int(input())
t = []
for i in range(n):
	s = input()
	t.append(list(s))
ok = 0
for x in t:
	if ok == 0:
		if x[0] == 'O' and x[1] == 'O':
			x[0] = '+'
			x[1] = '+'
			ok = 1
		elif x[3] == 'O' and x[4] == 'O':
			x[3] = '+'
			x[4] = '+'
			ok = 1
if ok == 0:
	print('NO')
	exit(0)
print('YES')
for x in t:
	print(''.join(x))


a = []
for i in range(int(input())):
	a.append(list(input()))
t = 0
for j in a:
	if j[0] == 'O' and j[1] == 'O':
		j[0] = '+'
		j[1] = '+'
		t += 1
		break
	elif j[3] == 'O' and j[4] == 'O':
		j[3] = '+'
		j[4] = '+'
		t += 1
		break
if t > 0:
	print('YES')
	for k in a:
		print(''.join(k))
else:
	print('NO')


a = [input() for i in range(int(input()))]
for (i, ai) in enumerate(a):
	if 'OO' in ai:
		a[i] = ai.replace('OO', '++', 1)
		print('YES')
		print('\n'.join(a))
		exit()
print('NO')


n = int(input())
bus = []
b = False
for i in range(n):
	bus.append(input().split('|'))
for (i, j) in enumerate(bus):
	if j[0] == 'OO':
		bus[i][0] = '++'
		b = True
		break
	elif j[1] == 'OO':
		bus[i][1] = '++'
		b = True
		break
if b:
	print('YES')
	for i in bus:
		print('|'.join(i))
else:
	print('NO')


n = int(input())
a = []
for _ in range(n):
	a.append(list(input()))
flag = 0
for i in range(n):
	for j in range(1, 5):
		if a[i][j] == 'O' and a[i][j - 1] == 'O':
			a[i][j] = '+'
			a[i][j - 1] = '+'
			flag = 1
			break
	if flag:
		break
if flag:
	print('YES')
	for i in range(n):
		print(''.join((str(x) for x in a[i])))
else:
	print('NO')


n = int(input())
seats = []
found = 0
for i in range(0, n):
	s = input()
	l = s.split('|')
	if l[0] == 'OO' and found == 0:
		l[0] = '++'
		found = 1
	elif l[1] == 'OO' and found == 0:
		l[1] = '++'
		found = 1
	s = '|'.join(l)
	seats.append(s)
if found == 1:
	print('YES')
	for i in range(0, n):
		print(seats[i])
else:
	print('NO')


num = int(input())
s = []
flag = 0
for i in range(num):
	s.append(input())
for i in range(num):
	temp = list(s[i])
	for j in range(4):
		if temp[j] == 'O' and temp[j + 1] == 'O':
			flag = 1
			temp[j] = '+'
			temp[j + 1] = '+'
			break
	s[i] = ''.join(temp)
	if flag == 1:
		break
if flag == 1:
	print('YES')
	for i in range(num):
		print(s[i])
else:
	print('NO')


n = int(input())
data = [input() for i in range(n)]
found = False
for i in range(n):
	if data[i][0:2] == 'OO':
		data[i] = '++' + data[i][2:]
		found = True
		break
	if data[i][3:5] == 'OO':
		data[i] = data[i][:3] + '++'
		found = True
		break
if found:
	print('YES')
	for s in data:
		print(s)
else:
	print('NO')


n = int(input())
v = []
ok = True
for i in range(n):
	m = input()
	x = list(m)
	if ok and x[0] == 'O' and (x[1] == 'O'):
		ok = False
		a = '++|' + x[3] + x[4]
		v.append(a)
	elif ok and x[3] == 'O' and (x[4] == 'O'):
		ok = False
		a = x[0] + x[1] + '|++'
		v.append(a)
	else:
		v.append(m)
if not ok:
	print('YES')
	for i in range(n):
		print(v[i])
else:
	print('NO')


(s, c) = ('', '')
for i in range(int(input())):
	s += input()
s = s.replace('|', '')
(i, t) = (0, 0)
while i < len(s) - 1:
	if s[i:i + 2] == 'OO':
		t = 1
		c += s[:i] + '++' + s[i + 2:]
		break
	i += 2
if t:
	print('YES')
	i = 0
	while i <= len(c) - 1:
		print(c[i:i + 2] + '|' + c[i + 2:i + 4])
		i = i + 4
else:
	print('NO')


n = int(input())
s = 0
w = []
for i in range(n):
	a = input().rjust(n).lstrip()
	if a[0] == 'O' and a[1] == 'O' or (a[-1] == 'O' and a[-2] == 'O'):
		if a[0] == 'O' and a[1] == 'O' and (s == 0):
			a = '++' + a[2:]
			s = s + 1
		elif a[-1] == 'O' and a[-2] == 'O' and (s == 0):
			a = a[:3] + '++'
			s = s + 1
	w.append(a)
if s > 0:
	print('YES')
	for i in range(n):
		print(w[i])
else:
	print('NO')


n = int(input())
seats = []
flag = 0
for i in range(n):
	situation = input()
	if flag == 0 and situation.find('OO') != -1:
		flag = 1
		place = situation.find('OO')
		if place == 0:
			situation = '++' + situation[2:]
		else:
			situation = situation[:3] + '++'
	seats.append(situation)
if flag == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(seats[i])


n = int(input())
ip = []
op = []
for i in range(n):
	line = input()
	line1 = line.split('|')
	ip.append(line1)
s = 0
for i in range(n):
	if ip[i][0] == 'OO':
		ip[i][0] = '++'
		s += 1
		for k in range(n):
			op.append(ip[k][0] + '|' + ip[k][1])
		break
	elif ip[i][1] == 'OO':
		ip[i][1] = '++'
		s += 1
		for j in range(n):
			op.append(ip[j][0] + '|' + ip[j][1])
		break
if s == 0:
	print('NO')
else:
	print('YES')
	for i in op:
		print(i)


c = []
for i in range(int(input())):
	c += input().split('|')
try:
	c[c.index('OO')] = '++'
	print('YES')
	for i in range(0, len(c), 2):
		print(c[i] + '|' + c[i + 1])
except:
	print('NO')


n = int(input())
seat_find = []
answer = 'NO'
for count in range(n):
	seat_config = input().split('|')
	seat_find.append(seat_config)
for find in seat_find:
	if 'OO' in find:
		answer = 'YES'
		change = find.index('OO')
		find[change] = '++'
		break
print(answer)
if answer == 'YES':
	for printing in seat_find:
		print('|'.join(printing))


bus = list()
possible = False
for i in range(int(input())):
	bus.append(input())
	if bus[i].count('OO') > 0:
		possible = True
if possible:
	print('YES')
	assigned = False
	for e in bus:
		if assigned:
			print(e)
		elif e[0] == 'O' and e[1] == 'O':
			assigned = True
			print('++' + e[2:])
		elif e[3] == 'O' and e[4] == 'O':
			assigned = True
			print(e[:3] + '++')
		else:
			print(e)
else:
	print('NO')


n = int(input())
flag = 0
res = []
for _ in range(n):
	s = list(input())
	hallway = s.index('|')
	if len(set(s[0:hallway])) == 1 and flag == 0 and (s[0] == 'O'):
		s[0] = '+'
		s[1] = '+'
		flag = 1
	elif len(set(s[hallway + 1:])) == 1 and flag == 0 and (s[3] == 'O'):
		s[3] = '+'
		s[4] = '+'
		flag = 1
	res.append(s)
if flag == 1:
	print('YES')
	for i in res:
		print(''.join(i))
else:
	print('NO')


n = int(input())
flag = 0
l = []
for i in range(n):
	s = str(input())
	s = list(s)
	e = ''
	for j in range(0, len(s) - 1):
		if s[j] == s[j + 1] == 'O' and flag == 0:
			flag = 1
			s[j] = '+'
			s[j + 1] = '+'
	e = e.join(s)
	l.append(e)
if flag == 0:
	print('NO')
else:
	print('YES')
	for j in range(0, len(l)):
		print(l[j])


flag = False
bus = []
for i in range(int(input())):
	row = input()
	if not flag:
		if row[0] == 'O' and row[1] == 'O':
			flag = True
			row = '++|' + row[3] + row[4]
		elif row[3] == 'O' and row[4] == 'O':
			flag = True
			row = row[0] + row[1] + '|++'
	bus.append(row)
if flag:
	print('YES')
	for row in bus:
		print(row)
else:
	print('NO')


n = int(input())
s = []
mishe = False
for i in range(n):
	p = input()
	for j in range(4):
		if (p[j] == 'O' and p[j + 1] == 'O') and mishe == False:
			mishe = True
			p = p[:j] + '++' + p[j + 2:]
	s.append(p)
if mishe:
	print('YES')
	for i in range(n):
		print(s[i])
else:
	print('NO')


rows = int(input())
R = []
free = False
for _ in range(rows):
	row = input()
	R.append(row)
	if 'OO' in row:
		free = True
print('YES' if free else 'NO')
if free:
	for row in R:
		if row.find('OO') != -1 and free is True:
			i = row.find('OO')
			print(row[:i] + '++' + row[i + 2:])
			free = False
		else:
			print(row)


n = int(input())
duduk = []
hasil = 'NO'
cek = 0
for i in range(n):
	seat = input()
	if cek == 0:
		if seat[0] == 'O' and seat[1] == 'O':
			hasil = 'YES'
			cek = 1
			seat = '++' + seat[2:]
		elif seat[3] == 'O' and seat[4] == 'O':
			hasil = 'YES'
			cek = 1
			seat = seat[:3] + '++'
	duduk += [seat]
print(hasil)
if hasil == 'YES':
	for i in duduk:
		print(i)


n = int(input())
b = [input() for i in range(n)]
(flag, m, c) = (0, 0, 0)
for i in b:
	s = list(i)
	m += 1
	for j in range(len(s) - 1):
		if s[j] == 'O' and s[j + 1] == 'O':
			s[j] = '+'
			s[j + 1] = '+'
			flag = 1
			A = ''.join(s)
			print('YES')
			for i in b:
				c += 1
				if c == m:
					print(A)
				else:
					print(i)
			break
	if flag == 1:
		break
if flag == 0:
	print('NO')


n = int(input())
l = []
for i in range(n):
	l.append(list(input()))
for i in range(n):
	if l[i][0] == 'O' and l[i][1] == 'O' or (l[i][3] == 'O' and l[i][4] == 'O'):
		print('YES')
		for j in range(n):
			if i == j and l[i][0] == 'O' and (l[i][1] == 'O'):
				print('++' + l[i][2] + l[i][3] + l[i][4])
			elif i == j and l[i][3] == 'O' and (l[i][4] == 'O'):
				print(l[i][0] + l[i][1] + l[i][2] + '++')
			else:
				for k in range(5):
					print(l[j][k], end='')
				print()
		break
else:
	print('NO')


import sys
n = int(input())
mes = []
for i in range(n):
	mes_d = list(input())
	mes.extend(mes_d)
i = 0
while i < n * 5:
	if mes[i] == 'O' and mes[i + 1] == 'O':
		mes.pop(i)
		mes.insert(i, '+')
		mes.pop(i + 1)
		mes.insert(i + 1, '+')
		print('YES')
		i = 0
		while i < n * 5:
			print(mes[i] + mes[i + 1] + mes[i + 2] + mes[i + 3] + mes[i + 4])
			i += 5
		sys.exit()
	if mes[i + 3] == 'O' and mes[i + 4] == 'O':
		mes.pop(i + 3)
		mes.insert(i + 3, '+')
		mes.pop(i + 4)
		mes.insert(i + 4, '+')
		print('YES')
		i = 0
		while i < n * 5:
			print(mes[i] + mes[i + 1] + mes[i + 2] + mes[i + 3] + mes[i + 4])
			i += 5
		sys.exit()
	i += 5
print('NO')


a = int(input())
encontrado = False
b = list()
for i in range(a):
	c = input()
	if not encontrado and 'OO' in c:
		encontrado = True
		if c[:2] == 'OO':
			c = '++' + c[2:]
		else:
			c = c[:3] + '++'
	b.append(c)
if encontrado:
	print('YES')
	for i in range(a):
		print(b[i])
else:
	print('NO')


n = int(input())
a = []
k = 0
while len(a) < n:
	d = input()
	a.append(d)
c = []
for i in range(n):
	b = list(a[i])
	if k == 0:
		if b[3] == 'O' and b[4] == 'O':
			b[3] = '+'
			b[4] = '+'
			k = k + 1
		elif b[0] == 'O' and b[1] == 'O':
			b[0] = '+'
			b[1] = '+'
			k = k + 1
	c.append(b)
if k == 0:
	print('NO')
else:
	print('YES')
	for i in c:
		print(''.join(i))


n = int(input())
a = []
ket = 'NO'
for i in range(n):
	s = input()
	a += [s]
for i in range(len(a)):
	for j in range(len(a[i])):
		if a[i][0] == 'O' and a[i][1] == 'O':
			ket = 'YES'
			a[i] = '++|' + a[i][3] + a[i][4]
			break
		if a[i][3] == 'O' and a[i][4] == 'O':
			ket = 'YES'
			a[i] = a[i][0] + a[i][1] + '|++'
			break
	if ket == 'YES':
		break
print(ket)
if ket == 'YES':
	for i in range(len(a)):
		print(a[i])


free = 'OO'
book = '++'
aisle = '|'
bus = []

def solve(n):
	ans = 'NO'
	for i in range(0, n):
		sides = bus[i].split(aisle)
		if sides[0] == free:
			bus[i] = book + aisle + sides[1]
			ans = 'YES'
			break
		elif sides[1] == free:
			bus[i] = sides[0] + aisle + book
			ans = 'YES'
			break
	return ans
n = int(input())
for i in range(0, n):
	bus.append(input())
ans = solve(n)
print(ans)
if ans == 'YES':
	for i in range(0, n):
		print(bus[i])


s = int(input())
result = 'NO'
r = []
t = 1
g = ''
for i in range(s):
	g = input()
	if t == 1:
		g = g.replace('OO', '++', 1)
		if g.find('++') != -1:
			t = 2
			result = 'YES'
	r.append(g)
if result == 'NO':
	print(result)
else:
	print(result)
	for i in range(s):
		print(r[i])


n = int(input())
k = []
s1 = ''
s2 = ''
c = 0
for i in range(n):
	(s1, s2) = map(str, input().split('|'))
	if s1 == 'OO' and c == 0:
		k.append('++' + '|' + s2)
		c += 1
	elif s2 == 'OO' and c == 0:
		k.append(s1 + '|' + '++')
		c += 1
	else:
		k.append(s1 + '|' + s2)
if c >= 1:
	print('YES')
	for i in range(len(k)):
		print(k[i])
else:
	print('NO')


n = int(input())
a = []
for i in range(n):
	a.append(input())
present = False
for i in range(len(a)):
	if not a[i].count('OO') == 0:
		a[i] = a[i].replace('OO', '++', 1)
		present = True
		break
if present == True:
	print('YES')
	for s in a:
		print(s)
else:
	print('NO')


t = int(input())
m = []
for i in range(t):
	s = input()
	s = list(s)
	m.append(s)
a = 0
b = 0
ans = 0
for i in range(0, t):
	for j in range(4):
		if m[i][j] == 'O' and m[i][j + 1] == 'O':
			ans = 1
			a = i
			b = j
			break
m1 = m[:]
if ans == 1:
	print('YES')
	m1[a][b] = '+'
	m1[a][b + 1] = '+'
	for i in range(t):
		for j in range(len(m1[i])):
			print(m[i][j], end='')
		print('\n')
else:
	print('NO')


n = int(input())
k = [input() for i in range(n)]
for (j, s) in enumerate(k):
	if 'OO' in s:
		k[j] = s.replace('OO', '++', 1)
		print('YES')
		print(*k, sep='\n')
		break
else:
	print('NO')


inp = int(input())
res = []
flag = 0
for i in range(inp):
	stroke = input()
	stroke = stroke.split('|')
	if (stroke[0] == 'OO') & (flag == 0):
		stroke[0] = '++'
		flag = 1
	elif (stroke[1] == 'OO') & (flag == 0):
		stroke[1] = '++'
		flag = 1
	res.append(stroke[0] + '|' + stroke[1])
if flag == 1:
	print('YES')
	for i in res:
		print(i)
else:
	print('NO')


n = int(input())
a = 2 * n * ['']
k = 1
for i in range(n):
	(a[2 * i], a[2 * i + 1]) = input().split('|')
for i in range(2 * n):
	if a[i] == 'OO':
		a[i] = '++'
		k = 0
		break
if k == 0:
	print('YES')
	for i in range(n):
		print(a[2 * i] + '|' + a[2 * i + 1])
else:
	print('NO')


n = int(input())
matrix = [input() for i in range(n)]
temp = 0
for (i, row) in enumerate(matrix):
	if 'OO' in row:
		temp = 1
		print('YES')
		matrix[i] = matrix[i].replace('OO', '++', 1)
		break
if temp == 0:
	print('NO')
else:
	for row in matrix:
		print(row)


def checkFreePair(arr):
	for i in arr:
		c = i.split('|')
		if c[0] == 'OO':
			return True
		elif c[1] == 'OO':
			return True

def occupyPair(arr):
	newArr = []
	doneOccupy = False
	for i in arr:
		if doneOccupy:
			newArr.append(i)
			continue
		c = i.split('|')
		if c[0] == 'OO':
			newArr.append('++|' + c[1])
			doneOccupy = True
		elif c[1] == 'OO':
			newArr.append(c[0] + '|++')
			doneOccupy = True
		else:
			newArr.append(i)
	return newArr
r = [input() for x in range(int(input()))]
if checkFreePair(r):
	print('YES')
	for i in occupyPair(r):
		print(i)
else:
	print('NO')


n = int(input())
count = 0
my_list = []
for i in range(n):
	i = input()
	if count == 0:
		if i == 'OO|OO':
			i = '++|OO'
			count += 1
		elif i == 'OO|XX' or i == 'OO|OX' or i == 'XO|OO' or (i == 'XX|OO') or (i == 'OX|OO') or (i == 'OO|XO'):
			i = i.replace('OO', '++')
			count += 1
	my_list.append(i)
if count > 0:
	print('YES')
	for v in my_list:
		print(v)
else:
	print('NO')


n = int(input())
bs = []
for i in range(0, n):
	s = input()
	bs.append(s)
ans = []
x = 'NO'
i = 0
f = 0
while i < n and f == 0:
	bl = list(bs[i])
	if bs[i][0] == 'O' and bs[i][1] == 'O':
		bl[0] = '+'
		bl[1] = '+'
		f = 1
	elif bs[i][3] == 'O' and bs[i][4] == 'O':
		bl[3] = '+'
		bl[4] = '+'
		f = 1
	if f == 1:
		bs[i] = ''.join(bl)
	i += 1
if f == 0:
	print('NO')
else:
	print('YES')
	for i in range(0, n):
		print(bs[i])


n = int(input())
ans = ''
arr = []
for _ in range(n):
	x = input()
	arr.append(x)
	if 'OO' in x and ans == '':
		ans = _
if ans != '':
	print('YES')
	for i in range(n):
		if i == ans:
			if arr[i][0] + arr[i][1] == 'OO':
				print('++' + arr[i][2:])
			else:
				print(arr[i][:3] + '++')
		else:
			print(arr[i])
else:
	print('NO')


n = int(input())
l = []
for i in range(n):
	(a, b) = input().split('|')
	l.append(a)
	l.append(b)
if 'OO' in l:
	print('YES')
	count = 0
	for i in range(2 * n):
		if i % 2 == 1:
			if l[i] == 'OO' and count == 0:
				print('++')
				count += 1
			else:
				print(l[i])
		elif l[i] == 'OO' and count == 0:
			print('++', end='|')
			count += 1
		else:
			print(l[i], end='|')
else:
	print('NO')


n = int(input())
a = []
flag = False
for i in range(n):
	k = input().strip()
	a.append(k)
for i in range(len(a)):
	if a[i].find('OO') != -1:
		a[i] = a[i].replace('OO', '++', 1)
		flag = True
		break
if flag:
	print('YES')
	for i in a:
		print(i)
else:
	print('NO')


t = int(input())
check = 1
l = []
for _ in range(t):
	a = input()
	if check:
		for i in range(4):
			if a[i] == a[i + 1] == 'O':
				b = i == 3
				if b:
					b = ''
				else:
					b = a[i + 2:]
				a = a[:i] + '++' + b
				check = 0
				break
	l.append(a)
if not check:
	print('YES')
	print('\n'.join(l))
else:
	print('NO')


I = False
ListofRows = []
for i in range(int(input())):
	X = input()
	if 'OO' in X and I == False:
		if X.count('OO') == 1:
			ListofRows.append(X.replace('OO', '++'))
			I = True
		elif X[:X.find('|')] == 'OO':
			ListofRows.append('++' + X[X.find('|'):])
			I = True
		elif X[X.find('|') + 1:] == 'OO':
			ListofRows.append(X[:X.find('|')] + '++')
			I = True
	else:
		ListofRows.append(X)
if I:
	print('YES')
	for i in ListofRows:
		print(i)
else:
	print('NO')


n = int(input())
pair = 'NO'
rows = []
for i in range(n):
	s = input()
	if pair == 'NO':
		p = s.find('OO')
		if p == 0:
			s = '++' + s[2:]
			pair = 'YES'
		elif p == 3:
			s = s[:3] + '++'
			pair = 'YES'
	rows.append(s)
print(pair)
if pair == 'YES':
	for i in rows:
		print(i)


lines = int(input())
rows = []
for i in range(lines):
	rows.append(input().split('|'))
boolean = False
for i in range(len(rows)):
	for k in range(len(rows[i])):
		if rows[i][k] == 'OO':
			boolean = True
			print('YES')
			rows[i][k] = '++'
			for j in range(len(rows)):
				print(rows[j][0] + '|' + rows[j][1])
			break
	if boolean:
		break
if not boolean:
	print('NO')


n = int(input())
s = ''
for i in range(n):
	s = s + input() + '\n'
if 'OO' not in s:
	print('NO')
else:
	print('YES')
	i = s.index('OO')
	print(s[:i] + '++' + s[i + 2:])


n = int(input())
l = []
for i in range(n):
	s = input().rstrip().lstrip()
	l.append(s)
for i in range(n):
	s = l[i]
	ind = s.find('OO')
	if ind != -1:
		s = list(s)
		s[ind] = '+'
		s[ind + 1] = '+'
		l[i] = ''.join(s)
		print('YES')
		print('\n'.join(l))
		return
print('NO')


import sys
n = int(input())
rows = [0] * n
replace = False
for x in range(n):
	(a, b) = input().split('|')
	if a == 'OO' and replace == False:
		a = '++'
		replace = True
	elif b == 'OO' and replace == False:
		b = '++'
		replace = True
	rows[x] = str(a) + str('|') + str(b)
if replace == False:
	print('NO')
	sys.exit()
else:
	print('YES')
for x in rows:
	print(x)


N = int(input(''))
A = []
Res = 'NO'
Yala = 0
for K in range(N):
	X = input('')
	AUX = []
	for Letra in X:
		AUX = AUX + [Letra]
	if (AUX[0] == 'O' and AUX[1] == 'O') and Yala == 0:
		AUX[0] = '+'
		AUX[1] = '+'
		Xp = ''
		for I in range(len(AUX)):
			Xp = Xp + AUX[I]
		Res = 'YES'
		A = A + [Xp]
		Yala = 1
	elif (AUX[3] == 'O' and AUX[4] == 'O') and Yala == 0:
		AUX[3] = '+'
		AUX[4] = '+'
		Xp = ''
		for I in range(len(AUX)):
			Xp = Xp + AUX[I]
		Res = 'YES'
		A = A + [Xp]
		Yala = 1
	else:
		A = A + [X]
if Res == 'YES':
	print(Res)
	for J in range(len(A)):
		print(A[J])
else:
	print('NO')


n = int(input())
S = [str(input()) for _ in range(n)]
ok = -1
r = -1
for i in range(n):
	if S[i][0] == 'O' and S[i][1] == 'O':
		ok = 1
		r = i
		break
	elif S[i][3] == 'O' and S[i][4] == 'O':
		ok = 2
		r = i
		break
if r == -1:
	print('NO')
else:
	print('YES')
	for i in range(n):
		if r == i:
			if ok == 1:
				print('++|' + S[i][3] + S[i][4])
			else:
				print(S[i][0] + S[i][1] + '|++')
		else:
			print(S[i])


n = int(input())
state = False
ans = ''
for _ in range(n):
	row = input()
	if row[:2] == 'OO' and (not state):
		ans += '++'
		state = True
	else:
		ans += row[:2]
	ans += '|'
	if row[-2:] == 'OO' and (not state):
		ans += '++'
		state = True
	else:
		ans += row[-2:]
	ans += '\n'
if '+' in ans:
	print('YES')
	print(ans)
else:
	print('NO')


from sys import stdin
n = int(input())
arr = []
for i in range(n):
	arr.append(input())
for i in range(len(arr)):
	if 'OO' in arr[i]:
		arr[i] = arr[i][:arr[i].index('OO')] + '++' + arr[i][arr[i].index('OO') + 2:]
		print('YES')
		for i in arr:
			print(i)
		break
else:
	print('NO')


n = int(input())
rows = list()
seated = False
for i in range(n):
	row = input()
	if not seated:
		if 'OO' == row[:2]:
			rows.append('++' + row[2:])
			seated = True
		elif 'OO' == row[3:]:
			rows.append(row[:3] + '++')
			seated = True
		else:
			rows.append(row)
	else:
		rows.append(row)
if seated:
	print('YES')
	for i in rows:
		print(i)
else:
	print('NO')


n = int(input())
r = -1
c = -1
res = []
for i in range(n):
	s = list(input())
	for j in range(2):
		ss = s[3 * j:3 * j + 2]
		if r < 0 and ss[0] == 'O' and (ss[1] == 'O'):
			r = i
			c = 3 * j
			s[3 * j] = '+'
			s[3 * j + 1] = '+'
	res.append(s)
if r < 0:
	print('NO')
	exit(0)
print('YES')
for e in res:
	print(''.join(map(str, e)))


n = int(input())
s = []
for _ in range(n):
	s.append(list(input()))
a = False
for i in s:
	if i[0] == i[1] == 'O':
		i[0] = i[1] = '+'
		a = True
		break
	if i[3] == i[4] == 'O':
		i[3] = i[4] = '+'
		a = True
		break
if a:
	s = [''.join(i) for i in s]
	print('YES', *s, sep='\n')
else:
	print('NO')


n = int(input())
l = []
x = 0
for i in range(n):
	l.append(input())
for i in range(n):
	if 'OO' in l[i]:
		y = l[i].index('OO')
		l[i] = l[i][:y] + '++' + l[i][y + 2:]
		x += 1
		break
if x == 1:
	print('YES')
	print(*l, sep='\n')
else:
	print('NO')


import sys
import bisect
n = int(input())
rows = []
for i in range(n):
	s = input()
	ml = []
	for j in s:
		ml.append(j)
	rows.append(ml)
check = 0
for i in rows:
	if i[0] == 'O' and i[1] == 'O':
		check = 1
		i[0] = '+'
		i[1] = '+'
		break
	if i[3] == 'O' and i[4] == 'O':
		check = 1
		i[3] = '+'
		i[4] = '+'
		break
if check:
	print('YES')
	for i in rows:
		for j in i:
			print(j, end='')
		print()
else:
	print('NO')


def main():
	n = int(input())
	have_empty_pair = False
	result = ''
	for i in range(n):
		s = input()
		if not have_empty_pair and s[:2] == 'OO':
			have_empty_pair = True
			s = '++' + s[2:]
		elif not have_empty_pair and s[3:] == 'OO':
			have_empty_pair = True
			s = s[:3] + '++'
		result += s + '\n'
	if have_empty_pair:
		print('YES')
		print(result)
	else:
		print('NO')
main()


n = int(input())
flag = False
ans = []
for i in range(n):
	s = input()
	if flag:
		ans.append(s)
		continue
	if s[0] == 'O' and s[1] == 'O':
		ans.append('++' + s[2:])
		flag = True
	elif s[3] == 'O' and s[4] == 'O':
		ans.append(s[:3] + '++')
		flag = True
	else:
		ans.append(s)
if flag:
	print('YES')
	for i in ans:
		print(i)
else:
	print('NO')


import math
import string
n = int(input())
flag = False
ss = []
for i in range(0, n):
	s = str(input())
	if s[0] == 'O' and s[1] == 'O':
		if flag == False:
			s = s.replace('O', '+', 2)
			flag = True
	elif s[3] == 'O' and s[4] == 'O':
		if flag == False:
			s1 = list(s)
			s1[3] = '+'
			s1[4] = '+'
			s = ''.join(s1)
			flag = True
	ss.append(s)
if flag == True:
	print('YES')
	for i in range(0, n):
		print(ss[i])
else:
	print('NO')


n_rows = int(input())
data = [input() for i in range(n_rows)]
flag = 1
for (i, row) in enumerate(data):
	if 'OO|' in row:
		data[i] = data[i].replace('OO|', '++|')
		break
	elif '|OO' in row:
		data[i] = data[i].replace('|OO', '|++')
		break
else:
	flag = 0
	print('NO')
if flag:
	print('YES')
	print('\n'.join(data))


rows = int(input())
bus = []
output = False
for i in range(rows):
	bus.append(input())
for row in bus:
	if row[:2] == 'OO':
		bus[bus.index(row)] = '++' + row[2:]
		output = True
		break
	elif row[3:] == 'OO':
		bus[bus.index(row)] = row[:3] + '++'
		output = True
		break
if output:
	print('YES')
	for n in bus:
		print(n)
else:
	print('NO')


s = input()
t = []
for i in range(int(s)):
	t += [list(input())]
b = False
for i in range(len(t)):
	for j in range(1, len(t[i])):
		if t[i][j] == t[i][j - 1] and t[i][j] == 'O':
			t[i][j] = '+'
			t[i][j - 1] = '+'
			b = True
			break
	if b:
		break
l = ''
for i in t:
	l += ''.join(map(str, i)) + '\n'
if b:
	print('YES')
	print(l)
else:
	print('NO')


import math
import os
import random
import re
import sys

def solve(n, matrix):
	aisle = '|'
	buddy_seats = 'OO'
	result = 'NO'
	for (row_index, row) in enumerate(matrix):
		for (col_index, col) in enumerate(row):
			pair = col.split(aisle)
			for (seat_index, seat) in enumerate(pair):
				if seat == buddy_seats:
					matrix[row_index][col_index] = matrix[row_index][col_index].replace('OO', '++', 1)
					result = 'YES'
					return result
	return result

def print_seating_chart(matrix):
	for row in matrix:
		for col in row:
			print(col)
n = int(input())
matrix = []
for index in range(n):
	matrix.append(list(map(str, input().split())))
result = solve(n, matrix)
print(result)
if result == 'YES':
	print_seating_chart(matrix)


n = int(input())
all_seats = []
count = 0
for i in range(n):
	(s1, s2, w, s3, s4) = input()
	all_seats.append([s1, s2, w, s3, s4])
for x in all_seats:
	if x[0] == x[1] == 'O':
		x[0] = '+'
		x[1] = '+'
		count += 1
		break
	elif x[3] == x[4] == 'O':
		(x[3], x[4]) = ('+', '+')
		count += 1
		break
if count > 0:
	print('YES')
	for x in all_seats:
		print(''.join(x))
else:
	print('NO')


n = int(input())
seats = []
for item in range(n):
	seats.append(input().split('|'))
flag = False
for i in range(n):
	if seats[i][0] == 'OO':
		seats[i][0] = '++'
		flag = True
		break
	if seats[i][1] == 'OO':
		seats[i][1] = '++'
		flag = True
		break
if flag:
	print('YES')
	for i in range(n):
		print(seats[i][0] + '|' + seats[i][1])
else:
	print('NO')


def Main():
	n = int(input())
	seat = 0
	rows = []
	for i in range(n):
		row = list(input())
		if seat == 0:
			if row[0] == 'O' and row[1] == 'O':
				row[0] = '+'
				row[1] = '+'
				seat = 1
			elif row[3] == 'O' and row[4] == 'O':
				row[3] = '+'
				row[4] = '+'
				seat = 1
		rows.append(''.join(row))
	if seat == 0:
		print('NO')
	else:
		print('YES')
		for i in range(len(rows)):
			print(rows[i])
Main()


inp = []
n = int(input())
done = False
for _ in range(n):
	(l, r) = input().split('|')
	if not done:
		if l == 'OO':
			l = '++'
			done = True
		elif r == 'OO':
			r = '++'
			done = True
	inp.append((l, r))
if done:
	print('YES')
	for (l, r) in inp:
		print('|'.join((l, r)))
else:
	print('NO')


__author__ = 'artyom'

def main():
	n = read()
	s = []
	f = 0
	for _ in range(n):
		x = read(0)
		if f == 0:
			if x[:2] == 'OO':
				x = '++' + x[2:]
				f = 1
			elif x[3:] == 'OO':
				x = x[:3] + '++'
				f = 1
		s.append(x)
	if f == 1:
		s.insert(0, 'YES')
	else:
		s = 'NO'
	return s

def read(mode=1, size=None):
	if mode == 0:
		return input().strip()
	if mode == 1:
		return int(input().strip())
	if mode == 2:
		return input().strip().split()
	if mode == 3:
		return list(map(int, input().strip().split()))
	a = []
	for _ in range(size):
		a.append(read(3))
	return a

def write(s='\n'):
	if s is None:
		s = ''
	if isinstance(s, tuple) or isinstance(s, list):
		s = '\n'.join(map(str, s))
	s = str(s)
	print(s, end='\n')
res = main()
write(res)


x = int(input())
inList = []
for i in range(x):
	inList.append(list(input().split('|')))
out = ''
(a, b) = (None, None)
for j in range(x):
	if inList[j][0] == 'OO':
		out = 'YES'
		inList[j][0] = '++'
		break
	elif inList[j][1] == 'OO':
		out = 'YES'
		inList[j][1] = '++'
		break
if out:
	print(out)
	for k in inList:
		print(k[0] + '|' + k[1])
else:
	print('NO')


n = int(input())
flag = 'NO'
result = []
for i in range(n):
	row = input().split('|')
	if row[0] == 'OO' and flag == 'NO':
		row[0] = '++'
		flag = 'YES'
	if row[1] == 'OO' and flag == 'NO':
		row[1] = '++'
		flag = 'YES'
	result.append(row[0] + '|' + row[1])
print(flag)
if flag == 'YES':
	for i in result:
		for y in i:
			print(y, end='')
		print()


n = int(input())
s = []
c = 0
for i in range(0, n):
	s.append(input())
for i in range(0, n):
	if 'OO' in s[i]:
		l = s[i].split('|')
		if l[0] == 'OO':
			l[0] = '++'
		else:
			l[1] = '++'
		print('Yes')
		s[i] = l[0] + '|' + l[1]
		for i in range(0, n):
			print(s[i])
		c = 1
		break
if c == 0:
	print('No')


n = int(input())
l = list()
t = 0
z = []
for i in range(n):
	(m, s) = map(str, input().split('|'))
	if m == 'OO' and t == 0:
		print('YES')
		m = '++'
		t += 1
	elif s == 'OO' and t == 0:
		s = '++'
		print('YES')
		t += 1
	z.append(m + '|' + s)
if t == 0:
	print('NO')
else:
	for i in range(n):
		print(z[i])


n = int(input())
lst = []
for i in range(n):
	lst.append(input())
ans = 'NO'
for i in range(n):
	a = lst[i].split('|')
	if a[0] == 'OO':
		lst.pop(i)
		lst.insert(i, '++|' + a[1])
		ans = 'YES'
		break
	if a[1] == 'OO':
		lst.pop(i)
		lst.insert(i, a[0] + '|++')
		ans = 'YES'
		break
print(ans)
if ans == 'YES':
	for i in range(n):
		print(lst[i])


n = int(input())
ans = 'NO'
l = []
for f in range(n):
	l.append(input())
for f in range(n):
	h = l[f].find('OO')
	if h != -1:
		ans = 'YES'
		l[f] = l[f].replace('OO', '++', 1)
		break
if ans == 'NO':
	print('NO')
else:
	print(ans)
	for f in l:
		print(f)


n = int(input())
arr = []
seats = []
c = 0
for i in range(0, n):
	ar = input()
	arr.append(ar)
	if [ar[0], ar[1]].count('O') == 2 and c == 0:
		seats = [i, 0, 1]
		c += 1
	elif [ar[3], ar[4]].count('O') == 2 and c == 0:
		seats = [i, 3, 4]
		c += 1
if len(seats) == 0:
	print('NO')
else:
	print('YES')
	for i in range(0, n):
		if i == seats[0]:
			for j in range(0, 5):
				if j == seats[1]:
					print('+', end='')
				elif j == seats[2]:
					print('+', end='')
				else:
					print(arr[i][j], end='')
			print()
		else:
			print(arr[i][0], arr[i][1], arr[i][2], arr[i][3], arr[i][4], sep='')


import math
n = int(input())
a = []
for i in range(n):
	a.append(list(input()))
res = False
index = -1
for i in range(n):
	if a[i][0] == 'O' and a[i][1] == 'O' or (a[i][3] == 'O' and a[i][4] == 'O'):
		res = True
		index = i
		break
if res:
	print('YES')
	for i in range(n):
		if i == index:
			if a[i][0] == 'O' and a[i][1] == 'O':
				print('++|', end='')
				print(a[i][3], end='')
				print(a[i][4], end='')
			elif a[i][3] == 'O' and a[i][4] == 'O':
				print(a[i][0], end='')
				print(a[i][1], end='')
				print('|++', end='')
		else:
			print(a[i][0], end='')
			print(a[i][1], end='')
			print('|', end='')
			print(a[i][3], end='')
			print(a[i][4], end='')
		print()
else:
	print('NO')


n = int(input())
p = ''
for i in range(n):
	p += input() + ' '
index = p.find('OO')
if index == -1:
	print('NO')
elif index > -1:
	print('YES')
	q = p[:index] + '++' + p[index + 2:]
	q = q.split()
	print(*q, sep='\n')


n = int(input())
str_d = ''
for i in range(n):
	temp = input()
	str_d = str_d + temp + '|'
if str_d.count('OO') == 0:
	print('NO')
else:
	print('YES')
	str_d = str_d.replace('OO', '++', 1)
	for i in range(n):
		print(str_d[i * 5 + i:i * 5 + 5 + i])


r = 0
l = []
for i in range(int(input())):
	a = input()
	if r == 1:
		l.append(a)
	elif a[:2] == 'OO':
		l.append('++' + a[2:])
		r += 1
	elif a[3:] == 'OO':
		l.append(a[:3] + '++')
		r += 1
	else:
		l.append(a)
if r == 0:
	print('NO')
else:
	print('YES')
	for i in l:
		print(i)


import math
import sys
import string

def ri():
	return input()

def ii():
	return int(input())

def li():
	return input().split()

def mi():
	return list(map(int, input().split()))
n = ii()
s = []
f = 0
ans = []
for i in range(n):
	line = ri()
	if f == 0:
		if line[0:2] == 'OO':
			ans.append('++' + line[2:])
			f = 1
		elif line[3:] == 'OO':
			ans.append(line[0:3] + '++')
			f = 1
		else:
			ans.append(line)
	else:
		ans.append(line)
if f == 0:
	print('NO')
else:
	print('YES')
	for i in ans:
		print(i)


n = int(input())
rows = []
for i in range(n):
	rows += [input()]
for j in range(len(rows)):
	if rows[j][0] == 'O' and rows[j][1] == 'O':
		print('YES')
		rows[j] = '++' + rows[j][2:]
		print('\n'.join(rows))
		exit()
	elif rows[j][3] == 'O' and rows[j][4] == 'O':
		print('YES')
		rows[j] = rows[j][:3] + '++'
		print('\n'.join(rows))
		exit()
	else:
		continue
print('NO')


a = int(input())
b = []
k = False
for i in range(a):
	b.append(input())
for i in range(a):
	if 'OO' in b[i]:
		b[i] = b[i].replace('OO', '++', 1)
		k = True
		break
if k == True:
	print('YES')
	for i in range(a):
		print(b[i])
else:
	print('NO')


(n, found) = (int(input()), 0)
lst = [input() for _ in range(n)]
for i in range(n):
	if 'OO' in lst[i]:
		lst[i] = lst[i].replace('OO', '++', 1)
		found = 1
		print('YES')
		break
else:
	print('NO')
if found:
	print('\n'.join(lst))


n = int(input())
seats = []
for i in range(n):
	seats.append([str(x) for x in input()])
for j in range(0, n):
	if seats[j][0] == seats[j][1] == 'O':
		del seats[j][0]
		seats[j].insert(0, '+')
		del seats[j][1]
		seats[j].insert(1, '+')
		break
	if seats[j][3] == seats[j][4] == 'O':
		del seats[j][3]
		seats[j].insert(3, '+')
		del seats[j][4]
		seats[j].insert(4, '+')
		break
if j == n - 1 and '+' not in seats[-1]:
	print('NO')
else:
	print('YES')
	for k in range(0, n):
		print(''.join([str(i) for i in seats[k]]))


n = int(input())
seats = []
for i in range(0, n):
	seats.append(input().split('|'))
ans = 0
for i in range(0, n):
	if ans == 1:
		break
	if seats[i][0] == 'OO':
		(seats[i][0], ans) = ('++', 1)
	elif seats[i][1] == 'OO':
		(seats[i][1], ans) = ('++', 1)
if ans:
	print('YES')
	for x in seats:
		print(x[0], '|', x[1], sep='')
else:
	print('NO')


a = int(input())
b = []
c = 0
for i in range(a):
	b.append(input())
for i in range(a):
	if c == 0:
		for j in range(4):
			if b[i][j] == b[i][j + 1] == 'O':
				d = b[i].split('|')
				if j > 0:
					d[j - 2] = d[j - 2].replace('O', '+')
				else:
					d[j] = d[j].replace('O', '+')
				b[i] = '|'.join(d)
				c += 1
				break
if c == 0:
	print('NO')
else:
	print('YES')
	for i in range(a):
		print(b[i])


from sys import stdout
busSize = int(input())
bus = []
isSeated = False
for i in range(0, busSize):
	row = input().split('|')
	if not isSeated:
		if row[0] == 'OO':
			row[0] = '++'
			isSeated = True
		elif row[1] == 'OO':
			row[1] = '++'
			isSeated = True
	bus.append('|'.join(row))
out = 'YES\n%s' % '\n'.join(bus) if isSeated else 'NO'
stdout.write(out)


n = int(input())
d = []
for k in range(n):
	d.append(input())
for k in range(n):
	if 'OO' in d[k]:
		if d[k] == 'OO|OO':
			d[k] = '++|OO'
		else:
			d[k] = d[k].replace('OO', '++')
		ans = 'YES'
		break
else:
	ans = 'NO'
if ans == 'NO':
	print(ans)
else:
	print(ans)
	for k in d:
		print(k)


n = int(input())
s = []
for i in range(n):
	s.append(input())
flag = False
for i in range(n):
	if flag:
		break
	for j in range(0, 5, 3):
		if s[i][j] == s[i][j + 1] == 'O':
			flag = True
			break
if flag:
	print('YES')
	for i in range(n):
		ans = ''
		for j in range(0, 5, 3):
			if s[i][j] == s[i][j + 1] == 'O' and flag == True:
				ans += '++'
				flag = False
			else:
				ans += s[i][j] + s[i][j + 1]
		print(ans[:2] + '|' + ans[2:4])
else:
	print('NO')


a = []
for tin in range(int(input())):
	s = str(input())
	a.append(s)
k = 0
for _ in range(len(a)):
	if 'OO' in a[_]:
		if a[_][:2] == 'OO':
			a[_] = '++' + a[_][2:]
			k = 1
			break
		else:
			a[_] = a[_][:3] + '++'
			k = 1
			break
if k == 0:
	print('NO')
else:
	print('YES')
	for _ in range(len(a)):
		print(a[_])


n = int(input())
l = []
k = False
for i in range(n):
	l.append(input())
for i in range(n):
	if l[i][0:2] == 'OO':
		k = True
		l[i] = '++' + l[i][2:5]
		break
	elif l[i][3:5] == 'OO':
		k = True
		l[i] = l[i][0:3] + '++'
		break
if k == True:
	print('YES')
	for i in range(n):
		print(l[i])
else:
	print('NO')


n = int(input())
w = []
f = 0
for i in range(n):
	s = input()
	s1 = ''
	if f == 0 and s[0] == 'O' and (s[1] == 'O'):
		s1 += '++'
		f = 1
	else:
		s1 += s[0] + s[1]
	s1 += '|'
	if f == 0 and s[3] == 'O' and (s[4] == 'O'):
		s1 += '++'
		f = 1
	else:
		s1 += s[3] + s[4]
	w.append(s1)
if f == 0:
	print('NO')
else:
	print('YES')
	for i in w:
		print(i)


n = int(input())
ok = False
rows = []
for i in range(n):
	s = input()
	if not ok and 'OO' in s:
		s = s.replace('OO', '++', 1)
		ok = True
	rows.append(s)
if ok:
	print('YES')
	print('\n'.join(rows))
else:
	print('NO')


n = int(input())
mat = []
f = 0
for i in range(n):
	l = list(map(str, input().split('|')))
	if f == 0:
		(x, y) = l
		if x == 'OO':
			x = '++'
			f = 1
		elif y == 'OO':
			y = '++'
			f = 1
		l = [x, y]
	mat.append(l)
if f == 1:
	print('YES')
	for i in mat:
		print(i[0] + '|' + i[1])
else:
	print('NO')


rows = int(input())
stringOfRows = []
for row in range(rows):
	stringOfRows.append(input())
newStringOfRows = []
for x in stringOfRows:
	newStringOfRows.append(x[:2])
	newStringOfRows.append(x[3:])
x = 0
if 'OO' in newStringOfRows:
	print('Yes')
	for set in newStringOfRows:
		if set == 'OO':
			break
		x += 1
	newStringOfRows[x] = '++'
	for y in range(len(newStringOfRows)):
		if y % 2 == 0:
			print(newStringOfRows[y] + '|' + newStringOfRows[y + 1])
		else:
			continue
else:
	print('No')


n = int(input())
f = False
ans = list()
for i in range(n):
	if f:
		ans.append(input())
		continue
	s = input()
	if s[:2] == 'OO':
		ans.append('++' + s[2:])
		f = True
		continue
	if s[3:] == 'OO':
		ans.append(s[:3] + '++')
		f = True
		continue
	ans.append(s)
if f:
	print('YES')
	print('\n'.join(ans))
else:
	print('NO')


n = int(input())
l = []
ans = 'NO'
for i in range(n):
	s = input()
	if ans == 'NO':
		if 'OO' in s:
			ans = 'YES'
			l.append(s.replace('OO', '++', 1))
		else:
			l.append(s)
	else:
		l.append(s)
print(ans)
if ans == 'YES':
	print(*l, sep='\n')


n = int(input())
stillwaiting = True
seats = []
for i in range(n):
	(left, right) = input().split('|')
	if stillwaiting:
		if left == 'OO':
			left = '++'
			stillwaiting = False
		elif right == 'OO':
			right = '++'
			stillwaiting = False
	seats.append(left + '|' + right)
if stillwaiting:
	print('NO')
else:
	print('YES')
	print('\n'.join(seats))


n = int(input())
resultList = []
flag = False
for _ in range(n):
	(left, right) = map(str, input().split('|'))
	if left == 'OO' and flag == False:
		left = '++'
		flag = True
	elif right == 'OO' and flag == False:
		right = '++'
		flag = True
	resultList.append(left + '|' + right)
if flag:
	print('YES')
	for x in resultList:
		print(x)
else:
	print('NO')


n = int(input())
seatFound = False
seats = []
answer = 'NO'
for i in range(n):
	seats.append(input())
	if seats[i].count('OO') > 0 and (not seatFound):
		answer = 'YES'
		seatFound = True
		seats[i] = seats[i].replace('OO', '++', 1)
print(answer)
if seatFound:
	for z in seats:
		print(z)


n = int(input())
l = []
fg = True
for i in range(n):
	s = input()
	ans = list(s)
	if ans[0] == 'O' and ans[1] == 'O' and (fg == True):
		ans[0] = '+'
		ans[1] = '+'
		fg = False
	elif ans[3] == 'O' and ans[4] == 'O' and (fg == True):
		ans[3] = '+'
		ans[4] = '+'
		fg = False
	l.append(ans)
if fg == False:
	print('YES')
	for i in l:
		print(''.join(i))
else:
	print('NO')


n = int(input())
bus = []
printyes = False
for i in range(n):
	bus.append(input().split('|'))
for i in range(n):
	if 'OO' in bus[i]:
		printyes = True
		bus[i][bus[i].index('OO')] = '++'
		break
if printyes == True:
	print('YES')
	for i in bus:
		print('|'.join(i))
else:
	print('NO')


n = int(input())
x = []
s = ''
y = 'NO'
counter = 0
for i in range(n):
	(a, b) = map(str, input().split('|'))
	if a == 'OO' and counter == 0:
		counter += 1
		a = '++'
		y = 'YES'
	if b == 'OO' and counter == 0:
		counter += 1
		b = '++'
		y = 'YES'
	s = a + '|' + b
	x.append(s)
if y == 'NO':
	print(y)
else:
	print(y)
	for i in range(n):
		print(x[i])


n = int(input())
arr = []
flag = True
for i in range(n):
	s = str(input())
	if flag:
		s = list(s)
		if s[0] == 'O' and s[1] == 'O':
			(s[0], s[1]) = ('+', '+')
			flag = False
			s = ''.join(s)
			arr.append(s)
		elif s[3] == 'O' and s[4] == 'O':
			(s[3], s[4]) = ('+', '+')
			flag = False
			s = ''.join(s)
			arr.append(s)
		else:
			arr.append(''.join(s))
	else:
		arr.append(s)
if not flag:
	print('YES')
	for i in range(n):
		print(arr[i])
else:
	print('NO')


n = int(input())
a = '\n'.join((input() for _ in range(n)))
print('YES\n' + a.replace('OO', '++', 1) if a.find('OO') != -1 else 'NO')


n = int(input())
lines = list()
flag = True
for i in range(n):
	line = str(input())
	if flag:
		if line[:2] == 'OO':
			line = '++' + line[2:]
			flag = False
		elif line[3:] == 'OO':
			line = line[:3] + '++'
			flag = False
	lines.append(line)
if flag:
	print('NO')
else:
	print('YES')
	print('\n'.join(lines))


t = int(input())
p = 0
m = 0
b = []
v = 0
while p < t:
	p = p + 1
	s = input()
	if s.find('OO') >= 0 and m == 0:
		print('YES')
		if s == 'OO|OO':
			v = '++|OO'
			b.append(v)
			m = 1
		else:
			v = s.replace('OO', '++')
			b.append(v)
			m = 1
	else:
		b.append(s)
if v == 0:
	print('NO')
	exit()
for i in b:
	print(i)


n = int(input())
test = 0
ans = []
for i in range(n):
	a = input()
	if test == 0 and a[0:2] == 'OO':
		a = '++' + a[2:]
		test = 1
	elif test == 0 and a[3:] == 'OO':
		a = a[0:3] + '++'
		test = 1
	ans.append(a)
if test == 1:
	print('YES')
	print('\n'.join(ans))
else:
	print('NO')


num = int(input())
value = 0
ans = ''
for i in range(num):
	str1 = input()
	if 'OO' in str1 and value == 0:
		ans += str1.replace('OO', '++', 1)
		ans += '\n'
		value = 1
	elif 'OO' in str1 and value != 0:
		ans += str1
		ans += '\n'
	if 'OO' not in str1:
		ans += str1
		ans += '\n'
if '++' in ans:
	print('YES\n' + ans)
else:
	print('NO')


n = int(input())
m = []
h = 0
for i in range(n):
	a = input()
	m.append(a)
for i in range(n):
	if 'OO' in m[i]:
		print('YES')
		m[i] = m[i].replace('OO', '++', 1)
		for j in m:
			print(j)
		break
	else:
		h += 1
		if h == n:
			print('NO')


n = int(input())
a = [0] * n
i = 0
flag = False
while i < n:
	(m1, m2, no, m3, m4) = input()
	if not flag:
		if m1 == 'O' == m2:
			(m1, m2) = ('+', '+')
			flag = True
		elif m3 == 'O' == m4:
			(m3, m4) = ('+', '+')
			flag = True
	a[i] = [m1, m2, no, m3, m4]
	i += 1
if not flag:
	print('NO')
else:
	print('YES')
	i = 0
	while i < n:
		print(''.join(a[i]))
		i += 1


n = int(input())
total = 0
a = list()
k = 0
for i in range(0, n):
	l = list(input())
	if l[0] == 'O' and l[1] == 'O':
		l[0] = '+'
		l[1] = '+'
		total = total + 1
		k = 1
		a.append(''.join(l))
		break
	elif l[3] == 'O' and l[4] == 'O':
		l[3] = '+'
		l[4] = '+'
		total = total + 1
		k = 1
		a.append(''.join(l))
		break
	a.append(''.join(l))
	total = total + 1
if total < n:
	for i in range(total, n):
		l = input()
		a.append(l)
if k == 1:
	print('YES')
else:
	print('NO')
for i in a:
	if k == 1:
		print(''.join(i))


rows = int(input())
string = str()
for i in range(rows):
	places = str(input())
	string += places + '\n'
if string.find('OO') >= 0:
	print('YES')
	print(string.replace('OO', '++', 1))
else:
	print('NO')


n = int(input())
l = []
f = 0
while n != 0:
	n -= 1
	l.append(list(input()))
for i in range(len(l)):
	if l[i][0] == 'O' and l[i][1] == 'O':
		f = 1
		l[i][0] = '+'
		l[i][1] = '+'
		break
	elif l[i][-1] == 'O' and l[i][-2] == 'O':
		f = 1
		l[i][-1] = '+'
		l[i][-2] = '+'
		break
if f == 1:
	print('YES')
	for i in range(len(l)):
		for j in range(len(l[i])):
			print(l[i][j], end='')
		print()
else:
	print('NO')


n = input()
lst = []
lst2 = []
for i in range(int(n)):
	c = input()
	lst.append(c.split('|'))
	lst2.append(c)
lst1 = []
for a in lst:
	lst1 += a
d = 'OO'
if d in lst1:
	lst1[lst1.index(d)] = '++'
	print('YES')
	for i in range(2, len(lst1) + 1, 2):
		print(lst1[i - 2] + '|' + lst1[i - 1])
else:
	print('NO')


import sys
n = int(input())
charList = []
charDict = {}
foundSeats = False
for row in range(n):
	seatOpen = False
	for char in [str(x) for x in input()]:
		if char == 'O':
			if seatOpen == True and foundSeats == False:
				charList.pop()
				char = '+'
				charList.append('+')
				foundSeats = True
			seatOpen = True
		else:
			seatOpen = False
		charList.append(char)
	charDict[row] = charList
	charList = []
if foundSeats:
	print('YES')
	for i in range(n):
		for char in charDict[i]:
			sys.stdout.write(char)
		print()
else:
	print('NO')


n = int(input())
bus_seats = []
for _ in range(n):
	row = list(input().split('|'))
	bus_seats.append(row)
taken = False
for i in bus_seats:
	for j in range(2):
		if i[j] == 'OO':
			i[j] = '++'
			taken = True
			break
	if taken:
		print('YES')
		break
if not taken:
	print('NO')
else:
	output = ''
	for x in bus_seats:
		for y in range(2):
			if y == 0:
				output += x[y] + '|'
			elif y == 1:
				output += x[y] + '\n'
	print(output)


n = int(input(''))
rows = []
for i in range(n):
	rows.append(input(''))
for i in range(n):
	if 'OO' in rows[i]:
		rows[i] = rows[i].replace('OO', '++', 1)
		out = True
		break
	out = False
if out:
	print('YES')
	for i in rows:
		print(i)
else:
	print('NO')


n = int(input())
yes = False
mat = []
for i in range(n):
	s = input()
	if 'OO' in s and yes == False:
		yes = True
		s = s.replace('OO', '++', 1)
	mat.append(s)
if yes == True:
	print('YES')
	for i in range(n):
		print(mat[i])
else:
	print('NO')


n = int(input())
s = []
f = 'NO'
for i in range(n):
	s.append(input().split('|'))
for pair in s:
	if pair[0] == 'OO':
		pair[0] = '++'
		f = 'YES'
		break
	elif pair[1] == 'OO':
		pair[1] = '++'
		f = 'YES'
		break
print(f)
if f == 'YES':
	for pair in s:
		print(pair[0] + '|' + pair[1])


has = False
n = int(input())
res = []
for i in range(n):
	c = input()
	if not has:
		x = c.split('|')
		if x[0] == 'OO':
			has = True
			c = '++|' + x[1]
		elif x[1] == 'OO':
			has = True
			c = x[0] + '|++'
	res.append(c)
if has:
	print('YES')
	for i in res:
		print(i)
else:
	print('NO')


n = int(input())
li = []
for i in range(n):
	a = input()
	li.append(a)
nn = 0
for i in range(0, n):
	if 'OO' in li[i]:
		nn += 1
		li[i] = li[i].replace('OO', '++', 1)
		break
if nn == 1:
	print('YES')
	for w in li:
		print(w)
else:
	print('NO')


from sys import stdin
n = int(input())
ans = False
puestos = [list(i) for i in stdin.readlines()]
for i in range(n):
	if puestos[i][0:2] == ['O', 'O']:
		puestos[i][0:2] = ['+', '+']
		ans = True
		break
	elif puestos[i][3:5] == ['O', 'O']:
		puestos[i][3:5] = ['+', '+']
		ans = True
		break
if not ans:
	print('NO')
else:
	print('YES')
	for i in puestos:
		print(''.join(i), end='')


n = int(input())
flg_ok = False
pairs = []
for _ in range(n):
	s = input()
	for _ in range(2):
		if s[0] == '|':
			s = s[1:]
		pairs.append(s[:2])
		s = s[2:]
		if not flg_ok and pairs[-1] == 'OO':
			pairs[-1] = '++'
			flg_ok = True
if not flg_ok:
	print('NO')
else:
	print('YES')
	for (i, v) in enumerate(pairs):
		print(v, end='')
		print(['|', '\n'][i % 2], end='')


in1 = int(input())
k = 0
tab = []
for i in range(in1):
	in2 = input()
	tab.append(in2)
	inp = in2.split('|')
	if inp[0] == 'OO' and k != 1:
		k = 1
		s = '++' + in2[2:5]
		tab[i] = s
	if inp[1] == 'OO' and k != 1:
		k = 1
		s = in2[0:3] + '++'
		tab[i] = s
if k == 1:
	print('YES')
	for i in range(in1):
		print(tab[i])
else:
	print('NO')


n = 0
P = 0
o = []
for _ in range(int(input())):
	p = input()
	if 'OO' in p and n == 0:
		k = p.count('OO')
		if k == 1:
			p = p.replace('OO', '++')
		else:
			p = '++' + p[2:]
		o = o + [p]
		n = 1
	else:
		o = o + [p]
print('YES' if n == 1 else 'NO')
[print(i) for i in o if n == 1]


n_lines = int(input())
disp = False
asientos = []
for e in range(n_lines):
	fila = input()
	if not disp:
		if 'OO' in fila:
			fila = fila.replace('OO', '++', 1)
			disp = True
	asientos.append(fila)
if disp:
	print('YES')
	for l in asientos:
		print(l)
else:
	print('NO')


n = int(input())
result = False
arr = []
for i in range(n):
	item = input()
	if not result and item.find('OO') != -1:
		result = True
		item = item.replace('OO', '++', 1)
	arr.append(item)
print('YES' if result else 'NO')
if result:
	for i in arr:
		print(i)


n = int(input())
t = []
for _ in range(n):
	t.append(list(input()))
flag = False
for row in t:
	if row[0] == 'O' and row[1] == 'O':
		row[0] = '+'
		row[1] = '+'
		flag = True
		break
	if row[4] == 'O' and row[3] == 'O':
		row[4] = '+'
		row[3] = '+'
		flag = True
		break
if flag:
	print('YES')
	for _ in t:
		print(''.join(_))
else:
	print('NO')


res = False
data = []
for i in range(int(input())):
	d = input()
	if not res and 'OO' in d:
		d = d.replace('OO', '++', 1)
		res = True
	data.append(d)
print(['NO', 'YES\n' + '\n'.join(data)][res])


def Det(s):
	if s[0] == 'O' and s[1] == 'O':
		return 0
	elif s[3] == 'O' and s[4] == 'O':
		return 3
	else:
		return -1
inp = int(input())
l = []
found = False
for x in range(0, inp):
	temp = ''
	k = input()
	if found == False:
		if Det(k) == 0:
			temp = '++|' + k[3] + k[4]
			found = True
			l.append(temp)
		elif Det(k) == 3:
			temp = k[0] + k[1] + '|++'
			found = True
			l.append(temp)
		else:
			l.append(k)
	else:
		l.append(k)
if found == True:
	print('YES')
	for x in range(0, inp):
		print(l[x])
else:
	print('NO')


n = int(input())
b = True
l = []
for i in range(n):
	s = input()
	if s[0] == s[1] and s[1] == 'O' and (b == True):
		b = False
		s2 = '++' + s[2:]
	elif s[3] == s[4] and s[3] == 'O' and (b == True):
		b = False
		s2 = s[:3] + '++'
	else:
		s2 = s
	l.append(s2)
if b:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(l[i])


n = int(input())
arr = []
for _ in range(n):
	inp = input().split('|')
	arr.append(inp[0])
	arr.append(inp[1])
if 'OO' in arr:
	print('YES')
	done = False
	for i in range(n * 2):
		if arr[i] == 'OO' and (not done):
			print('++', end='')
			done = True
		else:
			print(arr[i], end='')
		if (i + 1) % 2 == 1:
			print('|', end='')
		else:
			print()
else:
	print('NO')


n = int(input())
l = [input() for i in range(n)]
t = 0
for i in l:
	if 'OO' in i:
		l[l.index(i)] = i.replace('OO', '++', 1)
		print('YES')
		t = 1
		for u in l:
			print(u)
		break
if t == 0:
	print('NO')


x = False
plus = False
n = int(input())
s1 = ''
for i in range(n):
	s = input()
	if s.find('OO') != -1:
		x = True
		if plus == False:
			s = s.replace('OO', '++')
			plus = True
			if s.count('+') == 4:
				s = '++|OO'
	s1 = s1 + s + ' '
if x == False:
	print('NO')
else:
	print('YES')
	m = s1.split()
	for i in m:
		print(i)


n = int(input())
a = [str(input()) for i in range(n)]
flag = False
for i in range(n):
	if a[i][:2] == 'OO':
		flag = True
		a[i] = '++' + a[i][2:]
		break
	elif a[i][3:] == 'OO':
		flag = True
		a[i] = a[i][:3] + '++'
		break
if flag:
	print('YES')
	for i in a:
		print(i)
else:
	print('NO')


n = int(input())
z = 0
x = ''
for i in range(n):
	v = input()
	if z == 0:
		if v.find('OO') > -1:
			v = v.replace('OO', '++', 1)
			z = 1
	x += v
	x += '\n'
if z == 0:
	print('NO')
else:
	print('YES')
	print(x)


mat = []
flag = False
for _ in range(int(input())):
	temp = input().split('|')
	if 'OO' == temp[0] and (not flag):
		flag = True
		temp[0] = '++'
	elif 'OO' == temp[1] and (not flag):
		flag = True
		temp[1] = '++'
	mat.extend(temp)
if flag:
	print('YES')
	for (index, value) in enumerate(mat):
		print(value, end='')
		if index % 2 == 0:
			print('|', end='')
		else:
			print()
else:
	print('NO')


n = int(input())
seats = []
flag = 0
for i in range(n):
	seats.append(input().split('|'))
for i in range(n):
	if seats[i][0] == 'OO':
		seats[i][0] = '++'
		flag = 1
		break
	elif seats[i][1] == 'OO':
		seats[i][1] = '++'
		flag = 1
		break
if flag == 1:
	print('YES')
	for i in range(n):
		print('|'.join(seats[i]))
else:
	print('NO')


x = []
y = int(input())
a = 0
for i in range(y):
	s = input()
	if s.count('OO') and a == 0:
		a = 1
		s = s.replace('OO', '++', 1)
	x.append(s)
if a == 0:
	print('NO')
else:
	print('YES')
	for i in x:
		print(i)


n = int(input())
result = ''
count = 0
while n:
	val = input()
	if count == 0 and 'OO' in val:
		result += val.replace('OO', '++', 1) + '\n'
		count += 1
	else:
		result += val + '\n'
	n -= 1
print('YES\n' + result if '++' in result else 'NO\n')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	n = I()
	a = [S() for _ in range(n)]
	for i in range(n):
		t = a[i]
		if 'OO' in t:
			if t[:2] == 'OO':
				t = '++' + t[2:]
			else:
				t = t[:3] + '++'
			a[i] = t
			return 'YES\n' + '\n'.join(a)
	return 'NO'
print(main())


n = int(input())
a = []
for i in range(n):
	a.append(input())
x = '-'.join(a)
n = x.count('OO')
if n:
	x = x.replace('OO', '++', 1)
	print('YES')
	x = x.split('-')
	for i in x:
		print(i)
else:
	print('NO')


n = int(input())
found = False
w = []
for x in range(0, n):
	wor = str(input().strip())
	w.append(wor)
	if 'OO' in wor and (not found):
		found = True
if found:
	print('YES')
	once = 0
	for word in w:
		if 'OO' in word and once == 0:
			print(word.replace('OO', '++', 1))
			once += 1
		else:
			print(word)
else:
	print('NO')


flag = False
a = []
for _ in range(int(input())):
	(l, r) = input().split('|')
	if (l == 'OO' or r == 'OO') and flag == False:
		flag = True
		if l == 'OO':
			l = '++'
		else:
			r = '++'
	a.append(l + '|' + r)
if flag is False:
	print('NO')
else:
	print('YES')
	print(*a, sep='\n')


n = int(input())
flag = 0
c = 0
res = []
while n != 0:
	str = ''
	str = input()
	if 'OO' in str and flag == 0:
		tstr = ''
		i = 0
		while i < 5:
			if i < 4 and c == 0 and (str[i] == 'O') and (str[i + 1] == 'O'):
				tstr += '++'
				i += 2
				flag = 1
				c = 1
			else:
				tstr += str[i]
				i += 1
		res.append(tstr)
	else:
		res.append(str)
	n -= 1
if flag == 0:
	print('NO')
else:
	print('YES')
	for e in res:
		print(e)


n = int(input())
x = []
f = 0
g = 0
h = 0
for i in range(n):
	s = str(input())
	if h == 0:
		for j in range(1, 5):
			if s[j] == 'O' and s[j - 1] == 'O':
				a = j
				f = 1
				h = 1
	if f == 1:
		p = list(s)
		p[a] = '+'
		p[a - 1] = '+'
		q = ''.join(p)
		x.append(q)
		f = 0
		g = 1
	else:
		x.append(s)
if g == 1:
	print('YES')
	for k in range(n):
		print(x[k])
else:
	print('NO')


n = int(input())
flag = 0
b = [None] * n
for i in range(n):
	a = input()
	if 'OO' in a and flag == 0:
		b[i] = a.replace('OO', '++', 1)
		flag = 1
	else:
		b[i] = a
if flag == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(b[i])


n = int(input())
li = []
str = ''
for i in range(n):
	li.append(input())
for i in range(len(li)):
	if li[i][0] == 'O' and li[i][1] == 'O':
		print('YES')
		str = str + '++' + li[i][2:]
		li[i] = str
		for z in li:
			print(z)
		exit()
	elif li[i][3] == 'O' and li[i][4] == 'O':
		str = str + li[i][:3] + '++'
		li[i] = str
		print('YES')
		for z in li:
			print(z)
		exit()
print('NO')


n = int(input())
s = []
t = 0
for x in range(n):
	s += [input()]
for x in range(n):
	if s[x][0] == 'O' and s[x][1] == 'O':
		s[x] = '++' + s[x][2:]
		t += 1
		break
	elif s[x][3] == 'O' and s[x][4] == 'O':
		s[x] = s[x][:3] + '++'
		t += 1
		break
if t != 0:
	print('YES')
	for x in range(n):
		print(s[x])
else:
	print('NO')


n = int(input())
a = []
flag = False
for i in range(n):
	x = input()
	a.append(x)
b = [''] * n
for i in range(n):
	y = a[i].split('|')
	if y[0] == 'OO' and (not flag):
		flag = True
		b[i] = '++' + '|' + y[1]
	elif y[1] == 'OO' and (not flag):
		flag = True
		b[i] = y[0] + '|' + '++'
	else:
		b[i] = a[i]
if flag:
	print('YES')
	for i in range(n):
		print(b[i])
else:
	print('NO')


n = int(input())
seats = []
pair = 0
for i in range(n):
	line = input()
	seats.append(line)
for i in range(n):
	if 'OO' in seats[i]:
		seats[i] = seats[i].replace('OO', '++', 1)
		pair += 1
		break
if pair == 0:
	print('NO')
else:
	print('YES')
	for elem in seats:
		print(elem)


n = int(input())
seated = False
ans = ''
for i in range(n):
	j = input()
	if not seated and 'OO' in j:
		index = j.index('OO')
		j = j[0:index] + '++' + j[index + 2:]
		ans += '\n' + j
		seated = True
	else:
		ans += '\n' + j
if not seated:
	print('NO')
else:
	print('YES', end='')
	print(ans)


c = -1
l = []
for i in range(int(input())):
	s = input()
	if 'OO' in s and c == -1:
		x = s.find('OO')
		t = s[0:x] + '++' + s[x + 2:]
		l.append(t)
		c = 1
	else:
		l.append(s)
if c == -1:
	print('NO')
else:
	print('YES')
	for i in l:
		print(i)


t = int(input())
ls = []
flag = 0
for i in range(t):
	a = input().split('|')
	ls.append(a[0])
	ls.append(a[1])
for j in range(len(ls)):
	if ls[j] == 'OO':
		print('YES')
		ls[j] = '++'
		for k in range(0, len(ls) - 1, 2):
			print(ls[k], end='')
			print('|', end='')
			print(ls[k + 1])
		flag = 1
		break
if flag == 0:
	print('NO')


x = int(input())
y = []
for i in range(x):
	z = input()
	y.append(z)
availability = False
result = []
for i in range(x):
	w = y[i]
	res = ''
	if availability == True:
		res = w
	else:
		if w[0:2] == 'OO':
			res = res + '++'
			availability = True
		else:
			res = w[0:2]
		res = res + '|'
		if availability == False:
			if w[3:] == 'OO':
				res = res + '++'
				availability = True
			else:
				res = res + w[3:]
		else:
			res = res + w[3:]
	result.append(res)
if availability == True:
	print('YES')
	for i in range(x):
		print(result[i])
else:
	print('NO')


n = int(input())
li = []
for _ in range(n):
	li2 = input().split('|')
	for j in li2:
		li.append(j)
if 'OO' in li:
	print('YES')
	li[li.index('OO')] = '++'
else:
	print('NO')
	exit()
li = [li[n:n + 2] for n in range(0, len(li), 2)]
res = []
for i in li:
	res.append('|'.join(i))
print('\n'.join(res))


n = int(input())
b = []
yes_or_no = 0
for i in range(n):
	a = input()
	if 'OO' in a and yes_or_no == 0:
		a = a.replace('OO', '++', 1)
		yes_or_no += 1
	b.append(a)
print('YES' if yes_or_no != 0 else 'NO')
if yes_or_no != 0:
	print('\n'.join(b))


l = input().split()
a = 0
n = ''
for i in range(0, int(l[0])):
	(x, y) = input().split('|')
	if a == 0:
		if x == 'OO':
			x = '++'
			a = 1
		if y == 'OO':
			y = '++'
			a = 1
			if x == '++':
				y = 'OO'
	n = n + x + '|' + y + '\n'
if a == 1:
	print('YES')
	print(n)
else:
	print('NO')


n = int(input())
bus: str = ''
for i in range(n):
	bus += input() + '\n' if i != n else input()
bus = bus.replace('OO', '++', 1)
if '++' in bus:
	print('YES')
	print(bus)
else:
	print('NO')


n = int(input())
r = []
res = 'NO'
c = 0
for i in range(n):
	aux = input()
	if aux.find('OO') != -1:
		res = 'YES'
	r.append(aux)
print(res)
if res == 'YES':
	for j in r:
		if c == 0:
			if j.find('OO|') != -1:
				print('++|' + j[3] + j[4])
				c = 1
			elif j.find('|OO') != -1:
				print(j[0] + j[1] + '|++')
				c = 1
			else:
				print(j)
		else:
			print(j)


rows = int(input())
found = False
res = []
for i in range(rows):
	row = input()
	if found == False:
		if row.find('OO') > -1:
			found = True
			row = row.replace('OO', '++', 1)
	res.append(row)
if found == True:
	print('YES')
	print(*res, sep='\n')
else:
	print('NO')


n = int(input())
a = []
num = 0
for i in range(n):
	line = input()
	a.append(line)
for i in range(n):
	if 'OO' in a[i]:
		print('YES')
		if 'OO|' in a[i]:
			a[i] = '++|' + a[i][3:]
		else:
			a[i] = a[i][0:2] + '|++'
		break
	else:
		num += 1
if num == n:
	print('NO')
else:
	for i in range(n):
		print(a[i])


n = int(input())
a = [input() for i in range(n)]
for i in range(n):
	if a[i][0] + a[i][1] == 'OO':
		a[i] = '++' + a[i][2:]
		break
	elif a[i][3] + a[i][4] == 'OO':
		a[i] = a[i][:3] + '++'
		break
else:
	print('NO')
	exit()
print('YES')
[print(i) for i in a]


n = int(input())
a = []
for i in range(n):
	s = list(input())
	a.append(s)
cnt = 0
for i in range(len(a)):
	for j in range(4):
		if j != 2:
			if a[i][j] == 'O' and a[i][j + 1] == 'O':
				a[i][j] = '+'
				a[i][j + 1] = '+'
				cnt = 1
				break
	if cnt == 1:
		break
	else:
		continue
if cnt == 1:
	print('YES')
	for i in a:
		for j in i:
			print(j, end='')
		print()
else:
	print('NO')


def BusToUdayland(n, arrangement):
	finalArrangement = []
	found = 0
	for s in arrangement:
		if 'OO' in s and found == 0:
			finalArrangement.append(s.replace('OO', '++', 1))
			found = 1
		else:
			finalArrangement.append(s)
	if found == 1:
		print('YES')
		for s in finalArrangement:
			print(s)
	else:
		print('NO')
n = int(input())
arrangement = []
while n > 0:
	arrangement.append(input())
	n -= 1
BusToUdayland(n, arrangement)


n = int(input())
a = []
asw = ''
for i in range(0, n):
	x = input()
	a.append(x)
for i in range(0, n):
	if a[i][:2] == 'OO':
		a[i] = '++' + a[i][2:]
		asw = 'YES'
		break
	elif a[i][3:] == 'OO':
		a[i] = a[i][:3] + '++'
		asw = 'YES'
		break
	else:
		asw = 'NO'
if asw == 'YES':
	print(asw)
	for i in range(0, n):
		print(a[i])
else:
	print(asw)


import sys
input()
a = sys.stdin.read()
p = a.find('OO')
print('NO' if p < 0 else 'YES\n' + a[:p] + '++' + a[p + 2:])


n = int(input())
i = []
for x in range(n):
	i.append(input())
y = ''
for x in range(n):
	if 'OO' in i[x]:
		y = i[x].find('OO')
		i[x] = i[x].replace('OO', '++', 1)
		break
if y == '':
	print('NO')
else:
	print('YES')
	for line in i:
		print(line)


n = int(input())
bus = []
for i in range(n):
	bus.append(list(input()))

def print_bus(bus):
	print('YES')
	for row in bus:
		print(''.join(row))
aux = True
for row in bus:
	if aux:
		if row[0] == 'O' and row[1] == 'O':
			row[0] = '+'
			row[1] = '+'
			aux = False
		elif row[3] == 'O' and row[4] == 'O':
			row[3] = '+'
			row[4] = '+'
			aux = False
if aux:
	print('NO')
else:
	print_bus(bus)


n = int(input())
solution = []
pair = False
for i in range(n):
	seats = input()
	if 'OO' in seats and pair == False:
		if seats == 'OO|OO':
			solution.append('++|OO')
		else:
			solution.append(seats.replace('OO', '++'))
		pair = True
	else:
		solution.append(seats)
if pair:
	print('YES')
	print('\n'.join(solution))
else:
	print('NO')


n = int(input())
a = [input() for _ in range(n)]
flag = 0
for i in range(n):
	if a[i].find('OO') != -1:
		a[i] = a[i].replace('OO', '++', 1)
		flag = 1
		break
print('YES' if flag else 'NO')
if flag:
	for s in a:
		print(s)


n = int(input())
l = []
flag = 0
for i in range(0, n):
	l.append(input().split('|'))
	if l[i][0] == 'OO' and flag == 0:
		l[i][0] = '++'
		flag = 1
	if l[i][1] == 'OO' and flag == 0:
		l[i][1] = '++'
		flag = 1
if flag == 0:
	print('NO')
else:
	print('YES')
	for i in range(0, n):
		print(l[i][0] + '|' + l[i][1])


n = int(input())
a = [input() for i in range(n)]
k = False
for i in range(n):
	if a[i].find('OO') >= 0:
		k = True
		a[i] = a[i].replace('OO', '++', 1)
		break
if k:
	print('YES')
	for ele in a:
		print(ele)
else:
	print('NO')


n = int(input())
arr = []
for _ in range(n):
	arr.append(input())
(row, c1, c2) = (0, 0, 0)
for i in range(n):
	if arr[i][0] == 'O' and arr[i][1] == 'O':
		(row, c1, c2) = (i, 0, 1)
		break
	elif arr[i][3] == 'O' and arr[i][4] == 'O':
		(row, c1, c2) = (i, 3, 4)
		break
if row == 0 and c1 == 0 and (c2 == 0):
	print('NO')
else:
	print('YES')
	for i in range(n):
		for j in range(5):
			if i == row and j in (c1, c2):
				print('+', end='')
			else:
				print(arr[i][j], end='')
		print()


def identifySeats(busSeats):
	(res, inx) = calculatePairAvaiSeats(busSeats)
	if res == True:
		print('YES')
		if busSeats[inx][0:2] == 'OO':
			busSeats[inx] = '++' + busSeats[inx][2:]
		elif busSeats[inx][3:] == 'OO':
			busSeats[inx] = busSeats[inx][0:3] + '++'
		for row in busSeats:
			print(row)
	else:
		print('NO')

def calculatePairAvaiSeats(busSeats):
	availableSeats = False
	inx = 0
	for row in busSeats:
		if row[0:2] == 'OO' or row[3:] == 'OO':
			availableSeats = True
			return (availableSeats, inx)
		inx += 1
	if availableSeats == False:
		return (availableSeats, -1)

def solve():
	seatRows = int(input())
	busSeats = []
	for x in range(seatRows):
		busSeats.append(input())
	identifySeats(busSeats)
solve()


import sys
input()
s = sys.stdin.read()
f = s.find('OO')
print('NO' if f == -1 else 'YES\n' + s[:f] + '++' + s[f + 2:])


n = int(input())
seat1 = []
for i in range(0, n):
	seats = input()
	seat1.append(seats)
for item in seat1:
	if item[3:] == 'OO' or item[0:2] == 'OO':
		a = seat1.index(item)
		print('YES')
		b = seat1.pop(a)
		b = b.replace('OO', '++', 1)
		seat1.insert(a, b)
		for a in seat1:
			print(a)
		break
else:
	print('NO')


n = int(input())
s = []
c = 0
for i in range(0, n):
	s.append(input())
	if s[i][0] == 'O' and s[i][1] == 'O' and (c == 0):
		s[i] = '++|' + s[i][3] + s[i][4]
		c = 1
	elif s[i][3] == 'O' and s[i][4] == 'O' and (c == 0):
		s[i] = s[i][0] + s[i][1] + '|++'
		c = 1
if c == 0:
	print('NO')
else:
	print('YES')
	for i in range(0, n):
		print(s[i])


i = input()
r = []
s = ''
l = 0
for x in range(0, int(i)):
	r.append(input())
for y in r:
	if y[:2] == 'OO' or y[-2:] == 'OO':
		l = r.index(y)
		s = 'YES'
		break
	else:
		s = 'NO'
if s == 'YES':
	print(s)
	r[l] = r[l].replace('OO', '++', 1)
	for x in r:
		print(x)
if s == 'NO':
	print(s)


n = int(input())
a = []
k = 0
b = []
for i in range(n):
	s = str(input())
	a.append(s[:2])
	b.append(s[3:])
	if k == 0 and s[:2] == 'OO':
		print('YES')
		k = 1
		a[i] = '++'
	if k == 0 and s[3:] == 'OO':
		k = 1
		b[i] = '++'
		print('YES')
if k == 0:
	print('NO')
else:
	for i in range(n):
		d = a[i] + '|' + b[i]
		print(d)


n = int(input())
a = []
for i in range(n):
	a.append(input().split('|'))
for i in range(n):
	if a[i][0] == 'OO':
		a[i][0] = '++'
		print('YES')
		for j in range(n):
			print(a[j][0] + '|' + a[j][1])
		exit()
	if a[i][1] == 'OO':
		a[i][1] = '++'
		print('YES')
		for j in range(n):
			print(a[j][0] + '|' + a[j][1])
		exit()
print('NO')


a = int(input())
q = 0
t = []
for i in range(a):
	s = input().split('|')
	if s[0] == 'OO' and q == 0:
		s[0] = '++'
		q = 1
	if s[1] == 'OO' and q == 0:
		s[1] = '++'
		q = 1
	for u in range(len(s)):
		t.append(s[u])
if q == 0:
	print('NO')
else:
	print('YES')
	for y in range(0, len(t), 2):
		print(t[y] + '|' + t[y + 1], end='\n')


def solution():
	n = int(input())
	bus = []
	for i in range(n):
		bus.append(input())
	for i in range(len(bus)):
		if 'OO' in bus[i]:
			bus[i] = bus[i].replace('OO', '++', 1)
			break
	else:
		print('NO', end='')
		return 0
	print('YES', end='')
	for row in bus:
		print('\n' + row, end='')
solution()


n = int(input())
solution_found = False
output = ''
for i in range(n):
	row = input()
	if not solution_found:
		if row[0] == 'O' and row[1] == 'O':
			output += '++' + row[2:] + '\n'
			solution_found = True
			continue
		elif row[3] == 'O' and row[4] == 'O':
			output += row[:3] + '++\n'
			solution_found = True
			continue
	output += row + '\n'
print('YES' if solution_found else 'NO')
if solution_found:
	print(output)


def solve():
	n = int(input())
	u = 'NO'
	ans = []
	for i in range(n):
		s = input()
		check = s.split('|')
		if check[0] == 'OO' and u != 'YES':
			u = 'YES'
			ans.append('++' + '|' + check[1])
		elif check[1] == 'OO' and u != 'YES':
			u = 'YES'
			ans.append(check[0] + '|' + '++')
		else:
			ans.append(s)
	if u == 'YES':
		print(u)
		for i in range(n):
			print(ans[i])
	else:
		print(u)
solve()


NumOfRows = int(input())
seats = []
the_seat_taken = False
avilable_seat = 'NO'
for i in range(NumOfRows):
	seatsState = input().split('|')
	seats.append('|'.join(seatsState))
	if 'OO' in seats[i] and (not the_seat_taken):
		seats[i] = seats[i].replace('OO', '++', 1)
		the_seat_taken = True
		avilable_seat = 'YES'
if avilable_seat == 'NO':
	print(avilable_seat)
else:
	print('YES')
	for i in seats:
		print(i)


n = int(input())
flag = 0
yes = 0
nums = []
for x in range(n):
	nums.append(input())
for x in range(n):
	string = nums[x]
	if flag == 0:
		if string[0] == 'O' and string[1] == 'O':
			nums[x] = '++' + string[2:]
			flag = 1
		elif string[3] == 'O' and string[4] == 'O':
			nums[x] = string[:3] + '++'
			flag = 1
if flag == 0:
	print('NO')
else:
	print('YES')
	for x in range(n):
		print(nums[x])


d = int(input())
g = []
l = []
m = 0
j = 0
for _ in range(d):
	e = input()
	g.append(e)
for i in range(d):
	if 'OO' in g[i]:
		print('YES')
		g[i] = g[i].replace('OO', '++', 1)
		j = 1
		break
if j != 1:
	print('NO')
else:
	for i in g:
		print(i)


a = []
res = 'NO'
for _ in range(int(input())):
	s = input()
	if 'OO' in s and res == 'NO':
		s = s.replace('OO', '++', 1)
		res = 'YES'
	a.append(s)
print(res)
if res == 'YES':
	for i in a:
		print(i)


n = int(input())
l = []
for _ in range(n):
	s = input()
	l.append([s[0] + s[1], s[3] + s[4]])
t = 0
for i in range(n):
	if l[i][0] == 'OO':
		l[i][0] = '++'
		t = 1
		break
	if l[i][1] == 'OO':
		l[i][1] = '++'
		t = 1
		break
if t == 0:
	print('NO')
else:
	print('YES')
	for i in l:
		print(i[0] + '|' + i[1])


def find_seats(n, seats):
	for i in range(n):
		for j in range(2):
			if seats[i][j] == 'OO':
				seats[i][j] = '++'
				return True
	return False
n = int(input())
seats = [input().split(sep='|') for i in range(n)]
if find_seats(n, seats):
	print('YES')
	[print(seats[k][0] + '|' + seats[k][1]) for k in range(n)]
else:
	print('NO')


n = int(input())
s = ''
for i in range(n):
	x = input()
	s = s + x + '\n'
if s.count('OO') != 0:
	print('YES')
	s = s.replace('OO', '++', 1)
	print(s)
else:
	print('NO')


n = int(input())
li = ''
f = 0
for x in range(n):
	s = input()
	if (s[0] == 'O' and s[1] == 'O') and f == 0:
		a = '++' + s[2:]
		f = 1
	elif (s[3] == 'O' and s[4] == 'O') and f == 0:
		a = s[:3] + '++'
		f = 1
	else:
		a = s
	li += a
if f == 0:
	print('NO')
else:
	print('YES')
	for i in range(n * 5):
		print(li[i], end='')
		if (i + 1) % 5 == 0 and i >= 4:
			print()


n = int(input())
possible = 'NO'
bus = []
for _ in range(n):
	bus.append(list(map(str, input().split('|'))))
	if possible == 'NO':
		if 'OO' == bus[_][0]:
			possible = 'YES'
			bus[_][0] = '++'
		elif 'OO' == bus[_][1]:
			possible = 'YES'
			bus[_][1] = '++'
print(possible)
if possible == 'YES':
	for i in bus:
		print(i[0] + '|' + i[1])


n = int(input())
c = 0
l = []
for i in range(n):
	a = input()
	if a[:2] == 'OO' and c == 0:
		a = '++' + a[2:]
		c += 1
		l.append(a)
	elif a[3:] == 'OO' and c == 0:
		a = a[:3] + '++'
		c += 1
		l.append(a)
	else:
		l.append(a)
if c == 1:
	print('YES')
	for i in range(len(l)):
		print(l[i])
else:
	print('NO')


n = int(input())
a = []
k = 0
for i in range(n):
	(c, d) = input().split('|')
	a.append(c)
	a.append(d)
for i in range(2 * n):
	if a[i] == 'OO':
		a[i] = '++'
		print('YES')
		k += 1
		break
if k == 0:
	print('NO')
else:
	for i in range(0, 2 * n, 2):
		print(a[i], end='')
		print('|', end='')
		print(a[i + 1])


a = '\n'.join((input() for i in range(int(input()))))
if 'OO' in a:
	print('YES')
	print(a.replace('OO', '++', 1))
else:
	print('NO')


def solve(seats):
	for (i, seat) in enumerate(seats):
		for (j, pair) in enumerate(seat):
			if pair == 'OO':
				seats[i][j] = '++'
				output = ['YES']
				output.append('\n'.join(['|'.join(seat) for seat in seats]))
				return '\n'.join(output)
	return 'NO'

def main():
	n = int(input())
	seats = []
	for _ in range(n):
		seats.append(input().split('|'))
	print(solve(seats))
main()


n = int(input())
s = False
dic = []
for i in range(n):
	st = input().split('|')
	for j in range(2):
		if st[j] == 'OO' and (not s):
			st[j] = '++'
			s = True
			break
	res = st[0] + '|' + st[1]
	dic.append(res)
if s:
	print('YES')
	for i in range(n):
		print(dic[i])
else:
	print('NO')


n = int(input())
z = []
f = False
for i in range(n):
	t = input()
	t = t.split('|')
	z.append(t[0])
	z.append(t[1])
for i in range(2 * n):
	if z[i] == 'OO':
		z[i] = '++'
		f = True
		break
if f:
	print('YES')
	for i in range(0, 2 * n, 2):
		print(z[i] + '|' + z[i + 1])
else:
	print('NO')


a = int(input())
b = []
for i in range(a):
	d = input()
	b.append(d)
c = 0
e = 0
f = 'NO'
while c < a:
	if 'OO|' in b[e]:
		g = b[e].replace('OO|', '++|')
		b[e] = g
		c = a
		f = 'YES'
	elif '|OO' in b[e]:
		g = b[e].replace('|OO', '|++')
		b[e] = g
		c = a
		f = 'YES'
	e += 1
	c += 1
if f == 'YES':
	print(f)
	for i in b:
		print(i)
else:
	print(f)


n = int(input())
seat = [None] * n
x = False
for i in range(n):
	seat[i] = input()
for i in range(n):
	s = seat[i]
	if s[0] == 'O' and s[1] == 'O':
		s = '++' + s[2:]
		x = True
		seat[i] = s
		break
	elif s[3] == 'O' and s[4] == 'O':
		s = s[:3] + '++'
		x = True
		seat[i] = s
		break
if not x:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(seat[i])


n = int(input())
spisok = []
est = 0
for i in range(n):
	mestai = input()
	if est == 1:
		spisok += [mestai]
		continue
	if mestai[0] == mestai[1] == 'O':
		spisok += ['++' + mestai[2:]]
		est = 1
		continue
	elif mestai[3] == mestai[4] == 'O':
		spisok += [mestai[:3] + '++']
		est = 1
		continue
	spisok += [mestai]
if est == 1:
	print('YES')
	for i in range(n):
		print(spisok[i])
else:
	print('No')


n = int(input())
p = [input() for i in range(n)]
copy = p[:]
p = '\n'.join(p)
variants = ['XX|OO', 'XO|OO', 'OX|OO', 'OO|XX', 'OO|XO', 'OO|OX', 'OO|OO']
variants2 = ['XX|++', 'XO|++', 'OX|++', '++|XX', '++|XO', '++|OX', '++|OO']
z = 0
if 'OO' in p:
	for j in variants:
		if j in copy:
			copy = '\n'.join(copy)
			copy = copy.replace(j, variants2[z], 1)
			print('YES')
			print(copy)
			break
		z += 1
else:
	print('NO')


x = int(input())
j = 0
lst = []
for i in range(x):
	v = input()
	if v[0] + v[1] == 'OO' or v[3] + v[4] == 'OO':
		j += 1
		if j == 1:
			if v[0] + v[1] == 'OO':
				v = '++' + v[2:]
				lst.append(v)
				continue
			if v[3] + v[4] == 'OO':
				v = v[:3] + '++'
	lst.append(v)
if j > 0:
	print('YES')
	for h in range(x):
		print(lst[h])
else:
	print('NO')


a = int(input())
k = []
condition = False
for i in range(a):
	b = list(input().split('|'))
	if b[0] == 'OO' and condition == False:
		x = f'++|{b[1]}'
		k.append(x)
		condition = True
	elif b[1] == 'OO' and condition == False:
		x = f'{b[0]}|++'
		k.append(x)
		condition = True
	else:
		k.append(b[0] + '|' + b[1])
if condition:
	print('YES')
	for i in k:
		print(i)
else:
	print('NO')


n = int(input())
flag = 0
lis = []
for i in range(n):
	(a, b) = input().split('|')
	if flag == 0:
		if list(a).count('O') == 2:
			lis.append('++')
			lis.append(b)
			flag = 1
		elif list(b).count('O') == 2:
			lis.append(a)
			lis.append('++')
			flag = 1
		else:
			lis.append(a)
			lis.append(b)
	else:
		lis.append(a)
		lis.append(b)
if flag == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print('{}|{}'.format(lis[2 * i], lis[2 * i + 1]))


n = int(input())
f = 0
ans = []
for i in range(n):
	s = list(input())
	if f == 1:
		ans.append(''.join(s))
		continue
	elif s[:2] == list('OO'):
		s[:2] = ['+', '+']
		f = 1
	elif s[3:] == list('OO'):
		s[3:] = ['+', '+']
		f = 1
	ans.append(''.join(s))
if f == 0:
	print('NO')
else:
	print('YES')
	for i in ans:
		print(i)


n = int(input())
check = False
b = []
for _ in range(n):
	a = list(input())
	if not check:
		if a[0] == a[1] == 'O':
			a[0] = a[1] = '+'
			check = True
		elif a[3] == a[4] == 'O':
			a[3] = a[4] = '+'
			check = True
	b.append(a)
if check:
	print('YES')
	for i in b:
		print(*i, sep='')
else:
	print('NO')


n = int(input())
rows = [''] * n
for i in range(n):
	rows[i] = input()
for i in range(n):
	pos = rows[i].find('OO')
	if pos != -1:
		rows[i] = rows[i].replace('OO', '++', 1)
		print('YES')
		for row in rows:
			print(row)
		exit()
print('NO')


n = int(input())
seats = []
res = False
for i in range(n):
	seats.append(input())
	if res == False:
		if seats[i][:2] == 'OO':
			res = True
			seats[i] = '++' + seats[i][2:]
		elif seats[i][3:] == 'OO':
			res = True
			seats[i] = seats[i][:3] + '++'
if res == False:
	print('NO')
else:
	print('YES')
	print('\n'.join(seats))


def main():
	from sys import stdin, stdout
	l = []
	flag = 0
	n = int(stdin.readline())
	for _ in range(n):
		s = stdin.readline().strip()
		if 'OO' in s and flag == 0:
			flag = 1
			s = s.replace('OO', '++', 1)
		l.append(s)
	if flag:
		stdout.write('YES')
		for i in range(n):
			stdout.write('\n' + l[i])
	else:
		stdout.write('NO')
main()


from typing import List

def parse_input() -> List[str]:
	n = int(input())
	return [input() for _ in range(n)]

def solve(bus: List[str]) -> List[str]:
	for (idx, line) in enumerate(bus):
		if line[:2] == 'OO':
			bus[idx] = '++|' + line[3:]
			return bus
		elif line[3:] == 'OO':
			bus[idx] = line[:2] + '|++'
			return bus
	return []
answer = solve(parse_input())
print(['NO', 'YES'][len(answer) > 0])
for line in answer:
	print(line)


n = int(input())
l = ''
for i in range(n):
	t = input()
	if i != 0:
		l = l + '\n' + t
	else:
		l = l + t
if 'OO' in l:
	l = l.replace('OO', '++', 1)
	print('YES')
	print(l)
else:
	print('NO')


n = int(input())
lst = []
for i in range(n):
	s = input().split('|')
	lst.append(s)
flag = False
for i in range(n):
	for j in range(2):
		if lst[i][j] == 'OO' and flag == False:
			lst[i][j] = '++'
			flag = True
if flag == False:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print('{0}|{1}'.format(lst[i][0], lst[i][1]))


n = int(input())
arr = []
ans = 'No'
for i in range(n):
	st = str(input())
	if 'OO' in st and ans == 'No':
		ans = 'Yes'
		st = st.replace('OO', '++', 1)
	arr.append(st)
print(ans)
if ans == 'Yes':
	for i in range(n):
		print(arr[i])


n = int(input())
l1 = []
for i in range(n):
	l1.append(input())
x = 0
for i in range(n):
	if l1[i][0] == 'O' and l1[i][1] == 'O':
		l1[i] = '++|' + l1[i][3:5]
		x = 1
		break
	if l1[i][3] == 'O' and l1[i][4] == 'O':
		l1[i] = l1[i][0:3] + '++'
		x = 1
		break
if x == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(l1[i])


n = int(input())
seats = []
flag = 0
for i in range(n):
	seats.append(input())
	if flag:
		continue
	elif 'OO' in seats[i]:
		seats[i] = seats[i].replace('OO', '++', 1)
		flag = 1
if flag:
	print('YES')
	for i in range(n):
		print(seats[i])
else:
	print('NO')


n = int(input())
seats = []
flag = 0
for i in range(n):
	seats.append(input().split('|'))
for i in range(len(seats)):
	for j in range(len(seats[0])):
		if seats[i][j] == 'OO':
			seats[i][j] = '++'
			flag = 1
			break
		else:
			flag = 0
			continue
	if flag == 1:
		break
	else:
		continue
if flag == 1:
	print('YES')
	for i in range(n):
		print('|'.join(seats[i]))
else:
	print('NO')


n = int(input())
lst = []
prm = False
for i in range(n):
	lst.append(list(input()))
for i in lst:
	if i[0] == i[1] and i[1] == 'O':
		i[0] = i[1] = '+'
		prm = True
		break
	if i[3] == i[4] and i[3] == 'O':
		i[3] = i[4] = '+'
		prm = True
		break
if prm:
	print('YES')
	for i in lst:
		for a in i:
			print(a, end='')
		print('\n', end='')
else:
	print('NO')


p = False
n = int(input())
s = ''
for i in range(n):
	n = input()
	if not p and 'OO' in n:
		n = n.replace('OO', '++', 1)
		p = True
	s += n + '\n'
if p:
	print('YES')
	print(s[:-1])
else:
	print('NO')


n = int(input())
a = []
flag = False
result = 'YES'
for i in range(n):
	m = input()
	if flag == False:
		if 'OO' in m:
			flag = True
			a.append(m.replace('OO', '++', 1))
		else:
			a.append(m)
	else:
		a.append(m)
if flag == False:
	print('NO')
else:
	print('YES')
	print('\n'.join(a))


n = int(input())
seats_found = False
all_seats = []
for i in range(n):
	row = input()
	splitted_row = row.split('|')
	if splitted_row[0] == 'OO' and (not seats_found):
		splitted_row[0] = '++'
		seats_found = True
	elif splitted_row[1] == 'OO' and (not seats_found):
		splitted_row[1] = '++'
		seats_found = True
	all_seats.append(splitted_row)
if seats_found:
	print('YES')
	for row in all_seats:
		print('|'.join(row))
else:
	print('NO')


l = []
n = int(input())

def split(word):
	return [char for char in word]
for i in range(n):
	s = input()
	l.append(split(s))
result = 'NO'
for j in range(n):
	if result == 'YES':
		break
	for k in range(4):
		if l[j][k] == 'O' and l[j][k + 1] == 'O':
			l[j][k] = '+'
			l[j][k + 1] = '+'
			result = 'YES'
			break
print(result, end='')
if result == 'YES':
	for i in range(n):
		print()
		for j in range(5):
			print(l[i][j], end='')


n = int(input())
l = [list(input()) for i in range(n)]
c = 0
for i in range(n):
	if l[i][0] == 'O' and l[i][1] == 'O':
		l[i][0] = '+'
		l[i][1] = '+'
		c = c + 1
		break
	elif l[i][3] == 'O' and l[i][4] == 'O':
		l[i][3] = '+'
		l[i][4] = '+'
		c = c + 1
		break
if c == 1:
	print('YES')
	for i in range(0, n):
		print(*l[i], sep='')
else:
	print('NO')


n = int(input())
_se = []
for i in range(n):
	_se.append(list(input()))
flag = 0
for i in range(len(_se)):
	if _se[i][0] == 'O' and _se[i][1] == 'O':
		_se[i][0] = '+'
		_se[i][1] = '+'
		flag = 1
		print('YES')
		for i in range(len(_se)):
			s = ''
			for j in _se[i]:
				s += j
			print(s)
		break
	if _se[i][3] == 'O' and _se[i][4] == 'O':
		_se[i][3] = '+'
		_se[i][4] = '+'
		flag = 1
		print('YES')
		for i in range(len(_se)):
			s = ''
			for j in _se[i]:
				s += j
			print(s)
		break
if flag == 0:
	print('NO')


n = int(input())
replaced = 'NO'
queue = []
for i in range(n):
	row = input()
	if row.replace('OO', '++', 1) != row and replaced == 'NO':
		replaced = 'YES'
		queue.append(row.replace('OO', '++', 1))
	else:
		queue.append(row)
if replaced == 'NO':
	print(replaced)
else:
	print(replaced)
	print('\n'.join(queue))


n = int(input())
listResult = []
condition = False
for i in range(n):
	s = input()
	if s[:2] == 'OO':
		s = '++' + s[2:]
		listResult.append(s)
		condition = True
		m = i
		break
	elif s[3:] == 'OO':
		s = s[:3] + '++'
		listResult.append(s)
		condition = True
		m = i
		break
	else:
		listResult.append(s)
if not condition:
	print('NO')
	exit()
else:
	for i in range(m + 1, n):
		listResult.append(input())
print('YES')
for i in listResult:
	print(i)


l = []
isFound = False
for i in range(int(input())):
	l.append(input())
	if not isFound:
		a = l[len(l) - 1]
		if 'OO' in a:
			a = a.replace('OO', '++', 1)
			isFound = True
			l[len(l) - 1] = a
if isFound:
	print('YES')
	print('\n'.join(l))
else:
	print('NO')


x = input().strip('\n')
y = []
for i in range(0, int(x)):
	y = y + [s for s in input().strip('\n').split('|')]
if 'OO' in y:
	print('YES')
	y[y.index('OO')] = '++'
	for i in range(0, len(y), 2):
		print(y[i] + '|' + y[i + 1])
else:
	print('NO')


n = int(input())
wtf = []
for _ in range(n):
	wtf.append(input())
a = ''
for i in range(n):
	if wtf[i].find('OO') >= 0:
		wtf[i] = wtf[i].replace('OO', '++', 1)
		a = 'YES'
		break
if a:
	print(a)
	for w in wtf:
		print(w)
else:
	print('NO')


n = int(input())
a = []
str = 'NO'
for i in range(n):
	a.append(input())
for i in range(n):
	if 'OO' == a[i][:2]:
		a[i] = '++' + a[i][2:5]
		str = 'YES'
		break
	if 'OO' == a[i][3:5]:
		a[i] = a[i][:3] + '++'
		str = 'YES'
		break
if str == 'NO':
	print(str)
else:
	print(str)
	print(*a, sep='\n')


n = int(input())
list1 = [input() for _ in range(n)]
list2 = [[x for x in list1[y]] for y in range(len(list1))]
for x in range(n):
	for y in range(4):
		if list2[x][y] + list2[x][y + 1] == 'OO':
			print('YES')
			(list2[x][y], list2[x][y + 1]) = ('+', '+')
			str1 = ''
			for z in range(5):
				str1 += list2[x][z]
			list1[x] = str1
			for m in range(n):
				print(list1[m])
			break
	else:
		continue
	break
else:
	print('NO')


n = int(input())
s = ''
a = ''
flag = 0
for i in range(n):
	s = input().split('|')
	if s[0] == 'OO' and flag == 0:
		a += '++|'
		a += s[1]
		flag = 1
	else:
		a += s[0] + '|'
		if s[1] == 'OO' and flag == 0:
			a += '++'
			flag = 1
		else:
			a += s[1]
if flag == 1:
	print('YES')
	for j in range(0, 5 * n, 5):
		print(a[j:j + 5])
else:
	print('NO')


rows = []
found = False
for _ in range(int(input())):
	row = input()
	if row[:2] == 'OO' or row[3:] == 'OO':
		if not found:
			row = row.replace('OO', '++', 1)
			found = True
	rows.append(row)
if found:
	print('YES')
	for row in rows:
		print(row)
else:
	print('NO')


n = int(input())
a = [input() for i in range(n)]
if 'OO|XX' not in a and 'XX|OO' not in a and ('OO|OO' not in a) and ('OO|OX' not in a) and ('OX|OO' not in a) and ('XO|OO' not in a):
	print('NO')
else:
	for i in range(n):
		if 'OO|XX' in a[i]:
			a[i] = '++|XX'
			print('YES')
			break
		if 'XX|OO' in a[i]:
			a[i] = 'XX|++'
			print('YES')
			break
		if 'OO|OO' in a[i]:
			a[i] = '++|OO'
			print('YES')
			break
		if 'OO|OX' in a[i]:
			a[i] = '++|OX'
			print('YES')
			break
		if 'OX|OO' in a[i]:
			a[i] = 'OX|++'
			print('YES')
			break
		if 'XO|OO' in a[i]:
			a[i] = 'XO|++'
			print('YES')
			break
	for i in a:
		print(i)


pos = 0
data = []
number = int(input())
for m in range(number):
	tem_data = input()
	if tem_data[0] == tem_data[1] and tem_data[0] == 'O' and (pos == 0):
		pos = 1
		tem_list = list(tem_data)
		(tem_list[0], tem_list[1]) = ('+', '+')
		tem_data = ''
		for a in tem_list:
			tem_data += a
	elif tem_data[3] == tem_data[4] and tem_data[3] == 'O' and (pos == 0):
		pos = 1
		tem_list = list(tem_data)
		(tem_list[3], tem_list[4]) = ('+', '+')
		tem_data = ''
		for a in tem_list:
			tem_data += a
	data.append(tem_data)
if pos == 0:
	print('NO')
else:
	print('YES')
	for m in data:
		print(m)


n = int(input())
isAnyTwoSeatsThere = False
seatsList = []
for i in range(n):
	string = input()
	if not isAnyTwoSeatsThere and (string[0:2] == 'OO' or string[3:5] == 'OO'):
		if string[0:2] == 'OO':
			string = list(string)
			string[0] = '+'
			string[1] = '+'
			string = ''.join(string)
		elif string[3:5] == 'OO':
			string = list(string)
			string[3] = '+'
			string[4] = '+'
			string = ''.join(string)
		isAnyTwoSeatsThere = True
	seatsList.append(string)
if isAnyTwoSeatsThere:
	print('YES')
	for string in seatsList:
		print(string)
else:
	print('NO')


n = int(input())
f = 0
ans = []
for _ in range(n):
	a = input()
	if a.find('OO') != -1 and (not f):
		a = a.replace('OO', '++', 1)
		f = 1
	ans.append(a)
if f:
	print('YES')
	for i in range(n):
		print(ans[i])
else:
	print('NO')


n = int(input())
c = 0
s_f = ''
for i in range(n):
	s = input()
	s_f = s_f + s + ' '
	if s.count('OO') != 0:
		c += s.count('OO')
if c > 0:
	print('YES')
	s_f = s_f.split()
	q = 0
	for i in range(q, n):
		if s_f[i].count('OO') != 0:
			s_f[i] = s_f[i].replace('OO', '++', 1)
			print(s_f[i])
			q += 1
			break
		else:
			print(s_f[i])
			q += 1
	for i in range(q, n):
		print(s_f[i])
else:
	print('NO')


n = int(input())
rows_in_lines = ''
status = False
while n > 0:
	rows = str(input()).split('|')
	if 'OO' in rows[0] and status == False:
		rows[0] = '++'
		status = True
	elif 'OO' in rows[1] and status == False:
		rows[1] = '++'
		status = True
	line = rows[0] + '|' + rows[1]
	if n - 1 <= 0:
		rows_in_lines += line
	else:
		rows_in_lines += line + '\n'
	n = n - 1
if status:
	print('YES')
	print(rows_in_lines)
else:
	print('NO')


a = int(input())
strings = []
win = False
for i in range(a):
	b = input()
	if b[0:2] == 'OO' and win == False:
		strings.append('++' + b[2:])
		win = True
	elif b[3:5] == 'OO' and win == False:
		strings.append(b[:3] + '++')
		win = True
	else:
		strings.append(b)
if win == True:
	print('YES')
	for i in range(a):
		print(strings[i])
else:
	print('NO')


n = int(input())
rows = []
occupied = 0
for x in range(n):
	string = input()
	if 'OO' in string:
		occupied += 1
	if occupied == 1:
		string = string.replace('OO', '++', 1)
	rows.append(string)
if occupied >= 1:
	print('YES')
	for x in rows:
		print(x)
else:
	print('NO')


n = int(input())
b = []
for i in range(n):
	a = input()
	b.append(a)
count = 0
for i in range(len(b)):
	if 'OO' in b[i]:
		if b[i] != 'OO|OO':
			b[i] = b[i].replace('OO', '++')
		else:
			b[i] = '++|OO'
		count += 1
		break
if count != 1:
	print('NO')
else:
	print('YES')
	for i in b:
		print(i)


def solve(l):
	x = 0
	replaced = ''
	index = '-1'
	for i in range(0, len(l)):
		z = list(l[i])
		for j in range(0, len(z) - 1):
			if z[j] == 'O' and z[j + 1] == 'O' and (not replaced):
				z[j] = '+'
				z[j + 1] = '+'
				replaced = ''.join(z)
				index = i
				break
	return (replaced, index)

def main():
	l = list()
	for i in range(int(input())):
		l.append(input())
	(replaced, index) = solve(l)
	if len(replaced) == 0 or index == -1:
		print('NO')
	else:
		print('YES')
		for i in range(0, len(l)):
			if i == index:
				print(replaced)
			else:
				print(l[i])
main()


t = int(input())
status = 1
str1 = []
for i in range(t):
	s = input()
	if (s[0] == s[1] == 'O' or s[3] == s[4] == 'O') and status == 1:
		status = 0
		str1.append(s.replace('OO', '++', 1))
	else:
		str1.append(s)
print('YNEOS'[status::2])
if status == 0:
	for i in range(t):
		print(str1[i])


l = []
n = int(input())
found = False
for i in range(n):
	tmp = input()
	tmp = tmp.split('|')
	if tmp[0] == 'OO' and (not found):
		found = True
		tmp[0] = '++'
	if tmp[1] == 'OO' and (not found):
		found = True
		tmp[1] = '++'
	l += [tmp]
if found:
	print('YES')
	for i in l:
		print('|'.join(i))
else:
	print('NO')


n = int(input())
a = []
for i in range(n):
	a.append(input().rstrip())
ok = False
for i in range(len(a)):
	if a[i][:2] == 'OO':
		ok = True
		a[i] = ''.join(['++', a[i][2:]])
		break
	elif a[i][3:] == 'OO':
		ok = True
		a[i] = ''.join([a[i][:3], '++'])
		break
if ok:
	print('YES')
	for s in a:
		print(s)
else:
	print('NO')


n = int(input())
busSeats = list()
for i in range(n):
	rows = list(map(str, input().split('|')))
	busSeats.append(rows)
cnt = 0
for k in range(n):
	if busSeats[k][0] == 'OO':
		busSeats[k][0] = '++'
		cnt += 1
		break
	elif busSeats[k][1] == 'OO':
		busSeats[k][1] = '++'
		cnt += 1
		break
if cnt >= 1:
	print('YES')
	for _ in range(n):
		print('|'.join(busSeats[_]))
else:
	print('NO')


n = int(input())
res = ''
flag = False
for i in range(n):
	c = input()
	if 'OO' in c and (not flag):
		c = c.replace('OO', '++', 1)
		flag = True
	res += c + '\n'
if flag:
	print('YES')
	print(res)
else:
	print('NO')


n = int(input())
seats = 'NO'
bus = []
for i in range(n):
	a = input()
	if seats == 'NO' and 'OO' in a:
		bus.append(a.replace('OO', '++', 1))
		seats = 'YES'
	else:
		bus.append(a)
print(seats)
if seats == 'YES':
	for i in bus:
		print(i)


n = int(input())
x = []
for i in range(n):
	a = list(map(str, input().split('|')))
	x.append(a)
f = 0
for i in range(n):
	if x[i][0] == 'OO':
		x[i][0] = '++'
		f = 1
		break
	if x[i][1] == 'OO':
		x[i][1] = '++'
		f = 1
		break
if f == 0:
	print('NO')
else:
	print('YES')
	for i in range(len(x)):
		print(x[i][0] + '|' + x[i][1])


n = int(input())
ls = []
flag = 0
for i in range(n):
	s = str(input())
	ls.append(s.split('|'))
for j in ls:
	if j.count('OO') >= 1:
		ij = j.index('OO')
		j[ij] = '++'
		flag = 1
		break
if flag == 1:
	print('YES')
	for k in ls:
		print(k[0] + '|', end='')
		print(k[1])
else:
	print('NO')


n = int(input())
bc = list()
r = False
for i in range(n):
	s = input()
	if s[0:2] == 'OO':
		if not r:
			s = '++' + s[2:]
			r = True
	elif s[3:5] == 'OO':
		if not r:
			s = s[0:3] + '++'
			r = True
	bc.append(s)
if r:
	print('YES')
	for i in range(n):
		print(bc[i])
else:
	print('NO')


seat = 'NO'
cases = []
result = []
final = []
times = int(input())
for i in range(times):
	cases.append(input())
for line in cases:
	rows = line.split('|')
	for i in range(2):
		if seat == 'NO':
			if rows[i] == 'OO':
				seat = 'YES'
				result.append('++')
			else:
				result.append(rows[i])
		else:
			result.append(rows[i])
for i in range(0, len(result), 2):
	final.append('%s|%s' % (result[i], result[i + 1]))
print('%s' % seat)
if seat == 'YES':
	for i in range(len(cases)):
		print('%s' % final[i])


x = int(input())
a = []
for i in range(x):
	a.append(str(input()))
n = 0
for v in range(x):
	place = a[v]
	place = place.split('|')
	if place[0] == 'OO':
		n = 1
		a[v] = '++|' + place[1]
		break
	elif place[1] == 'OO':
		n = 1
		a[v] = place[0] + '|++'
		break
	else:
		pass
if n == 0:
	print('NO')
else:
	print('YES')
	for i in range(x):
		print(a[i])


l = []
for i in range(int(input())):
	l.append(list(input()))
for i in range(len(l)):
	if l[i][0] == 'O' and l[i][1] == 'O':
		(l[i][0], l[i][1]) = ('+', '+')
		print('Yes')
		for i in l:
			i = ''.join(i)
			print(i)
		break
	elif l[i][3] == 'O' and l[i][4] == 'O':
		(l[i][3], l[i][4]) = ('+', '+')
		print('Yes')
		for i in l:
			i = ''.join(i)
			print(i)
		break
else:
	print('No')


r = int(input())
a = 0
L = []
for i in range(r):
	L.append(input())
	while 'OO' in L[i] and (not a):
		a += 1
		if L[i].count('OO') == 2:
			L[i] = '++|OO'
		else:
			ff = L[i].split('OO')
			L[i] = '++'.join(ff)
	else:
		a += 0
if a:
	print('YES')
	for x in L:
		print(x)
else:
	print('NO')


N = int(input())
x = 0
L = []
for i in range(N):
	tmps = str(input())
	tmp = []
	for i in tmps:
		tmp.append(i)
	if x == 0:
		if tmp[0] == 'O' and tmp[1] == 'O':
			tmp[0] = '+'
			tmp[1] = '+'
			x = 1
		elif tmp[3] == 'O' and tmp[4] == 'O':
			tmp[4] = '+'
			tmp[3] = '+'
			x = 1
	L.append(tmp)
if x == 0:
	print('NO')
else:
	print('YES')
	for i in range(N):
		print(*L[i], sep='')


rows = input()
l = ''
for i in range(int(rows)):
	pair = input()
	l += pair + '\n'
if 'OO' not in l:
	print('NO')
elif 'OO' in l:
	print('YES')
	l = l.replace('OO', '++', 1)
	print(l)


n = int(input())
answer = 'NO'
config = ''
for i in range(n):
	therow = input()
	if answer == 'NO':
		if therow[0] == 'O' and therow[1] == 'O':
			answer = 'YES'
			newrow = '++' + therow[2:5]
			config += newrow + '\n'
		elif therow[3] == 'O' and therow[4] == 'O':
			answer = 'YES'
			newrow = therow[:3] + '++'
			config += newrow + '\n'
		else:
			config += therow + '\n'
	else:
		config += therow + '\n'
if answer == 'NO':
	print('NO')
else:
	print('YES')
	print(config)


t = int(input())
lst = []
a = 0
while t:
	t = t - 1
	lst1 = []
	lst1 = list(map(str, input().strip().split('|')))
	if a == 0:
		if 'OO' in lst1:
			lst1[lst1.index('OO')] = '++'
			a = 1
	lst.append(lst1)
if a == 1:
	print('YES')
	for i in lst:
		print(i[0] + '|' + i[1])
else:
	print('NO')


r = int(input())
lst = []
yes = False
for a in range(0, r):
	v = input()
	if not yes:
		two = v.split('|')
		x = ''
		if two[0] == 'OO':
			x = '++|'
			x = x + two[1]
		elif two[1] == 'OO':
			x = two[0] + '|++'
		if len(x) > 0:
			yes = True
			lst.append(x)
		else:
			lst.append(v)
	else:
		lst.append(v)
if yes:
	print('YES')
	for b in lst:
		print(b)
else:
	print('NO')


n = int(input())
seating = False
free_space_index = -1
seats = []
for i in range(n):
	row = input()
	seats.append(row)
	if 'OO' in row and (not seating):
		free_space_index = i
		seating = True
if seating:
	print('YES')
	for (i, row) in enumerate(seats):
		if i == free_space_index:
			print(row.replace('OO', '++', 1))
		else:
			print(row)
else:
	print('NO')


n = int(input())
found = False
l = []
for _ in range(n):
	s = input().strip()
	if not found and s.find('OO') >= 0:
		s = s.replace('OO', '++', 1)
		found = True
	l.append(s)
if found:
	print('YES')
	for i in l:
		print(i)
else:
	print('NO')


n = int(input())
bus = []
status = False
for i in range(n):
	z = str(input())
	bus.append(z)
	if z[0] == 'O' and z[1] == 'O' and (status == False):
		status = True
		if z[3] == 'O' and z[4] == 'O':
			bus[i] = '++|OO'
		elif z[3] == 'O' and z[4] == 'X':
			bus[i] = '++|OX'
		elif z[3] == 'X' and z[4] == 'O':
			bus[i] = '++|XO'
		elif z[3] == 'X' and z[4] == 'X':
			bus[i] = '++|XX'
	elif z[3] == 'O' and z[4] == 'O' and (status == False):
		status = True
		if z[0] == 'O' and z[1] == 'O':
			bus[i] = 'OO|++'
		elif z[0] == 'X' and z[1] == 'O':
			bus[i] = 'XO|++'
		elif z[0] == 'O' and z[1] == 'X':
			bus[i] = 'OX|++'
		elif z[0] == 'X' and z[1] == 'X':
			bus[i] = 'XX|++'
if status:
	print('YES')
	for i in range(len(bus)):
		print(bus[i])
else:
	print('NO')


n = int(input())
flag = False
seat = []
for i in range(n):
	line = input()
	if not flag:
		newline = line.replace('OO', '++', 1)
		if line != newline:
			line = newline
			flag = True
	seat.append(line)
if flag:
	print('YES')
	for line in seat:
		print(line)
else:
	print('NO')


n = int(input())
places = [input() for i in range(n)]
res = False
for i in range(len(places)):
	if places[i][0] == places[i][1] == 'O' and (not res):
		res = True
		places[i] = '++' + places[i][2:]
	elif places[i][3] == places[i][4] == 'O' and (not res):
		res = True
		places[i] = places[i][:3] + '++'
if res:
	print('YES')
	for i in places:
		print(i)
else:
	print('NO')


n = int(input())
a = []
count = 0
for i in range(n):
	s = input()
	a.append(s)
for i in range(len(a)):
	if 'OO' in a[i]:
		a[i] = a[i].replace('OO', '++', 1)
		print('YES')
		for i in a:
			print(i)
		break
for i in range(len(a)):
	if '++' not in a[i]:
		count += 1
if count == len(a):
	print('NO')


size = int(input())
ls = []
con = 0
for i in range(size):
	ls.append(input())
for i in range(len(ls)):
	s = ls[i]
	if s[0] == 'O' and s[1] == 'O' and (s[3] == 'O') and (s[4] == 'O'):
		ls[i] = '++|OO'
		con = 1
		break
	elif s[0] == 'O' and s[1] == 'O' and (s[3] == 'O') and (s[4] == 'X'):
		ls[i] = '++|OX'
		con = 1
		break
	elif s[0] == 'O' and s[1] == 'O' and (s[3] == 'X') and (s[4] == 'O'):
		ls[i] = '++|XO'
		con = 1
		break
	elif s[0] == 'O' and s[1] == 'O' and (s[3] == 'X') and (s[4] == 'X'):
		ls[i] = '++|XX'
		con = 1
		break
	elif s[0] == 'X' and s[1] == 'O' and (s[3] == 'O') and (s[4] == 'O'):
		ls[i] = 'XO|++'
		con = 1
		break
	elif s[0] == 'O' and s[1] == 'X' and (s[3] == 'O') and (s[4] == 'O'):
		ls[i] = 'OX|++'
		con = 1
		break
	elif s[0] == 'X' and s[1] == 'X' and (s[3] == 'O') and (s[4] == 'O'):
		ls[i] = 'XX|++'
		con = 1
		break
if con == 1:
	print('YES')
	for i in range(len(ls)):
		print(ls[i])
else:
	print('NO')


n = int(input())
l = []
flag = 1
for i in range(n):
	s = input()
	s = list(s)
	l.append(s)
for i in range(n):
	if l[i][0] == l[i][1]:
		if l[i][0] == 'O':
			l[i][0] = '+'
			l[i][1] = '+'
			flag = 0
			break
	if l[i][3] == l[i][4]:
		if l[i][3] == 'O':
			l[i][3] = '+'
			l[i][4] = '+'
			flag = 0
			break
if flag == 0:
	print('Yes')
	m = []
	for i in range(len(l)):
		k = ''.join(l[i])
		m.append(k)
	for i in range(len(m)):
		print(m[i])
else:
	print('NO')


n = int(input())
l = []
for i in range(n):
	x = input()
	l.append(x)
f = 0
for i in range(len(l)):
	y = l[i].split('|')
	if y[0].count('O') == 2:
		f = 1
		l[i] = l[i].replace('OO', '++', 1)
		break
	if y[1].count('O') == 2:
		f = 1
		l[i] = l[i].replace('OO', '++', 1)
		break
	else:
		f = 0
if f == 0:
	print('NO')
else:
	print('YES')
	for i in l:
		print(i)


def printBus():
	print('YES')
	for row in bus:
		for char in row:
			print(char, end='')
		print()
n = int(input())
busAux = []
bus = []
for i in range(n):
	busAux.append(input())
for row in busAux:
	curStr = []
	for char in row:
		curStr.append(char)
	bus.append(curStr)
for row in bus:
	if row[0] == row[1] == 'O':
		row[0] = '+'
		row[1] = '+'
		printBus()
		exit()
	if row[3] == row[4] == 'O':
		row[3] = '+'
		row[4] = '+'
		printBus()
		exit()
print('NO')


c1 = 0
c2 = 3
occ = 'X'
empty = 'O'

def isValid(i, row):
	if i == c1 or i == c2:
		c = row[i]
		nextC = row[i + 1]
		if c == empty and nextC == empty:
			return True
	return False

def solve(s):
	res = s
	hasAnswer = False
	for (k, row) in enumerate(s):
		for (i, c) in enumerate(row):
			if isValid(i, row) and (not hasAnswer):
				hasAnswer = True
				if i == c1:
					res[k] = '++' + res[k][2:]
				else:
					res[k] = res[k][:3] + '++'
	if hasAnswer:
		print('YES')
		for s in res:
			print(s)
	else:
		print('NO')
n = int(input())
s = []
for i in range(n):
	_s = input()
	s.append(_s)
solve(s)


n = int(input())
seats_found = 'NO'
seats_out = []
for i in range(n):
	row = input().split('|')
	if 'OO' == row[0] and seats_found == 'NO':
		seats_found = 'YES'
		row[0] = '++'
	elif 'OO' == row[1] and seats_found == 'NO':
		seats_found = 'YES'
		row[1] = '++'
	seats_out.append(row[0] + '|' + row[1])
if seats_found == 'YES':
	print(seats_found)
	for row in seats_out:
		print(row)
else:
	print(seats_found)


n = int(input())
l = []
p = False
for x in range(n):
	s = list(input())
	if p == False:
		if s[0] == s[1] and s[0] == 'O':
			p = True
			s[0] = '+'
			s[1] = '+'
		if p == False and s[3] == s[4] and (s[3] == 'O'):
			p = True
			s[3] = '+'
			s[4] = '+'
	l.append(s)
if p == False:
	print('NO')
else:
	print('YES')
	tmp = ''
	for x in l:
		for i in x:
			tmp += i
		print(tmp)
		tmp = ''


n = int(input())
bus = []
for i in range(0, n):
	bus.append(input())
answer = 'NO'
i = 0
while answer == 'NO' and n - 1 >= i:
	if bus[i][0] + bus[i][1] == 'OO':
		answer = 'YES'
		bus[i] = '++|' + bus[i][3] + bus[i][4]
	elif bus[i][3] + bus[i][4] == 'OO':
		answer = 'YES'
		bus[i] = bus[i][0] + bus[i][1] + '|++'
	i += 1
print(answer)
if answer == 'YES':
	for i in range(0, n):
		print(bus[i])


n = int(input())
res = []
found = False
for _ in range(n):
	line = input()
	(place1, place2) = line.split('|')
	if not found:
		if place1 == 'OO':
			res.append('++|' + place2)
			found = True
		elif place2 == 'OO':
			res.append(place1 + '|++')
			found = True
		else:
			res.append(line)
	else:
		res.append(line)
if found:
	print('YES')
	print('\n'.join(res))
else:
	print('NO')


def solve(N, A):
	for (i, s) in enumerate(A):
		idx = s.find('OO')
		if idx != -1:
			ss = list(s)
			ss[idx:idx + 2] = ['+'] * 2
			A[i] = ''.join(ss)
			return True
	return False
N = int(input().strip())
A = []
for i in range(N):
	s = input().strip()
	A.append(s)
ans = solve(N, A)
if ans:
	print('YES')
	print(*A, sep='\n')
else:
	print('NO')


n = int(input())
l = []
for i in range(n):
	l.append(input().split('|'))
f = 0
for i in range(n):
	for k in range(2):
		if l[i][k] == 'OO':
			l[i][k] = '++'
			f = 1
			break
	if f == 1:
		break
if f == 1:
	print('YES')
	for m in l:
		print(m[0] + '|' + m[1])
else:
	print('NO')


a = int(input())
b = [input() for x in range(a)]
k = 0
p = 0
for i in b:
	if i[0] + i[1] == 'OO':
		k = 1
		b[p] = '++|' + i[3] + i[4]
		break
	elif i[3] + i[4] == 'OO':
		k = 1
		b[p] = i[0] + i[1] + '|++'
		break
	p += 1
if k == 1:
	print('YES')
	for i in b:
		print(i)
else:
	print('NO')


n = int(input())
a = []
for i in range(n):
	a.append(input())
flag = 0
for i in range(n):
	if 'OO' in a[i]:
		flag = 1
		a[i] = a[i].replace('OO', '++', 1)
		break
if flag == 0:
	print('NO')
else:
	print('YES')
	print('\n'.join(a))


from sys import exit as sys_ret
amount = int(input())
flag = 0
bus = []
for i in range(amount):
	bus.append(input())
	if flag == 1:
		continue
	if bus[i][0] == bus[i][1] and bus[i][0] == 'O':
		flag = 1
		bus[i] = '++|' + bus[i][3] + bus[i][4]
	elif bus[i][3] == bus[i][4] and bus[i][3] == 'O':
		flag = 1
		bus[i] = bus[i][0] + bus[i][1] + '|++'
if flag == 0:
	print('NO')
	sys_ret(0)
print('YES')
for i in bus:
	print(i)


n = int(input())
b = []
pos = 0
index = 0
for i in range(n):
	a = str(input())
	if 'OO' in a and index == 0:
		a = a.replace('OO', '++', 1)
		index = 1
		pos = i + 1
	b.append(a)
if pos != 0:
	print('YES')
elif pos == 0:
	print('NO')
	exit()
for line in b:
	print(line)


a = int(input())
s = []
(b, c) = (0, 0)
key = False
for i in range(a):
	s.append(input().split('|'))
for i in range(a):
	for x in range(2):
		if s[i][x] == 'OO':
			b = i
			c = x
			key = True
			break
	if key:
		break
if not key:
	print('NO')
else:
	s[i][x] = '++'
	print('YES')
	for i in s:
		print('|'.join(i))


n = int(input())
checker = 0
s = []
for i in range(n):
	s.append(input())
	if not checker:
		if s[i][0] == 'O' and s[i][1] == 'O':
			s[i] = list(s[i])
			s[i][0] = '+'
			s[i][1] = '+'
			s[i] = ''.join(s[i])
			checker = 1
		elif s[i][3] == 'O' and s[i][4] == 'O':
			s[i] = list(s[i])
			s[i][3] = '+'
			s[i][4] = '+'
			s[i] = ''.join(s[i])
			checker = 1
if checker:
	print('YES')
	for i in range(n):
		print(s[i])
else:
	print('NO')


n = int(input())
output_yes = False
rows = []
for i in range(n):
	row = input()
	if not output_yes:
		can_sit = bool(row.count('OO'))
		if can_sit:
			row = row.replace('OO', '++', 1)
			output_yes = True
	rows.append(row)
if output_yes:
	print('YES')
	for row in rows:
		print(row)
else:
	print('NO')


seats = int(input())
mylist = [None] * seats
check = 0
for i in range(seats):
	mylist[i] = list(input())
for i in range(seats):
	for j in range(5):
		if j <= 3:
			if mylist[i][j] == 'O' and mylist[i][j + 1] == 'O':
				check = 1
				mylist[i][j] = '+'
				mylist[i][j + 1] = '+'
				break
	if check == 1:
		break
if check == 1:
	print('YES')
	for i in range(seats):
		for j in range(5):
			print(mylist[i][j], end='')
		print('')
else:
	print('NO')


n = int(input())
list1 = []
k = 1
for i in range(n):
	row = input()
	if 'OO' in row and k == 1:
		list1.append(row.replace('OO', '++', 1))
		k = 0
	else:
		list1.append(row)
if '++' in ' '.join(list1):
	print('YES')
	for i in list1:
		print(i)
else:
	print('NO')


n = int(input())
A = [input() for i in range(n)]
flag = False
for i in range(n):
	if A[i][0:2] == 'OO':
		A[i] = '++' + A[i][2:]
		flag = True
		break
	if A[i][3:5] == 'OO':
		A[i] = A[i][:3] + '++'
		flag = True
		break
if flag:
	print('YES')
	for s in A:
		print(s)
else:
	print('NO')


n = int(input())
result = []
z = 0
for i in range(n):
	place = input()
	if place.count('OO') > 0:
		if z == 0:
			result.append(place.replace('OO', '++', 1))
			z += 1
		else:
			result.append(place)
	else:
		result.append(place)
if z == 1:
	print('YES')
	for elem in result:
		print(elem, end='\n')
else:
	print('NO')


n = int(input())
l = []
for i in range(n):
	s = input()
	a = s[:2]
	b = s[3:]
	l.append(a)
	l.append(b)
ans = 0
for i in range(len(l)):
	if l[i] == 'OO':
		l[i] = '++'
		ans = 1
		break
if ans == 1:
	i = 0
	print('YES')
	while i < len(l) - 1:
		s = ''
		s = l[i] + '|' + l[i + 1]
		print(s)
		i += 2
else:
	print('NO')


numberRows = int(input())
seats = []
find = False
for _ in range(0, numberRows):
	currentSeats = list(input())
	if find is False and currentSeats[0] is 'O' and (currentSeats[1] is 'O'):
		find = True
		currentSeats[0] = '+'
		currentSeats[1] = '+'
	elif find is False and currentSeats[3] is 'O' and (currentSeats[4] is 'O'):
		find = True
		currentSeats[3] = '+'
		currentSeats[4] = '+'
	seats.append(currentSeats)
if find is True:
	print('YES')
	for currentSeats in seats:
		print(*currentSeats, sep='')
else:
	print('NO')


n = int(input())
mat = []
for i in range(n):
	mat.append(input())
k = False
for i in range(n):
	if 'OO' in mat[i]:
		if mat[i][:2] == 'OO':
			mat[i] = '++' + mat[i][2:]
		else:
			mat[i] = mat[i][:3] + '++'
		k = True
		break
if not k:
	print('NO')
else:
	print('YES')
	for i in mat:
		print(i)


n = int(input())
f = 0
v2 = []
for i in range(n):
	t = input()
	v = [i for i in t]
	if f == 0 and v[0] == 'O' and (v[1] == 'O'):
		(v[0], v[1]) = ('+', '+')
		f = 1
	elif f == 0 and v[3] == 'O' and (v[4] == 'O'):
		(v[3], v[4]) = ('+', '+')
		f = 1
	v2.append(v)
if f == 0:
	print('NO')
else:
	print('YES')
	for j in range(n):
		print(''.join(v2[j]))


number = int(input())
sits = [input() for s in range(number)]
cn = 0
for i in range(number):
	if sits[i].find('OO') != -1:
		sits[i] = sits[i].replace('OO', '++', 1)
		print('YES', *[a for a in sits], sep='\n')
		cn = 1
		break
if cn != 1:
	print('NO')


n = int(input())
f = 0
res = []
for _ in range(n):
	s = input().split('|')
	if s[0] == 'OO' and f == 0:
		f = 1
		s[0] = '++'
	elif s[1] == 'OO' and f == 0:
		f = 1
		s[1] = '++'
	res.append('|'.join(s))
if f:
	print('YES')
	print(*res, sep='\n')
else:
	print('NO')


rows = int(input())
flg = 0
alist = [[seat for seat in input()] for i in range(rows)]
for i in range(rows):
	if flg == 0:
		for t in range(4):
			if 'O' in alist[i][t]:
				if 'O' in alist[i][t + 1]:
					alist[i][t] = '+'
					alist[i][t + 1] = '+'
					flg += 1
					break
if flg != 0:
	print('YES')
	for i in range(rows):
		print(''.join(alist[i]))
else:
	print('NO')


n = int(input())
s = '\n'.join((input() for k in range(n)))
if s.find('OO') == -1:
	print('NO')
else:
	print('YES')
	print(s.replace('OO', '++', 1))


l = int(input())
s = []
for i in range(l):
	s.append(input())
df = -1
hi = False
for i in range(l):
	if 'OO' in s[i]:
		print('YES')
		hi = True
		break
	df = df + 1
if not hi:
	print('NO')
else:
	s[df + 1] = s[df + 1].replace('OO', '++', 1)
	for j in s:
		print(j)


l = []
n = int(input())
for _ in range(n):
	s = list(input())
	l.append(s)
for i in range(n):
	if l[i][0] == 'O' and l[i][1] == 'O':
		l[i][0] = '+'
		l[i][1] = '+'
		print('YES')
		for j in range(n):
			for x in range(5):
				print(str(l[j][x]), end='')
			print()
		break
	elif l[i][3] == 'O' and l[i][4] == 'O':
		l[i][3] = '+'
		l[i][4] = '+'
		print('YES')
		for j in range(n):
			for x in range(5):
				print(str(l[j][x]), end='')
			print()
		break
else:
	print('NO')


import sys
flag = True

def f(l):
	global flag
	if flag and 'OO' in l:
		flag = False
		l = l.replace('OO', '++', 1)
	return l
res = list(map(f, sys.stdin.readlines()[1:]))
print('NO') if flag else print('YES', ''.join(res), sep='\n')


lst = []
s = 0
z = int(input())
for x in range(z):
	c = [str(v) for v in input().split('|')]
	lst.append(c[0])
	lst.append(c[1])
for b in range(z * 2):
	if 'X' not in lst[b]:
		lst[b] = '++'
		s += 1
		break
print(['NO', 'YES'][s > 0])
if s > 0:
	for n in range(z * 2):
		if n % 2 != 0:
			print('|' + lst[n])
		else:
			print(lst[n], end='')


n = int(input())
seats = []
position = 0
e = 0
f = 0
for i in range(n):
	seat = input()
	seats.append(seat)
	a = 'OO'
	if seat[0:2] == a:
		c = 'YES'
		d = i
		e = 1
		f = 1
	elif seat[3:] == a:
		c = 'YES'
		d = i
		e = 1
		f = 3
	else:
		continue
if f == 1:
	h = seats[d]
	seats[d] = '++' + h[2:]
elif f == 3:
	h = seats[d]
	seats[d] = h[0:3] + '++'
else:
	f = 0
if e == 1:
	print(c)
	for i in range(len(seats)):
		print(seats[i])
else:
	print('NO')


n = int(input())
fl = False
vc = []
for i in range(n):
	s = input()
	t = ''
	mark = -1
	for j in range(0, 4, 3):
		if s[j] is 'O' and s[j + 1] is 'O' and (fl is False):
			mark = j
			fl = True
	for ptr in range(0, len(s)):
		if (ptr == mark or ptr == mark + 1) and mark is not -1:
			t = t + '+'
		else:
			t = t + s[ptr]
	vc.append(t)
if fl is False:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(vc[i])


c = []
j = True
n = int(input())
for i in range(n):
	l = list(map(str, input().split('|')))
	if 'OO' in l:
		if j:
			l[l.index('OO')] = '++'
			j = False
	c.append(l)
if not j:
	print('YES')
	for i in range(n):
		print('|'.join(c[i]))
else:
	print('NO')


lst = []
nd = 0
for _ in range(int(input())):
	s = input()
	if 'OO' in s[0:2] and nd == 0:
		lst.append('++' + s[2:])
		nd = 1
	elif 'OO' in s[3:] and nd == 0:
		lst.append(s[0:2] + '|' + '++')
		nd = 1
	else:
		lst.append(s)
if nd == 1:
	print('YES')
	for i in lst:
		print(i)
else:
	print('NO')


n = int(input())
s = [input() for _ in range(n)]
for (i, r) in enumerate(s):
	if 'OO' in r:
		s[i] = r.replace('OO', '++', 1)
		print('YES')
		print('\t'.join(s))
		break
else:
	print('NO')


n = int(input())
flag = 0
s = []
for i in range(n):
	a = input()
	if a[0] == a[1] and a[0] == 'O' and (flag != 1):
		s += ['++' + a[2:]]
		flag = 1
	elif a[3] == a[4] and a[3] == 'O' and (flag != 1):
		s += [a[:3] + '++']
		flag = 1
	else:
		s += [a]
if not flag:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(s[i])


n = int(input())
l = []
for u in range(n):
	l.append(input())
f = 0
for i in range(n):
	if 'OO' in l[i]:
		l[i] = l[i].replace('OO', '++', 1)
		f = 1
		break
if f == 1:
	print('YES')
	for i in l:
		print(i)
else:
	print('NO')


n = int(input())
seat = 0
configuration = [''] * 2000
isFind = False
for i in range(0, 2 * n, 2):
	seats = input()
	configuration[i] = seats[:2]
	configuration[i + 1] = seats[3:]
	if seats[:2] == 'OO':
		seat = i
		isFind = True
	elif seats[3:] == 'OO':
		seat = i + 1
		isFind = True
if isFind:
	print('YES')
	for i in range(2 * n):
		if seat == i:
			print('++', end='')
		else:
			print(configuration[i], end='')
		if i % 2 == 0:
			print('|', end='')
		else:
			print()
else:
	print('NO')


n = int(input())
found = False
myList = []
for i in range(n):
	x = input()
	if 'OO' in x and found == False:
		x = x.replace('OO', '++', 1)
		found = True
	myList.append(x)
if found == False:
	print('NO')
	exit()
else:
	print('YES')
	for i in range(len(myList)):
		print(myList[i])


n1 = int(input())
list_line = []
flag = 0
for i in range(n1):
	line = str(input())
	if (line[:2] == 'OO' or line[-2:] == 'OO') and flag == 0:
		flag = 1
		list_line.insert(0, 'YES')
		line = line.replace('OO', '++', 1)
		list_line.append(line)
	else:
		list_line.append(line)
if flag == 0:
	print('NO')
else:
	for i in range(len(list_line)):
		print(list_line[i])


import sys
import os
rowsNum = int(sys.stdin.readline())

def isPain(x):
	reallist = x
	for y in range(0, rowsNum * 2):
		if reallist[y] == 'OO':
			reallist[y] = '++'
			return 1
		elif reallist[y] == 'OO\n':
			reallist[y] = '++\n'
			return 1
		else:
			continue
	return 0
row = sys.stdin.readline().split('|')
for x in range(0, rowsNum):
	row = row + sys.stdin.readline().split('|')
if isPain(row) == 1:
	print('YES')
	for y in range(0, rowsNum * 2, 2):
		print('%s%s%s' % (row[y], '|', row[y + 1]), end='')
else:
	print('NO')


n = int(input())
index = -1
seats = []
for i in range(n):
	s = input()
	seats.append(s)
	if 'OO' in s and index == -1:
		index = i
if index != -1:
	(left, right) = seats[index].split('|')
	if left == 'OO':
		seats[index] = '++|{}'.format(right)
	else:
		seats[index] = '{}|++'.format(left)
	print('YES')
	print('\n'.join(seats))
else:
	print('NO')


n = int(input())
v = 0
sl = []
for i in range(n):
	d = input()
	if v == 0:
		d = list(d)
		if d[0] == 'O' and d[1] == 'O':
			d[0] = '+'
			d[1] = '+'
			v = 1
		elif d[3] == 'O' and d[4] == 'O':
			d[3] = '+'
			d[4] = '+'
			v = 1
		s = ''
		for i in range(5):
			s += d[i]
		sl.append(s)
	else:
		sl.append(d)
if v != 0:
	print('YES')
	for i in range(n):
		print(sl[i])
else:
	print('NO')


places = []
n = int(input())
answer = 'NO'
for i in range(n):
	(l, k) = input().split('|')
	places.append(l)
	places.append(k)
for k in range(0, 2 * n):
	if 'OO' == places[k]:
		places[k] = '++'
		answer = 'YES'
		break
print(answer)
if answer == 'YES':
	for m in range(0, 2 * n - 1, 2):
		print(places[m] + '|' + places[m + 1])


n = int(input().strip())
rows = []
found = False
for i in range(n):
	r = input().strip()
	if not found:
		(col1, col2) = r.split('|')
		if col1 == 'OO':
			r = '++|{}'.format(col2)
			found = True
		elif col2 == 'OO':
			r = '{}|++'.format(col1)
			found = True
	rows.append(r)
if found:
	print('YES')
	for r in rows:
		print(r)
else:
	print('NO')


n = int(input())
lst = []
it = 0
for i in range(n):
	a = input()
	if it == 0 and 'OO' in a:
		if a.find('OO') == 0:
			lst.append('++|' + a[3:])
		else:
			lst.append(a[:2] + '|++')
		it += 1
	else:
		lst.append(a)
if it == 1:
	print('YES')
	for i in lst:
		print(i)
else:
	print('NO')


n = int(input())
bus = []
for i in range(n):
	bus.append(input().strip())
flag = False
for i in range(n):
	if bus[i].find('OO') == 0:
		bus[i] = '++' + bus[i][2:]
		flag = True
		break
	elif bus[i].find('OO') == 3:
		bus[i] = bus[i][:3] + '++'
		flag = True
		break
if flag:
	print('YES')
	print('\n'.join(bus))
else:
	print('NO')


n = int(input())
flag = False
l1 = []
for i in range(n):
	s = input()
	l = list(s)
	if (l[0] == 'O' and l[1] == 'O') and (not flag):
		flag = True
		l[0] = '+'
		l[1] = '+'
	elif (l[-1] == 'O' and l[-2] == 'O') and (not flag):
		flag = True
		l[-1] = '+'
		l[-2] = '+'
	l1.append(l)
if flag:
	print('YES')
	for i in range(n):
		print(''.join(l1[i]))
else:
	print('NO')


n = int(input())
a = []
d = False
x = 0
z = 0
for i in range(n):
	a += [input()]
	if a[i][0] == 'O' and a[i][1] == 'O' and (not d):
		d = True
		x = i
	elif a[i][3] == 'O' and a[i][4] == 'O' and (not d):
		d = True
		x = i
		z = 3
if d:
	print('YES')
	for i in range(n):
		if i != x:
			print(a[i])
		else:
			if z == 0:
				print('++' + a[i][2:])
			if z == 3:
				print(a[i][:3] + '++')
else:
	print('NO')


n = int(input())
seated = False
all_seats = []
for row in range(n):
	seats = input().split('|')
	for i in range(len(seats)):
		if not seated and seats[i] == 'OO':
			seats[i] = '++'
			seated = True
	all_seats.append('|'.join(seats))
if seated:
	print('YES')
	for row in all_seats:
		print(row)
else:
	print('NO')


x = int(input())
lst = []
a = 0
for i in range(x):
	y = input()
	if a == 0:
		if y[:2] == 'OO':
			a = 1
			lst.append('++' + y[2:5])
		elif y[3:5] == 'OO':
			a = 1
			lst.append(y[:3] + '++')
		else:
			lst.append(y)
	else:
		lst.append(y)
if a == 1:
	print('YES')
	for i in lst:
		print(i)
else:
	print('NO')


n = int(input())
rows = []
can_sit = False
for i in range(n):
	rows.append(input().split('|'))
for (i, (pair1, pair2)) in enumerate(rows):
	if pair1 == 'OO':
		rows[i][0] = '++'
		can_sit = True
		break
	elif pair2 == 'OO':
		rows[i][1] = '++'
		can_sit = True
		break
if can_sit:
	print('YES')
	for row in rows:
		print('{}|{}'.format(row[0], row[1]))
else:
	print('NO')


n = int(input())
s = []
q = 3
for i in range(n):
	sp = input()
	sp1 = sp[:2]
	sp2 = sp[3:5]
	if q != 5:
		if sp[0] + sp[1] == 'OO':
			sp1 = '++'
			q = 5
		elif sp[3] + sp[4] == 'OO':
			sp2 = '++'
			q = 5
	s.append(sp1 + sp[2] + sp2)
if q != 5:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(s[i])


n = int(input())
result = []
find = True
add = True
for i in range(n):
	tmp = input()
	if find and tmp[0:2] == 'OO':
		result.append('++|' + tmp[3:5])
		find = False
		add = False
	if find and tmp[3:5] == 'OO':
		result.append(tmp[0:2] + '|++')
		find = False
		add = False
	elif add:
		result.append(tmp)
	add = True
if find:
	print('NO')
else:
	print('YES')
	for i in result:
		print(i)


def disec(i, x, y):
	lis = list(i)
	lis[x] = '+'
	lis[y] = '+'
	return ''.join(lis)
n = input()
strin = []
strin2 = []
done = False
done2 = False
for i in range(int(n)):
	strin.append(input())
for i in strin:
	if i[0] == 'O' and i[1] == 'O' and (done == False) and (done2 == False):
		strin2.append(disec(i, 0, 1))
		done = True
	elif i[3] == 'O' and i[4] == 'O' and (done == False) and (done2 == False):
		strin2.append(disec(i, 3, 4))
		done2 = True
	else:
		strin2.append(i)
if done == False and done2 == False:
	print('NO')
else:
	print('YES')
	for i in strin2:
		print(i)


def check_seats(i, j):
	if i == 'O' and j == 'O':
		return True
	return False
n = int(input())
solved = False
rows = []
for _ in range(n):
	row = input()
	if solved:
		print(row)
		continue
	if check_seats(row[0], row[1]):
		solved = True
		print('YES')
		for e in rows:
			print(e)
		print('++' + row[2:5])
		continue
	if check_seats(row[3], row[4]):
		solved = True
		print('YES')
		for e in rows:
			print(e)
		print(row[0:3] + '++')
		continue
	rows.append(row)
if not solved:
	print('NO')


n = int(input())
result = []
done = False
for i in range(n):
	row = input()
	if done:
		result.append(row)
	elif row[:2] == 'OO':
		done = True
		result.append('++' + row[2:])
	elif row[3:] == 'OO':
		done = True
		result.append(row[:3] + '++')
	else:
		result.append(row)
if done:
	print('YES')
	for row in result:
		print(row)
else:
	print('NO')


n = int(input())
c = 0
a = []
for i in range(n):
	x = input()
	a.append(x)
	if 'OO' in x and c == 0:
		c += 1
if c == 0:
	print('NO')
else:
	t = ''
	print('YES')
	for i in range(len(a)):
		if 'OO' in a[i] and c == 1:
			t += a[i].replace('OO', '++')
			if t.count('+') == 4:
				print('++|OO')
			else:
				print(t)
			c += 1
		else:
			print(a[i])


n = int(input())
rows = []
for i in range(int(n)):
	row = input()
	rows.append(row)
count = -1
for seat in rows:
	count += 1
	if seat[0:2] == 'OO' or seat[3:] == 'OO':
		rows[count] = seat.replace('OO', '++', 1)
		print('YES')
		for row in rows:
			print(row)
		break
	if count == n - 1:
		print('NO')


n = int(input())
flag = False
l = []
for i in range(n):
	c = input()
	if flag == False:
		if c[:2] == 'OO':
			flag = True
			c = '++' + c[2:]
		elif c[3:] == 'OO':
			flag = True
			c = c[:3] + '++'
	l.append(c)
if flag:
	print('YES')
	for i in l:
		print(i)
else:
	print('NO')


n = int(input())
M = [input() for i in range(n)]
c = 0
for i in range(n):
	if c == 0:
		for j in range(4):
			if M[i][j] == 'O' and M[i][j + 1] == 'O':
				c = 1
				if j == 0:
					M[i] = '++' + M[i][2:]
					break
				if j == 3:
					M[i] = M[i][:3] + '++'
					break
if c == 1:
	print('YES')
	for i in range(n):
		print(M[i])
else:
	print('No')


n = int(input())
s = [input().split('|') for _ in range(n)]
ok = False
for i in range(n):
	if not ok and s[i][0] == 'OO':
		s[i][0] = '++'
		ok = True
	if not ok and s[i][1] == 'OO':
		s[i][1] = '++'
		ok = True
if not ok:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print('|'.join(s[i]))


n = int(input())
bus_config = []
success = False
for _ in range(n):
	row = input().split('|')
	if not success:
		if row[0] == 'OO':
			row[0] = '++'
			success = True
		elif row[1] == 'OO':
			row[1] = '++'
			success = True
	bus_config.append(row[0] + '|' + row[1])
if success:
	print('YES')
	for row in bus_config:
		print(row)
else:
	print('NO')


def main():
	n = int(input())
	seats = []
	pair = 0
	for i in range(n):
		x = input()
		if 'OO' in x and pair != 1:
			x = x.replace('OO', '++', 1)
			pair += 1
		seats.append(x)
	if pair == 1:
		print('YES')
		print(*seats, sep='\n')
	elif pair == 0:
		print('NO')
main()


n = int(input())
possible = False
l = []
for i in range(n):
	t = input()
	s = list(t)
	if s[0] == 'O' and s[1] == 'O':
		if possible == False:
			(s[0], s[1]) = ('+', '+')
			possible = True
	elif s[3] == 'O' and s[4] == 'O':
		if possible == False:
			(s[3], s[4]) = ('+', '+')
			possible = True
	l.append(s)
if possible == True:
	print('YES')
	for i in range(len(l)):
		print(''.join(l[i]))
else:
	print('NO')


row = int(input())
already = 0
load = []
for i in range(row):
	seat = input()
	if already == 0:
		if seat[0] == 'O' and seat[1] == 'O':
			seat = '++' + seat[2:]
			load.append(seat)
			already += 1
		elif seat[3] == 'O' and seat[4] == 'O':
			seat = seat[:3] + '++'
			load.append(seat)
			already += 1
		else:
			load.append(seat)
	else:
		load.append(seat)
if already == 0:
	print('NO')
else:
	print('YES')
	for i in load:
		print(i)


l = []
f = 0
n = int(input())
sts = [input() for i in range(n)]
for i in sts:
	if i.find('OO') != -1:
		f = 1
		break
if f == 1:
	print('YES')
	for j in sts:
		if i == j:
			i = i.replace('OO', '++', 1)
			print(i)
		else:
			print(j)
else:
	print('NO')


n = int(input())
config = []
flag = 0
for x in range(n):
	row = list(input())
	if flag == 0:
		if row[0] == 'O' and row[1] == 'O':
			(row[0], row[1]) = ('+', '+')
			flag = 1
		elif row[3] == 'O' and row[4] == 'O':
			(row[3], row[4]) = ('+', '+')
			flag = 1
	config.append(''.join(row))
if flag == 1:
	print('YES')
	for row in config:
		print(row)
else:
	print('NO')


n = int(input())
f = True
a = []
for _ in range(n):
	x = input()
	x = x.split('|')
	if x[0] == 'OO' and f:
		a.append('++|' + x[1])
		f = False
	elif x[1] == 'OO' and f:
		a.append(x[0] + '|++')
		f = False
	else:
		a.append(x[0] + '|' + x[1])
if f:
	print('NO')
else:
	print('YES')
	for i in a:
		print(i)


from sys import stdin, stdout
n = int(stdin.readline())
ans = []
label = 0
for i in range(n):
	ans.append(stdin.readline().strip())
	if ans[-1].split('|')[0].count('O') == 2:
		if not label:
			ans[-1] = '++|' + ans[-1].split('|')[1]
		label = 1
	elif ans[-1].split('|')[1].count('O') == 2:
		if not label:
			ans[-1] = ans[-1].split('|')[0] + '|++'
		label = 1
if not label:
	stdout.write('NO')
else:
	stdout.write('YES' + '\n' + '\n'.join(ans))


l = []
for _ in range(int(input())):
	l.append(input())
count = 0
for i in l:
	if count > 0:
		break
	if i[0] == i[1] == 'O':
		pos = l.index(i)
		l[pos] = '++' + i[2:]
		count += 1
	elif i[3] == i[4] == 'O':
		pos = l.index(i)
		l[pos] = i[0:3] + '++'
		count += 1
if count == 0:
	print('NO')
else:
	print('YES')
	for j in l:
		print(j)


n = int(input())
s = [input() for _ in range(n)]
if not any(('OO' in ss for ss in s)):
	print('NO')
else:
	print('YES')
	for i in range(n):
		if 'OO' in s[i]:
			print(s[i].replace('OO', '++', 1))
			break
		else:
			print(s[i])
	for i in range(i + 1, n):
		print(s[i])


n = int(input())
was = True
res = ''
for _ in range(n):
	s = input()
	if was and s[:2] == 'OO':
		was = False
		s = '++' + s[2:]
	if was and s[3:] == 'OO':
		was = False
		s = s[:3] + '++'
	res = res + s + '\n'
if was:
	print('NO')
else:
	print('YES')
	print(res)


n = int(input())
flag = False
s = [0] * n
for i in range(n):
	s[i] = input().split()[0]
	if flag == False:
		if s[i][0] == s[i][1] == 'O':
			s[i] = '++|' + s[i][3:]
			flag = True
		elif s[i][3] == s[i][4] == 'O':
			s[i] = s[i][:3] + '++'
			flag = True
if flag == True:
	print('YES')
	for elem in s:
		print(elem)
else:
	print('NO')


n = int(input())
f = 0
c = '|'
ans = []
for i in range(n):
	(a, b) = input().split('|')
	if f == 0 and (a[0] == 'O' and a[1] == 'O'):
		x = a.replace('O', '+')
		f = 1
		p = x + c + b
	elif f == 0 and (b[0] == 'O' and b[1] == 'O'):
		x = b.replace('O', '+')
		f = 1
		p = a + c + x
	else:
		p = a + c + b
	ans.append(p)
if f == 0:
	print('NO')
else:
	print('YES')
	print(*ans, sep='\n')


n = int(input())
k = 1
otv = ''
kolvo = 0
st = ''
while k <= n:
	ryad = input()
	if 'OO' in ryad and kolvo < 1:
		st = ryad.replace('OO', '++', 1)
		otv = otv + st + '\n'
		kolvo += 1
	else:
		otv = otv + ryad + '\n'
	k += 1
if kolvo == 0:
	print('NO')
else:
	print('YES')
	print(otv)


n = int(input())
bus = []
for _ in range(n):
	bus.append(input().split('|'))

def searchforseat(bus):
	for (i, row) in enumerate(bus):
		for (j, pair) in enumerate(row):
			if pair.count('O') == 2:
				bus[i][j] = '++'
				return 'Can sit'
if searchforseat(bus) != None:
	print('YES')
	for row in bus:
		print('|'.join(row))
else:
	print('NO')


count = int(input())
output = []
found = False
for i in range(count):
	line = input()
	if not found:
		if line[0:2] == 'OO':
			line = list(line)
			line[0:2] = '++'
			line = ''.join(line)
			found = True
		elif line[3:5] == 'OO':
			line = list(line)
			line[3:5] = '++'
			line = ''.join(line)
			found = True
	output.append(line)
if found:
	print('YES')
	for i in output:
		print(i)
else:
	print('NO')


import sys
input()
m = sys.stdin.read()
y = m.find('OO')
print('NO' if y < 0 else 'YES\n' + m[:y] + '++' + m[y + 2:])


import sys
input()
s = sys.stdin.read()
x = s.find('OO')
print('NO' if x == -1 else 'YES\n' + s.replace('OO', '++', 1))


n = int(input())
test = False
seats = [input() for i in range(n)]
for i in range(n):
	if seats[i].count('OO') > 0:
		seats[i] = seats[i].replace('OO', '++', 1)
		test = True
		break
if test == False:
	print('NO')
else:
	print('YES')
	for i in seats:
		print(i)


def func(arr):
	found = False
	for i in range(len(arr)):
		st = list(arr[i])
		if st[0] == 'O' and st[1] == 'O':
			(st[0], st[1]) = ('+', '+')
			st = ''.join(st)
			arr[i] = st
			found = True
			break
		elif st[3] == 'O' and st[4] == 'O':
			(st[3], st[4]) = ('+', '+')
			st = ''.join(st)
			arr[i] = st
			found = True
			break
	if found:
		print('YES')
		for ele in arr:
			print(ele)
	else:
		print('NO')
n = int(input())
arr = []
for i in range(n):
	st = input()
	arr.append(st)
func(arr)


rows = int(input())
sits = []
for i in range(rows):
	sits.append(input())
out = 'NO'
for i in range(len(sits)):
	if sits[i].find('OO') != -1:
		if sits[i][:2] == 'OO':
			sits[i] = '++' + sits[i][2:]
		else:
			sits[i] = sits[i][:3] + '++'
		out = 'YES'
		break
print(out)
if out == 'YES':
	for i in sits:
		print(i)


n = int(input())
sts = []
for i in range(n):
	sts.append(input().split('|'))
bk = 0
for i in range(n):
	for j in range(2):
		if sts[i][j] == 'OO':
			sts[i][j] = '++'
			bk = 1
			break
	if bk == 1:
		break
if bk != 1:
	print('NO')
else:
	print('YES')
	for i in sts:
		print('|'.join(i))


n = int(input())
st = []
for i in range(n):
	st.append(input())
if n == 1 and st[0] == 'OO|OO':
	print('YES')
	print('++|OO')
else:
	check = 0
	for j in range(n):
		if check == 0:
			if 'OO' in st[j]:
				st[j] = st[j].replace('OO', '++')
				check = 1
				break
	if check == 1:
		print('YES')
		for k in range(n):
			print(st[k])
	else:
		print('NO')


a = int(input())
l = []
for i in range(a):
	l.append(list(input()))
bs = l
f = 0
for i in range(a):
	if l[i][0] == l[i][1] == 'O':
		l[i][0] = l[i][1] = '+'
		f = 1
		break
	elif l[i][3] == l[i][4] == 'O':
		list(l[i])
		l[i][3] = l[i][4] = '+'
		f = 1
		break
if f == 0:
	print('NO')
else:
	print('YES')
	for i in range(a):
		print(''.join(l[i]))


num_rows = int(input())
output = []
already_seated = False
for _ in range(num_rows):
	if already_seated:
		output.append(input())
		continue
	row = input()
	if 'OO' in row:
		already_seated = True
		if row.index('OO') == 0:
			output.append('++' + row[2:])
		else:
			output.append(row[:3] + '++')
	else:
		output.append(row)
if already_seated:
	print('YES')
	for row in output:
		print(row)
else:
	print('NO')


from sys import stdin
max_val = int(10000000000000.0)
min_val = int(-10000000000000.0)

def read_int():
	return int(stdin.readline())

def read_ints():
	return [int(x) for x in stdin.readline().split()]

def read_str():
	return input()

def read_strs():
	return [x for x in stdin.readline().split()]
nb_rows = read_int()
done = False
answer = []
for i in range(nb_rows):
	seats = input().split('|')
	for (i, v) in enumerate(seats):
		if v == 'OO' and (not done):
			seats[i] = '++'
			done = True
		else:
			seats[i] = v
	answer.append('|'.join(seats))
if done:
	print('YES')
	print('\n'.join(answer))
else:
	print('NO')


n = int(input())
ans = []
found = False
for i in range(0, n):
	s = input()
	if not found:
		if s[:2] == 'OO':
			s = '++' + s[2:]
			found = True
		elif s[3:] == 'OO':
			s = s[:3] + '++'
			found = True
	ans.append(s)
if found:
	print('YES')
	for i in ans:
		print(i)
else:
	print('NO')


nums = int(input())
ans = 'NO'
config = ''
for i in range(nums):
	a = input().split('|')
	if 'OO' in a and ans != 'YES':
		neigh = 0
		ans = 'YES'
		a[a.index('OO')] = '++'
	config += '|'.join(a) + '\n'
print(ans + '\n' + config) if ans == 'YES' else print(ans)


(n, res) = (int(input()), [])
for i in range(n):
	res.append(input())
m = res[:]
for i in range(len(res)):
	if 'OO' in res[i]:
		print('YES')
		if 'OO|OO' in res[i]:
			res[i] = res[i].replace('OO|', '++|')
		else:
			res[i] = res[i].replace('OO', '++')
		for x in res:
			print(x)
		break
if 'OO' not in ' '.join(m):
	print('NO')


n = int(input())
i = 0
row = [0] * n
output = 'NO'
while i < n:
	row[i] = input()
	row[i] = row[i].split('|')
	if output != 'YES':
		if row[i][0] == 'OO':
			output = 'YES'
			row[i][0] = '++'
		elif row[i][1] == 'OO':
			output = 'YES'
			row[i][1] = '++'
	i += 1
print(output)
if output != 'NO':
	i = 0
	while i < n:
		print(row[i][0] + '|' + row[i][1])
		i += 1


n = int(input())
l = []
flag = 0
for i in range(n):
	string = input()
	l1 = string.split('|')
	if l1[0] == 'OO' and flag == 0:
		flag = 1
		l1[0] = '++'
	elif l1[1] == 'OO' and flag == 0:
		flag = 1
		l1[1] = '++'
	l.append(l1)
if flag == 0:
	print('NO')
else:
	print('YES')
	for i in l:
		string = ''
		for j in i:
			string += j + '|'
		print(string[:-1])


s = []
n = int(input())
for i in range(n):
	s.append(input())
flag = 0
for i in range(n):
	if s[i][0] == 'O' and s[i][1] == 'O':
		s[i] = '++' + s[i][2:]
		flag = 1
		break
	elif s[i][3] == 'O' and s[i][4] == 'O':
		s[i] = s[i][:3] + '++'
		flag = 1
		break
if flag:
	print('YES')
	for i in s:
		print(i)
else:
	print('NO')


n = int(input())
st = ''
flag = True
for i in range(n):
	s = input()
	if flag and 'OO' in s:
		flag = False
		if s[0] == 'O' and s[1] == 'O':
			st += '++|' + s[3:]
		else:
			st += s[:3] + '++'
	else:
		st += s
	st += '\n'
if not flag:
	print('YES')
	print(st)
else:
	print('No')


n = int(input())
l = []
f = 0
for i in range(n):
	s = input()
	s = list(s)
	l.append(s)
for i in range(len(l)):
	if l[i][0] == 'O' and l[i][1] == 'O':
		l[i][0] = '+'
		l[i][1] = '+'
		f = 1
		break
	elif l[i][3] == 'O' and l[i][4] == 'O':
		l[i][3] = '+'
		l[i][4] = '+'
		f = 1
		break
	else:
		continue
if f == 1:
	print('YES')
	for i in range(len(l)):
		print(''.join(l[i]))
else:
	print('NO')


l = []
c = 0
for _ in range(int(input())):
	s = input()
	l1 = list(s)
	if (l1[0] == 'O' and l1[1] == 'O') and c == 0:
		c = 1
		l1[0] = '+'
		l1[1] = '+'
	elif (l1[3] == 'O' and l1[4] == 'O') and c == 0:
		c = 1
		l1[3] = '+'
		l1[4] = '+'
	l.append(l1)
tm = ''
if c == 1:
	print('YES', end='\n')
	for i in l:
		for j in i:
			tm += j
		print(tm, end='\n')
		tm = ''
else:
	print('NO')


def main():
	a = []
	for i in range(int(input())):
		a += input().split('|')
	if 'OO' in a:
		print('YES')
		a[a.index('OO')] = '++'
		for i in range(0, len(a) - 1, 2):
			print(*a[i:i + 2], sep='|')
	else:
		print('NO')
main()


n = int(input())
l = []
for _ in range(n):
	l.append(input())
f = 0
for i in l:
	if i[0:2] == 'OO' or i[3:] == 'OO':
		l[l.index(i)] = i.replace('OO', '++', 1)
		f = 1
		break
if f == 1:
	print('YES')
	for i in l:
		print(i)
else:
	print('NO')


n = int(input())
al = 0
d = []
for i in range(n):
	k = input()
	if al == 0:
		if 'OO' in k:
			al = 1
			k = k.replace('OO', '++', 1)
	d.append(k)
if al == 1:
	print('YES')
	for e in range(n):
		print(d[e])
else:
	print('NO')


n = int(input())
line = []
flag = True
for i in range(n):
	line.append(input())
	if flag:
		if line[-1][:2] == 'OO':
			line[-1] = '++' + line[-1][2:]
			flag = False
			continue
		if line[-1][3:] == 'OO':
			line[-1] = line[-1][:3] + '++'
			flag = False
			continue
if flag:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(line[i])


n = int(input())
l = []
boolean = True
r = False
for i in range(n):
	s = input().split('|')
	if s[0] == 'OO' and boolean:
		l.append('++|' + s[1])
		r = True
		boolean = False
	elif s[1] == 'OO' and boolean:
		l.append(s[0] + '|++')
		r = True
		boolean = False
	else:
		l.append(s[0] + '|' + s[1])
if r:
	print('YES')
	for i in l:
		print(''.join(i))
else:
	print('NO')


n = int(input())
seat = []
for _ in range(n):
	seat.extend(input().split('|'))
flag = 0
for i in range(2 * n):
	if seat[i] == 'OO':
		seat[i] = '++'
		flag = 1
		break
if flag == 1:
	print('YES')
	for i in range(0, 2 * n, 2):
		print(seat[i] + '|' + seat[i + 1])
else:
	print('NO')


n = int(input())
b = [i for i in range(n)]
for i in range(n):
	b[i] = input()
l = -1
r = -1
for i in range(n):
	if b[i][0] == b[i][1] == 'O':
		l = i
	if b[i][3] == b[i][4] == 'O':
		r = i
if l == -1 and r == -1:
	print('NO')
	exit(0)
print('YES')
if l > r:
	for i in range(n):
		if i == l:
			print('++', b[i][2:5], sep='')
		else:
			print(*b[i], sep='')
if r > l:
	for i in range(n):
		if i == r:
			print(b[i][0:3], '++', sep='')
		else:
			print(*b[i], sep='')
if l == r:
	for i in range(n):
		if i == r:
			print(b[i][0:3], '++', sep='')
		else:
			print(*b[i], sep='')


T = []
ok = 0
for i in range(int(input())):
	s = input()
	if s.count('OO') and ok == 0:
		ok = 1
		s = s.replace('OO', '++', 1)
	T.append(s)
print(['NO', 'YES'][ok])
if ok:
	for i in T:
		print(i)


n = int(input())
ip = []
op = []
b = 0
for i in range(n):
	s = str(input().split())
	ip.append(s)
	if 'OO' in s and b == 0:
		j = s.index('OO')
		s = s[:j] + '++' + s[j + 2:]
		b = 1
	op.append(s)
if b == 0:
	print('NO')
else:
	print('YES')
	for i in op:
		print(i[2:7])


n = int(input())
a = []
ans = 0
for i in range(n):
	a += [input()]
	if not ans:
		if a[-1][:2] == 'OO':
			a[-1] = '++' + a[-1][2:]
			ans = 1
		elif a[-1][3:] == 'OO':
			a[-1] = a[-1][:3] + '++'
			ans = 1
if ans:
	print('YES')
	for i in a:
		print(i)
else:
	print('NO')


n = int(input())
lis = []
(inp, left, right) = (str(), str(), str())
empty = False
for i in range(n):
	inp = input()
	(left, right) = inp.split('|')
	if empty == False:
		if left == 'OO':
			inp = '++|' + right
			empty = True
		elif right == 'OO':
			inp = left + '|++'
			empty = True
	lis.append(inp)
if empty:
	print('YES')
	for line in lis:
		print(line)
else:
	print('NO')


n = int(input())
found = False
lst = []
for i in range(n):
	s = input()
	if found:
		lst += [s]
	elif s[0] == 'O' and s[1] == 'O':
		found = True
		lst += [''.join(['+', '+', s[2], s[3], s[4]])]
	elif s[3] == 'O' and s[4] == 'O':
		found = True
		lst += [''.join([s[0], s[1], s[2], '+', '+'])]
	else:
		lst += [s]
if found:
	print('YES' + '\n' + '\n'.join(lst))
else:
	print('NO')


num = int(input())
lines = []
found = False
for _ in range(num):
	line = input()
	if found == False:
		try:
			index = line.index('OO')
			found = True
			line = line.replace('OO', '++', 1)
		except:
			pass
	lines.append(line)
if found:
	print('YES')
	for l in lines:
		print(l)
else:
	print('NO')


f = 0
l = []
for _ in range(int(input())):
	s = input()
	if 'OO' in s and (not f):
		s = s.replace('OO', '++', 1)
		f = 1
	l.append(s)
if f:
	print('YES')
	print('\n'.join(l))
else:
	print('NO')


n = int(input())
yes = 0
res = []
for i in range(n):
	(l, r) = map(str, input().split('|'))
	if l == 'OO' and yes == 0:
		l = '++'
		yes = 1
	elif r == 'OO' and yes == 0:
		r = '++'
		yes = 1
	res.append(l + '|' + r)
if yes == 1:
	print('YES')
	for i in res:
		print(i)
else:
	print('NO')


n = int(input())
l = [0] * n
for i in range(n):
	l[i] = input()
flag = False
for j in range(n):
	if 'OO' in l[j]:
		flag = True
		a = l[j].split('|')
		if a[0] == 'OO':
			a[0] = '++'
		else:
			a[1] = '++'
		l[j] = a[0] + '|' + a[1]
		break
if flag == False:
	print('NO')
else:
	print('YES')
	for k in range(n):
		print(l[k])


n = int(input())
flag = 0
seat = []
for i in range(n):
	seat.append(input())
for i in range(len(seat)):
	if 'OO' in seat[i]:
		seat[i] = seat[i].replace('OO', '++', 1)
		flag = 1
		break
if flag:
	print('YES')
	for p in seat:
		print(p)
else:
	print('NO')


n = int(input())
k = []
flag = False
for i in range(n):
	m = input().split('|')
	k = k + m
for i in range(len(k)):
	if k[i] == 'OO':
		flag = True
		k[i] = '++'
		break
if flag == False:
	print('NO')
if flag == True:
	print('YES')
	for i in range(0, 2 * n, 2):
		print(k[i] + '|' + k[i + 1])


x = int(input())
bus = []
for i in range(x):
	bus.append(input().split('|'))
c = 0
for l in range(x):
	if bus[l][0] == 'OO':
		bus[l][0] = '++'
		break
	elif bus[l][1] == 'OO':
		bus[l][1] = '++'
		break
	elif bus[l][0] == 'OO' and bus[l][1] == 'OO':
		bus[l][0] = '++'
		break
	elif bus[l][0] != 'OO' or bus[l][1] != 'OO':
		c += 1
if c == x:
	print('NO')
else:
	print('YES')
	for z in range(x):
		print(bus[z][0] + '|' + bus[z][1])


n = int(input())
s = []
for i in range(n):
	temp = list(input())
	s.append(temp)
flag = True
for i in range(n):
	if s[i][0] == 'O' and s[i][1] == 'O':
		flag = False
		s[i][0] = '+'
		s[i][1] = '+'
		break
	if s[i][3] == 'O' and s[i][4] == 'O':
		flag = False
		s[i][3] = '+'
		s[i][4] = '+'
		break
if flag:
	print('NO')
	exit(0)
print('YES')
for i in range(n):
	print(''.join(s[i]))


n = int(input())
have = False
answ = ''
for i in range(n):
	s = input().split('|')
	if not have:
		if s[0] == 'OO':
			have = True
			s[0] = '++'
		if s[1] == 'OO' and (not have):
			have = True
			s[1] = '++'
		answ += s[0] + '|' + s[1] + '\n'
	else:
		answ += s[0] + '|' + s[1] + '\n'
if have:
	print('YES')
	print(answ)
else:
	print('NO')


n = input()
import sys
a = sys.stdin.read()
if 'OO' in a:
	print('YES')
	print(a.replace('OO', '++', 1))
else:
	print('NO')


n = int(input())
yes = False
rows = []
for i in range(0, n):
	row = input()
	if not yes and 'OO' in row:
		yes = True
		row = row.replace('OO', '++', 1)
	rows.append(row)
if yes:
	print('YES')
	for row in rows:
		print(row)
else:
	print('NO')


b = int(input())
s = []
for i in range(b):
	s.append(input())
z = ' '.join(s)
if z.count('OO') > 0:
	print('YES')
	z = z.replace('OO', '++', 1)
	z = z.split()
	for i in z:
		print(i)
else:
	print('NO')


n = int(input())
o = []
k = 0
for i in range(n):
	l = input()
	if 'OO' in l:
		k += 1
	o.append(l)
if k == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		if 'OO' in o[i]:
			s = o[i]
			s = s.replace('OO', '++', 1)
			o[i] = s
			break
	for i in range(n):
		print(o[i])


n = int(input())
lst = []
pos = None
for i in range(n):
	row = input().split('|')
	if 'OO' in row:
		pos = i
		row[row.index('OO')] = '++'
		lst.append(row)
		break
	lst.append(row)
if pos == None:
	print('NO')
else:
	print('YES')
	for i in lst:
		print('|'.join(i))
	for j in range(pos + 1, n):
		row = input()
		print(row)


n = int(input())
str = []
l = False
for x in range(n):
	k = input()
	if 'OO' in k and l == False:
		k = k.replace('OO', '++', 1)
		str.append(k)
		l = True
	else:
		str.append(k)
print('Yes', '\n'.join(str)) if l == True else print('NO')


x = int(input())
y = []
b = []
a = 0
c = 0
for i in range(0, x):
	y.append(input())
for i in y:
	if i == 'OO|OO':
		if c == 0:
			b.append('++|OO')
			c += 1
			a += 1
		else:
			b.append(i)
	elif 'OO' in i:
		a += 1
		if c == 0:
			b.append(i.replace('OO', '++'))
			c += 1
		else:
			b.append(i)
	else:
		b.append(i)
if a >= 1:
	print('YES')
	for i in b:
		print(i, end='\n')
else:
	print('NO')


from sys import stdin as fin
n = int(fin.readline())
flag = False
out = []
for i in range(n):
	(l, r) = fin.readline().strip().split('|')
	if not flag and l == 'OO':
		flag = True
		l = '++'
	elif not flag and r == 'OO':
		flag = True
		r = '++'
	out.append(l + '|' + r)
if flag:
	print('YES')
	print('\n'.join(out))
else:
	print('NO')


import sys
while 1:
	try:
		n = int(input().strip())
	except:
		break
	t = [input().strip() for i in range(n)]
	o = []
	ans = 0
	for i in range(n):
		if not ans and t[i][0] == t[i][1] == 'O':
			o.append('++' + t[i][2:])
			ans = 1
		elif not ans and t[i][3] == t[i][4] == 'O':
			o.append(t[i][:-2] + '++')
			ans = 1
		else:
			o.append(t[i])
	if ans:
		print('YES')
		for l in o:
			print(l)
	else:
		print('NO')


n = int(input())
b = []
y = False
for i in range(n):
	r = input()
	if y is False and 'OO' in r:
		y = True
		r = r.replace('OO', '++', 1)
	b.append(r)
if y == True:
	print('YES')
	for i in range(n):
		print(b[i])
else:
	print('NO')


n = int(input())
ans = False
ans_rows = []
for i in range(n):
	row = input()
	if not ans:
		if row[0:2] == 'OO':
			ans = True
			ans_rows.append('++' + row[2:5])
		elif row[3:5] == 'OO' and (not ans):
			ans = True
			ans_rows.append(row[0:3] + '++')
		else:
			ans_rows.append(row)
	else:
		ans_rows.append(row)
print('YES' if ans else 'NO')
if ans:
	print(*ans_rows, sep='\n')


possible = False
seating = ''
for _ in range(int(input())):
	row = input()
	if not possible and 'OO' in row:
		row = row.replace('OO', '++', 1)
		possible = True
	seating += row + '\n'
if possible:
	print('YES')
	print(seating[:-1])
else:
	print('NO')


n = int(input())
seats = []
found = False
for i in range(0, n):
	seats.append(list(input()))
for row in seats:
	if row[0] == 'O' and row[1] == 'O':
		found = True
		row[0] = '+'
		row[1] = '+'
		break
	elif row[3] == 'O' and row[4] == 'O':
		found = True
		row[3] = '+'
		row[4] = '+'
		break
if found:
	print('YES')
	for row in seats:
		print(''.join(row))
else:
	print('NO')


rows_of_seats = int(input())
temp = []
found = False
for x in range(rows_of_seats):
	rows = input()
	if not found:
		if rows.find('OO') >= 0:
			rows = rows.replace('OO', '++', 1)
			found = True
	temp.append(rows)
if not found:
	print('NO')
else:
	print('YES')
	for item in temp:
		print(item)


def test97():
	cnt = int(input().strip())
	tmp_list = []
	for x in range(cnt):
		str_in = input().strip()
		if str_in.find('OO') != -1:
			print('YES')
			tmp_list.append(str_in.replace('OO', '++', 1))
			cnt -= 1
			break
		else:
			tmp_list.append(str_in)
			if cnt == 1:
				print('NO')
				return
		cnt -= 1
	for x in range(cnt):
		tmp_list.append(input().strip())
	for x in tmp_list:
		print(x)
test97()


rows = []
n = int(input())
for i in range(n):
	row = input()
	rows.append(row[0:2])
	rows.append(row[3:5])
if rows.count('OO') >= 1:
	print('YES')
	rows[rows.index('OO')] = '++'
	for j in range(0, n * 2, 2):
		print(rows[j] + '|' + rows[j + 1])
else:
	print('NO')


n = int(input())
car = []
bus = []
for i in range(n):
	(a, b) = input().split('|')
	car.extend([a, b])
	bus.append([a, b])
if 'OO' in car:
	print('YES')
	q = car.index('OO')
	r = q // 2
	c = q % 2
	bus[r][c] = '++'
	for j in range(n):
		print('|'.join((x for x in bus[j])))
else:
	print('NO')


n = int(input())
s = []
d = 0
for i in range(n):
	s.append(list(input().split('|')))
for i in range(n):
	if 'OO' in s[i]:
		c = s[i].index('OO')
		s[i].pop(c)
		s[i].insert(c, '++')
		d = 1
		break
	else:
		d = 0
if d == 1:
	print('YES')
	for i in range(n):
		for j in range(2):
			if j == 0:
				print(s[i][j], end='|')
			else:
				print(s[i][j])
else:
	print('NO')


n = int(input())
ban = False
ls = []
for i in range(n):
	s = input()
	ls.append(s)
	if s.find('OO') != -1:
		ban = True
if ban:
	print('YES')
	flag = True
	for e in ls:
		if flag and e.find('OO') != -1:
			e = e.replace('OO', '++', 1)
			flag = False
		print(e)
else:
	print('NO')


def main():
	n = int(input())
	l = []
	check = False
	for _ in range(n):
		s = input().split('|')
		l.append(s)
	for i in l:
		if i[0] == 'OO':
			i[0] = '++'
			check = True
			break
		elif i[1] == 'OO':
			i[1] = '++'
			check = True
			break
	if check:
		print('YES')
		for i in l:
			print('{}|{}'.format(i[0], i[1]))
	else:
		print('NO')
main()


n = int(input())
place = []
for i in range(n):
	place.append(input().split('|'))
flag = 0
for i in range(n):
	for j in range(2):
		if place[i][j] == 'OO':
			place[i][j] = '++'
			flag = 1
			break
	if flag:
		break
if flag:
	print('YES')
	for i in place:
		t = ''
		t += i[0]
		t += '|'
		t += i[1]
		print(t)
else:
	print('NO')


n = int(input())
(list1, sol) = ([], 'NO')
count = 0
for i in range(n):
	string = input()
	list1.append(list(string))
	if count == 0:
		ix = string.find('OO')
		if ix != -1:
			list1[i][ix:ix + 2] = '++'
			count += 1
			sol = 'YES'
if sol == 'YES':
	print(sol)
	for i in range(n):
		print(''.join(list1[i]))
else:
	print(sol)


n = int(input())
new = []
flag = 0
for i in range(n):
	r = list(map(str, input().split('|')))
	new.append(r)
for i in range(len(new)):
	for j in range(len(new[0])):
		if new[i][j] == 'OO':
			new[i][j] = '++'
			flag = 1
			break
	if flag == 1:
		break
	else:
		continue
if flag == 1:
	print('YES')
	for i in range(len(new)):
		print('|'.join(new[i]))
else:
	print('NO')


a = int(input())
b = []
for i in range(a):
	(x, y) = input().split('|')
	b.append(x)
	b.append(y)
yes = False
ans = 0
for i in range(a * 2):
	if b[i] == 'OO':
		if not yes:
			ans = i
		yes = True
n = []
for i in range(a * 2):
	if i != ans:
		n.append(b[i])
	else:
		n.append('++')
if yes:
	print('YES')
	for i in range(a):
		print('|'.join(map(str, n[i * 2:i * 2 + 2])))
else:
	print('NO')


n = int(input(''))
l = []
c = 0
for i in range(1, n + 1):
	s = input('')
	if s[0:2] == 'OO' or s[3:5] == 'OO':
		if c != 1:
			s = s.replace('OO', '++', 1)
			c = c + 1
	l.append(s)
if c == 1:
	print('YES')
	for i in l:
		print(i)
else:
	print('NO')


n = int(input())
flag = True
a = []
for _ in range(n):
	s = input()
	if 'OO' in s and flag:
		for i in range(4):
			if s[i] == 'O' and s[i + 1] == 'O':
				s = s[:i] + '++' + s[i + 2:]
				break
		flag = False
	a.append(s)
if not flag:
	print('YES', '\n'.join(a), sep='\n')
else:
	print('NO')


import sys

def main():
	n = int(input().strip())
	out = ''
	answ = False
	for i in range(n):
		(a, b) = input().strip().split('|')
		if a == 'OO' and (not answ):
			out += '++|' + b + '\n'
			answ = True
		elif b == 'OO' and (not answ):
			out += a + '|++' + '\n'
			answ = True
		else:
			out += a + '|' + b + '\n'
	if answ:
		print('YES')
		print(out)
	else:
		print('NO')
main()


n = int(input())
c = ''
for i in range(n):
	c += input() + '\n'
if 'OO' in c:
	print('YES')
	print(c.replace('OO', '++', 1))
else:
	print('NO')


l = [input().split('|') for _ in range(int(input()))]
temp = 0
for e in range(len(l)):
	if 'OO' in l[e]:
		print('YES')
		index = e
		index1 = l[e].index('OO')
		for i in range(len(l)):
			if i == index:
				l[i][index1] = '++'
			l[i] = '|'.join(l[i])
			print(l[i])
		temp = 1
		break
if temp == 0:
	print('NO')


n = int(input())
l = [input() for i in range(n)]
d = False
for i in range(len(l)):
	if l[i][:2] == 'OO':
		d = True
		l[i] = '++' + l[i][2:]
	elif l[i][3:] == 'OO':
		d = True
		l[i] = l[i][:3] + '++'
	if d:
		break
if d:
	print('YES')
	for i in l:
		print(i)
else:
	print('NO')


ct = 0
l = []
for I in range(int(input())):
	s = input()
	if s[0] == s[1] and s[0] == 'O' and (ct == 0):
		print('YES')
		s = '++' + s[2:]
		ct += 1
	elif s[3] == s[4] and s[3] == 'O' and (ct == 0):
		print('YES')
		s = s[:3] + '++'
		ct += 1
	l.append(s)
if ct != 0:
	for i in l:
		print(i)
else:
	print('NO')


n = int(input())
p = []
c = 0
for i in range(n):
	s = input()
	p.append(s)
for i in range(n):
	if p[i][0] == 'O' and p[i][1] == 'O':
		c = 1
		r = '++|' + p[i][3] + p[i][4]
		del p[i]
		p.insert(i, r)
		break
	elif p[i][3] == 'O' and p[i][4] == 'O':
		c = 1
		r = p[i][0] + p[i][1] + '|++'
		del p[i]
		p.insert(i, r)
		break
	else:
		continue
if c == 1:
	print('YES')
	for i in p:
		print(i)
else:
	print('NO')


def main():
	try:
		while True:
			n = int(input())
			grid = [input() for i in range(n)]
			for (i, row) in enumerate(grid):
				if row[:2] == 'OO':
					grid[i] = '++' + row[2:]
					break
				elif row[-2:] == 'OO':
					grid[i] = row[:-2] + '++'
					break
			else:
				print('NO')
				continue
			print('YES')
			print('\n'.join(grid))
	except EOFError:
		pass
main()


a = int(input())
l = []
k = 0
for i in range(a):
	b = list(input().upper())
	if k == 0:
		if b[0] == 'O' and b[1] == 'O':
			b[0] = '+'
			b[1] = '+'
			k = 1
		elif b[4] == 'O' and b[3] == 'O':
			b[4] = '+'
			b[3] = '+'
			k = 1
	l.append(b)
if k == 1:
	print('YES')
	for i in l:
		print(''.join(i))
else:
	print('NO')


n = int(input())
i = 0
k = []
while i < n:
	s = list(input())
	k.append(s)
	i += 1
v = 0
h = k.copy()
i = 0
for v in range(n):
	if i >= 1:
		break
	elif k[v][0] == k[v][1] and k[v][0] == 'O':
		k[v][0] = '+'
		k[v][1] = '+'
		i += 1
	elif k[v][3] == k[v][4] and k[v][3] == 'O':
		k[v][3] = '+'
		k[v][4] = '+'
		i += 1
for j in range(1):
	if i == 0:
		print('NO')
		break
	elif i == 1:
		print('YES')
		for o in k:
			print(''.join(o))


n = int(input())
c = 0
l1 = []
for i in range(n):
	l = list(input())
	if (l[0] == 'O' and l[0] == l[1] or (l[3] == 'O' and l[3] == l[4])) and c == 0:
		c = 1
		if l[0] == 'O' and l[1] == 'O':
			(l[0], l[1]) = ('+', '+')
		elif l[3] == 'O' and l[4] == 'O':
			(l[3], l[4]) = ('+', '+')
	l1.append(l)
if c == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(''.join((str(i) for i in l1[i])))


n = int(input())
list = []
for i in range(n):
	list.append(input())
match = 0
ans = 'NO'
t = 0
for i in range(n):
	match = 0
	for k in range(5):
		if t == 0:
			if list[i][k] == 'O':
				match += 1
			else:
				match = 0
			if match == 2:
				if k < 3:
					list[i] = '++|' + list[i][k + 2] + list[i][k + 3]
				else:
					list[i] = list[i][k - 4] + list[i][k - 3] + '|++'
				ans = 'YES'
				t = 1
if ans == 'YES':
	print(ans)
	for i in range(n):
		print(list[i])
else:
	print(ans)


n = int(input())
a = []
f = True
for i in range(n):
	s = input()
	if s.count('OO') != 0 and f:
		f = False
		ind = s.index('OO')
		s = list(s)
		s[ind] = '+'
		s[ind + 1] = '+'
		s = ''.join(s)
	a.append(s)
if not f:
	print('YES')
	for i in a:
		print(i)
else:
	print('NO')


def main():
	n = int(input())
	s = []
	for i in range(n):
		strng = input()
		s.append(list(strng))
	for row in s:
		seatleft = ''.join(row[:2])
		seatright = ''.join(row[3:])
		if seatleft == 'OO':
			row[:2] = '++'
			break
		elif seatright == 'OO':
			row[3:] = '++'
			break
	else:
		print('NO')
		return
	print('YES')
	for row in s:
		print(''.join(row))
main()


n = int(input())
l = list()
flag = True
for i in range(n):
	x = input()
	if x.find('OO') != -1 and flag:
		x = x.replace('OO', '++', 1)
		flag = False
	l.append(x)
print('NO' if flag else 'YES')
if not flag:
	for i in l:
		print(i)


n = int(input())
flag = -1
seat = []
for i in range(n):
	seat.append(input())
for i in range(n):
	if seat[i][0:2] == 'OO':
		flag = i
		ans = '++' + seat[i][2:]
		break
	elif seat[i][3:5] == 'OO':
		flag = i
		ans = seat[i][0:3] + '++'
		break
if flag == -1:
	print('NO')
else:
	print('YES')
	for i in range(n):
		if flag == i:
			print(ans)
		else:
			print(seat[i])


n = int(input())
arr = list()
for i in range(n):
	row = input()
	arr.append(row)
found_place = False
for i in range(n):
	row = arr[i]
	spl = row.split('|')
	left = spl[0]
	right = spl[1]
	if left == 'OO':
		arr[i] = arr[i].replace('OO', '++', 1)
		found_place = True
		break
	elif right == 'OO':
		arr[i] = arr[i].replace('OO', '++', 1)
		found_place = True
		break
if found_place:
	print('YES')
	for i in range(n):
		print(arr[i])
else:
	print('NO')


def seats(arr):
	for (n, i) in enumerate(arr):
		for j in range(1, len(i)):
			if i[j - 1] == 'O' and i[j] == 'O':
				arr[n][j] = '+'
				arr[n][j - 1] = '+'
				print('YES')
				return arr
	return 'NO'
n = int(input())
a = []
for i in range(n):
	val = list(input())
	a.append(val)
ret = seats(a)
if ret == 'NO':
	print('NO')
else:
	for i in ret:
		for j in i:
			print(j, end='')
		print()


n = int(input())
M = [input() for _ in range(n)]
for i in range(n):
	if 'OO' in M[i]:
		M[i] = M[i].replace('OO', '++', 1)
		print('YES', *M, sep='\n')
		break
else:
	print('NO')


n = int(input())
a = []
c = []
k = 0
for i in range(n):
	a.append(input())
	if a[i][0] == 'O' and a[i][1] == 'O' or (a[i][3] == 'O' and a[i][4] == 'O'):
		c.append(i)
		k = 1
if k == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		if i == c[0]:
			if a[i][0] == 'O' and a[i][1] == 'O':
				print('++|', a[i][3], a[i][4], sep='')
			else:
				print(a[i][0], a[i][1], '|++', sep='')
		else:
			print(a[i])


def _display(chairs, answer):
	if answer is 'YES':
		print('YES')
		for iarr in chairs.values():
			print(*iarr[0], '|', *iarr[1], sep='')
	else:
		print(answer)

def void_chairs(chairs):
	for inum in chairs:
		iarr = chairs[inum]
		if iarr[0].count('O') == 2:
			iarr[0] = ['+', '+']
			return (chairs, 'YES')
		elif iarr[1].count('O') == 2:
			iarr[1] = ['+', '+']
			return (chairs, 'YES')
	return (chairs, 'NO')

def main():
	chairs = dict()
	n = int(input())
	for inum in range(n):
		row = list([ch for ch in input()])
		iarr = [[row[0], row[1]], [row[3], row[4]]]
		chairs[inum] = iarr
	(chairs, answer) = void_chairs(chairs)
	_display(chairs, answer)
main()


n = int(input())
a = [input() for _ in range(n)]
is_find = False
ans = []
first = True
for s in a:
	if s.find('OO') != -1 and first:
		is_find = True
		s = s.replace('OO', '++', 1)
		first = False
	ans.append(s)
if is_find:
	print('YES')
	print('\n'.join(ans))
else:
	print('NO')


a = int(input())
x = ''.join((input() + '\n' for i in ' ' * a))
y = x.replace('OO', '++', 1)
print('NO' * (x == y) or 'YES\n' + y)


nStr = input()
n = int(nStr)
SeatLine = [''] * n
found = False
for i in range(n):
	SeatLine[i] = input()
	if SeatLine[i].find('OO') != -1 and (not found):
		SeatLine[i] = SeatLine[i].replace('OO', '++', 1)
		found = True
if found:
	print('YES')
	for i in range(n):
		print(SeatLine[i])
else:
	print('NO')


a = int(input())
b = []
givian = False
for r in range(0, a):
	d = []
	c = input()
	for i in c:
		d.append(i)
	b.append(d)
for r in range(0, a):
	if b[r][0] == 'O' and b[r][1] == 'O':
		b[r][0] = '+'
		b[r][1] = '+'
		givian = True
		break
	if b[r][3] == 'O' and b[r][4] == 'O':
		b[r][3] = '+'
		b[r][4] = '+'
		givian = True
		break
if givian == True:
	print('YES')
	for r in range(0, a):
		l = ''
		for i in b[r]:
			l = l + i
		print(l)
else:
	print('NO')


n = int(input())
l = []
b = False
for i in range(n):
	s = input()
	l.append(s)
for i in l:
	if 'OO' in i:
		b = True
		ind = l.index(i)
		x = i.replace('OO', '++', 1)
		break
	else:
		b = False
if b == False:
	print('NO')
else:
	print('YES')
	l.pop(ind)
	l.insert(ind, x)
	for i in l:
		print(i)


answer = list()
z = 0
rows = int(input())
for i in range(rows):
	string = input()
	if z == 0:
		if string == 'OO|OO':
			answer.append('++|OO')
			z = 1
		elif string == 'OO|OX':
			answer.append('++|OX')
			z = 1
		elif string == 'OO|XO':
			answer.append('++|XO')
			z = 1
		elif string == 'OO|XX':
			answer.append('++|XX')
			z = 1
		elif string == 'OX|OO':
			answer.append('OX|++')
			z = 1
		elif string == 'XO|OO':
			answer.append('XO|++')
			z = 1
		elif string == 'XX|OO':
			answer.append('XX|++')
			z = 1
		else:
			answer.append(string)
	elif z == 1:
		answer.append(string)
if z == 0:
	print('NO')
else:
	print('YES')
	for i in range(rows):
		print(answer[i])


n = int(input())
b = False
A = []
for i in range(n):
	s = input()
	A.append(s)
	if b:
		continue
	(l, r) = s.split('|')
	if 'OO' in l:
		b = True
		A[i] = '++|' + r
	elif 'OO' in r:
		b = True
		A[i] = l + '|++'
if b:
	print('YES')
	for x in A:
		print(x)
else:
	print('NO')


l = []
k = 0
for i in range(int(input())):
	s = input()
	if 'OO' in s and k == 0:
		s = s.split('|')
		p = s.index('OO')
		s = '|'.join(s)
		s = list(s)
		if p == 0:
			s[p] = '+'
			s[p + 1] = '+'
		else:
			s[p + 2] = '+'
			s[p + 3] = '+'
		k = 1
		s = ''.join(s)
	l.append(s)
if k == 0:
	print('NO')
else:
	print('YES')
	for i in l:
		print(i)


n = int(input())
z = []
q = True
for i in range(n):
	w = list(input().split('|'))
	if 'OO' in w:
		if q:
			w[w.index('OO')] = '++'
			q = False
	z.append(w)
if not q:
	print('YES')
	for i in range(n):
		print('|'.join(z[i]))
else:
	print('NO')


(found, l) = (False, [])
for _ in range(int(input())):
	a = input()
	if not (found or a.find('OO') < 0):
		a = a.replace('OO', '++', 1)
		found = True
	l.append(a)
print('YES\n' + '\n'.join(l) if found else 'NO')


n = int(input())
ls = []
ans = 'NO'
count = 0
for t in range(n):
	s = input()
	ls.append(list(s))
for i in range(len(ls)):
	for r in range(len(ls[i]) - 1):
		if ls[i][r] == 'O' and ls[i][r + 1] == 'O':
			ls[i][r] = '+'
			ls[i][r + 1] = '+'
			ans = 'YES'
			count += 1
			break
	if count == 1:
		break
if ans == 'YES':
	print('YES')
	for i in ls:
		i = ''.join(i)
		print(i)
else:
	print('NO')


bus = []
answer = 'NO'
for i in range(int(input())):
	row = input()
	if row[:2] == 'OO':
		answer = (i, 0)
	elif row[3:] == 'OO':
		answer = (i, 3)
	bus.append(list(row))
if answer == 'NO':
	print('NO')
else:
	print('YES')
	for i in range(len(bus)):
		if i == answer[0]:
			if answer[1] == 0:
				bus[i][0:2] = '++'
			else:
				bus[i][3:] = '++'
		print(''.join(bus[i]))


n = int(input())
lis = []
x = 0
for i in range(n):
	k = input()
	lis.append(k)
for i in range(n):
	re = lis[i][0] + lis[i][1]
	er = lis[i][3] + lis[i][4]
	if re == 'OO':
		lis[i] = '++' + lis[i][2:]
		lis.insert(0, 'YES')
		x = 1
		break
	elif er == 'OO':
		lis[i] = lis[i].replace(er, '++')
		lis.insert(0, 'YES')
		x = 1
		break
if x == 0:
	print('NO')
else:
	for i in range(n + 1):
		print(lis[i])


t = int(input())
l = []
while t > 0:
	t = t - 1
	n = input()
	l.extend(n.split('|'))
c = -1
for i in range(len(l)):
	if l[i] == 'OO':
		c = i
		break
if c == -1:
	print('NO')
else:
	print('YES')
	for j in range(len(l)):
		if j % 2 == 0:
			if c == j:
				print('++', end='|')
			else:
				print(l[j], end='|')
		elif c == j:
			print('++')
		else:
			print(l[j])


n = int(input())
m = []
flag = 0
for i in range(n):
	s = input().split('|')
	if flag == 0:
		if s[0] == 'OO':
			s[0] = '++'
			flag = 1
		elif s[1] == 'OO':
			s[1] = '++'
			flag = 1
	m.append(s[0] + '|' + s[1])
if flag == 1:
	print('YES')
	for i in range(n):
		print(m[i])
else:
	print('NO')


n = int(input())
b = False
ans = []
for i in range(0, n):
	s = input()
	a = s.split('|')
	if a[0] == 'OO' and b == False:
		b = True
		ans.append('++|' + a[1])
		continue
	if a[1] == 'OO' and b == False:
		b = True
		ans.append(a[0] + '|++')
		continue
	ans.append(s)
if b == False:
	print('NO')
else:
	print('YES')
	for x in ans:
		print(x)


import sys
rows = int(input())
if rows < 1 and rows > 1000:
	sys.exit()
seats = list()
correct1 = ['OO|OO', 'OO|OX', 'OO|XO', 'OO|XX']
correct2 = ['OX|OO', 'OX|OX', 'OX|XO', 'OX|XX']
correct3 = ['XO|OO', 'XO|OX', 'XO|XO', 'XO|XX']
correct4 = ['XX|OO', 'XX|OX', 'XX|XO', 'XX|XX']
correct = correct1 + correct2 + correct3 + correct4
seat = ''
for i in range(rows):
	pairs = input()
	if pairs not in correct:
		sys.exit()
	seat += pairs + '?'
empty = seat.find('OO')
if empty != -1:
	seat = seat.replace('OO', '++', 1)
	newseats = seat.split(sep='?')
	print('YES')
	for newseat in newseats:
		print(newseat)
else:
	print('NO')


n = int(input())
t = False
A = []
for i in range(n):
	x = input()
	if (x[0:2] == 'OO' or x[3:] == 'OO') and t == False:
		x = x.replace('OO', '++', 1)
		t = True
	A.append(x)
print(['NO', 'YES'][t])
if t:
	for i in A:
		print(i)


x = int(input())
seat = []
seat2 = seat
for c in range(x):
	seat.append(input())
a = 0
b = 0
t = []
for c in range(x):
	if seat[c][0] == 'O' and seat[c][1] == 'O':
		a = a + 1
		t.append(c)
		break
	elif seat[c][3] == 'O' and seat[c][4] == 'O':
		b = b + 1
		t.append(c)
		break
if a > 0:
	seat.insert(t[0], '++|' + seat[t[0]][3] + seat[t[0]][4])
	del seat[t[0] + 1]
	print('YES')
	for c in seat:
		print(c)
elif b > 0:
	seat.insert(t[0], seat[t[0]][0] + seat[t[0]][1] + '|++')
	del seat[t[0] + 1]
	print('YES')
	for c in seat:
		print(c)
else:
	print('NO')


def main():
	n = int(input())
	strings = []
	yes = False
	for i in range(n):
		old = input()
		new = old.replace('OO', '++', 1)
		if not yes and old != new:
			strings.append(new)
			yes = True
		else:
			strings.append(old)
	print('YES' if yes else 'NO')
	if yes:
		for s in strings:
			print(s)
main()


x = int(input())
y = ''
p = 0
while x != 0:
	y = y + input() + '\n'
	x -= 1
for (j, i) in enumerate(y):
	if i == 'O':
		if y[j + 1] == 'O':
			p = p + 1
y = list(y)
r = ''
if p > 0:
	for (j, i) in enumerate(y):
		if i == 'O':
			if y[j + 1] == 'O':
				y[j] = '+'
				y[j + 1] = '+'
				break
	for n in y:
		r = r + n
	print('Yes')
	print(r)
else:
	print('NO')


n = int(input())
seat = [[1] * 5] * n
t = 0
num = 0
while t < n:
	seat[t] = input()
	if 'OO' not in seat[t]:
		num = num + 1
	t = t + 1
if num == n:
	print('NO')
else:
	for i in range(n):
		if 'OO' in seat[i]:
			print('YES')
			seat[i] = seat[i].replace('OO', '++')
			if seat[i] == '++|++':
				seat[i] = '++|OO'
			break
	print('\n'.join(seat))


n = int(input())
import sys
i = sys.stdin.read()
if 'OO' in i:
	print('YES')
	print(i.replace('OO', '++', 1))
else:
	print('NO')


n = int(input())
l = []
flag = 0
c = int(0)
for i in range(n):
	l.append(input())
for i in range(n):
	if l[i][0] == 'O' and l[i][1] == 'O' or (l[i][3] == 'O' and l[i][4] == 'O'):
		flag = 1
		S = l[c]
		if l[c][0] == 'O' and l[c][1] == 'O':
			S = '+' + '+' + l[c][2:]
			l[c] = S
			break
		if l[c][3] == 'O' and l[c][4] == 'O':
			S = l[c][:3] + '+' + '+'
			l[c] = S
			break
	c = c + 1
if flag == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(l[i])


inp1 = input()
inps = []
for i in range(int(inp1)):
	inp = input()
	inps.append(inp)
sig = True
counter = 0
for i in inps:
	counter += 1
	if 'OO' in i:
		i = i.replace('OO', '++', 1)
		inps.pop(counter - 1)
		inps.insert(counter - 1, i)
		print('YES')
		for i in inps:
			print(i)
		sig = False
		break
if sig:
	print('NO')


n = int(input())
l = []
for i in range(n):
	s = input()
	l.append(s)
oz = 0
for i in range(n):
	if l[i].count('OO') > 0:
		x = l[i].index('OO')
		l[i] = l[i][:x] + '++' + l[i][x + 2:]
		print('YES')
		for j in range(n):
			print(l[j])
		oz = 1
		break
if oz == 0:
	print('NO')


n = int(input())
a = []
k = False
for z in range(n):
	s = input()
	a.append(s)
	for i in range(4):
		if s[i] == 'O' and s[i + 1] == 'O' and (k == False):
			a[z] = s[0:i] + '++' + s[i + 2:]
			k = True
			break
if k:
	print('YES')
	for i in range(n):
		print(a[i])
else:
	print('NO')


n = int(input())
a = []
for i in range(n):
	t = 0
	a.append(list(input()))
for i in range(n):
	if a[i][0] == 'O' and a[i][1] == 'O':
		a[i][0] = '+'
		a[i][1] = '+'
		t = 1
		break
	if a[i][3] == 'O' and a[i][4] == 'O':
		a[i][3] = '+'
		a[i][4] = '+'
		t = 1
		break
if t == 1:
	print('YES')
	for i in range(n):
		for j in range(5):
			print(a[i][j], end='')
		print('')
else:
	print('NO')


n = int(input())
s = 0
b = ''
for i in range(n):
	a = input()
	b += a + '\n'
	if a[0] == 'O' and a[1] == 'O' or (a[3] == 'O' and a[4] == 'O'):
		s += 1
if s > 0:
	print('Yes')
	print(b.replace('OO', '++', 1))
else:
	print('No')


n = int(input())
a = []
flag = 1
for _ in range(n):
	a.append(list(input()))
for i in range(n):
	if a[i][0] == a[i][1] == 'O':
		a[i][0] = a[i][1] = '+'
		flag = 0
		break
	elif a[i][3] == a[i][4] == 'O':
		a[i][3] = a[i][4] = '+'
		flag = 0
		break
if flag:
	print('NO')
else:
	print('YES')
	for i in range(n):
		for j in range(5):
			print(a[i][j], end='')
		print('')


y = int(input())
r = 0
l = []
l2 = []
while y > 0:
	l = list(input())
	if l[0] == 'O' and l[1] == 'O' and (r != 1):
		l[0] = '+'
		l[1] = '+'
		r = 1
	if l[3] == 'O' and l[4] == 'O' and (r != 1):
		l[3] = '+'
		l[4] = '+'
		r = 1
	l2.append(l)
	y = y - 1

def pri():
	for i in l2:
		print(*i, sep='')
if r == 1:
	print('YES')
	pri()
else:
	print('NO')


import sys, math
n = int(input())
ans = []
flag = 0
for i in range(n):
	z = input()
	if not flag:
		if z[0] == 'O' and z[1] == 'O':
			z = '++' + z[2:]
			flag = 1
		elif z[3] == 'O' and z[4] == 'O':
			z = z[:3] + '++'
			flag = 1
	ans.append(z)
if not flag:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(ans[i])


n = int(input())
args = []
row = -1
for _ in range(n):
	args.append(input())
for (i, arg) in enumerate(args):
	if arg.count('OO') >= 1 and row == -1:
		row = i
if row == -1:
	print('NO')
else:
	print('YES')
	for (i, arg) in enumerate(args):
		if i == row:
			print(arg.replace('OO', '++', 1))
		else:
			print(arg)


n = int(input())
flag = 0
list1 = []
ans = 0
for i in range(n):
	s = list(input())
	for j in range(len(s) - 1):
		if s[j] == 'O' and s[j + 1] == 'O':
			s[j] = '+'
			s[j + 1] = '+'
			ans = 1
			k = i
			flag = 1
			break
	list1.append(''.join(s))
	if flag == 1:
		break
if flag == 1:
	for i in range(k + 1, n):
		s = input()
		list1.append(s)
else:
	print('NO')
if ans == 1:
	print('YES')
	for j in range(n):
		print(list1[j])


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [input() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [int(input()) for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

	@staticmethod
	def divisor(n):
		res = []
		i = 1
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				res.append(i)
				if i != n // i:
					res.append(n // i)
		return res

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

class PriorityQueue:

	def __init__(self, l=[]):
		self.q = l
		heapq.heapify(self.q)
		return

	def push(self, n):
		heapq.heappush(self.q, n)
		return

	def pop(self):
		return heapq.heappop(self.q)

def pop_count(x):
	x = x - (x >> 1 & 6148914691236517205)
	x = (x & 3689348814741910323) + (x >> 2 & 3689348814741910323)
	x = x + (x >> 4) & 1085102592571150095
	x = x + (x >> 8)
	x = x + (x >> 16)
	x = x + (x >> 32)
	return x & 127
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def main():
	N = Scanner.int()
	S = Scanner.string_list(N)
	isOK = False
	for i in range(N):
		if S[i][0:2] == 'OO':
			S[i] = '++' + S[i][2:]
			isOK = True
			break
		elif S[i][3:] == 'OO':
			S[i] = S[i][:3] + '++'
			isOK = True
			break
	print('NYOE S'[isOK::2])
	if isOK:
		print(*S, sep='\n')
main()


import math
import os
import random
import re
import sys
s = int(input())
t = ''
for i in range(s):
	t = t + str(input()) + ' '
if 'OO' in t:
	a = t.find('OO')
	t = t[:a] + '++' + t[a + 2:]
	print('YES')
	t = t.replace(' ', '\n')
	print(t)
else:
	print('NO')


n = int(input())
s = ''
for i in range(n):
	m = input()
	s += m + ' '
if 'OO' in s:
	print('YES')
	for i in range(len(s) - 1):
		if s[i] == s[i + 1] == 'O':
			s = s[:i] + '++' + s[i + 2:]
			break
	s = s.split()
	for i in s:
		print(i)
else:
	print('NO')


def main():
	t = int(input())
	n = [list(input()) for i in range(t)]
	found = False
	for i in n:
		if i[0] == 'O' and i[1] == 'O':
			i[0] = '+'
			i[1] = '+'
			found = True
			break
		elif i[3] == 'O' and i[4] == 'O':
			i[3] = '+'
			i[4] = '+'
			found = True
			break
	if found == True:
		print('YES')
		for j in [''.join(i) for i in n]:
			print(j)
	else:
		print('NO')
main()


n = int(input())
x = []
k = 0
for i in range(n):
	a = input()
	if a[0] == 'O' and a[1] == 'O' and (k == 0):
		x.append('++' + a[2:])
		k = 1
	elif a[3] == 'O' and a[4] == 'O' and (k == 0):
		x.append(a[:3] + '++')
		k = 1
	else:
		x.append(a)
if k == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(x[i])


size = int(input())
l = []
flag = True
for i in range(0, size):
	l.append(input())
	if flag == True and 'OO' in ''.join(l[i]):
		t = [x for x in l[i]]
		if t[0] == 'O' and t[1] == 'O':
			t[0] = '+'
			t[1] = '+'
		else:
			t[3] = '+'
			t[4] = '+'
		l.pop()
		l.append(''.join(t))
		flag = False
if flag == False:
	print('YES')
	for x in l:
		print(x)
else:
	print('NO')


a = int(input())
lst = []
for j in range(a):
	lst.append(input().strip().split('|'))

def main(lst):
	for i in range(len(lst)):
		if lst[i][0][0] == lst[i][0][1] == 'O':
			print('YES')
			lst[i][0] = '++'
			for j in lst:
				print('|'.join(j))
			return None
		if lst[i][1][0] == lst[i][1][1] == 'O':
			print('YES')
			lst[i][1] = '++'
			for j in lst:
				print('|'.join(j))
			return None
	print('NO')
	return None
main(lst)


n = int(input())
l = [[c for c in input()] for _ in range(n)]
ok = False
for r in l:
	if r[0] == r[1] == 'O':
		r[0] = r[1] = '+'
		ok = True
		break
	if r[3] == r[4] == 'O':
		r[3] = r[4] = '+'
		ok = True
		break
if ok:
	print('YES')
	for r in l:
		print(''.join(r))
else:
	print('NO')


n = int(input())
place_found = False
tab = []
for i in range(n):
	(a, b) = input().split('|')
	if place_found == False:
		if a == 'OO':
			a = '++'
			place_found = True
		elif b == 'OO':
			b = '++'
			place_found = True
	tab.append(a + '|' + b)
if place_found:
	print('YES')
	print(*tab, sep='\n')
else:
	print('NO')


n = int(input())
index = -1
arr = []
for i in range(n):
	seat = input()
	arr.append(seat)
	if 'OO' in seat and index == -1:
		index = i
if index == -1:
	print('NO')
else:
	edit = arr[index].split('|')
	if edit.index('OO') == 0:
		arr[index] = '++|' + edit[1]
	else:
		arr[index] = edit[0] + '|++'
	print('YES')
	for seat in arr:
		print(seat)


a = int(input())
k = int(0)
c = []
for i in range(a):
	b = input()
	if b.find('OO') != -1 and k == 0:
		c.append(b.replace('OO', '++', 1))
		k = k + 1
	else:
		c.append(b)
if k == 0:
	print('NO')
else:
	print('YES')
	for i in range(a):
		print(c[i])


n = int(input())
arr = []
flag = False
for i in range(n):
	tmp = input().split('|')
	if not flag:
		if tmp[0] == 'OO':
			tmp[0] = '++'
			flag = True
		if tmp[1] == 'OO' and (not flag):
			tmp[1] = '++'
			flag = True
	arr.extend([tmp[0], '|', tmp[1], '\n'])
if flag:
	print('YES')
	print(''.join(arr))
else:
	print('NO')


n = int(input())
a = []
v = 0
for i in range(n):
	x = list(input())
	a.append(x)
for i in range(n):
	if a[i][0] == 'O' and a[i][1] == 'O':
		v = 1
		(a[i][0], a[i][1]) = ('+', '+')
		break
	elif a[i][3] == 'O' and a[i][4] == 'O':
		v = 1
		(a[i][3], a[i][4]) = ('+', '+')
		break
if v == 1:
	print('YES')
	for u in a:
		print(''.join(u))
else:
	print('NO')


n = int(input())
seats = []
count = 0
for i in range(n):
	seat = input()
	if 'OO' in seat and count == 0:
		seat = seat.replace('OO', '++', 1)
		count += 1
	seats.append(seat)
if count > 0:
	print('YES')
	for i in range(n):
		print(seats[i])
else:
	print('NO')


n = int(input())
lines = [input().split('|') for _ in range(n)]
flag = False
for line in lines:
	if flag == True:
		break
	for seats in range(2):
		if line[seats] == 'OO':
			line[seats] = '++'
			flag = True
			break
if flag == True:
	print('YES')
	[print('|'.join(line)) for line in lines]
else:
	print('NO')


n = int(input())
L = []
c = 0
for i in range(n):
	L.append(input())
for i in range(n):
	if 'OO' in L[i]:
		L[i] = L[i].replace('OO', '++', 1)
		c += 1
		break
if c > 0:
	print('YES')
	for i in L:
		print(i)
else:
	print('NO')


n = int(input())
l = []
for i in range(n):
	l.extend(input().split('|'))
b = False
for i in range(len(l)):
	if l[i] == 'OO':
		l[i] = '++'
		b = True
		print('YES')
		break
if b:
	for i in range(len(l)):
		if i % 2 == 0:
			print(l[i] + '|', end='')
		else:
			print(l[i])
else:
	print('NO')


n = int(input())
out = []
test = True
for i in range(n):
	str1 = input()
	str2 = []
	if test:
		str2 = str1.split('|')
		if str2[0] == 'OO':
			str2[0] = '++'
			test = False
		elif str2[1] == 'OO':
			str2[1] = '++'
			test = False
		out.append(str2[0] + '|' + str2[1])
	else:
		out.append(str1)
if test:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(out[i])


n = int(input())
check = 0
ans = []
for i in range(n):
	s = list(input())
	if check == 0 and s[0] == 'O' and (s[1] == 'O'):
		(s[0], s[1]) = ('+', '+')
		check = 1
	if check == 0 and s[3] == s[4] == 'O':
		(s[3], s[4]) = ('+', '+')
		check = 1
	ans.append(s)
if check:
	print('YES')
	for i in ans:
		print(*i, sep='')
else:
	print('NO')


N = int(input())
ls = []
for i in range(N):
	s = input()
	ls.append(s[:2])
	ls.append(s[3:])
for i in range(2 * N):
	if ls[i] == 'OO':
		ls[i] = '++'
		break
else:
	print('NO')
	exit()
print('YES')
for i in range(N):
	print(ls[2 * i], '|', ls[2 * i + 1], sep='')


n = int(input())
a = []
for i in range(n):
	s = input()
	a.append(s)
b = []
c = 0
for i in a:
	if 'OO' in i and c == 0:
		b.append(i.replace('OO', '++', 1))
		c += 1
	else:
		b.append(i)
if c == 0:
	print('NO')
else:
	print('YES')
	for i in b:
		print(i)


n = int(input())
A = []
for i in range(n):
	A.append(input().split('|'))
ans = 'NF'
for i in range(len(A)):
	for j in range(2):
		if A[i][j] == 'OO':
			ans = [i, j]
if ans == 'NF':
	print('NO')
else:
	print('YES')
	A[ans[0]][ans[1]] = '++'
	for i in range(len(A)):
		print(A[i][0] + '|' + A[i][1])


n = int(input())
l = []
for i in range(n):
	l += input().split('|')
for i in range(len(l)):
	if 'OO' not in l:
		print('NO')
		break
	if 'OO' in l:
		if l[i] == 'OO':
			l[i] = '++'
			print('YES')
			for i in range(0, len(l) - 1, 2):
				print(l[i] + '|' + l[i + 1])
			break


n = int(input())
a = [input().split('|') for i in range(n)]
answer = 'NO'
for i in range(n):
	if a[i][0] == 'OO':
		a[i][0] = '++'
		answer = 'YES'
		break
	elif a[i][1] == 'OO':
		a[i][1] = '++'
		answer = 'YES'
		break
print(answer)
if answer == 'YES':
	for x in a:
		print('|'.join(x))


n = int(input())
b = 0
c = []
for i in range(n):
	a = input()
	if a[0] == 'O' and a[1] == 'O' and (b == 0):
		b = 1
		c.append(a.replace('O', '+', 2))
	elif a[-1] == 'O' and a[-2] == 'O' and (b == 0):
		b = 1
		c.append(a[::-1].replace('O', '+', 2)[::-1])
	else:
		c.append(a)
if b == 1:
	print('YES')
	for i in c:
		print(i)
else:
	print('NO')


n = int(input().strip())
count = 0
res = []
for i in range(n):
	string = input().strip()
	if count == 0:
		for i in range(len(string) - 1):
			if string[i] == string[i + 1] and string[i] == 'O':
				string = string[:i] + '++' + string[i + 2:]
				res.append(string)
				count += 1
				break
		if count == 0:
			res.append(string)
	else:
		res.append(string)
if count == 0:
	print('NO')
else:
	print('YES')
	for i in res:
		print(i)


n = int(input())
b = list()
for i in range(n):
	x = str(input())
	b.append(x)
for i in range(len(b)):
	flag = True
	for j in range(len(b[i]) - 1):
		if b[i][j] == b[i][j + 1] and b[i][j] == 'O':
			flag = False
			if j == 0:
				b[i] = '++' + b[i][2:]
			else:
				b[i] = b[i][:j] + '++'
			break
	if flag == False:
		break
if flag == True:
	print('NO')
	exit()
else:
	print('YES')
for i in b:
	print(i)


n = int(input())
mas = []
for i in range(n):
	a = str(input())
	mas.append(a)
t = False
for i in range(n):
	if mas[i][0] == 'O' and mas[i][1] == 'O':
		mas[i] = mas[i][:0] + '++' + mas[i][2:]
		t = True
		break
	elif mas[i][3] == 'O' and mas[i][4] == 'O':
		mas[i] = mas[i][:3] + '++' + mas[i][5:]
		t = True
		break
if t == True:
	print('YES')
	for i in range(len(mas)):
		print(mas[i])
else:
	print('NO')


n = int(input())
row = None
pair = None
shape = []
found = False
for i in range(n):
	(first, second, walkway, third, fourth) = list(input())
	if not found:
		if first == 'O' and second == 'O':
			row = i
			pair = 1
			first = '+'
			second = '+'
			shape.append([first, second, walkway, third, fourth])
			found = True
		elif third == 'O' and fourth == 'O':
			row = i
			pair = 2
			third = '+'
			fourth = '+'
			shape.append([first, second, walkway, third, fourth])
			found = True
		else:
			shape.append([first, second, walkway, third, fourth])
	else:
		shape.append([first, second, walkway, third, fourth])
if row is not None:
	print('YES')
	for row in shape:
		print(''.join(row))
else:
	print('NO')


n = int(input())
a = []
for i in range(n):
	a.append(input())
check = True
for i in range(n):
	if check and 'OO' in a[i]:
		k = list(a[i])
		z = a[i].index('OO')
		k[z] = '+'
		k[z + 1] = '+'
		a[i] = ''.join(k)
		check = False
if not check:
	print('YES')
	for each in a:
		print(each)
else:
	print('NO')


n = int(input())
l = []
r = []
c = 0
for i in range(n):
	s = input()
	l.append(s[0] + s[1])
	r.append(s[3] + s[4])
for i in range(len(l)):
	if l[i] == 'OO':
		l[i] = '++'
		break
	elif r[i] == 'OO':
		r[i] = '++'
		break
	else:
		c += 1
if c == len(l):
	print('NO')
else:
	print('YES')
	for i in range(len(l)):
		print(l[i] + '|' + r[i])


n = int(input())
seats = []
s = []
count = 0
for i in range(n):
	seats.append(input().split('|'))
for i in seats:
	if 'OO' in i[0]:
		count = 1
		i[0] = '++'
		break
	elif 'OO' in i[1]:
		count = 1
		i[1] = '++'
		break
if count == 1:
	print('YES')
	for i in seats:
		print(i[0], '|', i[1], sep='')
else:
	print('NO')


n = int(input())
isFound = False
l = []
for i in range(n):
	s = str(input())
	if not isFound and s.find('OO') >= 0:
		s = s.replace('OO', '++', 1)
		isFound = True
	l.append(s)
if isFound:
	print('YES')
	for i in l:
		print(i)
else:
	print('NO')


s1 = '\n'.join((input() for i in range(int(input()))))
s2 = s1.replace('OO', '++', 1)
if s1 != s2:
	print('YES\n' + s2)
else:
	print('NO')


rows = int(input())
seat_map = []
for i in range(0, rows):
	seat_map.append(input())
seat_ma = [i.split('|') for i in seat_map]
seat_flat = [item for sublist in seat_ma for item in sublist]
try:
	result = seat_flat.index('OO')
except:
	result = None
if result is not None:
	print('YES')
	seat_flat[result] = '++'
	final_config = []
	for i in range(0, len(seat_flat) - 1, 2):
		final_config.append(seat_flat[i] + '|' + seat_flat[i + 1])
	for (i, e) in enumerate(final_config, 2):
		print(e)
else:
	print('NO')


number = int(input())
first = []
for i in range(number):
	first.append(input().split('|'))
IS = False
for i in range(number):
	for j in range(2):
		if 'OO' == first[i][j] and IS == False:
			IS = True
			first[i][j] = '++'
if IS:
	print('YES')
	for i in range(number):
		print(first[i][0], '|', first[i][1], sep='')
else:
	print('NO')


n = int(input())
found = False
res = []
for _ in range(n):
	s = input()
	if not found:
		index = s.find('OO')
		if index != -1:
			found = True
			s = f'{s[:index]}++{s[index + 2:]}'
	res.append(s)
if not found:
	print('NO')
else:
	print('YES')
	for x in res:
		print(x)


n = int(input())
a = [''] * n
for i in range(n):
	a[i] = input()
yes = False
for (i, ai) in enumerate(a):
	j = ai.find('OO')
	if j >= 0:
		yes = True
		a[i] = ai.replace('OO', '++', 1)
		break
if yes:
	print('YES')
	for ai in a:
		print(ai)
else:
	print('NO')


n = int(input())
seating_plan = []
for i in range(n):
	seating_plan.append(input())
for i in range(n):
	if 'OO' in seating_plan[i]:
		seating_plan[i] = seating_plan[i].replace('OO', '++', 1)
		print('YES')
		print('\n'.join(seating_plan))
		break
else:
	print('NO')


import sys
n = int(input())
count = 0
seats = []
for i in range(n):
	seats.append(sys.stdin.readline().strip('\n'))
for i in range(n):
	if count == 0 and seats[i].count('OO'):
		seats[i] = seats[i].replace('OO', '++', 1)
		count = 1
	else:
		continue
if count == 1:
	print('YES')
	for i in seats:
		print(i)
else:
	print('NO')


n = int(input())
seats = [input() for _ in range(n)]
found = False
for i in range(n):
	if seats[i][0:3] == 'OO|':
		seats[i] = '++|' + seats[i][3:]
		found = True
		break
	elif seats[i][2:] == '|OO':
		seats[i] = seats[i][0:2] + '|++'
		found = True
		break
if found:
	print('YES')
	print('\n'.join(seats))
else:
	print('NO')


n = int(input())
bus = []
for x in range(0, n):
	line = list(input())
	bus.append(line)
res = False
for x in range(0, n):
	if bus[x][0] == 'O' and bus[x][1] == 'O':
		bus[x][0] = '+'
		bus[x][1] = '+'
		res = True
		break
	elif bus[x][3] == 'O' and bus[x][4] == 'O':
		bus[x][3] = '+'
		bus[x][4] = '+'
		res = True
		break
if res:
	print('YES')
	for x in range(0, n):
		print(bus[x][0] + bus[x][1] + bus[x][2] + bus[x][3] + bus[x][4])
else:
	print('NO')


n = int(input())
x = str()
for i in range(n):
	a = str(input())
	x += a + '\n'
if x.find('OO') != -1:
	x = x.replace('OO', '++', 1)
	print('YES', end='\n' + x)
else:
	print('NO')


import random
import sys
import os
rest = 0
final = []
allrows = []
rownum = int(sys.stdin.readline())
u = rownum
for x in range(0, rownum):
	rownum = sys.stdin.readline()
	row = rownum.split('|')
	allrows.append(row)
for x in range(0, u):
	for i in range(0, 2):
		if (allrows[x][i] == 'OO' or allrows[x][i] == 'OO\n') and rest == 0:
			if allrows[x][i] == 'OO\n':
				allrows[x][i] = '++\n'
			else:
				allrows[x][i] = '++'
			rest += 1
	final.append(allrows[x][0] + '|' + allrows[x][1])
if rest == 1:
	print('YES')
	for x in range(0, u):
		print(final[x], end='')
else:
	print('NO')


n = int(input())
bus = []
ok = False
for i in range(n):
	seats = input()
	if ok == False and seats.find('OO') > -1:
		ok = True
		seats = seats.replace('OO', '++', 1)
	bus.append(seats)
if ok == True:
	print('YES')
	for i in range(n):
		print(bus[i])
else:
	print('NO')


n = int(input())
yes = False
L = list()
for i in range(n):
	s = input()
	if 'OO' in s and (not yes):
		s1 = s.replace('OO', '++', 1)
		yes = True
		L.append(s1)
	else:
		L.append(s)
if yes:
	print('YES')
	for l in L:
		print(l)
else:
	print('NO')


n = int(input().strip())
f = False
out = []
for _ in range(n):
	inp = input().strip()
	if not f:
		if inp.startswith('OO'):
			out.append('++' + inp[2:])
			f = True
			continue
		elif inp.endswith('OO'):
			out.append(inp[0:3] + '++')
			f = True
			continue
	out.append(inp)
if f:
	print('YES')
	for i in out:
		print(''.join(i))
else:
	print('NO')


s = '\n'.join([input() for _ in range(int(input()))])
ns = s.replace('OO', '++', 1)
print('YES\n' + ns if ns != s else 'NO')


n = int(input())
idx = -1
side = 0
l = []
for i in range(n):
	s = input()
	if s[0] == s[1] and s[0] == 'O' and (s[1] == 'O') and (idx == -1):
		idx = i
	elif s[3] == s[4] and s[3] == 'O' and (s[4] == 'O') and (idx == -1):
		idx = i
		side = 1
	l.append(s)
if idx == -1:
	print('NO')
	exit()
else:
	print('YES')
	i = 0
	while i != idx:
		print(l[i])
		i = i + 1
	if side == 0:
		print('++' + l[i][2] + l[i][3] + l[i][4])
	elif side == 1:
		print(l[i][0] + l[i][1] + l[i][2] + '++')
	i = i + 1
	while i != n:
		print(l[i])
		i = i + 1


def main():
	n = int(input())
	rows = [input() for _ in range(n)]
	flag = False
	ans = []
	for row in rows:
		if not flag:
			if row.startswith('OO'):
				ans.append('++' + row[2:])
				flag = True
			elif row.endswith('OO'):
				ans.append(row[:3] + '++')
				flag = True
			else:
				ans.append(row)
		else:
			ans.append(row)
	if flag:
		print('YES')
		print(*ans, sep='\n')
	else:
		print('NO')
main()


r = int(input())
l = []
for x in range(0, r):
	l.append(input())
s = ''
ind = 0
f = 0
for i in l:
	if i[0:2] == 'OO':
		s = '++' + i[2:]
		f = 1
		ind = l.index(i)
		break
	elif i[3:5] == 'OO':
		s = i[0:3] + '++'
		f = 1
		ind = l.index(i)
		break
if f == 1:
	print('YES')
	p = 0
	for i in l:
		if p == ind:
			print(s)
		else:
			print(i)
		p += 1
else:
	print('NO')


import sys
from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
import collections
import math
import heapq
import re

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def most_frequent(list):
	return max(set(list), key=list.count)

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def Convert(string):
	li = list(string.split(''))
	return li

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
prime = []
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j

def main():
	n = inin()
	l = []
	flag = 0
	arr = []
	temp1 = []
	temp = 0
	for i in range(n):
		s = sin()
		arr.append(s)
		l = s.split('|')
		if flag == 0:
			if l[0] == 'OO' or l[1] == 'OO':
				print('YES')
				flag = 1
				temp = i
				if l[0] == 'OO':
					l[0] = '++'
				elif l[1] == 'OO':
					l[1] = '++'
				temp1.append(l[0])
				temp1.append(l[1])
		l = []
	if flag == 0:
		print('NO')
	for i in range(n):
		if flag == 1:
			if i != temp:
				print(arr[i])
			else:
				print(temp1[0] + '|' + temp1[1])
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
tempat = []
for i in range(0, n):
	tp = str(input())
	tp = list(tp)
	tempat.append([tp[0], tp[1]])
	tempat.append([tp[3], tp[4]])
code = 0
for i in range(0, len(tempat)):
	if tempat[i] == ['O', 'O']:
		code = 1
		tempat[i] = ['+', '+']
		break
if code == 0:
	print('NO')
else:
	print('YES')
	for i in range(0, len(tempat)):
		if i % 2 == 0:
			print(tempat[i][0] + tempat[i][1], end='')
		else:
			print('|' + tempat[i][0] + tempat[i][1])


def func(st):
	new = ''
	if 'OO' in st:
		if st.index('|') > st.index('OO'):
			new += '++' + st[st.index('OO') + 2:]
			return [True, new]
		else:
			new += st[:st.index('OO')] + '++'
			return [True, new]
	else:
		return [False, st]
c = v = 0
li = []
n = int(input())
for _ in range(n):
	st = input()
	if c == 0:
		res = func(st)
		if res[0]:
			li.append(res[1])
			c += 1
		else:
			v += 1
			li.append(st)
	else:
		li.append(st)
if v == n:
	print('NO')
else:
	print('YES')
	for i in li:
		print(i, end='\n')


n = input()
n = int(n)
stat = []
for i in range(n):
	stat = stat + input().split('|')
if 'OO' not in stat:
	print('NO')
else:
	stat[stat.index('OO')] = '++'
	print('YES')
	for i in range(n):
		print(stat[2 * i] + '|' + stat[2 * i + 1])


n = int(input())
count = 0
a = ''
for i in range(n):
	s = input()
	if 'OO' in s and count == 0:
		if s.count('OO') == 1:
			a = a + s.replace('OO', '++')
			count = count + 1
			continue
		elif s.count('OO') == 2:
			s = list(s)
			s[0] = '+'
			s[1] = '+'
			s = ''.join(s)
			a = a + s
			count = count + 1
			continue
	a = a + s
if count == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(a[5 * i:(i + 1) * 5])


a = int(input())
(b, c) = ([], [])
for x in range(a):
	b.append(input())
	c.append(list(b[x]))
for x in range(a):
	for y in range(4):
		if c[x][y] == 'O' and c[x][y + 1] == 'O':
			c[x][y] = '+'
			c[x][y + 1] = '+'
			A = 1
			break
		else:
			A = 0
	if A == 1:
		break
if A == 1:
	print('YES')
	for x in range(a):
		d = ''
		for y in range(5):
			d += c[x][y]
		print(d)
else:
	print('NO')


x = int(input())
s = []
l = 1
for n in range(x):
	s.append([n for n in input()])
	if s[n][0] == s[n][1] == 'O' and l == 1:
		s[n][0] = '+'
		s[n][1] = '+'
		l = 0
	elif s[n][3] == s[n][4] == 'O' and l == 1:
		s[n][3] = '+'
		s[n][4] = '+'
		l = 0
if l == 1:
	print('NO')
else:
	print('YES')
	for n in range(len(s)):
		for k in range(len(s[n])):
			print(s[n][k], end='')
		print()


from sys import stdin
n = int(stdin.readline())
output = ''
f = False
while n > 0:
	cur = stdin.readline().rstrip()
	if 'OO' in cur:
		output += cur.replace('OO', '++', 1) + '\n'
		print('YES')
		f = True
		break
	else:
		output += cur + '\n'
	n -= 1
if not f:
	print('NO')
for cur in stdin.readlines():
	cur = cur.rstrip()
	output += cur + '\n'
if f:
	print(output)


n = int(input())
ok = False
field = [list(input()) for _ in range(n)]
for i in field:
	if i[0] == i[1] == 'O' and (not ok):
		i[0] = '+'
		i[1] = '+'
		ok = True
	if i[3] == i[4] == 'O' and (not ok):
		i[3] = '+'
		i[4] = '+'
		ok = True
if not ok:
	print('NO')
else:
	print('YES')
	for i in field:
		print(*i, sep='')


n = int(input())
seats_list = [0] * n
for i in range(n):
	seats_list[i] = str(input())
ans = 'NO'
for i in range(n):
	if ans == 'YES':
		break
	if seats_list[i][:2] == 'OO':
		ans = 'YES'
		seats_list[i] = '++' + seats_list[i][2:]
		break
	elif seats_list[i][3:] == 'OO':
		ans = 'YES'
		seats_list[i] = seats_list[i][:3] + '++'
		break
print(ans)
if ans == 'YES':
	for s in seats_list:
		print(s)


n = int(input().strip())
f = False
out = []
for _ in range(n):
	inp = list(input().strip())
	if f:
		out.append(inp)
		continue
	elif inp[0:2] == ['O', 'O']:
		inp[0:2] = '++'
		out.append(inp)
		f = True
	elif inp[3:5] == ['O', 'O']:
		inp[3:5] = '++'
		out.append(inp)
		f = True
	else:
		out.append(inp)
print('YES' if f else 'NO')
if f:
	for i in out:
		print(''.join(i))


n = int(input())
bus = []
works = False
for _ in range(n):
	bus.append(input())
for (i, row) in enumerate(bus):
	if row[:2] == 'OO':
		bus[i] = '++' + row[2:]
		works = True
		break
	elif row[-2:] == 'OO':
		bus[i] = row[:-2] + '++'
		works = True
		break
if works:
	print('YES')
	print('\n'.join(bus))
else:
	print('NO')


n = int(input())
ansExists = False
ans = []
for i in range(0, n):
	s = list(input())
	if not ansExists:
		for j in range(0, len(s) - 1):
			if s[j] == 'O' and s[j + 1] == 'O' and (not ansExists):
				ansExists = True
				s[j] = '+'
				s[j + 1] = '+'
	ans.append(''.join(s))
if ansExists:
	print('YES')
	for s in ans:
		print(s)
else:
	print('NO')


n = int(input())
a = []
flag = 0
for x in range(n):
	b = list(input())
	if flag == 0:
		for y in range(4):
			if b[y] == 'O' and b[y + 1] == 'O':
				flag = 1
				b[y] = b[y + 1] = '+'
				break
	a.append(''.join(b))
if flag == 1:
	print('YES')
	print('\n'.join(a))
else:
	print('NO')


n = int(input())
l = []
k = 0
for i in range(n):
	s = input()
	if 'OO' in s:
		if s.count('OO') == 1:
			s = s.replace('OO', '++')
		elif s.count('OO') == 2:
			s = '++' + s[2:]
		l.append(s)
		k = 1
		break
	else:
		l.append(s)
for j in range(n - i - 1):
	s = input()
	l.append(s)
if k == 1:
	print('YES')
	for i in l:
		print(i)
else:
	print('NO')


n = int(input())
out = ''
flag = False
for i in range(n):
	config = input()
	if 'OO' in config and (not flag):
		out += config.replace('OO', '++', 1) + '\n'
		flag = True
	else:
		out += config + '\n'
if flag:
	print('YES')
	print(out)
else:
	print('NO')


rows = int(input())
bus = []
answer = 'NO'
for row in range(rows):
	seats = input()
	if 'OO' in seats and answer == 'NO':
		seats = seats.replace('OO', '++', 1)
		answer = 'YES'
	bus.append(seats)
if answer == 'YES':
	print(answer)
	for row in bus:
		print(row)
else:
	print('NO')


n = int(input())
s = ''
q = ''
x = -1
for i in range(n):
	p = str(input())
	s = s + ' ' + p
x = s.find('OO')
if x != -1:
	print('YES')
	q = s[0:x] + '++' + s[x + 2:len(s)]
	q = q.strip()
	q = q.replace(' ', '\n')
	print(q)
else:
	print('NO')


n = int(input())
s = []
tr = False
for i in range(n):
	l = input().split('|')
	if tr == False and 'OO' in l[0]:
		l[0] = l[0].replace('OO', '++')
		tr = True
	elif tr == False and 'OO' in l[1]:
		l[1] = l[1].replace('OO', '++')
		tr = True
	s.append([l[0] + '|' + l[1]])
if tr == True:
	print('YES')
	for i in s:
		print(*i)
else:
	print('NO')


n = int(input())
a = []
l = 1
a = []
for i in range(n):
	s = input()
	if l == 1 and s.count('OO') > 0:
		if s.find('OO') == 0:
			a.append('++' + s[2:])
		else:
			a.append(s[:3] + '++')
		l = 0
	else:
		a.append(s)
if l == 1:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(a[i])


n = int(input())
ans = False
a = []
for _ in range(n):
	s = input()
	if ans == True:
		a.append(s)
		continue
	if s[0] == 'O' and s[1] == 'O':
		ans = True
		a.append('++' + s[2:])
	elif s[3] == 'O' and s[4] == 'O':
		ans = True
		a.append(s[:3] + '++')
	else:
		a.append(s)
if ans:
	print('YES')
	for ss in a:
		print(ss)
else:
	print('NO')


x = []
got = False
n = int(input())
for i in range(n):
	c = input()
	if c.find('OO') != -1 and (not got):
		c = c.replace('OO', '++', 1)
		got = True
	x.append(c)
found = False
for i in x:
	if '++' in i:
		found = True
		break
if found:
	print('YES')
	for i in x:
		print(i)
else:
	print('NO')


n = int(input())
rows = [input() for _ in range(n)]
for i in range(n):
	if 'OO' in rows[i]:
		rows[i] = rows[i].replace('OO', '++', 1)
		print('YES')
		for row in rows:
			print(row)
		break
else:
	print('NO')


p = 0
a = []
n = int(input())
for i in range(n):
	w = input()
	a.append(w)
for i in range(n):
	if a[i][0] == 'O' and a[i][1] == 'O' and (p != 1):
		a[i] = '++' + a[i][2:5]
		p = 1
	elif a[i][3] == 'O' and a[i][4] == 'O' and (p != 1):
		a[i] = a[i][0:3] + '++'
		p = 1
if p == 1:
	print('YES')
	for i in range(n):
		print(a[i])
else:
	print('NO')


a = int(input())
l = []
for i in range(a):
	n = input()
	l.append(n)
for s in range(len(l)):
	if l[s][0:2] == 'OO' or l[s][3:5] == 'OO':
		print('YES')
		x = s
		for i in range(len(l)):
			if x == i:
				if l[i][0:2] == 'OO':
					print('++' + l[i][2:])
				else:
					print(l[i][0:3] + '++')
			else:
				print(l[i])
		break
else:
	print('NO')


b = [input() for _ in range(int(input()))]
for r in b:
	if r[:2] == 'OO':
		print('YES')
		b[b.index(r)] = '++' + r[2:]
		for x in b:
			print(x)
		break
	elif r[3:] == 'OO':
		print('YES')
		b[b.index(r)] = r[:3] + '++'
		for x in b:
			print(x)
		break
else:
	print('NO')


import math

def solve(arr):
	for (i, v) in enumerate(arr):
		if v == 'OO':
			arr[i] = '++'
			print('YES', end='\n')
			for j in range(0, len(arr), 2):
				print(f'{arr[j]}|{arr[j + 1]}', end='\n')
			return
	print('NO')
	return

def main():
	arr2 = []
	n = int(input())
	for j in range(n):
		i = input().split('|')
		arr2 = arr2 + i
	solve(arr2)
main()


n = int(input())
l = []
for _ in ' ' * n:
	l.append(input())
for (j, i) in enumerate(l):
	if 'OO' in i:
		if i[0:2] == 'OO':
			l[j] = '++' + i[2:]
		else:
			l[j] = i[0:3] + '++'
		print('YES')
		for i in l:
			print(i)
		break
	if j == len(l) - 1 and 'OO' not in i:
		print('NO')


N = int(input())
rows = [None] * N
found = False
for i in range(N):
	rows[i] = input()
for i in range(N):
	temp = rows[i].split('|')
	if temp[0] == 'OO':
		found = True
		rows[i] = '++|' + temp[1]
		break
	elif temp[1] == 'OO':
		found = True
		rows[i] = temp[0] + '|++'
		break
if not found:
	print('NO')
	exit()
print('YES')
for i in range(N):
	print(rows[i])


n = int(input())
f = []
k = 0
for i in range(n):
	s = input()
	x = s.split('|')
	if 'OO' in x and k == 0:
		k = 1
		if x.index('OO') == 0:
			f.append('++|' + x[1])
		else:
			f.append(x[0] + '|++')
	else:
		f.append(s)
if k == 0:
	print('NO')
else:
	print('YES')
	for i in f:
		print(i, end='\n')


n = int(input())
s = []
for i in range(n):
	s.append(input())
for i in range(n):
	if s[i][0] == s[i][1] == 'O':
		s[i] = '++' + s[i][2:]
		print('YES')
		print('\n'.join(s))
		break
	if s[i][3] == s[i][4] == 'O':
		s[i] = s[i][:3] + '++'
		print('YES')
		print('\n'.join(s))
		break
else:
	print('NO')


from collections import deque, Counter
import array
from itertools import combinations, permutations
from math import sqrt
import unittest

def read_int():
	return int(input().strip())

def read_int_array():
	return [int(i) for i in input().strip().split(' ')]
n = read_int()
rows = []
sitted = False
for i in range(n):
	row = input().strip()
	if not sitted and 'OO' in row:
		rows += [row.replace('OO', '++', 1)]
		sitted = True
	else:
		rows += [row]
if sitted:
	print('YES')
	print('\n'.join(rows))
else:
	print('NO')


n = int(input())
res = []
found = False
for _ in range(n):
	row = input()
	s = row.split('|')
	if not found:
		if s[0] != 'OO' and s[1] != 'OO':
			res.append(row)
		else:
			if s[0] == 'OO':
				res.append('++|' + s[1])
			else:
				res.append(s[0] + '|++')
			found = True
	else:
		res.append(row)
if found:
	print('YES')
	print('\n'.join(res))
else:
	print('NO')


a = int(input())
k = False
T = []
for x in range(a):
	A = input()
	if k == False:
		j = -1
		if A[:2] == 'OO':
			j = 1
			k = True
		elif A[3:] == 'OO':
			j = 2
			k = True
		if j != -1:
			if j == 1:
				A = '++|' + A[3:]
			else:
				A = A[:2] + '|++'
	T.append(A)
if k == True:
	print('YES')
	for x in T:
		print(x)
else:
	print('NO')


n = int(input())
flg = 0
arr = []
for i in range(n):
	s = input()
	if flg == 0:
		if s.find('OO') != -1:
			x = s.find('OO')
			s = s[:x] + '++' + s[x + 2:]
			flg = 1
	arr.append(s)
if flg == 0:
	print('NO')
else:
	print('YES')
	for x in arr:
		print(x)


n = int(input())
y = []
d = ''
z = 0
for i in range(n):
	x = list(map(str, input().split('|')))
	y.append(x)
for i in range(n):
	for j in range(2):
		if y[i][j] == 'OO' and z == 0:
			y[i][j] = '++'
			d = 'YES'
			z = 1
if d == 'YES':
	print(d)
	for i in range(n):
		for j in range(2):
			print(y[i][j], end='')
			if j != 1:
				print('|', end='')
		print()
else:
	print('NO')


import sys
inp = int(input())
if inp in range(1, 1001):
	pass
else:
	sys.exit()
seats = []
for inputs in range(inp):
	seat = input()
	seat = seat.split('|')
	seats.append(seat)
count = 1
flag = 0
elem = []
for i in seats:
	for j in i:
		if j == 'OO' and count < 2:
			j = '++'
			count += 1
			elem.append(j)
			flag = 1
		else:
			elem.append(j)
if flag == 0:
	print('NO')
else:
	print('YES')
	for j in range(0, len(elem), 2):
		print(elem[j] + '|' + elem[j + 1])


def main():
	n = int(input())
	answer = []
	found = False
	for i in range(n):
		temp = input()
		if not found and temp[0] == 'O' and (temp[1] == 'O'):
			answer.append('++' + temp[2:])
			found = True
			continue
		if not found and temp[3] == 'O' and (temp[4] == 'O'):
			answer.append(temp[:3] + '++')
			found = True
			continue
		answer.append(temp)
	if found:
		print('YES')
		for i in answer:
			print(i)
	else:
		print('NO')
main()


def solve(test):
	n = int(input())
	ok = False
	s = []
	for i in range(n):
		t = list(input())
		for i in range(len(t) - 1):
			if not ok and t[i] == 'O' and (t[i + 1] == 'O'):
				ok = True
				t[i] = '+'
				t[i + 1] = '+'
				break
		s.append(''.join(t))
	if ok:
		print('YES')
		for i in s:
			print(i)
	else:
		print('NO')
t = 1
for _ in range(t):
	solve(_ + 1)


n = int(input())
found = False
res = [input().split('|') for _ in range(n)]
for ii in range(n):
	for i in range(2):
		if res[ii][i] == 'OO':
			res[ii][i] = '++'
			found = True
			break
	if found:
		break
if found:
	print('YES')
	for ii in range(n):
		print('|'.join(res[ii]))
else:
	print('NO')


n = int(input())
b = []
a = 0
for i in range(1, n + 1):
	x = input()
	if a == 0:
		if 'OO' in x:
			x = x.replace('OO', '++', 1)
			a = 1
	b.append(x)
if a == 1:
	print('YES')
	for i in b:
		print(i)
else:
	print('NO')


n = int(input())
places = []
for i in range(n):
	place = input().split('|')
	places.append(place)
can = False
for i in range(len(places)):
	if 'OO' in places[i]:
		if places[i][0] == 'OO':
			places[i] = ['++', places[i][1]]
		else:
			places[i] = [places[i][0], '++']
		can = True
		break
if can:
	print('YES')
	for row in places:
		print('|'.join(row))
else:
	print('NO')


n = int(input())
cond = False
seats = []
for i in range(n):
	x = input()
	if not cond:
		if 'OO' in x:
			if x[:2] == 'OO':
				x = '++' + x[2:]
			else:
				x = x[:3] + '++'
			cond = True
	seats.append(x)
if not cond:
	print('No')
else:
	print('Yes')
	for i in range(n):
		print(seats[i])


n = int(input())
s = ''
for i in range(n):
	string = input()
	s = s + string + '\n'
if 'OO' in s:
	print('YES')
	s = s.replace('OO', '++', 1)
	print(s)
else:
	print('NO')


n = int(input())
arr = []
found = False
for i in range(n):
	s = input()
	for c in s:
		arr.append(c)
	arr.append('W')
for i in range(len(arr) - 1):
	if arr[i] == 'O' and arr[i + 1] == 'O':
		arr[i] = '+'
		arr[i + 1] = '+'
		found = True
		break
arr = list(filter(lambda a: a != 'W', arr))
if found:
	print('YES')
	i = 0
	for x in range(n):
		print(arr[i] + arr[i + 1] + arr[i + 2] + arr[i + 3] + arr[i + 4])
		i += 5
else:
	print('NO')


n = int(input())
import sys
x = [input() for i in range(n)]
for i in range(len(x)):
	if x[i].find('|OO') != -1:
		print('YES')
		y = x[i].replace('|OO', '|++')
		x.remove(x[i])
		x.insert(i, y)
		for j in range(len(x)):
			print(x[j])
		sys.exit()
	if x[i].find('OO|') != -1:
		print('YES')
		z = x[i].replace('OO|', '++|')
		x.remove(x[i])
		x.insert(i, z)
		for j in range(len(x)):
			print(x[j])
		sys.exit()
print('NO')


n = int(input())
c = []
d = []
for i in range(n):
	a = list(input())
	if '+' in c:
		d.append(a)
	elif a[0] == 'O' and a[1] == 'O':
		a[0] = '+'
		a[1] = '+'
		c.append('+')
		d.append(a)
	elif a[3] == 'O' and a[4] == 'O':
		a[3] = '+'
		a[4] = '+'
		c.append('+')
		d.append(a)
	else:
		d.append(a)
for i in range(n):
	if '+' in d[i]:
		d.insert(0, ['YES'])
		break
if ['YES'] not in d:
	print('NO')
else:
	for i in range(len(d)):
		d[i] = ''.join(d[i])
		print(d[i])


l = []
j = 0
for i in range(int(input())):
	(a, b) = input().split('|')
	l.append((a, b))
	if a[0] == a[-1] == 'O' or b[0] == b[-1] == 'O':
		j += 1
if j:
	print('YES')
	j = 1
	for (a, b) in l:
		if j == 1 and a[0] == a[-1] == 'O':
			j -= 1
			print('++', '|', b, sep='')
			continue
		if j == 1 and b[0] == b[-1] == 'O':
			j -= 1
			print(a, '|', '++', sep='')
			continue
		print(a, '|', b, sep='')
else:
	print('NO')


tc = int(input())
m = 0
n = []
for k in range(tc):
	seat = input()
	if seat[:2] == 'OO' and m == 0:
		n.append('++|{}'.format(seat[3:5]))
		m += 1
	elif seat[3:5] == 'OO' and m == 0:
		n.append('{}|++'.format(seat[:2]))
		m += 1
	else:
		n.append(seat)
if m > 0:
	print('YES')
	for k in n:
		print(k)
else:
	print('NO')


n = int(input())
bus = []
for _ in range(n):
	bus.append(input().split('|'))
seated = False
for i in range(n):
	if bus[i][0] == 'OO':
		seated = True
		bus[i][0] = '++'
	elif bus[i][1] == 'OO':
		seated = True
		bus[i][1] = '++'
	if seated == True:
		break
if seated == False:
	print('NO')
else:
	print('YES')
	for row in bus:
		print('|'.join(row))


n = int(input())
p = []
r = ''
count = 0
i = 0
for _ in range(n):
	a = input()
	if 'OO' in a and count == 0:
		count += 1
		for i in range(len(a)):
			if a[i] == 'O' and a[i + 1] == 'O':
				r += '++'
				break
			else:
				r += a[i]
		for j in range(i + 2, len(a)):
			r += a[j]
		p.append(r)
	else:
		p.append(a)
if count != 0:
	print('YES')
	for i in p:
		print(i)
else:
	print('NO')


n = int(input())
s = ''
f = True
for _ in range(n):
	x = input()
	if 'OO' in x and f:
		s += x.replace('OO', '++', 1) + '\n'
		f = False
	else:
		s += x + '\n'
if not f:
	print('YES')
	print(s)
else:
	print('NO')


n = int(input())
tg = False
st = ''
for i in range(n):
	s = input()
	if 'OO' in s and (not tg):
		tg = True
		if s == 'OO|OO':
			s = '++|OO'
		else:
			s = s.replace('OO', '++')
	st += s + '\n'
print('YES' if tg else 'NO')
if tg:
	print(st)


n = int(input(''))
(sits, check) = ([], False)
for i in range(n):
	sits.append(input('').split('|'))
for i in range(len(sits)):
	if sits[i][0] == 'OO':
		sits[i][0] = '++'
		print('YES')
		for sit in sits:
			print('|'.join(sit))
		check = True
		break
	if sits[i][1] == 'OO':
		sits[i][1] = '++'
		print('YES')
		for sit in sits:
			print('|'.join(sit))
		check = True
		break
if not check:
	print('NO')


a = int(input())
b = []
c = 0
for i in range(a):
	b.append(input())
for i in range(a):
	if b[i].find('OO') != -1:
		c = 1
		if b[i] == 'XX|OO':
			b[i] = 'XX|++'
		elif b[i] == 'OO|XX':
			b[i] = '++|XX'
		elif b[i] == 'OO|OO':
			b[i] = '++|OO'
		elif b[i] == 'OX|OO':
			b[i] = 'OX|++'
		elif b[i] == 'XO|OO':
			b[i] = 'XO|++'
		elif b[i] == 'OO|XO':
			b[i] = '++|XO'
		else:
			b[i] = '++|OX'
		break
if c == 1:
	print('YES')
	for i in b:
		print(i)
else:
	print('NO')


n = int(input())
done = False
arr = []
for _ in range(n):
	ps = input().split('|')
	if not done:
		if ps[0] == 'OO':
			arr.append('++|' + ps[1])
			done = True
		elif ps[1] == 'OO':
			arr.append(ps[0] + '|++')
			done = True
		else:
			arr.append(ps[0] + '|' + ps[1])
	else:
		arr.append(ps[0] + '|' + ps[1])
if not done:
	print('NO')
else:
	print('YES')
	list(map(print, arr))


bus = ['' for i in range(1010)]
ans = 'NO'
loop = True
n = int(input().strip())
for i in range(n):
	inp = input().strip()
	if loop and (inp[0] == 'O' and inp[1] == 'O'):
		ans = 'YES'
		loop = False
		bus[i] = '++|' + inp[3] + inp[4]
	elif loop and inp[3] == 'O' and (inp[4] == 'O'):
		ans = 'YES'
		loop = False
		bus[i] = '' + inp[0] + inp[1] + '|++'
	else:
		bus[i] = inp
print(ans)
if not loop:
	for i in range(n):
		print(bus[i])


n = int(input())
seat = []
for i in range(n):
	seat.append(input())
boo = False
for i in range(n):
	for j in range(4):
		if seat[i][j] == 'O' and seat[i][j + 1] == 'O':
			boo = True
			break
	if boo:
		break
if boo:
	print('YES')
	for j in range(n):
		if j != i:
			print(seat[j])
		else:
			l = seat[i].split('|')
			if l[0] == 'OO':
				print('++' + '|' + l[1])
			elif l[1] == 'OO':
				print(l[0] + '|' + '++')
else:
	print('NO')


n = int(input())
seats = []
seatThere = True
for i in range(n):
	seat = input()
	if 'OO' in seat and seatThere:
		seatL = list(seat)
		if seatL[0] == 'O' and seatL[1] == 'O':
			seatL[0] = '+'
			seatL[1] = '+'
		elif seatL[3] == 'O' and seatL[4] == 'O':
			seatL[3] = '+'
			seatL[4] = '+'
		seatThere = False
		seat = ''.join(seatL)
	seats.append(seat)
if seatThere:
	print('NO')
else:
	print('YES')
	for seat in seats:
		print(seat)


n = int(input())
t = 0
s = []
for i in range(n):
	s.append([j for j in input().split('|')])
for i in range(n):
	if s[i][0] == 'OO':
		s[i][0] = '++'
		t = 1
		break
	if s[i][1] == 'OO':
		s[i][1] = '++'
		t = 1
		break
if t == 0:
	print('NO')
else:
	print('YES')
	for i in s:
		print('|'.join(i))


import math

def pcase(i, num):
	print('Case #{0}: {1}'.format(i + 1, num))
n = int(input())
lines = []
yuh = False
for _ in range(n):
	r = input()
	if 'OO' in r and (not yuh):
		yuh = True
		if r[0:2] == 'OO':
			r = '++' + r[2:]
		else:
			r = r.replace('OO', '++')
	lines.append(r)
if yuh:
	print('YES')
	for l in lines:
		print(l)
else:
	print('NO')


n = int(input())
config = []
count = 0
for _ in range(n):
	a = input()
	config.append(a)
for i in range(n):
	if count == 1:
		break
	else:
		b = config[i].split('|')
		k = b.count('OO')
		if k == 1:
			c = b.index('OO')
			res = ['++' if x == 'OO' else x for x in b]
			config[i] = '|'.join(res)
			count += 1
		elif k == 2:
			t = 0
			res = '++|OO'
			config[i] = res
			count += 1
if count == 1:
	print('YES')
	for i in config:
		print(i)
else:
	print('NO')


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def foo():
	n = inp()
	arr = []
	flag = 0
	for i in range(n):
		arr.append(input())
	idx = 0
	for item in arr:
		if item[0] == item[1] == 'O':
			flag = 1
			rp = item.replace('O', '+', 2)
			arr[idx] = rp
			break
		if item[3] == item[4] == 'O':
			flag = 2
			rp = item[:3] + '+' + '+' + '\n'
			arr[idx] = rp
			break
		idx += 1
	if flag == 1:
		print('YES')
		s1 = ''
		print(s1.join(arr))
	elif flag == 2:
		print('YES')
		s1 = ''
		print(s1.join(arr))
	else:
		print('NO')
foo()


n = int(input())
seatarr = list()
flag = 0
for i in range(n):
	row = input()
	if row[:2] == 'OO' and flag == 0:
		x = '++' + row[2:]
		seatarr.append(x)
		flag = 1
	elif row[3:] == 'OO' and flag == 0:
		x = row[:3] + '++'
		seatarr.append(x)
		flag = 1
	else:
		seatarr.append(row)
if flag == 1:
	print('YES')
	for j in seatarr:
		print(j)
else:
	print('NO')


l = []
flag = 0
n = int(input())
for a in range(n):
	s = input()
	if s.count('OO') and flag == 0:
		s = s.replace('OO', '++', 1)
		flag = 2
	l.append(s)
if flag:
	print('YES')
	for a in range(len(l)):
		print(l[a])
else:
	print('NO')


hm = int(input())
seats = []
for i in range(hm):
	(a, b) = input().split('|')
	seats.append(a)
	seats.append(b)
if 'OO' not in seats:
	print('NO')
else:
	for i in range(hm * 2):
		if seats[i] == 'OO':
			print('YES')
			seats[i] = '++'
			break
	i = 0
	while i < hm * 2:
		print(seats[i] + '|' + seats[i + 1])
		i += 2


n = int(input())
bus = []
for i in range(n):
	seat = input()
	bus.append(seat)
ch_bus = bus[:]
for i in range(len(bus)):
	if bus[i][:2] == 'OO':
		bus[i] = bus[i][0:3].replace('O', '+') + bus[i][3:]
		break
	elif bus[i][3:] == 'OO':
		bus[i] = bus[i][:3] + bus[i][3:].replace('O', '+')
		break
if ch_bus == bus:
	print('NO')
else:
	print('YES')
	for i in bus:
		print(i)


bus = []
aquiteed = False
for _ in range(int(input())):
	rows = []
	(r1, r2) = input().split('|')
	if not aquiteed:
		if r1 == 'OO':
			rows.append(f'++|{r2}')
			aquiteed = True
		elif r2 == 'OO':
			rows.append(f'{r1}|++')
			aquiteed = True
		else:
			rows.append(f'{r1}|{r2}')
	else:
		rows.append('|'.join((r1, r2)))
	bus.extend(rows)
if aquiteed:
	print('YES')
	print(*bus, sep='\n')
else:
	print('NO')


n = int(input())
count = 1
y = 0
d = {}
while count <= n:
	seat = input()
	d[str(count)] = seat.split('|')
	count += 1
for b in d.values():
	if b[0] == 'OO':
		b[0] = '++'
		print('YES')
		y += 1
		break
	elif b[1] == 'OO':
		b[1] = '++'
		print('YES')
		y += 1
		break
	else:
		pass
if y == 1:
	for b in d.values():
		print('|'.join(b))
else:
	print('NO')


def ind(li):
	for i in range(len(li)):
		if li[i] == 'OO':
			return i
	return -1
n = int(input())
li = []
for i in range(n):
	li.extend(input().split('|'))
ind = ind(li)
if ind >= 0:
	print('YES')
	li[ind] = '++'
	for i in range(len(li)):
		if i % 2 != 0:
			print('|', end='')
			print(li[i])
		else:
			print(li[i], end='')
else:
	print('NO')


import sys
fin = sys.stdin
fout = sys.stdout
n = int(fin.readline())
temp = []
for cur in fin.readlines():
	temp.append(cur.strip())
for i in range(len(temp)):
	cur = temp[i]
	if cur[0] == 'O' and cur[1] == 'O':
		cur = '++' + cur[2:]
		fout.write('YES\n')
		temp[i] = cur
		for cur2 in temp:
			fout.write(''.join(cur2) + '\n')
		break
	if cur[3] == 'O' and cur[4] == 'O':
		cur = cur[:3] + '++'
		fout.write('YES\n')
		temp[i] = cur
		for cur2 in temp:
			fout.write(''.join(cur2) + '\n')
		break
else:
	fout.write('NO')


n = int(input())
lst = []
ind = []
for i in range(n):
	s = input()
	lst.append(s)
	if 'OO' in s:
		ind.append(i)
if ind != []:
	print('YES')
	for i in range(ind[0] + 1):
		if 'OO' in lst[i]:
			lst[i] = lst[i].replace('OO', '++', 1)
		print(lst[i])
	for i in range(ind[0] + 1, len(lst)):
		print(lst[i])
else:
	print('NO')


n = int(input())
output = ''
found = False
for i in range(n):
	row = input()
	if not found and 'OO' in row:
		found = True
		row = row.replace('OO', '++', 1)
	output += row + '\n'
if found:
	print('YES')
	print(output)
else:
	print('NO')


n = int(input())
l = []
seat = False
for _ in range(n):
	x = str(input())
	if 'OO' in x and (not seat):
		x = x.replace('OO', '++', 1)
		seat = True
	l.append(x.split('|'))
if seat:
	print('YES')
	for x in l:
		print('{}|{}'.format(x[0], x[1]))
else:
	print('NO')


n = int(input())
flag = 0
a = []
b = []
for i in range(n):
	a.append(input())
for j in range(n):
	for i in a[j]:
		b.append(i)
for i in range(len(a)):
	for j in range(4):
		if a[i][j] == 'O' and a[i][j + 1] == 'O':
			b[i * 5 + j] = '+'
			b[i * 5 + j + 1] = '+'
			flag = 1
			break
	if flag == 1:
		break
if flag == 1:
	print('YES')
	for i in range(len(b) // 5):
		for j in range(5):
			print(b[i * 5 + j], end='')
		print()
else:
	print('NO')


n = int(input())
li = []
for i in range(n):
	s = input().split('|')
	li.extend(s)
flag = 0
for i in range(2 * n):
	if li[i] == 'OO':
		print('YES')
		li[i] = '++'
		flag = 1
		break
if flag == 0:
	print('NO')
else:
	for i in range(0, 2 * n, 2):
		print(li[i] + '|' + li[i + 1])


n = int(input())
l1 = []
for i in range(n):
	l = list(input().split('|'))
	l1.append(l)
co = 0
for i in range(n):
	for j in range(2):
		if l1[i][j] == 'OO':
			print('YES')
			co += 1
			l1[i][j] = '++'
			break
	if co != 0:
		break
if co == 0:
	print('NO')
	exit()
for i in range(n):
	print(*l1[i], sep='|')


(a, d, v) = (int(input()), [], False)
for i in range(a):
	d.append(input())
	if not v and d[-1][:2] == 'OO':
		d[-1] = '++' + d[-1][2:]
		v = True
	elif not v and d[-1][3:] == 'OO':
		d[-1] = d[-1][:3] + '++'
		v = True
if v:
	print('YES')
	for i in d:
		print(i)
else:
	print('NO')


t = int(input())
c = 0
z = 0
b = []
for j in range(0, t):
	s = input()
	a = list(s)
	for i in range(0, len(a) - 1):
		if a[i] == 'O' and a[i + 1] == 'O' and (c == 0):
			c = c + 1
			(a[i], a[i + 1]) = ('+', '+')
			b.append(a)
			z = j
	b.append(s)
if c == 0:
	print('NO')
else:
	print('YES')
	for i in range(0, len(b)):
		if i != z + 1:
			print(*b[i], sep='')


n = int(input())
B = False
s = ''
for i in range(n):
	ch = input().split('|')
	if ch[0] == 'OO' and B == False:
		ch[0] = '++'
		B = True
	if ch[1] == 'OO' and B == False:
		ch[1] = '++'
		B = True
	s += ch[0] + '|' + ch[1] + '\n'
if B:
	print('YES')
	print(s[:-1])
else:
	print('NO')


num = int(input(''))
seats = []
for x in range(0, num):
	inp = input('')
	seats.append(inp)
result = -1
for x in range(0, num):
	if 'OO' in seats[x]:
		result = 1
		y = x
	else:
		pass
if result > 0:
	print('YES')
	for x in range(0, num):
		if x != y:
			print(seats[x])
		elif 'OO|' in seats[x]:
			print(seats[x].replace('OO|', '++|'))
		elif '|OO' in seats[x]:
			print(seats[x].replace('|OO', '|++'))
else:
	print('NO')


n = int(input())
flag = 0
l = []
l1 = []
for j in range(n):
	(a, b) = input().split('|')
	l.append(a)
	l1.append(b)
for i in range(len(l)):
	if l[i] == 'OO':
		l[i] = '++'
		flag = 1
		break
	elif l1[i] == 'OO':
		l1[i] = '++'
		flag = 1
		break
if flag == 1:
	print('YES')
	for k in range(n):
		print(l[k] + '|' + l1[k])
else:
	print('NO')


n = int(input())
seat0 = []
for i in range(n):
	seat0.append(input())

def f(i):
	return i.split('|')
seat = []
for i in range(n):
	seat.append(f(seat0[i]))
for pos in range(n):
	if seat[pos][0] == 'OO':
		seat[pos][0] = '++'
		print('YES')
		for l in range(n):
			print(seat[l][0] + '|' + seat[l][1])
		break
	elif seat[pos][1] == 'OO':
		seat[pos][1] = '++'
		print('YES')
		for l in range(n):
			print(seat[l][0] + '|' + seat[l][1])
		break
else:
	print('NO')


n = int(input())
l = []
a = 0
m = []
for i in range(n):
	s = input()
	if s.startswith('OO') == True and a == 0:
		a = a + 1
		s = s.replace('OO', '++', 1)
	elif s.endswith('OO') == True and a == 0:
		a = a + 1
		s = s.replace('OO', '++', 1)
	m.append(s)
	l.append(m)
	m = []
if a > 0:
	print('YES')
	for i in range(n):
		s = ''
		print(s.join(l[i]))
else:
	print('NO')


i = int(input())
f = True
p = []
for k in range(i):
	s = input()
	if f:
		if s[:2] == 'OO':
			s = '++' + s[2:]
			f = False
		elif s[3:] == 'OO':
			s = s[:3] + '++'
			f = False
	p.append(s)
if not f:
	print('YES')
	for x in p:
		print(x)
else:
	print('NO')


n = int(input())
inpL = []
for z in range(n):
	inpL.append(list(str(input())))
ans = 'NO'
for i in range(n):
	for j in range(4):
		if inpL[i][j] == inpL[i][j + 1] == 'O':
			inpL[i][j] = '+'
			inpL[i][j + 1] = '+'
			ans = 'YES'
			break
	if ans == 'YES':
		break
if ans == 'NO':
	print('NO')
else:
	print('YES')
	for a in inpL:
		print(''.join(a))


a = int(input())
b = []
f = ''
for i in range(0, a):
	c = input()
	b.append(c)
for i in range(0, a):
	if b[i][0:2] == 'OO':
		d = '++' + b[i][2:]
		b[i] = d
		f = 'YES'
		break
	elif b[i][3:] == 'OO':
		e = b[i][:3] + '++'
		b[i] = e
		f = 'YES'
		break
	else:
		f = 'NO'
if f == 'YES':
	print(f)
	for y in b:
		print(y)
else:
	print('NO')


n = int(input())
bus = [[]] * n
accept = 0
for i in range(n):
	bus[i] = list(map(str, input()))
	if accept == 0:
		if bus[i][0] == 'O' and bus[i][1] == 'O':
			accept = 1
			bus[i][0] = '+'
			bus[i][1] = '+'
		elif bus[i][3] == 'O' and bus[i][4] == 'O':
			accept = 1
			bus[i][3] = '+'
			bus[i][4] = '+'
if accept == 1:
	print('YES')
	for m in range(n):
		print(*bus[m], sep='')
else:
	print('NO')


n = int(input())
check = 0
bus = []
done = 0
for i in range(0, n):
	row = input()
	rowSlice = row.split('|')
	if done == 1:
		bus.append(row)
	elif rowSlice[0] == 'OO' or rowSlice[1] == 'OO':
		rowM = row.replace('OO', '++', 1)
		bus.append(rowM)
		check = 1
		done = 1
	else:
		bus.append(row)
if check == 1:
	print('YES')
	for line in bus:
		print(line)
else:
	print('NO')


n = int(input())
found = False
out = ''
for i in range(n):
	s = input()
	if found:
		out += s + '\n'
	elif s.find('OO') == -1:
		out += s + '\n'
	else:
		found = True
		s = s.replace('OO', '++', 1)
		out += s + '\n'
if found:
	print('Yes\n' + out, end='')
else:
	print('NO')


n = int(input())
m = n * [[]]
l = 0
for i in range(n):
	m[i] = input().split('|')
for i in range(n):
	if 'OO' in m[i]:
		m[i][m[i].index('OO')] = '++'
		l += 1
		break
if l >= 1:
	print('YES')
	for i in range(n):
		print(m[i][0] + '|' + m[i][1])
else:
	print('NO')


t = int(input())
seats = []
ans = 'NO'
for _ in range(t):
	seats.append(input().split('|'))
a = False
for i in seats:
	for s in i:
		if s == 'OO':
			a = True
			ans = 'YES'
			seats[seats.index(i)][i.index(s)] = '++'
			break
	if a:
		break
print(ans)
if ans == 'YES':
	for i in seats:
		print(i[0] + '|' + i[1])


n = int(input())
seat = list()
for j in range(n):
	seat.append(input())
k = 0
for j in range(n):
	if seat[j][:2] == 'OO':
		seat[j] = '++' + seat[j][2:]
		k = 1
		break
	elif seat[j][3:] == 'OO':
		seat[j] = seat[j][:3] + '++'
		k = 1
		break
if k == 1:
	print('YES')
	for x in seat:
		print(x)
else:
	print('NO')


n = int(input())
arr = [0] * n
d = 0
for i in range(n):
	x = input()
	if d == 0 and (x[0] == 'O' and x[1] == 'O'):
		d = 1
		x = '++' + x[2:]
	if (x[3] == 'O' and x[4] == 'O') and d == 0:
		d = 1
		x = x[:3] + '++'
	arr[i] = x
if d == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(arr[i])


a = []
for i in range(int(input())):
	s = input().split('|')
	a.append(s[0])
	a.append(s[1])
try:
	it = a.index('OO')
except Exception:
	print('NO')
	exit(0)
print('YES')
for i in range(len(a)):
	if i == it:
		print('++', end='')
	else:
		print(a[i], end='')
	if i % 2 == 0:
		print('|', end='')
		continue
	print()


import sys
sys.setrecursionlimit(30000)
from collections import Counter, defaultdict, deque
from math import ceil, floor, factorial, fsum, isinf, exp, log, log10, log2, isfinite, sqrt
from math import pi as PI, e as E
from math import sin, cos, tan, sinh, cosh, tanh, asin, acos, atan
from fractions import Fraction
from itertools import starmap, tee, chain, filterfalse, combinations as combos
from itertools import permutations as perms, product as prod, combinations_with_replacement as rcombos
from functools import reduce, partial
import operator as ops
from operator import __not__ as notit, __abs__ as absit, __or__ as orit
from bisect import insort_left, bisect_left, bisect_right
from copy import deepcopy
(PHI, PHI2) = ((1 + 5 ** 0.5) / 2, (5 ** 0.5 - 1) / 2)
INF = float('inf')

class TreeNode:

	def __init__(self, v):
		self.val = v
		self.left = None
		self.right = None

def setBit(x, offset):
	return x | 1 << offset

def clearBit(x, offset):
	return x & ~(1 << offset)

def getBit(x, offset):
	return 1 if testBit(x, offset) > 0 else 0

def testBit(x, offset):
	return x & 1 << offset

def flipBitAt(x, offset):
	return x ^ 1 << offset

def flipBits(x, length=-1):
	length = x.bit_length() - 1 if length == -1 else length
	return x ^ (1 << length) - 1

def numBits(x):
	return x.bit_length()

def countOnes(x):
	return bin(x).count('1')

def countZeros(x, length=-1):
	length = x.bit_length() if length == -1 else length
	return length - countOnes(x)

def getList(tcast=str):
	return [tcast(x) for x in input().strip().split(' ')]

def getItems(*tcast):
	return map(lambda f, x: f(x), tcast, getList())

def getVal(tcast=str):
	return tcast(input().strip())

def getMatrix(r, tcast=str):
	return [getList(tcast) for row in range(r)]

def isOdd(n):
	return n & 1 > 0

def isEven(n):
	return not n & 1

def numDigits(n):
	return len(str(n)) - (1 if n < 0 else 0)

def _gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def gcd(*xs):
	nums = xs[0] if type(xs[0]) == list else list(xs)
	cur = nums[0]
	for n in nums[1:]:
		if cur == 1:
			return cur
		cur = _gcd(cur, n)
	return cur

def _lcm(a, b):
	return a // gcd(a, b) * b

def lcm(*xs):
	nums = xs[0] if type(xs[0]) == list else list(xs)
	cur = nums[0]
	for n in nums[1:]:
		cur = _lcm(cur, n)
	return cur

def primesUpto(n):
	isp = [True] * (n + 1)
	(isp[0], isp[1]) = (False, False)
	primes = []
	for (i, x) in enumerate(isp):
		if x:
			primes.append(i)
			mults = i * i
			while mults <= n:
				isp[mults] = False
				mults += i
	return primes

def primeFactor(n):
	factors = Counter()
	while not n & 1:
		factors[2] += 1
		n >>= 1
	trynum = 3
	while trynum <= ceil(sqrt(n)):
		while n % trynum == 0:
			factors[trynum] += 1
			n //= trynum
		trynum += 2
	if n != 1:
		factors[n] += 1
	return factors

def isPrime(n):
	if n & 1 and n >= 2:
		trynum = 3
		limit = ceil(sqrt(n))
		while trynum < limit:
			if n % trynum == 0:
				return False
			trynum += 2
		else:
			return True
	else:
		return False

def nthFib(n):
	if n <= 2:
		return 1
	else:
		(a, b) = (1, 1)
		while n > 2:
			(a, b) = (b, a + b)
			n -= 1
		return b

def zipNWith(f, *x):
	return (f(y) for y in zip(*x))

def zipWith(f, xs, ys):
	return (f(x, y) for (x, y) in zip(xs, ys))

def flatten(xs):
	return reduce(ops.concat, xs)

def quantify(pred, it):
	return sum(map(pred, it))

def dotproduct(xs, ys):
	return sum(map(ops.mul, xs, ys))

def adjpairs(it):
	(a, b) = tee(it)
	next(b, None)
	return zip(a, b)

def bipartition(pred, it):
	(t, f) = tee(it)
	return (filter(pred, t), filterfalse(pred, f))

def powerset(it):
	s = list(it)
	return chain.from_iterable((combos(s, r) for r in range(len(s) + 1)))

def depProduct(bounds, f=lambda y: y + 1, g=lambda *x: tuple(x)):
	args = [-1]
	nbounds = len(bounds)
	while args:
		n = len(args)
		args[-1] += 1
		if args[-1] >= bounds[n - 1]:
			args.pop()
		elif n == nbounds:
			yield g(*args)
		else:
			_f = f[n] if type(f) == list else f
			args.append(_f(args[-1]) - 1)

def revEnumerate(xs):
	n = len(xs) - 1
	for (i, x) in enumerate(reversed(xs)):
		yield (n - i, x)
nrows = getVal(int)
rows = []
for r in range(nrows):
	rows.append(getVal(str))
for (i, r) in enumerate(rows):
	if 'OO' in r:
		rows[i] = r.replace('OO', '++', 1)
		print('YES')
		print(*rows, sep='\n')
		break
else:
	print('NO')


n = int(input())
m = []
for i in range(n):
	x = list(input())
	m.append(x)
z = 0
for i in range(n):
	if m[i][0] == 'O' and m[i][1] == 'O':
		print('YES')
		m[i][0] = '+'
		m[i][1] = '+'
		z = z + 1
		break
	elif m[i][3] == 'O' and m[i][4] == 'O':
		print('YES')
		m[i][3] = '+'
		m[i][4] = '+'
		z = z + 1
		break
if z == 0:
	print('NO')
else:
	for i in range(n):
		for j in range(5):
			print(m[i][j], end='')
		print()


n = int(input())
l = []
f = 0
for _ in range(n):
	s = input()
	l.append(s)
for i in range(len(l)):
	if 'OO' in l[i] and f != 1:
		l[i] = l[i].replace('OO', '++', 1)
		f = 1
		break
if f == 1:
	print('YES')
	print(*l, sep='\n')
else:
	print('NO')


n = int(input())
M = []
co = False
for i in range(n):
	s = input()
	if not co and (s[:2] == 'OO' or s[3:] == 'OO'):
		if s[:2] == 'OO':
			M.append('++' + s[2:])
		else:
			M.append(s[:3] + '++')
		co = True
	else:
		M.append(s)
if not co:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(M[i])


n = int(input())
b = False
s = []
for i in range(n):
	a = input()
	if not b:
		if 'OO' in a:
			b = True
			a = a.replace('OO', '++', 1)
	s.append(a)
if not b:
	print('NO')
else:
	print('YES')
	for i in s:
		print(i)


n = int(input())
a = [input() for i in range(n)]
for i in range(len(a)):
	if a[i][0] == a[i][1] == 'O':
		a[i] = '++' + a[i][2:]
		print('YES')
		print('\n'.join(a))
		exit(0)
	elif a[i][3] == a[i][4] == 'O':
		a[i] = a[i][:3] + '++'
		print('YES')
		print('\n'.join(a))
		exit(0)
print('NO')


import sys
row = int(input())
sl = [input() for x in range(row)]
for x in range(row):
	if 'OO' in sl[x]:
		print('YES')
		sl[x] = sl[x].replace('OO', '++', 1)
		print(*sl, sep='\n')
		sys.exit()
print('NO')


n = int(input())
x = []
f = 1
for i in range(n):
	s = input()
	if f:
		s = list(s)
		if s[0] == s[1] == 'O':
			s[0] = s[1] = '+'
			f = 0
		elif s[3] == s[4] == 'O':
			s[3] = s[4] = '+'
			f = 0
		else:
			f = 1
		s = ''.join(s)
	x.append(s)
if f:
	print('NO')
else:
	print('YES')
	print(*x, sep='\n')


t = int(input())
lst1 = []
n = 0
for i in range(t):
	s = str(input())
	lst2 = list(s)
	if lst2[0] == 'O' and lst2[1] == 'O' and (n == 0):
		lst2[0] = '+'
		lst2[1] = '+'
		n = 1
	elif lst2[3] == 'O' and lst2[4] == 'O' and (n == 0):
		lst2[3] = '+'
		lst2[4] = '+'
		n = 1
	m = ''
	for j in lst2:
		m = m + j
	lst1.append(m)
if n == 1:
	print('YES')
	for j in lst1:
		print(j)
else:
	print('NO')


n = int(input())
found = False
ans = []
for i in range(n):
	row = input()
	if not found and (row[:2] == 'OO' or row[-2:] == 'OO'):
		found = True
		if row[:2] == 'OO':
			ans += ['++' + row[2:]]
		else:
			ans += [row[:-2] + '++']
	else:
		ans += [row]
if not found:
	print('NO')
else:
	print('YES')
	for a in ans:
		print(a)


n = int(input())
rows = []
sol = False
for i in range(n):
	rows.append(input())
	if not sol:
		if 'OO' in rows[-1]:
			sol = True
			if rows[-1][0] == 'O' and rows[-1][1] == 'O':
				rows[-1] = '++' + rows[-1][2:5]
			else:
				rows[-1] = rows[-1][0:3] + '++'
if sol:
	print('YES')
	for i in rows:
		print(i)
else:
	print('NO')


n = int(input())
s = []
flag = False
for i in range(n):
	s_ = input()
	if not flag and s_[0:2] == 'OO':
		s_ = '++' + s_[2:]
		flag = True
	if not flag and s_[3:5] == 'OO':
		s_ = s_[:3] + '++'
		flag = True
	s.append(s_)
if flag:
	print('YES')
	for s_ in s:
		print(s_)
else:
	print('NO')


n = int(input())
str = []
l = False
for x in range(n):
	k = list(input())
	if k[0] == 'O' and k[1] == 'O' and (l == False):
		k[0] = '+'
		k[1] = '+'
		str.append(''.join(k))
		l = True
	elif k[3] == 'O' and k[4] == 'O' and (l == False):
		k[3] = '+'
		k[4] = '+'
		str.append(''.join(k))
		l = True
	elif l == True or l == False:
		str.append(''.join(k))
print('Yes\n', '\n'.join(str), sep='') if l == True else print('NO')


n = int(input())
l = []
c = 0
for i in range(1, n + 1):
	x = input()
	if c == 0:
		if 'OO' in x:
			x = x.replace('OO', '++', 1)
			c = 1
	l.append(x)
if c == 1:
	print('YES')
	for i in l:
		print(i)
else:
	print('NO')


n = int(input())
a = []
b = []
k = 0
for i in range(n):
	a.append(input())
for i in a:
	i = list(i)
	for j in range(len(i) - 1):
		if i[j] == 'O' and i[j + 1] == 'O' and (k == 0):
			i[j] = '+'
			i[j + 1] = '+'
			k += 1
	b.append(i)
if k != 0:
	print('YES')
	for i in b:
		print(*i, sep='')
else:
	print('NO')


def final():
	print('YES')
	for i in range(n):
		for j in range(5):
			print(l[i][j], end='')
		print('')
	exit(0)
n = int(input())
l = []
for i in range(n):
	l.append(list(input()))
for i in range(n):
	if l[i][0] == l[i][1] == 'O':
		l[i][0] = l[i][1] = '+'
		final()
	elif l[i][3] == l[i][4] == 'O':
		l[i][3] = l[i][4] = '+'
		final()
print('NO')


test = int(input())
l = []
p = False
for _ in range(test):
	l.append(list(input().split('|')))
i = 0
for (a, b) in l:
	if not p:
		if a == 'OO':
			a = '++'
			p = True
		elif b == 'OO':
			b = '++'
			p = True
		l[i] = [a, b]
	i += 1
if p:
	print('YES')
	for j in range(test):
		print('|'.join(l[j]))
else:
	print('NO')


n = int(input())
rows = []
possible = False
for i in range(n):
	string = input()
	if possible == False:
		if string[:2] == 'OO':
			string = '++' + string[2:]
			possible = True
		elif string[3:] == 'OO':
			string = string[:3] + '++'
			possible = True
	rows.append(string)
if possible == True:
	print('YES')
	for item in rows:
		print(item)
else:
	print('NO')


n = int(input())
game = []
for i in range(n):
	game.append(input())
flag = True
for line in game:
	if 'OO' in line:
		print('YES')
		flag = False
		break
if flag:
	print('NO')
else:
	for line in game:
		if 'OO' in line and flag == False:
			if line[0] == 'O' and line[1] == 'O':
				print('++', end='')
				for i in range(2, 5):
					print(line[i], end='')
			elif line[3] == 'O' and line[4] == 'O':
				for i in range(3):
					print(line[i], end='')
				print('++', end='')
			print()
			flag = True
		else:
			print(line)


n = int(input())
c = 0
l = []
h = []
for i in range(n):
	s = input()
	l.append(s)
	if 'OO' in s and c == 0:
		if s.count('OO') == 1:
			h.append(l[-1].replace('OO', '++'))
			c = 1
		else:
			c = 1
			k = l[-1]
			m = '' + k[:2].replace('OO', '++') + str(k[2:])
			h.append(m)
	else:
		h.append(l[-1])
if c == 1:
	print('YES')
	for i in h:
		print(str(i))
else:
	print('NO')


n = int(input())
bus = '\n'.join([input() for i in range(n)])
ans = bus.replace('OO', '++', 1)
if ans != bus:
	print('YES')
	print(ans)
else:
	print('NO')


N = int(input())
seat = False
BUS = ''
for i in range(N):
	s = input()
	if s.split('|')[0] == 'OO' and seat is False:
		s = '++|' + s.split('|')[1]
		seat = True
	elif s.split('|')[1] == 'OO' and seat is False:
		s = s.split('|')[0] + '|++'
		seat = True
	BUS += s + '\n'
if seat:
	print('YES')
	print(BUS)
else:
	print('NO')


n = int(input())
a = []
for i in range(n):
	a.append(input())
for i in range(n):
	if a[i][:2] == 'OO':
		a[i] = '++' + a[i][2:]
		print('YES')
		break
	if a[i][-2:] == 'OO':
		a[i] = a[i][:-2] + '++'
		print('YES')
		break
if i == n - 1 and '++' not in a[-1]:
	print('NO')
	exit(0)
for i in range(n):
	print(a[i])


n = int(input())
l = []
o = 0
for i in range(n):
	s = input()
	l.append(s)
	if o == 0:
		if s == 'OO|OO':
			s = '++|OO'
			l.insert(i, s)
			l.pop(i + 1)
			o = 1
		else:
			for j in range(len(s) - 1):
				if s[j] == s[j + 1] and s[j] == 'O':
					s = s.replace('OO', '++', 1)
					l.insert(i, s)
					l.pop(i + 1)
					o = 1
if o == 0:
	print('NO')
else:
	print('YES')
	for i in l:
		print(i)


n = int(input())
f = []
while n:
	s = input()
	f.append(s)
	n -= 1
x = 'OO'
i = 0
final = ''
ans = ''
for i in range(len(f)):
	if x in f[i]:
		ans = 'YES'
		j = f[i].index(x)
		f[i] = f[i][:j] + '++' + f[i][j + 2:]
		break
	else:
		ans = 'NO'
if ans == 'YES':
	print(ans)
	for i in f:
		print(i)
else:
	print(ans)


f = 0
ans = []
n = int(input())
for _ in range(n):
	s = input().split('|')
	if s[0] == 'OO' and f == 0:
		s[0] = '++'
		f = 1
	elif s[1] == 'OO' and f == 0:
		s[1] = '++'
		f = 1
	ans.append('|'.join(s))
if f == 1:
	print('YES')
	for i in ans:
		print(i)
else:
	print('NO')


n = int(input())
m = [tuple(input().split('|')) for _ in range(n)]
res = 'NO'
for (i, e) in enumerate(m):
	if e[0] == 'OO':
		m[i] = ('++', e[1])
		res = 'YES'
		break
	elif e[1] == 'OO':
		m[i] = (e[0], '++')
		res = 'YES'
		break
print(res)
if res == 'YES':
	for i in m:
		print(i[0] + '|' + i[1])


n = int(input())
places = []
flag = False
for i in range(n):
	l = input()
	if flag is False:
		if l[:2] == 'OO':
			places.append('++' + l[2:])
			flag = True
		elif l[-2:] == 'OO':
			places.append(l[:3] + '++')
			flag = True
		else:
			places.append(l)
	else:
		places.append(l)
if flag is True:
	print('YES')
	for item in places:
		print(item)
else:
	print('NO')


n = int(input())
answer = ''
kek = 0
for i in range(n):
	s = input()
	if kek == 0:
		if s.find('OO') != -1:
			if s.find('OO') == 0:
				s = '++' + s[2:]
			else:
				s = s[:3] + '++'
			kek = 1
	answer += s + '\n'
if kek == 1:
	print('YES')
	print(answer)
else:
	print('NO')


n = int(input())
(bus, key) = ([0] * n, False)
for i in range(n):
	bus[i] = input()
for i in range(n):
	if bus[i][0] == 'O' and bus[i][1] == 'O':
		key = True
		bus[i] = '++' + bus[i][2:]
		break
	if bus[i][3] == 'O' and bus[i][4] == 'O':
		key = True
		bus[i] = bus[i][:3] + '++'
		break
if key:
	print('YES')
	for i in range(n):
		print(bus[i])
else:
	print('NO')


siz = int(input())
lst = list()
for i in range(siz):
	lst.append(input())
flag = 0
for i in range(len(lst)):
	if lst[i][0] == 'O' and lst[i][1] == 'O':
		sr = lst[i][3] + lst[i][4]
		lst[i] = '++|' + sr
		flag = 1
		break
	if lst[i][3] == 'O' and lst[i][4] == 'O':
		sr = lst[i][0] + lst[i][1]
		lst[i] = sr + '|++'
		flag = 1
		break
if flag == 1:
	print('YES')
	print(*lst, sep='\n')
else:
	print('NO')


rows = int(input())
seats = []
found = False
for _ in range(rows):
	seats.append(input())
for i in range(rows):
	if 'OO' in seats[i]:
		if seats[i][0:2] == 'OO':
			occ = '++' + seats[i][2:]
		else:
			occ = seats[i][:3] + '++'
		seats[i] = occ
		found = True
		break
if not found:
	print('NO')
else:
	print('YES')
	for i in seats:
		print(i)


n = int(input())
seat = []
flag = False
for i in range(0, n):
	m = input()
	seat.append(m)
for i in range(0, n):
	if seat[i][0:2] == 'OO':
		if flag == False:
			seat[i] = '++' + seat[i][2:]
			print('YES')
			flag = True
			break
	elif seat[i][3:5] == 'OO':
		if flag == False:
			seat[i] = seat[i][0:3] + '++'
			print('YES')
			flag = True
			break
if flag == False:
	print('NO')
else:
	for i in range(0, n):
		print(seat[i])


n = int(input())
s = []
s1 = []
count = 0
for _ in ' ' * n:
	s.append(input())
for i in s:
	if count == 0:
		if 'OO' in i:
			count = 1
			s1.append(i.replace('OO', '++', 1))
		else:
			s1.append(i)
	else:
		s1.append(i)
if count == 1:
	print('YES')
	for i in s1:
		print(i)
else:
	print('NO')


n = int(input())
Bus = []
seat_selected = False
for i in range(n):
	row = list(input())
	if seat_selected is False:
		if row[0] == 'O' and row[1] == 'O':
			row[0] = '+'
			row[1] = '+'
			seat_selected = True
		elif row[-1] == 'O' and row[-2] == 'O':
			row[-1] = '+'
			row[-2] = '+'
			seat_selected = True
	Bus.append(row)
if seat_selected is True:
	print('YES')
	for i in Bus:
		print(i[0] + i[1] + i[2] + i[3] + i[4])
else:
	print('NO')


count = int(input())
yes_or_no = 'NO'
seat_list = []
for i in range(count):
	tmp = input()
	seat_list.append(tmp)
for i in range(count):
	if 'OO' in seat_list[i]:
		seat_list[i] = seat_list[i].replace('OO', '++', 1)
		yes_or_no = 'YES'
		break
print(yes_or_no)
if yes_or_no == 'YES':
	for i in range(count):
		print(seat_list[i])


n = int(input())
arr = []
pbuffer = []
flag = False
for i in range(n):
	ls = input()
	l = []
	for i in ls:
		l.append(i)
	arr.append(l)
for i in arr:
	if flag:
		pbuffer.append(i)
		continue
	if i[0] == 'O' and i[1] == 'O':
		flag = True
		i[0] = i[1] = '+'
	elif i[3] == 'O' and i[4] == 'O':
		flag = True
		i[3] = i[4] = '+'
	pbuffer.append(i)
if not flag:
	print('NO')
else:
	print('YES')
	for i in pbuffer:
		print(''.join(i))


n = int(input())
res = []
fl = True
for i in range(n):
	line = input()
	if 'OO' in line and fl:
		fl = False
		line = line.split('|')
		if line[0] == 'OO':
			line[0] = '++'
		else:
			line[1] = '++'
		res.append(line[0] + '|' + line[1])
	else:
		res.append(line)
if not fl:
	print('YES')
	for i in res:
		print(i)
else:
	print('NO')


x = int(input())
L = []
FLAG = 0
for i in range(x):
	L.append(input().split('|'))
for i in range(x):
	if L[i][0] == 'OO' or L[i][1] == 'OO':
		FLAG = 1
		print('YES')
		break
if FLAG == 1:
	if L[i][0] == 'OO':
		L[i][0] = '++'
	else:
		L[i][1] = '++'
	for i in range(x):
		print(L[i][0], end='|')
		print(L[i][1])
else:
	print('NO')


n = int(input())
bus_map = []
f = False
for i in range(n):
	ipt = input().split('|')
	if not f:
		if ipt[0] == 'OO':
			ipt[0] = '++'
			f = True
		elif ipt[1] == 'OO':
			ipt[1] = '++'
			f = True
	bus_map.append(ipt)
if f:
	print('YES')
	for i in range(n):
		print(bus_map[i][0] + '|' + bus_map[i][1])
else:
	print('NO')


n = int(input())
bus = []
found = False
for i in range(n):
	row = input()
	a = row[0:2]
	b = row[3:]
	if not found:
		if a == 'OO':
			found = True
			a = '++'
		elif b == 'OO':
			found = True
			b = '++'
	bus.append(a + '|' + b)
if found:
	print('YES')
	for i in range(n):
		print(bus[i])
else:
	print('NO')


def is_possible(n, conf):
	row = -1
	pos = -1
	for i in range(n):
		if 'OO' in conf[i]:
			row = i
			pos = conf[i].index('OO')
			break
	if row == -1:
		print('NO')
	else:
		print('YES')
		initial = list(conf[row])
		initial[pos] = '+'
		initial[pos + 1] = '+'
		conf[row] = ''.join(initial)
		print('\n'.join(conf))
n = int(input())
temp = n
conf = []
while temp > 0:
	conf.append(input())
	temp -= 1
is_possible(n, conf)


l = int(input())
p = []
c = 0
for k in range(l):
	x = input()
	if 'OO|OO' in x and c == 0:
		if 'OO|' in x:
			y = x.replace('OO|', '++|')
			p.append(y)
			c = 1
	elif 'OO' in x and c == 0:
		y = x.replace('OO', '++')
		p.append(y)
		c = 1
	else:
		p.append(x)
if c == 1:
	print('YES')
elif c == 0:
	print('NO')
if c == 1:
	for e in range(l):
		print(p[e])


n = int(input())
list1 = []
bool = 0
for i in range(n):
	list1.append(input())
for i in range(n):
	if 'OO' in list1[i]:
		print('YES')
		bool = 1
		list1[i] = list1[i].replace('OO', '++', 1)
		break
if bool == 0:
	print('NO')
else:
	for k in range(n):
		print(list1[k])


n = int(input())
li = []
c = 0
for i in range(n):
	s = input()
	while True:
		if c == 1:
			break
		if s[0] == 'O' and s[1] == 'O':
			c += 1
			s = '++' + s[2:]
			break
		elif s[3] == 'O' and s[4] == 'O':
			c += 1
			s = s[:3] + '++'
			break
		else:
			break
	li.append(s)
if c == 0:
	print('NO')
else:
	print('YES')
	for i in li:
		print(i)


n = int(input())
p = False
A = []
for i in range(n):
	A.append(input())
	if not p and A[i][:2] == 'OO':
		p = True
		A[i] = '++' + A[i][2:]
	if not p and A[i][3:] == 'OO':
		p = True
		A[i] = A[i][:3] + '++'
if p:
	print('YES')
	print(*A, sep='\n')
else:
	print('NO')


n = int(input())
lst = []
flag = 0
for i in range(n):
	lst.append(input())
for i in range(n):
	x = lst[i].find('OO')
	if x != -1:
		lst[i] = lst[i][:x] + '++' + lst[i][x + 2:]
		flag = 1
		break
if flag == 1:
	print('YES')
	for i in range(n):
		print(lst[i])
else:
	print('NO')


n = int(input())
l = []
check = True
for i in range(n):
	a = input()
	if 'OO' in a and check:
		a = a.replace('OO', '++')
		if a == '++|++':
			a = '++|OO'
		l.append(a)
		check = False
	else:
		l.append(a)
if not check:
	print('YES')
	for i in range(n):
		print(l[i])
else:
	print('NO')


n = int(input())
rows = [input() for _ in range(n)]

def check(rows: list, r: int, c: int) -> bool:
	if rows[r][c] == rows[r][c + 1] and rows[r][c] == 'O':
		rows[r] = rows[r][:c] + '++' + rows[r][c + 2:]
		return True
	return False
found = False
for (i, row) in enumerate(rows):
	if check(rows, i, 0) or check(rows, i, 3):
		found = True
		break
if found:
	print('YES')
	for row in rows:
		print(row)
else:
	print('NO')


n = int(input())
answer = ''
flage = 0
for i in range(n):
	row = str(input())
	if 'OO' in row and flage == 0:
		if row.count('OO') == 2:
			row = '++|OO'
			flage = 1
		else:
			row = row.replace('OO', '++')
			flage = 1
	answer += row + '\n'
if flage == 1:
	print('YES')
	print(answer, end='')
else:
	print('NO')


n = int(input())
lst = []
yes = False
for i in range(n):
	lst.append(input())
	if not yes and lst[i].find('OO') != -1:
		lst[i] = lst[i].replace('OO', '++', 1)
		print('YES')
		yes = True
if not yes:
	print('NO')
if yes:
	for i in range(n):
		print(lst[i])


n = int(input())
tab = []
ans = 0
for i in range(n):
	x = input()
	if x[0] == 'O' and x[1] == 'O' and (ans == 0):
		x = '++' + x[2:]
		ans = 1
	elif x[3] == 'O' and x[4] == 'O' and (ans == 0):
		x = x[:3] + '++'
		ans = 1
	tab.append(x)
if ans == 1:
	print('YES')
	for i in tab:
		print(i)
else:
	print('NO')


n = int(input())
a = []
for i in range(n):
	a.append(list(input()))
flag = 0
for i in a:
	if i[0] == i[1] == 'O':
		i[0] = i[1] = '+'
		break
	elif i[3] == i[4] == 'O':
		i[3] = i[4] = '+'
		break
	flag += 1
if flag == len(a):
	print('NO')
else:
	print('YES')
	for i in a:
		print(*i, sep='')


n = int(input())
bus = []
s = 0
for i in range(n):
	bus.append(input())
for i in bus:
	s = s + i.count('OO')
if s == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		if bus[i][0:2] == 'OO':
			print('++' + bus[i][2:5])
			break
		elif bus[i][3:5] == 'OO' and bus[i][0:2] != 'OO':
			print(bus[i][0:3] + '++')
			break
		else:
			print(bus[i])
	for j in range(i + 1, n):
		print(bus[j])


n = int(input())
f = 0
bus = []
bus2 = []
for i in range(n):
	bus.append(input())
for i in range(n):
	s = bus[i]
	x = ''
	if s[:2] == 'OO' and f == 0:
		x += '++'
		f = 1
	else:
		x += s[:2]
	x += '|'
	if s[3:] == 'OO' and f == 0:
		x += '++'
		f = 1
	else:
		x += s[3:]
	bus2.append(x)
if f == 0:
	print('NO')
else:
	print('YES')
	for row in bus2:
		print(f'{row[0]}{row[1]}{row[2]}{row[3]}{row[4]}')


n = int(input())
yon = 0
slist = []
for i in range(n):
	line = input()
	if 'OO' in line and yon == 0:
		yon = 1
		if line[0:2] == 'OO':
			line = '++' + line[2:]
			slist.append(line)
		else:
			line = line[:3] + '++'
			slist.append(line)
	else:
		slist.append(line)
if yon == 0:
	print('NO')
else:
	print('YES')
	for i in slist:
		print(i)


a = int(input(''))
s = str('')
temp = 0
for i in range(int(a)):
	y = str(input(''))
	if temp == 0:
		y = y.split('|')
		if y[0] == 'OO':
			y[0] = '++'
			temp = 1
		elif y[1] == 'OO':
			y[1] = '++'
			temp = 1
		y = str(y[0] + '|' + y[1])
	s = s + str(y)
	s = s + '\n'
if temp == 1:
	print('YES')
	print(s)
else:
	print('NO')


def go(ls):
	c = False
	for i in range(len(ls)):
		for j in range(2):
			if ls[i][j] == 'OO' and (not c):
				c = True
				ls[i][j] = '++'
	if c:
		print('YES')
		for i in ls:
			row = '|'.join(i)
			print(row)
	else:
		print('NO')
t = int(input())
ls = []
for i in range(t):
	ls += (input().split('|'),)
go(ls)


n = int(input())
seats = []
for i in range(n):
	seats.append(input().split('|'))
can = False
for i in range(len(seats)):
	if seats[i][0] == 'OO':
		seats[i][0] = '++'
		can = True
		break
	elif seats[i][1] == 'OO':
		seats[i][1] = '++'
		can = True
		break
if can:
	print('YES')
	for i in range(n):
		print('|'.join(seats[i]))
else:
	print('NO')


import sys, math, string
input = sys.stdin.readline
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
n = int(input())
d = 0
l = []
for i in range(n):
	s = input().strip()
	k = list(s)
	if s.count('OO') > 0 and d == 0:
		h = s.index('OO')
		k[h] = '+'
		k[h + 1] = '+'
		d = 1
	l.append(''.join(k))
if d == 1:
	print('YES')
	print(*l, sep='\n')
else:
	print('NO')


n = int(input())
mas = []
mas3 = []
z = 'NO'
for x in range(n):
	mas1 = []
	for x1 in input().split('|'):
		mas1.append(x1)
	if 'OO' in mas1 and '++' not in mas3:
		z = 'YES'
		v = mas1.index('OO')
		del mas1[v]
		mas1.insert(v, '++')
		mas3.append('++')
	mas.append(mas1)
print(z)
if z == 'YES':
	for c in mas:
		print('|'.join(c))


n = int(input())
s1 = ''
while n != 0:
	s = input()
	s1 += s + '\n'
	n -= 1
if 'OO' in s1:
	print('YES')
	print(s1.replace('OO', '++', 1))
else:
	print('NO')


a = int(input())
f = []
for i in range(a):
	b = input()
	b = b.replace('|', ' ').split()
	f += b
if 'OO' in f:
	print('YES')
	f[f.index('OO')] = '++'
	for i in range(1, len(f), 2):
		print(f[i - 1] + '|' + f[i])
else:
	print('NO')


n = int(input())
b = ''
for i in range(n):
	a = input()
	b += a + '|'
	c = b.split('|')
if 'OO' in c:
	c[c.index('OO')] = '++'
	print('YES')
	for i in range(len(c) // 2):
		print(c[0] + '|' + c[1])
		c.pop(0)
		c.pop(0)
else:
	print('NO')


n = int(input())
a = [input() for i in range(n)]
s = 0
for i in range(n):
	if s == 0 and a[i][0] == a[i][1] == 'O':
		a[i] = '++' + a[i][2:]
		s += 1
	if s == 0 and a[i][3] == a[i][4] == 'O':
		a[i] = a[i][:3] + '++'
		s += 1
if s > 0:
	print('YES')
	print('\n'.join([s for s in a]))
else:
	print('NO')


rows = input()
(bus, rows, result) = ([], int(rows), 'NO')
for i in range(1, rows + 1):
	row1 = input()
	bus.append(row1)
for i in bus:
	index = bus.index(i)
	chairs = i.split('|')
	if chairs[0] == 'OO':
		result = 'YES'
		bus[index] = '++|' + chairs[1]
		break
	if chairs[1] == 'OO':
		result = 'YES'
		bus[index] = chairs[0] + '|++'
		break
if result == 'YES':
	print(result)
	for i in bus:
		print(i)
else:
	print('NO')


l = []
changed = False
for _ in range(int(input())):
	l.append(input().split(','))
for x in l:
	t = x[0]
	if t[0] == 'O' and t[1] == 'O':
		y = t
		t = '++' + y[2:]
		x.append(t)
		x.remove(x[0])
		changed = True
		break
	elif t[3] == 'O' and t[4] == 'O':
		y = t
		t = y[0:3] + '++'
		x.append(t)
		x.remove(x[0])
		changed = True
		break
if changed:
	print('YES')
	for num in l:
		print(num[0])
else:
	print('NO')


n = int(input())
seats = [list(map(str, input().split('|'))) for i in range(n)]
f = False
for j in range(n):
	for i in range(2):
		if seats[j][i] == 'OO':
			seats[j][i] = '++'
			f = True
			break
	if f:
		break
if f:
	print('YES')
	for i in range(n):
		print(seats[i][0] + '|' + seats[i][1])
else:
	print('NO')


n = int(input())
result = list()
is_display_result = bool()
for i in range(n):
	row = input()
	if row[:2] == 'OO' and (not is_display_result):
		is_display_result = True
		row = '++' + row[2:]
	elif row[3:] == 'OO' and (not is_display_result):
		is_display_result = True
		row = row[:3] + '++'
	result.append(row)
if is_display_result:
	print('YES')
	for i in result:
		print(i)
else:
	print('NO')


import sys
a = []
n = int(input())
for i in range(n):
	a.append(input())
for i in range(n):
	if a[i][:2] == 'OO':
		a[i] = '++' + a[i][2:]
		print('YES')
		print('\n'.join(a))
		sys.exit(0)
	elif a[i][3:] == 'OO':
		a[i] = a[i][:3] + '++'
		print('YES')
		print('\n'.join(a))
		sys.exit(0)
print('NO')


n = int(input())
x = []
for i in range(n):
	a = input()
	x.append(a)
for i in range(len(x)):
	if 'OO' in x[i]:
		x[i] = x[i].replace('OO', '++')
		if x[i] == '++|++':
			x[i] = '++|OO'
		break
k = 0
for i in range(len(x)):
	if '++' in x[i]:
		k += 1
		print('YES')
		for i in x:
			print(i)
if k == 0:
	print('NO')


n = int(input())
(flag, lines) = (False, list())
for i in range(n):
	line = input()
	if 'OO' in line and (not flag):
		line = line.replace('OO', '++', 1)
		flag = True
	lines.append(line)
if flag:
	print('YES')
	print('\n'.join(lines))
else:
	print('NO')


n = int(input())
flag = 0
c = []
for i in range(n):
	a = input()
	if flag == 0 and a[0] == 'O' and (a[1] == 'O'):
		c.append('+' + '+' + a[2:])
		flag = 1
	elif flag == 0 and a[3] == 'O' and (a[4] == 'O'):
		c.append(a[:3] + '+' + '+')
		flag = 1
	else:
		c.append(a)
if '++|OX' in c:
	print('YES')
	for i in range(n):
		print(c[i])
elif '++|XO' in c:
	print('YES')
	for i in range(n):
		print(c[i])
elif 'XO|++' in c:
	print('YES')
	for i in range(n):
		print(c[i])
elif 'OX|++' in c:
	print('YES')
	for i in range(n):
		print(c[i])
elif '++|XX' in c:
	print('YES')
	for i in range(n):
		print(c[i])
elif 'XX|++' in c:
	print('YES')
	for i in range(n):
		print(c[i])
elif '++|OO' in c:
	print('YES')
	for i in range(n):
		print(c[i])
else:
	print('NO')


n = int(input())
m = []
for i in range(n):
	k = list(input())
	m.append(k)
for i in range(len(m)):
	if m[i][0] == 'O' and m[i][1] == 'O':
		m[i][0] = '+'
		m[i][1] = '+'
		print('YES')
		for i in m:
			for j in i:
				print(j, end='')
			print()
		break
	elif m[i][3] == 'O' and m[i][4] == 'O':
		m[i][3] = '+'
		m[i][4] = '+'
		print('YES')
		for i in m:
			for j in i:
				print(j, end='')
			print()
		break
else:
	print('NO')


n = int(input())
arr = []
for i in range(n):
	arr.append(input())
suc = 0
for i in range(n):
	x = arr[i]
	if x[0:2] == 'OO':
		suc = 1
		arr[i] = '++' + x[2:]
		break
	if x[3:5] == 'OO':
		suc = 1
		arr[i] = x[:3] + '++'
		break
if suc:
	print('YES')
	for x in arr:
		print(x)
else:
	print('NO')


n = int(input())
b = True
ans = False
A = []
for i in range(n):
	s = input()
	if s[0] == 'O' and s[1] == 'O' and b:
		A.append('++|{0}{1}'.format(s[3], s[4]))
		b = False
		ans = True
	elif s[3] == 'O' and s[4] == 'O' and b:
		A.append('{0}{1}|++'.format(s[0], s[1]))
		b = False
		ans = True
	else:
		A.append(s)
if ans:
	print('YES')
	for i in A:
		print(i)
else:
	print('NO')


n = int(input())
l = []
for i in range(n):
	a = [input().split('|')]
	l.append(a)
f = 0
for i in range(n):
	if l[i][0][0] == 'OO':
		l[i][0][0] = '++'
		f = 1
		break
	if l[i][0][1] == 'OO':
		l[i][0][1] = '++'
		f = 1
		break
if f == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(l[i][0][0] + '|' + l[i][0][1])


num_of_rows = int(input())
free_seat = False
bus_conf = ''
for i in range(num_of_rows):
	row = input()
	if row[0] == 'O' and row[1] == 'O':
		if not free_seat:
			free_seat = True
			bus_conf += '++' + row[2] + row[3] + row[4]
		else:
			bus_conf += row
	elif row[3] == 'O' and row[4] == 'O':
		if not free_seat:
			free_seat = True
			bus_conf += row[0] + row[1] + row[2] + '++'
		else:
			bus_conf += row
	else:
		bus_conf += row
	bus_conf += '\n'
if free_seat:
	print('YES')
	print(bus_conf)
else:
	print('NO')


n = int(input())
l = []
ans = 'NO'
c = 0
for i in range(n):
	x = input()
	if x[0] == x[1] and x[0] == 'O' and (c == 0):
		c = 1
		ans = 'YES'
		x = '++|' + x[3:5]
	elif x[3] == x[4] and x[3] == 'O' and (c == 0):
		c = 1
		ans = 'YES'
		x = x[0:2] + '|++'
	l.append(x)
print(ans)
if ans == 'YES':
	for item in l:
		print(item)


n = int(input())
list = []
for x in range(n):
	s = input()
	for y in range(5):
		list.append(s[y])
		if y == 4:
			list.append(' ')
x = 0
for i in range(len(list) - 1):
	if list[i] == list[i + 1] and list[i] == 'O':
		x = 1
if x == 1:
	print('YES')
else:
	print('NO')
count = 0
if x == 1:
	for a in range(0, len(list) - 1, 6):
		if (list[a] == list[a + 1] and list[a] == 'O') and count == 0:
			print('++', end='')
			count += 1
		else:
			print(list[a] + list[a + 1], end='')
		print('|', end='')
		if (list[a + 3] == list[a + 4] and list[a + 3] == 'O') and count == 0:
			print('++', end='')
			count += 1
		else:
			print(list[a + 3] + list[a + 4], end='')
		print()


arr = []
flag = False
for _ in range(int(input())):
	arr.append(input())
c = 0
for i in arr:
	if i[:2] == 'OO':
		arr[c] = '++' + i[2:]
		flag = True
		break
	elif i[-2:] == 'OO':
		arr[c] = i[:-2] + '++'
		flag = True
		break
	c += 1
if flag:
	print('YES')
	for j in arr:
		print(j)
else:
	print('NO')


n = int(input())
(ans, flag) = ('', False)
for _ in range(n):
	(a, b) = map(str, input().split('|'))
	if not flag:
		if a == 'OO':
			ans += '++|%s' % b
			flag = True
		elif b == 'OO':
			ans += '%s|++' % a
			flag = True
		else:
			ans += '%s|%s' % (a, b)
	else:
		ans += '%s|%s' % (a, b)
	if _ != n - 1:
		ans += '\n'
if flag:
	print('YES')
	print(ans)
else:
	print('NO')


def bus():
	n = int(input())
	sit = False
	b = []
	while n > 0:
		row = str(input())
		if sit == False:
			if row.find('OO') != -1:
				sit = True
				row = row.replace('OO', '++', 1)
		b.append(row)
		n -= 1
	if sit == True:
		print('YES')
		for row in b:
			print(row)
	else:
		print('NO')
bus()


number_of_rows = int(input())
pairs = []
for i in range(number_of_rows):
	for item in input().split('|'):
		pairs.append(item)

def pairwise(iterable):
	i = iter(iterable)
	return list(zip(i, i))
if 'OO' in pairs:
	index = pairs.index('OO')
	pairs[index] = '++'
	print('YES')
	rows = pairwise(pairs)
	for row in rows:
		print(row[0] + '|' + row[1])
else:
	print('NO')


n = int(input())
buf = []
res = False
for _ in range(n):
	buf.append(input())
	if not res and (buf[-1].startswith('OO') or buf[-1].endswith('OO')):
		buf[-1] = buf[-1].replace('OO', '++', 1)
		res = True
print('YES\n' + '\n'.join(buf) if res else 'NO')


n = int(input())
seats = [input() for i in range(n)]
for (i, row) in enumerate(seats):
	if str.startswith(row, 'OO|') or str.endswith(row, '|OO'):
		print('YES')
		seats[i] = seats[i].replace('OO', '++', 1)
		for x in seats:
			print(x)
		exit(0)
print('NO')


n = int(input())
strs = []
found = False
for i in range(n):
	row = input()
	if not found:
		if row[0] == 'O' and row[1] == 'O':
			strs.append('++|' + row[3] + row[4])
			found = True
		elif row[3] == 'O' and row[4] == 'O':
			strs.append(row[0] + row[1] + '|++')
			found = True
		else:
			strs.append(row)
	else:
		strs.append(row)
if found:
	print('YES')
	for el in strs:
		print(el)
else:
	print('NO')


n = int(input())
a = 5
ss = []
for i in range(n):
	str = list(input())
	ss.append(str)
flag = 0
r = c = -1
for i in range(n):
	kk = 0
	for j in range(a):
		if r != -1:
			break
		if j == 2:
			kk = 0
			continue
		elif ss[i][j] == 'O':
			kk = kk + 1
			if kk == 2:
				r = i
				c = j
				break
		else:
			kk = 0
if r == -1:
	print('NO')
else:
	print('YES')
	ss[r][c] = ss[r][c - 1] = '+'
	for i in range(n):
		print(''.join(ss[i]))


l = []
flag = False
for _ in range(int(input())):
	s = input()
	if not flag:
		s = list(s)
		for i in range(1, 5):
			if i != 2 and i != 3:
				if s[i] == s[i - 1] and s[i] == 'O':
					flag = True
					(s[i], s[i - 1]) = ('+', '+')
					break
	l.append(''.join(s))
if flag:
	print('YES')
	for i in l:
		print(i)
else:
	print('NO')


testcase = int(input())
count = 0
li = []
for i in range(testcase):
	str = input()
	if 'OO' in str:
		count += 1
		if count == 1:
			str = str.replace('OO', '++', 1)
			print('YES')
	li.append(str)
if count == 0:
	print('NO')
else:
	print(*li, sep='\n')


n = int(input())
f = 0
b = ''
for i in range(n):
	a = input().split('|')
	if not f and 'OO' in a:
		f = 1
		a[a.index('OO')] = '++'
	b += a[0] + '|' + a[1] + '\n'
if f:
	print('YES')
	print(b)
else:
	print('NO')


n = int(input())
a = []
b = []
for i in range(0, n):
	a.append(input())
for i in range(0, n):
	if a[i][:2] == 'oo' or a[i][:2] == 'OO':
		flag = 0
		a[i] = '++' + a[i][2:]
		break
	elif a[i][3:] == 'oo' or a[i][3:] == 'OO':
		flag = 0
		a[i] = a[i][:3] + '++'
		break
	else:
		flag = 1
if flag == 0:
	print('YES')
	for i in range(0, n):
		print(a[i])
else:
	print('NO')


n = int(input())
data = []
while n > 0:
	data += [x for x in input().split('|')]
	n -= 1
if 'OO' in data:
	print('YES')
	data[data.index('OO')] = '++'
	for i in range(len(data)):
		print(data[i], end='|' if (i + 1) % 2 != 0 else '\n')
else:
	print('NO')


a = int(input())
b = []
for i in range(a):
	b.append(input())

def BU(a):
	for i in range(a):
		if b[i][0] == b[i][1] == 'O':
			b[i] = '++' + b[i][2:]
			return True
		elif b[i][-2] == b[i][-1] == 'O':
			b[i] = b[i][:-2] + '++'
			return True
	return False
if BU(a):
	print('YES')
	for i in range(a):
		print(b[i])
else:
	print('NO')


from sys import exit
length = int(input())
bus = []
counter = 0
for i in range(length):
	bus += input().split('|')
for i in range(len(bus)):
	if bus[i] == 'OO':
		bus[i] = '++'
		print('YES')
		for e in bus:
			print(e, end='')
			if counter == 0:
				print('|', end='')
				counter += 1
			else:
				print()
				counter = 0
		exit()
print('NO')


import sys
input = sys.stdin.readlines()
input1 = int(input[0])
input.reverse()
input.pop()
input.reverse()
tab = []
for row in input:
	row_list = row.split('|')
	tab.append(row_list[0])
	str1 = ''
	counter = 0
	for x in row_list[1]:
		str1 += x
		counter += 1
		if counter == 2:
			break
	tab.append(str1)
last_row_in_tab = tab[-1].split('\n')
tab[-1] = last_row_in_tab[0]
founded = False
for row in tab:
	if row == 'OO':
		index_of_place = tab.index('OO')
		tab[index_of_place] = '++'
		founded = True
		break
else:
	print('NO')
if founded:
	output = 'YES\n'
	counter = 0
	tab_2 = []
	for index in range(0, len(tab), 2):
		tab_2.append([tab[index], tab[index + 1]])
	for row in range(len(tab_2)):
		tab_2[row].insert(1, '|')
		tab_2[row].append('\n')
	for row in tab_2:
		for col in row:
			output += col
	print(output.strip())


def main():
	n = int(input())
	lines = []
	for i in range(n):
		lines.append(input())
	for (i, line) in enumerate(lines):
		if 'OO' in line:
			lines[i] = line.replace('OO', '++', 1)
			print('YES')
			print('\n'.join(lines))
			break
	else:
		print('NO')
main()


n = int(input())
a = []
for i in range(n):
	a.append(input())
find = False
for i in range(n):
	(s1, s2) = a[i].split('|')
	if s1 == 'OO':
		a[i] = '++|' + s2
		find = True
		break
	elif s2 == 'OO':
		a[i] = s1 + '|++'
		find = True
		break
if find:
	print('YES')
	for i in a:
		print(i)
else:
	print('NO')


t = int(input())
arr = []
arr.append('|')
while t:
	s = input()
	s = s + '|'
	for i in s:
		arr.append(i)
	t = t - 1
m = False
for i in range(len(arr) - 1):
	if arr[i] == 'O' and arr[i + 1] == 'O':
		m = True
		arr[i] = '+'
		arr[i + 1] = '+'
		break
ss = ''
if m:
	print('YES')
	for i in range(len(arr)):
		ss = ss + arr[i]
		if i % 6 == 0 and i != 0 and (i != 1):
			print(ss[i - 5:i])
else:
	print('NO')


l = []
import re
r = 0
for i in range(int(input())):
	x = input()
	if r != 1:
		if 'OO' in x:
			x = re.sub('OO', '++', x, 1)
			l.append(x)
			r = 1
		else:
			l.append(x)
	else:
		l.append(x)
if r == 1:
	print('YES')
	for j in range(len(l)):
		print(str(l[j]))
else:
	print('NO')


N = int(input())
rows = []
for i in range(N):
	rows.append(input().split('|'))
flg = False
for (i, row) in enumerate(rows):
	if row[0] == 'OO':
		rows[i][0] = '++'
		flg = True
	elif row[1] == 'OO':
		rows[i][1] = '++'
		flg = True
	if flg:
		break
if not flg:
	print('NO')
else:
	print('YES')
	for row in rows:
		print('{}|{}'.format(row[0], row[1]))


t = int(input())
seats = list()
for i in range(t):
	seats.append(input().strip())
flag = 0
for i in range(t):
	config = list(seats[i])
	if config[0] == 'O' and config[1] == 'O':
		config[0] = '+'
		config[1] = '+'
		seats[i] = ''.join(config)
		flag = 1
		break
	elif config[3] == 'O' and config[4] == 'O':
		config[3] = '+'
		config[4] = '+'
		seats[i] = ''.join(config)
		flag = 1
		break
if flag == 1:
	print('YES')
	for config in seats:
		print(config)
else:
	print('NO')


n = int(input(''))
b = []
p = 0
while n:
	a = input('')
	a = list(a)
	if p == 0:
		if a[0] == 'O' and a[1] == 'O':
			p = 1
			a[0] = '+'
			a[1] = '+'
		elif a[3] == 'O' and a[4] == 'O':
			p = 1
			a[3] = '+'
			a[4] = '+'
	a = ''.join((str(i) for i in a))
	b.append(a)
	n -= 1
if p == 1:
	print('YES')
	for i in b:
		print(i)
else:
	print('NO')


a = int(input())
b = 0
f = []
for i in range(a):
	fila = input()
	if b != 1 and 'OO' in fila:
		if fila[0] + fila[1] == 'OO':
			fila = '++|' + fila[3] + fila[4]
		else:
			fila = fila[0] + fila[1] + '|++'
		b = 1
	f.append(fila)
if b == 1:
	print('YES')
	for i in f:
		print(i)
else:
	print('NO')


row = int(input())
count = 0
list1 = []
for i in range(row):
	x = input()
	if 'OO' in x and count == 0:
		count += 1
		list1.append(x.replace('OO', '++', 1))
	else:
		list1.append(x)
if count == 1:
	print('YES')
	for j in range(len(list1)):
		print(list1[j])
else:
	print('NO')


s = [input() for _ in range(int(input()))]
for i in range(len(s)):
	if 'OO' in s[i]:
		s[i] = s[i].replace('OO', '++')
		if s[i] == '++|++':
			s[i] = '++|OO'
		print('YES')
		print('\n'.join(s))
		exit(0)
print('NO')


n = int(input())
l = list((list(input().split('|')) for i in range(n)))
a = 0
k = 0
r = 0
if a == 0:
	for i in range(n):
		for j in range(2):
			if a == 0:
				if l[i][j] == 'OO':
					k = i
					r = j
					a = 1
if a == 1:
	print('YES')
	l[k][r] = '++'
	for i in l:
		print('|'.join(i))
else:
	print('NO')


n = int(input())
s = []
for i in range(n):
	a = input()
	a = a.split('|')
	s.append(a)
for i in s:
	if 'OO' in i:
		print('YES')
		b = i.index('OO')
		i[b] = '++'
		for i in range(n):
			print(s[i][0] + '|' + s[i][1])
		exit()
print('NO')


n = int(input())
ar = []
cout = 1
for i in range(n):
	s = input()
	if 'OO|' in s and cout == 1:
		s = '++|' + s[3:]
		cout += 1
	elif '|OO' in s and cout == 1:
		s = s[:3] + '++'
		cout += 1
	ar.append(s)
if cout == 2:
	print('YES')
	for i in ar:
		print(i)
else:
	print('NO')


n = int(input())
lst = []
for i in range(n):
	s = input()
	lst.append(s)
cnt = 0
ans = []
for item in lst:
	import re
	if len(re.findall('OO', item)) >= 1 and cnt < 1:
		x = re.sub('OO', '++', item, 1)
		cnt += 1
		ans.append(x)
	else:
		ans.append(item)
if cnt == 0:
	print('NO')
else:
	print('YES')
	for item in ans:
		print(item)


n = int(input())
flag = False
out = ''
for i in range(n):
	txt = input()
	if not flag:
		if txt.find('OO') != -1:
			flag = True
			txt = txt.replace('OO', '++', 1)
	out += txt + '\n'
print('YES' if flag else 'NO')
if flag:
	print(out.strip())


n = int(input())
l = []
for i in range(n):
	l.append(str(input()))
r = 'NO'
for j in range(n):
	if 'OO' in l[j]:
		a = l[j].index('OO')
		l[j] = l[j][:a] + '++' + l[j][a + 2:]
		r = 'YES'
		break
if r == 'NO':
	print(r)
else:
	print(r)
	for i in range(0, n):
		print(l[i])


T = int(input())
f = 0
b = 0
count = 0
l = []
for _ in range(T):
	s = input()
	if b != 1 and 'OO' in s:
		s = s.replace('OO', '++')
		b = 1
		f = 1
		for i in s:
			if i == '+':
				count += 1
			else:
				pass
		if count == 4:
			aa = s[:3]
			aa += 'OO'
			l.append(aa)
		else:
			l.append(s)
	else:
		l.append(s)
if f == 1:
	print('YES')
	print(*l, sep='\n')
else:
	print('NO')


k = int(input())
l = []
for _ in range(k):
	s = input()
	s = s.split('|')
	l.append(s)
flag = 0
for i in range(k):
	if l[i][0].find('OO') != -1:
		x = i
		y = 0
		flag = 1
		break
	elif l[i][1].find('OO') != -1:
		x = i
		y = 1
		flag = 1
		break
if flag == 1:
	print('YES')
	for i in range(k):
		if i == x:
			if y == 0:
				print('++|' + l[i][1])
			elif y == 1:
				print(l[i][0] + '|++')
		else:
			print(l[i][0] + '|' + l[i][1])
else:
	print('NO')


n = int(input())
x = [list(input()) for i in range(n)]

def change(v):
	if v[0] == v[1] == 'O':
		v[0] = v[1] = '+'
	else:
		v[3] = v[4] = '+'
	return v
for i in range(n):
	if 'OO' in ''.join(x[i]):
		x[i] = change(x[i])
		print('YES')
		for t in x:
			print(''.join(t))
		exit(0)
print('NO')


n = int(input())
c = 0
s = ''
for i in range(n):
	p = input()
	if c == 0:
		p = p.replace('|', ' ')
		p = p.split()
		if p[1] == 'OO' and p[0] == 'OO':
			if p[1] == 'OO':
				p[1] = '++'
				c = 1
		else:
			if p[1] == 'OO':
				p[1] = '++'
				c = 1
			if p[0] == 'OO':
				p[0] = '++'
				c = 1
		p = '|'.join(p)
	s = s + p
if c == 0:
	print('NO')
if c == 1:
	print('YES')
	m = 0
	q = 0
	while m < 5 * n:
		m += 5
		print(s[q:m])
		q = m


n = int(input())
s = ''
for i in range(n):
	s += input()
	s += ' '
t = s.replace('OO', '++', 1)
if t != s:
	print('YES')
	for i in t:
		if i == ' ':
			print('')
		else:
			print(i, end='')
else:
	print('NO')


n = int(input())
found = False
bus = []
for i in range(n):
	row = input().split('|')
	for i in range(len(row)):
		if not found and row[i] == 'OO':
			row[i] = '++'
			found = True
	bus.append('|'.join(row))
print('YES\n{}'.format('\n'.join(bus)) if found else 'NO')


n = int(input())
a = ''
tmp = 0
for i in range(n):
	b = input()
	if tmp == 0:
		if b.find('OO') == 0:
			b = '++' + b[2:]
			tmp = 1
		elif b.find('OO') == 3:
			b = b[:3] + '++'
			tmp = 1
	a += b
	if i != n - 1:
		a += '\n'
if tmp == 1:
	print('YES')
	print(a)
else:
	print('NO')


a = int(input())
i = 0
mas = ['', '', '']
b = []
s = ''
for i in range(a):
	b.append(input().split('|'))
j = 0
for j in range(len(b)):
	if str(b[j][0]) == 'OO':
		b[j][0] = '++'
		s = 'YES'
		break
	elif str(b[j][1]) == 'OO':
		b[j][1] = '++'
		s = 'YES'
		break
if s == 'YES':
	print(s)
	e = 0
	for e in range(len(b)):
		print(b[e][0], end='')
		print('|', end='')
		print(b[e][1])
else:
	print('NO')


n = int(input())
a = []
k = 0
for i in range(n):
	seat = input()
	if k == 0 and 'OO' in seat:
		a.append(seat.replace('OO', '++', 1))
		k = 1
	else:
		a.append(seat)
if k == 0:
	print('NO')
else:
	print('YES')
	for element in a:
		print(element)


n = int(input())
lst = []
while n > 0:
	lst.append(input())
	n -= 1
for i in range(0, len(lst)):
	if 'OO' in lst[i]:
		s = lst[i]
		s = list(s)
		for j in range(1, len(s)):
			if s[j - 1] + s[j] == 'OO':
				s[j - 1] = '+'
				s[j] = '+'
				break
		s = ''.join(s)
		lst[i] = s
		break
ans = []
for i in range(0, len(lst)):
	if '++' in lst[i]:
		ans.append(1)
if 1 in ans:
	print('YES')
	for ele in lst:
		print(ele)
else:
	print('NO')


n = int(input())
l = list()
found_ans = False
for _ in range(n):
	r = input()
	if not found_ans:
		if r[0] == r[1] == 'O':
			r = '++' + r[2:]
			found_ans = True
		elif r[3] == r[4] == 'O':
			r = r[:3] + '++'
			found_ans = True
	l.append(r)
print('NO' if not found_ans else 'YES\n' + '\n'.join(l))


import sys
seats = sys.stdin.readlines()[1:]
with_seats = False
if 'OO' in ''.join(seats):
	print('YES')
	for row in seats:
		if not with_seats:
			if 'OO' in row:
				print(row.replace('OO', '++', 1).rstrip('\n'))
				with_seats = True
			else:
				print(row.rstrip('\n'))
		else:
			print(row.rstrip('\n'))
else:
	print('NO')


n = int(input())
s = []
y = 0
for i in range(0, n):
	temp = input()
	if y == 0 and temp.count('OO') > 0:
		y = 1
		index = temp.index('OO')
		if index == 0:
			temp = '++|' + temp[3:]
		elif index == 3:
			temp = temp[:3] + '++'
	s.append(temp)
if y == 1:
	print('YES')
	for i in range(0, n):
		print(s[i])
else:
	print('NO')


n = int(input())
str = ''
while n > 0:
	t = input()
	str += '\n' + t
	n = n - 1
if 'OO' in str:
	print('YES')
	str = str.replace('OO', '++', 1)
	print(str.lstrip())
else:
	print('NO')


n = int(input())
lst = []
flag = False
for i in range(0, n):
	a = input().split('|')
	if a[0] == 'OO' or a[1] == 'OO':
		flag = True
	lst.append(a)
if flag:
	printed = False
	print('YES')
	for i in lst:
		if printed:
			print(i[0], '|', i[1], sep='')
		elif i[0] == 'OO':
			print('++|', i[1], sep='')
			printed = True
		elif i[1] == 'OO':
			print(i[0], '|++', sep='')
			printed = True
		else:
			print(i[0], '|', i[1], sep='')
else:
	print('NO')


n = int(input())
bus = []
status = False
for i in range(n):
	a = str(input())
	bus.append(a)

def found():
	for i in range(n):
		print(bus[i])
for i in range(n):
	if 'OO' in bus[i]:
		status = True
		print('YES')
		bus[i] = bus[i].replace('OO', '++', 1)
		found()
		break
if status == False:
	print('NO')


N = int(input())
arr = ['' for i in range(0, 1005)]
okf = 0
for i in range(0, N):
	arr[i] = input()
	for j in range(0, 4):
		if okf == 0:
			if arr[i][j] == 'O' and arr[i][j + 1] == 'O':
				okf = 1
				arr[i] = arr[i][:j] + '++' + arr[i][j + 2:]
if okf:
	print('YES')
	for i in range(0, N):
		print(arr[i])
else:
	print('NO')


def pt(ma):
	print('YES')
	for x in ma:
		print('|'.join(x))
n = int(input().strip())
ma = []
for _ in range(n):
	ma.append(input().strip().split('|'))
for seat in ma:
	if seat[0] == 'OO':
		seat[0] = '++'
		pt(ma)
		exit(0)
	elif seat[1] == 'OO':
		seat[1] = '++'
		pt(ma)
		exit(0)
print('NO')


ans = False
a = []
n = int(input())
for i in range(n):
	line = input()
	if 'OO' in line and (not ans):
		line = line.replace('OO', '++', 1)
		ans = True
	a.append(line)
if ans:
	print('YES')
	print(*a, sep='\n')
else:
	print('NO')


import sys
T = int(sys.stdin.readline())
seats = []
check = False
for i in range(T):
	seats.append(str(sys.stdin.readline().strip()))
	if 'OO' in seats[-1] and check == False:
		seats[-1] = seats[-1].replace('OO', '++', 1)
		check = True
if check == True:
	print('YES')
	for j in range(T):
		print(seats[j])
else:
	print('NO')


n = int(input())
a = []
(f, s) = (-1, -1)
for i in range(n):
	a.append(list(input().split('|')))
	if a[i][0] == 'OO' or a[i][1] == 'OO':
		f = i
		if a[i][0] == 'OO':
			s = 0
		else:
			s = 1
if f == -1:
	print('NO')
else:
	print('YES')
	if s == 0:
		a[f].remove(a[f][s])
		a[f].insert(0, '++')
	else:
		a[f].pop()
		a[f].append('++')
	for i in range(n):
		k = '|'.join(a[i])
		print(k)


class Solution(object):

	def findSeats(self, arr):
		N = len(arr)
		found = False
		for i in range(N):
			if arr[i].find('OO') != -1:
				found = True
				arr[i] = arr[i].replace('OO', '++', 1)
				break
		print('YES' if found else 'NO')
		if found:
			for s in arr:
				print(s)

def read_input():
	return [int(x) for x in input().split()]

def readStringInput():
	return input()
n = read_input()[0]
arr = []
for i in range(n):
	arr.append(readStringInput())
sol = Solution()
sol.findSeats(arr)


a = int(input())
b = []
d = 'NO'
for k in range(a):
	c = input()
	if 'OO' in c and d == 'NO':
		if c == 'OO|OO':
			c = '++|OO'
		else:
			c = c.replace('OO', '++')
		d = 'YES'
	b += [c]
print(d)
if d == 'YES':
	for j in b:
		print(j)


x = int(input())
a = []
i = 0
while i < x:
	a.append(input())
	i += 1
j = 0
for l in a:
	if 'OO' in l:
		if l[:2] == 'OO':
			a[a.index(l)] = '++' + l[2:]
		else:
			a[a.index(l)] = l[:3] + '++'
		j += 1
		break
if j == 0:
	print('NO')
else:
	print('YES')
	for b in a:
		print(b)


n = int(input())
(a, s, p) = ([], 0, 0)
for i in range(n):
	k = input()
	b = []
	b = k.split('|')
	a.append(b)
for i in range(n):
	for j in range(2):
		if a[i][j] == 'OO':
			a[i][j] = '++'
			p += 1
			break
	if p == 1:
		break
if p > 0:
	print('YES')
	for i in range(n):
		for j in range(2):
			if j == 0:
				print(a[i][j], end='|')
			if j == 1:
				print(a[i][j])
else:
	print('NO')


n = int(input())
s = []
c = 0
r = 'No'
for i in range(n):
	x = str(input())
	if c == 0:
		if x.find('OO') != -1:
			x = x.replace('OO', '++', 1)
			c += 1
			r = 'YES'
	s.append(x)
print(r)
if r == 'YES':
	print(*s, sep='\n')


n = int(input())
a = [' '] * n
b = [' '] * n
x = 0
for i in range(n):
	(a[i], b[i]) = map(str, input().split('|'))
for i in range(n):
	if a[i][0] == 'O' and a[i][1] == 'O':
		c = list(a[i])
		c[0] = c[1] = '+'
		a[i] = ''.join(c)
		x = 1
		break
	elif b[i][0] == 'O' and b[i][1] == 'O':
		c = list(b[i])
		c[0] = c[1] = '+'
		b[i] = ''.join(c)
		x = 1
		break
if x:
	print('YES')
	for i in range(n):
		print(a[i], end='|')
		print(b[i])
else:
	print('NO')


n = int(input())
a = []
r = 0
left = None
for i in range(n):
	x = input()
	if x[0:2] == 'OO' and left == None:
		left = True
		r = i
	elif x[3:] == 'OO' and left == None:
		left = False
		r = i
	a.append(x)
if left == True:
	a[r] = '++' + a[r][2:]
	print('YES')
	print('\n'.join(a))
elif left == False:
	a[r] = a[r][:3] + '++'
	print('YES')
	print('\n'.join(a))
else:
	print('NO')


N = int(input())
ok = False
lines = []
for n in range(N):
	line = input()
	if 'OO' in line and (not ok):
		line = line.replace('OO', '++', 1)
		ok = True
	lines.append(line)
if ok:
	print('YES')
	print('\n'.join(lines))
else:
	print('NO')


x = int(input())
c = []
while x != 0:
	y = input().split('|')
	c += y
	x -= 1
h = 0
for i in c:
	if i == 'OO':
		c.remove('OO')
		c.insert(h, '++')
		break
	h += 1
k = 0
b = 0
for p in c:
	if p == '++':
		b += 1
if b == 1:
	print('YES')
	for i in range(0, len(c) - 1, 2):
		print(c[i] + '|' + c[i + 1])
else:
	print('NO')


n = int(input())
rows = ['' for i in range(n)]
answer = 'NO'
for i in range(n):
	rows[i] = input()
for i in range(n):
	row = rows[i]
	if row[0] == 'O' and row[1] == 'O':
		rows[i] = '++|' + row[3] + row[4]
		answer = 'YES'
		break
	elif row[3] == 'O' and row[4] == 'O':
		rows[i] = row[0] + row[1] + '|++'
		answer = 'YES'
		break
print(answer)
if answer == 'YES':
	for i in range(n):
		print(rows[i])


available = True
n = int(input())
row_seat = []
for i in range(n):
	row_seat.append(input())
	if 'OO' in row_seat[i][:2] and available == True:
		seat = row_seat[i]
		new_seat = seat[:2].replace('OO', '++') + seat[2:5]
		row_seat.remove(seat)
		row_seat.append(new_seat)
		available = False
	if 'OO' in row_seat[i][3:5] and available == True:
		seat = row_seat[i]
		row_seat.remove(seat)
		row_seat.append(seat.replace('OO', '++'))
		available = False
if available == False:
	print('YES')
	for seat in row_seat:
		print(seat)
else:
	print('NO')


x = int(input())
lis = []
res = []
sFind = 0
for i in range(0, x):
	busSeat = input()
	lis.append(busSeat)
	p = [e.strip('|') for e in lis[i]]
	p.remove('')
	res.append(p)
for i in range(0, len(res)):
	for j in range(0, len(res[i])):
		if sFind != 1:
			if j + 1 < len(res[i]) and j != 1:
				if res[i][j] == 'O' and res[i][j + 1] == 'O':
					res[i][j] = '+'
					res[i][j + 1] = '+'
					print('YES')
					sFind = 1
if sFind != 1:
	print('NO')
else:
	for i in range(0, len(res)):
		res[i].insert(2, '|')
		str1 = ''.join((str(e) for e in res[i]))
		print(str1)


columns = int(input())
Os = False
rows = []
for i in range(columns):
	row = input()
	if row.find('OO') > -1 and Os == False:
		Os = True
		row = row.replace('OO', '++', 1)
	rows.append(row)
if Os:
	print('YES')
	print(*rows, sep='\n')
else:
	print('NO')


text = 'abcdefg'
text = text[:1] + 'Z' + text[2:]

def bus(n, a):
	pair = False
	tmp = ''
	for i in range(0, n):
		if a[i][0] == 'O' and a[i][1] == 'O':
			tmp = '++' + a[i][2:]
			a[i] = tmp
			print('YES')
			pair = True
			break
		elif a[i][3] == 'O' and a[i][4] == 'O':
			tmp = a[i][:3] + '++'
			a[i] = tmp
			print('YES')
			pair = True
			break
	if pair == False:
		print('NO')
	else:
		print(*a, sep='\n')
n = int(input())
a = []
for i in range(0, n):
	tmp = input()
	a.append(tmp)
bus(n, a)


num = int(input(''))
ans = ''
flag = 0
for i in range(num):
	bus = input('')
	if 'OO' in bus and flag == 0:
		ans += bus.replace('OO', '++', 1)
		flag = 1
	else:
		ans += bus
	ans += '\n'
if flag == 1:
	print('YES')
	print(ans)
else:
	print('NO')


t = int(input())
k = False
kek = []
for i in range(t):
	s = str(input())
	if k == False:
		for j in range(1, len(s)):
			if s[j] == 'O' and s[j - 1] == 'O':
				k = True
				s = s[:j - 1] + '+' + '+' + s[j - 1 + 2:]
				break
	kek.append(s)
if k == False:
	print('NO')
else:
	print('YES')
	for t in kek:
		print(t)


import sys
bus = []
for _ in range(int(sys.stdin.readline())):
	bus.append([i for i in input()])
istrue = False
for i in bus:
	if i[3] == 'O' and i[4] == 'O':
		istrue = True
		i[3] = '+'
		i[4] = '+'
		break
	elif i[0] == 'O' and i[1] == 'O':
		istrue = True
		i[0] = '+'
		i[1] = '+'
		break
	else:
		pass
if istrue == True:
	print('YES')
	for i in bus:
		print(''.join(i))
else:
	print('NO')


a = int(input())
yes = 0
prints = []
for i in range(a):
	(x, y) = map(str, input().split('|'))
	if not yes:
		if x == 'OO':
			prints.append('++|' + y)
			yes = 1
		elif y == 'OO':
			prints.append(x + '|++')
			yes = 1
		else:
			prints.append(x + '|' + y)
	else:
		prints.append(x + '|' + y)
print(['NO', 'YES'][yes])
if yes:
	print('\n'.join(prints))


n = int(input())
can_sit = 'NO'
seats = []
for i in range(n):
	seat = input()
	if can_sit == 'YES':
		seats.append(seat)
	elif seat[0] == seat[1] == 'O':
		can_sit = 'YES'
		seats.append('++' + seat[2:])
	elif seat[3] == seat[4] == 'O':
		can_sit = 'YES'
		seats.append(seat[:3] + '++')
	else:
		seats.append(seat)
print(can_sit)
if can_sit == 'YES':
	for seat in seats:
		print(seat)


rows = []
result = 'NO'
n = int(input())
for num in range(0, n):
	row = input()
	if result != 'YES':
		pair1 = row.split('|')[0]
		if pair1[0] == 'O' and pair1[1] == 'O':
			result = 'YES'
			row = '++' + row[2:]
		else:
			pair2 = row.split('|')[1]
			if pair2[0] == 'O' and pair2[1] == 'O':
				result = 'YES'
				row = row[:3] + '++'
	rows.append(row)
print(result)
if result == 'YES':
	for row in rows:
		print(row)


import sys
fin = sys.stdin
fin.readline()
s = fin.read()
x = s.find('OO')
print('NO' if x < 0 else 'YES\n' + s[:x] + '++' + s[x + 2:])


n = int(input())
sol = False
changed = False
L = []
for i in range(0, n):
	s = input()
	if 'OO' in s:
		sol = True
		if changed == False:
			s = s.replace('OO', '++', 1)
			changed = True
	L.append(s)
if sol == True:
	print('YES')
	for i in range(0, n):
		print(L[i])
else:
	print('NO')


line = int(input())
array = []
completed = False
for x in range(line):
	temp = input()
	sits = temp.split('|')
	if completed == False:
		if sits[0] == 'OO':
			sits = ['++', sits[1]]
			completed = True
	if completed == False:
		if sits[1] == 'OO':
			sits = [sits[0], '++']
			completed = True
	array.append(sits)
if completed:
	print('YES')
	for x in array:
		print('|'.join(x))
else:
	print('NO')


import sys
input()
s = sys.stdin.read()
if 'OO' in s:
	print('YES')
	print(s.replace('OO', '++', 1), end='')
else:
	print('NO')


ret1 = 'NO'
ret2 = list()
for i in range(int(input())):
	s = input()
	if 'OO' in s and ret1 == 'NO':
		s = s.replace('OO', '++', 1)
		ret1 = 'YES'
	ret2.append(s)
else:
	print(ret1)
	if ret1 == 'YES':
		for i in ret2:
			print(i)


import sys
from random import choice, randint
inp = sys.stdin.readline
out = sys.stdout.write
flsh = sys.stdout.flush
sys.setrecursionlimit(10 ** 9)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def MI():
	return map(int, inp().strip().split())

def LI():
	return list(map(int, inp().strip().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]

def LI_():
	return [int(x) - 1 for x in inp().strip().split()]

def LF():
	return [float(x) for x in inp().strip().split()]

def LS():
	return inp().strip().split()

def I():
	return int(inp().strip())

def F():
	return float(inp().strip())

def S():
	return inp().strip()

def pf(s):
	return out(s + '\n')

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	n = I()
	f = 0
	l = []
	for i in range(n):
		s = S()
		if 'OO' in s and f == 0:
			f = 1
			if s[:2] == 'OO':
				s = '++' + s[2:]
			else:
				s = s[:3] + '++'
		l.append(s)
	if f == 1:
		pf('YES')
		for i in range(n):
			pf(l[i])
	else:
		pf('NO')
main()


from sys import stdin
n = int(input())
bus = []
possible = False
for i in range(n):
	rangee = list(input())
	if not possible and rangee[0] == 'O' and (rangee[1] == 'O'):
		possible = True
		rangee[0] = '+'
		rangee[1] = '+'
	elif not possible and rangee[-1] == 'O' and (rangee[-2] == 'O'):
		possible = True
		rangee[-1] = '+'
		rangee[-2] = '+'
	bus.append(rangee)
if possible:
	print('YES')
	for i in range(n):
		print(*bus[i], sep='')
else:
	print('NO')


def printGrid():
	for i in range(n):
		print(arr[i])

def check(i, j):
	if arr[i][j:j + 2] == 'OO':
		print('YES')
		arr[i] = arr[i][:j] + '++' + arr[i][j + 2:]
		printGrid()
		return True
	return False
n = int(input())
arr = []
for i in range(n):
	s = str(input())
	arr.append(s)
for i in range(n):
	if check(i, 0) or check(i, 3):
		break
else:
	print('NO')


n = int(input())
l = list()
k = False
for i in range(n):
	l.append(input())
for i in range(len(l)):
	if 'OO' in l[i]:
		l[i] = l[i].replace('OO', '++', 1)
		k = True
		break
if k:
	print('YES')
	for i in l:
		print(i)
else:
	print('NO')


n = int(input())
a = []
b1 = []
cnt = 0
cnt1 = 0
for i in range(n):
	b = input()
	a.append(b)
for j in a:
	if j[0] == 'O' and j[1] == 'O':
		if cnt == 0:
			b1.append('++' + j[2:])
			cnt = cnt + 1
		else:
			b1.append(j)
	elif j[3] == 'O' and j[4] == 'O':
		if cnt == 0:
			b1.append(j[0:3] + '++')
			cnt = cnt + 1
		else:
			b1.append(j)
	else:
		b1.append(j)
		cnt1 = cnt1 + 1
if cnt1 == n:
	print('NO')
else:
	print('YES')
	for k in b1:
		print(k)


a = []
f = False
for i in range(int(input())):
	s = input()
	if not f:
		if 'OO' in s:
			f = True
			if s[:2] == 'OO':
				s = '++' + s[2:]
			else:
				s = s[:3] + '++'
	a.append(s)
if f:
	print('YES')
	for j in a:
		print(j)
else:
	print('NO')


n = int(input())
a = []
exist = False
for i in range(n):
	temp = list(map(str, input().split('|')))
	if temp[0] == 'OO' and (not exist):
		temp[0] = '++'
		exist = True
	elif temp[-1] == 'OO' and (not exist):
		temp[-1] = '++'
		exist = True
	a.append(temp)
if exist:
	print('YES')
	for i in range(n):
		print('|'.join(a[i]))
else:
	print('NO')


n = int(input())
check = 1
ls = []
for i in range(n):
	s = input()
	str = ''
	if check == 0:
		ls.append(s)
		continue
	if s[:2] == 'OO':
		check = 0
		str = '++' + s[2:]
		ls.append(str)
	elif s[3:] == 'OO':
		check = 0
		str = s[:3] + '++'
		ls.append(str)
	else:
		ls.append(s)
if check:
	print('NO')
else:
	print('YES')
	for i in ls:
		print(i)


def main():
	n = int(input())
	c = []
	found = False
	for i in range(n):
		r = input()
		if found:
			c.append(r)
			continue
		s = ''
		if r[0] == 'O' and r[1] == 'O':
			s = '++' + r[2:]
			found = True
		elif r[3] == 'O' and r[4] == 'O':
			s = r[:3] + '++'
			found = True
		else:
			s = r
		c.append(s)
	if found:
		print('YES')
		print('\n'.join(c))
	else:
		print('NO')
main()


n = int(input())
config = []
for i in range(n):
	config.append(list(input()))
canSit = False
for i in range(n):
	if canSit:
		continue
	else:
		(a, b, c, d, e) = config[i]
		if a == 'O' and b == 'O':
			canSit = True
			ans = (i, 1, 2)
		elif d == 'O' and e == 'O':
			canSit = True
			ans = (i, 4, 5)
		else:
			continue
if not canSit:
	print('NO')
else:
	print('YES')
	config[ans[0]][ans[1] - 1] = '+'
	config[ans[0]][ans[2] - 1] = '+'
	for row in config:
		print(''.join(row))


n = int(input())
gh = []
flag = 0
for i in range(n):
	stri = list(input())
	x = ''
	for j in range(len(stri) - 1):
		if stri[j] == 'O' and stri[j + 1] == 'O' and (flag == 0):
			stri[j] = '+'
			stri[j + 1] = '+'
			flag = 1
	for g in range(len(stri)):
		x += str(stri[g])
	gh.append(x)
if flag == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(gh[i])


n = int(input())
bus = [input() for x in range(n)]
if 'OO' in ' '.join(bus):
	print('YES')
	found = False
	for line in bus:
		if 'OO' in line and (not found):
			found = True
			if line[:2] == 'OO':
				print('++' + line[2:])
			else:
				print(line[:3] + '++')
		else:
			print(line)
else:
	print('NO')


import sys
input()
s = sys.stdin.read().rstrip()
i = s.find('OO')
print('NO' if i < 0 else 'YES\n' + s[:i] + '++' + s[i + 2:])


def find(li):
	for i in li:
		for j in range(0, len(i) - 1):
			if i[j] == i[j + 1] == 'O':
				i[j] = '+'
				i[j + 1] = '+'
				return 1
	return 0
n = int(input())
li = []
for i in range(0, n):
	s = str(input())
	li.append(list(s))
if find(li):
	print('YES')
	for i in li:
		print(''.join(i))
else:
	print('NO')


n = int(input())
sp = []
fl = True
for i in range(n):
	(s1, s2) = input().split('|')
	if fl:
		if 'OO' == s1:
			s1 = '++'
			fl = False
		elif 'OO' == s2:
			s2 = '++'
			fl = False
	sp.append(s1)
	sp.append(s2)
if not fl:
	print('YES')
	for i in range(0, len(sp), 2):
		print(sp[i], '|', sp[i + 1], sep='')
else:
	print('NO')


n = int(input())
s = []
for i in range(n):
	a = input()
	s.append(a)
for i in s:
	if 'OO' in i:
		temp = s.index(i)
		newi = i.replace('OO', '++', 1)
		s.remove(i)
		s.insert(temp, newi)
		s.insert(0, 'YES')
		break
if 'YES' in s:
	for i in s:
		print(i)
else:
	print('NO')


n = int(input())
flag = 0
m = []
for x in range(n):
	l = input().split('|')
	if flag == 0:
		if l[0] == 'OO':
			l[0] = '++'
			print('Yes')
			flag = 1
		elif l[1] == 'OO':
			l[1] = '++'
			print('Yes')
			flag = 1
	l = '|'.join(l)
	m.append(l)
if flag == 0:
	print('No')
else:
	for x in m:
		print(x)


import math

def main():
	f = 0
	a = []
	for i in range(int(input())):
		s = input()
		if s.find('OO') >= 0 and f == 0:
			f = 1
			s = s.replace('OO', '++', 1)
		a.append(s)
	if f == 0:
		print('NO')
	else:
		print('YES')
		for i in a:
			print(i)
main()


n = int(input())
mark = True
total = ''
for el in range(n):
	a = input()
	if a.count('OO') > 1 and mark:
		total += '\n'
		total += '++|OO'
		mark = False
	elif a.count('OO') > 0 and mark:
		a = a.replace('OO', '++')
		total += '\n'
		total += a
		mark = False
	else:
		total += '\n' + a
total = total[1:]
if mark == False:
	print('YES\n' + total)
else:
	print('NO')


ans = 'NO'
ar = []
count = 1
for _ in range(int(input())):
	s = input()
	if s[0:2] == 'OO' and count == 1:
		ar.append('++' + s[2:])
		ans = 'YES'
		count = 0
	elif s[3:] == 'OO' and count == 1:
		ar.append(s[0:3] + '++')
		ans = 'YES'
		count = 0
	else:
		ar.append(s)
if count == 0:
	print('YES')
	for i in ar:
		print(i)
else:
	print('NO')


n = int(input())
(flag, cnt) = (0, 0)
s = ''
for i in range(n):
	a = input()
	for j in range(1, 5):
		if a[j] == 'O' and a[j - 1] == 'O' and (flag == 0):
			flag = 1
			if j == 1:
				s += '+' + '+' + a[2] + a[3] + a[4] + '\n'
			else:
				s += a[0] + a[1] + a[2] + '+' + '+' + '\n'
			cnt = 1
	if cnt == 0:
		s += a + '\n'
	cnt = 0
if flag == 0:
	print('NO')
else:
	print('YES')
	print(s)


n = int(input())
ans = False
s = []
mark = -1
for i in range(0, n):
	tmp = input()
	if tmp.find('OO') != -1 and ans == False:
		ans = True
		mark = i
	s.append(tmp)
if ans == False:
	print('NO')
else:
	print('Yes')
	for i in range(0, n):
		if i != mark:
			print(s[i])
		elif s[i][0] == 'O' and s[i][1] == 'O':
			print('++' + s[i][2] + s[i][3] + s[i][4])
		else:
			print(s[i][0] + s[i][1] + s[i][2] + '++')


n = int(input())
s = 'NO'
b = list((list(map(str, input())) for i in range(n)))
for i in range(n):
	if b[i][0] == 'O' and b[i][1] == 'O':
		b[i][0] = '+'
		b[i][1] = '+'
		s = 'YES'
		break
	elif b[i][3] == 'O' and b[i][4] == 'O':
		b[i][3] = '+'
		b[i][4] = '+'
		s = 'YES'
		break
if s == 'YES':
	print('YES')
	for j in range(n):
		print(b[j][0] + b[j][1] + b[j][2] + b[j][3] + b[j][4])
else:
	print('NO')


n = int(input())
s = []
msg = 'NO'
for i in range(n):
	s.append(list(input()))
for i in range(n):
	if s[i][0] == 'O' and s[i][1] == 'O':
		s[i][0] = '+'
		s[i][1] = '+'
		msg = 'YES'
		break
	if s[i][3] == 'O' and s[i][4] == 'O':
		s[i][3] = '+'
		s[i][4] = '+'
		msg = 'YES'
		break
print(msg)
if msg == 'YES':
	for i in range(n):
		s[i] = ''.join(s[i])
		print(s[i])


n = int(input())
lst = []
f = 0
f1 = 1
for i in range(n):
	s = str(input())
	s = s.split('|')
	s1 = str()
	if (s[0] == 'OO' or s[-1] == 'OO') and f1 == 1:
		f = 1
		f1 = 0
		if s[0] == 'OO':
			s1 = '++' + '|' + s[-1]
		else:
			s1 = s[0] + '|' + '++'
		lst.append(s1)
	else:
		s1 = s[0] + '|' + s[-1]
		lst.append(s1)
if f == 1:
	print('YES')
	print(*lst, sep='\n')
else:
	print('NO')


n = int(input())
r = []
fl = False
for i in range(n):
	r1 = input()
	(a, b) = r1.split('|')
	if a == 'OO' and (not fl):
		r.append('++|' + b)
		fl = True
	elif b == 'OO' and (not fl):
		r.append(a + '|++')
		fl = True
	else:
		r.append(r1)
if fl:
	print('YES')
	for i in r:
		print(i)
else:
	print('NO')


inp1 = int(input())
matrix = []
matrix1 = []
num = int()
for x in range(inp1):
	inp2 = input()
	matrix.append(inp2)
for y in matrix:
	num = num + 1
	if y == 'OO|OX':
		matrix1.append('++|OX')
		break
	elif y == 'OO|XO':
		matrix1.append('++|XO')
		break
	elif y == 'OO|XX':
		matrix1.append('++|XX')
		break
	elif y == 'XO|OO':
		matrix1.append('XO|++')
		break
	elif y == 'OX|OO':
		matrix1.append('OX|++')
		break
	elif y == 'OO|OO':
		matrix1.append('++|OO')
		break
	elif y == 'XX|OO':
		matrix1.append('XX|++')
		break
	else:
		matrix1.append(y)
if matrix1[num - 1] == matrix[num - 1]:
	print('NO')
else:
	print('Yes')
	print(' '.join(matrix1[0:num + 1]), ' '.join(matrix[num:]))


a = int(input())
l = []
d = 0
cnt = 0
for i in range(a):
	s = list(input())
	l.append(s)
	if cnt == 0:
		if s[0] == 'O' and s[1] == 'O':
			cnt += 1
			print('YES')
			d += 1
			s[0] = s[1] = '+'
		if s[3] == 'O' and s[4] == 'O' and (d == 0):
			cnt += 1
			print('YES')
			s[3] = s[4] = '+'
if cnt > 0:
	for i in l:
		for j in i:
			print(j, end='')
		print('\n')
else:
	print('NO')


n = int(input())
ans = False
out = []
for i in range(n):
	row = input().split('|')
	if ans == False and row[0] == 'OO':
		ans = True
		row[0] = '++'
	if ans == False and row[1] == 'OO':
		ans = True
		row[1] = '++'
	out.append(row[0] + '|' + row[1])
if ans == False:
	print('NO')
else:
	print('YES')
	for i in out:
		print(i)


from math import sqrt
n = int(input())
bus = []
for _ in range(n):
	bus.append(input().split('|'))
find = False
for i in range(len(bus)):
	for j in range(len(bus[i])):
		if bus[i][j] == 'OO':
			bus[i][j] = '++'
			find = True
			break
	if find:
		break
if find:
	print('YES')
	for row in bus:
		print('|'.join(row))
else:
	print('NO')


flag = 0
bus = []
for i in range(int(input())):
	seat = input()
	if 'OO' in seat and flag == 0:
		flag = 1
		seat = seat.replace('OO', '++', 1)
	bus.append(seat)
if flag == 1:
	print('YES')
	for i in bus:
		print(i)
else:
	print('NO')


n = int(input())
a = []
k = 0
for i in range(n):
	a.append([])
for i in range(n):
	(b, c) = map(str, input().split('|'))
	a[i].append(b)
	a[i].append(c)
for i in range(n):
	for j in range(2):
		if k < 1:
			if a[i][j] == 'OO':
				a[i][j] = '++'
				k += 1
				for i in range(n):
					a[i][0] += '|'
				print('YES')
				for i in range(n):
					for j in range(2):
						print(a[i][j], end='')
					print()
if k == 0:
	print('NO')


from sys import stdin
b = [x.rstrip() for x in stdin.readlines()][1:]
for (i, x) in enumerate(b):
	if 'OO' in x:
		print('YES')
		if i > 0:
			print('\n'.join(b[:i]))
		if x[:2] == 'OO':
			print('++' + x[2:])
		else:
			print(x[:-2] + '++')
		print('\n'.join(b[i + 1:]))
		break
else:
	print('NO')


n = int(input())
listt = []
k = ''
t = ''
flag = True
for i in range(n):
	k = input()
	if 'OO' in k and flag == True:
		if k[0] == 'O' and k[1] == 'O':
			t += '++'
			t += k[2:5:1]
		else:
			t += k[0:3:1]
			t += '++'
		listt.append(t)
		flag = not flag
	else:
		listt.append(k)
if flag == False:
	print('YES')
	print('\n'.join(listt))
else:
	print('NO')


n = int(input())
l = []
for i in range(0, n):
	l.append(list(input()))
flag = 0
for i in range(0, n):
	if l[i][0] == 'O' and l[i][1] == 'O':
		print('YES')
		l[i][0] = '+'
		l[i][1] = '+'
		flag = 1
		for i in range(0, n):
			print(''.join(l[i]))
		break
	elif l[i][3] == 'O' and l[i][4] == 'O':
		print('YES')
		l[i][3] = '+'
		l[i][4] = '+'
		flag = 1
		for i in range(0, n):
			print(''.join(l[i]))
		break
if flag == 0:
	print('NO')


n = int(input())
array = [input().split('|') for _ in range(n)]
result = []
f = False
for i in range(n):
	for j in range(2):
		if array[i][j] == 'OO' and (not f):
			f = True
			result = [i, j]
if not result:
	print('NO')
	exit()
print('YES')
for i in range(n):
	for j in range(2):
		if j == 1:
			print('|', end='')
		if [i, j] == result:
			print('++', end='')
		else:
			print(array[i][j], end='')
	print()


n = int(input())
seat = []
change = 0
for i in range(n):
	seat.append(input())
for i in range(n):
	if 'OO' in seat[i]:
		change += 1
		if seat[i].count('OO') == 2:
			seat[i] = 'OO|++'
		else:
			seat[i] = seat[i].replace('OO', '++')
		break
if change == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(seat[i])


n = int(input())
count = 0
a = []
for i in range(n):
	a.append(input())
for i in range(n):
	for j in range(1, len(a[i])):
		if count < 1 and (a[i][j - 1] == 'O' and a[i][j] == 'O'):
			a[i] = a[i][:j - 1] + '+' + '+' + a[i][j + 1:]
			count += 1
if count > 0:
	print('YES')
	for i in range(n):
		print(a[i])
else:
	print('NO')


n = int(input())
a = []
count = 0
for i in range(n):
	a.append(input())
for i in range(n):
	if a[i][:2] == 'OO':
		a[i] = '++' + a[i][2:]
		count += 1
		break
	if a[i][3:] == 'OO':
		a[i] = a[i][:3] + '++'
		count += 1
		break
if count == 0:
	print('NO')
else:
	print('YES', *a, sep='\n')


n = int(input())
conf = []
found = False
seat = ''
index = -1
i = 0
while i < n:
	line = input()
	if 'OO' in line and (not found):
		found = True
		seat = line.replace('OO', '++', 1)
		index = i
	conf.append(line)
	i += 1
if found:
	i = 0
	print('YES')
	while i < n:
		if i == index:
			print(seat)
		else:
			print(conf[i])
		i += 1
else:
	print('NO')


n = int(input())
sits = [input() for i in range(n)]
flag = 0
for i in range(n):
	if sits[i].find('OO') != -1:
		flag = 1
		break
if flag == 0:
	print('NO')
else:
	print('YES')
	i = 0
	for i in range(n):
		if sits[i].find('OO') != -1:
			if sits[i].find('OO') == 0:
				print('++|' + sits[i][-2:])
			else:
				print(sits[i][:2] + '|++')
			break
		print(sits[i])
	for j in range(i + 1, n):
		print(sits[j])


n = int(input())
(i, flag) = (0, 0)
m = []
while i < n:
	l = input()
	x = l.find('OO')
	if x != -1 and flag != 1:
		if x == 0:
			l = '++' + l[2:]
		else:
			l = l[:3] + '++'
		m.append(l)
		flag = 1
	else:
		m.append(l)
	i += 1
if flag == 0:
	print('NO')
else:
	print('YES')
	for i in m:
		print(i)


n = int(input())
flag = 0
a = []
for i in range(n):
	(x, y) = input().split('|')
	a.append([x, y])
for i in range(n):
	for j in range(2):
		if a[i][j] == 'OO':
			a[i][j] = '++'
			flag = 1
			break
	if flag == 1:
		break
if flag == 1:
	print('YES')
	for i in range(n):
		for j in range(2):
			print(a[i][j], end='')
			if j == 0:
				print('|', end='')
		print()
else:
	print('NO')


def main():
	l = [input() for _ in range(int(input()))]
	for (i, s) in enumerate(l):
		if s.startswith('OO'):
			l[i] = '++' + s[2:]
		elif s.endswith('OO'):
			l[i] = s[:3] + '++'
		else:
			continue
		print('YES')
		print('\n'.join(l))
		return
	print('NO')
main()


a = int(input())
l = True
m = []
for _ in range(a):
	lst = input()
	if 'OO' in lst and l:
		l = False
		m.append(lst[:lst.index('OO')] + '++' + lst[lst.index('OO') + 2:])
	else:
		m.append(lst)
if l:
	print('NO')
else:
	print('YES')
	for el in m:
		print(el)


n = int(input())
arr = []
for i in range(n):
	y = input()
	arr.append(y)
c = 0
for i in arr:
	c += 1
	if i[0] == 'O' and i[1] == 'O':
		print('YES')
		i = '++' + i[2:]
		arr[c - 1] = i
		for j in arr:
			print(j)
		break
	elif i[3] == 'O' and i[4] == 'O':
		print('YES')
		i = i[0:3] + '++'
		arr[c - 1] = i
		for j in arr:
			print(j)
		break
else:
	print('NO')


l = []
for i in range(int(input())):
	s = input()
	l.append(s)
for i in range(len(l)):
	if 'OO' in l[i]:
		s = l[i].replace('OO', '++', 1)
		l[i] = s
		print('YES')
		print('\n'.join(l))
		break
else:
	print('NO')


(z, zz) = (input, lambda : list(map(int, z().split())))
fast = lambda : stdin.readline().strip()
zzz = lambda : [int(i) for i in fast().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = 1
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)

def output(answer):
	stdout.write(str(answer))
num = int(z())
c = 0
ans = []
for i in range(num):
	(a, b) = fast().split('|')
	if a.count('X') == 0 and c == 0:
		s = '++' + '|' + b
		c = 1
	elif b.count('X') == 0 and c == 0:
		s = a + '|' + '++'
		c = 1
	else:
		s = a + '|' + b
	ans.append(s)
print('YES' if c else 'NO')
if c:
	for i in ans:
		print(i)


size = int(input())
bus_configuration = [input() for i in range(size)]
bus_configuration = ' '.join(bus_configuration)
if 'OO' not in bus_configuration:
	print('NO')
else:
	result = bus_configuration.replace('OO', '++', 1)
	print('YES')
	for i in result.split(' '):
		print(i)


row = []
for i in range(int(input())):
	string = list(input())
	row.append(string)
flag = False
for i in row:
	if i[0] == 'O' and i[1] == 'O':
		(i[0], i[1]) = ('+', '+')
		flag = True
		break
	if i[3] == 'O' and i[4] == 'O':
		(i[3], i[4]) = ('+', '+')
		flag = True
		break
if flag:
	print('YES')
	[print(''.join(i), end='\n') for i in row]
if not flag:
	print('NO')


n = int(input())
x = []
ch = 'NO'
for i in range(n):
	m = input()
	x = x + m.split('|')
for i in range(2 * n):
	if x[i] == 'OO':
		x[i] = '++'
		ch = 'YES'
		break
if ch == 'YES':
	print(ch)
	for i in range(n):
		j = i * 2
		print(x[j] + '|' + x[j + 1])
else:
	print(ch)


list1 = []
judge = False
for i in range(int(input())):
	list1.append(input())
	if 'OO' in list1[-1] and judge == False:
		judge = True
		if list1[-1][:2] == 'OO':
			list1[-1] = '++' + list1[-1][2:]
		else:
			list1[-1] = list1[-1][:3] + '++'
if judge:
	print('YES')
	for i in range(len(list1)):
		print(list1[i])
else:
	print('NO')


n = int(input())
s = []
z = 0
for i in range(0, n):
	c = input()
	if z == 0:
		if c[0] == 'O' and c[1] == 'O':
			z = 1
			d = '++|' + c[3] + c[4]
			s.append(d)
		elif c[3] == 'O' and c[4] == 'O':
			z = 2
			d = c[0] + c[1] + '|++'
			s.append(d)
		else:
			s.append(c)
	else:
		s.append(c)
if z == 1 or z == 2:
	print('YES')
	for i in range(0, n):
		print(s[i])
else:
	print('NO')


n = int(input())
res = []
raz = False
for i in range(n):
	slovo = input()
	if raz == False:
		if slovo[0] == 'O' and slovo[1] == 'O':
			slovo = '++' + slovo[2:]
			raz = True
		elif slovo[3] == 'O' and slovo[4] == 'O':
			slovo = slovo[:3] + '++'
			raz = True
	res.append(slovo)
if raz == False:
	print('NO')
else:
	print('YES')
	for i in res:
		print(i)


n = int(input())
table = [input() for i in range(n)]
flag = False
index = 0
for (i, row) in enumerate(table):
	if 'OO' in row:
		index = i
		flag = True
		break
if flag:
	print('YES')
	for i in range(n):
		if i == index:
			print(table[i].replace('OO', '++', 1))
		else:
			print(table[i])
else:
	print('NO')


n = int(input())
seats = []
found = False
for i in range(n):
	pairs = input()
	(a, b) = pairs.split('|')
	if a == 'OO' and (not found):
		a = '++'
		found = True
	elif b == 'OO' and (not found):
		b = '++'
		found = True
	seats.append(a + '|' + b)
if found:
	print('YES')
	for j in range(n):
		print(seats[j])
else:
	print('NO')


def answer():
	n = int(input())
	c_in = []
	while n:
		a = input().split('|')
		c_in.append(a)
		n -= 1
	i = 0
	yas = 0
	while i < len(c_in):
		if c_in[i][0] == 'OO':
			c_in[i][0] = '++'
			yas = 1
			break
		elif c_in[i][1] == 'OO':
			c_in[i][1] = '++'
			yas = 1
			break
		i += 1
	i = 0
	if yas:
		print('YES')
	else:
		print('NO')
	if yas:
		for x in c_in:
			print(x[0] + '|' + x[1])
answer()


n = int(input())
flag = 0
c = 0
b = []
for _ in range(n):
	a = input()
	c += 1
	if flag == 0:
		if a.count('OO') > 0:
			a = a.replace('OO', '++', 1)
			flag = 1
	b.append(a)
if flag == 0 and c == n:
	print('NO')
else:
	print('YES')
	for i in b:
		print(i)


n = int(input())
bus = list()
for _ in range(n):
	s = input().split('|')
	for a in s:
		bus.append(a)
for i in range(n * 2):
	if bus[i] == 'OO':
		bus[i] = '++'
		print('YES')
		for i in range(0, n * 2 - 1, 2):
			print(bus[i] + '|' + bus[i + 1])
		exit()
print('NO')


n = int(input())
c = -1
a = []
for i in range(n):
	s = str(input())
	a.append(s)
	if s.find('OO') + 1:
		c = i
if c + 1:
	print('YES')
	for i in range(n):
		if i == c:
			print(a[i].replace('OO', '++', 1))
		else:
			print(a[i])
else:
	print('NO')


n = int(input())
a = [input() for i in range(n)]
a1 = []
set = 0
for i in range(len(a)):
	if 'OO' in a[i]:
		a[i] = a[i].replace('OO', '++', 1)
		break
for i in a:
	if '++' in i:
		set += 1
if set == 1:
	print('YES')
	for i in a:
		print(i, sep='\n')
else:
	print('NO')


n = int(input())
seats = []
ans = ''
for i in range(n):
	s = input()
	ss = s.split('|')
	s1 = ss[0]
	if ans == '' and ss[0] == 'OO':
		ans = 'YES'
		s1 = '++'
	s2 = ss[1]
	if ans == '' and ss[1] == 'OO':
		ans = 'YES'
		s2 = '++'
	seats.append(s1 + '|' + s2)
if ans != '':
	print(ans)
	print('\n'.join(seats))
else:
	print('NO')


def udayland(x):
	flag = 0
	l = []
	for i in x:
		if 'OO' in i and flag == 0:
			flag = 1
			x = list(i)
			for j in range(len(x)):
				if x[j] == 'O' and x[j + 1] == 'O':
					x[j] = '+'
					x[j + 1] = '+'
					break
			l.append(''.join(x))
		else:
			l.append(i)
	if flag == 1:
		print('YES')
		for k in l:
			print(k)
	else:
		print('NO')
n = int(input())
x = []
for j in range(n):
	x.append(input())
udayland(x)


n = int(input())
status = False
y = ''
for i in range(n):
	x = input()
	if x.find('OO') != -1 and status == False:
		id = x.find('OO')
		if id == 0:
			y += '++|' + x[-2:] + '\n'
		elif id == 3:
			y += x[:3] + '++' + '\n'
		status = True
	else:
		y += x + '\n'
if status == True:
	print('YES')
	print(y)
else:
	print('NO')


n = int(input())
lst = list()
for i in range(n):
	data = input()
	for m in data.split('|'):
		lst.append(m)
count = 0
for k in lst:
	if k == 'OO':
		count = count + 1
		break
if count > 0:
	print('YES')
	a = lst.index('OO')
	lst[a] = '++'
	j = 0
	while j < len(lst) - 1:
		z = '{}|{}'.format(lst[j], lst[j + 1])
		print(z)
		j = j + 2
else:
	print('NO')


(livre, alvo, corredor, onibus) = ('OO', '++', '|', [])

def solution(n, onibus):
	(ans, onibus_) = ('NO', onibus.copy())
	for i in range(0, n):
		if livre in onibus_[i]:
			ans = 'YES'
		(lado_esq, lado_dir) = onibus_[i].split(corredor)
		if lado_esq == livre:
			onibus_[i] = alvo + corredor + lado_dir
			break
		elif lado_dir == livre:
			onibus_[i] = lado_esq + corredor + alvo
			break
	return (ans, onibus_)
n = int(input())
for _ in range(0, n):
	onibus.append(input())
(ans, onibus_) = solution(n, onibus)
print(ans)
if ans == 'YES':
	print('\n'.join(onibus_))


n = int(input())
seat_found = False
rows = []
for i in range(n):
	row = input()
	if not seat_found:
		if 'OO' in row:
			seat_found = True
			if row[:2] == 'OO':
				rows.append('++' + row[2:])
			else:
				rows.append(row[:3] + '++')
		else:
			rows.append(row)
	else:
		rows.append(row)
if seat_found:
	print('YES')
	print('\n'.join(rows))
else:
	print('NO')


b = []
flag = 0
t = int(input().strip())
for i in range(t):
	x = input().strip()
	if 'OO' in x and (not flag):
		x = x[:x.index('OO')] + '++' + x[x.index('OO') + 2:]
		flag = 1
	b.append(x)
if flag:
	print('YES')
	for i in b:
		print(i)
else:
	print('NO')


t = int(input())
index = 0
d = []
asd = []
for i in range(t):
	s = input()
	d.append(s)
for i in d:
	if i.split('|')[0] == 'OO':
		print('YES')
		z = d.index(i)
		asd.append(True)
		break
	if i.split('|')[1] == 'OO':
		print('YES')
		z = d.index(i)
		asd.append(True)
		index = 3
		break
	else:
		asd.append(False)
if any(asd):
	if index == 0:
		dv = '++' + d[z][2:]
	elif index == 3:
		dv = d[z][0:3] + '++'
	zzv = []
	if t == 0:
		s = 1
	else:
		s = t
	for i in range(s):
		if i == z:
			zzv.append(dv)
		else:
			zzv.append(d[i])
	for i in zzv:
		print(i)
else:
	print('NO')


n = int(input())
l = []
for i in range(n):
	l.append(input())
for i in range(n):
	if l[i][:2] == 'OO':
		l[i] = list(l[i])
		l[i][:2] = ['+', '+']
		l[i] = ''.join(l[i])
		print('YES')
		for i in l:
			print(i)
		break
	elif l[i][3:] == 'OO':
		l[i] = list(l[i])
		l[i][3:] = ['+', '+']
		l[i] = ''.join(l[i])
		print('YES')
		for i in l:
			print(i)
		break
else:
	print('NO')


ans = 0
i = 0
ans1 = ''
n = int(input())
for x in range(n):
	a = input()
	b = []
	if a[0] == a[1] == 'O' and ans != 1:
		ans = 1
		s = str('++|' + a[3:])
		ans1 += s
	elif a[3] == a[4] == 'O' and ans != 1:
		ans = 1
		s = str(a[:3] + '++')
		ans1 += s
	else:
		ans1 += a
if ans == 1:
	print('YES')
	i = 0
	l = n * 5
	while i < l:
		print(ans1[i:i + 5], end='\n')
		i += 5
else:
	print('NO')


x = int(input())
res = []
done = 0
for i in range(x):
	each = input()
	if not done:
		if each[0:2] == 'OO':
			res.append(each.replace('OO', '++', 1))
			done = 1
		elif each[3:5] == 'OO':
			res.append(each.replace('OO', '++', 1))
			done = 1
		else:
			res.append(each)
	else:
		res.append(each)
if done:
	print('YES')
	for i in range(x):
		print(res[i])
else:
	print('NO')


n = int(input())
l = [[0] for i in range(n)]
s = []
for y in range(n):
	l[y] = input()
	if l[y].find('OO') != -1:
		s.append(y)
if len(s) != 0:
	p = l[s[0]].index('OO')
	l[s[0]] = list(l[s[0]])
	(l[s[0]][p], l[s[0]][p + 1]) = ('+', '+')
	l[s[0]] = ''.join(l[s[0]])
	print('YES')
	for y in range(n):
		print(l[y])
else:
	print('NO')


n = int(input())
bus = [input().split('|') for i in range(n)]
for s in bus:
	if 'OO' in s:
		for k in range(2):
			if s[k] == 'OO':
				s.pop(k)
				s.insert(k, '++')
				print('YES')
				for j in bus:
					print('|'.join(j))
				exit()
print('NO')


n = int(input())
l = []
for i in range(n):
	l.append(input())
res = []
j = 0
f = 0
for i in l:
	if 'OO' in str(i):
		f = 1
		l.remove(i)
		l.insert(j, i.replace('OO', '++', 1))
		break
	j += 1
if f == 1:
	print('YES')
	for i in range(n):
		print(''.join(l[i]))
else:
	print('NO')


queries = int(input())
final = []
yes = 0
for i in range(queries):
	pairs = input().split('|')
	for j in range(2):
		if pairs[j] == 'OO' and yes == 0:
			pairs.pop(j)
			pairs.insert(j, '++')
			yes = 1
	final.append(pairs[0] + '|' + pairs[1])
if yes == 1:
	final.insert(0, 'YES')
	for k in final:
		print(k)
else:
	print('NO')


n = int(input())
x = ''
t = False
for i in range(n):
	n = input()
	if t == False:
		if n[0] == 'O' and n[1] == 'O':
			n = '++' + n[2:]
			t = True
		elif n[3] == 'O' and n[4] == 'O':
			n = n[:3] + '++'
			t = True
	x += n + '\n'
if t == True:
	print('YES')
	print(x)
else:
	print('NO')


x = int(input())
y = ''
for i in range(x):
	y = y + input()
z = y
i = 0
c = ''
f = 0
z = z.replace('|', '')
while i < len(z) - 1:
	if z[i:i + 2] == 'OO':
		f = 1
		c = c + z[:i] + '++' + z[i + 2:]
		break
	i = i + 2
if f:
	print('YES')
	i = 0
	while i <= len(c) - 1:
		print(c[i:i + 2] + '|' + c[i + 2:i + 4])
		i = i + 4
else:
	print('NO')


N = int(input())
bus = []
for i in range(0, N):
	bus.append(input().split('|'))
ans = 'NO'
for i in range(0, N):
	for j in range(0, 2):
		if bus[i][j] == 'OO':
			bus[i][j] = '++'
			ans = 'YES'
			break
	if ans == 'YES':
		break
print(ans)
if ans == 'YES':
	for i in range(0, N):
		print(bus[i][0] + '|' + bus[i][1])


n = int(input())
h = 0
k = 5
vyk = 0
b = ''
for i in range(n):
	a = input()
	if a[:2] == 'OO' and vyk == 0:
		a = a.replace('OO', '++', 1)
		vyk += 1
	elif a[3:] == 'OO' and vyk == 0:
		a = a.replace('OO', '++', 1)
		vyk += 1
	b += a
if '++' in b:
	print('YES')
	for i in range(n - 1):
		print(b[h:k])
		h += 5
		k += 5
	print(b[-5:])
else:
	print('NO')


n = int(input())
bus = [[] for i in range(n)]
check = 0
for i in range(n):
	bus[i].append(input().split('|'))
for i in range(n):
	if bus[i][0][0] == 'OO':
		check += 1
		bus[i][0][0] = '++'
		break
	elif bus[i][0][1] == 'OO':
		check += 1
		bus[i][0][1] = '++'
		break
if check == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(bus[i][0][0] + '|' + bus[i][0][1])


n = int(input())
a = '\n'.join((input() for i in range(n)))
if 'OO' in a:
	print('YES')
	i = a.index('OO')
	a = a[:i] + '++' + a[i + 2:]
	print(a)
else:
	print('NO')


a = int(input())
x = []
bisa = 'NO'
for i in range(0, a):
	b = input()
	x.append(b)
for j in range(0, a):
	if x[j][0] == 'O' and x[j][1] == 'O':
		x[j] = '++' + x[j][2:]
		bisa = 'YES'
		break
	elif x[j][3] == 'O' and x[j][4] == 'O':
		x[j] = x[j][:-2] + '++'
		bisa = 'YES'
		break
print(bisa)
if bisa == 'YES':
	for j in range(0, a):
		print(x[j])


rows = int(input())
l = []
flag = False
for i in range(rows):
	s = list(input().split('|'))
	l.append(s)
for i in range(rows):
	for j in range(2):
		if l[i][j] == 'OO':
			print('YES')
			l[i][j] = '++'
			flag = True
			for k in l:
				print(k[0] + '|' + k[1])
			break
	if flag:
		break
if not flag:
	print('NO')


n = int(input())
config = []
flag = 0
for i in range(n):
	config.append(input().split('|'))
for i in range(n):
	for j in range(2):
		if config[i][j] == 'OO' and flag == 0:
			flag = 1
			config[i][j] = '++'
			break
if flag == 1:
	print('YES')
	for i in range(n):
		print(config[i][0] + '|' + config[i][1])
else:
	print('NO')


from collections import defaultdict
import sys, os, math
n = int(input())
s = list((input() for i in range(n)))
for i in range(n):
	if s[i][:2] == 'OO':
		s[i] = '++' + s[i][2:]
		break
	elif s[i][3:] == 'OO':
		s[i] = s[i][:3] + '++'
		break
	if i == n - 1:
		print('NO')
		sys.exit(0)
print('YES')
for i in range(n):
	print(s[i])


a = int(input())
b = []
cnt = 0
d = 0
for i in range(a):
	b.append(input())
for i in range(a):
	if 'OO' in b[i]:
		b[i] = b[i].replace('OO', '++', 1)
		cnt = 1
		break
if cnt == 1:
	print('YES')
	for i in range(a):
		print(b[i])
else:
	print('NO')


a = int(input())
NeedPlace = True
mat = []
for i in range(a):
	mat.append(input())
for i in range(a):
	if NeedPlace:
		if mat[i][0:2] == 'OO':
			mat[i] = '++' + mat[i][2:]
			NeedPlace = False
			break
		elif mat[i][3:] == 'OO':
			mat[i] = mat[i][0:3] + '++'
			NeedPlace = False
			break
if NeedPlace:
	print('NO')
else:
	print('YES')
	for i in mat:
		print(i)


f = 1
l = []
for _ in range(int(input())):
	s = input().split('|')
	if f == 1:
		if s[0] == 'OO':
			s[0] = '++'
			f = 0
		elif s[1] == 'OO':
			s[1] = '++'
			f = 0
	l.append('|'.join(s))
if f == 1:
	print('NO')
else:
	print('YES')
	for i in l:
		print(i)


n = int(input())
s = []
for i in range(n):
	s.append(input())
ans = 'NO'
for i in range(len(s)):
	if s[i][0:2] == 'OO':
		s[i] = s[i].replace('OO', '++', 1)
		ans = 'YES'
		break
	elif s[i][3:5] == 'OO':
		s[i] = s[i].replace('OO', '++')
		ans = 'YES'
		break
print(ans)
if ans == 'YES':
	for item in s:
		print(item)


(n, flag) = (int(input()), 0)
str = ''
list = []
for i in range(n):
	list.append(input())
for i in range(n):
	for j in range(4):
		if list[i][j:j + 2] == 'OO':
			flag = 1
			list[i] = list[i][:j] + '++' + list[i][j + 2:]
			break
	if flag > 0:
		break
if flag == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(list[i])


import re
p = re.compile('OO')
n = int(input())
res = 'NO'
out = ''
for i in range(n):
	entrada = input()
	if p.search(entrada) != None and res == 'NO':
		res = 'YES'
		entrada = entrada.replace('OO', '++', 1)
	out += entrada + '\n'
print(res)
if res == 'YES':
	print(out.strip())


ans = ''
f = 0
for i in range(int(input())):
	s = input()
	if f == 0:
		if s[0] == s[1] == 'O':
			ans += '++' + s[2:] + '\n'
			f = 1
		elif s[-1] == s[-2] == 'O':
			ans += s[:-2] + '++\n'
			f = 1
		else:
			ans += s + '\n'
	else:
		ans += s + '\n'
if f:
	print('YES\n' + ans)
else:
	print('NO')


import sys
n = int(input())
s = [input() for x in range(n)]
ok = False
for i in range(n):
	if s[i].find('OO') >= 0:
		ok = True
		s[i] = s[i].replace('OO', '++', 1)
		break
if ok:
	print('YES')
	for t in s:
		print(t)
else:
	print('NO')


x = int(input())
bus = []
c = 0
for i in range(x):
	b = input()
	if c != 1 and 'OO' in b:
		b = b.replace('OO', '++', 1)
		c = 1
	bus.append(b)
if c == 1:
	print('YES')
	print('\n'.join(map(str, bus)))
else:
	print('NO')


import sys
n = int(sys.stdin.readline().strip())
found = False
outputs = []
for i in range(n):
	s = sys.stdin.readline().strip()
	if found:
		outputs.append(s)
	else:
		(l, r) = s.split('|')
		if l == 'OO':
			found = True
			l = '++'
		elif r == 'OO':
			found = True
			r = '++'
		outputs.append('|'.join([l, r]))
if found:
	print('YES')
	for output in outputs:
		print(output)
else:
	print('NO')


j = []
c = 0
for _ in range(int(input())):
	s = input()
	k = s.split('|')
	i = 0
	while i < len(k) and c == 0:
		if k[i] == 'OO':
			k[i] = '++'
			c = 1
			break
		i += 1
	j.append(k)
if c == 1:
	print('YES')
	for k in j:
		print(k[0] + '|' + k[1])
else:
	print('NO')


n = int(input())
a = []
m = False
for i in range(n):
	x = list(input())
	if x[0] == 'O' and x[1] == 'O' and (m == False):
		x[0] = '+'
		x[1] = '+'
		m = True
	elif x[3] == 'O' and x[4] == 'O' and (m == False):
		x[3] = '+'
		x[4] = '+'
		m = True
	a.append(x)
if m == True:
	print('YES')
	for i in range(n):
		print(''.join(a[i]))
elif m == False:
	print('NO')


n = int(input())
a = [str(input()) for i in range(n)]
flag = True
for i in range(n):
	if 'OO' in a[i]:
		if a[i] == 'OO|OO':
			a[i] = '++|OO'
		else:
			a[i] = a[i].replace('OO', '++')
		print('YES')
		flag = False
		break
if flag == True:
	print('NO')
if flag == False:
	for i in a:
		print(i)


n = int(input())
a = [0]
b = [0]
for x in range(0, n):
	a.append(input())
for y in range(1, n + 1):
	if a[y][0:2] == 'OO':
		a[y] = list(a[y])
		a[y][0:2] = '++'
		a[y] = ''.join(a[y])
		b.append(1)
		break
	elif a[y][3:5] == 'OO':
		a[y] = list(a[y])
		a[y][3:5] = '++'
		a[y] = ''.join(a[y])
		b.append(1)
		break
	else:
		c = 'duh'
if 1 in b:
	print('YES')
	for z in range(1, n + 1):
		print(a[z])
else:
	print('NO')


n = int(input())
s = [input() for i in range(n)]
ans = 0
for (i, item) in enumerate(s):
	if 'OO' in item:
		s[i] = s[i].replace('OO', '++', 1)
		ans = 1
		break
if ans == 1:
	print('YES')
	print(*s, sep='\n')
else:
	print('NO')


n = int(input())
keks = True
ans = []
for i in range(n):
	s = list(input())
	if keks:
		if s[0] == 'O' and s[1] == 'O':
			s[0] = '+'
			s[1] = '+'
			keks = False
		elif s[3] == 'O' and s[4] == 'O':
			s[3] = '+'
			s[4] = '+'
			keks = False
	ans.append(s)
if not keks:
	print('YES')
	for elem in ans:
		print(''.join(map(str, elem)))
else:
	print('NO')


n = int(input())
bus = []
f = False
for i in range(n):
	row = input()
	if not f and row[0] == 'O' and (row[1] == 'O'):
		f = True
		print('YES')
		bus.append('++|' + row[3:])
	elif not f and row[3] == 'O' and (row[4] == 'O'):
		f = True
		print('YES')
		bus.append(row[:2] + '|++')
	else:
		bus.append(row)
if not f:
	print('NO')
else:
	print('\n'.join(bus))


test = 1
result = []
for i in range(int(input())):
	(row1, row2) = input().split('|')
	if 'OO' in row1 and test:
		row1 = row1.replace('OO', '++')
		test = 0
	if 'OO' in row2 and test:
		row2 = row2.replace('OO', '++')
		test = 0
	result.append(row1 + '|' + row2)
if not test:
	print('YES')
	for i in result:
		print(i)
else:
	print('NO')


flag = 0
L = []
N = int(input())
for i in range(N):
	X = list(input())
	if X[0] == 'O' and X[1] == 'O' and (flag == 0):
		flag = 1
		X[0] = '+'
		X[1] = '+'
	elif X[-1] == 'O' and X[-2] == 'O' and (flag == 0):
		flag = 1
		X[-1] = '+'
		X[-2] = '+'
	L.append(''.join(X))
if flag == 0:
	print('NO')
else:
	print('YES')
	for x in L:
		print(x)


s = []
n = int(input())
for i in range(n):
	s.append(input())
for i in range(n):
	if s[i][:2] == 'OO':
		s[i] = '++' + s[i][2:]
		print('YES')
		print(*s, sep='\n')
		exit(0)
	elif s[i][3:] == 'OO':
		s[i] = s[i][:3] + '++'
		print('YES')
		print(*s, sep='\n')
		exit(0)
print('NO')


n = int(input())
p = 0
m = []
for i in range(n):
	s = input()
	l = list(s)
	if l[0] == 'O' and l[1] == 'O' and (p == 0):
		l[0] = '+'
		l[1] = '+'
		p = 1
	elif l[3] == 'O' and l[4] == 'O' and (p == 0):
		l[3] = '+'
		l[4] = '+'
		p = 1
	m.append(l)
if p == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		for j in range(5):
			print(m[i][j], end='')
		print()


L = []
a = 1
b = 0
for i in range(int(input())):
	x = input()
	if x.find('OO') != -1 and a:
		x = x.replace('OO', '++', 1)
		a -= 1
		b = 1
		L.append(x)
	else:
		L.append(x)
if b == 1:
	print('YES')
	for i in L:
		print(i)
if b != 1:
	print('NO')


(result, ans) = ([], 'NO')
for _ in range(int(input())):
	(x, y) = input().split('|')
	if 'OO' in x and ans == 'NO':
		ans = 'YES'
		x = x.replace('OO', '++')
	elif 'OO' in y and ans == 'NO':
		ans = 'YES'
		y = y.replace('OO', '++')
	result.append(f'{x}|{y}')
print(ans)
if ans == 'YES':
	[print(row) for row in result]


l = []
answer = 'NO'
for i in range(int(input())):
	(a, b) = input().split('|')
	if a == 'OO' or b == 'OO':
		answer = 'YES'
	l.append([a, b])
if answer == 'NO':
	print(answer)
else:
	print(answer)
	for i in l:
		if i[0] == 'OO':
			i[0] = '++'
			break
		elif i[1] == 'OO':
			i[1] = '++'
			break
	for i in l:
		print('|'.join(i))


n = int(input())
seats = [[None for x in range(5)] for y in range(n)]
flag = 0
for i in range(n):
	seats[i][:] = list(input())
	if flag == 0 and seats[i][0] == 'O' and (seats[i][1] == 'O'):
		flag = 1
		print('YES')
		row = i
		column = 0
	if flag == 0 and seats[i][3] == 'O' and (seats[i][4] == 'O'):
		flag = 1
		print('YES')
		row = i
		column = 3
if flag > 0:
	for i in range(n):
		for j in range(5):
			if i != row:
				print(seats[i][j], end='')
			elif j != column and j != column + 1:
				print(seats[i][j], end='')
			else:
				print('+', end='')
		print('\n')
else:
	print('NO')


n = int(input())
a = []
x = -1
y = -1
for i in range(n):
	a.append(input())
	if a[-1][0] == a[-1][1] == 'O':
		x = [i, 0]
		y = [i, 1]
	if a[-1][3] == a[-1][4] == 'O':
		x = [i, 3]
		y = [i, 4]
if x == -1:
	print('NO')
else:
	print('YES')
	a[x[0]] = a[x[0]][:x[1]] + '+' + a[x[0]][x[1] + 1:]
	a[y[0]] = a[y[0]][:y[1]] + '+' + a[y[0]][y[1] + 1:]
	for i in range(n):
		print(a[i])


n = int(input())
li = []
for i in range(n):
	st = input()
	li.append(st)
flag = True
for i in range(n):
	if 'OO|' in li[i]:
		st = li[i]
		st = st.replace('OO|', '++|')
		li[i] = st
		flag = False
		break
	elif '|OO' in li[i]:
		st = li[i]
		st = st.replace('|OO', '|++')
		li[i] = st
		flag = False
		break
if flag:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(li[i])


n = int(input())
l = []
done = False
for i in range(n):
	l.append(input())
	if not done:
		if l[i][0:2] == 'OO':
			l[i] = '++' + l[i][2:]
			done = True
		elif l[i][3:] == 'OO':
			l[i] = l[i][0:3] + '++'
			done = True
if done:
	print('YES')
	for s in l:
		print(s)
else:
	print('NO')


n = int(input())
count = 0
previnp = []
for i in range(n):
	x = input()
	previnp.append(x)
	if x[:2] != 'OO' and x[3:] != 'OO':
		count += 1
if count == n:
	print('NO')
else:
	print('YES')
	toto = 0
	for i in range(n):
		x = previnp[i]
		if toto == 1:
			print(x)
		elif x[:2] == 'OO':
			print('++|' + x[3:])
			toto = 1
		elif x[3:] == 'OO':
			print(x[:2] + '|++')
			toto = 1
		else:
			print(x)


r = int(input())
j = False
list = []
for i in range(r):
	n = input()
	if 'OO' in n and j == False:
		j = True
		list.append(n.replace('OO', '++', 1))
	else:
		list.append(n)
if j == True:
	print('YES')
	for i in list:
		print(i)
else:
	print('NO')


n = int(input())
m = ''
for i in range(n):
	t = input()
	m = m + t + ','
if 'OO' in m:
	print('YES')
	t = m.replace('OO', '++', 1)
	m = t.replace(',', '\n')
	print(m)
else:
	print('NO')


n = int(input())
A = [list(input()) for i in range(n)]
Stop = False
for i in range(n):
	if A[i][0] == 'O' and A[i][1] == 'O':
		A[i][0] = '+'
		A[i][1] = '+'
		Stop = True
		break
	elif A[i][3] == 'O' and A[i][4] == 'O':
		A[i][3] = '+'
		A[i][4] = '+'
		Stop = True
		break
if Stop:
	print('YES')
	for i in range(n):
		print(''.join(A[i]))
else:
	print('NO')


n = int(input())
found = False
seats = []
for j in range(n):
	curr = input().strip()
	if not found and 'OO' in curr:
		found = True
		curr = curr.replace('OO', '++', 1)
	seats.append(curr)
if found:
	print('YES')
	print('\n'.join(seats))
else:
	print('NO')


import math
import sys
import string

def ri():
	return input()

def ii():
	return int(input())

def li():
	return input().split()

def mi():
	return list(map(int, input().split()))
n = ii()
s = []
flag = 0
for i in range(n):
	line = ri()
	s.append(line)
for i in range(n):
	if not flag:
		if s[i][0:2] == 'OO' or s[i][3:] == 'OO':
			s[i] = s[i].replace('OO', '++', 1)
			flag = 1
if flag == 1:
	print('YES')
	for i in s:
		print(i)
else:
	print('NO')


n = int(input())
f = 0
p = []
for i in range(n):
	p.append(input().strip())
for i in range(n):
	if p[i][0] == 'O' and p[i][1] == 'O':
		p[i] = '++|' + p[i][3:]
		f = 1
		break
	elif p[i][3] == 'O' and p[i][4] == 'O':
		p[i] = p[i][:2] + '|++'
		f = 1
		break
if f == 0:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(p[i])


n = int(input())
m = []
for i in range(n):
	a = input()
	m.append(a)
c = 0
for j in range(n):
	if m[j][0:2] == 'OO' or m[j][3:5] == 'OO':
		c = 1
		print('YES')
		b = m[j].replace('OO', '++', 1)
		break
if c == 0:
	print('NO')
else:
	for k in range(n):
		if k != j:
			print(m[k])
		else:
			print(b)


n = int(input())
seats = []
f = 0
for _ in range(n):
	s = input()
	if 'OO' in s and f == 0:
		s = s.replace('OO', '++', 1)
		f = 1
	seats.append(s)
print('YES' if f else 'NO')
if f == 1:
	print(*seats, sep='\n')


n = int(input())
l = []
for i in range(n):
	l.append(input().split('|'))
flag = 0
for i in range(n):
	if l[i][0] == 'OO':
		flag = 1
		l[i][0] = '++'
		break
	if l[i][1] == 'OO':
		flag = 1
		l[i][1] = '++'
		break
if flag == 1:
	print('YES')
	for j in range(n):
		print('|'.join(l[j]))
else:
	print('NO')


f = 0
a = []
for i in range(int(input())):
	s = input()
	s1 = s[0:2]
	s2 = s[3:5]
	s = ''
	if f == 0:
		if s1 == 'OO':
			f = 1
			s += '++'
		else:
			s += s1
	else:
		s += s1
	s += '|'
	if f == 1:
		s += s2
	elif s2 == 'OO':
		f = 1
		s += '++'
	else:
		s += s2
	a.append(s)
if f == 1:
	print('YES')
	for i in a:
		print(i)
else:
	print('NO')


n = int(input())
ls = []
occupied = False
for j in range(n):
	line = input()
	if occupied:
		ls.append(line)
	elif line.startswith('OO'):
		ls.append('++|' + line[3] + line[4])
		occupied = True
	elif line.endswith('OO'):
		ls.append(line[0] + line[1] + '|++')
		occupied = True
	else:
		ls.append(line)
if occupied:
	print('YES')
	for el in ls:
		print(el)
else:
	print('NO')


n = int(input())
matrix = []
flag = False
for i in range(n):
	string = input()
	if string[0:2] == 'OO' and (not flag):
		string = '++' + string[2:]
		matrix.append(string)
		flag = True
	elif string[3:] == 'OO' and (not flag):
		string = string[0:3] + '++'
		matrix.append(string)
		flag = True
	else:
		matrix.append(string)
if flag:
	print('YES')
	for row in matrix:
		print(row, end='\n')
else:
	print('NO')


ans = []
flag = False
for _ in range(int(input())):
	a = input().split('|')
	if not flag:
		if a[0] == 'OO' or a[1] == 'OO':
			if a[0] == 'OO':
				a[0] = '++'
			else:
				a[1] = '++'
			flag = True
	ans.append(a)
if flag:
	print('YES')
	for i in ans:
		print(i[0] + '|' + i[1])
else:
	print('NO')


t = int(input())
m = 0
f = 0
l = []
while m < t:
	n = list(input())
	l.append(n)
	m = m + 1
i = 0
while i < t:
	if l[i][0] == l[i][1] and l[i][0] == 'O':
		f = 1
		break
	if l[i][3] == l[i][4] and l[i][3] == 'O':
		f = 2
		break
	i = i + 1
if f == 0:
	print('NO')
else:
	print('YES')
	j = 0
	while j < t:
		if i == j:
			if f == 1:
				l[j][0] = '+'
				l[j][1] = '+'
			elif f == 2:
				l[j][3] = '+'
				l[j][4] = '+'
		print(''.join(l[j]))
		j = j + 1


import re
num_rows = int(input())
bus = []
first = True
for i in range(num_rows):
	temp = input()
	if 'OO' in temp and first:
		first = False
		temp = re.sub('OO', '++', temp, 1)
	bus.append(temp)
if not first:
	print('YES')
	print(*bus, sep='\n')
else:
	print('NO')


def f(a):
	long = ' '.join(a)
	if 'OO' in long:
		print('YES')
		out = long.replace('OO', '++', 1)
		out = out.split()
		out = '\n'.join(out)
		print(out)
	else:
		print('NO')
count = int(input())
ar = []
for _ in range(count):
	ar.append(input())
f(ar)


n = int(input())
ls = []
for i in range(0, n):
	ls.append([])
	ls[i] = input().split()
br = 0
for i in range(0, n):
	j = 0
	for j in range(0, len(ls[i][0]) - 1):
		if ls[i][0][j] == 'O' and ls[i][0][j + 1] == 'O':
			ls[i][0] = ls[i][0][:j] + '++' + ls[i][0][j + 2:]
			br = 1
			break
	if br:
		print('YES')
		break
if br:
	for i in range(0, n):
		print(ls[i][0])
else:
	print('NO')


x = int(input())
count = 0
lst = []
for i in range(0, x):
	c = input()
	if c.find('OO') != -1 and count < 1:
		d = c.find('OO')
		count += 1
		lst.append(c[:d] + '++' + c[d + 2:])
	else:
		lst.append(c)
if count == 0:
	print('NO')
else:
	print('YES')
	print(*lst, sep='\n')


x = int(input())
t = []
d = 0
for i in range(x):
	t.append(input())
for i in range(x):
	if 'OO' in t[i]:
		d += 1
		t[i] = t[i].replace('OO', '++', 1)
		break
if d == 0:
	print('NO')
else:
	print('YES')
	for i in t:
		print(i)


z = []
h = 0
for x in range(int(input())):
	b = list(input())
	if b[0] == b[1] == 'O' and h == 0:
		b[0] = b[1] = '+'
		z.append(b)
		h = 1
	elif b[3] == b[4] == 'O' and h == 0:
		b[3] = b[4] = '+'
		z.append(b)
		h = 1
	else:
		z.append(b)
if h == 0:
	print('NO')
if h == 1:
	print('YES')
	for char in z:
		print(*char, sep='')


n = int(input())
ok = False
bus = []
for i in range(n):
	row = input()
	if not ok and row[0:2] == 'OO':
		row = '++' + row[2:]
		ok = True
	elif not ok and row[3:] == 'OO':
		row = row[:3] + '++'
		ok = True
	bus.append(row)
if ok:
	print('YES')
	print('\n'.join(bus))
else:
	print('NO')


n = int(input())
config = []
found = False
for i in range(n):
	row = input()
	if not found:
		if 'OO|' in row:
			row = '++' + row[2:]
			found = True
		elif '|OO' in row:
			row = row[:3] + '++'
			found = True
	config.append(row)
print('YES' if found else 'NO')
if found:
	print('\n'.join(config))


import math
input_s = input()
result = False
result_list = []
for i in range(int(input_s)):
	input_l = input()
	if not result:
		if input_l[:2] == 'OO':
			result_list.append('++' + input_l[2:])
			result = True
		elif input_l[3:] == 'OO':
			result_list.append(input_l[:3] + '++')
			result = True
		else:
			result_list.append(input_l)
	else:
		result_list.append(input_l)
print('YES' if result else 'NO')
if result:
	print('\n'.join(result_list))


t = int(input())
x = list()
flag = False
while t > 0:
	row = list(input())
	if row[0] == 'O' and row[1] == 'O' and (not flag):
		row[0] = '+'
		row[1] = '+'
		flag = True
	elif row[3] == 'O' and row[4] == 'O' and (not flag):
		row[3] = '+'
		row[4] = '+'
		flag = True
	x.insert(len(x), row)
	t -= 1
if flag:
	print('YES')
	for st in x:
		print(''.join(st))
else:
	print('NO')
	zip


n = int(input())
seats = []
for i in range(n):
	seats.append(input().split('|'))
a = False
for i in range(n):
	for k in range(2):
		if seats[i][k] == 'OO':
			a = True
			seats[i][k] = '++'
			break
	if a:
		break
if a:
	print('YES')
	for i in range(n):
		print('|'.join(seats[i]))
else:
	print('NO')


n = int(input())
l = []
c = 0
for i in range(n):
	x = input().split('|')
	if x[0] == 'OO' and c != 1:
		x[0] = '++'
		c = 1
	elif x[1] == 'OO' and c != 1:
		x[1] = '++'
		c = 1
	l.append('|'.join(x))
if c == 0:
	print('NO')
else:
	print('YES')
	for i in l:
		print(i)


n = int(input())
bus = []
for _ in range(n):
	bus.append(input().split('|'))

def yes_or_no():
	for i in range(0, len(bus)):
		for j in bus[i]:
			if j == 'OO':
				bus[i][bus[i].index(j)] = '++'
				print('YES')
				c = 0
				for k in range(0, len(bus)):
					for m in bus[k]:
						if c % 2 == 0:
							print(m + '|', end='')
							c += 1
						else:
							print(m)
							c += 1
				return
	print('NO')
yes_or_no()


n = int(input())
cani = True
foo = []
for i in range(n):
	bar = input()
	if cani and 'OO' in bar:
		cani = False
		bar = bar.replace('OO', '++', 1)
	foo.append(bar)
if cani:
	print('NO')
else:
	print('YES')
	for e in foo:
		print(e)


n = int(input().strip())
seats = []
seat = None
for i in range(n):
	seat = input().strip()
	seats.append(seat)
for i in range(len(seats)):
	if seats[i].count('OO') != 0:
		print('YES')
		seats[i] = seats[i].replace('OO', '++', 1)
		for j in seats:
			print(j)
		break
	if i == len(seats) - 1:
		print('NO')


(x, flag) = ([], 0)
n = int(input())
for j in range(n):
	s = input()
	if 'OO' in s and flag == 0:
		i = s.index('OO')
		s = s[0:i] + '++' + s[i + 2:]
		x.append(s)
		flag = 1
	else:
		x.append(s)
if flag == 0:
	print('NO')
else:
	print('YES')
	print(*x, sep='\n')


list = []
check = True
for _ in range(int(input())):
	inp = input()
	if check and inp.find('OO|') != -1:
		list.append('++|' + inp.split('|')[1])
		check = False
	elif check and inp.find('|OO') != -1:
		list.append(inp.split('|')[0] + '|++')
		check = False
	else:
		list.append(inp)
if check:
	print('NO')
	exit()
print('YES')
for x in list:
	print(x)


n = int(input())
bool = False
inputs = []
for i in range(n):
	inputs.append(input())
for i in range(n):
	v = inputs[i]
	if bool == False:
		if v[0] == 'O' and v[1] == 'O':
			bool = True
			inputs[i] = '++' + v[2] + v[3] + v[4]
		elif v[3] == 'O' and v[4] == 'O':
			bool = True
			inputs[i] = v[0] + v[1] + v[2] + '++'
if bool == False:
	print('NO')
else:
	print('YES')
	for i in range(n):
		print(inputs[i])


n = int(input())
p1_1 = []
p1_2 = []
p2_1 = []
p2_2 = []
r = '|'
count = 'NO'
for i in range(n):
	(o1_1, o1_2, r, o2_1, o2_2) = (s for s in input().replace('', ' ').strip().split())
	p1_1.append(o1_1)
	p1_2.append(o1_2)
	p2_1.append(o2_1)
	p2_2.append(o2_2)
	if p1_1[i] == p1_2[i] == 'O' and count == 'NO':
		p1_1[i] = p1_2[i] = '+'
		count = 'YES'
	elif p2_1[i] == p2_2[i] == 'O' and count == 'NO':
		p2_1[i] = p2_2[i] = '+'
		count = 'YES'
print(count)
if count == 'YES':
	for i in range(n):
		print(p1_1[i] + p1_2[i] + r + p2_1[i] + p2_2[i])


n = int(input())
s = [input() for _ in range(n)]
for i in range(n):
	if 'OO' in s[i]:
		s[i] = s[i].replace('OO', '++', 1)
		print('YES')
		for j in range(n):
			print(s[j])
		break
	elif i == n - 1:
		print('NO')


def checkPlace(i, j):
	if arr[i][j:j + 2] == 'OO':
		print('YES')
		arr[i] = arr[i][:j] + '++' + arr[i][j + 2:]
		for i in range(n):
			print(arr[i])
		return True
	return False
n = int(input())
arr = []
for i in range(n):
	x = str(input())
	arr.append(x)
for i in range(n):
	if checkPlace(i, 0) or checkPlace(i, 3):
		break
else:
	print('NO')


n = int(input())
s1 = []
l = 0
k = 1
for i in range(n):
	s = input()
	if s[0] + s[1] == 'OO' and l == 0:
		s1.append('++|' + s[3] + s[4])
		l += 1
		k = 0
		continue
	if s[3] + s[4] == 'OO' and l == 0:
		s1.append(s[0] + s[1] + '|++')
		l += 1
		k = 0
		continue
	else:
		s1.append(s)
if l > 0:
	print('YES')
	for item in s1:
		print(item)
if l == 0:
	print('NO')


import pdb
k = [input() for _ in range(int(input()))]
x = '\n'.join(k).replace('OO', '++', 1)
print('YES\n' + x if x.find('++') >= 0 else 'NO')


n = int(input())
lines = ''
for _ in range(n):
	lines += input() + '\n'
lines = lines[:-1]
if 'OO' in lines:
	print('YES')
	print(lines.replace('OO', '++', 1))
else:
	print('NO')


m = []
f = 0
for i in range(int(input())):
	s = input()
	if f == 0:
		if 'OO' in s:
			if s[:2] == 'OO':
				s = '++' + s[2:]
			else:
				s = s[:3] + '++'
			f = 1
	m.append(s)
if f == 1:
	print('YES')
	for i in m:
		print(i)
else:
	print('NO')


n = int(input())
arr = []
for i in range(n):
	(x, y) = input().split('|')
	arr.append(x)
	arr.append(y)
for i in range(2 * n):
	if arr[i] == 'OO':
		ans = 'YES'
		arr[i] = '++'
		break
else:
	ans = 'NO'
print(ans)
if ans == 'YES':
	s = ''
	for i in range(2 * n):
		if i % 2 == 0:
			s += arr[i] + '|'
		else:
			s += arr[i] + '\n'
	print(s.strip())


t = int(input())
flag = 0
z = []
for i in range(t):
	l = input()
	if 'OO|' in l and flag == 0:
		flag = 1
		l = l.replace('OO|', '++|')
	elif '|OO' in l and flag == 0:
		flag = 1
		l = l.replace('|OO', '|++')
	z.append(l)
if flag == 0:
	print('NO')
else:
	print('YES')
	for j in range(t):
		print(z[j])


bus = []
a = 'NO'
for _ in range(int(input())):
	s = input()
	ss = s.split('|')
	if a == 'NO':
		for i in range(2):
			if ss[i] == 'OO':
				ss[i] = '++'
				a = 'YES'
				break
		bus.append('|'.join(ss))
	else:
		bus.append(s)
if a == 'YES':
	print(a)
	print(*bus, sep='\n')
else:
	print('NO')


n = int(input())
array = []
a = -1
for i in range(0, n):
	x = input()
	array.append(x)
for i in range(0, n):
	if 'OO' in array[i]:
		array[i] = array[i].replace('OO', '++', 1)
		array.insert(0, 'YES')
		break
	else:
		a += 1
if a != n - 1:
	for i in range(0, n + 1):
		print(array[i])
else:
	print('NO')
	exit(0)


n = int(input())

def change(s, j):
	ans = ''
	for i in range(len(s)):
		if i == j:
			ans += '+'
		else:
			ans += s[i]
	return ans
Y = 0
b = list()
for i in range(n):
	a = input()
	if Y == 0:
		if (a[0] == 'O') & (a[1] == 'O'):
			Y = 1
			a = change(a, 0)
			a = change(a, 1)
		elif (a[3] == 'O') & (a[4] == 'O'):
			Y = 1
			a = change(a, 3)
			a = change(a, 4)
	b += [a]
if Y == 1:
	print('YES')
	for i in range(n):
		print(b[i])
elif Y == 0:
	print('NO')


import os
import sys
import random
n = int(input())
li = []
check = False
for i in range(0, n):
	st = str(input())
	li.append(st)
index = 0
for i in li:
	p1 = i[0:2]
	p2 = i[3:5]
	if p1 == 'OO':
		i = '++' + i[2:5]
		li.insert(index, i)
		li.pop(index + 1)
		check = True
		break
	elif p2 == 'OO':
		i = i[0:3] + '++'
		li.insert(index, i)
		li.pop(index + 1)
		check = True
		break
	index += 1
if check:
	print('YES')
	for i in li:
		print(i)
else:
	print('NO')


loop = True
strT = []
for _ in range(int(input())):
	m = input()
	if loop:
		if 'OO' in m:
			m = m.replace('OO', '++', 1)
			strT.append(m)
			loop = False
		else:
			strT.append(m)
	else:
		strT.append(m)
if loop == False:
	print('YES')
	for p in strT:
		print(p)
else:
	print('NO')


n = int(input())
l = []
c = 0
for i in range(n):
	s = input().split('|')
	if c == 0:
		if 'OO' in s:
			s[s.index('OO')] = '++'
			c += 1
	l.append(s)
if c == 1:
	print('YES')
	for i in l:
		print(*i, sep='|')
else:
	print('NO')


seat = False
l = []
for _ in range(int(input())):
	s = input()
	if 'OO' in s and seat == False:
		if s.count('O') == 4:
			s = s.replace('OO|', '++|')
		else:
			s = s.replace('OO', '++')
		seat = True
	l.append(s)
print('YES' if seat == True else 'NO')
if seat == True:
	print(*l, sep='\n')


n = int(input())
result = []
possible_to_seat = False

def can_seat_on_side(side):
	return side[0] == side[1] and side[0] == 'O'

def can_seat_on_line(line):
	return can_seat_on_side(line[0] + line[1]) or can_seat_on_side(line[3] + line[4])

def sit_on_line(line):
	if can_seat_on_side(line[:2]):
		return '++|' + line[3:]
	if can_seat_on_side(line[3:]):
		return line[:2] + '|++'

def compute_result():
	global possible_to_seat
	for k in range(n):
		line = input()
		if not possible_to_seat and can_seat_on_line(line):
			possible_to_seat = True
			result.append(sit_on_line(line))
		else:
			result.append(line)
compute_result()
if possible_to_seat:
	print('YES')
	for k in result:
		print(k)
else:
	print('NO')


n = int(input())
seats = []
ans = 'NO'
for i in range(n):
	seats.append(input())
	if ans == 'NO':
		if 'OO|' in seats[i]:
			seats[i] = '++' + seats[i][2:]
			ans = 'YES'
		elif '|OO' in seats[i]:
			seats[i] = seats[i][:3] + '++'
			ans = 'YES'
print(ans)
if ans == 'YES':
	for i in range(n):
		print(seats[i])


a = int(input())
temp = []
flag = False
res = ''
for i in range(a):
	temp.append(input().split())
for i in temp:
	if 'OO' in i[0] and (not flag):
		res = res + i[0].replace('OO', '++', 1) + '\n'
		flag = True
	else:
		res = res + i[0] + '\n'
if '+' in res:
	print('YES\n' + res)
else:
	print('NO')


n = int(input())
flag = True
list1 = []
ans = False
for i in range(n):
	s = str(input())
	l = list(s)
	if 'OO' in s and flag:
		if s[0:2] == 'OO':
			l[0] = '+'
			l[1] = '+'
		elif s[3:] == 'OO':
			l[3] = '+'
			l[4] = '+'
		flag = False
		ans = True
		list1.append(''.join(l))
	else:
		list1.append(s)
if ans == False:
	print('NO')
if ans == True:
	print('YES')
	for i in range(n):
		print(list1[i])


n = int(input())
s = ''
r = 0
for i in range(n):
	a = input()
	if a[:2] == 'OO' and r == 0:
		s = s + '++' + a[2:]
		r = 1
	elif a[3:] == 'OO' and r == 0:
		s = s + a[:3] + '++'
		r = 1
	else:
		s = s + a
if r == 0:
	print('NO')
else:
	print('YES')
	for i in range(len(s)):
		print(s[i], end='')
		if (i + 1) % 5 == 0:
			print()


rows = int(input())
seats = []
answer = 'NO'
for _ in range(rows):
	this_row = input()
	if 'OO' in this_row and answer == 'NO':
		this_row = this_row.replace('OO', '++', 1)
		answer = 'YES'
	seats.append(this_row)
print(answer)
if answer == 'YES':
	for seat in seats:
		print(seat)


a = int(input())
b = []
f = 0
for i in range(a):
	b.append(input())
for i in range(a):
	if f == 1:
		break
	if 'OO' in b[i]:
		n = b[i].find('OO')
		b[i] = b[i][:n] + '++' + b[i][n + 2:]
		f = 1
if f == 1:
	print('YES')
	for i in range(a):
		print(b[i])
else:
	print('NO')


n = int(input())
seat = []
for i in range(n):
	seat.append(input())
for i in range(n):
	if 'OO' in seat[i]:
		print('YES')
		seat[i] = seat[i].replace('OO', '++', 1)
		for e in seat:
			print(e)
		exit()
print('NO')


n = input()
flag = 0
sets = []
for i in range(int(n)):
	set = input()
	if 'OO' in set and flag != 1:
		sets.append(set.replace('OO', '++', 1))
		flag = 1
	else:
		sets.append(set)
if flag == 1:
	print('YES')
	for set in sets:
		print(set)
else:
	print('NO')


n = int(input())
l = []
for i in range(n):
	s = input()
	a = s.split('|')
	l.append(a)
x = False
for j in range(len(l)):
	if 'OO' in l[j]:
		if l[j][0] == 'OO':
			l[j][0] = '++'
			x = True
			break
		elif l[j][1] == 'OO':
			l[j][1] = '++'
			x = True
			break
if x == True:
	p = []
	for k in range(n):
		p.append(l[k][0] + '|' + l[k][1])
	print('YES')
	for L in range(n):
		print(p[L])
else:
	print('NO')


import re
number_of_rows = int(input())
seat = ''
for item in range(number_of_rows):
	seat += input() + '\n'
if re.findall('OO', seat):
	print('YES')
	print(seat.replace('OO', '++', 1))
else:
	print('NO')


a = int(input())
d = 0
l = []
for i in range(a):
	(x, y) = map(str, input().split('|'))
	if x == 'OO' and d == 0:
		x = '++'
		d += 1
	if y == 'OO' and d == 0:
		y = '++'
		d += 1
	l.append(x + str('|') + y)
if d == 1:
	print('YES')
	for i in l:
		print(i)
else:
	print('NO')


ans = ''
for _ in '0' * int(input()):
	ans += input() + '\n'
b = ans.find('OO') == -1
print('YNEOS'[b::2] + '\n' + (ans.replace('OO', '++', 1) if not b else ''))


n = int(input())
l = []
for i in range(n):
	k = list(input())
	l.append(k)
t = False
for i in range(n):
	a = l[i]
	if a[:2] == ['O', 'O']:
		l[i][:2] = ['+', '+']
		t = True
		break
	if a[3:] == ['O', 'O']:
		l[i][3:] = ['+', '+']
		t = True
		break
if t:
	print('YES')
	for i in range(n):
		print(''.join(l[i]))
else:
	print('NO')


n = int(input())
seats = []
flag = 0
for _ in range(n):
	x = input()
	if 'OO' in x and flag == 0:
		x = x.replace('OO', '++', 1)
		flag = 1
	seats.append(x)
if flag == 1:
	print('YES')
	for seat in seats:
		print(seat)
else:
	print('NO')


rows = int(input())
foundSeat = False
bus = []
while rows > 0:
	rowOfSeats = input()
	if 'OO' in rowOfSeats and (not foundSeat):
		foundSeat = True
		rowOfSeats = rowOfSeats.replace('OO', '++', 1)
	bus.append(rowOfSeats)
	rows = rows - 1
if foundSeat:
	print('YES')
	for row in bus:
		print(row)
else:
	print('NO')


n = int(input())
a = [0] * n
for i in range(n):
	a[i] = input()
for i in range(len(a)):
	k = a[i].find('OO')
	if k != -1:
		print('YES')
		a[i] = a[i][:k] + '++' + a[i][k + 2:]
		for j in range(len(a)):
			print(a[j])
		break
else:
	print('NO')


n = int(input())
rows = []
count = 0
for i in range(n):
	row = input()
	if count == 0:
		for r in range(4):
			if row[r] == 'O':
				if row[r + 1] == 'O':
					row = list(row)
					row[r] = '+'
					row[r + 1] = '+'
					row = ''.join(row)
					count += 1
					break
	rows.append(row)
if count == 0:
	print('NO')
elif count == 1:
	print('YES')
	for row in rows:
		print(row)


n = int(input())
ans = False
list = []
for i in range(n):
	str = input()
	if not ans:
		if str[0] == 'O' and str[1] == 'O':
			str = '++' + str[2:]
			ans = True
		elif str[3] == 'O' and str[4] == 'O':
			str = str[:3] + '++'
			ans = True
	list.append(str)
if ans:
	print('YES\n')
	for elem in list:
		print(elem, '\n')
else:
	print('NO')


n = int(input())
l = []
for i in range(n):
	s = [i for i in input()]
	l.append(s)
flag = 'NO'
for i in l:
	for j in range(len(i) - 1):
		if i[j] == i[j + 1] and i[j] == 'O':
			i[j] = i[j + 1] = '+'
			flag = 'YES'
			break
	if flag == 'YES':
		break
print(flag)
if flag == 'YES':
	for i in l:
		print(*i, sep='')


def main():
	n = int(input())
	added = False
	lines = []
	for i in range(n):
		d = input().strip()
		if not added and d.endswith('OO'):
			lines.append(d[0:3] + '++')
			added = True
		elif not added and d.startswith('OO'):
			lines.append('++' + d[2:])
			added = True
		else:
			lines.append(d)
	if added:
		print('YES')
		for v in lines:
			print(v)
	else:
		print('NO')
main()


x = int(input())
lst = []
for i in range(0, x):
	lst.append(input())
i = 0
while i < len(lst):
	c = lst[i]
	if c.find('OO') != -1:
		d = c.find('OO')
		lst[i] = c[:d] + '++' + c[d + 2:]
		break
	i += 1
if i == len(lst):
	print('NO')
else:
	print('YES')
	print(*lst, sep='\n')


n = int(input())
z = []
flag = False
for i in range(n):
	z.append(input())
for i in z:
	if i[:2] == 'OO':
		z[z.index(i)] = '++' + i[2:]
		flag = True
		break
	elif i[3:] == 'OO':
		z[z.index(i)] = i[:3] + '++'
		flag = True
		break
if flag == True:
	print('YES')
	for i in z:
		print(i)
else:
	print('NO')


n = int(input())
bus = []
s = -1
for i in range(n):
	bus.append(input())
for i in range(n):
	if 'OO' in bus[i]:
		print('YES')
		s = i
		break
else:
	print('NO')
if s != -1:
	for i in range(n):
		if i == s:
			print(bus[i].replace('OO', '++', 1))
		else:
			print(bus[i])


n = int(input())
l = []
for i in range(0, n):
	s = input()
	k = s[0:2]
	o = s[3:5]
	l.append(k)
	l.append(o)
c = 0
h = []
d = []
q = ['++']
for i in range(0, 2 * n):
	if l[i] == 'OO':
		h = l[0:i]
		d = l[i + 1:2 * n]
		q = h + q + d
		break
	else:
		c += 1
if c == 2 * n:
	print('NO')
else:
	print('YES')
	for i in range(0, n):
		print(q[2 * i], end='|')
		print(q[2 * i + 1])


t = int(input())
flag = 0
str = ''
for i in range(t):
	s = input()
	if flag == 0:
		for i in range(len(s) - 1):
			a = 0
			if s[i] == 'O' and s[i + 1] == 'O':
				str += s[:i] + '+' + '+' + s[i + 2:] + '\n'
				flag = 1
				a = 1
				break
		if a == 0:
			str += s + '\n'
	else:
		str += s + '\n'
if flag == 0:
	print('NO')
else:
	print('YES')
	print(str)


n = int(input())
boo = True
nl = []
for i in range(n):
	li = input().split('|')
	if boo:
		if 'OO' in li:
			if li[0] == 'OO':
				li[0] = '++'
				boo = False
			else:
				li[1] = '++'
				boo = False
	nl.append('|'.join(li))
print('YES' if boo == False else 'NO')
if boo == False:
	for i in nl:
		print(i)


n = int(input())
s = ''
for i in range(n):
	s += input() + '\n'
e = -1
for j in range(0, len(s), 3):
	if e == -1 and s[j] == 'O' and (s[j] == s[j + 1]):
		e = j
if e == -1:
	print('NO')
else:
	print('YES')
	print(s[:e] + '++' + s[e + 2:])


n = int(input())
list3 = []
for i in range(n):
	(x, y) = map(str, input().split('|'))
	list3.extend([x, y])
if 'OO' in list3:
	print('YES')
	k = list3.index('OO')
	list3[k] = '++'
	p = 0
	for j in range(n):
		m = list3[p] + '|' + list3[p + 1]
		p = p + 2
		print(m)
else:
	print('NO')


n = int(input())
i = n
l = list()
flag = 0
while i:
	s = input()
	l.append(s)
	i -= 1
for i in range(n):
	if l[i][0] == 'O' and l[i][1] == 'O':
		l[i] = l[i].replace('OO', '++', 1)
		flag = 1
		break
	if l[i][3] == 'O' and l[i][4] == 'O':
		l[i] = l[i].replace('OO', '++', 1)
		flag = 1
		break
if flag == 1:
	print('YES')
	for i in range(n):
		print(l[i])
else:
	print('NO')


class Main:
	n = int(input())
	seats = []
	for i in range(n):
		seats.append(input())
	for seat in seats:
		if 'OO' in seat:
			print('YES')
			seats[seats.index(seat)] = seat.replace('OO', '++', 1)
			print(*seats, sep='\n')
			break
	else:
		print('NO')
Main()


t = int(input())
lt = []
isp = 0
for i in range(t):
	st = list(input())
	if isp == 0 and st[0] == 'O' and (st[1] == 'O'):
		isp = 1
		st[0] = '+'
		st[1] = '+'
	if isp == 0 and st[3] == 'O' and (st[4] == 'O'):
		isp = 1
		st[3] = '+'
		st[4] = '+'
	lt.append(st)
if isp:
	print('YES')
	for st in lt:
		print(''.join(st))
else:
	print('NO')


a = int(input())
h = []
count = 0
count1 = 0
for i in range(a):
	count1 += 1
	b = input()
	c = b[:2]
	s = b[3:]
	if c[0] == 'O' and c[1] == 'O':
		f = b.replace('O', '+', 2)
		h.append(f)
		count += 1
		break
	elif s[0] == 'O' and s[1] == 'O':
		r = s.replace('O', '+')
		f = b[0] + b[1] + b[2] + r
		h.append(f)
		count += 1
		break
	else:
		h.append(b)
if count == 1:
	for i in range(a - count1):
		b = input()
		h.append(b)
if count == 1:
	print('YES')
	for i in h:
		print(i)
elif count == 0:
	print('NO')


import sys
n = int(input())
seats = [''] * n
ans = 'NO'
for i in range(n):
	seats[i] = sys.stdin.readline().strip()
	if ans == 'NO':
		(a, b) = seats[i].split('|')
		if a == 'OO':
			ans = 'YES'
			seats[i] = '++' + seats[i][2:]
		elif b == 'OO':
			ans = 'YES'
			seats[i] = seats[i][:3] + '++'
print(ans)
if ans == 'YES':
	for i in range(n):
		print(seats[i])


x = int(input())
f = 0
ylist = []
for i in range(0, x, 1):
	y = list(input())
	for j in range(0, len(y) - 1, 1):
		if y[j] == 'O' and y[j + 1] == 'O' and (f == 0):
			y[j] = '+'
			y[j + 1] = '+'
			f = 1
	ylist.append(y)
if f > 0:
	print('YES')
	for i in range(0, x, 1):
		print(''.join(ylist[i]))
elif len(ylist) == x:
	print('NO')


inp = input
li = list
iinp = lambda : int(inp())
ent = lambda : map(int, inp().split())
lient = lambda : li(ent())
n = iinp()
res = []
ban = False
for _ in range(n):
	fila = inp()
	if fila[0] == fila[1] == 'O' and (not ban):
		ban = True
		fila = '++' + fila[2:]
	elif fila[3] == fila[4] == 'O' and (not ban):
		ban = True
		fila = fila[:3] + '++'
	res.append(fila)
if ban:
	print('YES')
	for i in res:
		print(i)
else:
	print('NO')


i = int(input())
rep = 1
rows = []
for r in range(i):
	rows.append(input().split('|'))
	if rep == 1 and rows[-1][0] == 'OO':
		rows[-1][0] = '++'
		rep = 0
	if rep == 1 and rows[-1][1] == 'OO':
		rows[-1][1] = '++'
		rep = 0
if rep == 1:
	print('NO')
else:
	print('YES')
	for r in rows:
		print('|'.join(r))


n = int(input())
b = 0
c = ''
f = ''
for i in range(n):
	a = input()
	c = c + a
x = 0
for i in range(len(c) // 5):
	if c[x:x + 2] == 'OO' and b <= 0:
		d = c[x:x + 5]
		d = d.replace('O', '+', 2)
		b = b + 1
		x = x + 5
		f = f + d
	elif c[x + 3:x + 5] == 'OO' and b <= 0:
		d = c[x:x + 5]
		d = d[::-1]
		d = d.replace('O', '+', 2)
		d = d[::-1]
		b = b + 1
		x = x + 5
		f = f + d
	else:
		f = f + c[x:x + 5]
		x = x + 5
if '++' in f:
	print('YES')
	z = 0
	for i in range(len(f) // 5):
		g = f[z:z + 5]
		print(g)
		z = z + 5
else:
	print('NO')


s1 = '\n'.join([input() for _ in range(int(input()))])
s2 = s1.replace('OO', '++', 1)
print('Yes\n' + s2 if s1 != s2 else 'No')