Problem:
Score : 200 points

Problem Statement

You are given two positive integers A and B. Compare the magnitudes of these numbers.

Constraints

1 ≤ A, B ≤ 10^{100}

Neither A nor B begins with a 0.

Input

Input is given from Standard Input in the following format:

A
B

Output

Print GREATER if A>B, LESS if A<B and EQUAL if A=B.

Sample Input 1

36
24

Sample Output 1

GREATER

Since 36>24, print GREATER.

Sample Input 2

850
3777

Sample Output 2

LESS

Sample Input 3

9720246
22516266

Sample Output 3

LESS

Sample Input 4

123456789012345678901234567890
234567890123456789012345678901

Sample Output 4

LESS

Solution in C++ (GCC 9.2.1) (judge verdict: Accepted)

#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pqueue priority_queue
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  string A, B;
  cin>>A>>B;
  if(A.size()>B.size()) {
    cout<<"GREATER"<<endl;
    return 0;
  }
  if(A.size()<B.size()) {
    cout<<"LESS"<<endl;
    return 0;
  }
  bool equ = true, a=false;
  for(int i=0;i<A.size();++i) {
    if(A[i]<B[i]) {
      equ = false;
      a = false;
      break;
    }
    else if(A[i]>B[i]) {
      equ = false;
      a = true;
      break;
    }
  }
  if(equ) cout<<"EQUAL"<<endl;
  else if(a) cout<<"GREATER"<<endl;
  else cout<<"LESS"<<endl;
}