Considering -digit primes containing repeated digits it is clear that they cannot all be the same: is divisible by , is divisible by , and so on. But there are nine -digit primes containing three ones: .
We shall say that represents the maximum number of repeated digits for an -digit prime where is the repeated digit; represents the number of such primes; and represents the set of these primes.
So is the maximum number of repeated digits for a -digit prime where one is the repeated digit, there are such primes, and . It turns out that for , it is only possible to have repeated digits, but there are such cases.
Determine the set for a given values of and .
First line contains an integer denoting the number of test cases.
Each of the following lines contain two integers and .
For each of test cases print one line containing all primes that belong to in ascending order.