#include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define bFOR(i,n1,n2) for(ll i=n1;i>=n2;i--)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef long long int ll;
typedef pair<ll,ll> Pi;
typedef tuple<ll,ll,ll> Tu;
const int INF=(ll)(1LL<<30)-1;
const double INFd=100000000000.0;
const double PI=3.14151926535;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
const ll tMOD=(ll)998244353;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
int dx[4]={0,-1,0,1},dy[4]={-1,0,1,0};
int mdx[8]={0,1,0,-1,1,1,-1,-1},mdy[8]={-1,0,1,0,1,-1,1,-1};


template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

char s[8][8];
char reverse_coo(char c){
    if(c=='o')return 'x';
    if(c=='x')return 'o';
}
int count_check(char c,int ly,int lx){
    if(s[ly][lx]!='.')return 0;
    int co=0;
    REP(i,8){
        if(!(ly+mdy[i]>=0&&8>ly+mdy[i]&&lx+mdx[i]>=0&&8>lx+mdx[i])){
            continue;
        }else if(s[ly+mdy[i]][lx+mdx[i]]!=reverse_coo(c)){
            continue;
        }
        int ty=ly+mdy[i],tx=lx+mdx[i];
        int ddx=0;
        while(ty>=0&&8>ty&&tx>=0&&8>tx&&s[ty][tx]==reverse_coo(c)){
            ty+=mdy[i],tx+=mdx[i];
            ddx++;
        }
        if(!(ty>=0&&8>ty&&tx>=0&&8>tx)){}
        else if(s[ty][tx]==c)co+=ddx;
        
    }
    return co;
}
void change_check(char c,int ly,int lx){
    int co=0;
    REP(i,8){
        if(!(ly+mdy[i]>=0&&8>ly+mdy[i]&&lx+mdx[i]>=0&&8>lx+mdx[i])){
            continue;
        }else if(s[ly+mdy[i]][lx+mdx[i]]!=reverse_coo(c)){
            continue;
        }
        int ty=ly+mdy[i],tx=lx+mdx[i];
        int ddx=0;
        while(ty>=0&&8>ty&&tx>=0&&8>tx&&s[ty][tx]==reverse_coo(c)){
            ty+=mdy[i],tx+=mdx[i];
            ddx++;
        }
        if(!(ty>=0&&8>ty&&tx>=0&&8>tx)){}
        else if(s[ty][tx]==c){
            ty=ly+mdy[i],tx=lx+mdx[i];
            while(ty>=0&&8>ty&&tx>=0&&8>tx&&s[ty][tx]==reverse_coo(c)){
                s[ty][tx]=c;
                ty+=mdy[i],tx+=mdx[i];
        }
        }
        
    }
    s[ly][lx]=c;
}
int main(){
    REP(i,8)REP(j,8)cin>>s[i][j];
    char turn='o';
    int check_finish=1;
    while(check_finish){
        check_finish=0;
        int lly=-1,llx=-1;
        int cou=0;
        turn='o';
        REP(i,8){
            REP(j,8){
                if(cou<count_check(turn,i,j)){
                    lly=i,llx=j,cou=count_check(turn,i,j);
                }
            }
        }
        if(cou!=0){
            change_check(turn,lly,llx);
            check_finish=1;
        }
        lly=-1,llx=-1;
        cou=0;
        turn='x';
        for(int i=7;i>=0;i--){
            for(int j=7;j>=0;j--){
                if(cou<count_check(turn,i,j)){
                    lly=i,llx=j,cou=count_check(turn,i,j);
                }
            }
        }
        if(cou!=0){
            change_check(turn,lly,llx);
            check_finish=1;
        }
    }

    
    REP(i,8){
        REP(j,8){
            cout<<s[i][j];
        }
        cout<<endl;
    }
    return 0;
}


Measured memory_bytes: 3112