#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

const int H = 3;
const int W = 3;

inline int pos(int i, int j) {
  return i*W + j;
}

char solve(const string &s) {
  for(int i = 0; i < H; ++i) {
    for(int j = 0; j < W; ++j) {
      if(s[pos(i,j)] == 's') continue;
      for(int di = -1; di <= 1; ++di) {
        for(int dj = -1; dj <= 1; ++dj) {
          if(di|dj) ; else continue;
          for(int l = 1; l <= 3; ++l) {
            if(l == 3) return s[pos(i,j)];
            int ni = i + di * l;
            int nj = j + dj * l;
            if(ni < 0 || ni >= H) break;
            if(nj < 0 || nj >= W) break;
            if(s[pos(ni,nj)] != s[pos(i,j)]) break;
          }
        }
      }
    }
  }
  return 'd';
}

int main() {
  string s;
  while(getline(cin, s)) {
    cout << solve(s) << endl;
  }
  return 0;
}