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 A and B.
Dividing A by B 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.
The first line contains the number of test cases T. (1≤T≤200)
The first line of each test case contains two integers N and M. N is the length of sequence A and M is the length of sequence B. (1≤N,M≤110,000)
The second line contains the N elements of sequence A separated by spaces, and the third line contains the M elements of sequence B in the same format. Every element is an integer between 1 and 1,000,000.
The two numbers being divided are the products of the sequences, so A=A1×A2×⋯×AN and B=B1×B2×⋯×BM.
For each test case, print one line in the form Case #i: X / Y. Here i is the test case number starting from 1, and X/Y is A divided by B 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 1 anyway. Both X and Y fit in a 32-bit integer.