Problem Description
Given two non-negative rational numbers A and B(A<B), your task is to find a fraction between (A,B).
Maybe there're many fractions in this interval. In this condition, output the fraction with the smallest sum of its denominator and molecular.
Input
The first line is an integer T(<=25) indicating the case number.
The next T lines each contains two strings, namely A and B.
A rational number contains characters '0'~'9','.','[',']' only.
Digits between '[' and ']' are recurring decimal's cycle parts.(0.[6] = 0.666...,etc.)
You may assume the input are all logical, and all the strings are no more than 16.
Output
For each case, output a fraction(as the format below) with the smallest sum of its denominator and molecular.
Sample Input
4
0 0.5
0.[6] 0.[7]
11.0[8] 11.1[5]
1.[142857] 3.[142857]
Sample Output
Case 1: 1/3
Case 2: 3/4
Case 3: 78/7
Case 4: 2/1