#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((buf[i/3] == 'o' || buf[i/3] == 'x') && buf[i/3] == buf[(i/3)+3] && buf[i/3] == buf[(i/3)+6]){
				printf("%c\n",buf[i/3]);
				FLG = false;
				break;
			}
		}

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

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

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

	}

    return 0;
}