#include <stdio.h>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <time.h>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <string.h>

#define sf scanf
#define pf printf
#define lf double
#define ll long long
#define p123 printf("123\n");
#define pn printf("\n");
#define pk printf(" ");
#define p(n) printf("%d",n);
#define pln(n) printf("%d\n",n);
#define s(n) scanf("%d",&n);
#define ss(n) scanf("%s",n);
#define ps(n) printf("%s",n);
#define sld(n) scanf("%lld",&n);
#define pld(n) printf("%lld",n);
#define slf(n) scanf("%lf",&n);
#define plf(n) printf("%lf",n);
#define sc(n) scanf("%c",&n);
#define pc(n) printf("%c",n);
#define gc getchar();
#define re(n,a) memset(n,a,sizeof(n));
#define len(a) strlen(a)
using namespace std;

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <time.h>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <string.h>

#define sf scanf
#define pf printf
#define lf double
#define ll long long
#define p123 printf("123\n");
#define pn printf("\n");
#define pk printf(" ");
#define p(n) printf("%d",n);
#define pln(n) printf("%d\n",n);
#define s(n) scanf("%d",&n);
#define ss(n) scanf("%s",n);
#define ps(n) printf("%s",n);
#define sld(n) scanf("%lld",&n);
#define pld(n) printf("%lld",n);
#define slf(n) scanf("%lf",&n);
#define plf(n) printf("%lf",n);
#define sc(n) scanf("%c",&n);
#define pc(n) printf("%c",n);
#define gc getchar();
#define re(n,a) memset(n,a,sizeof(n));
#define len(a) strlen(a)
using namespace std;


/*
//快速幂 (a^b)%mod
//如果求逆元，则b = mod-2;
ll mod;
//
//快速幂 (a^b)%mod
//如果求逆元，则b = mod-2;
ll pow_quick(ll a,ll b){
    ll r = 1,base = a;
    while(b){
        if(b & 1){
            r *= base;
            r %= mod;
        }
        base *= base;
        base %= mod;
        b >>= 1;
    }
    return r;
}
//
struct A{
    ll op,x;
}a[100060];
int main(){
    int T = 0;
    s(T)
    ll q,m;
    for(ll i = 0; i< T; i ++) {
        //slf(ax) slf(ay) slf(bx) slf(by) slf(cx) slf(cy)
        sld(q) sld(mod)
        ll temp = 1;
        pf("Case #%d: ",i+1);
        for(ll j = 1;j <= q; j ++){
            sld(a[j].op) sld(a[j].x)
            if(a[j].op == 1){
                temp *= a[j].x;
                temp %=
                mod;
            }else if(a[j].op == 2){
                temp *= pow_quick(a[a[j].x].x,mod-2);
                temp %= mod;
            }
            pld(temp) pn
        }






        pn
    }

    return 0;
}
*/
//快速幂 (a^b)%mod
//如果求逆元，则b = mod-2;
//ll a[100000];
int main() {
    string a;
    string b;
    cin >> a >> b;

    if(a.length() < b.length()){
        puts("LESS");
    }else if(a.length() > b.length()){
        puts("GREATER");
    }else{
    if(a > b){
            puts("GREATER");

        }else if(a < b){
            puts("LESS");
        }else{
            puts("EQUAL");
        }
    }
    /*ll n,m,k;
    while(~scanf("%lld",&n)){
        sld(m) sld(k)
        if(k & 1){
            k --;
        }
        if(k >= n+m+n+m){
            k = n+m+n+m;
        }
        ll sum = 0;
        //保证n<m
        if(m < n){
            swap(n,m);
        }
        //pld(sum) pn

        for(ll i = 1; i <= k/2-m; i ++){
            ll x = k/2-i;
            sum += (n-i+1)*(x*m+x-(x+1)*x/2);
        }
        pld(sum) pn
    }*/
    return 0;
}


Measured memory_bytes: 504