#include <iostream>
using namespace std;

char tictactoe(char x[]) {
  for(int i=0;i<7;i = i+3) { //yoko
    if( (x[i] == x[i+1]) && (x[i+1] == x[i+2]) ) {
      if((x[i] == 'o')||(x[i] == 'x'))
        return x[i];
    }
  }

  for(int i=0;i<3;i++)  { //tate
    if((x[i] == x[i+3]) && (x[i+3] == x[i+6])) {
      if((x[i] == 'o')||(x[i] == 'x'))
        return x[i];
    }
  }
  if((x[0] == x[4]) && (x[4] == x[8])) {
    if((x[0] == 'o')||(x[0] == 'x'))
      return x[0];
  }
  if((x[2] == x[4]) && (x[4] == x[6])) {
    if((x[2] == 'o')||(x[2] == 'x'))
      return x[2];
  }
  return 'd';
}

  int main() {
    string str;
    while(cin >> str) {
      char x[9] = {};
      for(int i=0;i<9;i++) {
        x[i] = *str.substr(i,1).c_str();
      }
      cout << tictactoe(x) << endl;
    }
  }