#include <iostream>
#include <string>
using namespace std;
string s;
bool isall(char c, int p, int d) {
	for (int i = 0; i < 3; i++) {
		if (s[p + d * i] != c) return false;
	}
	return true;
}
bool win(char c) {
	for (int i = 0; i < 9; i += 3) {
		if (isall(c, i, 1)) return true;
	}
	for (int i = 0; i < 3; i++) {
		if (isall(c, i, 3)) return true;
	}
	if (isall(c, 0, 4)) return true;
	if (isall(c, 2, 2)) return true;
	return false;
}

int main() {
	while (cin >> s) {
		if(win('o')) cout << 'o' << endl;
		else if (win('x')) cout << 'x' << endl;
		else cout << 'd' << endl;
	}
	return 0;
}