Poodle and Bolonka#3762

Poodle and Bolonka

1 second
256 megabytes
Very easy

Poodle walks along the line segment parallel to the axis (coordinates of one end-point are (x_1, ), coordinates of the other end-point are (x_2, )). Initially, he is in the point (x_1, ) and goes to other end-point of the segment with velocity . When Poodle reaches the end-point (x_2, ), he immediately turns around and goes in the opposite direction with the same velocity until he reaches the point (x_1, ). There he turns around again, goes in the direction of (x_2, ) again, etc.

Similarly, Bolonka walks along the line segment parallel to the axis with end-points (, y_1) and (, y_2), starting from the point (, y_1). She goes with velocity as well and changes walking direction after reaching any end-point. They walk until they meet, i.e. come to same point at same time.

Your task is to determine how much time it will take (from start until the meeting moment).

Input

First line of input contains integers x_1, x_2, , and second line contains integers , y_1, y_2. All numbers do not exceed 5 \times 10^8 by absolute value.

Output

Output only one number, time when Poodle and Bolonka meet for the first time. If they can never meet, output number .

Examples

Example 1

Loading
Loading