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