Moliu Fractions

[Vocabulary] moliu (adj) - (Cantonese) Something is moliu if it is senseless, stupid, boring etc. As the title suggests, this task is very dull, so... those who hate boring tasks may consider skipping this one :-). The reason why this task is so boring is that it is taken from my younger brother’s maths homework. He is currently learning “multiplication of fractions”, and his teacher has given him loads of related exer- cises. And... as you know, all the questions in the exercises are so dull in the following aspects:

  1. They are unrealistic and meaningless; what’s the meaning of finding the weight of 3/8 bar of soap? Or 5/7 cup of cola?
  2. The answers are nearly always ugly. Values like 13/24 kilograms are not uncommon.
  3. Most important of all, you don’t even need to look into the problem statements in order to get the solutions! Just pick out all the numbers stated, multiply them together, and you get the correct answer!!! For the above reasons, instead of wasting our time in solving such boring questions by hand, why don’t we just let the computer to do the work? Please write a program that solves the questions by the method of “pick out numbers then multiply!” Input The first line of input contains an integer T. Each of the next T lines is a question to which your program should compute the answer as described above. This task deals with three types of operands, namely: integers, proper fractions and mixed fractions. As an example, the first question in the sample input reads: In each question there are at least 2 and at most 4 operands, all of which are well-formatted as shown in sample input. There is always a space (ASCII #32) immediately after each operand. All operands are non-negative, so your result will also be greater than or equal to 0. There are no improper fractions in the input, and your output should also not contain any. Output Of course, you will have to give your results in the simplest form. If your result can be expressed as an integer, you should not output it as a proper fraction or a mixed fraction. You do not have to worry about integer overflow (after all, the maths exercises are targeted to kids :-). Sample Input 2 What is the product of 2 , 6/55 and 3-1/3 ? A cookie weighs exactly 18-2/5 g. What is the weight of a packet of 12 cookies?

2/2 Sample Output 8/11 220-4/5