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

template<class T>
bool eq_3(T t1,T t2,T t3){
    return t1==t2 && t2==t3;
}

char solve(string f){
    for(int i=0;i<9;i+=3){
        if(eq_3(f[i],f[i+1],f[i+2])){
            return f[i];
        }
    }

    for(int i=0;i<3;i++){
        if(eq_3(f[i],f[i+3],f[i+6])){
            return f[i];
        }
    }

    if(eq_3(f[0],f[4],f[8])){
        return f[0];
    }

    if(eq_3(f[2],f[4],f[6])){
        return f[2];
    }

    return 'd';
}

int main(){
    string f;

    while(getline(cin,f)){
        cout<<solve(f)<<endl;
    }

    return 0;
}