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

int main(){

    while(1){
        string s; cin >> s;

        char a[3][3];
        a[0][0] = s[0];
        a[0][1] = s[1];
        a[0][2] = s[2];
        a[1][0] = s[3];
        a[1][1] = s[4];
        a[1][2] = s[5];
        a[2][0] = s[6];
        a[2][1] = s[7];
        a[2][2] = s[8];
        char S = 's';
        bool ok = false;
        for(int i = 0; i < 3; i++){
            if(a[i][0] != S && a[i][0] == a[i][1] && a[i][1] == a[i][2]){
                cout << a[i][0] << endl;
                ok = true;
                break;
            }
        }

        for(int j = 0; j < 3; j++){
            if(ok) break;

            if(a[0][j] != S && a[0][j] == a[1][j] && a[1][j] == a[2][j]){
                cout << a[0][j] << endl;
                ok = true;
                break;
            }
        }
        
        if(!ok){
            if(a[0][0] != S && a[0][0] == a[1][1] && a[1][1] == a[2][2]){
                cout << a[0][0] << endl;
                ok = true;
            }else if(a[0][2] != S && a[0][2] == a[1][1] && a[1][1] == a[2][0]){
                cout << a[1][1] << endl;
                ok = true;
            }
        }

        if(!ok) cout << "d" << endl;
    }

    return 0;
}
