while gets
	a = $_.chars
	combi = [[0,1,2],[3,4,5],[6,7,8],
	         [0,3,6],[1,4,7],[2,5,8],
	         [0,4,8],[2,4,6]]
	winner = nil
	combi.each{|i|
		temp = []
		i.each{|j|
			temp << a[j]
		}
		if temp.uniq.size == 1
			winner = temp.uniq[0]
		end
	}
	if winner && winner != "s"
		puts winner
	else
		puts "d"
	end
end