#include<cstdio>
using namespace std;

int main(void){
	
	char masu[10];
	
	while(scanf("%s", masu) != EOF){
		char win='d';
		
		for(int i = 0; i < 3; i++){
			if(masu[i*3] == masu[i*3+1] && masu[i*3+1] == masu[i*3+2]){
				win = masu[i*3];
				break;
			}
			if(masu[i] == masu[i+3] && masu[i+3] == masu[i+6]){
				win = masu[i];
				break;
			}
		}
		if(masu[0] == masu[4] && masu[4] == masu[8]){
			win = masu[0];
		}
		if(masu[2] == masu[4] && masu[4] == masu[6]){
			win = masu[2];
		}
		if(win == 's')win = 'd';
		printf("%c\n",win);
		
	}
	return 0;
}