#Lutece0431. Sum of Digits

Sum of Digits

Migrated from Lutece 431 Sum of Digits

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

Petka thought of a positive integer n and reported to Chapaev the sum of its digits and the sum of its squared digits. Chapaev scratched his head and said: “Well, Petka, I won't find just your number, but I can find the smallest fitting number.” Can you do the same?

Input

The first line contains the number of test cases tt (no more than 1000010000). In each of the following tlines there are numbers s1s_1 and s2s_2 (1s1,s2100001\leq s_1, s_2\leq 10000) separated by a space. They are the sum of digits and the sum of squared digits of the number nn.

Output

For each test case, output in a separate line the smallest fitting number n, or No solution if there is no such number or if it contains more than 100100 digits.

Samples

4
9 81
12 9
6 10
7 9
9
No solution
1122
111112

Resources

NEERC 2008, Eastern subregion quarterfin