CISCO OA 8/03/2022
Anonymous User
1456

Alice and her friends appeared in CISCO hackathon and they are very exicted . In hackathon htey have given a programming question on string in which Alice and her team needs to form a string of length n by using two characters 'A' and 'B' in which two consecutive B's are not allowed .
Alice can generate any string by using permutation and satisfying the above condition . So, Alice and her team can make any number of strings but there is one more condition in which they need to sort all the the possible strings in lexographical order and they provide a string as output which comes at a particular index mentioned in question.

Input Format :
T - Test Cases
N - number of characters M - index
1<=t<=10
1<=N<=100
1<=M<=10^9

Input -
2
2 3
2 4

Output -
BA
Not possible

Comments (2)