#arc136a. [arc136_a]A ↔ BB

[arc136_a]A ↔ BB

Problem Statement

You are given a string SS of length NN consisting of A, B, C.

You can do the following two kinds of operations on SS any number of times in any order.

  • Choose A in SS, delete it, and insert BB at that position.
  • Choose two adjacent characters that are BB in SS, delete them, and insert A at that position.

Find the lexicographically smallest possible string that SS can become after your operations.

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

  • 1leqNleq2000001 \\leq N \\leq 200000
  • SS is a string of length NN consisting of A, B, C.

Input

Input is given from Standard Input in the following format:

NN SS

Output

Print the answer.


Sample Input 1

4
CBAA

Sample Output 1

CAAB

We should do the following.

  • Initially, we have S=S=CBAA.
  • Delete the 33-rd character A and insert BB, making S=S=CBBBA.
  • Delete the 22-nd and 33-rd characters BB and insert A, making S=S=CABA.
  • Delete the 44-th character A and insert BB, making S=S=CABBB.
  • Delete the 33-rd and 44-th characters BB and insert A, making S=S=CAAB.

We cannot make SS lexicographically smaller than CAAB. Thus, the answer is CAAB.


Sample Input 2

1
A

Sample Output 2

A

We do no operation.


Sample Input 3

6
BBBCBB

Sample Output 3

ABCA