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

int main(){
    string str;
    
    while(getline(cin,str)){
        
        if(((str[0]==str[4]&&str[4]==str[8])||(str[2]==str[4]&&str[4]==str[6]))&&(str[4]!='s')) cout << str[4] << endl;
        else if((str[0]==str[1]&&str[1]==str[2])&&str[0]!='s') cout << str[0] << endl;
        else if((str[3]==str[4]&&str[4]==str[5])&&str[3]!='s') cout << str[3] << endl;
        else if((str[6]==str[7]&&str[7]==str[8])&&str[6]!='s') cout << str[6] << endl;
        else if((str[0]==str[3]&&str[3]==str[6])&&str[0]!='s') cout << str[0] << endl;
        else if((str[1]==str[4]&&str[4]==str[7])&&str[0]!='s') cout << str[1] << endl;
        else if((str[2]==str[5]&&str[5]==str[8])&&str[0]!='s') cout << str[2] << endl;
        else cout << 'd' << endl;
    }
    
    return 0;
}