#include <iostream>

using namespace std;

char hoge(char *seq) {
  for (int i = 0; i < 3; ++i) {
    if ((seq[i] == seq[i+3]) && (seq[i] == seq[i+6]) && (seq[i] != 's'))
      return seq[i];
    if ((seq[i*3] == seq[i*3+1]) && (seq[i*3] == seq[i*3+2]) && (seq[i*3] != 's'))
      return seq[i*3];
  }
  if ( ((seq[0] == seq[4]) && (seq[0] == seq[8]) && (seq[4] != 's')) ||
       ((seq[2] == seq[4]) && (seq[2] == seq[6]) && (seq[4] != 's')) )
    return seq[4];

  return 'd';
}

int main() {
  while (true) {
    char seq[9];
    for (int i = 0; i < 9; ++i)
      cin >> seq[i];

    if (cin.fail())
      break;

    cout <<hoge(seq) << endl;
  }
}
