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

int main(void){
	string n;
	while(cin>>n){
		if(n[0]==n[1] && n[1]==n[2]){
			cout<<n[0]<<endl;continue;
		}else if(n[3]==n[4] && n[4]==n[5]){
			cout<<n[3]<<endl;continue;
		}else if(n[6]==n[7] && n[7]==n[8]){
			cout<<n[6]<<endl;continue;
		}else if(n[0]==n[4] && n[4]==n[8]){
			cout<<n[0]<<endl;continue;
		}else if(n[2]==n[4] && n[4]==n[6]){
			cout<<n[2]<<endl;continue;
		}else cout<<"d"<<endl; 
		 
	}
}