Vlad and the Best of Five
Vladislav has a string of length $$$5$$$, whose characters are each either $$$\texttt{A}$$$ or $$$\texttt{B}$$$.Which letter appears most frequently: $$$\texttt{A}$$$ or $$$\texttt{B}$$$?
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 32$$$) — the number of test cases.The only line of each test case contains a string of length $$$5$$$ consisting of letters $$$\texttt{A}$$$ and $$$\texttt{B}$$$.All $$$t$$$ strings in a test are different (distinct).
For each test case, output one letter ($$$\texttt{A}$$$ or $$$\texttt{B}$$$) denoting the character that appears most frequently in the string.
testcases = int(input())
for _ in range(testcases):
    s = input()
    count_a = 0
    count_b = 0
    for i in range(len(s)):
        if s[i] == 'A':
            count_a += 1
        elif s[i] == 'B':
            count_b += 1
    if count_a > count_b:
        print('A')
    else:
        print('B')
nn = int(input())
for i in range(nn):
    ss = input()
    print('A' if ss.count('A') > ss.count('B') else 'B')
import copy
import math

def solve():
    s = input()
    j = 0
    for i in s:
        if i == 'A':
            j += 1
    if j < 3:
        print('B')
    else:
        print('A')
s = int(input())
while s:
    s -= 1
    solve()