#include<iostream>
using namespace std;

int main() {
	char data[9];

	while(cin >> data){
		if (data[0] == data[1] && data[0] == data[2] ||
			data[0] == data[3] && data[0] == data[6] ||
			data[0] == data[4] && data[0] == data[8]) {

			cout << data[0] << endl;
		}
		else if (
			data[8] == data[7] && data[8] == data[6] ||
			data[8] == data[5] && data[8] == data[2]) {

			cout << data[8] << endl;
		}
		else if (
			data[4] == data[1] && data[4] == data[7] ||
			data[4] == data[3] && data[4] == data[5] ||
			data[4] == data[6] && data[4] == data[2]) {

			cout << data[4] << endl;
		}
		else {
			cout << 'd' << endl;
		}
	}
	return 0;
}