#C9827. Smallest Number After Digit Removal

    ID: 53963 Type: Default 1000ms 256MiB

Smallest Number After Digit Removal

Smallest Number After Digit Removal

You are given a non‐negative integer represented as a string s. Your task is to remove exactly one digit from s so that the resulting number (after stripping any leading zeros) is the smallest possible.

Note: If removing a digit results in an empty string after stripping the leading zeros, then the answer should be "0".

The problem can be formalized as follows: Given a string \(s\) representing a non-negative integer, remove exactly one digit to form a new string \(s'\). Let \(\ell(s')\) denote the number obtained from \(s'\) after removing any leading zeros. Determine \(\min \ell(s')\).

inputFormat

The first line of the input contains a single integer T (\(1 \le T \le 10^5\)), the number of test cases. Each of the following T lines contains a single string s representing a large non-negative integer. It is guaranteed that s has at least 2 digits.

outputFormat

For each test case, output the smallest possible number (after removing exactly one digit and stripping any leading zeros) on a new line.

## sample
3
123
10200
10
12

200 0

</p>