#include <cstdio>

using namespace std;

int w[8][3] = {
  { 0, 1, 2 },
  { 3, 4, 5 },
  { 6, 7, 8 },
  { 0, 3, 6 },
  { 1, 4, 7 },
  { 2, 5, 8 },
  { 0, 4, 8 },
  { 2, 4, 6 }
};

int main() {
  char s[16];
  while (scanf("%s", s) == 1) {
    for (int i = 0; i < 8; i++) {
      int r = 0;
      for (int j = 0; j < 3; j++)
        r += s[w[i][j]] == 'o' ? 1 : s[w[i][j]] == 'x' ? -1 : 0;
      if (r == 3) {
        puts("o");
        goto next;
      }
      if (r == -3) {
        puts("x");
        goto next;
      }
    }
    puts("d");
next:;
  }
  return 0;
}