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

int main(void)
{
	char str[12];
	while (scanf("%s", str) != EOF){
		if ((str[0] != 's') && ((str[0] == str[1] && str[1] == str[2]) || (str[0] == str[3] && str[3] == str[6]) || (str[0] == str[4] && str[4] == str[8]))){
			cout << str[0] << endl;
		}
		else if ((str[4] != 's') && ((str[3] == str[4] && str[4] == str[5]) || (str[1] == str[4] && str[4] == str[7]) || (str[0] == str[4] && str[4] == str[8]) || (str[2] == str[4] && str[4] == str[6]))){
			cout << str[4] << endl;
		}
		else if ((str[8] != 's') && ((str[6] == str[7] && str[7] == str[8]) || (str[2] == str[5] && str[5] == str[8]))){
			cout << str[8] << endl;
		}
		else puts("d");
	}
	
	return (0);
}