#include<iostream>
#include<string>
using namespace std;

char field[3][3];

char judge(){
	for(int i=0; i < 3; i++){
		if(field[i][0] == field[i][1] && field[i][0] == field[i][2] && field[i][0] != 's'){
			return field[i][0];
		}
		else if(field[0][i] == field[1][i] && field[0][i] == field[2][i] && field[0][i] != 's'){
			return field[0][i];
		}
	}
	if(field[0][0] == field[1][1] && field[0][0] == field[2][2] && field[0][0] != 's'){
		return field[0][0];
	}
	else if(field[0][2] == field[1][1] && field[0][2] == field[2][0] && field[0][2] != 's'){
		return field[0][2];
	}
	else return 'd';
}

int main(){
	while(cin >> field[0][0]){
		for(int i=0; i < 3; i++){
			for(int j=0; j < 3; j++){
				if(i == 0 && j == 0) continue;
				cin >> field[i][j];
			}
		}

		cout << judge() << endl;
	}
}