#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define mp            make_pair
#define pb            push_back
template<class T1, class T2> inline void minup(T1& m, T2 x){ if(m>x) m=static_cast<T2>(x); }
template<class T1, class T2> inline void maxup(T1& m, T2 x){ if(m<x) m=static_cast<T2>(x); }

#define INF 1000000000
#define MOD 1000000007
#define EPS 1E-12

const int N = 3;
char m[N][N+1];

int main()
{
  while(true){
    rep(i, N) rep(j, N) if(!(cin >> m[i][j])) return 0;
    bool flag = false;
    rep(i, N){
      flag = true;  rep(j, N) flag &= (m[i][j] == m[i][0]);  if(flag){ cout << m[i][0] << endl;  break; }
      flag = true;  rep(j, N) flag &= (m[j][i] == m[0][i]);  if(flag){ cout << m[0][i] << endl;  break; }
    }

    if(flag) continue;

    flag = true;  rep(i, N) flag &= (m[i][i] == m[0][0]);          if(flag){ cout << m[0][0] << endl;  continue; }
    flag = true;  rep(i, N) flag &= (m[i][N-i-1] == m[0][N-1]);    if(flag){ cout << m[0][N-1] << endl;  continue; }

    cout << 'd' << endl;
  }

  return 0;
}