import std.stdio;
import std.algorithm;
import std.string;
import std.conv;
import std.math;

void main(){
    while(true){
	auto s = readln();
	if(stdin.eof()) break;
	s = chomp(s);
	char win = 'd';
	for(int i=0;i<3;i++){
	    if(s[3*i] != 's' && s[3*i] == s[3*i+1] && s[3*i] == s[3*i+2]) win = s[3*i];
	}
	for(int i=0;i<3;i++){
	    if(s[i] != 's' && s[i] == s[i+3] && s[i+6] == s[i]) win = s[i];
	}
	if(s[4] != 's'){
	    if(s[0] == s[4] && s[0] == s[8]) win = s[0];
	    else if(s[2] == s[4] && s[2] == s[6]) win = s[2];
	}

	writeln(win);
    }
}