#include<iostream>
using namespace std;


int main(){
  char G[4][4];
  int frago,fragx,i,j;
  char n;
  
  while(scanf("%c",&n)!=EOF){

    frago = fragx = 0; 

    for(i=0; i<3; i++){
      for(j=0; j<3; j++){
	if(i==0 && j==0) continue;
	scanf("%c",&G[i][j]);
      }
    }
    getchar();
    G[0][0] = n;


    for(j=0; j<3; j++){
      if(G[0][j] =='o' && G[1][j] == 'o' && G[2][j] == 'o') frago = 1;
      if(G[0][j] =='x' && G[1][j] == 'x' && G[2][j] == 'x') fragx = 1;
      
      if(G[j][0] =='o' && G[j][1] == 'o' && G[j][2] == 'o') frago = 1;
      if(G[j][0] =='x' && G[j][1] == 'x' && G[j][2] == 'x') fragx = 1;
    }



    if(G[0][0] =='o'&& G[1][1]=='o'&& G[2][2]=='o') frago = 1;
    if(G[0][0] =='x'&& G[1][1]=='x'&& G[2][2]=='x') fragx=1;

    if(G[0][2]=='o' && G[1][1]=='o' && G[2][0]=='o') frago=1;
    if(G[0][2]=='x' && G[1][1]=='x' && G[2][0]=='x') fragx=1;

    if(frago == 0 && fragx == 0) cout << 'd' << endl;
    else if(frago == 1 && fragx == 0) cout << 'o' << endl;
    else if(frago == 0 && fragx == 1) cout << 'x' << endl;
  }



  return 0;
}