#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <iostream>
#include <climits>
#include <cfloat>


using namespace std;

bool win(char* t, char c)
{
	for (int y = 0; y < 3; ++y)
	{
		bool ok = true;
		for (int x = 0; x < 3; ++x)
		{
			if (t[y*3 + x] != c)
			{
				ok = false;
				break;
			}
		}
		if (ok)
			return true;
	}
	for (int x = 0; x < 3; ++x)
	{
		bool ok = true;
		for (int y = 0; y < 3; ++y)
		{
			if (t[x*3 + y] != c)
			{
				ok = false;
				break;
			}
		}
		if (ok)
			return true;
	}

	return t[0] == c && t[4] == c && t[8] == c
		|| t[2] == c && t[4] == c && t[6] == c;
}

int main()
{
	char buf[10];
	while (scanf("%s\n", buf) != EOF)
	{
		char c;
		if (win(buf, 'o'))
			c = 'o';
		else if (win(buf, 'x'))
			c = 'x';
		else
			c = 'd';
		printf("%c\n", c);
	}

	return 0;
}