Number
Very easy
Execution time limit is 0.1 seconds
Runtime memory usage limit is 256 megabytes
You are given a sequence consisting of eight digits. Each of the digits is either 1, 2 or 3. We select four of the given eight digits, write these digits in the order they are presented in the sequence and obtain a four-digit decimal number.
Your task is to select four digits in such a way that this number is as small as possible.
Input
The first line of input contains eight digits. Each of them is either 1, 2 or 3. There are no spaces between consecutive digits.
Output
On the first line of output, print the four-digit decimal number obtained by the above procedure. The number must be minimal possible.
Examples
Input #1
Answer #1
Submissions 377
Acceptance rate 35%