#include <iostream>
using namespace std;
int main()
{
	int i;
	char s[10], r;
	bool f;
	while (cin >> s)
	{
		if (s[0] != 's' && s[0] == s[1] && s[1] == s[2])
			cout << s[0] << endl;
		else if (s[3] != 's' && s[3] == s[4] && s[4] == s[5])
			cout << s[3] << endl;
		else if (s[6] != 's' && s[6] == s[7] && s[7] == s[8])
			cout << s[6] << endl;
		else if (s[0] != 's' && s[0] == s[3] && s[3] == s[6])
			cout << s[0] << endl;
		else if (s[1] != 's' && s[1] == s[4] && s[4] == s[7])
			cout << s[1] << endl;
		else if (s[2] != 's' && s[2] == s[5] && s[5] == s[8])
			cout << s[2] << endl;
		else if (s[0] != 's' && s[0] == s[4] && s[4] == s[8])
			cout << s[0] << endl;
		else if (s[2] != 's' && s[2] == s[4] && s[4] == s[6])
			cout << s[2] << endl;
		else
			cout << "d" << endl;
	}
}