#include<iostream>
#include<string>

#define ROW 3
#define COL 3
#define MAX (ROW*COL)

using namespace std;

int main(void){
	while( 1 ){
		char win = 'd';
		bool Found = true;
		string s;

		cin >> s;
		if( cin.eof() ) break;

		/* æ± */
		for(int i = 0; i < MAX; i += COL){
			for(int j = 0; j < COL - 1; j++){
				if( s[i + j] != s[i + j + 1]) Found = false;
			}
			if( Found ) win = s[i];
		}

		/* ½Ä */
		Found = true;
		for(int i = 0; i < COL; i++){
			for(int j = 0; j < MAX - COL; j += COL){
				if( s[i + j] != s[i + j + COL]) Found = false;
			}
			if( Found ) win = s[i];
		}
		
		/* ÈÈß */
		if( ROW == COL ){
			Found = true;
			for(int i = 0; i < MAX - (ROW + 1); i += (ROW + 1)){
				if( s[i] != s[i + (ROW + 1)] ) Found = false;
			}
			if( Found ) win = s[0];
			
			Found = true;
			for(int i = COL - 1; i < MAX - (COL - 1); i += (COL - 1)){
				if( s[i] != s[i + (COL - 1)] ) Found = false;
			}
			if( Found ) win = s[COL - 1];
		}

		cout << win << endl;
	}
	return 0;
}