#include <bits/stdc++.h>
#define pq priority_queue
using namespace std; typedef pair<int, int> P; typedef pair<int, P> P2;
typedef pair<int, P2> P3; typedef long long ll; typedef long double ld;
constexpr long long gcd(long long a, long long b){return b ? gcd(b, a % b) : a;}
constexpr long long lcm(long long a, long long b){return a / gcd(a, b) * b;}
constexpr int INF = 1e9, MOD = INF + 7, around[] = {0, 1, 1, -1, -1, 0, -1, 1, 0, 0};
constexpr int mod_pow(long long x, long long n, const int mod){long long ret=1;while(n){if(n&1)(ret*=x)%=mod;(x*=x)%=mod;n>>=1;}return ret;}
template<int n> struct Prime{bool arr[n+1];constexpr bool operator[](int k){return arr[k];}constexpr Prime():arr(){for(int i=2;i<n;i++){arr[i]=true;for(int j=2;j*j<=i;j++){if(!(i%j))arr[i]=false;}}}};
template<int n> struct Factorial{long long arr[n+1],ary[n+1];constexpr Factorial():arr(),ary(){arr[0]=1;ary[0]=1;for(int i=0;i<n;i++){arr[i+1]=arr[i]*(i+1)%MOD;ary[i+1]=mod_pow(arr[i+1],MOD-2,MOD);}}};
constexpr Factorial<10> fact; constexpr Prime<10> prime;
constexpr int comb(int a, int b){long long pos = fact.arr[a], pot = fact.ary[a - b], por = fact.ary[b];return pos * pot % MOD * por % MOD;}
template<int n> struct Bernoulli{long long arr[n+1];constexpr Bernoulli():arr(){arr[0]=1;for(int i=1;i<=n;i++){long long sum=0;for(int j=0;j<i;j++){(sum+=comb(i+1,j)*arr[j]%MOD)%=MOD;}arr[i]=(MOD-mod_pow(i+1,MOD-2,MOD))%MOD*sum%MOD;}}};
constexpr int vx[] = {1, 0, -1, 0}, vy[] = {0, 1, 0, -1};
constexpr int sqrtN = 512, logN = 32;
constexpr ld PI = abs(acos(-1));
constexpr ll LINF=1e18;

string s[8];

int count(int x, int y, char z){
	if(s[x][y] != '.') return -1;
	
	int c = 0;
	for(int i = 1; x - i >= 0; i++){
		if(s[x - i][y] == '.') break;
		if(s[x - i][y] == z){
			c += i - 1;
			break;
		}
	}
	
	for(int i = 1; x + i < 8; i++){
		if(s[x + i][y] == '.') break;
		if(s[x + i][y] == z){
			c += i - 1;
			break;
		}
	}
	
	for(int i = 1; y - i >= 0; i++){
		if(s[x][y - i] == '.') break;
		if(s[x][y - i] == z){
			c += i - 1;
			break;
		}
	}
	
	for(int i = 1; y + i < 8; i++){
		if(s[x][y + i] == '.') break;
		if(s[x][y + i] == z){
			c += i - 1;
			break;
		}
	}
	
	for(int i = 1; i + x < 8 and i + y < 8; i++){
		if(s[i + x][i + y] == '.') break;
		if(s[i + x][i + y] == z){
			c += i - 1;
			break;
		}
	}
	
	for(int i = 1; x - i >= 0 and y - i >= 0; i++){
		if(s[x - i][y - i] == '.') break;
		if(s[x - i][y - i] == z){
			c += i - 1;
			break;
		}
	}
	
	for(int i = 1; x + i < 8 and y - i >= 0; i++){
		if(s[x + i][y - i] == '.') break;
		if(s[x + i][y - i] == z){
			c += i - 1;
			break;
		}
	}
	
	for(int i = 1; x - i >= 0 and y + i < 8; i++){
		if(s[x - i][y + i] == '.') break;
		if(s[x - i][y + i] == z){
			c += i - 1;
			break;
		}
	}
	
	return !c ? -1 : c;
}

void color(int x, int y, char z){
	bool f = false;
	
	for(int i = 1; x - i >= 0; i++){
		if(s[x - i][y] == '.') break;
		if(s[x - i][y] == z){f = true; break;}
	}
	
	if(f)
	for(int i = 1; x - i >= 0; i++){
		if(s[x - i][y] == z) break;
		s[x - i][y] = z;
	}
	
	f = false;
	for(int i = 1; x + i < 8; i++){
		if(s[x + i][y] == '.') break;
		if(s[x + i][y] == z){f = true; break;}
	}
	
	if(f)
	for(int i = 1; x + i < 8; i++){
		if(s[x + i][y] == z) break;
		s[x + i][y] = z;
	}
	
	f = false;
	for(int i = 1; y - i >= 0; i++){
		if(s[x][y - i] == '.') break;
		if(s[x][y - i] == z){f = true; break;}
	}
	
	if(f)
	for(int i = 1; y - i >= 0; i++){
		if(s[x][y - i] == z) break;
		s[x][y - i] = z;
	}
	
	f = false;
	for(int i = 1; y + i < 8; i++){
		if(s[x][y + i] == '.') break;
		if(s[x][y + i] == z){f = true; break;}
	}
	
	if(f)
	for(int i = 1; y + i < 8; i++){
		if(s[x][y + i] == z) break;
		s[x][y + i] = z;
	}
	
	f = false;
	for(int i = 1; i + x < 8 and i + y < 8; i++){
		if(s[i + x][i + y] == '.') break;
		if(s[i + x][i + y] == z){f = true; break;}
	}
	
	if(f)
	for(int i = 1; i + x < 8 and i + y < 8; i++){
		if(s[i + x][i + y] == z) break;
		s[i + x][i + y] = z;
	}
	
	f = false;
	for(int i = 1; x - i >= 0 and y - i >= 0; i++){
		if(s[x - i][y - i] == '.') break;
		if(s[x - i][y - i] == z){f = true; break;}
	}
	
	if(f)
	for(int i = 1; x - i >= 0 and y - i >= 0; i++){
		if(s[x - i][y - i] == z) break;
		s[x - i][y - i] = z;
	}
	
	f = false;
	for(int i = 1; x + i < 8 and y - i >= 0; i++){
		if(s[x + i][y - i] == '.') break;
		if(s[x + i][y - i] == z){f = true; break;}
	}
	
	if(f)
	for(int i = 1; x + i < 8 and y - i >= 0; i++){
		if(s[x + i][y - i] == z) break;
		s[x + i][y - i] = z;
	}
	
	f = false;
	for(int i = 1; x - i >= 0 and y + i < 8; i++){
		if(s[x - i][y + i] == '.') break;
		if(s[x - i][y + i] == z){f = true; break;}
	}
	
	if(f)
	for(int i = 1; x - i >= 0 and y + i < 8; i++){
		if(s[x - i][y + i] == z) break;
		s[x - i][y + i] = z;
	}
}
void solve(char x, char y){
	int ma = -1, ma2 = -1;
	for(int i = 0; i < 8; i++){
		for(int j = 0; j < 8; j++){
			if(s[i][j] != '.') continue;
			ma = max(ma, count(i, j, x));
			ma2 = max(ma2, count(i, j, y));
		}
	}
	
	if(ma == -1 and ma2 == -1) return;
	if(ma == -1){
		solve(y, x);
		return;
	}
	
	if(x == 'o'){
		for(int i = 0; i < 8; i++){
			for(int j = 0; j < 8; j++){
				if(s[i][j] != '.') continue;
				if(count(i, j, x) < ma) continue;
				s[i][j] = x;
				color(i, j, x);
				i = j = INF;
			}
		}
	}else if(x == 'x'){
		for(int i = 7; i >= 0; i--){
			for(int j = 7; j >= 0; j--){
				if(s[i][j] != '.') continue;
				if(count(i, j, x) < ma) continue;
				s[i][j] = x;
				color(i, j, x);
				i = j = -INF;
			}
		}
	}
	
	solve(y, x);
}

int main(){
	for(int i = 0; i < 8; i++) cin >> s[i];
	
	solve('o', 'x');
	for(int i = 0; i < 8; i++) cout << s[i] << endl;
	return 0;
}



Measured memory_bytes: 3244