#include <iostream>
using namespace std;
int main()
{
	int i, j, f, n;
	char t[10], b;
	while (cin >> t)
	{
		if (cin.eof()) break;
		for (i = 0; i < 3; i++)
		{
			f = 0;
			for (j = 0; j < 3; j++)
			{
				n = 3 * i + j;
				if (t[n] != 's')
				{
					if (j == 0)
					{
						b = t[n];
						f++;
					}
					else if (t[n] == b)
					{
						f++;
						if (f == 3)
						{
							cout << b << endl;
							break;
						}
					}
					else
						break;
				}
				else
					break;
			}
			if (f == 3) break;
		}
		if (f == 3) continue;
		for (i = 0; i < 3; i++)
		{
			f = 0;
			for (j = 0; j < 3; j++)
			{
				n = i + j * 3;
				if (t[n] != 's')
				{
					if (j == 0)
					{
						b = t[n];
						f++;
					}
					else if (t[n] == b)
					{
						f++;
						if (f == 3)
						{
							cout << b << endl;
							break;
						}
					}
					else
						break;
				}
				else
					break;
			}
			if (f == 3) break;
		}
		if (f == 3) continue;
		f = 0;
		for (i = 0; i < 3; i++)
		{
			n = i * 4;
			if (t[n] != 's')
			{
				if (i == 0)
				{
					b = t[n];
					f++;
				}
				else if (t[n] == b)
				{
					f++;
					if (f == 3)
					{
						cout << b << endl;
						break;
					}
				}
				else
					break;
			}
			else
				break;
		}
		if (f == 3) continue;
		f = 0;
		for (i = 2; i >= 0; i++)
		{
			n = 6 - i * 2;
			if (t[n] != 's')
			{
				if (i == 0)
				{
					b = t[n];
					f++;
				}
				else if (t[n] == b)
				{
					f++;
					if (f == 3)
					{
						cout << b << endl;
						break;
					}
				}
				else
				{
					cout << "d" << endl;
					break;
				}
			}
			else
			{
				cout << "d" << endl;
				break;
			}
		}
	}
}