//ようこ
#include<stdio.h>
#include<string.h>

char n[8];

int sw(int a,int b,int c,int ans){
	if(n[a] == n[b] && n[b] == n[c]){
		if(n[a] == 'o'){return 1;}
		if(n[a] == 'x'){return 0;}
	}
	return ans != -1 ? ans : -1;
}

int main(void){
	
	while(scanf("%s",n) != EOF){
		int ans = -1;
		ans=sw(0,1,2,ans);
		ans=sw(3,4,5,ans);
		ans=sw(6,7,8,ans);
		ans=sw(0,4,8,ans);
		ans=sw(2,4,6,ans);
		ans=sw(0,3,6,ans);
		ans=sw(1,4,7,ans);
		ans=sw(2,5,8,ans);
		
		if(ans == 0)printf("x\n");
		else if(ans == 1)printf("o\n");
		else printf("d\n"); 
	}
}