The distance from the point to the segment#1838

The distance from the point to the segment

1 second
256 megabytes
Easy

Given a segment in space (x_1, y_1, z_1)—(x_2, y_2, z_2) and a point (x, y, z). Find the distance from the point to the segment.

Input

You are given integers x_1, y_1, z_1, x_2, y_2, z_2, x, y, z. The absolute value of each coordinate does not exceed .

Output

Print the required distance with at least digits after the decimal point.

Examples

Example 1

Loading
Loading