#include <iostream>
using namespace std;
int main(){
  char koma[3] = {'o','x','d'},gomoku[9];
  while(cin >> gomoku[0]){
  for(int i = 1 ; i < 9 ; i++ ){
    cin >> gomoku[i];
}

  int ans = 2;
  for(int i = 0 ; i < 2 ; i++){
    if(gomoku[0] == koma[i]){
      if((gomoku[3] == koma[i] && gomoku[6] == koma[i])||
	 (gomoku[4] == koma[i] && gomoku[8] == koma[i])||
	 (gomoku[1] == koma[i] && gomoku[2] == koma[i]))ans = i;
    }
  if(gomoku[1] == koma[i] && gomoku[4] == koma[i] &&
	      gomoku[7] == koma[i])ans = i;

  if(gomoku[2] == koma[i] ){
    if(gomoku[5] == koma[i] && gomoku[8] == koma[i])ans = i;
    if(gomoku[4] == koma[i] && gomoku[6] == koma[i])ans = i;
      }

  if(gomoku[3] == koma[i] && gomoku[4] == koma[i] && gomoku[5] == koma[i])
    ans = i;

  if(gomoku[6] == koma[i] && gomoku[7] == koma[i] && gomoku[8] == koma[i])
    ans = i;
    }
  cout << koma[ans] << endl;
  }

}