#include <iostream>
using namespace std;

bool check(char which, string board) {
    //水平
    for(int r = 0; r < board.length(); r+=3)
        if(board[r]==which&&board[r+1]==which&&board[r+2]==which)return(true);
    //垂直
    for(int r = 0; r < 3; r++)
        if(board[r]==which&&board[r+3]==which&&board[r+6]==which)return(true);
    //斜め
    if((board[0]==which&&board[4]==which&&board[8]==which) ||
       (board[2]==which&&board[4]==which&&board[6]==which))return(true);
    return(false);
}

int main(void) {
    string input;
    while(cin >> input) {
        if(check('o', input)) cout << "o" << endl;
        else if(check('x', input)) cout << "x" << endl;
        else cout << "d" << endl;
    }
    return(0);
}