All submissions for this problem are available.Ajay is weak in Sports. Shivam teases Ajay for not knowing the rules of various games. For all games the last match (**Final Match**) is deciding match for whole game. Shivam asked Ajay to tell who will win Tennis Game played between Player **A** and **B**. Game is given by string **S** which contain **a** if player **A** wins current match and **b** if **B** wins current match. Can you help Ajay by printing who will win the whole game? **NOTE:** There will be no tie in game ###Input: - First line of Input contains Test Case **T** - Next **T** lines contain string **S** ###Output: For every Test Case **T** print **A** or **B**, Player winning game. ###Constraints - 1<=T<=100 - 1<=|S|<=1e5 ###Sample Input: 3 abbaaa bbbaab aaabaa ###Sample Output: A B A
|Time Limit:||2 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.