#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>
#include <cmath>
#include <climits>
#include <set>
#include <iostream>
#include <map>
#include <functional>
#include <cstdlib>

using namespace std;

#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)

typedef vector<int> vi;
typedef pair<int, int> pii;

bool win(const char* str, char c)
{
	bool ret = false;
	ret |= str[0]==c && str[1]==c && str[2]==c;
	ret |= str[3]==c && str[4]==c && str[5]==c;
	ret |= str[6]==c && str[7]==c && str[8]==c;
	ret |= str[0]==c && str[3]==c && str[6]==c;
	ret |= str[1]==c && str[4]==c && str[7]==c;
	ret |= str[2]==c && str[5]==c && str[8]==c;
	ret |= str[0]==c && str[4]==c && str[8]==c;
	ret |= str[2]==c && str[4]==c && str[6]==c;
	return ret;
}

int main()
{
	char str[16];
	while(scanf("%s", str) != EOF){
		if(win(str, 'o'))
			puts("o");
		else if(win(str, 'x'))
			puts("x");
		else
			puts("d");
	}
}