#include<iostream>
using namespace std;
int main() {
	char l[9];
	while (cin >> l){
		if		(l[0] == l[1] && l[1] == l[2] && l[0] != 's')cout << l[0] << endl;
		else if (l[3] == l[4] && l[4] == l[5] && l[3] != 's')cout << l[3] << endl;
		else if (l[6] == l[7] && l[7] == l[8] && l[6] != 's')cout << l[6] << endl;
		else if (l[0] == l[3] && l[3] == l[6] && l[0] != 's')cout << l[0] << endl;
		else if (l[1] == l[4] && l[4] == l[7] && l[1] != 's')cout << l[1] << endl;
		else if (l[2] == l[5] && l[5] == l[8] && l[2] != 's')cout << l[2] << endl;
		else if (l[2] == l[4] && l[4] == l[6] && l[2] != 's')cout << l[3] << endl;
		else if (l[0] == l[4] && l[4] == l[8] && l[0] != 's')cout << l[3] << endl;
		else cout << 'd' << endl;
		}
	}