9591: Insert One

内存限制:512 MB 时间限制:2 S
题面:传统 评测方式:文本比较 上传者:
提交:2 通过:2

题目描述

Given a decimal integer x without leading zeros, please insert a digit 1 into it such that the modified number x is still a decimal integer without leading zeros and is maximized.

Here, leading zeros refer to all zeros located to the left of the first non-zero digit in the numerical representation. If the number itself is 0, then it does not contain leading zeros.

输入格式

The first line contains an integer T (1<=T<=105), indicating the number of test cases.
Then follow T test cases. For each test case:
The only line contains an integer x (-263<=x<263).


输出格式

For each test case, output an integer in one line, representing the maximum possible changed x.

输入样例 复制

6
2
1
0
-1
-2
-1000000000000000000

输出样例 复制

21
11
10
-11
-12
-10000000000000000001