#include <bits/stdc++.h>

using namespace std;

int main()
{
    string s;
    while (cin >> s) {
        char c[3][3];
        for (int i = 0; i < 9; i++) {
            c[i/3][i%3] = s[i];
        }

        auto check = [&](char m) -> bool {
            for (int i = 0; i < 3; i++) {
                if (c[i][0] == m && c[i][1] == m && c[i][2] == m) {
                    return true;
                }
                if (c[0][i] == m && c[1][i] == m && c[2][i] == m) {
                    return true;
                }
            }
            if (c[0][0] == m && c[1][1] == m && c[2][2] == m) {
                return true;
            }
            if (c[0][2] == m && c[1][1] == m && c[2][0] == m) {
                return true;
            }
            return false;
        };

        if (check('o')) {
            cout << 'o' << endl;
        } else if (check('x')) {
            cout << 'x' << endl;
        } else {
            cout << 'd' << endl;
        }
    }
    return 0;
}