#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <string>
#include <cmath>
using namespace std;
#define MOD 998244353
#define INF 1<<30
#define LINF (ll)1<<62
#define MAX 510000
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(ll i=(a); i<(b); i++)
#define all(x) (x).begin(),(x).end()
#define uni(q) unique(all(q)),q.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> P;
typedef vector<pair<ll, ll>> vpl;
const int mod = 1e9 + 7;

char s[8][8];
ll num[8][8];
ll dy[8] = {1,0,-1,0,1,-1,1,-1};
ll dx[8] = {0,1,0,-1,1,-1,-1,1};
bool direc[8][8][8]; //y,x,direction

bool in(ll y, ll x){
    return 0<=y && y<8 && 0<=x && x<8;
}


int main(){
    rep(i,8) rep(j,8) cin >> s[i][j];
    while(1){
        bool put = false;
        ll mx = 0;
        bool flag = false;
        rep(i,8) rep(j,8) num[i][j] = 0;
        rep(i,8){
            rep(j,8){
                if(s[i][j] != '.') continue;
                ll cnt = 0;
                rep(k,8){
                    ll ny = i + dy[k];
                    ll nx = j + dx[k];
                    if(!in(ny,nx)) continue;
                    ll kcnt = 0;
                    while(1){
                        if(!in(ny,nx)){
                            kcnt = 0;
                            direc[i][j][k] = false;
                            break;
                        }
                        if(s[ny][nx]=='x'){
                            direc[i][j][k] = true;
                            kcnt++;
                            ny += dy[k];
                            nx += dx[k];
                        }else if(s[ny][nx]=='.'){
                            kcnt = 0;
                            direc[i][j][k] = false;
                            break;
                        }else{
                            break;
                        }
                    }
                    cnt += kcnt;
                }
                num[i][j] = max(num[i][j], cnt);
                mx = max(num[i][j],mx);
            }
        }
        if(mx!=0){
            put = true;
            rep(i,8){
                rep(j,8){
                    if(num[i][j]==mx){
                        rep(k,8){
                            if(direc[i][j][k]){
                                s[i][j] = 'o';
                                ll ny = i + dy[k];
                                ll nx = j + dx[k];
                                while(s[ny][nx]=='x'){
                                    s[ny][nx] = 'o';
                                    ny += dy[k];
                                    nx += dx[k];
                                }
                            }
                        }
                        flag = true;
                        break;
                    }
                }
                if(flag) break;
            }
        }
        rep(i,8) rep(j,8) num[i][j] = 0;
        rep(i,8) rep(j,8) rep(k,8) direc[i][j][k] = false;
        mx = 0;
        for(ll i=7; i>=0; i--){
            for(ll j=7; j>=0; j--){
                if(s[i][j] != '.') continue;
                ll cnt = 0;
                rep(k,8){
                    ll ny = i + dy[k];
                    ll nx = j + dx[k];
                    if(!in(ny,nx)) continue;
                    ll kcnt = 0;
                    while(1){
                        if(!in(ny,nx)){
                            kcnt = 0;
                            direc[i][j][k] = false;
                            break;
                        }
                        if(s[ny][nx]=='o'){
                            direc[i][j][k] = true;
                            kcnt++;
                            ny += dy[k];
                            nx += dx[k];
                        }else if(s[ny][nx]=='.'){
                            kcnt = 0;
                            direc[i][j][k] = false;
                            break;
                        }else{
                            break;
                        }
                    }
                    cnt += kcnt;
                }
                num[i][j] = max(num[i][j], cnt);
                mx = max(num[i][j],mx);
            }
        }
        flag = false;
        if(mx!=0){
            put = true;
            for(ll i=7; i>=0; i--){
                for(ll j=7; j>=0; j--){
                    if(mx==num[i][j]){
                        rep(k,8){
                            if(direc[i][j][k]){
                                s[i][j] = 'x';
                                ll ny = i + dy[k];
                                ll nx = j + dx[k];
                                while(s[ny][nx]=='o'){
                                    s[ny][nx] = 'x';
                                    ny += dy[k];
                                    nx += dx[k];
                                }
                            }
                        }
                        flag = true;
                        break;
                    }
                }
                if(flag) break;
            }
        }
        if(!put) break;
        rep(i,8) rep(j,8) rep(k,8) direc[i][j][k] = false;
    }
    rep(i,8){
        rep(j,8) cout << s[i][j];
        cout << endl;
    }
}



Measured memory_bytes: 3116