#include<iostream>
#include<string>
using namespace std;

int hantei(char c){
  if(c == 'o') return 1;
  if(c == 'x') return 2;
  if(c == 's') return 0;
}

int main(){
  int pass[3][3];
  string s;
  
  while(cin >> s){
    for(int i=0; i<3; i++){
      for(int j=0; j<3; j++){
	pass[i][j] = 0;
      }
    }
    int count=0;
      for(int m=0; m<3; m++){
	for(int n=0; n<3; n++){
	  pass[m][n] = hantei(s[count]);
	  count++;
	}
      }

      bool flag = false;
      int winer=1, win=0;

      for(int i=0; i<2; i++){
	for(int m=0; m<3; m++){
	  if(winer == pass[m][0] && winer == pass[m][1] && winer == pass[m][2]){
	    flag = true;  win = winer; break;
	  }
	  if(winer == pass[0][m] && winer == pass[1][m] && winer == pass[3][m]){
	    win = winer;  flag = true; break;
	  }
	}
	
	if(winer == pass[0][0] && winer == pass[1][1] && winer == pass[2][2]){
	  win= winer;  flag = true; break;
	}
	if(winer == pass[0][2] && winer == pass[1][1] && winer == pass[2][0]){
	 win = winer;  flag = true; break;
	}
	winer++;
      }
      
      if(flag == true){
	if(win == 1) cout << 'o' << endl;
	if(win == 2) cout << 'x' << endl;
      }
      else cout << 'd' << endl;
      
  }


}