#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cstdlib>

using namespace std;

inline int to_int(string s) {int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string to_str(T x) {ostringstream sout; sout << x; return sout.str();}

typedef long long ll;

int main()
{
	int field[4][4];
	string f;

	while(cin >> f)
	{

		for(int i = 0; i < 3; i++)
		{
			for(int j = 0; j < 3; j++)
			{
				if(f[3*i+j] == 'o') field[i][j] = 1;
				else if(f[3*i+j] == 'x') field[i][j] = -1;
				else field[i][j] = 0;
			}
		}
		int jo[8];
		for(int i = 0; i < 8; i++)
			jo[i] = 0;

		for(int i = 0; i < 3; i++)
		{
			for(int j = 0; j < 3; j++)
			{
				if(i == j) jo[0] += field[i][j];
				if(i+j == 2) jo[1] += field[i][j];
				if(j == 0) jo[2] += field[i][j];
				if(j == 1) jo[3] += field[i][j];
				if(j == 2) jo[4] += field[i][j];
				if(i == 0) jo[5] += field[i][j];
				if(i == 1) jo[6] += field[i][j];
				if(i == 2) jo[7] += field[i][j];
			}
		}

		int ans = 0;

		for(int i = 0; i < 8; i++)
		{
			if(jo[i] == 3) ans = 1;
			else if(jo[i] == -3) ans = -1;
		}

		if(ans == 1) cout << 'o' << endl;
		else if(ans == -1) cout << 'x' << endl;
		else cout << 'd' << endl;
	}
}