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

bool solve (const string& s, const char ch)
{
	// horizonal
	if (s[0] == ch && s[1] == ch && s[2] == ch)
		return true;
	if (s[3] == ch && s[4] == ch && s[5] == ch)
		return true;
	if (s[6] == ch && s[7] == ch && s[8] == ch)
		return true;

	// vertical
	if (s[0] == ch && s[3] == ch && s[6] == ch)
		return true;
	if (s[1] == ch && s[4] == ch && s[7] == ch)
		return true;
	if (s[2] == ch && s[5] == ch && s[8] == ch)
		return true;

	// diagonal
	if (s[0] == ch && s[4] == ch && s[8] == ch)
		return true;
	if (s[2] == ch && s[4] == ch && s[6] == ch)
		return true;

	return false;
}

int main()
{
	string s;
	while (cin >> s) {
		if (solve(s, 'o'))
			cout << "o" << endl;
		else if (solve(s, 'x'))
			cout << "x" << endl;
		else
			cout << "d" << endl;
	}
	return 0;
}