#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>

using namespace std;

int t[8][3]={0,1,2,
	     3,4,5,
	     6,7,8,
	     0,3,6,
	     1,4,7,
	     2,5,8,
	     0,4,8,
	     2,4,6};

main(){
  int i;
  string str;
  char c;
  while(cin >> str){
    c=0;
    for(i=0;i<8;i++){
      if(str[t[i][0]]==str[t[i][1]] && str[t[i][1]]==str[t[i][2]] && str[t[i][2]]!='s'){
	c=str[t[i][0]];
	break;
      }
    }
    if(c==0) c='d';
    cout << c << endl;
  }
}