#include <iostream>

using namespace std;

enum OXD { O = 0, X = 1, D = 2};

char hyou[7][7];

OXD hantei(void) {
	for (int i = 2; i < 5; i++) {
		for (int j = 2; j < 5; j++) {
			if (hyou[i][j] == 'o') {
				if (hyou[i][j+1] == 'o' && hyou[i][j+2] == 'o') {
					return O;
				}

				if (hyou[i+1][j] == 'o' && hyou[i+2][j] == 'o') {
					return O;
				}

				if (hyou[i+1][j+1] == 'o' && hyou[i+2][j+2] == 'o') {
					return O;
				}

				if (hyou[i+1][j-1] == 'o' && hyou[i+2][j-2] == 'o') {
					return O;
				}
			}
		}
	}

	for (int i = 2; i < 5; i++) {
		for (int j = 2; j < 5; j++) {
			if (hyou[i][j] == 'x') {
				if (hyou[i][j+1] == 'x' && hyou[i][j+2] == 'x') {
					return X;
				}

				if (hyou[i+1][j] == 'x' && hyou[i+2][j] == 'x') {
					return X;
				}

				if (hyou[i+1][j+1] == 'x' && hyou[i+2][j+2] == 'x') {
					return X;
				}

				if (hyou[i+1][j-1] == 'x' && hyou[i+2][j-2] == 'x') {
					return X;
				}
			}
		}
	}

	return D;
}

int main() {
	char a;
	OXD h;
	while (cin >> a) {
		for (int i = 0; i < 7; i++) {
			for (int j = 0; j < 7; j++) {
				hyou[i][j] = 's';
			}
		}
		hyou[2][2] = a;
		cin >> hyou[2][3] >> hyou[2][4];
		for (int i = 3; i < 5; i++) {
			for (int j = 2; j < 5; j++) {
				cin >> hyou[i][j];
			}
		}
		h = hantei();
		if (h == O) {
			cout << 'o' << endl;
		} else if (h == X) {
			cout << 'x' << endl; 
		} else {
			cout << 'd' << endl;
		}
	}
	return 0;
}