#P1326A. Bad Ugly Numbers
Bad Ugly Numbers
Description
You are given a integer (). Find any integer which satisfies these conditions, or report that there are no such numbers:
In the decimal representation of :
- ,
- consists of digits,
- no digit in equals ,
- is not divisible by any of it's digits.
The input consists of multiple test cases. The first line of the input contains a single integer (), the number of test cases. The next lines each describe a test case.
Each test case contains one positive integer ().
It is guaranteed that the sum of for all test cases does not exceed .
For each test case, print an integer which satisfies the conditions described above, or "-1" (without quotes), if no such number exists. If there are multiple possible solutions for , print any solution.
Input
The input consists of multiple test cases. The first line of the input contains a single integer (), the number of test cases. The next lines each describe a test case.
Each test case contains one positive integer ().
It is guaranteed that the sum of for all test cases does not exceed .
Output
For each test case, print an integer which satisfies the conditions described above, or "-1" (without quotes), if no such number exists. If there are multiple possible solutions for , print any solution.
Samples
Note
In the first test case, there are no possible solutions for consisting of one digit, because any such solution is divisible by itself.
For the second test case, the possible solutions are: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and .
For the third test case, one possible solution is because is not divisible by , or and has three digits (none of which equals zero).