#P1010. Pow

Pow

题目描述

As we all now that there's a easy way to describe some same consecutive factors multiply each other which is POW.

For example, 2 imes2 imes2=232\ imes2\ imes2=2^3 and 3 imes3=323\ imes3=3^2 and it is easy to see that 23<322^3<3^2.

Now, your math teacher just gave you a problem in his class which is 10099100^{99} 9910099^{100} which one is bigger? There are many ways to solve that and you solved it quickly. When you told the answer to your teach, he seemed to be unsatisfactory about that and he continued to asked the pow problems like that, which is given four positive integers a,b,c,da,b,c,d could you tell that which one is bigger between aba^b and cdc^d or they are equal.

picture: some answers in the Internet

In C, you may use the function pow to calculate the answer: ```c++ pow(2,3)=8 pow(3,2)=9 ```

输入格式

First line of the input contains one positive integer T(1leTle105)T (1\\le T\\le 10^5) indicating the number of the test cases.

Next TT lines, each line contains four positive integers a,b,c,d(1lea,b,c,dle109)a,b,c,d (1\\le a,b,c,d\\le10^9)

输出格式

Four each test case: if ab>cda^b>c^d print LEFT else if ab=cda^b=c^d print EQUAL else print RIGHT

样例

3 
3 2 2 3 
100 99 99 100 
2 4 4 2 

LEFT 
RIGHT 
EQUAL