#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<sstream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cctype>
#include<climits>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
#define P pair<int, int>
const int INF = INT_MAX / 2;
const int N = 1000000;

int check(string str, char c){
    int ok[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}};
    REP(i, 8){
        int cnt = 0;
        REP(j, 3) if(str[ok[i][j]] == c) ++cnt;
        if(cnt == 3) return true;
    }
    return false;
}

int main(){
    string str;
    while(cin >>str){
        if(check(str, 'o')) cout <<'o' <<endl;
        else if(check(str, 'x')) cout <<'x' <<endl;
        else cout <<'d' <<endl;
    }
    return 0;
}