#include <bits/stdc++.h>
using namespace std;
int main() {
  string sa, sb;
  unsigned long long la, lb, lc;
  cin >> sa;
  cin >> sb;
  la = sa.size();
  lb = sb.size();
  if (la > lb)
    cout << "GREATER";
  else if (la < lb)
    cout << "LESS";
  else {
    if (sa > sb)
      cout << "GREATER";
    else if (sa < sb)
      cout << "LESS";
    else if (sa == sb)
      cout << "EQUAL";
  }
  return 0;
}
