Given a number 'N'. The task is to find the Nth number whose each digit is a prime number i.e 2, 3, 5, 7. In other words, you have to find the nth number of this sequence: 2, 3, 5, 7, 22, 23,.. and so on.
The first line contains a single integer T i.e. the number of test cases. The first and only line of each test case consists of an integer N.
In one line print the nth number of the given sequence made of prime digits.
Expected Auxiliary Space: O(N).
1 <= T <= 100
1 <= N <= 100
Testcase 1: 10th number in the sequence of numbers whose each digit is prime is 33.
Testcase 2: 21st number in the sequence of numbers whose each digit is prime is 222.
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.