#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <map>
#include <set>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <vector>
#include <algorithm>
#include <functional>
#include <cstring>
#include <string>
#include <sstream>
#include <bitset>
using namespace std;
#define INF	100000000
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define lb lower_bound
#define ub upper_bound
#define SS stringstream
#define rep(i,n) for(int i = 0; i < n; i++)
#define SORT(x) sort((x).begin(), (x).end())
#define clr(a,b) memset((a),(b),sizeof(a))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<int> Vi;
typedef vector<ll> Vll;
typedef vector<P> Vp;
typedef priority_queue<P, vector<P>, greater<P> > PQ;

int dx[8] = {1,1,1,-1,-1,-1,0,0}, dy[8] = {1,0,-1,1,0,-1,1,-1};

int main(){
	char cell[8][8];
	rep(i,8) rep(j,8) cin >> cell[i][j];
	bool pass = false;
	for(int u = 0;; u++){
		if(u%2 == 0){
			P put;
			int num = 0;
			rep(i,8) rep(j,8){
				if(cell[i][j] != '.') continue;
				int sum = 0;
				rep(k,8){
					int cnt = 0;
					int y = i, x = j;
					while(true){
						y += dy[k];
						x += dx[k];
						if(0>y||y>=8||0>x||x>=8||cell[y][x] == '.'){
							cnt = 0;
							break;
						}
						if(cell[y][x] == 'o'){
							break;
						}
						if(cell[y][x] == 'x') cnt++;
					}
					sum += cnt;
				}
				if(sum > num){
					put.fi = i;
					put.sec = j;
					num = sum;
				}
			}
			if(num == 0){
				if(pass) break;
				else pass = true;
			} else{
				pass = false;
				cell[put.fi][put.sec] = 'o';
				rep(k,8){
					int cnt = 0;
					int y = put.fi, x = put.sec;
					while(true){
						y += dy[k];
						x += dx[k];
						if(0>y||y>=8||0>x||x>=8||cell[y][x] == '.'){
							cnt = 0;
							break;
						}
						if(cell[y][x] == 'o'){
							for(int l = 1; l <= cnt; l++){
								y -= dy[k]; x -= dx[k];
								cell[y][x] = 'o';
							}
							break;
						}
						if(cell[y][x] == 'x') cnt++;
					}
				}
			}
		} else{
			P put;
			int num = 0;
			for(int i = 7; i >= 0; i--) for(int j = 7; j >= 0; j--){
				if(cell[i][j] != '.') continue;
				int sum = 0;
				rep(k,8){
					int cnt = 0;
					int y = i, x = j;
					while(true){
						y += dy[k];
						x += dx[k];
						if(0>y||y>=8||0>x||x>=8||cell[y][x] == '.'){
							cnt = 0;
							break;
						}
						if(cell[y][x] == 'x'){
							break;
						}
						if(cell[y][x] == 'o') cnt++;
					}
					sum += cnt;
				}
				if(sum > num){
					put.fi = i;
					put.sec = j;
					num = sum;
				}
			}
			if(num == 0){
				if(pass) break;
				else pass = true;
			} else{
				pass = false;
				cell[put.fi][put.sec] = 'x';
				rep(k,8){
					int cnt = 0;
					int y = put.fi, x = put.sec;
					while(true){
						y += dy[k];
						x += dx[k];
						if(0>y||y>=8||0>x||x>=8||cell[y][x] == '.'){
							cnt = 0;
							break;
						}
						if(cell[y][x] == 'x'){
							for(int l = 1; l <= cnt; l++){
								y -= dy[k]; x -= dx[k];
								cell[y][x] = 'x';
							}
							break;
						}
						if(cell[y][x] == 'o') cnt++;
					}
				}
			}
		}
	}
	rep(i,8){
		rep(j,8){
			cout << cell[i][j];
		}
		cout << endl;
	}
}

Measured memory_bytes: 1136