#include <iostream>

using namespace std;

bool yoko( char key, int i, char data[3][3] ){
	if( data[0][i] == key && data[1][i] == key && data[2][i] == key ) return true;
	return false;
}

bool tate( char key, int i, char data[3][3] ){
	if( data[i][0] == key && data[i][1] == key && data[i][2] == key ) return true;
	return false;
}

bool hantei( char key, char data[3][3] )
{
	for( int i = 0;i < 3;i++ ){
		if( yoko( key, i, data ) ) return true;
		if( tate( key, i, data ) ) return true;
	}

	if( data[0][0] == key && data[1][1] == key && data[2][2] == key ) return true;

	if( data[2][0] == key && data[1][1] == key && data[0][2] == key ) return true;
	 return false;
}

int main(void)
{
	char data[3][3];

	while( true ){
		for( int i = 0;i < 3;i++ ){
			for( int j = 0;j < 3;j++ ){
				if( !( cin >> data[i][j] ) ) return 0;
			}
		}

		if( hantei( 'o', data ) ){
			cout << "o" << endl;
			continue;
		} else if( hantei( 'x', data ) ){
			cout << "x" << endl;
			continue;
		}

		cout << 'd' << endl;
	}
	return 0;
}