#include<iostream>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cstring>
#include<climits>
#include<cmath>
#include<map>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()

typedef unsigned int uint;
typedef long long ll;

using namespace std;

int main(){
  string str;
  while(cin>>str){
    char buff[3][3];
    REP(i,3) REP(j,3)
      buff[i][j] = str[i*3+j];

    REP(i,3){
      if(buff[i][0] == buff[i][1] &&
         buff[i][1] == buff[i][2] &&
         buff[i][0] != 's'){
        cout << buff[i][0] << endl;
        goto end;
      }
      if(buff[0][i] == buff[1][i] &&
         buff[1][i] == buff[2][i] &&
         buff[0][i] != 's'){
        cout << buff[0][i] << endl;
        goto end;
      }
    }
    if(buff[0][0] == buff[1][1] &&
       buff[1][1] == buff[2][2] &&
       buff[0][0] != 's'){
      cout << buff[0][0] << endl;
      goto end;
    }
    if(buff[2][0] == buff[1][1] &&
       buff[1][1] == buff[0][2] &&
       buff[2][0] != 's'){
      cout << buff[2][0] << endl;
      goto end;
    }
    cout << 'd' << endl;
  end:;
  }
  return 0;
}