#include <iostream>
#define abs(x) ( x>=0 ? x : -x )

int main() {
	
	char str[10];
	int map[3][3];
	int vec, hor, res;
	
	while( std::cin >> str) {
		// Load a map.
		for( int i=0; i<9; i++) {
			if(str[i]=='o') map[i%3][i/3] = 1;
			if(str[i]=='x') map[i%3][i/3] = -1;
			if(str[i]=='s') map[i%3][i/3] = 0;
		}
		
		res = 0;
		
		// diagonal
		vec = 0; hor = 0;
		for( int i=0; i<3; i++) {
			vec += map[i][i];
			hor += map[i][2-i];
		}
		if( abs(vec)==3 ) res = vec/3;
		if( abs(hor)==3 ) res = hor/3;
		
		// straight line
		if(!res) {
			for( int i=0; i<3; i++) {
				vec = 0; hor = 0;
				for( int j=0; j<3; j++) {
					vec += map[j][i]; hor += map[i][j];
				}
				if( abs(vec)==3 ) res = vec/3;
				if( abs(hor)==3 ) res = hor/3;
				if(res) break;
			}
		}
		// result
		std::cout << ( res!=0 ? ( res>0 ? "o" : "x" ) : "d" ) << std::endl;
	}
	return 0;
}