#include <cstdio>
#include <string>
#include <vector>

bool wins(const std::string &s, char ch) {
  for (int i=0; i<3; ++i) {
    if ([&] {
        for (int j=0; j<3; ++j)
        if (s[3*i+j] != ch) return false;
        return true;
    }()) {
      return true;
    }
    if ([&] {
        for (int j=0; j<3; ++j)
        if (s[i+3*j] != ch) return false;
        return true;
    }()) {
      return true;
    }
  }
  if (s[0] == s[4] && s[4] == s[8] && s[8] == ch)
    return true;
  if (s[2] == s[4] && s[4] == s[6] && s[6] == ch)
    return true;

  return false;
}

int testcase_ends() {
  char buf[16];
  if (scanf("%s", buf) == EOF)
    return 1;

  std::string s=buf;
  for (char ch: {'o', 'x'})
    if (wins(s, ch))
      return !printf("%c\n", ch);

  printf("d\n");
  return 0;
}

int main() {
  while (!testcase_ends()) {}
}

