#include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<set>
using namespace std;
int stoi(string x){stringstream ss;ss<<x;int tmp;ss>>tmp;return tmp;}
string itos(int x){stringstream ss;ss<<x;return ss.str();}
	string ta;
	
	bool win(char x){
	bool f=0;
	for(int i=0;i<9;i+=3){
	if(ta[i]==x&&ta[i+1]==x&&ta[i+2]==x)f=1;
	}
	for(int i=0;i<3;i++){
	if(ta[i]==x&&ta[i+3]==x&&ta[i+6]==x)f=1;
	}
	
	if(ta[2]==x&&ta[4]==x&&ta[6]==x)f=1;
	if(ta[0]==x&&ta[4]==x&&ta[8]==x)f=1;
	
	return f;
	}
int main(){
	while(cin>>ta){
	if(win('o'))cout<<'o'<<endl;
	if(win('x'))cout<<'x'<<endl;
	else cout<<'d'<<endl;
	}
	return 0;
}