The prophet nodded with satisfaction upon seeing Shuma return with the herbs. He said to Shuma, "Follow me." Shuma obediently followed the prophet into his room. The prophet's room was large, with bookshelves lining the walls, filled with rows of neatly arranged books. On a round table in the center of the room sat a giant crystal ball, its fluorescent glow illuminating the entire space. The prophet walked to a bookshelf and pulled out a thin book. It looked very old; the paper had turned yellow, and in some places, it had even blackened. Shuma thought that this book must be several hundred years old. The prophet gestured for Shuma to sit down, opened the book, and said to him, "I have been studying this book for a long time. It is written in an ancient script and records a very old legend. The book mentions that ordinary weapons cannot harm a dragon; only the Dragon-Slaying Spear, forged by the combined efforts of the gods, can destroy it. To prevent the spear from being misused, the gods sealed it on Mount Kagees. Only someone with superhuman courage, strength, and wisdom can break this seal. For centuries, many have sought the power of the Dragon-Slaying Spear, but no one has ever succeeded. I have consulted all the records regarding the spear and studied the materials carefully. I have learned that the spear is sealed in a temple at the summit of the mountain, and to break the seal, one must push a giant round stone in the temple to the center of the altar and then recite the incantation to break the seal." Shuma asked, "That incantation must have been lost by now, right?" "No, quite the contrary," the prophet said. "The incantation is recorded in this book and has been well preserved." "Then, all that remains is to push the round stone to the center of the altar," Shuma said with a confident smile. However, the prophet shook his head. "No, Shuma, it is not as simple as you imagine. Climbing Mount Kagees is no easy task. It towers into the clouds, surrounded by bare stone walls with almost no footholds. Only a true warrior can climb it. The round stone is also not easy to move; it requires extraordinary strength. You possess these qualities, Shuma. But if that were all, the Dragon-Slaying Spear would have been taken long ago. As the book says, one must have courage, strength, and wisdom. Wisdom is the true key. If you cannot push the round stone to the center of the altar within a fixed time, the stone will automatically roll back to its original position, and the person pushing it will never be able to move it again. Furthermore, no matter how hard you push, the stone cannot roll as fast as you might hope. I estimate that only by following the shortest path can you push it to the center of the altar within the time limit. The temple is also filled with stone pillars of various sizes, and the gaps between some of them are so small that the stone cannot pass through. It is because of these difficulties that no one has been able to take the Dragon-Slaying Spear from the temple." Shuma was silent for a moment, then said, "Regardless, I must try. If I cannot obtain the Dragon-Slaying Spear, no one will be able to." The prophet nodded and said, "Go, Shuma. Remember, use your wisdom." Shuma rode his horse for ten days and ten nights, finally arriving at the foot of Mount Kagees. Just as the prophet had said, there was no path up the mountain, and he could not even find a place to set foot. Yet, relying on his courage and skilled techniques, Shuma climbed to the summit. He entered the temple and immediately saw the giant round stone. What must Shuma do to push the round stone to the center of the altar?
Description
Your task is to calculate the length of the shortest path to push the round stone to the center of the altar. Pushing to the center of the altar means that the center of the round stone coincides with the center of the altar. The initial position of the center of the round stone and the position of the center of the altar are known. The round stone has a radius $R$ and can roll in any direction. All stone pillars in the cave are right square prisms of varying sizes. During the process of pushing the round stone, the distance between the center of the round stone and all stone pillars must be no less than $R$; otherwise, the round stone will be blocked by the pillars and cannot continue to roll.
Input
The first line of the input file dragon.in contains five real numbers, representing the initial $x$-coordinate and $y$-coordinate of the center of the round stone, the radius $R$ of the round stone, and the $x$-coordinate and $y$-coordinate of the center of the altar, respectively. The second line contains an integer $N$ ($0 \le N \le 20$), representing the number of stone pillars in the temple. The following $N$ lines each contain three real numbers, providing information about a stone pillar. The three real numbers on the $(I+2)$-th line represent the $x$-coordinate and $y$-coordinate of the bottom-left corner of the $I$-th stone pillar, and its side length, respectively. All real numbers are accurate to 2 decimal places and are in the range of 0 to 1000.
Output
The output file dragon.out contains only one real number representing the length of the shortest path to push the round stone to the center of the altar, with the result rounded to two decimal places. You may assume that there is always a path to push the round stone to the center of the altar.
Examples
Input 1
0 0 10 30 40 1 10 10 10
Output 1
57.93