AtCoder Beginner Contest 059 - Comparison

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-----
36
24

-----Sample Output-----
GREATER

Since 36>24, print GREATER.

Difficulty: EASY

Starter code:

Solutions:
a = int(input())
b = int(input())
ans = ''
if a > b:
	ans = 'GREATER'
elif a == b:
	ans = 'EQUAL'
else:
	ans = 'LESS'
print(ans)


A = int(input())
B = int(input())
print('EQUAL' if A == B else 'GREATER' if A > B else 'LESS')


a = int(input())
b = int(input())
print(['GREATER', 'EQUAL', 'LESS'][(a < b) + (a <= b)])


a = input()
b = input()
len_a = len(a)
len_b = len(b)
if len_a > len_b:
	print('GREATER')
elif len_a < len_b:
	print('LESS')
elif a > b:
	print('GREATER')
elif a < b:
	print('LESS')
else:
	print('EQUAL')


a = input()
b = input()
if len(a) > len(b):
	print('GREATER')
elif len(a) < len(b):
	print('LESS')
else:
	for i in range(len(a)):
		if a[i] > b[i]:
			print('GREATER')
			break
		elif a[i] < b[i]:
			print('LESS')
			break
	else:
		print('EQUAL')


(a, b) = (int(input()) for _ in range(2))
if a > b:
	print('GREATER')
elif a < b:
	print('LESS')
else:
	print('EQUAL')


a = int(input()) - int(input())
print('GREATER' if a > 0 else 'LESS' if a else 'EQUAL')


(a, b) = (int(input()), int(input()))
ans = ['EQUAL', 'GREATER', 'LESS']
print(ans[a > b or -(a < b)])


a = int(input())
b = int(input())
print('GREATER' if a > b else 'LESS' if b > a else 'EQUAL')


A = int(input())
B = int(input())
ans = 'EQUAL'
if A > B:
	ans = 'GREATER'
if A < B:
	ans = 'LESS'
print(ans)


A = int(input())
B = int(input())
Ans = 'EQUAL'
if A > B:
	Ans = 'GREATER'
elif A < B:
	Ans = 'LESS'
print(Ans)


def answer(a: int, b: int) -> str:
	if a == b:
		return 'EQUAL'
	if a < b:
		return 'LESS'
	if a > b:
		return 'GREATER'

def main():
	a = int(input())
	b = int(input())
	print(answer(a, b))

def __starting_point():
	main()
__starting_point()


a = input()
b = input()
if len(a) == len(b):
	if a == b:
		print('EQUAL')
	else:
		print('GREATER' if a > b else 'LESS')
else:
	print('GREATER' if len(a) > len(b) else 'LESS')


a = int(input()) - int(input())
print(a > 0 and 'GREATER' or (a < 0 and 'LESS') or 'EQUAL')


A = int(input())
B = int(input())
if A == B:
	print('EQUAL')
elif A // B > 0:
	print('GREATER')
else:
	print('LESS')


n1 = int(input())
n2 = int(input())
if n1 > n2:
	print('GREATER')
if n1 == n2:
	print('EQUAL')
if n1 < n2:
	print('LESS')


x = int(input())
y = int(input())
if x > y:
	print('GREATER')
elif x < y:
	print('LESS')
else:
	print('EQUAL')


import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):

	def assertIO(self, input, output):
		(stdout, stdin) = (sys.stdout, sys.stdin)
		(sys.stdout, sys.stdin) = (StringIO(), StringIO(input))
		resolve()
		sys.stdout.seek(0)
		out = sys.stdout.read()[:-1]
		(sys.stdout, sys.stdin) = (stdout, stdin)
		self.assertEqual(out, output)

	def test_入力例_1(self):
		input = '36\n24'
		output = 'GREATER'
		self.assertIO(input, output)

	def test_入力例_2(self):
		input = '850\n3777'
		output = 'LESS'
		self.assertIO(input, output)

	def test_入力例_3(self):
		input = '9720246\n22516266'
		output = 'LESS'
		self.assertIO(input, output)

	def test_入力例_4(self):
		input = '123456789012345678901234567890\n234567890123456789012345678901'
		output = 'LESS'
		self.assertIO(input, output)

def resolve():
	A = int(input())
	B = int(input())
	if A > B:
		print('GREATER')
	elif A < B:
		print('LESS')
	else:
		print('EQUAL')

def __starting_point():
	resolve()
__starting_point()


A = int(input())
B = int(input())
if A > B:
	ans = 'GREATER'
elif A == B:
	ans = 'EQUAL'
else:
	ans = 'LESS'
print(ans)


(a, s) = (int(input()), int(input()))
print('GREATER' if a > s else 'LESS' if a < s else 'EQUAL')


(a, b) = [int(input()) for i in range(2)]
print('GREATER' if a > b else 'LESS' if a < b else 'EQUAL')


(a, b) = map(int, open(0))
print([['LESS', 'GREATER'][a > b], 'EQUAL'][a == b])


n = int(input())
s = int(input())
if s < n:
	print('GREATER')
elif s == n:
	print('EQUAL')
else:
	print('LESS')


a = int(input())
b = int(input())
print('GREATER' if a > b else 'ELQEUSASL'[a < b::2])


def main():
	a = int(input())
	b = int(input())
	if a > b:
		print('GREATER')
	if a < b:
		print('LESS')
	if a == b:
		print('EQUAL')

def __starting_point():
	main()
__starting_point()


def answer(a: str, b: str) -> str:
	if a == b:
		return 'EQUAL'
	if a < b or len(a) < len(b):
		return 'LESS'
	if a > b or len(a) > len(b):
		return 'GREATER'

def main():
	a = input()
	b = input()
	print(answer(a, b))

def __starting_point():
	main()
__starting_point()


a = int(input()) - int(input())
print('GELRQEEUSAASTL E  R'[(a < 1) + (a < 0)::3])


n = int(input())
m = int(input())
if n > m:
	print('GREATER')
elif n < m:
	print('LESS')
else:
	print('EQUAL')


a = int(input())
b = int(input())
if a > b:
	print('GREATER\n')
elif a == b:
	print('EQUAL\n')
else:
	print('LESS\n')


import math
num1 = int(input())
num2 = int(input())
if num1 == num2:
	print('EQUAL')
elif num1 > num2:
	print('GREATER')
elif num1 < num2:
	print('LESS')


d = int(input()) - int(input())
print(['EQUAL', 'GREATER', 'LESS'][(d > 0) - (d < 0)])


import sys, math
from itertools import combinations as c, product as p
from collections import deque
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

def si():
	return input()

def ii():
	return int(input())

def fi():
	return float(input())

def lstr():
	return input().split()

def lint():
	return list(map(int, input().split()))

def lintdec():
	return list(map(lambda x: int(x) - 1, input().split()))

def lnstr(n):
	return [input() for _ in range(n)]

def lnint(n):
	return [int(input()) for _ in range(n)]

def lint_list(n):
	return [lint() for _ in range(n)]
A = ii()
B = ii()
print('GREATER' if A > B else 'LESS' if A < B else 'EQUAL')


(n, m) = map(int, open(0))
print('GREATER' if n > m else 'ELQEUSASL'[n < m::2])


(A, B) = eval('int(input()),' * 2)
if A > B:
	print('GREATER')
elif A < B:
	print('LESS')
else:
	print('EQUAL')


(a, b) = [int(input()) for _ in [0] * 2]
print('GREATER' if a > b else 'ELQEUSASL'[a < b::2])


A = int(input())
B = int(input())
print(['LESS', 'EQUAL', 'GREATER'][(A >= B) + (A > B)])


p = input
a = int(p()) - int(p())
print(['ELQEUSASL'[a < 0::2], 'GREATER'][a > 0])


(a, b) = map(int, open(0))
if a > b:
	print('GREATER')
elif a == b:
	print('EQUAL')
else:
	print('LESS')


(A, B) = [int(input()) for i in range(2)]
print('EQUAL' if A == B else 'GREATER' if A > B else 'LESS')


a = list(map(int, input().split()))
b = list(map(int, input().split()))
if len(a) > len(b):
	print('GREATER')
	return
elif len(a) < len(b):
	print('LESS')
	return
else:
	for i in range(len(a)):
		if a[i] > b[i]:
			print('GREATER')
			return
		elif a[i] < b[i]:
			print('LESS')
			return
print('EQUAL')


a = int(input())
b = int(input())
k = 2
if a > b:
	k = 0
elif a < b:
	k = 1
print(('GREATER', 'LESS', 'EQUAL')[k])


(A, B) = (int(input()), int(input()))
if A > B:
	print('greater'.upper())
if A < B:
	print('less'.upper())
if A == B:
	print('equal'.upper())


a = int(input())
b = int(input())
if a > b:
	print('GREATER')
elif a == b:
	print('EQUAL')
elif a < b:
	print('LESS')


a = int(input()) - int(input())
print(['LESS', 'GREATER', 'EQUAL'][(a >= 0) + (a == 0)])


A = int(input())
B = int(input())
s = 'EQUAL'
if A > B:
	s = 'GREATER'
if A < B:
	s = 'LESS'
print(s)


(A, B) = map(int, open(0))
print('GELRQEEUSAASTL E  R'[(A < B) + (A <= B)::3])


a = str(input())
b = str(input())
if len(a) < len(b):
	ans = 'LESS'
elif len(a) > len(b):
	ans = 'GREATER'
else:
	n = len(a)
	ans = 'EQUAL'
	for i in range(n):
		if a[i] < b[i]:
			ans = 'LESS'
			break
		elif a[i] > b[i]:
			ans = 'GREATER'
			break
print(ans)


a = int(input())
b = int(input())
s = ''
if a == b:
	s = 'EQUAL'
if a < b:
	s = 'LESS'
if a > b:
	s = 'GREATER'
print(s)


import sys
import copy
import math
import itertools
import numpy as np
A = int(input())
B = int(input())
if A > B:
	print('GREATER')
elif A < B:
	print('LESS')
elif A == B:
	print('EQUAL')


A = input()
B = input()
if A > B and len(A) == len(B) or len(A) > len(B):
	print('GREATER')
elif A < B and len(A) == len(B) or len(A) < len(B):
	print('LESS')
else:
	print('EQUAL')


A = float(input())
B = float(input())
if A > B:
	print('GREATER')
elif A < B:
	print('LESS')
else:
	print('EQUAL')


(a, b) = map(int, open(0))
print('GREATER' if a > b else 'ELQEUSASL'[a < b::2])


N = [int(input()) for i in range(2)]
print('GREATER' if N[0] > N[1] else 'LESS' if N[0] < N[1] else 'EQUAL')


(A, B) = (int(input()) for T in range(0, 2))
if A == B:
	print('EQUAL')
else:
	print(['GREATER', 'LESS'][A < B])


a = input()
b = input()
l = max(len(a), len(b))
for (i, j) in zip(a.zfill(l), b.zfill(l)):
	if int(i) > int(j):
		print('GREATER')
		break
	elif int(i) < int(j):
		print('LESS')
		break
else:
	print('EQUAL')


a = int(input())
b = int(input())
print(a > b and 'GREATER' or (a == b and 'EQUAL' or 'LESS'))


import sys
input = sys.stdin.readline

def main():
	a = int(input())
	b = int(input())
	if a > b:
		print('GREATER')
	elif a < b:
		print('LESS')
	elif a == b:
		print('EQUAL')

def __starting_point():
	main()
__starting_point()


(a, b) = map(int, open(0))
print(['ELQEUSASL'[a < b::2], 'GREATER'][a > b])


A = input()
B = input()
if len(A) > len(B):
	print('GREATER')
elif len(A) < len(B):
	print('LESS')
elif A > B:
	print('GREATER')
elif A < B:
	print('LESS')
else:
	print('EQUAL')


(a, b) = (int(input()), int(input()))
print(['ELQEUSASL'[a < b::2], 'GREATER'][a > b])


s = int(input())
t = int(input())
if s == t:
	print('EQUAL')
elif s > t:
	print('GREATER')
else:
	print('LESS')


p = input
a = int(p()) - int(p())
print(a > 0 and 'GREATER' or 'ELQEUSASL'[a < 0::2])


(A, B) = map(int, open(0))
print('GREATER' if A > B else 'LESS' if A < B else 'EQUAL')


a = int(input())
b = int(input())
c = a - b
print('GREATER' if c > 0 else 'LESS' if c < 0 else 'EQUAL')


x = int(input()) - int(input())
if x > 0:
	print('GREATER')
elif x == 0:
	print('EQUAL')
else:
	print('LESS')


(a, b) = map(int, open(0).read().split())
print('GREATER' if a > b else 'LESS' if a < b else 'EQUAL')


(A, B) = map(int, open(0).read().split())
if A > B:
	print('GREATER')
elif A < B:
	print('LESS')
elif A == B:
	print('EQUAL')


a = int(input())
b = int(input())
import math
if math.sqrt(a) == math.sqrt(b):
	print('EQUAL')
elif math.sqrt(a) > math.sqrt(b):
	print('GREATER')
elif math.sqrt(a) < math.sqrt(b):
	print('LESS')