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++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    string a,b;
    cin>>a>>b;
    int ans=-1; // 0=a , 1=draw , 2=b
    if(a.length()>b.length())
        ans=0;
    else if(a.length()<b.length())
        ans=2;
    else{
        ans=1;
        for(int i=0;i<a.length();i++){
            if(b[i]>a[i]){
                ans=2;
                break;
            }
            else if(a[i]>b[i]){
                ans=0;
                break;
            }
        }
    }
    if(ans==0){
        cout<<"GREATER"<<endl;
    }
    else if(ans==0){
        cout<<"EQUAL"<<endl;
    }
    else{
        cout<<"LESS"<<endl;
    }
    return 0;
}