#include<cstdio>
#include<cstring>
#include<algorithm>
#include<functional>
#include<vector>
#include<stack>
#include<queue>
#include<iostream>	
char parx[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},
				};
using namespace std;
int main(void)
{
	char s[9],cpy[9];
	int p,ff;
	while(scanf("%s",s)!=EOF) {
		ff=0;
		p=0;
		for(int i=0;i<8;i++) {
			if(s[parx[i][p]]==s[parx[i][p+1]] 
			&& s[parx[i][p]]==s[parx[i][p+2]] &&s[parx[i][p]]!='s') {
				cout<<s[parx[i][p]]<<endl;
				ff=1;
			}
		}
		if(ff==0) cout<<"d"<<endl;
	}
}