Given a number N, the task is to find a number in range from 1 to N such that its sum is maximum. If there are several such numbers, print the biggest of them.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains a number N as input.

Output:
For each test case, print the biggest number having maximum sum in new line.

Constraints: 1 <= T <= 100
1 <= N <= 10^{18}

Example: Input:
2 90 48

Output:
89
48

Explanation:

Input: n = 48
Output: 48
There are two numbers with maximum
digit sum. The numbers are 48 and 39
Since 48 > 39, it is our answer.