Tommy has just invented an interesting string encoding algorithm, which is described below.
For example, the encoded string of abc is cba, and the encoded string of cac is aba.
You are given a string of length $$$n$$$ and then encode all the $$$2^n-1$$$ nonempty subsequences. Your task is to find the encoded string that has the greatest lexicographical order among all the encoded strings.
The first line contains an integer $$$n$$$ $$$(1 \le n \le 1\,000)$$$.
The second line contains a string of length $$$n$$$, which consists of only the first $$$20$$$ lowercase letters, a to t.
Output the encoded string that has the greatest lexicographical order among all the encoded strings.
4 aacc
bbaa
4 acac
bba
| Название |
|---|


