#include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define LOOP(i) while(i--)
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);

	string S;
	while(cin>>S){
		int win=0;
		REP(i,3){
			if((S[3*i]=='o' && S[3*i+1]=='o' && S[3*i+2]=='o') ||
				(S[i]=='o' && S[3+i]=='o' && S[6+i]=='o')){
				win = 1;
				break;
			}
		}
		if((S[0]=='o' && S[4]=='o' && S[8]=='o') ||
			(S[2]=='o' && S[4]=='o' && S[6]=='o')){
			win = 1;
		}
		if(win==1){
			out('o');
			continue;
		}
		REP(i,3){
			if((S[3*i]=='x' && S[3*i+1]=='x' && S[3*i+2]=='x') ||
				(S[i]=='x' && S[3+i]=='x' && S[6+i]=='x')){
				win = 2;
				break;
			}
		}
		if((S[0]=='x' && S[4]=='x' && S[8]=='x') ||
			(S[2]=='x' && S[4]=='x' && S[6]=='x')){
			win = 2;
		}
		if(win==2){
			out('x');
			continue;
		}
		out('d');
	}
	
	return 0;
}

