#include<iostream>
#include<string>

using namespace std;

int win[8][3]={
	{1,2,3},
	{4,5,6},
	{7,8,9},
	{1,4,7},
	{2,5,8},
	{3,6,9},
	{1,5,9},
	{3,5,7}
};

int main(void)
{
	for(int i=0;i<8;i++)
	{
		for(int j=0;j<3;j++)
		{
			win[i][j]--;
		}
	}
	while(1)
	{
		string s;
		cin>>s;
		if(cin.eof())break;
		char c='d';
		for(int i=0;i<8;i++)
		{
			if(s[win[i][0]]!='s'&&s[win[i][0]]==s[win[i][1]]&&s[win[i][1]]==s[win[i][2]])
			{
				c=s[win[i][0]];
			}
		}
		cout<<c<<endl;
	}
}