#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <iostream>
#include <algorithm>

using namespace std;

typedef long long ll;
const int N = 1e7 + 5;
string a[N], b[N];

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