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

char ttt(string& s)
{
  for (int i = 0; i < 9; i+=3) {
    if (s[i] == s[i+1] && s[i] == s[i+2])
      return s[i];
  }
  for (int i = 0; i < 3; i++) {
    if (s[i] == s[i+3] && s[i] == s[i+6])
      return s[i];
  }
  if ((s[4] == s[0] && s[4] == s[8])
      || (s[4] == s[2] && s[4] == s[6]))
    return s[4];
  return 'd';
}

int main(int argc, char **argv)
{
  string s;
  while (cin >> s) {
    cout << ttt(s) << endl;
  }
  return 0;
}