#include <bits/stdc++.h>
using namespace std;

int main(void){
    string s;
    while(true){
        cin>>s;
        if(cin.fail())break;
        for (int i = 0; i < 3; ++i) {
            if(s[0+3*i]==s[1+3*i]&&s[1+3*i]==s[2+3*i]&&s[2+3*i]=='o'){cout<<"o"<<endl;goto end;}
            if(s[0+3*i]==s[1+3*i]&&s[1+3*i]==s[2+3*i]&&s[2+3*i]=='x'){cout<<"x"<<endl;goto end;}
        }

        for (int i = 0; i < 3; ++i) {
            if(s[0+i]==s[3+i]&&s[3+i]==s[6+i]&&s[6+i]=='o'){cout<<"o"<<endl;goto end;}
            if(s[0+i]==s[3+i]&&s[3+i]==s[6+i]&&s[6+i]=='x'){cout<<"x"<<endl;goto end;}
        }
        for (int i = 0; i < 2; ++i) {
            if(s[0+2*i]==s[4]&&s[4]==s[8-2*i]&&s[4]=='o'){cout<<"o"<<endl;goto end;}
            if(s[0+2*i]==s[4]&&s[4]==s[8-2*i]&&s[4]=='x'){cout<<"x"<<endl;goto end;}
        }
        cout<<"d"<<endl;
        end:;
        if(s[9]==EOF)break;
    }
    return 0;
}
