#include <cstdio>
#include <iostream>
#include <cstring>
#include <map>
#include <algorithm>
using namespace std;
typedef long long LL;
#define PI 3.1415926536

int main(){
    string a, b;
    while(cin >> a >> b) {
        int flag = 0;
        if(a.size() > b.size()) flag = 1;
        else if(a.size() == b.size()) {
            for (int i = 0; i < a.size(); i++) {
                if(a[i] > b[i]){
                    flag = 1;
                    break;
                }
                else if(a[i] < b[i]) break;
                else flag = 2;
            }
        }
        if(flag == 1) cout << "GREATER" << endl;
        else if(flag == 2) cout << "EQUAL" << endl;
        else cout << "LESS" << endl;
    }
    return 0;
}