Big Division

No attempts yetTime limit5sMemory limit128 MB

Problem

Theoretical physicists did not believe that the ultimate answer to the question of life, the universe, and everything is 42. (That is the answer given in The Hitchhiker's Guide to the Galaxy.) They decided the real answer sits in the quotient of two positive integers AA and BB.

Dividing AA by BB is harder than it looks. Each of the two numbers is given as a product of many integers, and writing those products out in full can run to hundreds of digits, which an old computer takes an enormous amount of time to divide.

You are a clever programmer, so help the theoretical physicists out.

Input

The first line contains the number of test cases TT. (1T2001 \le T \le 200)

The first line of each test case contains two integers NN and MM. NN is the length of sequence AA and MM is the length of sequence BB. (1N,M110,0001 \le N, M \le 110{,}000)

The second line contains the NN elements of sequence AA separated by spaces, and the third line contains the MM elements of sequence BB in the same format. Every element is an integer between 11 and 1,000,0001{,}000{,}000.

The two numbers being divided are the products of the sequences, so A=A1×A2××ANA = A_1 \times A_2 \times \cdots \times A_N and B=B1×B2××BMB = B_1 \times B_2 \times \cdots \times B_M.

Output

For each test case, print one line in the form Case #i: X / Y. Here ii is the test case number starting from 1, and X/YX / Y is AA divided by BB written as a fraction in lowest terms. Put exactly one space on each side of the slash.

A fraction is in lowest terms when the numerator and denominator have been divided by their greatest common divisor and nothing cancels any further. When the quotient is a whole number, print the denominator 11 anyway. Both XX and YY fit in a 32-bit integer.