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.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.StringTokenizer;
import java.util.function.Function;

public class P1260C {

    static boolean multipleIndependent = true;

    void run() {
        long r = in.nextInt();
        long b = in.nextInt();
        long k = in.nextInt();
        long lcm = lcm(r, b);
        long x = lcm / Math.max(r, b);
        long y = lcm / Math.min(r, b) - 1;
//        System.out.println(((double) y / x));
//        System.out.println(Math.ceil((double) y / x));
        if (Math.ceil((double) y / x) < k) {
            System.out.println("OBEY");
        } else {
            System.out.println("REBEL");
        }
    }

    public static long gcd(long a, long b) {
        BigInteger b1 = BigInteger.valueOf(a);
        BigInteger b2 = BigInteger.valueOf(b);
        BigInteger gcd = b1.gcd(b2);
        return gcd.longValue();
    }

    public static long lcm(long number1, long number2) {
        return number1 * number2 / gcd(number1, number2);
    }

    /* -----: Template :----- */
    static InputReader in = new InputReader(System.in);
    static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    public static void main(String[] args) {
        int q = multipleIndependent ? in.nextInt() : 1;
        while (q-- > 0) {
            new P1260C().run();
        }
        out.flush();
    }

    static class InputReader {

        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            int bufferSize = 32 * 1024;
            reader = new BufferedReader(new InputStreamReader(stream), bufferSize);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public <T> T[] nextIntArrayWithFunction(int n, Function<Integer, T> function, Class<T> c) {
            T[] arr = (T[]) Array.newInstance(c, n);
            for (int i = 0; i < n; i++) {
                arr[i] = function.apply(nextInt());
            }
            return arr;
        }

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        public <T> T[] nextLongArrayWithFunction(int n, Function<Long, T> function, Class<T> c) {
            T[] arr = (T[]) Array.newInstance(c, n);
            for (int i = 0; i < n; i++) {
                arr[i] = function.apply(nextLong());
            }
            return arr;
        }

        public int[][] nextIntMap(int n, int m) {
            int[][] map = new int[n][m];
            for (int i = 0; i < n; i++) {
                map[i] = nextIntArray(m);
            }
            return map;
        }

        public long[][] nextLongMap(int n, int m) {
            long[][] map = new long[n][m];
            for (int i = 0; i < n; i++) {
                map[i] = nextLongArray(m);
            }
            return map;
        }

        public char[][] nextCharMap(int n) {
            char[][] map = new char[n][];
            for (int i = 0; i < n; i++) {
                map[i] = next().toCharArray();
            }
            return map;
        }
    }

//    static int numLength(long n) {
//        int l = 0;
//        while (n > 0) {
//            n /= 10;
//            l++;
//        }
//        return l;
//    }
//
//    static <R> long binarySearch(long lowerBound, long upperBound,
//            R value, Function<Long, R> generatorFunction, Comparator<R> comparator) {
//        if (lowerBound <= upperBound) {
//            long mid = (lowerBound + upperBound) / 2;
//            int compare = comparator.compare(generatorFunction.apply(mid), value);
//            if (compare == 0) {
//                return mid;
//            } else if (compare < 0) {
//                return binarySearch(mid + 1, upperBound, value, generatorFunction, comparator);
//            } else {
//                return binarySearch(lowerBound, mid - 1, value, generatorFunction, comparator);
//            }
//        } else {
//            return -1;
//        }
//    }
//
//    static <T> Integer[] sortSimultaneously(T[] key, Comparator<T> comparator,
//            Object[]... moreArrays) {
//        int n = key.length;
//        for (Object[] array : moreArrays) {
//            if (array.length != n) {
//                throw new RuntimeException("Arrays must have equals lengths");
//            }
//        }
//        Integer[] indices = new Integer[n];
//        for (int i = 0; i < n; i++) {
//            indices[i] = i;
//        }
//        Comparator<Integer> delegatingComparator = (a, b) -> {
//            return comparator.compare(key[a], key[b]);
//        };
//        Arrays.sort(indices, delegatingComparator);
//        reorder(indices, key);
//        for (Object[] array : moreArrays) {
//            reorder(indices, array);
//        }
//        return indices;
//    }
//
//    static void reorder(Integer[] indices, Object[] arr) {
//        if (indices.length != arr.length) {
//            throw new RuntimeException("Arrays must have equals lengths");
//        }
//        int n = arr.length;
//        Object[] copy = new Object[n];
//        for (int i = 0; i < n; i++) {
//            copy[i] = arr[indices[i]];
//        }
//        System.arraycopy(copy, 0, arr, 0, n);
//    }
//    static int prodMod(int a, int b, int mod) {
//        return (int) (((long) a) * b % mod);
//    }
//
//    static long prodMod(long a, long b, long mod) {
//        long res = 0;
//        a %= mod;
//        b %= mod;
//        while (b > 0) {
//            if ((b & 1) > 0) {
//                res = (res + a) % mod;
//            }
//            a = (a << 1) % mod;
//            b >>= 1;
//        }
//        return res;
//    }
//
//    static long sumMod(int[] b, long mod) {
//        long res = 0;
//        for (int i = 0; i < b.length; i++) {
//            res = (res + b[i] % mod) % mod;
//        }
//        return res;
//    }
//
//    static long sumMod(long[] a, long mod) {
//        long res = 0;
//        for (int i = 0; i < a.length; i++) {
//            res = (res + a[i] % mod) % mod;
//        }
//        return res;
//    }
//
//    static long sumProdMod(int[] a, long b, long mod) {
//        long res = sumMod(a, mod);
//        return prodMod(res, b, mod);
//    }
//
//    static long sumProdMod(long[] a, long b, long mod) {
//        long res = sumMod(a, mod);
//        return prodMod(res, b, mod);
//    }
//
//    static long sumProdMod(int[] a, int[] b, long mod) {
//        if (a.length != b.length) {
//            throw new RuntimeException("Arrays must have equals lengths");
//        }
//        long res = 0;
//        for (int i = 0; i < a.length; i++) {
//            res = (res + prodMod(a[i], b[i], mod)) % mod;
//        }
//        return res;
//    }
//
//    static long sumProdMod(long[] a, long[] b, long mod) {
//        if (a.length != b.length) {
//            throw new RuntimeException("Arrays must have equals lengths");
//        }
//        long res = 0;
//        for (int i = 0; i < a.length; i++) {
//            res = (res + prodMod(a[i], b[i], mod)) % mod;
//        }
//        return res;
//    }
//
//    static int[] toPrimitive(Integer[] arr) {
//        int[] res = new int[arr.length];
//        for (int i = 0; i < arr.length; i++) {
//            res[i] = arr[i];
//        }
//        return res;
//    }
//
//    static int[][] toPrimitive(Integer[][] arr) {
//        int[][] res = new int[arr.length][];
//        for (int i = 0; i < arr.length; i++) {
//            res[i] = toPrimitive(arr[i]);
//        }
//        return res;
//    }
//
//    static long[] toPrimitive(Long[] arr) {
//        long[] res = new long[arr.length];
//        for (int i = 0; i < arr.length; i++) {
//            res[i] = arr[i];
//        }
//        return res;
//    }
//
//    static long[][] toPrimitive(Long[][] arr) {
//        long[][] res = new long[arr.length][];
//        for (int i = 0; i < arr.length; i++) {
//            res[i] = toPrimitive(arr[i]);
//        }
//        return res;
//    }
//
//    static Integer[] toWrapper(int[] arr) {
//        Integer[] res = new Integer[arr.length];
//        for (int i = 0; i < arr.length; i++) {
//            res[i] = arr[i];
//        }
//        return res;
//    }
//
//    static Integer[][] toWrapper(int[][] arr) {
//        Integer[][] res = new Integer[arr.length][];
//        for (int i = 0; i < arr.length; i++) {
//            res[i] = toWrapper(arr[i]);
//        }
//        return res;
//    }
//
//    static Long[] toWrapper(long[] arr) {
//        Long[] res = new Long[arr.length];
//        for (int i = 0; i < arr.length; i++) {
//            res[i] = arr[i];
//        }
//        return res;
//    }
//
//    static Long[][] toWrapper(long[][] arr) {
//        Long[][] res = new Long[arr.length][];
//        for (int i = 0; i < arr.length; i++) {
//            res[i] = toWrapper(arr[i]);
//        }
//        return res;
//    }
}