// 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]==brd[0][1]&&brd[0][1]==brd[0][2])
			cout << brd[0][0] << endl;
		else if(brd[1][0]==brd[1][1]&&brd[1][1]==brd[1][2])
			cout << brd[1][0] << endl;
		else if(brd[2][0]==brd[2][1]&&brd[2][1]==brd[2][2])
			cout << brd[2][0] << endl;
		else if(brd[0][0]==brd[1][0]&&brd[1][0]==brd[2][0])
			cout << brd[0][0] << endl;
		else if(brd[0][1]==brd[1][1]&&brd[1][1]==brd[2][1])
			cout << brd[0][1] << endl;
		else if(brd[0][2]==brd[1][2]&&brd[1][2]==brd[2][2])
			cout << brd[0][2] << endl;
		else if(brd[0][0]==brd[1][1]&&brd[1][1]==brd[2][2])
			cout << brd[0][0] << endl;
		else if(brd[0][2]==brd[1][1]&&brd[1][1]==brd[2][0])
			cout << brd[0][2] << endl;
		else
			cout << 'd' << endl;
	}

	return 0;
}