Given a positive integer N, find the smallest number S such that the product of all the digits of S is equal to the number N.
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. The first line of each test case contains a positive integer N.
Print out the number S. If there exists no such number, then print -1.
1 <= T <= 200
1 <= N <= 109
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.