One day Mr. Seth went to a shop to play the game of Lottery. So he scratched the Lottery card and found a number N. Lottery number K is defined as the number which only consists of digits 3 or 5 or both.
The Lottery number is always least greater (i.e. nearest to N) than the number N.
Help Mr. Seth to find the Lottery Number.
Input:
First line of input contains number of test cases T. Each test case contains a single number N.
Output:
For each test case, print the Lottery Number K in a separate line.
Constraints:
1<=T<=1000
1<=N<=10100