object Main extends App {
  def removeSignZero(z: Double) = if (math.abs(z) == 0) 0 else z
  Stream
    .continually(readLine)
    .takeWhile(_ != null)
    .map(_.split(" ").map(_.toInt))
    .map {
      case Array(a, b, c, d, e, f) =>
        val det = (a * e - b * d).toDouble
        Seq((c * e - b * f) / det, (a * f - c * d) / det).map(removeSignZero).map(d => f"$d%.3f").mkString(" ")
    }
    .foreach(println)
}

