Aakash is a member of Ninja club. He has a weird family structure. Every male member (M) gives birth to a male child first and then a female child, whereas every female (F) member gives birth to a female child first and then to a male child. Aakash analyses this pattern and wants to know what will be the Kth child in his Nth generation. Can you help him?
A sample generation tree is shown, where ‘M’ denotes the male member and ‘F’ denotes the female member.

The generation tree starts with a male member i.e. Aakash.
Every member has exactly two children.
The given N and K will always be valid.
Input Format:
The first line contains an integer 'T' which denotes the number of test cases. Then the test cases follow.
The first and the only line of each test case contains two space-separated integers ‘N’ and ‘K’ denoting the generation number and position of the child in Nth generation, respectively.
Output Format
For each test case, print the gender of the Kth child in the Nth generation. If the gender is male, print “Male” else print “Female” (without quotes).
The output of each test case is printed in a separate line.
Note
You don’t have to print anything, it has already been taken care of. Just implement the given function.
Constraints :
1 <= T <= 5
1 <= N <= 50
1 <= K <= 2^(N - 1)
where ‘T’ is the number of test cases, ‘N’ is generation number and ‘K’ is the position of the child in the Nth generation.
2
2 2
3 4
Female
Male
Test Case 1: 2nd child of the 2nd generation is shown in green colour.

Test Case 2: 4th child of the 3rd generation is shown in green colour.

3
5 1
3 1
4 4
Male
Male
Male
Try to find a recursive based on the relation between generation number and position of the child in Nth generation.
The idea is to find the gender of the parent of the Kth child in Nth generation. Now, if the Kth child of the Nth generation is the first child of its parent, then it’s gender will be the same as the parent’s gender else it will be the opposite. This can be done recursively.
Algorithm:
For example: N = 3, K = 3
We need to find the gender of the 3rd child in the 3rd generation.
Now, par = (K + 1) / 2 = (3 + 1) / 2 and generation = N - 1 = 2.
Now, we have to find the parent of the second child of the second generation.
par = (2 + 1) / 2 = 1 and generation = 1.
As the generation is 1, simply return “Male”.
Now, we know the gender of the parent of the 2nd child of the 2nd generation. As the 2nd child of the 2nd generation is the second child of its parent, its gender will be Female(opposite of the parent).
Now, we know the gender of the parent of the 3rd child of the 3rd generation. As the 3rd child of the 3rd generation is the first child of its parent, its gender will be Female( same as the parent’s).
Thus, “Female” is the required answer.
O(min(N, log(K)), where N is the number of generations and K is the position of the child in the Nth generation.
We are doing a constant amount of work in each recursive call and there will be at-most min(N, log(K)) recursive calls. Thus, the final time complexity is O(N).
O(N), where N is the number of generations.
We are calling the same recursive function (N - 1) times. Thus, recursion stack space is required of the size (N - 1). Hence, the space complexity is O(N).