Repeated Rounding

Time limit1sMemory limit128 MB

Problem

You are given an integer $x$. Round it repeatedly according to the following rules.

  • If $x$ is greater than $10$, round at the ones place, i.e. change it to the nearest multiple of $10$.
  • If the result is greater than $100$, round at the tens place, i.e. change it to the nearest multiple of $100$.
  • If the result is greater than $1000$, round at the hundreds place.
  • Continue this way: while the rounded result is greater than the next threshold ($10, 100, 1000, \dots$), move one place higher and round again.

Rounding is round-half-up: if the part being dropped is at least half of the place value, round up; otherwise round down (for the ones place, a ones digit of $5$ or more rounds up). When you can no longer round (the current value is at most the current threshold), that value is the final result.

Input

The first line contains the number of test cases $n$. Each of the following lines contains one integer $x$ to be rounded. ($0 \le x \le 99999999$)

Output

For each test case, print the result of rounding the given integer by the rules above, one per line.