#include <cstdio>
using namespace std;

char ttt[10];
int t[9];
const int jc[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 change(char c){
  int a;
  if(c=='o')
    a=1;
  else if(c=='x')
    a=2;
  else if(c=='s')
    a=0;
  return a;
}

int judge_line(int a){
  if (jc[a][0] == jc[a][1] && jc[a][1] == jc[a][2])
    return t[jc[a][0]];
  else
    return 0;
}

int judge(){
  int ans, j=0;
  do{
    ans = judge_line(j);
    ++j;
  }while(ans == 0);
  return ans;
}

char solve(){
  for(int i=0; i<9; ++i){
    t[i] = change(ttt[i]);
  }
  if(judge()==1)
    return 'o';
  else if(judge()==2)
    return 'x';
  else
    return 'd';
}

int main(){
  while(scanf("%s", ttt)){
    printf("%c\n", solve());
  }
}