#include<cstdio>
#include<algorithm>
#include<iostream>
using namespace std;
typedef long long ll;
int main(){
	char a[10];
	scanf("%s",a);
	char ans = 'd';
	if(a[0] == a[1] && a[1] == a[2])ans = a[0];
	else if(a[3] == a[4] && a[4] == a[5])ans = a[3];
	else if(a[6] == a[7] && a[7] == a[8])ans = a[6];
	else if(a[0] == a[3] && a[3] == a[6])ans = a[0];
	else if(a[1] == a[4] && a[4] == a[7])ans = a[1];
	else if(a[2] == a[5] && a[5] == a[8])ans = a[2];
	else if(a[0] == a[4] && a[4] == a[8])ans = a[4];
	else if(a[2] == a[4] && a[4] == a[6])ans = a[4];
	printf("%c\n",ans);
	return 0;
}