#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cstring>
#include <functional>

using namespace std;

#define rep(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define foreach(itr,c) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)

int main(){
  int i,j,k;

  string in;
  while(cin >> in){
    rep(i,in.size()){
      if(in[i] == 's') in[i] = rand() % 50 + '0';
    }
    if(in[0] == in[1] && in[1] == in[2]){
      cout << in[0] << endl;
      continue;
    }
    if(in[3] == in[4] && in[4] == in[5]){
      cout << in[3] << endl;
      continue;
    }
    if(in[6] == in[7] && in[7] == in[8]){
      cout << in[6] << endl;
      continue;
    }
    if(in[0] == in[4] && in[4] == in[8]){
      cout << in[0] << endl;
      continue;
    }
    if(in[2] == in[4] && in[4] == in[6]){
      cout << in[2] << endl;
      continue;
    }
    if(in[0] == in[3] && in[3] == in[6]){
      cout << in[0] << endl;
      continue;
    }
    if(in[1] == in[4] && in[4] == in[7]){
      cout << in[1] << endl;
      continue;
    }
    if(in[2] == in[5] && in[5] == in[8]){
      cout << in[2] << endl;
      continue;
    }
    cout << "d" << endl;
  }

  return 0;
}