#include <stdio.h>

int main()
{
        char str[10];

        while ( scanf( "%s", str ) != EOF ) {
                if ( str[0] == str[1] && str[0] == str[2] ) { printf( "%c\n", str[0] ); }
                else if ( str[3] == str[4] && str[3] == str[5] ) { printf( "%c\n", str[3] ); }
                else if ( str[6] == str[7] && str[6] == str[8] ) { printf( "%c\n", str[6] ); }
                else if ( str[0] == str[3] && str[0] == str[6] ) { printf( "%c\n", str[0] ); }
                else if ( str[1] == str[4] && str[1] == str[7] ) { printf( "%c\n", str[1] ); }
                else if ( str[2] == str[8] && str[2] == str[8] ) { printf( "%c\n", str[2] ); }
                else if ( str[0] == str[4] && str[0] == str[8] ) { printf( "%c\n", str[0] ); }
                else if ( str[2] == str[4] && str[2] == str[6] ) { printf( "%c\n", str[2] ); }
                else { printf( "d\n" ); }
        }
        return 0;
}

