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.io.*;
import java.math.BigInteger;
import java.net.Inet4Address;
import java.util.*;

// written by luchy0120

public class Main {
    public static void main(String[] args) throws Exception {
        new Main().run();
    }



    int[] euler(int maxn) {
        int prime[] = new int[maxn + 1];
    //    int phi[] = new int[maxn+1];
        boolean visit[] = new boolean[maxn + 1];
        visit[0] = true;
        int minfactor[] = new int[maxn+1];
        minfactor[1] = 1;
        int p = 0;
        for (int i = 2; i <= maxn; ++i) {
            if (!visit[i]) {
                prime[p++] = i;
                minfactor[i] = i;
                // prime
          //      phi[i] = i-1;
            }
            for (int j = 0; j < p; ++j) {
                int check = i * prime[j];
                if( check > maxn){
                    break;
                }
                visit[check] = true;
                minfactor[check] = prime[j];
                if (i % prime[j] == 0) {
              //      phi[ check ] = phi[i] * prime[j];
                    break;
                }
          //      phi[ check ] = phi[i] * (prime[j] - 1);
            }
        }
        return minfactor;
    }
    int q[];
    int size =0;
    int rt = 1;

    void offer(int v){
        q[++size] = v;
        for(int i=size;i>1;i>>=1){
            if(q[i]>q[i>>1]){
                int t = q[i];q[i] = q[i>>1];q[i>>1] = t;
            }else break;
        }
    }

    int poll(){
        int r = q[rt];
        q[rt] = q[size--];
        for(int u=rt,v = rt<<1;v<=size;u = v,v<<=1){
            if(v+1<=size&&q[v]<q[v+1]) v++;
            if(q[u]<q[v]){
                int t = q[u]; q[u] = q[v]; q[v] = t;
            }else break;
        }
        return r;
    }

    int sz(){
        return size;
    }

    boolean ok =false;
    void dfs(int n,int tm,HashSet<Integer> g,int mx){
        if(tm>r){
            return;
        }
        if(mx << (r-tm) < n) return;


        if(g.contains(n)){
            ok = true;
            r = tm;
            return;
        }
        HashSet<Integer> st = new HashSet<>(g);
        for(int u:g){
                int t = u+mx;
                if(t>=n*2){
                    return;
                }
                st.add(t);
                dfs(n,tm+1,st,t);
                st.remove(t);
                    t = mx-u;
                    if(t==0) continue;

                    if(!g.contains(t)){

                        st.add(t);
                        dfs(n,tm+1,st,mx);
                        st.remove(t);
                    }



        }
    }
    int r;
    void solve() {
//        int t = 1;
//        while(true) {
//            int n = ni();if(n==0) break;
//            r = 0;
//            int d[] = na(n);
//            Arrays.sort(d);
//            int num[] = new int[10];
//            num[1] = d[0];
//            while (true) {
//                int p = 2;
//                boolean f[] = new boolean[n];
//                f[0] = true;
//                if (dfs(r, num, d, p,f,n)) {
//                    println("Case "+t+":");
//                    println(r);
//                    for(int i=0;i<r;++i){
//                        print(num[i]);
//                        if(i!=r-1){
//                            print(" ");
//                        }
//                    }
//                    println();
//                    t++;
//                    break;
//                }
//                r++;
//            }
//
//        }

        int t = ni();

        for(int i=0;i<t;++i){
            long r = nl();
            long b = nl();
            long k = nl();
            if(r==1&&b==1||r==1&&b==2||b==1&&r==2||r==b){
                println("OBEY"); continue;
            }
            if(r>b){
                long y =r;
                r = b;
                b = y;
            }
            if(r==1){
                if(b>k){
                    println("REBEL");
                }else{
                    println("OBEY");
                }
                continue;
            }
            long fk = gcd(r,b);
            long tot = (k-1)*r-b;

            if(tot<0&&tot+fk<0){
                println("REBEL");
            }else{
                println("OBEY");
            }



        }

}

long gcd(long a,long b){
        return b==0?a:gcd(b,a%b);
}

boolean dfs(int r,int[] num, int[] d,int p,boolean[] f,int n){
        if(p>r) return false;
        int mc = 0;
        for(boolean v:f){
            if(v) mc++;
        }
        if(mc==n) return true;

        for(int j=0;j<n;++j){
            if(!f[j]){
                int cur = d[j];
                for(int i=0;i<p;++i){
                    if(cur+num[i]>num[p-1]){
                        num[p] = cur+num[i];
                        boolean nf[] = f.clone();
                        for(int k=0;k<p;++k){
                            int dis = num[p] - num[k];
                            for(int l=0;l<n;++l){
                                if(d[l]==dis){
                                    nf[l] = true;
                                    break;
                                }
                            }
                        }
                       if(dfs(r,num,d,p+1,nf,n)){
                           return true;
                       }
                    }
                }
            }
        }
        return false;
}











    InputStream is;
    PrintWriter out;

    void run() throws Exception {
        is = System.in;
        out = new PrintWriter(System.out);
        solve();
        out.flush();
    }

    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;

    private int readByte() {
        if (lenbuf == -1) throw new InputMismatchException();
        if (ptrbuf >= lenbuf) {
            ptrbuf = 0;
            try {
                lenbuf = is.read(inbuf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (lenbuf <= 0) return -1;
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) {
        return !(c >= 33 && c <= 126);
    }

    private int skip() {
        int b;
        while ((b = readByte()) != -1 && isSpaceChar(b)) ;
        return b;
    }

    private double nd() {
        return Double.parseDouble(ns());
    }

    private char nc() {
        return (char) skip();
    }

    private char ncc() {
        int b = readByte();
        return (char) b;
    }

    private String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while (p < n && !(isSpaceChar(b))) {
            buf[p++] = (char) b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private String nline() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!isSpaceChar(b) || b == ' ') {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[][] nm(int n, int m) {
        char[][] a = new char[n][];
        for (int i = 0; i < n; i++) a[i] = ns(m);
        return a;
    }

    private int[] na(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = ni();
        return a;
    }

    private long[] nal(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) a[i] = nl();
        return a;
    }

    private int ni() {
        int num = 0, b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) {
        }
        ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') num = (num << 3) + (num << 1) + (b - '0');
            else return minus ? -num : num;
            b = readByte();
        }
    }

    private long nl() {
        long num = 0;
        int b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) {
        }
        ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') num = num * 10 + (b - '0');
            else return minus ? -num : num;
            b = readByte();
        }
    }

    void print(Object obj) {
        out.print(obj);
    }

    void println(Object obj) {
        out.println(obj);
    }

    void println() {
        out.println();
    }
}