#include <iostream>
using namespace std;

char search(char cells[10]) {
    if (cells[4] != 's'
        && ((cells[0] == cells[4] && cells[4] == cells[8])
            || (cells[1] == cells[4] && cells[4] == cells[7])
            || (cells[2] == cells[4] && cells[4] == cells[6])
            || (cells[3] == cells[4] && cells[4] == cells[5])
        )) {
        return cells[4];
    } else if (cells[0] != 's'
               && ((cells[0] == cells[1] && cells[0] == cells[2])
                   || (cells[0] == cells[3] && cells[0] == cells[6])
               )) {
        return cells[0];
    } else if (cells[8] != 's'
               && ((cells[8] == cells[2] && cells[8] == cells[5])
                   || (cells[8] == cells[6] && cells[8] == cells[7])
               )) {
        return cells[8];
    }
    return 'd';
}

int main() {
    char cells[10];
    while (cin >> cells) {
        cout << search(cells) << endl;
    }
}