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

string ban;

int main()
{
    while (cin >> ban)
    {
        if (ban[0]!='s' && ban[0]==ban[1] && ban[1]==ban[2])
        {
            cout << ban[0] << endl;
            continue;
        }
        if (ban[3]!='s' && ban[3]==ban[4] && ban[4]==ban[5])
        {
            cout << ban[3] << endl;
            continue;
        }
        if (ban[6]!='s' && ban[6]==ban[7] && ban[7]==ban[8])
        {
            cout << ban[6] << endl;
            continue;
        }
        if (ban[0]!='s' && ban[0]==ban[3] && ban[3]==ban[6])
        {
            cout << ban[0] << endl;
            continue;
        }
        if (ban[1]!='s' && ban[1]==ban[4] && ban[4]==ban[7])
        {
            cout << ban[1] << endl;
            continue;
        }
        if (ban[2]!='s' && ban[2]==ban[5] && ban[5]==ban[8])
        {
            cout << ban[2] << endl;
            continue;
        }
        if (ban[0]!='s' && ban[0]==ban[4] && ban[4]==ban[8])
        {
            cout << ban[0] << endl;
            continue;
        }
        if (ban[2]!='s' && ban[2]==ban[4] && ban[4]==ban[6])
        {
            cout << ban[2] << endl;
            continue;
        }
        cout << 'd' << endl;
    }

    return 0;
}