Jack and Jill are playing a game. Jack chooses some positive
integer n at random, and then Jill must construct that number with the
following rules:
n.2.1 to the current number.1 to the number on the previous turn, then she cannot perform that same action again on the next turn.For example if Jack imagines the number 13, then Jill can perform a sequence of actions to the number 2 which yields the desired number:
2 -> 3 -> 6 -> 12 -> 13
If we refer to the Doubling as action A and the Addition as action B, then we can describe this sequence with the string:
BAAB
Input Data
First line will be Q, the quantity of testcases.
Q lines will then follow, each with a single integer n being the number that Jack has chosen.
Answer
Should consist of Q space-separated strings corresponding the to the sequence of actions taken by Jill to produce the number n, starting from 2.
Example
input data:
2
13
1234
answer:
BAAB AABABAABAAABA