#include<iostream>
#include<string>
using namespace std;
int main(){
string s;
while(getline(cin,s)){
if(s=="")break;
if(s[0]!='s'&&s[0]==s[1]&&s[1]==s[2]){cout<<s[0]<<endl;continue;}
if(s[3]!='s'&&s[3]==s[4]&&s[4]==s[5]){cout<<s[3]<<endl;continue;}
if(s[6]!='s'&&s[6]==s[7]&&s[7]==s[8]){cout<<s[6]<<endl;continue;}
if(s[0]!='s'&&s[0]==s[3]&&s[3]==s[6]){cout<<s[0]<<endl;continue;}
if(s[1]!='s'&&s[1]==s[4]&&s[4]==s[7]){cout<<s[1]<<endl;continue;}
if(s[2]!='s'&&s[2]==s[5]&&s[5]==s[8]){cout<<s[2]<<endl;continue;}
if(s[0]!='s'&&s[0]==s[4]&&s[4]==s[8]){cout<<s[0]<<endl;continue;}
if(s[2]!='s'&&s[2]==s[4]&&s[4]==s[6]){cout<<s[2]<<endl;continue;}
cout<<"d"<<endl;
}
return 0;
}