#include <stdio.h>
#include<math.h>
#include <algorithm>
using namespace std;

int main(){
	char buf[10];
	bool FLG;

	while(scanf("%s",buf)!=EOF){
		FLG = true;
		for(int i=0;i<=6;i+=3){
			if((buf[i] == 'o' || buf[i] == 'x') && buf[i] == buf[i+1] && buf[i+1] == buf[i+2]){
				printf("%c\n",buf[i]);
				FLG = false;
				break;
			}
		}

		if(FLG){
			for(int i = 0; i <=2; i++){
				if((buf[i] == 'o' || buf[i] == 'x') && buf[i] == buf[i+3] && buf[i] == buf[i+6]){
					printf("%c\n",buf[i]);
					FLG = false;
					break;
				}
			}
		}

		if(FLG){
			if((buf[0] == 'o' || buf[0] == 'x') && buf[0] == buf[4] && buf[4] == buf[8]){
				printf("%c\n",buf[0]);
				FLG = false;
			}
		}

		if(FLG){
			if((buf[2] == 'o' || buf[2] == 'x')  && buf[2] == buf[4] && buf[4] == buf[6]){
				printf("%c\n",buf[2]);
				FLG = false;
			}
		}

		if(FLG)printf("d\n");

	}

    return 0;
}