#include <bits/stdc++.h>

#define loop(v, f, l) for(int v = (f), v##_ = (l); v < v##_; ++v)

using namespace std;

typedef long long int lint;
static inline int in(){ int x; scanf("%d", &x); return (x); }
static inline lint inl(){ lint x; scanf("%lld", &x); return (x); }

char boardstate[10];

#define WIN		(1)
#define LOSE	(2)
#define DRAW	(0)

bool is(int x, int y, char m)
{
	return boardstate[x + y * 3] == m;
}

bool isWin(char m)
{
	loop(i, 0, 3)
	{
		if( (is(i, 0, m) && is(i, 1, m) && is(i, 2, m)) || (is(0, i, m) && is(1, i, m) && is(2, i, m)) )
		{
			return true;
		}
	}
	if( is(0, 0, m) && is(1, 1, m) && (2, 2, m) )
	{
		return true;
	}
	if( is(0, 2, m) && is(1, 1, m) && (2, 0, m) )
	{
		return true;
	}
	return false;
}

int main()
{
	while( scanf("%s", boardstate) != EOF )
	{
		if( isWin('o') )
		{
			printf("o\n");
		}
		else if( isWin('x') )
		{
			printf("x\n");
		}
		else
		{
			printf("d\n");
		}
	}
	return (0);
}