#include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <map>
#include <numeric>
#include <sstream>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()
#define print(s) cout << (s) << endl

bool hasline(char c, char bd[3][3]) {
    if (bd[0][0] == c && bd[0][1] == c && bd[0][2] == c) return true;
    if (bd[1][0] == c && bd[1][1] == c && bd[1][2] == c) return true;
    if (bd[2][0] == c && bd[2][1] == c && bd[2][2] == c) return true;
    if (bd[0][0] == c && bd[1][0] == c && bd[2][0] == c) return true;
    if (bd[0][1] == c && bd[1][1] == c && bd[2][1] == c) return true;
    if (bd[0][2] == c && bd[1][2] == c && bd[2][2] == c) return true;
    if (bd[0][0] == c && bd[1][1] == c && bd[2][2] == c) return true;
    if (bd[0][2] == c && bd[1][1] == c && bd[2][0] == c) return true;
    return false;
}

void solve67(string s) {
    char bd[3][3];
    REP(i,3) REP(j,3) bd[i][j] = s[3*i+j];
    if (hasline('o', bd)) {
        cout << "o" << endl;
    }else if (hasline('x', bd)) {
        cout << "x" << endl;
    }else {
        cout << "d" << endl;
    }
}

int main() {
    string s;
    while(cin >> s) {
        solve67(s);
    }
    return 0;
}