#include <iostream>
#include <string>
using namespace std;

int main()
{
	string str;
	int check[8][3] =
	{
		{0,1,2},
		{3,4,5},
		{6,7,8},
		{0,3,6},
		{1,4,7},
		{2,5,8},
		{0,4,8},
		{2,4,6}
	};

	while (cin >> str)
	{
		for (int i = 0; i < 8; i++)
		{
			if (str[check[i][0]] == 'o' && str[check[i][1]] == 'o' && str[check[i][2]] == 'o')
			{
				cout << 'o' << endl;
				break;
			}
			if (str[check[i][0]] == 'x' && str[check[i][1]] == 'x' && str[check[i][2]] == 'x')
			{
				cout << 'x' << endl;
				break;
			}
			if (i == 7) cout << 'd' << endl;
		}
	}

	return 0;
}