#include <bits/stdc++.h>
using namespace std;
int main(){
	string s;
	while(cin>>s){
		if((s[3]==s[4]&&s[3]==s[5]||s[1]==s[4]&&s[1]==s[7]||s[0]==s[4]&&s[0]==s[8]||s[2]==s[4]&&s[2]==s[6])&&s[4]!='s')cout<<s[4];
		else if((s[0]==s[1]&&s[0]==s[2]||s[0]==s[3]&&s[0]==s[6])&&s[0]!='s')cout<<s[0];
		else if((s[2]==s[5]&&s[2]==s[8]||s[6]==s[7]&&s[6]==s[8])&&s[8]!='s')cout<<s[8];
		else cout<<'d';
		cout<<endl;
	}
}