All Submissions


A and B decide to a play a game.They take a long strip of paper and divide it into N cells. They decide that A would start the game and B would pick up some cells on the strip and write 'B' on them.On the rest of the cells 'A' is written.
Now each player in his turn picks up any number(atleast 1) of CONTIGUOUS CELLS and puts a peg on each of them.The game ends when only 1 cell remains.Now if the remaining cell has 'B' wriiten on it ,he wins else A does.
Now B wants u to figure out that for the given strip of cells that he has prepared who will win the game if both play optimally.

INPUT:
The input file consists of a number of test cases.For each test case a string is given on a line.Take input till EOF.

OUTPUT
For each test case print "A" if A wins otherwise print "B".

CONSTRAINTS
Number of test cases<=200
N<=20

SAMPLE INPUT
BA
ABBB
BABBB


SAMPLE OUTPUT
A
A
B


Problem Setter:Shradha Chhaparia
Problem Tester: Dhruva Bhaswar

Languages: AWK,Bash,Brain,C,C++,Java,C#,JavaScript,Pascal,Perl,PHP,Python,Python3,Ruby,Text

Time Limit: 1 Second(s)
Score: 0 Point(s)
Input File Limit: 50000 Bytes

Submit

Login to post clarification.

No Clarifications.

Contest

Mode Judge

Passive

Online

Overall Rankings

RankNameScore
1xyz0
2Ams0
3TIP0
4team420
5xyzz0
6asdasdasd0
7abcd0
8khankhan0
9Gabriel0
10gigel0