You are on page 1of 1

A

game of strings
Problem Statement
Alice and Bob are now playing with string . Initially they choose a string s and take turn to reduce it. In each
turn one of them reduce ascii value of any one character by 1. For example d becomes c, c becomes b and
so on. The one who is unable to make a move loses the game. Given a string you need to tell who will win.
Alice always moves first.
Note: you cannot reduce 'a'.
Input Format
First line contains a single integer T which denotes number of test cases . Each of the Next T lines contains a
String.
Output Format
For every test case in Newline Output 'Bob' if Bob wins otherwise output 'Alice'.
Constraints
1<=Length of each string<=1000
1<=T<=100
Strings will only consist lower case letters.
Sample Input
3
ab
abb
hackerrank

Sample Output
Alice
Bob
Bob

Explanation
In first case Alice will reduce the string to 'aa', then Bob will have no move left.
In second case, Alice have to reduce the string to "aba" or "aab". In either case she will lose as Bob will
reduce it to "aaa" in his turn.

You might also like