#include <iostream>

using namespace std;

typedef enum enum_WL {win, lose, draw} WL;

bool isWin(char board[][3], char ox)
{
	for (int i=0; i<3; i++) {
		if (board[i][0] == ox && board[i][1] == ox && board[i][2] == ox) return true;
	}
	for (int i=0; i<3; i++) {
		if (board[0][i] == ox && board[1][i] == ox && board[2][i] == ox) return true;
	}
	if (board[0][0] == ox && board[1][1] == ox && board[2][2] == ox) return true;
	if (board[0][2] == ox && board[1][1] == ox && board[2][0] == ox) return true;
	return false;
}

WL win_or_lose(char board[][3], bool turn)
{
	if ( isWin(board, 'o') ) return win;
	else if ( isWin(board, 'x') ) return lose;
	
	for (int i=0; i<3; i++) {
		for (int j=0; j<3; j++) {
			if (board[i][j] != 's') continue;
			board[i][j] = turn ? 'o' : 'x';
			WL wl = win_or_lose(board, !turn);
			if (wl != draw) return wl;
			board[i][j] = 's';
		}
	}
	return draw;
}

int main()
{
	char board[3][3];
	char buf[10];
	
	while ( cin >> buf ) {
		bool turn = true; // true : o's turn
		for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				board[i][j] = buf[3*i+j];
				if (board[i][j] != 's') turn = !turn;
			}
		}
		switch ( win_or_lose(board, turn) ) {
		case win :  cout << "o"; break;
		case lose : cout << "x"; break;
		case draw : cout << "d"; break;
		}
		cout << endl;
	}
	
	return 0;
}