This is a very straight forward question.
You are given lengths of the three sides AB, BC and CA (in this order) of a triangle ABC. You have to find one particular angle of the triangle which is specified in input.
INPUT
First line of input contains a single integer, T. T is the number of test cases.
Each of the next T lines of the input contains 4 space-separated strings . First string is of the form AB=X, second string is of form BC=Y, third string is of form CA=Z and fourth string contains only a single character (either 'A', 'B' or 'C'), denoting the angle to be found. Here, X,Y,Z are integers and may or may not have same value.
OUTPUT
Print the angle in degrees with exactly 4 digits after the decimal.
Constraints
Number of test cases: 1<=T<=100
1 <= Length of sides <= 10000
Length of sides are integers.
It is guranteed that sides correspond to a valid triangle of positive area.