#include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <math.h>
#include <map>
#include <queue>
#include <string>
using namespace std;

int w[8][3]={{1,4,7},{2,5,8},{3,6,9},{1,2,3},{4,5,6},{7,8,9},{1,5,9},{3,5,7}};
char c[10];

int main(){
	while(cin>>c[1]){
		for(int i=2;i<10;i++)cin>>c[i];
		int flag=0;
		for(int i=0;i<8;i++){
			int p=0;
			for(int j=0;j<3;j++){
				if(c[w[i][j]]=='o')p++;
				if(c[w[i][j]]=='x')p--;
			}
			if(p==3){cout<<"o"<<endl;flag=1;break;}
			if(p==-3){cout<<"x"<<endl;flag=1;break;}
		}
		if(flag==0)cout<<"d"<<endl;
	}
}