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

int main(){

	int cmb[8][3] = {{0,1,2}, {3,4,5}, {6,7,8},
									 {0,3,6}, {1,4,7}, {2,5,8},
									 {0,4,8}, {2,4,6}};
	string str;
	
	while(cin >> str){
		for(int i=0; i<8; i++){
			if(str[cmb[i][0]] != 's'){
				if(str[cmb[i][0]] == str[cmb[i][1]] && str[cmb[i][1]] == str[cmb[i][2]]){
					cout << str[cmb[i][0]] << endl;
					break;
				}
			}
			
			if(i == 7){
				cout << 'd' << endl;
			}
		}
	}

	return 0;

}