#C2498. Smallest Number After Deleting One Digit

    ID: 45820 Type: Default 1000ms 256MiB

Smallest Number After Deleting One Digit

Smallest Number After Deleting One Digit

You are given a string \(S\) consisting only of digits (0–9). Your task is to delete exactly one digit from \(S\) such that the resulting string is the smallest possible.

Formally, for a string \(S\) of length \(n\), if you remove the digit at index \(i\) (with \(0 \le i < n\)), the resulting string is \[ S_i = S[0:i] + S[i+1:n]. \] Your goal is to choose an index \(i\) such that \(S_i\) is minimized according to lexicographical order. Note that the output should remain a string (thus, any leading zeros are preserved).

Examples:

  • For \(S = \texttt{132}\), removing the second digit gives \(S_1 = \texttt{12}\), which is the smallest.
  • For \(S = \texttt{1001}\), the smallest string obtainable is \(\texttt{001}\) (even though numerically it represents 1, you must preserve the leading zeros).

Read the input from standard input and print the result to standard output.

inputFormat

The input consists of a single line containing a non-empty string \(S\), which consists of digits from 0 to 9.

outputFormat

Output the smallest possible string obtainable by deleting exactly one digit from \(S\). The answer should be printed on standard output.

## sample
132
12