#include <bits/stdc++.h>
const long long MOD = 1000000007;
const long long INF = MOD + 1;
const long double PI = 3.1415926;
#define FOR(i, r, n) for(int i=(ll)(r); i<(ll)(n); i++) 
#define REP(i, n) FOR(i, (0), n)
#define ALL(r) r.begin(), r.end()
#define ll long long int
using namespace std;
string s;
vector<ll> v;
vector<pair<ll, ll>> vp;
vector<vector<ll>> vv(110, vector<ll>(110, INF));
vector<tuple<ll, ll, ll>> vt;
set<ll> st;
map<char, ll> mp;

vector<string> vs;

int solve(bool ismami)
{
	int x, y, dir, tmp, point = 0, px = -1, py = -1, pdir = -1;
	map<pair<int, int>, int> mdir;
	REP(i, 8)
		REP(j, 8)
	{
		if (vs[i][j] == '.')
		{
			dir = 9;
			int cnt = 0;
			while (dir--) {
				tmp = 0;
				if (!dir) break;
				x = i; y = j;
				if (dir == 8)
				{
					x--; y--;
				}
				else if (dir == 7) y--;
				else if (dir == 6)
				{
					x++; y--;
				}
				else if (dir == 5) x++;
				else if (dir == 4)
				{
					x++; y++;
				}
				else if (dir == 3) y++;
				else if (dir == 2)
				{
					x--; y++;
				}
				else if (dir == 1) x--;
				while (x > -1 && y > -1 && x < 8 && y < 8)
				{
					if (ismami) {
						if (vs[x][y] == 'x') tmp++;
						else if (vs[x][y] == '.') break;
						else if (vs[x][y] == 'o') {
							if (tmp) {
								cnt += tmp;
							}
							break;
						}
					}
					else
					{
						if (vs[x][y] == 'o') tmp++;
						else if (vs[x][y] == '.') break;
						else if (vs[x][y] == 'x') {
							if (tmp) {
								cnt += tmp;
							}
							break;
						}
					}
					if (dir == 8)
					{
						x--; y--;
					}
					else if (dir == 7) y--;
					else if (dir == 6)
					{
						x++; y--;
					}
					else if (dir == 5) x++;
					else if (dir == 4)
					{
						x++; y++;
					}
					else if (dir == 3) y++;
					else if (dir == 2)
					{
						x--; y++;
					}
					else if (dir == 1) x--;
				}
			}
			if (point < cnt&&ismami)
			{
				px = i;
				py = j;
				point = cnt;
			}
			else if (point <= cnt && !ismami) {
				px = i;
				py = j;
				point = cnt;
			}
		}
	}
	if (!point) return 1;
	else {
		x = px, y = py;
		if (ismami) {
			vs[x][y] = 'o';
		}
		else
		{
			vs[x][y] = 'x';
		}
		dir = 9;
		while (dir--) {
			if (!dir) break;
			int step = 0;
			x = px, y = py;
			if (dir == 8)
			{
				x--; y--;
			}
			else if (dir == 7) y--;
			else if (dir == 6)
			{
				x++; y--;
			}
			else if (dir == 5) x++;
			else if (dir == 4)
			{
				x++; y++;
			}
			else if (dir == 3) y++;
			else if (dir == 2)
			{
				x--; y++;
			}
			else if (dir == 1) x--;
			while (x > -1 && y > -1 && x < 8 && y < 8)
			{
				if (ismami) {
					if (vs[x][y] == 'x') step++;
					else if (vs[x][y] == '.') break;
					else if (vs[x][y] == 'o') {
						if(step)
						{
							REP(i,step)
							{
								if (dir == 8)
								{
									x++; y++;
								}
								else if (dir == 7) y++;
								else if (dir == 6)
								{
									x--; y++;
								}
								else if (dir == 5) x--;
								else if (dir == 4)
								{
									x--; y--;
								}
								else if (dir == 3) y--;
								else if (dir == 2)
								{
									x++; y--;
								}
								else if (dir == 1) x++;
								vs[x][y] = 'o';
							}
						}
						break;
					}
				}
				else
				{
					if (vs[x][y] == 'o') step++;
					else if (vs[x][y] == '.') break;
					else if (vs[x][y] == 'x') {
						if (step)
						{
							REP(i, step)
							{
								if (dir == 8)
								{
									x++; y++;
								}
								else if (dir == 7) y++;
								else if (dir == 6)
								{
									x--; y++;
								}
								else if (dir == 5) x--;
								else if (dir == 4)
								{
									x--; y--;
								}
								else if (dir == 3) y--;
								else if (dir == 2)
								{
									x++; y--;
								}
								else if (dir == 1) x++;
								vs[x][y] = 'x';
							}
						}
						break;
					}
				}
				if (dir == 8)
				{
					x--; y--;
				}
				else if (dir == 7) y--;
				else if (dir == 6)
				{
					x++; y--;
				}
				else if (dir == 5) x++;
				else if (dir == 4)
				{
					x++; y++;
				}
				else if (dir == 3) y++;
				else if (dir == 2)
				{
					x--; y++;
				}
				else if (dir == 1) x--;
			}
		}
	}
	return 0;
}

int main()
{
	vs.resize(8);
	REP(i, 8) cin >> vs[i];
	int cnt = 0;
	while (cnt < 2)
	{
		cnt = 0;
		cnt += solve(true);
		cnt += solve(false);
	}
	REP(i, 8) cout << vs[i] << endl;
}

Measured memory_bytes: 3292