#include<iostream>
#include<string>
using namespace std;
int main()
{
	string in;
	while(cin>>in)
	{
		if(in[0]==in[4]&&in[4]==in[8])
		{
			if(in[0]=='o')
			{
				cout<<"o"<<endl;
				continue;
			}
			else if(in[0]=='x')
			{
				cout<<"x"<<endl;
				continue;
			}
		}
		if(in[2]==in[4]&&in[4]==in[6])
		{
			if(in[2]=='o')
			{
				cout<<"o"<<endl;
				continue;
			}
			else if(in[2]=='x')
			{
				cout<<"x"<<endl;
				continue;
			}
		}
		if(in[0]==in[1]&&in[1]==in[2])
		{
			if(in[0]=='o')
			{
				cout<<"o"<<endl;
				continue;
			}
			else if(in[0]=='x')
			{
				cout<<"x"<<endl;
				continue;
			}
		}
		if(in[3]==in[4]&&in[4]==in[5])
		{
			if(in[3]=='o')
			{
				cout<<"o"<<endl;
				continue;
			}
			else if(in[3]=='x')
			{
				cout<<"x"<<endl;
				continue;
			}
		}
		if(in[6]==in[7]&&in[7]==in[8])
		{
			if(in[6]=='o')
			{
				cout<<"o"<<endl;
				continue;
			}
			else if(in[6]=='x')
			{
				cout<<"x"<<endl;
				continue;
			}
		}
		if(in[0]==in[3]&&in[3]==in[6])
		{
			if(in[0]=='o')
			{
				cout<<"o"<<endl;
				continue;
			}
			else if(in[0]=='x')
			{
				cout<<"x"<<endl;
				continue;
			}
		}
		if(in[1]==in[4]&&in[4]==in[7])
		{
			if(in[1]=='o')
			{
				cout<<"o"<<endl;
				continue;
			}
			else if(in[1]=='x')
			{
				cout<<"x"<<endl;
				continue;
			}
		}
		if(in[2]==in[5]&&in[5]==in[8])
		{
			if(in[2]=='o')
			{
				cout<<"o"<<endl;
				continue;
			}
			else if(in[2]=='x')
			{
				cout<<"x"<<endl;
				continue;
			}
		}
		cout<<"d"<<endl;
	}
  return 0;
}