#arc134b. [arc134_b]Reserve or Reverse

[arc134_b]Reserve or Reverse

Problem Statement

Given is a string ss of length NN. Let sis_i denote the ii-th character of ss.

Snuke will transform ss by the following procedure.

  • Choose an even length (not necessarily contiguous) subsequence x=(x1,x2,ldots,x2k)x=(x_1, x_2, \\ldots, x_{2k}) of (1,2,ldots,N)(1,2, \\ldots, N) (kk may be 00).
  • Swap sx1s_{x_1} and sx2ks_{x_{2k}}.
  • Swap sx2s_{x_2} and sx2k1s_{x_{2k-1}}.
  • Swap sx3s_{x_3} and sx2k2s_{x_{2k-2}}.
  • vdots\\vdots
  • Swap sxks_{x_{k}} and sxk+1s_{x_{k+1}}.

Among the strings that ss can become after the procedure, find the lexicographically smallest one.

What is the lexicographical order?

Simply speaking, the lexicographical order is the order in which words are listed in a dictionary. As a more formal definition, here is the algorithm to determine the lexicographical order between different strings SS and TT.

Below, let SiS_i denote the ii-th character of SS. Also, if SS is lexicographically smaller than TT, we will denote that fact as SltTS \\lt T; if SS is lexicographically larger than TT, we will denote that fact as SgtTS \\gt T.

  1. Let LL be the smaller of the lengths of SS and TT. For each i=1,2,dots,Li=1,2,\\dots,L, we check whether SiS_i and TiT_i are the same.
  2. If there is an ii such that SineqTiS_i \\neq T_i, let jj be the smallest such ii. Then, we compare SjS_j and TjT_j. If SjS_j comes earlier than TjT_j in alphabetical order, we determine that SltTS \\lt T and quit; if SjS_j comes later than TjT_j, we determine that SgtTS \\gt T and quit.
  3. If there is no ii such that SineqTiS_i \\neq T_i, we compare the lengths of SS and TT. If SS is shorter than TT, we determine that SltTS \\lt T and quit; if SS is longer than TT, we determine that SgtTS \\gt T and quit.

Constraints

  • 1leqNleq2times1051 \\leq N \\leq 2 \\times 10^5
  • ss is a string of length NN consisting of lowercase English letters.

Input

Input is given from Standard Input in the following format:

NN ss

Output

Print the lexicographically smallest possible string ss after the procedure by Snuke.


Sample Input 1

4
dcab

Sample Output 1

acdb
  • When x=(1,3)x=(1,3), the procedure just swaps s1s_{1} and s3s_{3}.
  • The ss after the procedure is acdb, the lexicographically smallest possible result.

Sample Input 2

2
ab

Sample Output 2

ab
  • When x=()x=(), the ss after the procedure is ab, the lexicographically smallest possible result.
  • Note that xx may have a length of 00.

Sample Input 3

16
cabaaabbbabcbaba

Sample Output 3

aaaaaaabbbbcbbbc

Sample Input 4

17
snwfpfwipeusiwkzo

Sample Output 4

effwpnwipsusiwkzo