#include <bits/stdc++.h>
using namespace std;

#define rep(i,n) for(int i=0;i<(n);++i)
#define loop for(;;)
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;
#define inf (1e9)
#define eps (1e-9)

template<class T> inline
ostream& operator<<(ostream&os, vector<T> v) {
  if (v.size() == 0) {
    os << "(empty)";
    return os;
  }
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

inline
int num_empty(vector<int>&v) {
  int ret = 0;
  for (int x: v) if (x == 0) ++ret;
  return ret;
}

inline
bool is_draw(vector<int>&v) {
  return num_empty(v) == 0;
}

inline
int is_goal(vector<int>&v) {
  for (int t=1; t<3; ++t) {
    rep (k, 3) {
      if ( v[3 * k + 0] == t
       and v[3 * k + 1] == t
       and v[3 * k + 2] == t ) return t;
      if ( v[k + 0] == t
       and v[k + 3] == t
       and v[k + 6] == t ) return t;
    }
    if (v[0] == t
      and v[4] == t
      and v[8] == t ) return t;
    if (v[2] == t
        and v[4] == t
        and v[6] == t ) return t;
  }
  return 0;
}

vector<int> empties(vector<int>&v) {
  vector<int> r;
  rep (i, 9) if (v[i] == 0) r.push_back(i);
  return r;
}

map<vector<int>, int> memo;

int search(vector<int> v, bool b) {
  if (memo.count(v) > 0) return memo[v];
  if (is_goal(v)) return memo[v] = is_goal(v);
  if (is_draw(v)) return memo[v] = 0;
  auto es = empties(v);
  int t = b ? 1 : 2;
  bool drawable = false;
  for (int e: es) {
    v[e] = t;
    int r = search(v, (not b));
    if (r == t) return memo[v] = t;
    if (r == 0) drawable = true;
    v[e] = 0;
  }
  if (drawable) return memo[v] = 0;
  return memo[v] = (3 - t);
}

int solve(string s) {
  vector<int> f(9); rep (i, 9) f[i] = s[i] == 's' ? 0 : s[i] == 'o' ? 1 : 2;
  bool b = num_empty(f) % 2 == 1; // is o's turn?
  return search(f, b);
}

int main() {
  string s;
  while (getline(cin, s)) {
    int res = solve(s);
    cout << ((res == 0) ? 'd' : (res == 1) ? 'o' : 'x') << endl;
  }
  return 0;
}