e-olymp
favorite We need a little bit of your help to keep things running, click on this banner to learn more
Problems

Without repetitions

Without repetitions

In positive integer A one removed some digits so that to get the biggest positive integer B with different digits. Find this number.

Input

One positive integer A (1A10100).

Output

Print positive integer B.

Time limit 1 second
Memory limit 122.17 MiB
Input example #1
575747
Output example #1
754
Source III етеп Всеукраїнської олімпіади з інформатики в Житомирській обл. 2016-2017 р