Global Positioning System
Recently in Flatland it was decided to create the Newest Global Positioning System. Since the country occupies an infinitely large portion of the plane, the output of the satellites is very difficult, so it was decided to confine ourselves to the ground-based positioning method.
To this end, three radio towers were built in Flatland, not on the same straight line. An object that wants to know its location sends a signal to the towers. By the strength of the signal, reaching the towers, the distance between the towers and the object is determined.
Write a program that implements the last component of the system, which, by obtaining the coordinates of the towers and the distance from the object to each of them, finds the coordinates of the object.
Input
First line contains three pairs of numbers x[1]
, y[1]
, x[2]
, y[2]
, x[3]
and y[3]
- the tower coordinates. Second line contains three non-negative numbers - the distances to corresponding towers. All input numbers are integers and do not exceed 50 by absolute value.
Output
If there is no such location for the object, that the distances to the towers correspond the data, then output single word "Impossible". Otherwise output two numbers - the coordinates of the object with an accuracy of six decimal places.