#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>
#include <assert.h>


using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)







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

pair<ll, ll> best_pos_mami(vector<string> &s){
    pair<ll, ll> res = {-1, -1};
    ll maxx = 0;
    
    REP(i, 8){
        REP(j, 8){
            if(s[i][j] != '.') continue;
            ll sum = 0;
            REP(k, 8){
                ll y = i + dy[k], x = j + dx[k], cnt = 0;
                while(y >= 0 && y < 8 && x >= 0 && x < 8 && s[y][x] != '.' && s[y][x] != 'o'){
                    cnt++;
                    y += dy[k];
                    x += dx[k];
                }
                if(y >= 0 && y < 8 && x >= 0 && x < 8 && s[y][x] == 'o'){
                    sum += cnt;
                }
            }
            if(maxx < sum){
                maxx = sum;
                res = {i, j};
            }
        }
    }
    
    return res;
}

pair<ll, ll> best_pos_witch(vector<string> &s){
    pair<ll, ll> res = {-1, -1};
    ll maxx = 0;
    
    for(ll i = 7; i >= 0; i--){
        for(ll j = 7; j >= 0; j--){
            if(s[i][j] != '.') continue;
            ll sum = 0;
            REP(k, 8){
                ll y = i + dy[k], x = j + dx[k], cnt = 0;
                while(y >= 0 && y < 8 && x >= 0 && x < 8 && s[y][x] != '.' && s[y][x] != 'x'){
                    cnt++;
                    y += dy[k];
                    x += dx[k];
                }
                if(y >= 0 && y < 8 && x >= 0 && x < 8 && s[y][x] == 'x'){
                    sum += cnt;
                }
            }
            if(maxx < sum){
                maxx = sum;
                res = {i, j};
            }
        }
    }
    
    return res;
}

void return_cookie(vector<string> &s, pair<ll, ll> p, char c){
    ll i = p.first, j = p.second;
    s[i][j] = c;
    
    REP(k, 8){
        ll y = i + dy[k], x = j + dx[k];
        while(y >= 0 && y < 8 && x >= 0 && x < 8 && s[y][x] != '.' && s[y][x] != s[i][j]){
            y += dy[k];
            x += dx[k];
        }
        if(y >= 0 && y < 8 && x >= 0 && x < 8 && s[y][x] == s[i][j]){
            ll yy = i + dy[k], xx = j + dx[k];
            while(yy >= 0 && yy < 8 && xx >= 0 && xx < 8 && s[yy][xx] != '.' && s[yy][xx] != s[i][j]){
                s[yy][xx] = s[i][j];
                yy += dy[k];
                xx += dx[k];
            }
        }
    }
}


int main(){
    vector<string> s(8);
    REP(i, 8){
        cin >> s[i];
    }
    
    bool ok = true;
    while(ok){
        ok = false;
        
        auto res = best_pos_mami(s);
        if(res.first != -1){
            ok = true;
            return_cookie(s, res, 'o');
        }
        
        res = best_pos_witch(s);
        if(res.first != -1){
            ok = true;
            return_cookie(s, res, 'x');
        }
    }
    
    REP(i, 8){
        cout << s[i] << endl;
    }
}


Measured memory_bytes: 3224