#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef pair<int,int> pint;

#define DE 1
#define FI first
#define SE second
#define PB push_back
#define MP make_pair
#define ALL(s) (s).begin(),(s).end()
#define REP(i,n) for (int i = 0; i < (int)(n); ++i)
#define EACH(i,s) for (typeof((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<<endl

template<class T1, class T2> ostream& operator<<(ostream &s, pair<T1,T2> P){return s<<'<'<<P.first<<", "<<P.second<<'>';}
template<class T> ostream& operator<<(ostream &s, vector<T> P) {s<<"{ ";for(int i=0;i<P.size();++i){if(i>0)s<<", ";s<<P[i];}return s<<" }"<<endl;}
template<class T1, class T2> ostream& operator<<(ostream &s, map<T1,T2> P) {s<<"{ ";for(typeof(P.begin()) it=P.begin();it!=P.end();++it){if(it!=P.begin())s<<", ";s<<'<'<<it->first<<"->"<<it->second<<'>';}return s<<" }"<<endl;}



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

int main() {
    //freopen( "/Users/macuser/Documents/Programming/Contest/input.in", "r", stdin );
    
    vector<string> board(8, "........");
    for (int i = 0; i < 8; ++i) {
        cin >> board[i];
    }
        
    int par = 0, pass = 0;;
    while (true) {
        
        
//        for (int i = 0; i < 8; ++i) {
//            cout << board[i] << endl;
//        }
            
        // par0 : ○、上、左
        if (par == 0) {
            int Max = 0, mx = -1, my = -1;
            vector<string> mb;
            for (int i = 0; i < 8; ++i) {
                for (int j = 0; j < 8; ++j) {
                    int con = 0;
                    vector<string> temp = board;
                    
                    if (temp[i][j] != '.') continue;
                    else temp[i][j] = 'o';
                    
                    for (int k = 0; k < 8; ++k) {
                        int ni = i, nj = j;
                        int tcon = 0; bool ok = true;
                        vector<string> ttemp = temp;
                        
                        while (true) {
                            ni += dx[k]; nj += dy[k];
                            if (ni < 0 || ni >= 8 || nj < 0 || nj >= 8) {
                                ok = false;
                                break;
                            }
                            if (temp[ni][nj] == 'x') {
                                ++tcon;
                                ttemp[ni][nj] = 'o';
                            }
                            else if (temp[ni][nj] == 'o') {
                                break;
                            }
                            else if (temp[ni][nj] == '.') {
                                ok = false;
                                break;
                            }
                        }
                        if (ok) {
                            con += tcon;
                            temp = ttemp;
                        }
                    }
                    
                    if (Max < con) {
                        Max = con;
                        mx = i;
                        my = j;
                        mb = temp;
                    }
                }
            }
            
            if (Max == 0) {
                ++pass;
                if (pass == 2) break;
            }
            else {
                pass = 0;
                board = mb;
            }
            par = 1;
        }
        
        // par1 : x、下、右
        else if (par == 1) {
            int Max = 0, mx = -1, my = -1;
            vector<string> mb;
            for (int i = 7; i >= 0; --i) {
                for (int j = 7; j >= 0; --j) {
                    int con = 0;
                    vector<string> temp = board;
                    
                    if (temp[i][j] != '.') continue;
                    else temp[i][j] = 'x';
                    
                    for (int k = 0; k < 8; ++k) {
                        int ni = i, nj = j;
                        int tcon = 0; bool ok = true;
                        vector<string> ttemp = temp;
                        
                        while (true) {
                            ni += dx[k]; nj += dy[k];
                            if (ni < 0 || ni >= 8 || nj < 0 || nj >= 8) {
                                ok = false;
                                break;
                            }
                            if (temp[ni][nj] == 'o') {
                                ++tcon;
                                ttemp[ni][nj] = 'x';
                            }
                            else if (temp[ni][nj] == 'x') {
                                break;
                            }
                            else if (temp[ni][nj] == '.') {
                                ok = false;
                                break;
                            }
                        }
                        if (ok) {
                            con += tcon;
                            temp = ttemp;
                        }
                    }
                    
                    if (Max < con) {
                        Max = con;
                        mx = i;
                        my = j;
                        mb = temp;
                    }
                }
            }
            
            if (Max == 0) {
                ++pass;
                if (pass == 2) break;
            }
            else {
                pass = 0;
                board = mb;
            }
            par = 0;
        }
        
    }
    
    for (int i = 0; i < 8; ++i) {
        cout << board[i] << endl;
    }
    
    return 0;
}


Measured memory_bytes: 1196