#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

#define endl '\n'

typedef long long ll;
typedef long double lb;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
typedef pair<string, int> psi;

inline bool inside(int y, int x, int H, int W)
{ 
  return (y >= 0 && x >= 0 && y < H && x < W);
}

inline int in() {int x; std::cin >> x; return x;}

const ll MOD = 1e9 + 7;
const ll INF = 1e9 + 9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1};
const int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  string s;

  while (cin >> s){
         if (s[0] == s[1] && s[1] == s[2]) cout << s[0] << endl;
    else if (s[3] == s[4] && s[4] == s[5]) cout << s[3] << endl;
    else if (s[6] == s[7] && s[7] == s[8]) cout << s[6] << endl;

    else if (s[0] == s[3] && s[3] == s[6]) cout << s[0] << endl;
    else if (s[1] == s[4] && s[4] == s[7]) cout << s[1] << endl;
    else if (s[2] == s[5] && s[5] == s[8]) cout << s[2] << endl;

    else if (s[0] == s[4] && s[4] == s[8]) cout << s[4] << endl;
    else if (s[2] == s[4] && s[4] == s[6]) cout << s[4] << endl;

    else cout << 'd' << endl;
  }
      

  return (0);
}