
def yoko_chk( a )
	0.upto( 2 ){|y|
		t = a[ y * 3 ]
		ng = 0
		1.upto( 2 ){ |x|
			if a[ y * 3 + x] != t
				ng = 1
				break
			end
		}
		return true,t if (ng == 0 && t != 's')
	}	
	return false,'a'
end

def tate_chk( a )
	0.upto( 2 ){|x|
		t = a[ x ]
		ng = 0
		1.upto( 2 ){ |y|
			if a[ y * 3 + x] != t
				ng = 1
				break
			end
		}
		return true,t if (ng == 0 && t!= 's')
	}	
	return false,'a'
end

def naname_chk( a )
	#1	
	if a[0]	== a[4] && a[4] == a[8] && a[0] != 's'
		return true, a[ 0 ]
	elsif a[2] == a[4] && a[ 4 ] == a[6] && a[2] !='s'
		return true, a[ 2 ]
	end
end


def tictactoe_check( line )
	a = line.split( // )	
	check, kachi = yoko_chk( a )
	if check && (kachi != 's')
		return kachi
	end
	check, kachi = tate_chk( a )
	if check && (kachi != 's')
		return kachi
	end
	check, kachi = naname_chk( a )
	if check && (kachi != 's')
		return kachi
	end
	return 'd'
end

answers = Array.new
while line = $stdin.gets
	answers << tictactoe_check( line.chomp )
end
answers.each{|a| puts a }
