#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

bool check(char a, char b, char c) {
  return a != 's' && a == b && b == c;
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  string s;
  while (cin >> s) {
    if (check(s[0], s[1], s[2])) cout << s[0] << endl;
    else if (check(s[3], s[4], s[5])) cout << s[3] << endl;
    else if (check(s[6], s[7], s[8])) cout << s[6] << endl;
    else if (check(s[0], s[3], s[6])) cout << s[0] << endl;
    else if (check(s[1], s[4], s[7])) cout << s[1] << endl;
    else if (check(s[2], s[5], s[8])) cout << s[2] << endl;
    else if (check(s[0], s[4], s[8])) cout << s[0] << endl;
    else if (check(s[2], s[4], s[6])) cout << s[6] << endl;
    else cout << 'd' << endl;
  }

  return 0;
}
