Trisha is very good at maths. One day she was discussing palindromes. Her teacher asks Trisha to explain palindromes to the class, after doing so, her teacher asks her to find the smallest palindrome greater than 10, Trisha in no time answers the question answer: 11, moving forward her teacher starts asking her the same question for large values. As Trisha does not want to lose her reputation in the class, she asks you for help.
The first line of the input contains an integer T denoting the number of test cases. The description of each test case is as follows. Each test case contains a single line with one integer ' X ' for which you have to find the smallest palindrome greater than the input number (X).
Output: For each X, output the smallest palindrome greater than X.
1 < = T < = 10000
1 < = X < = 10000
Explanation: For the first test case 23 the smallest number which is a palindrome and greater than 23 is 33.
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.