#include <iostream>
using namespace std;

char solver(char a[9]){
    for(int i=0; i<9; i+=3)
        if(a[i] == a[i+1] && a[i+1] == a[i+2] && a[i] != 's') return a[i];
    for(int i=0; i<3; ++i)
        if(a[i] == a[i+3] && a[i+3] == a[i+6] && a[i] != 's') return a[i];
    if(a[0] == a[4] && a[4] == a[8] && a[0] != 's') return a[0];
    if(a[2] == a[4] && a[4] == a[6] && a[2] != 's') return a[2];
    return 'd';
}

int main(){
    char a[9];
    while(scanf("%s", a) != EOF){
        char result = solver(a);
        cout << result << endl;
    }
    return 0;
}