#include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	char a, b, c, d, e, f, g, h, i;
	
	while((cin >> a >> b >> c >> d >> e >> f >> g >> h >> i)){
		if(((a == b && b == c)||(a == d && a == g)||(a == e && e == i)) && ( a != 's')){
			cout << a << endl;
		} else if(((b == e && e == h) || (e == d && e == f) || (c == e && c == g)) && (e != 's')){
			cout << e << endl;
		} else if(((c == f && f == i) || (g == h && g == i)) && (i != 's')){
			cout << i << endl;
		} else {
			cout << 'd' << endl;
		}
	}
	
	return 0;
}