#include<bits/stdc++.h>
using namespace std;

int getPos(int i, int j){
  return i * 3 + j;
}


char running(const string& s){
  for(int q = 0; q < 2; q++){

    char c = "ox"[q];
    bool judge;

    for(int i = 0; i < 3; i++){
      judge = true;
      for(int j = 0; j < 3; j++){ //よこ
        judge &= s[getPos(i,j)] == c;
      }
      if(judge) return c;
    }
    
    for(int i = 0; i < 3; i++){
      judge = true;
      for(int j = 0; j < 3; j++){
        judge &= s[getPos(j,i)] == c;
      }
      if(judge) return c;
    }

    judge = true;
    for(int j = 0; j < 3; j++){
      judge &= s[getPos(j,j)] == c;
    }
    if(judge) return c;

    judge = true;
    for(int j = 0; j < 3; j++){
      judge &= s[getPos(2-j,j)] == c;
    }
    if(judge) return c;

  }
  return 'd';
}

int main(){
  string s;
  while(cin >> s){
    printf("%c\n", running(s));
  }
  return 0;
}