#include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    int p[8][3] = {
        {1,2,3},
        {4,5,6},
        {7,8,9},
        {1,4,7},
        {2,5,8},
        {3,6,9},
        {1,5,9},
        {3,5,7}
    };
    char s[10], ans;

    while(cin >> s){
        ans = 'd';
        rep(i,8){
            if(s[ p[i][0]-1 ] == s[ p[i][1]-1 ] && s[ p[i][1]-1 ] == s[ p[i][2]-1 ]){
                ans = s[ p[i][0]-1 ];
            }
        }
        cout << ans << endl;
    }
}