#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cctype>
#include<complex>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<functional>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>

using namespace std;
const int dx[] = {1,0,-1,0},dy[] = {0,1,0,-1};
#define INF 1e+9
#define EPS 1e-9
#define rep(i,j) for(int i = 0; i < (j); i++)
#define reps(i,j,k) for(int i = j; i < k; i++)
typedef long long ll;
typedef unsigned long long ull;
char judge(char tmp){
	if(tmp == 'o')return 'o';
	if(tmp == 'x')return 'x';
	return 'N';
}
char check(char *str){
	/*height*/
	for(int i = 0; i < 9; i+=3){
		if(str[i] == str[i+1] && str[i] == str[i+2]){
			if(judge(str[i]) != 'N')return judge(str[i]);
		}
	}
	/*width*/
	rep(i,3){
		if(str[i] == str[i+3] && str[i] == str[i+6]){
			if(judge(str[i]) != 'N')return judge(str[i]);
		}
	}
	/*slanting*/
	if(str[0] == str[4] && str[0] == str[8]){
		if(judge(str[0]) != 'N')return judge(str[0]);
	}
	if(str[2] == str[4] && str[2] == str[6]){
		if(judge(str[2]) != 'N')return judge(str[2]);
	}

	return 'd';
}
int main(){
	char str[16]={0};
	while(~scanf("%s",str)){
		printf("%c\n",check(str));
	}
	return 0;
}