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

int main(){
	string s;
	int w,f;
	while(cin>>s){
		f=0;
		for(int i=0;i<3;i++){
			if(s[3*i+0]==s[3*i+1]&&s[3*i+1]==s[3*i+2]&&f==0){cout<<s[i*3];f=1;}
			if(s[i]==s[i+3]&&s[i+3]==s[i+6]){cout<<s[i];f=1;}
		}
		if(s[0]==s[4]&&s[4]==s[8]&&f==0){cout<<s[0];f=1;}
		if(s[2]==s[4]&&s[4]==s[6]&&f==0){cout<<s[2];f=1;}
		if(f==0)cout<<"d";
		cout<<endl;
	}
	return 0;
}