def main(input = STDIN)
  table = {'o' => 1, 's' => 0, 'x' => -1}
  while (state = input.gets.chomp.split(//)) != []
    result = nil
    3.times do |i|
      bool = 0
      bool1 = 0
      bool2 = 0
      3.times do |j|
        bool += table[state[3 * i + j]]
        bool1 += table[state[i + 3 * j]]
        bool2 += table[state[i + (4 - i) * j]]
      end
      result = true if (bool == 3) or (bool1 == 3) or (bool2 == 3)
      result = false if (bool == -3) or (bool1 == -3) or (bool2 == -3)
    end
    if result
      puts "o\n"
    elsif result.nil?
      puts "d\n"
    else
      puts "x\n"
    end
  end
end
main