You are given an integer in the form of a string of digits, where some digits are known and some are hidden by the symbol . Your task is to determine the smallest integer that can be obtained by replacing all occurrences of with digits so that the resulting integer is divisible by every odd digit, i.e., by , , , , and .
Note: The resulting integer cannot have leading zeros.
The first line contains a single integer (1 \le t \le 100) – the number of test cases.
Each test case consists of a single string (1 \le |s| \le 5000), representing the integer with hidden digits.
It is guaranteed that \sum |s| \le 5000 for all test cases combined.
For each test case, output the smallest integer that can be obtained from by replacing all with digits such that is divisible by every odd digit. If there is no such integer, output "NO SOLUTION".
Example 1
In the first test case, the smallest integer divisible by all of , , , , and is .
\textbf{1} \times 315 = 315.
\textbf{3} \times 105 = 315.
\textbf{5} \times 63 = 315.
\textbf{7} \times 45 = 315.
\textbf{9} \times 35 = 315.
In the third test case, there is no solution.
Subtask 1 (5 points): 1 \le \sum |s| \le 5
Subtask 2 (15 points): 1 \le \sum |s| \le 10
Subtask 3 (20 points): 1 \le \sum |s| \le 50
Subtask 4 (20 points): 1 \le \sum |s| \le 250
Subtask 5 (40 points): 1 \le \sum |s| \le 1000
Subtask 6 (100 points): No additional constraints.