#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

int main() {
	string s;
	int index[8][3] = {
		{0, 1, 2},
		{3, 4, 5},
		{6, 7, 8},
		{0, 3, 6},
		{1, 4, 7},
		{2, 5, 8},
		{0, 4, 8},
		{2, 4, 6},
	};
	while (cin >> s) {
		string result = "d";
		for (int i = 0; i < 8; i++) {
			int a = index[i][0];
			int b = index[i][1];
			int c = index[i][2];
			if (s[a] == s[b] && s[b] == s[c]) {
				result = s[a];
				break;
			}
		}
		cout << result << endl;
	}
	return 0;
}