题库练习 Vlad and the Best of Five
← 上一题 下一题 →

A11351 | Vlad and the Best of Five

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

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.

输入输出样例

输入 #1
8
ABABB
ABABA
BBBAB
AAAAA
BBBBB
BABAA
AAAAB
BAAAA
输出 #1
B
A
B
A
B
A
A
A
C++ 编辑器
输入
输出