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

int main(){

  string s;

  while(cin >> s){

    int o = 0,x = 0;

    for(int i=0;i<9;i+=3){
      if(s[i] == s[i+1] && s[i] == s[i+2] && s[i] == 'o') o = 1;
      if(s[i] == s[i+1] && s[i] == s[i+2] && s[i] == 'x') x = 1;
    }

    for(int i=0;i<3;i++){
      if(s[i] == s[i+3] && s[i] == s[i+6] && s[i] == 'o') o = 1;
      if(s[i] == s[i+3] && s[i] == s[i+6] && s[i] == 'x') x = 1;
    }

    if(s[0] == s[4] && s[0] == s[8] && s[0] == 'o') o = 1;
    if(s[0] == s[4] && s[0] == s[8] && s[0] == 'x') x = 1;

    if(s[2] == s[4] && s[2] == s[6] && s[2] == 'o') o = 1;
    if(s[2] == s[4] && s[2] == s[6] && s[2] == 'x') x = 1;

    if(o) cout << "o" << endl;
    else if(x) cout << "x" << endl;
    else cout << "d" << endl;
  }
}