import java.io.*;
import java.util.StringTokenizer;

import static java.lang.Math.min;

public class bet_am {
    public int count(int a, int c, int r, int b, int g) {
        return a * (r * r + g * g + b * b) + c * min(r, min(g, b));
    }

    public void solve() {
        int t = in.nextInt();
        int a, c;
        int[] clrs = new int[3];
        for (int i = 0; i < t; i++) {
            int res = -1;
            int ind = -1;
            a = in.nextInt(); c = in.nextInt();
            clrs[0] = in.nextInt(); clrs[1] = in.nextInt(); clrs[2] = in.nextInt();
            for (int j = 0; j < 3; j++) {
                clrs[j] += 1;
                int cur_res = count(a, c, clrs[0], clrs[1], clrs[2]);
                if (res < cur_res) {
                    res = cur_res;
                    ind = j;
                }
                clrs[j] -= 1;
            }
            switch (ind) {
                case 0:
                    out.println("RED");
                    break;
                case 1:
                    out.println("GREEN");
                    break;
                case 2:
                    out.println("BLUE");
                    break;
            }
        }
    }

    MyScanner in;
    PrintWriter out;

    public void run() {
        try {
            in = new MyScanner("bet.in");
            out = new PrintWriter("bet.out");
            solve();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public MyScanner(String name) {
            try {
                br = new BufferedReader(new FileReader(name));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public String nextToken() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }

    public static void main(String[] args) {
        new bet_am().run();
    }
}
