// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>



using namespace std;



int main(){

	char s[205];

	char s1[205];

	int a[205];

	int b[205];

	int flag = 0;

	scanf("%s%s",s,s1);

	int len = strlen(s);

	int len1 = strlen(s1);

	if(len > len1) printf("GREATER\n");

	else if(len < len1) printf("LESS\n");

	else if(len == len1){

		for(int i = 0; i < len; i++){

			a[i] = s[i] - '0';

			}

		for(int i = 0; i< len1; i++){

			b[i] = s1[i] - '0';

			}

		for(int i =0; i < len; i++){

			if(a[i] > b[i]){

				flag = 1;

				printf("GREATER\n");

				break;

			}			

			else if(a[i] < b[i]){

				flag = 1;

				printf("LESS\n");

				break;

				}

		}

		if(flag == 0) printf("EQUAL\n");

	}

}

// Fastest known solution for this problem: