#include <iostream>
#include <cstdio>
using namespace std;

int main(){
	char s[9];
	bool o, x;
	
	
	while(scanf("%s", s) != EOF){
		o = x = false;
		for(int i = 0; i < 9; i += 3){
			if(s[i] == s[i+1] && s[i] == s[i+2]){
				if(s[i] == 'o') o = true;
				else if(s[i] == 'x') x = true;
			}
		}
		for(int i = 0; i < 3; i++){
			if(s[i] == s[i+3] && s[i] == s[i+6]){
				if(s[i] == 'o') o = true;
				else if(s[i] == 'x') x = true;
			}
		}
		if(s[0] == s[4] && s[0] == s[8]){
			if(s[0] == 'o') o = true;
			else if(s[0] == 'x') x = true;
		}
		if(s[2] == s[4] && s[2] == s[6]){
			if(s[0] == 'o') o = true;
			else if(s[0] == 'x') x = true;
		}
		
		if(o == false && x == false){
			cout << "d" << endl;
		}else if(o == true){
			cout << "o" << endl;
		}else if(x == true){
			cout << "x" << endl;
		}
	}
	
	return 0;
}