Solution of the machine equation#5972

Solution of the machine equation

1 second
64 megabytes
Hard

In one of the first machines created by McCulloch, there were only two rules for generating a new number from a given one, consisting of the digits , , , , , , , , , , and regarding the admissibility of numbers:

1. For any (possibly even empty) number , the number (here and elsewhere, denotes the concatenation of the records of numbers and ) is admissible, and generates the number . 2. For any admissible number , the number is also admissible. If generates the number , then generates the associate of number , that is, the number .

McCulloch often challenged Inspector Craig with problems related to this machine. These problems provided two expressions S_1(X) and S_2(X), in each of which some part of could appear (possibly more than once) as a substring. The task required finding such a value of that S_1(X) would be an admissible number, which, when input into the machine, generates the number S_2(X). The inspector asks for your help to write a program that will find the desired number .

Input

The first line of the input file specifies the expression S_1(X), which, after substituting , will be input into the machine; the second line specifies the expression S_2(X), which should be produced as output. The first line consists of no more than characters, the second no more than characters, each of which is either a decimal digit or the letter .

Output

In the first line of the output file, print Unique if a solution exists and it is unique, Multiple if there are multiple solutions, or No solution if there are no solutions. If solutions exist, in the second line print any value of that satisfies the problem condition.

Examples

Example 1

Loading
Loading