Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/if-raqamlardan-eng-kichik-son

Smallest number from the digits

Medium 1000 ms 64 MB 40%
Share

A three-digit positive integer $n$ is given. Find the smallest three-digit number that can be made by rearranging its three digits. The result must not start with zero.

The digits of a number rearranged into the smallest three-digit number

Input

One three-digit positive integer $n$.

Output

One three-digit positive integer — the smallest number obtained.

Note

$100 \le n \le 999$

Examples

Input #1
310
Output #1
103
Input #2
352
Output #2
235

Sign in to submit a solution

Signing up is free and takes a minute.