// 2011/05/04 Tazoe

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

int main()
{
	while(!cin.eof()){
		string str;
		getline(cin, str);
		if(str.empty())
			continue;

		istringstream ist(str);
		char brd[3][3];
		for(int i=0; i<3; i++)
			for(int j=0; j<3; j++)
				ist >> brd[i][j];

		if(brd[0][0]=='o'&&brd[0][1]=='o'&&brd[0][2]=='o')
			cout << 'o' << endl;
		else if(brd[1][0]=='o'&&brd[1][1]=='o'&&brd[1][2]=='o')
			cout << 'o' << endl;
		else if(brd[2][0]=='o'&&brd[2][1]=='o'&&brd[2][2]=='o')
			cout << 'o' << endl;
		else if(brd[0][0]=='o'&&brd[1][0]=='o'&&brd[2][0]=='o')
			cout << 'o' << endl;
		else if(brd[0][1]=='o'&&brd[1][1]=='o'&&brd[2][1]=='o')
			cout << 'o' << endl;
		else if(brd[0][2]=='o'&&brd[1][2]=='o'&&brd[2][2]=='o')
			cout << 'o' << endl;
		else if(brd[0][0]=='o'&&brd[1][1]=='o'&&brd[2][2]=='o')
			cout << 'o' << endl;
		else if(brd[0][2]=='o'&&brd[1][1]=='o'&&brd[2][0]=='o')
			cout << 'o' << endl;
		else if(brd[0][0]=='x'&&brd[0][1]=='x'&&brd[0][2]=='x')
			cout << 'x' << endl;
		else if(brd[1][0]=='x'&&brd[1][1]=='x'&&brd[1][2]=='x')
			cout << 'x' << endl;
		else if(brd[2][0]=='x'&&brd[2][1]=='x'&&brd[2][2]=='x')
			cout << 'x' << endl;
		else if(brd[0][0]=='x'&&brd[1][0]=='x'&&brd[2][0]=='x')
			cout << 'x' << endl;
		else if(brd[0][1]=='x'&&brd[1][1]=='x'&&brd[2][1]=='x')
			cout << 'x' << endl;
		else if(brd[0][2]=='x'&&brd[1][2]=='x'&&brd[2][2]=='x')
			cout << 'x' << endl;
		else if(brd[0][0]=='x'&&brd[1][1]=='x'&&brd[2][2]=='x')
			cout << 'x' << endl;
		else if(brd[0][2]=='x'&&brd[1][1]=='x'&&brd[2][0]=='x')
			cout << 'x' << endl;
		else
			cout << 'd' << endl;
	}

	return 0;
}