#include<stdio.h>
int main()
{
    char sq[10];
    int p[2];
    int i,j,pos,winner;
    p[0]=p[1]=0;
    while (scanf("%s",sq) != EOF) {
        winner=-1;
        for (i=1;i<=3;i++) {
            for (j=1;j<=3;j++) {
                pos = i*j-1;
                if (sq[pos]=='o') p[0]++;
                else if (sq[pos]=='x') p[1]++;
            }
            if (p[0]==3) winner=1;
            else if (p[1]==3) winner=0;
            if (winner!=-1) break;
            p[0]=p[1]=0;
        }
        if (winner!=-1) {
            for (i=0;i<3;i++) {
                for (j=i;j<i+6;j+=3) {
                    pos = j;
                    if (sq[pos]=='o') p[0]++;
                    else if (sq[pos]=='x') p[1]++;
                }
                if (p[0]==3) winner=1;
                else if (p[1]==3) winner=0;
                if (winner!=-1) break;
                p[0]=p[1]=0;
            }
        }
        if (winner!=-1) {
            for (i=0;i<9;i+=4) {
                if (sq[i]=='o') p[0]++;
                else if (sq[i]=='x') p[1]++;
            }
            if (p[0]==3) winner=1;
            else if (p[1]==3) winner=0;
        }
        if (winner!=-1) {
            for (i=2;i<=6;i+=2) {
                if (sq[i]=='o') p[0]++;
                else if (sq[i]=='x') p[1]++;
            }
            if (p[0]==3) winner=1;
            else if (p[1]==3) winner=0;
        }
        printf("%s\n",(winner==1)?"o":(winner==0)?"x":"d");
    }
    return 0;
}