Back

Angle Measuring

Worth 3 point(s) - Runtime Limit: 1 seconds

Introduction

Brian has just learned about radians in his pre-calculus class and is struggling with converting between radians and degrees. He would like for you to create a conversion program for his use on the test next week which he knows he can’t prepare for because he’s too busy pursuing computer science. He would also like to tell you that 360 degrees is equal to 2π radians.

Input:
The first line contains an integer N, the number of datasets. The next N lines contain the unit name followed by the unit name to convert to, followed by the value that needs to be converted.

Output:
Output the measure of the angle in the new unit to 3 decimal places along with the unit name after. (“Rad” or “Deg”)

Sample Input

3
Rad Deg 6.28
Deg Rad 360
Deg Deg 360

Sample Output

359.817 Deg
6.283 Rad
360.000 Deg