while (s = gets) != "\n"
  s = s.chomp.split(//)

  c = (1..9).each_slice(3).map.to_a.concat((1..3).map{|i| i.step(9, 3).to_a}).concat([[1,5,9],[3,5,7]])

  res = "d"

  c.each do |r|
    case r.map{|i| s[i-1]}.join
    when "ooo"
      res = "o"
      break
    when "xxx"
      res = "x"
      break
    end
  end

  puts res
end