#include<iostream>
using namespace std;
string s;
main()
{
    while(cin>>s)
    {
        int f=0;
        for(int i=0;i<3;i++)
        {
            if(s[i*3]!='s'&&s[i*3]==s[i*3+1]&&s[i*3]==s[i*3+2])
            {
                f=1;
                cout<<s[i*3]<<endl;
            }
        }
        for(int i=0;i<3;i++)
        {
            if(s[i]!='s'&&s[i]==s[i+3]&&s[i]==s[i+6])
            {
                f=1;
                cout<<s[i]<<endl;
            }
        }
        if(s[0]!='s'&&s[0]==s[4]&&s[0]==s[8])
        {
            f=1;
            cout<<s[0]<<endl;
        }
        if(s[2]!='s'&&s[2]==s[4]&&s[2]==s[6])
        {
            f=1;
            cout<<s[2]<<endl;
        }
        if(!f)cout<<"d"<<endl;
    }
}
