#include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back


int main() {
    string s;
    while(cin>>s){
        bool flag=false;
        rep(i,3){
            if( s[i*3]==s[i*3+1] && s[i*3+1]==s[i*3+2] && s[i*3]!='s'){
                cout<<s[i*3]<<endl;
                flag=true;
                goto next;
            }
        }
        
        rep(i,3){
            if( s[i]==s[i+3] && s[i+3]==s[i+6] && s[i]!='s'){
                cout<<s[i]<<endl;
                flag=true;
                goto next;
            }
        }
        if( ((s[0]==s[4] && s[4]==s[8]) || (s[2]==s[4] && s[4]==s[6])) && s[0]!='s' ){cout<<s[0]<<endl;flag=true;}
        
        next:;
        if(flag==false)cout<<"d"<<endl;
    }

    return 0;
}