#include <iostream>
#include <string>

using namespace std;

int main(){
  string a;
  int i,j,k;
  //baseÌ\ª3*3}XÌÀÑÉÎ
  int base[2][8]= {{0,1,2,0,3,6,0,2},{3,3,3,1,1,1,4,2}};
  bool flag;

  //~ÌÇÝÝ
  while(cin >> a){
    flag = false;
    for(int l=0;l<8;l++){
      i = base[0][l];
      j = i + base[1][l];
      k = j + base[1][l];
      if(a[i] == a[j] && a[j] == a[k]){
	cout << a[i] << endl;
	flag = true;
	break;
      }
    }
    if(!flag){
      cout << "d" << endl;
    }
  }
}