#include <iostream>
#include <cstring>
using namespace std;
int x[8][3]={{0,1,2},{3,4,5},{6,7,8},{0,3,6},{1,4,7},{2,5,8},{0,4,8},{2,4,6}};
int main(){
	char str[9];
	while(cin>>str){
		char win='d';
		for(int i=0;i<8;i++){
			if(str[x[i][0]]=='o' && str[x[i][1]]=='o' && str[x[i][2]]=='o') win='o';
			if(str[x[i][0]]=='x' && str[x[i][1]]=='x' && str[x[i][2]]=='x') win='x';
			if(win=='o' || win=='x') break;
		};
	cout << win << '\n' ;
	};
}