#include <iostream>
#include <string>
using namespace std;
int main( void )
{
	string in;
	while ( cin >> in )
	{
		bool ok = true;
		for ( int i = 0; ok && i < 3; i++ )
		{
			if ( in[i*3] != 's' && in[i*3] == in[i*3+1] && in[i*3+1] == in[i*3+2] )
			{
				cout << in[i*3] << endl;
				ok = false;
			}
		}
		for ( int i = 0; ok && i < 3; i++ )
		{
			if ( in[i*3] != 's' && in[i*3] == in[i*3+3] && in[i*3+3] == in[i*3+6] )
			{
				cout << in[i*3] << endl;
				ok = false;
			}
		}
		if ( ok && in[0] != 's' && in[0] == in[4] && in[4] == in[8] )
		{
			cout << in[0] << endl;
			ok = false;
		}
		if ( ok && in[2] != 's' && in[2] == in[4] && in[4] == in[6] )
		{
			cout << in[2] << endl;
			ok = false;
		}

		if ( ok )
			cout << "d" << endl;
	}
}