题目描述
There is an infinite binary tree which has following structure:
3
/ \
6 8
/ \ / \
11 13 15 17
/ \ / \ / \ / \
20 22 24 26 28 30 32 34
...This tree has a formula to get each node’s value. Base of the formula is even binary tree which is infinite tree made of even numbers with root node 2.
Root node’s level is 1 and level of its child nodes is 2 and so on.
Based on value of node in even tree and its level; above tree is formed
Input
First line of input contains a number T, which is total number of test cases.
Following T lines contains a number N.
Output
For every test case, output a single line containing either NO, LEFT or RIGHT.
Output NO if the number N is not in the tree.
Output LEFT if the number is in the tree and its left child of its parent node.
Output RIGHT if the number N is in the tree and its right child of its parent node.
Constraints
1 ≤ T ≤ 100
4 ≤ N ≤ 10^7
Example
Input:
3
39
16
70
Output:
RIGHT
NO
LEFT
Explanation
For 34, Its in the tree and its right child of 20.
16 is not in the tree, hence output is NO.
70 is left child of 37, so output is LEFT.
输入格式
见题面
输出格式
见题面