#include<iostream>
#include<string>

int main()
{
	std::string s;
	while( std::cin >> s )
	{
		bool f = false;
		for( int i = 0; i != 3; ++i )
		{
			if( s[i*3] != 's' && s[i*3] == s[i*3+1] && s[i*3+1] == s[i*3+2] )
				std::cout << s[i*3] << std::endl, f = true;
			else if( s[i] != 's' && s[i] == s[i+3] && s[i+3] == s[i+6] )
				std::cout << s[i] << std::endl, f = true;
		}

		if( s[4] != 's' )
			if( ( s[0] == s[4] && s[4] == s[8] ) || ( s[2] == s[4] && s[4] == s[6] ) )
				std::cout << s[4] << std::endl, f = true;

		if( !f )
			std::cout << "d" << std::endl;
	}

	return 0;
}