#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;

const int N=8;

class GameMgr{
  char board[N][N];
  bool CanAccess(int r,int c){
    if(r<0||N<=r) return false;
    if(c<0||N<=c) return false;
    return true;
  }
public:
  void Init(void){
    for(int i=0;i<N;i++){
      for(int j=0;j<N;j++){
        char c;
        cin>>c;
        board[i][j]=c;
      }
    }
  }
  int PutChoco(int r,int c){
    if(board[r][c]!='.'){
      return 0;
    }

    board[r][c]='o';

    int result=0;

    for(int vec_r=-1;vec_r<=1;vec_r++){
      for(int vec_c=-1;vec_c<=1;vec_c++){

        if(vec_c==0&&vec_r==0) continue;

        int search_r=r,search_c=c;

        while(CanAccess(search_r+vec_r,search_c+vec_c)){

          search_r+=vec_r;
          search_c+=vec_c;

          if(board[search_r][search_c]=='.'){
            break;
          }

          if(board[search_r][search_c]=='o'){
            int turn_r=r+vec_r,turn_c=c+vec_c;
            int to_r=search_r,to_c=search_c;
            while(turn_r!=to_r||turn_c!=to_c){
              board[turn_r][turn_c]='o';
              result++;
              turn_r+=vec_r;
              turn_c+=vec_c;
            }
            break;
          }
        }

      }
    }
    return result;
  }
  int PutCheese(int r,int c){
    if(board[r][c]!='.'){
      return 0;
    }

    board[r][c]='x';

    int result=0;

    for(int vec_r=-1;vec_r<=1;vec_r++){
      for(int vec_c=-1;vec_c<=1;vec_c++){

        if(vec_c==0&&vec_r==0) continue;

        int search_r=r,search_c=c;

        while(CanAccess(search_r+vec_r,search_c+vec_c)){

          search_r+=vec_r;
          search_c+=vec_c;

          if(board[search_r][search_c]=='.'){
            break;
          }

          if(board[search_r][search_c]=='x'){
            int turn_r=r+vec_r,turn_c=c+vec_c;
            int to_r=search_r,to_c=search_c;
            while(turn_r!=to_r||turn_c!=to_c){
              board[turn_r][turn_c]='x';
              result++;
              turn_r+=vec_r;
              turn_c+=vec_c;
            }
            break;
          }
        }

      }
    }
    return result;
  }
  void Output(void){
    for(int i=0;i<N;i++){
      for(int j=0;j<N;j++){
        cout<<board[i][j];
      }
      cout<<endl;
    }
  }
};

bool MamiPlay(GameMgr& mgr){
  int max=0;
  int final_r=0,final_c=0;
  for(int r=0;r<N;r++){
    for(int c=0;c<N;c++){
      GameMgr new_mgr=mgr;
      int count=new_mgr.PutChoco(r,c);
      if(count>max){
        final_r=r;
        final_c=c;
        max=count;
      }
    }
  }
  if(max==0){
    return false;
  }else{
    mgr.PutChoco(final_r,final_c);
    return true;
  }
}
bool CharPlay(GameMgr& mgr){
  int max=0;
  int final_r=0,final_c=0;
  for(int r=N-1;r>=0;r--){
    for(int c=N-1;c>=0;c--){
      GameMgr new_mgr=mgr;
      int count=new_mgr.PutCheese(r,c);
      if(count>max){
        final_r=r;
        final_c=c;
        max=count;
      }
    }
  }
  if(max==0){
    return false;
  }else{
    mgr.PutCheese(final_r,final_c);
    return true;
  }
}

int main(void) {
  cout << std::fixed << std::setprecision(10);
  cin.tie(0);
  std::ios::sync_with_stdio(false);

  GameMgr mgr;
  mgr.Init();
  while(true){
    bool m=MamiPlay(mgr);
    bool c=CharPlay(mgr);
    if(!m&&!c){
      break;
    }
  }

  mgr.Output();

  return 0;
}



Measured memory_bytes: 3220