#K81532. Determine the Winner
Determine the Winner
Determine the Winner
This problem is a simple string game between two players: Alice and Bob. You are given T test cases. For each test case, you are provided with a string. The rules of the game are as follows:
- If the string contains the character
a
, then Alice wins the game. - If the string does not contain the character
a
, then Bob wins the game.
Your task is to determine the winner for each test case.
Note: The input will be provided via standard input and your output should be printed to standard output.
Formally, let \( S \) be the given string. Then the winner is defined as:
\[ \text{Winner}(S) = \begin{cases} \text{Alice}, & \text{if } a \in S, \\ \text{Bob}, & \text{otherwise.} \end{cases} \]inputFormat
The first line of the input contains a single integer \( T \) representing the number of test cases. Each of the following \( T \) lines contains one non-space string \( S \), representing a test case.
Example:
3 baca xyz abc
outputFormat
For each test case, print a single line containing either Alice
or Bob
depending on the winner of the game.
Example Output:
Alice Bob Alice## sample
1
baca
Alice
</p>