#include<cstdio>
#include<cstring>
using namespace std;
const int maxn = 1e5+5;
 int main()
 {
 	 char a[maxn],b[maxn];
 	 gets(a);
 	 gets(b);
 	 if ( a > b) printf("GREATER\n");
 	 else if ( a < b) printf("LESS\n");
 	 else printf("EQUAL\n");
 	 	 return 0;
 	 	 }