Given a number N. Find a number K such that product of digits of K must be equal to N.
Note : K must be as smallest as possible.
Input: First line of input contains number of testcases T. For each testcase, there will be a single line containing N.
Output: For each testcase, output single integer. If K is not possible, print "-1" (without quotes).
1 <= T <= 100
1 <= N <= 1015
Testcase 1: 26 is the smallest number, and product of 2 and 6 is 12.
Testcase 2: 5 is the smallest number which is itself equal to 5.