Grade School Multiplication

Time limit1sMemory limit128 MB

Problem

An educational software company, All Computer Math (ACM), has a unit on the multiplication of integers. They want to display each calculation in the traditional grade-school format, like the following computation of 432 × 5678:

    432
   5678
-------
   3456
  3024
 2592
2160
-------
2452896

The final product is printed with no leading spaces, but leading spaces are required on some of the other lines to keep the columns aligned. However, by our regional rules, no line may ever contain trailing whitespace. Each line of dashes has the same length as the final product.

As a special case, when one of the digits of the second operand is a zero, it produces a single 0 in the partial answers, and the next partial result is placed on the same line rather than on the next line down. For example, consider the product 200001 × 90040:

     200001
      90040
-----------
    8000040
180000900
-----------
18008090040

The rightmost digit of the second operand is 0, which places a 0 in the rightmost column of the first partial product. Rather than continuing to a new line, the partial product of 4 × 200001 is written on the same line as that 0. The third and fourth least-significant digits of the second operand are also zeros, each producing a 0 in the second partial product, on the same line as the result of 9 × 200001.

As a final special case, if there is only one line in the partial answer, it is already the complete answer, so there is no need to compute a sum. For example, the computation of 246 × 70 is formatted as:

  246
   70
-----
17220

Your job is to generate these solution displays.

Input

The input contains one or more data sets. Each data set is a line with two positive integers, giving the operands in the required order (first operand, then second operand). Neither number has more than 6 digits, and neither has leading zeros. After the last data set comes a line containing only 0 0, which marks the end of the input.

Output

For each data set, output a label line Problem N, where N is the data set's number (starting from 1), followed by the complete multiplication laid out according to the format rules described above.

Warning: the product can have up to 12 digits, which does not fit in a 32-bit integer. Use a 64-bit integer type (for example, a long in Java, or a long long in C++).