#include <iostream>
#include <string>
#include <vector>
using namespace std;

vector<string> tile;

void solve(int n) {
    vector<string> _tile(3);
    for (int i = 0; i < 3; i++) {
        _tile[i] = tile[i].substr(n, 3);
    }

//    for (int i = 0; i < 3; i++) {
//        cout << _tile[i] << endl;
//    }

    // check horizontal
    for (int i = 0; i < 3; i++) {
        if (_tile[i][0] == _tile[i][1] && _tile[i][1] == _tile[i][2]) {
            if (_tile[i][0] == 's') {
                cout << 'd' << endl;
                return;
            }
            cout << _tile[i][0] << endl;
            return;
        }
    }
    // check vertical
    for (int i = 0; i < 3; i++) {
        if (_tile[0][i] == _tile[1][i] && _tile[1][i] == _tile[2][i]) {
            if (_tile[0][i] == 's') {
                cout << 'd' << endl;
                return;
            }
            cout << _tile[0][i] << endl;
            return;
        }
    }
    // check diag
    if (_tile[0][0] == _tile[1][1] && _tile[1][1] == _tile[2][2]) {
        if (_tile[0][0] == 's') {
            cout << 'd' <<endl;
            return;
        }
        cout << _tile[0][0] << endl;
        return;
    }
    if (_tile[0][2] == _tile[1][1] && _tile[1][1] == _tile[2][0]) {
        if (_tile[0][2] == 's') {
            cout << 'd' << endl;
            return;
        }
        cout << _tile[0][2] << endl;
        return;
    }
    cout << 'd' << endl;
}

int main() {
    tile.resize(3);
    for (int i = 0; i < 3; i++) {
        cin >> tile[i];
    }
    int lim = tile[0].size();
    for (int i = 0; i < lim; i+=3) {
        solve(i);
    }
    return 0;
}