#include<bits/stdc++.h>
#define fi first
#define se second
#define show(x) cerr<<#x<<"="<<x<<"\n"
typedef long long ll;
using namespace std;
//const ll MOD=(ll)1e9+7;
//const ll inf=(ll)1e14;
const int dy[]={1,0,-1};
const int dx[]={1,0,-1};
int n,m,h,w;
string s;
char a[10][10];

int check(int now,int y,int x){
  int res=0;
  if(now==0){
    for(int i=0;i<3;i++){
      for(int j=0;j<3;j++){
        if(i==1 && j==1)continue;
        int cont=0;
        bool flag=0;
        for(int k=1;k<8;k++){
          if(y+k*dy[i]<0 || y+k*dy[i]>=8)break;
          if(x+k*dx[j]<0 || x+k*dx[j]>=8)break;
          if(a[y+k*dy[i]][x+k*dx[j]]=='o'){
            flag=1;
            break;
          }else if(a[y+k*dy[i]][x+k*dx[j]]=='.'){
            flag=0;
            break;
          }else{
            cont++;
          }
        }
        if(flag)res+=cont;
      }
    }
  }else{
    for(int i=0;i<3;i++){
      for(int j=0;j<3;j++){
        if(i==1 && j==1)continue;
        int cont=0;
        bool flag=0;
        for(int k=1;k<8;k++){
          if(y+k*dy[i]<0 || y+k*dy[i]>=8)break;
          if(x+k*dx[j]<0 || x+k*dx[j]>=8)break;
          if(a[y+k*dy[i]][x+k*dx[j]]=='x'){
            flag=1;
            break;
          }else if(a[y+k*dy[i]][x+k*dx[j]]=='.'){
            flag=0;
            break;
          }else{
            cont++;
          }
        }
        if(flag)res+=cont;
      }
    }
  }
  return res;
}

void check2(int now,int y,int x){
  if(now==0){
    for(int i=0;i<3;i++){
      for(int j=0;j<3;j++){
        if(i==1 && j==1)continue;
        bool flag=0;
        for(int k=1;k<8;k++){
          if(y+k*dy[i]<0 || y+k*dy[i]>=8)break;
          if(x+k*dx[j]<0 || x+k*dx[j]>=8)break;
          if(a[y+k*dy[i]][x+k*dx[j]]=='o'){
            flag=1;
            break;
          }else if(a[y+k*dy[i]][x+k*dx[j]]=='.'){
            flag=0;
            break;
          }
        }
        if(flag){
          for(int k=1;k<8;k++){
            if(y+k*dy[i]<0 || y+k*dy[i]>=8)break;
            if(x+k*dx[j]<0 || x+k*dx[j]>=8)break;
            if(a[y+k*dy[i]][x+k*dx[j]]=='o')break;
            else if(a[y+k*dy[i]][x+k*dx[j]]=='.')break;
            else a[y+k*dy[i]][x+k*dx[j]]='o';
          }
        }
      }
    }
  }else{
    for(int i=0;i<3;i++){
      for(int j=0;j<3;j++){
        if(i==1 && j==1)continue;
        if(y+dy[i]<0 || y+dy[i]>=8)continue;
        if(x+dx[j]<0 || x+dx[j]>=8)continue;
        bool flag=0;
        for(int k=1;k<8;k++){
          if(y+k*dy[i]<0 || y+k*dy[i]>=8)break;
          if(x+k*dx[j]<0 || x+k*dx[j]>=8)break;
          if(a[y+k*dy[i]][x+k*dx[j]]=='x'){
            flag=1;
            break;
          }else if(a[y+k*dy[i]][x+k*dx[j]]=='.'){
            flag=0;
            break;
          }
        }
        if(flag){
          for(int k=1;k<8;k++){
            if(y+k*dy[i]<0 || y+k*dy[i]>=8)break;
            if(x+k*dx[j]<0 || x+k*dx[j]>=8)break;
            if(a[y+k*dy[i]][x+k*dx[j]]=='x')break;
            else if(a[y+k*dy[i]][x+k*dx[j]]=='.')break;
            else a[y+k*dy[i]][x+k*dx[j]]='x';
          }
        }
      }
    }
  }
}

void solve(int now,int stop){
  if(stop==2)return;
  if(now==0){
    int maxi=-1,maxj=-1;
    int nowmax=0;
    for(int i=0;i<8;i++){
      for(int j=0;j<8;j++){
        if(a[i][j]!='.')continue;
        int tmp=check(0,i,j);
        if(tmp>nowmax){
          nowmax=tmp;
          maxi=i;
          maxj=j;
        }
      }
    }
    if(nowmax==0){
      solve(1,stop+1);
    }else{
      a[maxi][maxj]='o';
      check2(0,maxi,maxj);
      solve(1,0);
    }
  }else{
    int maxi=-1,maxj=-1;
    int nowmax=0;
    for(int i=7;i>=0;i--){
      for(int j=7;j>=0;j--){
        if(a[i][j]!='.')continue;
        int tmp=check(1,i,j);
        if(tmp>nowmax){
          nowmax=tmp;
          maxi=i;
          maxj=j;
        }
      }
    }
    if(nowmax==0){
      solve(0,stop+1);
    }else{
      a[maxi][maxj]='x';
      check2(1,maxi,maxj);
      solve(0,0);
    }
  }
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cout<<fixed;
#ifdef LOCAL_DEFINE
  FILE *stream1;
  //FILE *stream2;
  stream1=freopen("in","r",stdin);
  //stream2=freopen("out","w",stdout);
  if(stream1==NULL)return 0;
  //if(stream2==NULL)return 0;
#endif
  for(int i=0;i<8;i++){
    for(int j=0;j<8;j++){
      cin>>a[i][j];
    }
  }
  solve(0,0);
  for(int i=0;i<8;i++){
    for(int j=0;j<8;j++){
      cout<<a[i][j];
    }
    cout<<endl;
  }
#ifdef LOCAL_DEFINE
  cerr<<"Time elapsed: "<<1.0*clock()/CLOCKS_PER_SEC<<"s.\n";
  fclose(stream1);
  //fclose(stream2);
#endif
  return 0;
}







Measured memory_bytes: 3240