#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define REP(i, n) FOR(i, 0, n)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define RREP(i, n) RFOR(i, n, 0)
#define MFOR(i, m) for(auto i=(m).begin();i!=(m).end();i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((int)(x).size())

typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(vector<T> const& s) {
  REP(i, SZ(s)) {
    cout << s[i];
    if(i == SZ(s)-1) {
      cout << endl;
    } else {
      cout << " ";
    }
  }
}

vector<int> dx = {1, 1, 0, -1, -1, -1, 0, 1};
vector<int> dy = {0, 1, 1, 1, 0, -1, -1, -1};

struct Game {
  int h = 8, w = 8;
  int cnt = 64;
  int path = 0;
  bool turnm = true;
  vector<vector<char>> board;
  Game(vector<vector<char>> &board) {
    this->board = board;
  }

  void mami() {
    vector<vector<bool>> sel(h, vector<bool>(w, false));
    int maxrev = -1;
    int maxx = -1, maxy = -1;
    vector<bool> maxdir(8, false);
    REP(i, h) {
      REP(j, w) {
        if(board[i][j] != '.') continue;
        int rev = 0;
        vector<bool> dir(8, false);
        REP(k, 8) {
          int x = i+dx[k], y = j+dy[k];
          int tmp = 0;
          while(0 <= x && x < h && 0 <= y && y < w && board[x][y] == 'x') {
            tmp++;
            x += dx[k];
            y += dy[k];
          }
          if(0 <= x && x < h && 0 <= y && y < w && board[x][y] == 'o') {
            rev += tmp;
            dir[k] = true;
          }
        }
        if(rev > 0 && rev > maxrev) {
          maxx = i;
          maxy = j;
          maxrev = rev;
          maxdir = dir;
        }
      }
    }

    if(maxrev != -1) {
      cnt--;
      path = 0;
      REP(i, 8) {
        if(maxdir[i]) {
          int x = maxx + dx[i], y = maxy + dy[i];
          while(0 <= x && x < h && 0 <= y && y < w && board[x][y] == 'x') {
            board[x][y] = 'o';
            x += dx[i];
            y += dy[i];
          }
        }
      }
      board[maxx][maxy] = 'o';
    } else {
      path++;
    }

    // cout << maxx << ":" << maxy << ":" << maxrev << endl;
    // prt();

  }

  void lotte() {
    vector<vector<bool>> sel(h, vector<bool>(w, false));
    int maxrev = -1;
    int maxx = -1, maxy = -1;
    vector<bool> maxdir(8, false);
    RREP(i, h-1) {
      RREP(j, w-1) {
        if(board[i][j] != '.') continue;
        // cout << i << ":" << j << endl;
        int rev = 0;
        vector<bool> dir(8, false);
        REP(k, 8) {
          int x = i+dx[k], y = j+dy[k];
          int tmp = 0;
          while(0 <= x && x < h && 0 <= y && y < w && board[x][y] == 'o') {
            tmp++;
            x += dx[k];
            y += dy[k];
          }
          // cout << x << ":" << y << endl;
          if(0 <= x && x < h && 0 <= y && y < w && board[x][y] == 'x') {
            rev += tmp;
            dir[k] = true;
          }
        }
        if(rev > 0 && rev > maxrev) {
          maxx = i;
          maxy = j;
          maxrev = rev;
          maxdir = dir;
        }
      }
    }

    if(maxrev != -1) {
      cnt--;
      path = 0;
      REP(i, 8) {
        if(maxdir[i]) {
          int x = maxx + dx[i], y = maxy + dy[i];
          while(0 <= x && x < h && 0 <= y && y < w && board[x][y] == 'o') {
            board[x][y] = 'x';
            x += dx[i];
            y += dy[i];
          }
        }
      }
      board[maxx][maxy] = 'x';
    } else {
      path++;
    }
    // cout << maxx << ":" << maxy << ":" << maxrev << endl;
    // prt();
  }

  void solve() {
    while(cnt > 0 && path != 2) {
      // cout << "A" << endl;
      if(turnm) {
        mami();
        turnm = false;
      } else {
        lotte();
        turnm = true;
      }
    }
    prt();
  }

  void prt() {
    REP(i, h) {
      REP(j, w) {
        cout << board[i][j];
      }
      cout << endl;
    }
  }
};

int main () {
  cin.tie(0);
  cout << fixed << setprecision(10);

  vector<vector<char>> v(8, vector<char>(8));
  REP(i, 8) {
    REP(j, 8) {
      cin >> v[i][j];
    }
  }
  Game(v).solve();
}



Measured memory_bytes: 3144