#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;
#define MARU 1
#define BATU -1
int main()
{
//	cut here before submit 
//	freopen("testcase.ttt", "r", stdin);
	
	string str = "";
	while (getline (cin, str ) ){
		if (str.empty() ){
			break;
		} // end if
		vector <vector<int> > b(3, vector <int> (3, 0 ) );
		int i,j; 
		stringstream ss(str);
		for (i = 0; i < 3; ++i){
			for (j = 0; j < 3; ++j){
				char c;
				ss >> c;
				if (c == 'x'){
					b[i][j] = BATU;
				}else if (c == 'o'){
					b[i][j] = MARU;
				} // end if
			} // end for
		} // end for
		int vd = 0;
		int player[2] = {MARU, BATU };

		for (j = 0; j < 2; ++j){
			for (i = 0; i < 3; ++i){
				if ( ( b[i][0] == player[j] && b[i][1] == player[j] && b[i][2] == player[j] )
				||    ( b[0][i] == player[j] && b[1][i] == player[j] && b[2][i] == player[j] )
				||    ( b[i][i] == player[j] && b[(i+1)%3][(i+1)%3] == player[j] && b[(i+2)%3][(i+2)%3] == player[j])
				||    ( b[i][2-i] == player[j] && b[(i+1)%3][2 - ((i+1)%3)] == player[j] && b[(i+2)%3][2 - ((i+2)%3)] == player[j] ) ){
					vd = player[j];
					break;
				} // end if
			} // end for
		} // end for

		switch (vd){
			case MARU:
				cout << 'o' << endl; break;
			case BATU:
				cout << 'x' << endl; break;
			default:
				cout << 'd' << endl; break;
		} // end switch

	} // end loop
		
	return 0;
}