#include <iostream>
#include <sstream>
#include <algorithm>
#include <cstdio>
#include <string>


#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(int x=from;x<to;x++)

using namespace std;


int main(void){

string ws;
char bd[3][3];

	while(!cin.eof()){
		getline(cin,ws);
		if(cin.eof()) break;
		rep(i,9){
			int zi = i/3; int zz = i%3;
			bd[zi][zz] = ws[i];
		}
//		rep(i,3) rep(j,3) { cout << bd[i][j] << "-";if(j>1) cout <<endl; }
		string ans = "d";
		rep(i,3) if(bd[i][0]==bd[i][1] && bd[i][0]==bd[i][2] ){
					ans = bd[i][0]; break;
					}
		if(ans=="d") 
			rep(i,3) if(bd[0][i]==bd[1][i] && bd[0][i]==bd[2][i] ){
					ans = bd[0][i]; break;
					}
		if(ans=="d") 
			if(bd[0][0]==bd[1][1] && bd[1][1]==bd[2][2] ||
			   bd[0][2]==bd[1][1] && bd[1][1]==bd[2][0]){
					ans = bd[1][1]; 
					}
		cout << ans << endl;
	}		
	return 0;
	
}