#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)n; ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cout<<*i<<" "; cout<<endl; }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy[8] = {0, -1, -1, -1, 0, 1, 1, 1};

int main(){
  vector<string> grid(8);
  REP(y, 8) cin>>grid[y];
  bool update = true;
  while(update){
    update = false;
    {
      int sx = -1, sy = -1;
      int cnt = 0;
      REP(y, 8)REP(x, 8)if(grid[y][x] == '.'){
        int t = 0;
        REP(r, 8){
          int nx = x + dx[r], ny = y + dy[r];
          int rt = 0;
          while(true){
            if(!(nx >= 0 && nx < 8 && ny >= 0 && ny < 8)){
              break;
            }
            if(grid[ny][nx] == '.'){
              break;
            }
            if(grid[ny][nx] == 'o'){
              t += rt;
              break;
            }
            assert(grid[ny][nx] == 'x');
            rt ++;
            ny += dy[r]; nx += dx[r];
          }
        }
        if(cnt < t){
          sx = x; sy = y; cnt = t;
        }
      }
      if(sx != -1){
        update = true;
        grid[sy][sx] = 'o';
        REP(r, 8){
          int nx = sx + dx[r], ny = sy + dy[r];
          bool ok = true;
          while(true){
            if(!(nx >= 0 && nx < 8 && ny >= 0 && ny < 8)){
              ok = false;
              break;
            }
            if(grid[ny][nx] == '.'){
              ok = false;
              break;
            }
            if(grid[ny][nx] == 'o'){
              break;
            }
            assert(grid[ny][nx] == 'x');
            ny += dy[r]; nx += dx[r];
          }
          if(ok){
            nx = sx + dx[r], ny = sy + dy[r];
            while(true){
              assert((nx >= 0 && nx < 8 && ny >= 0 && ny < 8));
              if(grid[ny][nx] == 'o'){
                break;
              }
              assert(grid[ny][nx] == 'x');
              grid[ny][nx] = 'o';
              ny += dy[r]; nx += dx[r];
            }
          }
        }
      }
    }
    {
      int sx = -1, sy = -1;
      int cnt = 1;
      REP(y, 8)REP(x, 8)if(grid[y][x] == '.'){
        int t = 0;
        REP(r, 8){
          int nx = x + dx[r], ny = y + dy[r];
          int rt = 0;
          while(true){
            if(!(nx >= 0 && nx < 8 && ny >= 0 && ny < 8)){
              break;
            }
            if(grid[ny][nx] == '.'){
              break;
            }
            if(grid[ny][nx] == 'x'){
              t += rt;
              break;
            }
            assert(grid[ny][nx] == 'o');
            rt ++;
            ny += dy[r]; nx += dx[r];
          }
        }
        if(cnt <= t){
          sx = x; sy = y; cnt = t;
        }
      }
      if(sx != -1){
        update = true;
        grid[sy][sx] = 'x';
        REP(r, 8){
          int nx = sx + dx[r], ny = sy + dy[r];
          bool ok = true;
          while(true){
            if(!(nx >= 0 && nx < 8 && ny >= 0 && ny < 8)){
              ok = false;
              break;
            }
            if(grid[ny][nx] == '.'){
              ok = false;
              break;
            }
            if(grid[ny][nx] == 'x'){
              break;
            }
            assert(grid[ny][nx] == 'o');
            ny += dy[r]; nx += dx[r];
          }
          if(ok){
            nx = sx + dx[r], ny = sy + dy[r];
            while(true){
              assert((nx >= 0 && nx < 8 && ny >= 0 && ny < 8));
              if(grid[ny][nx] == 'x'){
                break;
              }
              assert(grid[ny][nx] == 'o');
              grid[ny][nx] = 'x';
              ny += dy[r]; nx += dx[r];
            }
          }
        }
      }
    }
  }
  REP(y, 8) cout<<grid[y]<<endl;
  return 0;
}

Measured memory_bytes: 1188