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

const int INF = 1e+9;

int m[4][4];
bool search(int t){
	if(m[0][0] == t && ((m[0][0] == m[1][1] && m[0][0] == m[2][2])
	 				|| (m[0][0] == m[0][1] && m[0][0] == m[0][2])
	 				|| (m[0][0] == m[1][0] && m[0][0] == m[2][0]))) return true;
	else if(m[2][0] == t && ((m[2][0] == m[1][1] && m[1][1] == m[0][2])
						 || (m[2][0] == m[2][1] && m[2][1] == m[2][2]))) return true;
	else if(m[0][1] == t && m[0][1] == m[1][1] && m[1][1] == m[2][1]) return true;
	else if(m[1][0] == t && m[1][0] == m[1][1] && m[1][1] == m[1][2]) return true;
	else if(m[0][2] == t && m[0][2] == m[1][2] && m[1][2] == m[2][2]) return true;
	
	return false;
}

int main() {
	string s;
	while(cin >> s){
		for(int i = 0; i < s.size(); ++i){
			int t;
			if(s[i] == 'o')
				t = 0;
			else if(s[i] == 'x')
				t = 1;
			else
				t = 2;
			m[i / 3][i % 3] = t;
		}
		if(search(0)){
			cout << "o" << endl;
		}
		else if(search(1)){
			cout << "x" << endl;
		}
		else{
			cout << "d" << endl;
		}
	}
	
	return 0;
}