K

Batting Practice

After being all out for 58 and 78 in two matches in the most prestigious tournament in the world, the coach of a certain national cricket team was very upset. He decided to make the batsmen a lot of practice. But he was wondering how to make them practice, because the possibility of getting out seems completely random for them. So he decided to keep them in practice as long as he can and told them to practice in net until they remain not out for k1 consecutive balls. But if the batsman continues to be out for consecutive k2 balls, then the coach becomes hopeless about the batsman and throws him out of the team. In both cases the practice session for the batsman ends. Now the coach is wondering how many balls the practice session is expected to take.

For a batsman the probability of being out in each ball is independent and equal to p / q. What is the expected number of balls he must face to remain not out for k1 consecutive balls or become out in consecutive k2 balls.

Input

Input starts with an integer T (≤ 12000), denoting the number of test cases.

Each case contains four integers p, q, k1 and k2 (0 < p < q < 21, 0 < k1, 0 < k2, k1 + k2 < 51).

Output

For each case of input output one line in the format "Case k: x / y". Here k is the case number starting from 1 and x and y are numerator and denominator of the expected number of balls in reduced form i.e. there is no common factors other between x and y other than 1. The input will be given in such a way that both x and y will fit in 64 bit signed integer in reduced form.

Sample Input

Output for Sample Input

5
1 2 1 1
1 2 1 2
1 2 2 2
1 3 1 3
1 3 2 1
Case 1: 1 / 1
Case 2: 3 / 2
Case 3: 3 / 1
Case 4: 13 / 9
Case 5: 5 / 3

Problem Setter: Md. Towhidul Islam Talukder, Special Thanks: Md. Arifuzzaman Arif