Starry Sky
Are we alone in the Universe, or are there others out there? The twinkling stars have always captured our imagination. What lies beyond, far away from Earth? What stars are traversing the vastness of the Universe?
The young astronomers' club at the city planetarium is also exploring the sky. The club members are keen to discover a new star or at least an asteroid not yet documented by science. To accomplish this, they conduct a series of observations. Each observation involves a detailed study of all the stars visible through the telescope in a specific plane.
Stars vary in brightness. It's known that the brightness of stars is measured in special units called stellar magnitudes. We will represent the brightness of a star as an integer ranging from 1 to 1000. When observing the starry sky, it might happen that one star completely overlaps another. In such cases, it appears as if we see a single star, with brightness equal to the sum of the brightness of these stars. Sometimes, a group of stars partially overlaps each other. In these instances, it seems as if we see all the stars, but each one has a brightness equal to the arithmetic mean of all the stars in the overlapping group.
Input
The input file starts with a line indicating N - the number of stars visible through the telescope in the given plane.
Following this, there are N lines, each describing one star. Information about a star includes its coordinates (X, Y) in parsecs and the brightness of the star B (-1000 ≤ X ≤ +1000, -1000 ≤ Y ≤ +1000, 1 ≤ B ≤ 1000). You can assume that a star is a luminous sphere with a diameter of one parsec. The telescope is located at the point with coordinates (0, 0). Naturally, the telescope does not touch or intersect any star—otherwise, Earth would be in trouble!
Output
Your program should output the coordinates and visible brightness (rounded to two decimal places) of the nearest star. If there are multiple such stars, output the one that appears first when rotating counterclockwise from the positive direction of the OX axis.