Preparation

The math module1 of the Python Standard Library provides some goniometric functions2 that might be very useful for this exercise. Note that these functions work with angles expressed in radians. To convert degrees to radians and vice versa, the math module provides the functions math.radians3 and math.degrees4. The following interactive session shows how these functions can be applied.

>>> from math import pi, sin, degrees, radians
>>> radians(180)
3.141592653589793
>>> degrees(pi)
180.0
>>> sin(degrees(180))
0.5715301650260188

Exercise

A sundial is a device that tells the time of day by the position of the Sun5. In common designs such as the horizontal sundial, the sun casts a shadow from its style onto a surface marked with lines indicating the hours of the day. As the sun moves across the sky, the shadow edge aligns with different hour lines. All sundials must be aligned with their styles parallel to the axis of the Earth's rotation to tell the correct time throughout the year. If the shadow points to the North (in the southern hemisphere to the South) it is exactly noon. The sun is in the South (on the southern hemisphere in the North) and at its highest position, exactly on top of the meridian. It is then 12 pm (noon) local time. From this, a distribution is made and hour lines are added, allowing to read the hour. The oldest known sundial is found in Egypt and dates back to 1500 before Christ.

horizontale zonnewijzer
Horizontal sundial (Museum of Hasselt)

As the surface of a horizontal sundial is horizontal, the shadow doesn't rotate uniformly across the surface. Moreover, the passing of the sun over the meridian does not always occur exactly at 12 pm (noon). As the earth is subdivided in time zones, this only applies to the central meridian of the timezone. Therefore, the distribution of the hour lines on the sundial is done by the following rule \[\tan(\theta) = \sin(\lambda) \times \tan(\alpha)\] with $$\lambda$$ depicting the longitude of the sundial, and $$\theta$$ the angle on the surface between a given hour line and the hour line at noon (which always points to the North). The parameter $$\alpha$$ depicts the hour angle of the sun, and is computed at hour $$t$$ (relative to noon) as $${15}^{\circ} \times t - \Delta$$, with $$\Delta$$ the difference between the latitude $$\phi_z$$ of the sundial and the latitude $$\phi_c$$ of the central meridian of the local time zone. On the central meridian of the local time zone, the angle $$\theta$$ of the hour line for 3 pm is equal to the arctangent of $$\sin(\lambda)$$, as $$\tan({45}^{\circ}) = 1$$.

Input

Three lines containing respectively the longitude $$\lambda \in \mathbb{R}$$ ($$-180 \le \lambda \leq 180$$) and latitude $$\phi_z \in \mathbb{R}$$ ($$-90 \leq \phi_z \leq 90$$) of the sundial, and the latitude $$\phi_c \in \mathbb{R}$$ ($$-90 \leq \phi_c \leq 90$$) of the central meridian of the local time zone. Latitude and longitude are given in decimal degrees.

Output

One line containing the hour, the hour angle of the sun (in degrees), and the angle of the hour line on a horizontal sundial (in degrees), and this for every hour of the day, from 6 am up to 6 pm. After all, after dark a sundial becomes quite useless. Check the example below to derive the format in which the output must be printed.

Example

Input:

-4.95
-150.5
-150.0

Output:

hour: -6; hour angle (sun): -89.5; angle (hour line): 84.22483260136025
hour: -5; hour angle (sun): -74.5; angle (hour line): 17.2829335027853
hour: -4; hour angle (sun): -59.5; angle (hour line): 8.333711921468085
hour: -3; hour angle (sun): -44.5; angle (hour line): 4.846708924373172
hour: -2; hour angle (sun): -29.5; angle (hour line): 2.794873809318643
hour: -1; hour angle (sun): -14.5; angle (hour line): 1.2783529809190628
hour: 0; hour angle (sun): 0.5; angle (hour line): -0.04314426995813971
hour: 1; hour angle (sun): 15.5; angle (hour line): -1.3707878431870524
hour: 2; hour angle (sun): 30.5; angle (hour line): -2.909643210076617
hour: 3; hour angle (sun): 45.5; angle (hour line): -5.018023174356127
hour: 4; hour angle (sun): 60.5; angle (hour line): -8.671396957302383
hour: 5; hour angle (sun): 75.5; angle (hour line): -18.450999222565326
hour: 6; hour angle (sun): 90.5; angle (hour line): 84.22483260136018