#include <stdio.h>

int main(void)
{
	char c[200];
	int a[3][3];
	int ans;
	while(scanf("%s", c) != EOF){
		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
				if(c[i * 3 + j] == 'o'){
					a[i][j] = 1;
				}else if(c[i * 3 + j] == 'x'){
					a[i][j] = 2;
				}else{
					a[i][j] = 0;
				}
			}
		}
		ans = 0;
		for(int i = 0; i < 3; i++){
			if(a[i][0] == a[i][1] && a[i][1] == a[i][2]){
				if(a[i][0]){
					ans = a[i][0];
				}
			}
			if(a[0][i] == a[1][i] && a[1][i] == a[2][i]){
				if(a[0][i]){
					ans = a[0][i];
				}
			}
		}
		if(a[0][0] == a[1][1] && a[1][1] == a[2][2]){
			if(a[0][0]){
				ans = a[0][0];
			}
		}
		if(a[0][2] == a[1][1] && a[1][1] == a[2][0]){
			if(a[0][2]){
				ans = a[0][2];
			}
		}
		if(ans == 1){
			printf("o\n");
		}else if(ans == 2){
			printf("x\n");
		}else{
			printf("d\n");
		}
	}
	return 0;
}