#include <algorithm>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <cctype>
#include <iostream>
#include <set>
#include <string>
#include <queue>
#include <map>
#include <utility>
using namespace std;
int size(string x){
	string::size_type size=x.size();
	return size;
}
#define fu(l,k) for(int i=l;i<k;i++)
#define fd(l,k) for(int i=l;i>k;i--)
#define sort(ss) sort(ss.begin(), ss.end())
#define rsort(ss) sort(ss.rbegin(), ss.rend())
typedef  vector<string> vs;
typedef  vector<int> vi;
double pi(){
	return M_PI;
}
typedef set<int> set_i;
typedef set<string> set_s;
int INF=1000000;
int main(){
	string ss;
	while(cin>>ss){
		if(ss[0]==ss[1]&&ss[1]==ss[2]&&ss[0]!='s') cout<<ss[0]<<endl;
		else if(ss[0]==ss[1]&&ss[1]==ss[2]&&ss[0]!='s') cout<<ss[0]<<endl;
		else if(ss[3]==ss[4]&&ss[4]==ss[5]&&ss[3]!='s') cout<<ss[3]<<endl;
		else if(ss[6]==ss[7]&&ss[7]==ss[8]&&ss[6]!='s') cout<<ss[6]<<endl;
		else if(ss[0]==ss[3]&&ss[3]==ss[6]&&ss[0]!='s') cout<<ss[0]<<endl;
		else if(ss[1]==ss[4]&&ss[4]==ss[7]&&ss[1]!='s') cout<<ss[1]<<endl;
		else if(ss[2]==ss[5]&&ss[5]==ss[8]&&ss[2]!='s') cout<<ss[2]<<endl;
		else if(ss[0]==ss[4]&&ss[4]==ss[8]&&ss[0]!='s') cout<<ss[0]<<endl;
		else if(ss[2]==ss[4]&&ss[4]==ss[6]&&ss[2]!='s') cout<<ss[2]<<endl;
		else cout<<"d"<<endl;
	}
}