#include "bits/stdc++.h"
using namespace std;
#define Rep(i,n) for(int i=0;i<(int)(n);i++)
#define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++)
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--)
#define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++)
#define put(a) cout<<a<<"\n"
#define all(a)  (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define oorret 0
#define oor(x) [&](){try{x;} catch(const out_of_range& oor){return oorret;} return x;}()
#define SZ(x) ((ll)(x).size())
typedef long long ll;
typedef pair<int, int> P;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){if(a>b){a=b;return 1;}return 0;}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){if(a<b){a=b;return 1;}return 0;}

class Demical{
public:
    int m;
    vector<int> val;//進数の値を格納、n=sum(val[i]*m^i),val[0]=0とval.size()=0がどちらを0とするかが課題
    Demical(int _m){//m進数,m>1
        m=_m;
    }
    Demical(int _m,int _size){//m進数
        m=_m;
        val.resize(_size);
    }
    void zero_pad(vector<int> a){//先頭の0を削除,値が0の時が1個だけ残す
        while(a.size()>1&&a.back()==0){
            a.pop_back();
        }
    }
    Demical sum(Demical d){//m==d.mが前提
        int max_len = max(val.size(),d.val.size());
        Demical res(m,max_len);
        int carry=0;
        REP(i,max_len){
            int temp=carry+oor(val.at(i))+oor(d.val.at(i));
            carry=temp/m;
            res.val[i]=temp%m;
        }
        if(carry!=0){
            res.val.push_back(carry);
        }
        return res;
    }
    Demical dif(Demical d){//m==d.mかつval>d.valが前提
        int max_len = val.size();
        Demical res(m,max_len);
        int borrow=0;
        REP(i,max_len){
            int temp=oor(val.at(i))-oor(d.val.at(i))-borrow;
            if(temp<0){
                borrow=1;
                temp+=m;
            }else{
                borrow=0;
            }
            res.val[i]=temp;
        }
        //zero_pad(res.val);
        return res;
    }
    Demical pro(int d){
        int max_len = val.size();
        Demical res(m,max_len);
        int carry=0;
        REP(i,max_len){
            int temp=val[i]*d+carry;
            carry=temp/m;
            res.val[i]=temp%m;
        }
        while(carry!=0){
            int temp=carry;
            carry=temp/m;
            res.val.push_back(temp%m);
        }
        //zero_pad(res.val);
        return res;
    }
    Demical quo(int d){//d!=0が前提
        int max_len = val.size();
        Demical res(m,max_len);
        int carry=0;
        for(int i=max_len-1;i>=0;--i){
            int temp=oor(val.at(i))+carry*m;
            carry=temp%d;
            res.val[i]=temp/d;
        }
        //zero_pad(res.val);
        return res;
    }
    bool GREATER(Demical d){//m==d.mが前提
        if(size()>d.size()){
            return true;
        }else if(size()<d.size()){
            return false;
        }
        int s = size();
        RREP(i,s){
            if(val[i]>d.val[i]){
                return true;
            }else if(val[i]<d.val[i]){
                return false;
            }
        }
        return false;
    }
    bool GEQ(Demical d){//m==d.mが前提
        if(size()>d.size()){
            return true;
        }else if(size()<d.size()){
            return false;
        }
        int s = size();
        RREP(i,s){
            if(val[i]>d.val[i]){
                return true;
            }else if(val[i]<d.val[i]){
                return false;
            }
        }
        return true;
    }
    bool LESS(Demical d){//m==d.mが前提
        if(size()>d.size()){
            return true;
        }else if(size()<d.size()){
            return false;
        }
        int s = size();
        RREP(i,s){
            if(val[i]<d.val[i]){
                return true;
            }else if(val[i]>d.val[i]){
                return false;
            }
        }
        return false;
    }
    bool LEQ(Demical d){//m==d.mが前提
        if(size()>d.size()){
            return true;
        }else if(size()<d.size()){
            return false;
        }
        int s = size();
        RREP(i,s){
            if(val[i]<d.val[i]){
                return true;
            }else if(val[i]>d.val[i]){
                return false;
            }
        }
        return true;
    }
    bool EQUAL(Demical d){//m==d.mが前提
        return GEQ(d)&&LEQ(d);
    }
    Demical operator+(Demical d){return sum(d);}
    Demical operator-(Demical d){return dif(d);}
    Demical operator*(int d){return pro(d);}
    Demical operator/(int d){return quo(d);}
    void operator+=(Demical d){val = sum(d).val;}
    void operator-=(Demical d){val = dif(d).val;}
    void operator*=(int d){val = pro(d).val;}
    void operator/=(int d){val = quo(d).val;}
    bool operator>(Demical d){return GREATER(d);}
    bool operator<(Demical d){return LESS(d);}
    bool operator>=(Demical d){return GEQ(d);}
    bool operator<=(Demical d){return LEQ(d);}
    bool operator==(Demical d){return EQUAL(d);}
    int size(){
        return val.size();
    }
};

int main(){
    string sa,sb;
    cin >> sa >> sb;
    Demical da(10);
    Demical db(10);
    
    RREP(i,sa.size()){
        da.val.push_back(sa[i]-'0');
    }
    RREP(i,sb.size()){
        db.val.push_back(sb[i]-'0');
    }
    if(da>db){
        put("GREATER");
    }else if(db>da){
        put("LESS");
    }else if(da==db){
        put("EQUAL");
    }else{
        put("error");
        da.val[100];
    }
    return 0;
}


Measured memory_bytes: 256