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

int main()
{
	char ch[10],win;
	while (cin>>ch[1])
	{
		for (int i = 2; i < 10; i++)
		{
			cin >> ch[i];
		}

		win = 'd';
		
		for (int i = 1; i < 8; i+=3)
		{
			if ((ch[i] == ch[i + 1]) && (ch[i + 1] == ch[i + 2]))
			{
				win = ch[i];
				break;
			}
		}
		
		for (int i = 1; i < 4; i++)
		{
			if ((ch[i] == ch[i+3]) && (ch[i+3] == ch[i+6]))
			{
				win = ch[i];
				break;
			}
		}

		if ((ch[1]==ch[5]) && (ch[5]==ch[9]))
		{
			win = ch[1];
		}

		if ((ch[3]==ch[5]) && (ch[5]==ch[7]))
		{
			win = ch[3];
		}

		cout << win << endl;
	}
	return 0;
}