#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define loop(i, x, n) for (int i = (x); i < (n); i++)
#define all(v) (v).begin(), (v).end()
#define int long long
#define INF 1e9
using namespace std;
template<typename T> void cmin(T &a, T b) { a = min(a, b); }
template<typename T> void cmax(T &a, T b) { a = max(a, b); }
char mp[10][10];

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

bool CheckArea(int y, int x) {
  if (0 <= y && y < 8 && 0 <= x && x < 8)
    return true;
  else
    return false;
}

int check(int y, int x, char masu) {
  int sum = 0;
  rep(i, 8) {
    int ny = y, nx = x, cnt = 0;
    ny += dy[i];
    nx += dx[i];
    while (CheckArea(ny, nx) && mp[ny][nx] != '.') {
      if (mp[ny][nx] != masu) cnt++;
      if (mp[ny][nx] == masu) {
        sum += cnt;
        break;
      }
      ny += dy[i];
      nx += dx[i];
    }
  }
  return sum;
}

void draw(int y, int x, char masu) {
  rep(i, 8) {
    int ny = y, nx = x;
    ny += dy[i];
    nx += dx[i];
    // cout << "ny=" << ny << ' ' << "nx=" << nx << ' ' << "mp[ny][nx]=" << mp[ny][nx] << endl;
    bool ok = false;
    while (CheckArea(ny, nx) && mp[ny][nx] != '.') {
      if (mp[ny][nx] == masu) {
        ok = true;
        break;
      }
      ny += dy[i];
      nx += dx[i];
    }
    if (ok) {
      ny = y + dy[i];
      nx = x + dx[i];
      while (CheckArea(ny, nx) && mp[ny][nx] != '.') {
        if (mp[ny][nx] == masu) break;
        mp[ny][nx] = (masu == 'o' ? 'o' : 'x');
        // cout << "ny=" << ny << ' ' << "nx=" << nx << endl;
        ny += dy[i];
        nx += dx[i];
      }
    }
  }
}

signed main() {
  rep(i, 8) rep(j, 8) cin >> mp[i][j];
  bool isTomoe = true;
  int pass = 0;

  while (1) {
    if (isTomoe) {
      int ypos, xpos, mpoint = 0;
      rep(i, 8) rep(j, 8) {
        if (mp[i][j] != '.') continue;
        int temp_point = check(i, j, 'o');
        if (mpoint < temp_point) {
          ypos = i, xpos = j;
          mpoint = temp_point;
        }
      }
      //  cout << "ypos=" << ypos << ' ' << "xpos=" << xpos << ' ' << "mpoint=" << mpoint << endl;

      if (mpoint == 0) {
        pass++;
      } else {
        mp[ypos][xpos] = 'o';
        draw(ypos, xpos, 'o');
        pass = 0;
      }
      isTomoe = false;
    } else {
      int ypos, xpos, mpoint = 0;
      for (int i = 7; i >= 0; i--) {
        for (int j = 7; j >= 0; j--) {
          if (mp[i][j] != '.') continue;
          int temp_point = check(i, j, 'x');
          if (mpoint < temp_point) {
            ypos = i, xpos = j;
            mpoint = temp_point;
          }
        }
      }
      //      cout << "ypos=" << ypos << ' ' << "xpos=" << xpos << ' ' << "mpoint=" << mpoint << endl;

      if (mpoint == 0) {
        pass++;
      } else {
        mp[ypos][xpos] = 'x';
        draw(ypos, xpos, 'x');
        pass = 0;
      }
      isTomoe = true;
    }
    if (pass == 2) break;
    // rep(i, 8) {
    //   rep(j, 8) cout << mp[i][j];
    //   cout << endl;
    // }
    // cout << endl;
    // out << "pass=" << pass << endl;
  }
  rep(i, 8) {
    rep(j, 8) cout << mp[i][j];
    cout << endl;
  }
  return 0;
}



Measured memory_bytes: 3120