#include <iostream>
#include <string>

using namespace std;
int table[8][9] = {
	{1,1,1,0,0,0,0,0,0},
	{0,0,0,1,1,1,0,0,0},
	{0,0,0,0,0,0,1,1,1},
	{1,0,0,1,0,0,1,0,0},
	{0,1,0,0,1,0,0,1,0},
	{0,0,1,0,0,1,0,0,1},
	{1,0,0,0,1,0,0,0,1},
	{0,0,1,0,1,0,1,0,0}
};

int main(){
	string str;
	int field[9];
	int sum, lines;
	
	while(cin >> str){
		for(int i = 0; i < 9; ++i){
			switch(str[i]){
			case 'o':
				field[i] = 1; break;
			case 'x':
				field[i] = -1; break;
			default:
				field[i] = 0; break;
			}
		}
		
		lines = 0;
		for(int i = 0; i < 8; ++i){
			sum = 0;
			for(int j = 0; j < 9; ++j){
				sum += field[j] * table[i][j];
			}
			if(sum == 3 || sum == -3){
				lines += sum / 3;
			}
		}
		switch (lines){
		case 1:
			cout << "o" << endl; break;
		case -1:
			cout << "x" << endl; break;
		default:
			cout << "d" << endl; break;
		}
	}
	
	return 0;
}