#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>

using namespace std;

bool isWin( string s, char c ) {
	//縦
	bool b = false;
	for( int i = 0; i < 3; i++ )
		b |= ( s[i] == c && s[i + 3] == c && s[i + 6] == c);
	if( b ) return true;
	//横
	b = false;
	for( int i = 0; i < 3; i++ )
		b |= ( s[i*3] == c && s[i*3 + 1] == c && s[i*3 + 2] == c );
	if( b ) return true;
	//斜め
	if( s[0] == c && s[4] == c && s[8] == c ) return true;
	if( s[2] == c && s[4] == c && s[6] == c ) return true;
	return false;

}

int main(void){
	
	while( true ) {
		string str;
		if( cin.eof() ) break;
		getline( cin, str );
		if( str == "\n" || str == "" ) break;
		//oの勝利判定
		if( isWin( str, 'o' ) ) cout << "o" << endl;
		else if( isWin( str, 'x' ) ) cout << "x" << endl;
		else cout << "d" << endl;
		
	}


    return 0;
}