All Tracks Basic Programming Input/Output Basics of Input/Output Problem

Lift queries
Tag(s):

Easy

Problem
Editorial
Analytics

There are 7 floors in BH3 and only 2 lifts. Initially Lift A is at the ground floor and Lift B at the top floor. Whenever someone calls the lift from N th floor, the lift closest to that floor comes to pick him up. If both the lifts are at equidistant from the N th floor, them the lift from the lower floor comes up.


INPUT

First line contains a integer denoting the number of test cases.

Next lines contains a single integer denoting the floor from which lift is called.


OUTPUT

Output T lines containing one character "A" if the first lift goes to N th floor or "B" for the second lift.


CONTRAINTS

0 <= N <= 7

1 <= T <= 100000


 

SAMPLE INPUT
2
3
5
SAMPLE OUTPUT
A
A
Explanation

3rd floor calls, Lift A(0) goes there.

5th  floor calls, Lift A(3) and Lift B(7) are equidistant from 5, so Lift from lowest floor goes there i.e. A.

Time Limit: 1,0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: Bash, C, C++, C++14, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, JavaScript(Rhino), JavaScript(Node.js), Julia, Kotlin, Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, R(RScript), Racket, Ruby, Rust, Scala, Swift, Swift-4.1, TypeScript, Visual Basic

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

Уведомления
View All Notifications

?