def jd(m,a,b,c)
  return [true,m[a]] if m[a]==m[b] and m[b]==m[c] and m[a]!="s"
  return [false,0]
end
while gets
  m=$_.chomp.split("")
  l=jd(m,0,1,2)<<jd(m,3,4,5)<<jd(m,6,7,8)<<jd(m,0,3,6)<<jd(m,1,4,7)<<jd(m,2,5,8)<<jd(m,0,4,8)<<jd(m,2,4,6)
  q=l.flatten!.index(true)
  puts q.nil? ? "d" : l[q+1]
end