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

int main(){
    string in;
    char ch[2] = {'o', 'x'};
    while( cin >> in ){
        bool found = false;
        for( int i=0; i<2; i++ ){
            // 縦
            for( int x=0; x<3; x++ ){
                if( in[x] == ch[i] && in[x] == in[x+3] && in[x] == in[x+6] ){
                    cout << ch[i] << endl;
                    found = true;
                }
            }
            // 横
            for( int y=0; y<3; y++ ){
                if( in[y*3] == ch[i] && in[y*3+1] == ch[i] && in[y*3+2] == ch[i] ){
                    cout << ch[i] << endl;
                    found = true;
                }
            }
            // 斜
            if( ch[i] == in[0] && ch[i] == in[4] && ch[i] == in[8] ){
                cout << ch[i] << endl;
                found = true;
            }
            if( ch[i] == in[2] && ch[i] == in[4] && ch[i] == in[6] ){
                cout << ch[i] << endl;
                found = true;
            }
        }
        if( !found ){
            cout << 'd' << endl;
        }
    }
    return 0;
}