#include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main(){
	string s;
	while(cin>>s){
		bool f=0;
		rep(i,0,3){
			if(s[3*i]==s[3*i+1] && s[3*i]==s[3*i+2]){
				o(s[3*i]); f=1; break;
			}
		}
		if(f) continue;
		rep(i,0,3){
			if(s[i]==s[i+3] && s[i]==s[i+6]){
				o(s[i]); f=1; break;
			}
		}
		if(f) continue;
		if(s[0]==s[4] && s[0]==s[8]){
			o(s[0]); f=1;
		}
		if(f) continue;
		if(s[2]==s[4] && s[2]==s[6]){
			o(s[2]); f=1;
		}
		if(!f) o('d');
	}
}