AT_agc078_c [AGC078C] AB vs. BA

Description

You are given a string $ S $ of length $ N $ consisting of `A` and `B`. Abel and Bart play a game using $ S $ . Starting with Abel, they take turns performing the following operation. - Abel chooses one substring `AB` of $ S $ and deletes it. - Bart chooses one substring `BA` of $ S $ and deletes it. The person who cannot perform the operation on their turn loses, and the other person wins. Find the winner when both players act optimally. Solve $ T $ test cases for each input.

Input Format

The input is given from Standard Input in the following format: > $ T $ $ \mathrm{case}_1 $ $ \mathrm{case}_2 $ $ \vdots $ $ \mathrm{case}_T $ Each test case is given in the following format: > $ N $ $ S $

Output Format

Output $ T $ lines. The $ i $ -th line should contain `Abel` if Abel wins the $ i $ -th test case, and `Bart` otherwise.

Explanation/Hint

### Sample Explanation 1 In the first test case, if Abel deletes the left `AB`, then $ S= $ `AAB`, and Bart cannot perform the operation, so Abel wins. In the second test case, if Abel deletes `AB`, then $ S= $ `ABA`. Next, if Bart deletes `BA`, then $ S= $ `A`, and Abel cannot perform the operation, so Bart wins. ### Constraints - $ 1 \le T \le 2 \times 10^5 $ - $ 1 \le N \le 2 \times 10^5 $ - $ S $ is a string of length $ N $ consisting of `A` and `B`. - The sum of $ N $ over the $ T $ test cases is at most $ 2 \times 10^5 $ . - All input values are integers.