#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl
#define Cout2(x, y) cout << (x) << " " << (y) << endl
#define dump(x) cerr << #x << " = " << (x) << endl;
typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
const int inf = 1e9;
const double pi = acos(-1.0);

int main() {
	string s;
	while (cin >> s) {
		VS c(3);
		rep(i, 9)c[i / 3] += s[i];

		int ans = 3;

		rep(i, 3) {
			if (count(all(c[i]), 'o') == 3)ans = 1;
			if (count(all(c[i]), 'x') == 3)ans = 2;
		}

		rep(i, 3) {
			int co = 0, cx = 0;
			rep(j, 3) {
				if (c[j][i] == 'o')co++;
				if (c[j][i] == 'x')cx++;
			}
			if (co == 3)ans = 1;
			if (cx == 3)ans = 2;
		}

		int co1 = 0, cx1 = 0;
		rep(i, 3) {
			if (c[i][i] == 'o')co1++;
			if (c[i][i] == 'x')cx1++;
		}
		if (co1 == 3)ans = 1;
		if (cx1 == 3)ans = 2;

		if (c[0][2] == c[1][1] && c[1][1] == c[2][0]) {
			if (c[0][2] == 'o')ans = 1;
			if (c[0][2] == 'x')ans = 2;
		}

		puts(ans == 1 ? "o" : ans == 2 ? "x" : "d");
	}
}
