#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
//#include <utility>
#include <set>
#include <iostream>
//#include <memory>
#include <string>
#include <vector>
#include <algorithm>
//#include <functional>
#include <sstream>
//#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
//#include <cctype>
#include <cstring>
//#include <ctime>
#include <iterator>
#include <bitset>
//#include <numeric>
//#include <list>
//#include <iomanip>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <unordered_set>
#include <unordered_map>
#include <forward_list>

#define cauto const auto&
#else

#endif

using namespace std;


namespace{
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}


#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()


#define MOD 1000000007LL
#define EPS 1e-8
static const int INF=1<<24;
vvint vv;
int dd1[]={0,1,0,-1,0};
int dd2[]={1,-1,-1,1,1};
int foo(int a,int b,int c){
	int ret=0;
	rep(i,4){
		int aa=a+dd1[i];
		int bb=b+dd1[i+1];
		int tt=0;
		while(0<=aa&&aa<8&&0<=bb&&bb<8){
			if(vv[aa][bb]==c){
				ret+=tt;
				break;
			}
			if(vv[aa][bb]==-1) break;
			aa+=dd1[i];
			bb+=dd1[i+1];
			tt++;
		}
	}
	rep(i,4){
		int aa=a+dd2[i];
		int bb=b+dd2[i+1];
		int tt=0;
		while(0<=aa&&aa<8&&0<=bb&&bb<8){
			if(vv[aa][bb]==c){
				ret+=tt;
				break;
			}
			if(vv[aa][bb]==-1) break;
			aa+=dd2[i];
			bb+=dd2[i+1];
			tt++;
		}
	}
	return ret;
}
void foo2(int a,int b,int c){
	// cout<<"hoge\n";
	vv[a][b]=c;
	rep(i,4){
		int aa=a+dd1[i];
		int bb=b+dd1[i+1];
		int tt=0;
		while(0<=aa&&aa<8&&0<=bb&&bb<8){
			if(vv[aa][bb]==c){
				int a1=a+dd1[i];
				int b1=b+dd1[i+1];
				rep(j,tt){
					vv[a1][b1]=c;
					a1+=dd1[i];
					b1+=dd1[i+1];
				}
				break;
			}
			if(vv[aa][bb]==-1) break;
			aa+=dd1[i];
			bb+=dd1[i+1];
			tt++;
		}
	}
	rep(i,4){
		int aa=a+dd2[i];
		int bb=b+dd2[i+1];
		int tt=0;
		while(0<=aa&&aa<8&&0<=bb&&bb<8){
			if(vv[aa][bb]==c){
				int a1=a+dd2[i];
				int b1=b+dd2[i+1];
				rep(j,tt){
					vv[a1][b1]=c;
					a1+=dd2[i];
					b1+=dd2[i+1];
				}
				break;
			}
			if(vv[aa][bb]==-1) break;
			aa+=dd2[i];
			bb+=dd2[i+1];
			tt++;
		}
	}
}
void disp(){
	cout<<"disp\n";
	rep(i,8){
		rep(j,8){
			if(vv[i][j]==0) cout<<"o";
			else if(vv[i][j]==1) cout<<"x";
			else cout<<".";
		}
		cout<<endl;
	}
	cout<<endl;
}
void mainmain(){
	vector<string> s(8);
	rep(i,8) cin>>s[i];
	initvv(vv,8,8);
	rep(i,8) rep(j,8){
		if(s[i][j]=='o') vv[i][j]=0;
		else if(s[i][j]=='x') vv[i][j]=1;
		else vv[i][j]=-1;
	}
	// rep(i,8) cout<<s[i]<<endl;
	// cout<<endl;
	int update=1;
	while(update){
		update=0;
		vvint tmp;
		initvv(tmp,8,8,-1);
		rep(i,8){
			rep(j,8){
				if(vv[i][j]==-1) tmp[i][j]=foo(i,j,0);
			}
		}
		int M=-1;
		bool f=false;
		rep(i,8) rep(j,8) M=max(M,tmp[i][j]);
		// cout<<"M = "<<M<<endl;
		if(M>=1) rep(i,8){
			rep(j,8){
				if(M==tmp[i][j]){
					foo2(i,j,0);
					update=1;
					f=true;
					break;
				}
			}
			if(f) break;
		}
		// disp();
		initvv(tmp,8,8,-1);
		rep(i,8){
			rep(j,8){
				if(vv[i][j]==-1) tmp[i][j]=foo(i,j,1);
			}
		}
		M=-1;
		rep(i,8) rep(j,8) M=max(M,tmp[i][j]);
		if(M>=1){
			int x=-1,y=-1;
			rep(i,8){
				rep(j,8){
					if(M==tmp[i][j]){
						x=i;
						y=j;
					}
				}
			}
			update=1;
			foo2(x,y,1);
		}
		// disp();
	}
	rep(i,8){
		rep(j,8){
			if(vv[i][j]==0) cout<<"o";
			else if(vv[i][j]==1) cout<<"x";
			else cout<<".";
		}
		cout<<endl;
	}
}



}
main() try{
    mainmain();
}
catch(...){
}

Measured memory_bytes: 1204