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

bool win(string s,char c){
	for(int y=0;y<9;y+=3)
		if(s[y]==c&&s[y+1]==c&&s[y+2]==c)return true;
	for(int x=0;x<3;x++)
		if(s[x]==c&&s[x+3]==c&&s[x+6]==c)return true;
	if(s[0]==c&&s[4]==c&&s[8]==c)return true;
	if(s[2]==c&&s[4]==c&&s[6]==c)return true;
	return false;
}
int main(){
	string s;
	while(cin>>s){
		cout<<(win(s,'o')?'o':win(s,'x')?'x':'d')<<endl;
	}
	return 0;
}