#include <iostream>
#include <cstdio>
#include <string>
using namespace std;
#define rep2(x,from,to) for(int x = (from); x < (to); ++(x))
#define rep(x,to) rep2(x,0,to)
int main() {
	string s;
	while(cin >> s) {
		char r = 'd';
		rep(i,3) {
			char c = s[i * 3];
			bool f = 1;
			rep2(j,1,3) {
				if(s[i * 3 + j] != c) f = 0;
			}
			if(f) {
				r = c;
				break;
			}
		}
		rep(i,3) {
			char c = s[i];
			bool f = 1;
			rep2(j,1,3) {
				if(s[j * 3 + i] != c) f = 0;
			}
			if(f) {
				r = c;
				break;
			}
		}		
		char c = s[4];
		if(s[0] == c && c == s[8]) r = c;
		else if(s[2] == c && c == s[6]) r = c;
		
		cout << r << endl;
	}
	return 0;
}