#include <iostream>

using namespace std;

void solve()
{
	char str[9];
	while(cin >> str)
	{
		if(str[0] == str[1] && str[0] == str[2] && str[0] != 's')
		{
			cout << str[0] << endl;
		}
		else if(str[3] == str[4] && str[3] == str[5] && str[3] != 's')
		{
			cout << str[3] << endl;
		}
		else if(str[6] == str[7] && str[6] == str[8] && str[6] != 's')
		{
			cout << str[6] << endl;
		}
		else if(str[0] == str[3] && str[0] == str[6] && str[0] != 's')
		{
			cout << str[0] << endl;
		}
		else if(str[1] == str[4] && str[1] == str[7] && str[1] != 's')
		{
			cout << str[1] << endl;
		}
		else if(str[2] == str[5] && str[2] == str[8] && str[2] != 's')
		{
			cout << str[2] << endl;
		}
		else if(str[0] == str[4] && str[0] == str[8] && str[0] != 's')
		{
			cout << str[0] << endl;
		}
		else if(str[2] == str[4] && str[2] == str[6] && str[2] != 's')
		{
			cout << str[2] << endl;
		}
		else
		{
			cout << "d" << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}