#include <iostream>
#include <string>
int f(char a,char b, char c){
	return ((a!='s'&&a==b&&a==c)?a:0);
}
int main(){
	std::string s;
	int i,j;
	while(getline(std::cin,s)){
		char c=(f(s[0],s[4],s[8])||f(s[2],s[4],s[6]))?s[4]:0;
		if(!c){
			for(i=0;i<3;i++){
				c=f(s[i],s[i+3],s[i+6]);
				if(c)break;
				j=i*3;
				c=f(s[j],s[j+1],s[j+2]);
				if(c)break;
			}
			if(!c)c='d';
		}
		std::cout<<c<<"\n";
	}
}