#include <iostream>
#include <sstream>
#include <algorithm>
#include <cstdio>
#include <string>


#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(int x=from;x<to;x++)

using namespace std;


int main(void){

string ws;
int bd[3][3], wk;

	while(!cin.eof()){
		getline(cin,ws);
		if(cin.eof()) break;
		rep(i,9){
			int zi = i/3; int zz = i%3 ;int sp;
			if(ws[i] == 's') sp=0;
			if(ws[i] == 'o') sp=100;
			if(ws[i] == 'x') sp=1;
			
			bd[zi][zz] = sp;
		}
//		rep(i,3) rep(j,3) { cout << bd[i][j] << "-";if(j>1) cout <<endl; }
		int ans = 0;
		rep(i,3) {
			wk = bd[i][0] + bd[i][1] + bd[i][2];
				if(wk >= 300 || wk % 100 >= 3) ans = bd[i][0];
		}
		if(ans==0){ 
			rep(i,3){
				wk = bd[0][i] + bd[1][i] + bd[2][i];
				if(wk >= 300 || wk % 100 >= 3) ans = bd[0][i];
			}
		}
		if(ans==0){ 
			if(bd[0][0]==bd[1][1] && bd[1][1]==bd[2][2] ||
			   bd[0][2]==bd[1][1] && bd[1][1]==bd[2][0]){
					ans = bd[1][1]; 
			}
		}
		string z = ( ans==100? "o": ans==1? "x" : "d"); 
		cout << z << endl;
	}		
	return 0;
	
}