Find the largest palindrome made from the product of two 3-digit numbers which is less than N .
First line contains T that denotes the number of test cases. This is followed by T lines, each containing an integer,N .
Print the required answer for each test case.
1≤ T ≤ 100
101101≤ N ≤ 1000000
2
101110
800000
101101
793397