#include <iostream>
#include <cstdio>
using namespace std;
int main(void) {
  char in[9];
  while(scanf("%s", in) != EOF) {
    if(in[0] == 'o' && in[1] == 'o' && in[2] == 'o') cout << 'o' << endl;
    else if(in[3] == 'o' && in[4] == 'o' && in[5] == 'o') cout << 'o' << endl;
    else if(in[6] == 'o' && in[7] == 'o' && in[8] == 'o') cout << 'o' << endl;
    else if(in[0] == 'o' && in[3] == 'o' && in[6] == 'o') cout << 'o' << endl;
    else if(in[1] == 'o' && in[4] == 'o' && in[7] == 'o') cout << 'o' << endl;
    else if(in[2] == 'o' && in[5] == 'o' && in[8] == 'o') cout << 'o' << endl;
    else if(in[0] == 'o' && in[4] == 'o' && in[8] == 'o') cout << 'o' << endl;
    else if(in[2] == 'o' && in[4] == 'o' && in[6] == 'o') cout << 'o' << endl;

    else if(in[0] == 'x' && in[1] == 'x' && in[2] == 'x') cout << 'x' << endl;
    else if(in[3] == 'x' && in[4] == 'x' && in[5] == 'x') cout << 'x' << endl;
    else if(in[6] == 'x' && in[7] == 'x' && in[8] == 'x') cout << 'x' << endl;
    else if(in[0] == 'x' && in[3] == 'x' && in[6] == 'x') cout << 'x' << endl;
    else if(in[1] == 'x' && in[4] == 'x' && in[7] == 'x') cout << 'x' << endl;
    else if(in[2] == 'x' && in[5] == 'x' && in[8] == 'x') cout << 'x' << endl;
    else if(in[0] == 'x' && in[4] == 'x' && in[8] == 'x') cout << 'x' << endl;
    else if(in[2] == 'x' && in[4] == 'x' && in[6] == 'x') cout << 'x' << endl;
    
    else cout << 'd' << endl;
  }
  return 0;
}