#include <cmath>
#include <ctime>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <bitset>
#include <functional>
#include <numeric>
#include <utility>
#include <iomanip>
#include <cstdio>
#include <cctype>
#include <queue>
#include <complex>
#include <climits>

typedef long long ll;

using namespace std;

int main(){
	string s;
	while(cin >> s){
		char res = '0';
		for(int i=0; i<3; ++i){
			if(s[3*i] == s[3*i+1] && s[3*i] == s[3*i+2] && s[3*i] != 's'){
				res = s[3*i];
			} else if(s[i] == s[i+3] && s[i] == s[i+6] && s[i] != 's'){
				res = s[i];
			} else if(s[0] == s[4] && s[0] == s[8] && s[0] != 's'){
				res = s[0];
			} else if(s[2] == s[4] && s[2] == s[6] && s[2] != 's'){
				res = s[2];
			}
		}

		if(res == '0'){
			res = 'd';
		}

		cout << res << endl;
	}

    return 0;
}