#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <string>
#include <sstream>
 
#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif

bool does_win(std::string str, char c){
	if(str[0] == c && str[1] == c && str[2] == c){
		return true;
	}
	if(str[3] == c && str[4] == c && str[5] == c){
		return true;
	}
	if(str[6] == c && str[7] == c && str[8] == c){
		return true;
	}
	if(str[0] == c && str[3] == c && str[6] == c){
		return true;
	}
	if(str[1] == c && str[4] == c && str[7] == c){
		return true;
	}
	if(str[2] == c && str[5] == c && str[8] == c){
		return true;
	}
	if(str[0] == c && str[4] == c && str[8] == c){
		return true;
	}
	if(str[2] == c && str[4] == c && str[6] == c){
		return true;
	}
	return false;
}

int main(int argc, char **argv){
	std::string str;


#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
	//FILE *fp = fopen("test.txt", "r");
#endif


#if INPUT_FROM_FILE
	while(std::getline(ifs, str)){
#else
	while(std::getline(std::cin, str)){
#endif
		if(does_win(str, 'o')){
			std::cout << "o" << std::endl;
		}
		else if(does_win(str, 'x')){
			std::cout << "x" << std::endl;
		}
		else{
			std::cout << "d" << std::endl;
		}

	}
 
#if INPUT_FROM_FILE
	//fclose(fp);
#endif
    return 0;
}
