- Time limit: 1.00 s
- Memory limit: 512 MB
Find the smallest integer greater than where each digit is the same.
Input
The first line of input consists of an integer : the number of test cases.
The following lines each represent one test case, containing the integer .
Output
Print the answer for each test on separate lines.
Example
Input:
3 5 9 123
Output:
6 11 222