import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.container;

void main()
{
	foreach (line; stdin.byLine) {
		auto x = line.chomp.array;
		auto field = new int[](9);

		foreach (i, e; x) {
			if (e == 'o') field[i] = 1;
			else if (e == 'x') field[i] = -1;
			else field[i] = 0;
		}

		int res;
		foreach (i; 0..3) {
			auto a = field[i*3] + field[i*3+1] + field[i*3+2];
			auto b = field[i] + field[i+3] + field[i+6];
			if (a == 3 || b == 3) res = 1;
			else if (a == -3 || b == -3) res = -1;
		}

		auto a = field[0] + field[4] + field[8];
		auto b = field[2] + field[4] + field[6];
		if (a == 3 || b == 3) res = 1;
		else if (a == -3 || b == -3) res = -1;

		if (res == 1) writeln("o");
		else if (res == -1) writeln("x");
		else writeln("d");
	}
}