#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <tuple>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <numeric>
#include <utility>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <ctime>
#include <cassert>
#include <random>
#include <cstring>

#define rep(i,n) for(int i=0;i<int(n);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back

using namespace std;
using ll = long long;

const ll mod = 1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int ddx[8]={-1,-1,0,1,1,1,0,-1};
int ddy[8]={0,1,1,1,0,-1,-1,-1};
bool debug=false;

/*---------------------------------------------------*/

#define CHOCO 'o'
#define CHEESE 'x'
#define NONE '.'

using Board = vector<vector<char>>;

struct Vector2 {
  int x;
  int y;
};

void debug_print(Board& board){
  for(int i = 0 ; i < 8; i++){
    for(int j = 0; j < 8; j++){
      cout << board[i][j]; 
    }
    cout << endl;
  }
  cout << endl;
}

bool in_area(Vector2 v){
  return 0 <= v.x && v.x < 8 && 0 <= v.y && v.y < 8;
}

bool is_reverse(Board board, Vector2 v, int x, int y, char color){
  v.x += x; v.y += y;
  char check = (color == CHOCO ? CHEESE : CHOCO);
  bool ok = false;
  while(in_area(v)){
    if(board[v.y][v.x] == check) ok = true;
    else if(board[v.y][v.x] == color && ok) return true;
    else break;
    v.x += x; v.y += y;
  }
  return false;
}

int reverse_count(Board board, Vector2 v, char color){
  int reverse_num = 0;
  board[v.y][v.x] = color;
  for(int i = 0; i < 8; i++){
    if(is_reverse(board, v, ddx[i], ddy[i], color)) {
      Vector2 vv = v;
      vv.x += ddx[i], vv.y += ddy[i];
      while(board[vv.y][vv.x] != color) {
	board[vv.y][vv.x] = color;
	reverse_num++;
	vv.x += ddx[i], vv.y += ddy[i];
      }
    }
  }
  return reverse_num;
}

void reverse(Board& board, Vector2 v, char color){
  int reverse_num = 0;
  board[v.y][v.x] = color;
  for(int i = 0; i < 8; i++){
    if(is_reverse(board, v, ddx[i], ddy[i], color)) {
      Vector2 vv = v;
      vv.x += ddx[i], vv.y += ddy[i];
      while(board[vv.y][vv.x] != color) {
	board[vv.y][vv.x] = color;
	reverse_num++;
	vv.x += ddx[i], vv.y += ddy[i];
      }
    }
  }
}

void simulate(Board& board, char& color){
  int max_reverse = 0;
  Vector2 position;
  if(color == CHOCO){
    for(int h = 0; h < 8; h++){
      for(int w = 0; w < 8; w++) {
	if(board[h][w] != NONE) continue;
	int rev = reverse_count(board, {w, h}, color);
	if(max_reverse < rev) {
	  max_reverse = rev;
	  position = {w, h};
	}
      }
    }
  } else {
    for(int h = 7; h >= 0; h--){
      for(int w = 7; w >= 0; w--) {
	if(board[h][w] != NONE) continue;
	int rev = reverse_count(board, {w, h}, color);
	if(max_reverse < rev) {
	  max_reverse = rev;
	  position = {w, h};
	}
      }
    }
  }
  if(max_reverse == 0) return ;
  reverse(board, position, color);
}

int main(){
  vector<vector<char>> board = vector<vector<char>>(8, vector<char>(9));
  for(int i = 0; i < 8; i++){
    for(int j = 0; j < 8; j++){
      cin >> board[i][j];
    }
  }
  
  for(int turn = 0; turn < 64 *  2; turn++){
    char color = (turn % 2 == 0 ? CHOCO : CHEESE);
    simulate(board, color);
    // debug_print(board);
  }
  
  for(int i = 0 ; i < 8; i++){
    for(int j = 0; j < 8; j++){
      cout << board[i][j]; 
    }
    cout << endl;
  }
  return 0;
}



Measured memory_bytes: 3172