#include <iostream>
using namespace std;

int main(void){
  char ban[10];
  while(cin >> ban[1]){
    char ans = 'd';
    for(int i = 2; i <= 9; i++) cin >> ban[i];
    for(int i = 0; i <= 2; i++){
      if(ban[1+i*3] == ban[2+i*3] && ban[2+i*3] == ban[3+i*3] && ban[1+i*3] != 's') ans = ban[1+i*3];
      if(ban[1+i] == ban[4+i] && ban[4+i] == ban[7+i] && ban[1+i] != 's') ans = ban[1+i];
    }
    if(ban[1] == ban[5] && ban[5] == ban[9] && ban[1] != 's') ans = ban[1];
    if(ban[3] == ban[5] && ban[5] == ban[7] && ban[3] != 's') ans = ban[3];
    cout << ans << endl;
  }
  return 0;
}