object Main extends App {
	val a = scala.io.StdIn.readLine.toList
	val b = scala.io.StdIn.readLine.toList

	val sizeA = a.size
	val sizeB = b.size

	if(sizeA > sizeB) println("GREATER")
	else if(sizeA < sizeB) println("LESS")
	else{
		var i = sizeA - 1
		var flag = true

		while(flag && i >= 0){
			if(a(i).toInt != b(i).toInt) flag = false
		}

		if(flag) println("EQUAL")
		else{
			if(a(i).toInt > b(i).toInt) println("GREATER")
			else println("LESS")
		}
	}


}