Once a Push-To Telescope is set up, it tells you where to point the telescope to see a star in its built-in catalogue by giving an azimuth (counter-clockwise angle in the base plane of the telescope) and elevation (angle above the base plane of the telescope). The telescope is initialized by pointing it at a known star, finding the star in the catalogue, and selecting it. This step is repeated with a second known star that is not too close to the first one.
The direction of stars in the catalogue is given in geocentric equatorial coordinates. The origin is the center of the Earth. The positive z-axis passes through the North Pole, and the xy-plane contains the equator. The x-axis points at the sun at the spring equinox (when the sun is in the equatorial plane). The star coordinates are right ascension, , (angle in the xy-plane counter-clockwise from the x-axis, in degrees) and declination, , (angle above (positive) or below (negative) the xy-plane).


In this coordinate system, the Earth rotates at 2 \cdot 1.0027379093 / 86400 radians per second. (Since the Earth moves around the sun, it must rotate more than degrees to get the sun over the same point.)
During setup, when you select a star, the system records the time (in seconds since the system was turned on), the azimuth and elevation of the telescope when pointing at the star, and the index of the star in the table. After two selections of known stars, the system computes the transformation from geocentric equatorial coordinates to local coordinates. Subsequently, when you select a star to view, the system uses the star's geocentric equatorial coordinates and the current time to compute the azimuth and elevation at which to point the telescope.
Write a program to implement the Push-To Telescope.
Since the telescope coordinate system rotates with the Earth, it may be useful to use a rotating geocentric equatorial coordinate system for star coordinates. This system aligns with geocentric equatorial coordinates when the system turns on and rotates with the Earth thereafter. In this system, the declination is the same, but the right ascension angle changes with time:
where \alpha_{\text{rot}} is the right ascension angle in the rotating system (in radians), is the right ascension angle in geocentric equatorial coordinates (in radians), is the time in seconds since the system was turned on, and is the Earth rotation rate given above.
The first line of input contains two decimal integers separated by a single space. The first integer gives the number of stars in the catalogue (0 < S \leq 100), and the second gives the number of data sets (0 < P < 100).
The next lines of input are the star table. Each line of the star table consists of a decimal integer and two floating-point values separated by spaces. The integer is the star index, and the floating-point values are the right ascension () and declination () in degrees. There is one star table, and it is used for all data sets. Each data set should be processed identically and independently using the star table.
The problem data sets follow the star table data. Each data set consists of several lines. The first line of each data set consists of two decimal integers separated by a single space. The first integer is the problem instance number . The second integer is the number of stars to find for the data set (T \leq 10).
The next two lines specify the setup data for the data set. Each setup line consists of two integers followed by two floating-point values. The integers are , the number of seconds since the system was started, and , the index of the known setup star in the table. The floating-point values are the azimuth and elevation of the star in degrees (in telescope coordinates).
The remaining lines of input in the data set specify a star the user wants to observe. Each line of input consists of three integers separated by spaces. The first integer is the number of the star to observe (the sub-problem number), the second is the time (in seconds) since the system was started, and the last is the index of the star to observe in the star table.
There are several lines of output for each data set. The first line of output contains the data set number, followed by a single space and the number of stars the user wishes to observe (). For each star to be observed, there is one line of output. If the computed elevation is less than zero (the star is below the horizon), the line consists of the star (sub-problem) number followed by a space and the string NOT VISIBLE (without the quotes). Otherwise, the line consists of the observed star (sub-problem) number followed by the azimuth and elevation in degrees to one decimal place.
Example 1