#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;

int main()
{
	int i,j,a,b,ans=-7;
	char c[10];
	//while(scanf("%s",&c) !=EOF){
		/*for(i=1; i<9; i++){
			scanf("%s", &c[i]);
		}*/
		for(i=0; i<9; i++){
			//cout << c[i] <<endl;
			if(i%3==0 || i==0){
				if(c[0+i]=='o' &&c[1+i]=='o'&&c[2+i]=='o'){
					ans=1;
				}
				if(c[0+i]=='x' &&c[1+i]=='x'&&c[2+i]=='x'){
					ans=0;
				}
			}
			if(i <=2){
				if(c[0+i]=='o' &&c[3+i]=='o'&&c[6+i]=='o'){
					ans=1;
				}
				if(c[0+i]=='x' &&c[3+i]=='x'&&c[6+i]=='x'){
					ans=0;
				}
			}
		}
		if(c[0]=='o' &&c[4]=='o'&&c[8]=='o')	ans=1;
		if(c[0]=='x' &&c[4]=='x'&&c[8]=='x')	ans=0;
		if(c[2]=='o' &&c[4]=='o'&&c[6]=='o')	ans=1;
		if(c[2]=='x' &&c[4]=='x'&&c[6]=='x')	ans=0;

		if(ans==1)		cout<<'o'<<endl;
		else if(ans==0)	cout<<'x'<<endl;
		else			cout<<'d'<<endl;
	//}
}