#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;

string b;

bool hantei(char p){
	for(int i=0;i<3;i++){
		if(b[i+0]==p&b[i+3]==p&b[i+6]==p)return true;
		if(b[i*3]==p&b[i*3+1]==p&b[i*3+2]==p)return true;
	}
	if(b[0]==p&b[4]==p&b[8]==p)return true;
	if(b[2]==p&b[4]==p&b[6]==p)return true;
	
	return false;
}

int main(){
	int n;
	while(cin>>b){
		if(hantei('o'))cout<<"o"<<endl;
		else if(hantei('x'))cout<<"x"<<endl;
		else cout<<"d"<<endl;
	}
}