#include <iostream>

using namespace std;

int main(){
	char a[9];
	while(cin>>a[0]){
		for(int i=1;i<9;i++) cin>>a[i];
		int b = 2;
		if(a[0]=='o' and a[1]=='o' and a[2]=='o') b = 0;
		if(a[3]=='o' and a[4]=='o' and a[5]=='o') b = 0;
		if(a[6]=='o' and a[7]=='o' and a[8]=='o') b = 0;
		if(a[0]=='o' and a[3]=='o' and a[6]=='o') b = 0;
		if(a[1]=='o' and a[4]=='o' and a[7]=='o') b = 0;
		if(a[2]=='o' and a[5]=='o' and a[8]=='o') b = 0;
		if(a[0]=='o' and a[4]=='o' and a[8]=='o') b = 0;
		if(a[2]=='o' and a[4]=='o' and a[6]=='o') b = 0;
		if(a[0]=='x' and a[1]=='x' and a[2]=='x') b = 1;
		if(a[3]=='x' and a[4]=='x' and a[5]=='x') b = 1;
		if(a[6]=='x' and a[7]=='x' and a[8]=='x') b = 1;
		if(a[0]=='x' and a[3]=='x' and a[6]=='x') b = 1;
		if(a[1]=='x' and a[4]=='x' and a[7]=='x') b = 1;
		if(a[2]=='x' and a[5]=='x' and a[8]=='x') b = 1;
		if(a[0]=='x' and a[4]=='x' and a[8]=='x') b = 1;
		if(a[2]=='x' and a[4]=='x' and a[6]=='x') b = 1;
		if(b==0) cout << "o" << endl;
		if(b==1) cout << "x" << endl;
		if(b==2) cout << "d" << endl;
	}
}