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 JavaScript (node.js v5.12) (judge verdict: Runtime Error)

'use strict'

function main(input) {

  // 最大数が1e100なので、文字列として比較

  input = input.split('\n').slice(0, -1);
  const A = input[0]
  const B = input[1]

  const G = 'GREATER'
  const L = 'LESS'
  const E = 'EQUAL'

  //桁のチェック
  if (A === B) {
    console.log(E)
    return
  } else if (A.length > B.length) {
    consone.log(G)
    return
  } else if (A.length < B.length) {
    console.log(L)
    return
  } else {

    //桁は同じなので先頭の数字から比較
    for (let i = 0; i < A.length; i++) {
      let tmpA = Number(A.charAt(i))
      let tmpB = Number(B.charAt(i))
      // console.log(tmpA, tmpB)
      if (tmpA > tmpB) {
        console.log(G)
        return
      } else if (tmpA < tmpB) {
        console.log(L)
        return
      }
    }
  }

}
main(require("fs").readFileSync("/dev/stdin", "utf8"));