#include<iostream>
#include<string>
#define N 3

using namespace std;

int main(){
  int i, j, k;
  string s;
  char win, c[N][N];

  while(cin >> s){
    k=0;
    for(i=0; i<N; i++){
      for(j=0; j<N; j++){
	c[i][j] = s[k];
	k++;
      }
    }

    win = 'd';

    for(i=0; i<3; i++){
      if(c[i][0] == c[i][1] && c[i][0] == c[i][2] && c[i][0] != 's')
        win = c[i][0];
      if(c[0][i] == c[1][i] && c[0][i] == c[2][i] && c[0][i] != 's')
        win = c[0][i];
    }

    if(c[0][0] == c[1][1] && c[0][0] == c[2][2] && c[0][0] != 's')
      win = c[0][0];
    if(c[0][2] == c[1][1] && c[0][2] == c[2][0] && c[0][2] != 's')
      win = c[0][2];

    cout << win << endl;

  }

  return 0;
}