#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;
int d[][3] = {
	{0,1,2},{0,4,8},
	{0,3,6},{1,4,7},
	{2,5,8},{2,4,6},
	{3,4,5},{6,7,8}
};
char check(string str) {
	char ret = 'd';
	for(int i = 0; i < 8; i++) {
		int n1 = d[i][0],n2 = d[i][1], n3 = d[i][2];
		if(str[n1] == str[n2] && str[n2] == str[n3]) {
			ret = str[n1];
		}
	}
	return ret;
}
int main() {
	string str;
	while(cin >> str) {
		cout << check(str) << endl;
	}
	return 0;
}