#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
using namespace std;
const int MaxN = 1e3 + 5;

char a[1005], b[1005];

int main() {
	int l1 = strlen(a);
	int l2 = strlen(b);
	if(l1 < l2) printf("LESS\n");
	else if(l1 > l2) printf("GREATER\n");
	else {
		for(int i = 0; i < l1; i++) {
			if(a[i] < b[i]) {
				printf("LESS\n");
				return 0;
			}
			else if(a[i] > b[i]) {
				printf("GREATER\n");
				return 0;
			}
		}
		printf("EQUAL\n");
	}
	return 0;
}