Problem: You are a rebel leader and you are planning to start a revolution in your country. But the evil Government found out about your plans and set your punishment in the form of correctional labor.

You must paint a fence which consists of 10^{100} planks in two colors in the following way (suppose planks are numbered from left to right from 0): 

  * if the index of the plank is divisible by r (such planks have indices 0, r, 2r and so on) then you must paint it red; 
  * if the index of the plank is divisible by b (such planks have indices 0, b, 2b and so on) then you must paint it blue; 
  * if the index is divisible both by r and b you can choose the color to paint the plank; 
  * otherwise, you don't need to paint the plank at all (and it is forbidden to spent paint on it). 



Furthermore, the Government added one additional restriction to make your punishment worse. Let's list all painted planks of the fence in ascending order: if there are k consecutive planks with the same color in this list, then the Government will state that you failed the labor and execute you immediately. If you don't paint the fence according to the four aforementioned conditions, you will also be executed.

The question is: will you be able to accomplish the labor (the time is not important) or the execution is unavoidable and you need to escape at all costs.

Input

The first line contains single integer T (1 ≤ T ≤ 1000) — the number of test cases.

The next T lines contain descriptions of test cases — one per line. Each test case contains three integers r, b, k (1 ≤ r, b ≤ 10^9, 2 ≤ k ≤ 10^9) — the corresponding coefficients.

Output

Print T words — one per line. For each test case print REBEL (case insensitive) if the execution is unavoidable or OBEY (case insensitive) otherwise.

Example

Input


4
1 1 2
2 10 4
5 2 3
3 2 2


Output


OBEY
REBEL
OBEY
OBEY

Solution (in JAVA):

Solution:
import java.util.*; 

public class c {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in); 

    int numT = in.nextInt(); 
    for(int t=0; t<numT; t++) {
      long r = in.nextInt(); 
      long b = in.nextInt(); 
      long k = in.nextInt(); 

      // make r = the smaller one
      if(r > b) {
        r ^= b;
        b ^= r;
        r ^= b;
      } 
      
      long gcd = gcd(r, b);
      long lcm = lcm(r, b);  // could be something gross if two primes in 10^8

      // no reason not to divide out gcd
      b /= gcd;
      r /= gcd; 
      // If overlap, can alternate

      // Why not just be naive and simulate until lcm?
      // wait lcm could be super gross.

      // int firstLen = 0; // for wrapping around after lcm
      // int curLen = 0;
      // for(int i=0; i<lcm; i++) {

      // }

      // worst case is if it goes through b fully. 
      // so if a multiple of r < lcm ever  multiple%b == 1 then bad.
      long worstCase = (b - 1-1)/r +1;  // dont include the lcm, thus the -1
        // imagine getting b+1, then b+1 +r, then b+1+2r + ... 
        // 1, 1+r, 1+2r, ... b-1]
        // 0, r, 2r, ... b-2].   the +1 is for "0"
        //
        // 3 and 11.    11 | 12 15 18 21 | 22
        // (11-2)/3 +1 = 9/3 + 1 = 4.  

      // if(gcd == r) {
      //   worstCase = b/r  -1;
      //   // 2, 8.   2 4 6 | 8.  
      //   // 1, 4. 
      // }


      // So does it hit the worst case?

      boolean isGood = false;
      // trivial case
      if(r == b) {
        isGood = true;
      }

      // This seems sketch.  time to yeet some code
      if(k > worstCase) {
        isGood = true;
      }



      if(isGood) {
        System.out.println("OBEY");
      } else {
        System.out.println("REBEL");
      }

    }
  }

  static public long gcd(long a, long b) { return b == 0 ? a : gcd(b, a%b); }
  static public long lcm(long a, long b) { return a / gcd(a, b) * b; }
}

/* 

4
1 1 2
2 10 4
5 2 3
3 2 2


OBEY
REBEL
OBEY
OBEY


1 1 2  overlap = trivial
2 10 4    2 4 6 8 10   needs min k=4 for that

5 2 3     2 4 5 6 8 10   needs min k=2
3 2 2     2 3 4 6     needs min k = 1

3 5 _     3 5 *6 9* 10 12 15   needs min = 2

3 7 _     3 6 7 9 12 14 15 18 21      
worst case is if the smaller one fits perfectly between bigger ones

lcm wrapping ever an issue?
Nah, assume if you can color big you'll color big.
  probably.

3 11 _    3 6 9 11 *12 15 18 21* 22 
  Is a multiple of the number ever   multiple%big == 1 ?  if so then worse case is true

5 7 _     5 7 10 14 *15 20* 21 25 28 30 35


7 9 _     7 9 14 18 21 27 *28 35* 36   .. huh
    Is it just true?  *shrug*

2 8 _     2 4 6 8   min = 3

3 9 _     3 6 9     min = 2

4 16 _    4 8 12 16
  can just divide out their gcd


Let's see, you have two co-prime numbers
You iterate through a  b times
  Does it get every thing modulo b? I feel like yeah.


13
3 5 2
3 5 3 
3 7 2
3 7 3
3 11 3
3 11 4
3 11 5
7 9 2 
7 9 3
2 9 4 
2 9 5
2 8 3
2 8 4



13
3 5 2 - bad
3 5 3 
3 7 2 - bad
3 7 3
3 11 3 -bad
3 11 4 -bad
3 11 5
7 9 2 - bad
7 9 3
2 9 4 - bad
2 9 5
2 8 3 - bad
2 8 4

REBEL
OBEY
REBEL
OBEY
REBEL
REBEL
OBEY
REBEL
OBEY
REBEL
OBEY
REBEL
OBEY



*/