## GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

## Subtle Substring Subtraction Solution | Codeforces Problem Solution 2022

A. Subtle Substring Subtraction
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Alice and Bob are playing a game with strings. There will be $t$ rounds in the game. In each round, there will be a string $s$ consisting of lowercase English letters.

Alice moves first and both the players take alternate turns. Alice is allowed to remove any substring of even length (possibly empty) and Bob is allowed to remove any substring of odd length from $s$.

More formally, if there was a string $s={s}_{1}{s}_{2}\dots {s}_{k}$ the player can choose a substring ${s}_{l}{s}_{l+1}\dots {s}_{r-1}{s}_{r}$ with length of corresponding parity and remove it. After that the string will become $s={s}_{1}\dots {s}_{l-1}{s}_{r+1}\dots {s}_{k}$.

After the string becomes empty, the round ends and each player calculates his/her score for this round. The score of a player is the sum of values of all characters removed by him/her. The value of $\mathtt{\text{a}}$ is $1$, the value of $\mathtt{\text{b}}$ is $2$, the value of $\mathtt{\text{c}}$ is $3$$\dots$, and the value of $\mathtt{\text{z}}$ is $26$. The player with higher score wins the round. For each round, determine the winner and the difference between winner's and loser's scores. Assume that both players play optimally to maximize their score. It can be proved that a draw is impossible.

Input

The first line of input contains a single integer $t$ ($1\le t\le 5\cdot {10}^{4}$) denoting the number of rounds.

Each of the next $t$ lines contain a single string $s$ ($1\le |s|\le 2\cdot {10}^{5}$) consisting of lowercase English letters, denoting the string used for the round. Here $|s|$ denotes the length of the string $s$.

It is guaranteed that the sum of $|s|$ over all rounds does not exceed $2\cdot {10}^{5}$.

Output

For each round, print a single line containing a string and an integer. If Alice wins the round, the string must be "Alice". If Bob wins the round, the string must be "Bob". The integer must be the difference between their scores assuming both players play optimally.