#include "bits/stdc++.h"
#include<string>
#include<sstream>
using namespace std;
int main() {
string s;
while(cin>>s){
	if(s[0]==s[1]&&s[1]==s[2]){cout<<s[0]<<endl;continue;}
	else if(s[3]==s[4]&&s[4]==s[5]){cout<<s[3]<<endl;continue;}
	else if(s[6]==s[7]&&s[7]==s[8]){cout<<s[6]<<endl;continue;}
	else if(s[0]==s[3]&&s[3]==s[6]){cout<<s[0]<<endl;continue;}
	else if(s[1]==s[4]&&s[4]==s[7]){cout<<s[7]<<endl;continue;}
	else if(s[2]==s[5]&&s[5]==s[8]){cout<<s[2]<<endl;continue;}
	else if(s[0]==s[4]&&s[4]==s[8]){cout<<s[0]<<endl;continue;}
	else if(s[2]==s[4]&&s[4]==s[6]){cout<<s[2]<<endl;continue;}
	else{cout<<"d"<<endl;}
}
}