#include <bits/stdc++.h>
  
using namespace std;
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)
  
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()
  
#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

#define INF 1000000000

typedef long double Real;
#define EPS 1e-11
#define EQ(x) (-EPS<x && x<EPS)
typedef complex<Real> P;
Real dot(P a,P b){return real(conj(a)*b);}
Real cross(P a,P b){return imag(conj(a)*b);}

char s[10];
bool eq(int a,int b,int c,char o){
  return (s[a]==o && s[b]==o && s[c]==o);
}

int main(){
  while(~scanf("%s",s)){
    bool owin = false;
    owin |= eq(0,1,2,'o');
    owin |= eq(3,4,5,'o');
    owin |= eq(6,7,8,'o');
    owin |= eq(0,3,6,'o');
    owin |= eq(1,4,7,'o');
    owin |= eq(2,5,8,'o');
    owin |= eq(0,4,8,'o');
    owin |= eq(2,4,6,'o');
    bool xwin = false;
    xwin |= eq(0,1,2,'x');
    xwin |= eq(3,4,5,'x');
    xwin |= eq(6,7,8,'x');
    xwin |= eq(0,3,6,'x');
    xwin |= eq(1,4,7,'x');
    xwin |= eq(2,5,8,'x');
    xwin |= eq(0,4,8,'x');
    xwin |= eq(2,4,6,'x');
    if(owin)cout<<"o"<<endl;
    else if(xwin)cout<<"x"<<endl;
    else cout<<"d"<<endl;
  }
  return 0;
}