#include <iostream>
using namespace std;

int main()
{
    char in[10];
    char r;
    while (scanf("%s",in) != EOF)
    {
	r='d';
	if (in[0] == in[4] && in[0] == in[8] && in[0] != 's')
	    r=in[0];
	if (in[2] == in[4] && in[2] == in[6] && in[2] != 's')
	    r=in[2];
	for (int i=0; i<3; i++)
	{
	    if (in[i*3] == in[i*3+1] && in[i*3] == in[i*3+2] && in[i*3] != 's')
		r=in[i*3];
	    if (in[i] == in[i+3] && in[i] == in[i+6] && in[i] != 's')
		r=in[i];
	}
	printf("%c\n",r);
    }
    return 0;
}