#include<iostream>
#include<cstdio>

using namespace std;



int main(){
  char data[12];
  int jadge=0;//0Èçø«ª¯//PÈço//2Èçx
  while(cin >> data){
    jadge=0;
    
   
    
    
    for(int i=0, j=0;i<3;i++,j+=3){//¡ÉÀÔÆ«
      if(data[0+j]=='o'&&data[1+j]=='o'&&data[2+j]=='o')jadge=1;
      if(data[0+j]=='x'&&data[1+j]=='x'&&data[2+j]=='x')jadge=2;
      //cout << j<< endl;
    }
    
    
    //cÉÈçÔÆ«
    for(int i=0;i<3;i++){
      if(data[0+i]=='o'&&data[3+i]=='o'&&data[6+i]=='o')jadge=1;
      if(data[0+i]=='x'&&data[3+i]=='x'&&data[6+i]=='x')jadge=2;
    }
        
    //ÎßÉÈçÔÆ«
    if(data[0]=='o'&&data[4]=='o'&&data[8]=='o')jadge=1;
    if(data[0]=='x'&&data[4]=='x'&&data[8]=='x')jadge=2;
    if(data[2]=='o'&&data[4]=='o'&&data[6]=='o')jadge=1;
    if(data[2]=='x'&&data[4]=='x'&&data[6]=='x')jadge=2;

    switch(jadge){
    case 1:
      printf("o\n");
      break;
    case 2:
      printf("x\n");
      break;
    case 0:
      printf("d\n");
      break;
    }
    
  }

  return 0;
}