#include <cstdio>
using namespace std;

int main() {
  char buf[20];
  int d[9];
  int j[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}};
  bool draw;
  while (fgets(buf, sizeof(buf), stdin)) {
    for (int i=0; i<9; i++) {
      if (buf[i]=='o') d[i]=2;
      else if (buf[i]=='x') d[i]=1;
      else d[i]=0;
    }
    draw = true;
    for (int i=0; i<8; i++) {
      if (d[j[i][0]]==d[j[i][1]] && d[j[i][0]]==d[j[i][2]]) {
        if (d[j[i][0]]==2) {
          draw = false;
          printf("o\n");
          break;
        } else if (d[j[i][0]]==1) {
          draw = false;
          printf("x\n");
          break;
        }
      }
    }
    if (draw) {
      printf("d\n");
    }
  }
  return 0;
}