#include<iostream>
using namespace std;
char a[50][9];
int hantei(int x,int y,int z,int k){
    if(a[k][x] == a[k][y] && a[k][y] == a[k][z]){
        if(a[k][x] == 'o'){return 1;}
        else if(a[k][x] == 'x'){return 2;}
        else{return 0;}
    }
    else{return 0;}
}
int handan(int l){
    if(hantei(0,1,2,l) ==1 || hantei(3,4,5,l) ==1 || hantei(6,7,8,l) ==1 || hantei(0,3,6,l) ==1 || hantei(1,4,7,l) ==1 || hantei(2,5,8,l) ==1 || hantei(0,4,8,l) ==1 || hantei(2,4,6,l) ==1){
        return 1;
    }
    else if(hantei(0,1,2,l) ==2 || hantei(3,4,5,l) ==2 || hantei(6,7,8,l) ==2 || hantei(0,3,6,l) ==2 || hantei(1,4,7,l) ==2 || hantei(2,5,8,l) ==2 || hantei(0,4,8,l) ==2 || hantei(2,4,6,l) ==2){
        return 2;
    }
    else {return 0;}
}
int main(){
    int n = 0;
    while(cin >> a[n][0] >> a[n][1] >> a[n][2] >> a[n][3] >> a[n][4] >> a[n][5] >> a[n][6] >> a[n][7] >> a[n][8]){
        n ++;
    }
    for(int i = 0;i < n;i++){
        if (handan(i) == 1){
            cout << "o" <<endl;
        }
        else if(handan(i) == 2){
            cout << "x" <<endl;
        }
        else{cout << "d" << endl;}
    }
    return 0;
}
