#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <cstring>
#include <utility>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#define debug(x) cerr << #x << ':' << x << endl
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define ALL(c) (c).begin(), (c).end()
using namespace std;
typedef long long ll;

int main(){
    string s;
    while(cin >> s){
        if( (s[0]==s[1] && s[1]==s[2]) && (s[0]=='o' || s[0]=='x')  ) cout << s[0] << endl;
        else if( (s[3]==s[4] && s[4]==s[5]) && (s[3]=='o' || s[3]=='x') ) cout << s[3] << endl;
        else if( (s[6]==s[7] && s[7]==s[8]) && (s[6]=='o' || s[6]=='x') ) cout << s[6] << endl;
        else if( (s[0]==s[3] && s[3]==s[6]) && (s[0]=='o' || s[0]=='x') ) cout << s[0] << endl;
        else if( (s[1]==s[4] && s[4]==s[7]) && (s[1]=='o' || s[1]=='x') ) cout << s[1] << endl;
        else if( (s[2]==s[5] && s[5]==s[8]) && (s[2]=='o' || s[2]=='x') ) cout << s[2] << endl;
        else if( (s[0]==s[4] && s[4]==s[8]) && (s[0]=='o' || s[0]=='x') ) cout << s[0] << endl;
        else if( (s[2]==s[4] && s[4]==s[6]) && (s[2]=='o' || s[2]=='x') ) cout << s[2] << endl;
        else cout << 'd' << endl;
    }
    return 0;
}
