
In a very large city, unusual horse races are organized. Unlike ordinary races which take place at a hippodrome, these races are held on a special track, which is represented by an infinite straight line on the plane.
The track is very long, so the races may last several days and take place both day and night. The organizers spent a lot of time thinking about how to light the track, since lighting an infinitely long track is not easy. For this purpose, they bought floodlights to be installed at certain points in the city. It is known that the floodlights illuminate circles on the ground.
However, the installation company mixed up the installation sites, so some floodlights may not illuminate the track at all. Now the event may be at risk, and the organizers are very worried that the audience may not see the most interesting moments due to this mistake. Help the organizers determine the length of the illuminated section of the track.
The first line contains four numbers x_1, y_1, x_2, y_2 — the coordinates of two points on the straight line.
The second line contains (1 \leq N \leq 100000) — the number of floodlights.
Each of the next lines contains three numbers , and — the center coordinates and radius of each circle illuminated by a floodlight.
All coordinates and radii are integers not exceeding 10^5 in absolute value.
Print the answer to the problem with an absolute or relative error of at most 10^{-4}.
Example 1