#include <iostream>
#include <string>;
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

void solve();
int judge(char, char, char);
void answer(int);
int line[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} };
int result;
string board;

int main() {
    while (getline(cin, board)) {
        solve();
    }
    return 0;
}

void solve() {
    for (int i = 0; i < 8; i++) {
        result = judge(board[line[i][0]], board[line[i][1]], board[line[i][2]]);
        if (result) {
            answer(result);
            return;
        }
    }
    cout << "d" << endl;
    return;
}

int judge(char a, char b, char c) {
    if (a == 'o' && b == 'o' && c == 'o')return 2;
    if (a == 'x' && b == 'x' && c == 'x')return 1;
    return 0;
}

void answer(int result) {
    if (result == 2) cout << "o" << endl;
    if (result == 1) cout << "x" << endl;
    return;
}