#C1227. Lexicographically Largest String
Lexicographically Largest String
Lexicographically Largest String
You are given a string S consisting of lowercase English letters. You can perform any number of swap operations on the characters of the string. Your task is to produce the lexicographically largest string possible by reordering the characters of S.
In formal terms, let S = s1s2...sn. You need to produce a permutation of these characters such that the resulting string is maximum in lexicographical order. In other words, if you denote the answer by T, then for any other permutation U of S, it holds that T \geq U (in lexicographical order).
Hint: Sorting the characters in descending order yields the desired result.
The problem can also be expressed mathematically as follows:
\[ \text{Find } T \text{ such that } T = \max\{ \pi(S) : \pi \text{ is a permutation of } S \} \]
inputFormat
The input consists of a single line containing the string S (1 ≤ |S| ≤ 105), composed of lowercase English letters.
You should read the input from stdin.
outputFormat
Output a single line: the lexicographically largest string that can be obtained by reordering the characters of S.
The output should be written to stdout.
## samplea
a