Under construction

Still being built. Things may change

Sort Digits Descending

Interview

Time limit2sMemory limit128 MB

Summary
Rearrange the digits of a given natural number so they appear in descending order and print the result.
Level

Easy2 of 10

Topics
Sorting, String, Implementation
Solved
No attempts yet

Problem

Given a natural number N, rearrange the digits of N in descending order to form a new number.

Input

The first line contains the natural number N. N is at most 1,000,000,000.

Output

Print the number formed by arranging the digits of N in descending order.

Examples4

  1. Example 1

    Input
    2143
    
    Expected output
    4321
    
  2. Example 2

    Input
    999998999
    
    Expected output
    999999998
    
  3. Example 3

    Input
    61423
    
    Expected output
    64321
    
  4. Example 4

    Input
    500613009
    
    Expected output
    965310000