Distance from the point#4262

Distance from the point

1 second
122.174 megabytes
Easy

Three points , and are given.

Find the distance from point to the line, ray and segment, formed with points and .

Input

First line contains two integers - the coordinates of point . Next two lines in the same format contains points and (A \neq B). All input integers are not greater than .

Output

In the first line print one real number - the distance from point to the line. In the next two lines print the distance from the ray ( is the ray starting point) and from the segment . Print all numbers with accuracy not less than 10^{-6}. The ray is directed from point to point .

Examples

Example 1

Loading
Loading