Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03471 (python)

Fixed submission:
def main():
    N,Y = list(map(int,input().split()))

    flag = False

    loop_10000 = Y // 10000
    loop_5000 = Y // 5000
    loop_1000 = Y // 1000

    for i in range(loop_10000+1):
        for j in range(loop_5000+1):
            k = N - i - j
            if(k >= 0 and i+j+k == N and 10000 * i + 5000 * j + 1000 * k == Y):
                print(i,j,k)
                flag = True
                break
            #for k in range(loop_1000+1):
            #    if(i+j+k == N and 10000 * i + 5000 * j + 1000 * k == Y):
            #        print(i,j,k)
            #        flag = True
            #        break
            #if(flag):
            #    break
        if(flag):
            break
    if(not flag):
        print(-1,-1,-1)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N,Y = list(map(int,input().split()))

    flag = False

    for i in range(N+1):
        for j in range(N+1):
            for k in range(N+1):
                if(i+j+k == N and 10000 * i + 5000 * j + 1000 * k == Y):
                    print(i,j,k)
                    flag = True
                    break
            if(flag):
                break
        if(flag):
            break
    if(!flag):
        print(-1,-1,-1)

if __name__ == "__main__":
    main()
Problem p03611 (python)

Fixed submission:
from collections import Counter

N = int(input())
a = list(map(int,input().split()))

c = [0 for _ in range(10**5+3)]

for i in a:
    c[i-1] += 1
    c[i+1] += 1
    c[i] += 1
print(max(c))

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))

c = [0 for _ in range(10**5)]

for i in a:
    c[i-1] += 1
    c[i+1] += 1
    c[i] += 1
print(max(c))
Problem p03624 (python)

Fixed submission:
S = input()

for i in range(97,26+97):
    if chr(i) not in S:
        print(chr(i))
        exit(0)
else:
    print('None')

Buggy submission (verdict: Runtime Error):
S = input()

for i in range(97,26+97):
    if chr(i) not in s:
        print(chr(i))
        exit(0)
else:
    print('None')
Problem p03697 (python)

Fixed submission:
A,B = map(int,input().split())

if A+B>=10:
    print('error')
else:
    print(A+B)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())

if A+B>=10:
    print('error')
else:
    print(A+b)
Problem p02628 (python)

Fixed submission:
n, k = map(int, input().split(" "))
p = map(int, input().split(" "))
print(sum(sorted(p)[:k]))

Buggy submission (verdict: Runtime Error):
n, k = mapt(int, input().split(" "))
p = mapt(int, input().split(" "))
print(sum(sorted(p)[:3]))
Problem p02658 (python)

Fixed submission:
def main():
    x = int(input())
    list1 = list(map(int, input().split(" ")))
    result = 1

    if 0 in list1:
        print(0)
        return 
    
    for i in list1:
        result *= i
        if result > 1000000000000000000:
            print("-1")
            exit()
    print(result)

main()

Buggy submission (verdict: Runtime Error):
x = int(input())

list1 = list(map(int, input().split(" ")))

def calc():
    result = 1
    if 0 in result:
        print("-1")
        exit()
    for i in list1:
        result *= i
        if result > 1000000000000000000:
            print("-1")
            exit()
    print(result)

calc()
Problem p02675 (python)

Fixed submission:
n = input()

remainder = int(n[-1])
if remainder in (2, 4, 5, 7, 9): print("hon")
elif remainder in (0,1,6,8): print("pon")
elif remainder is 3: print("bon")

Buggy submission (verdict: Runtime Error):
n = int(input())

remainder = n[-1]
if remainder in (2, 4, 5, 7, 9): print("hon")
elif remainder in (0,1,6,8): print("pon")
elif remainder in (3): print("bon")

Buggy submission (verdict: Runtime Error):
n = int(input())

remainder = n%10
if remainder in (2, 4, 5, 7, 9): print("hon")
elif remainder in (0,1,6,8): print("pon")
elif remainder in (3): print("bon")
Problem p02886 (python)

Fixed submission:
from itertools import combinations

def mapt(fn, *args):
    return tuple(map(fn, *args))

n = int(input())
d = mapt(int, input().split(" "))

print(sum(d[a]*d[b] for a, b in combinations(range(n), 2)))

Buggy submission (verdict: Runtime Error):
from itertools import combinations

n = int(input())
d = map(int, input().split(" "))

print(sum(d[a]*d[b] for a, b in combinations(range(n), 2)))

Buggy submission (verdict: Runtime Error):
from itertools import combinations

n = int(input())
d = mapt(int, input().split(" "))

print(sum(d[a]*d[b] for a, b in combinations(range(n), 2)))
Problem p02917 (python)

Fixed submission:
def mapt(fn, *args):
    return tuple(map(fn, *args))

def Input():
    return mapt(int, input().split(" "))

def main():
    n = int(input())
    b = Input()
    data = 0
    for i in range(n-1):
        if i == 0:
            data += b[i]
            continue
        data += min(b[i], b[i-1])
    data += b[-1]
    print(data)
main()

Buggy submission (verdict: Runtime Error):
def Input():
    return mapt(int, input().split(" "))

def main():
    n = int(input())
    b = Input()
    data = 0
    for i in range(n-1):
        if i == 0:
            data += b[i]
            continue
        data += min(b[i], b[i-1])
    data += b[-1]
    print(data)
main()
Problem p02923 (python)

Fixed submission:
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n = int(input())
    h = list(reversed(Input()))
    val = 0
    ans = 0
    for i in range(1, n):
        if h[i-1] <= h[i]: val += 1
        else: val = 0
        ans = max(ans, val)
        
    print(ans)
main()

Buggy submission (verdict: Runtime Error):
def Input():
    return map(int, input().split(" "))


def main():
    n = int(input())
    h = list(reversed(Input()))
    count = 0
    ans = 0
    for i in range(n-1):
        if h[i] <= h[i+1]:
            count += 1
        else:
            ans = max(ans, count)
            count = 0
    print(ans)
main()

Buggy submission (verdict: Runtime Error):
def Input():
    return mapt(int, input().split(" "))


def main():
    n = int(input())
    h = list(reversed(Input()))
    count = 0
    ans = 0
    for i in range(n-1):
        if h[i] <= h[i+1]:
            count += 1
        else:
            ans = max(ans, count)
            count = 0
    print(ans)
main()
Problem p02924 (python)

Fixed submission:
def main():
    n = int(input())
    x = (n *(n-1))//2
    print(x)

main()

Buggy submission (verdict: Runtime Error):
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n = int(input())
    if n == 1: print(0); exit()
    k = list(range(1, n+1))
    list1 = [i+1 for i in range(2, n)]
    a = [1] + list1[:] + [2]
    b = [2] + list1[:] + [1]
    ans = 0
    for row in (a, b):
        r = 0
        for x, y in zip(k, row):
            r += x % y
        ans = max(ans, r)
    print(ans)



main()
Problem p02945 (python)

Fixed submission:
def Input():
    return map(int, input().split(" "))

def main():
    a, b = Input()
    return max(a*b, a-b, a+b)


print(main())

Buggy submission (verdict: Runtime Error):
def Input():
    return mapt(int, input().split(" "))

  
def main():
    a, b = Input()
    return max(a*b, a-b, a+b)


print(main())
Problem p02947 (python)

Fixed submission:
from collections import Counter


def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    k = int(input())
    a = sorted(["".join(sorted(input())) for _ in range(k)])
    d = Counter(a)
    return int(sum(val*(val-1)/2 for val in d.values()))



print(main())

Buggy submission (verdict: Runtime Error):
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))



from itertools import permutations
from collections import Counter


def factorial(n):
    if n == 0:
        return 1
    return n * factorial(n-1)


def combinations_count(n, r=2):
    return factorial(n) // (factorial(n - r) * factorial(r))


def main():
    k = int(input())
    a = sorted(["".join(sorted(input())) for _ in range(k)])
    d = Counter(a)
    return sum(combinations_count(val) for val in d.values() if val > 1)


print(main())
Problem p02957 (python)

Fixed submission:
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    a, b = Input()
    if a % 2 !=  b % 2:
        print("IMPOSSIBLE")
    else:
        print((a+b)//2)

main()

Buggy submission (verdict: Runtime Error):

def Input():
    return mapt(int, input().split(" "))


def main():
    a, b = Input()
    if a % 2 !=  b % 2:
        print("IMPOSSIBLE")
    else:
        print((a+b)//2)

main()
Problem p02981 (python)

Fixed submission:
def mapt(fn, *args):
    return list(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n, a, b = Input()
    ans = min(n*a, b)
    print(ans)


main()

Buggy submission (verdict: Runtime Error):
def Input():
    return mapt(int, input().split(" "))


def main():
    n, a, b = Input()
    ans = min(n*a, b)
    print(ans)


main()
Problem p02999 (python)

Fixed submission:
def main():
    a, b = map(int, input().split(" "))
    print(0 if a < b else 10)

main()

Buggy submission (verdict: Runtime Error):
def Input():
    return mapt(int, input().split(" "))

def main():
    a, b = Input()
    print(0 if a < b else 10)

main()
Problem p03262 (python)

Fixed submission:
def gcd(a, b):
    """最大公約数"""
    if b == 0: return a
    return gcd(b, a % b)
  

def mapt(fn, *args):
    return list(map(fn, *args))
 
 
def Input():
    return mapt(int, input().split(" "))
 
def main():
    N, X = Input()
    x = Input()
 
    if N == 1:
        print(abs(x[0] - X))
        exit()
 
    x.append(X)
    x.sort()
    data = [abs(x[i] - x[i+1]) for i in range(N)]
 
    ans = data[0]
    for i in range(1, N):
        ans = gcd(data[i], ans)
    print(ans)
 
 
 
main()

Buggy submission (verdict: Runtime Error):
def mapt(fn, *args):
    return list(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))

def main():
    N, X = Input()
    x = Input()

    data = [abs(X - x[i]) for i in range(N)]
    ans = data[0]
    for i in range(1, len(data)):
        ans = gcd(data[i], ans)
    print(ans)



main()

Buggy submission (verdict: Runtime Error):
def mapt(fn, *args):
    return list(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))

def main():
    N, X = Input()
    x = Input()

    if N == 1:
        print(abs(x[0] - X))
        exit()

    x.append(X)
    x.sort()
    data = [abs(x[i] - x[i+1]) for i in range(N)]

    ans = data[0]
    for i in range(1, N):
        ans = gcd(data[i], ans)
    print(ans)



main()

Buggy submission (verdict: Runtime Error):
def mapt(fn, *args):
    return list(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))

def main():
    N, X = Input()
    if N == 1:
        print(abs(N-X))
        exit()
        
    x = Input()
    x.append(X)
    x.sort()
    data = [abs(x[i] - x[i+1]) for i in range(N)]

    ans = data[0]
    for i in range(1, N):
        ans = gcd(data[i], ans)
    print(ans)



main()
Problem p03264 (python)

Fixed submission:
from itertools import combinations


def main():
    n = int(input())

    ans = 0
    for a, b in (list(combinations(range(1, n+1), 2))):
        if (a%2==0 and b%2 != 0) or (b%2==0 and a%2!=0):
            ans += 1

    print(ans)


main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())

    ans = 0
    for a, b in (list(combinations(range(1, n+1), 2))):
        if (a%2==0 and b%2 != 0) or (b%2==0 and a%2!=0):
            ans += 1

    print(ans)


main()
Problem p03284 (python)

Fixed submission:
def mapt(fn, *args):
    return list(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n, k = Input()
    if n % k == 0:
        print(0)
    else:
        print(1)


main()

Buggy submission (verdict: Runtime Error):
def mapt(fn, *args):
    return list(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n, k = Input()
    if n % k == 0:
        print(0)
    else:
        max_n = math.ceil(k/n)
        min_n = math.floor(k/n)
        print(max_n - min_n)


main()
Problem p02677 (python)

Fixed submission:
import sys
import math
 
a, b, h, m = map(int, input().split())
 
#if h == 0 and m == 0:
#  print(0)
#  sys.exit()
  
angle_h = (h*60 + m) * (360 / 12 / 60)
angle_m = m * (360 / 60)
 
angle = abs(angle_h - angle_m)
radian = math.radians(angle)
cosine = math.cos(radian)
ans = a*a + b*b - 2*a*b * cosine
ans = math.sqrt(ans)
 
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import math

a, b, h, m = map(int, input().split())

if h == 0 and m == 0:
  print(0)
  sys.exit()
  
angle_h = (h*60 + m) * (360 / 12 / 60)
angle_m = m * (360 / 60)

radian = math.radians(angle)
cosine = math.cos(radian)
ans = a*a + b*b - 2*a*b * cosine
ans = math.sqrt(ans)

print(ans)
Problem p02900 (python)

Fixed submission:
global primeList
primeList = []

def primeFactorize(X):
  global primeList
  result = set()
  for prime in primeList:
      while X % prime == 0:
        result.add(prime)
        X //= prime
  if X != 1:
      result.add(X)
  return result

A,B = map(int,input().split())

isPrime = [True for i in range(1000001)]
isPrime[0] = isPrime[1] = False;
primeList.append(2)
for i in range(4,1000001,2):
  isPrime[i] = False

for i in range(3,1000001,2):
    if not isPrime[i]:
      continue
    primeList.append(i)
    for j in range(i, 1000000//i + 1):
      isPrime[i*j] = False

pA = primeFactorize(A)
pB = primeFactorize(B)
print(len(pA.intersection(pB)) + 1)

Buggy submission (verdict: Runtime Error):
global primeList
primeList = []

def primeFactorize(X):
  global primeList
  result = set()
  for prime in primeList:
      if X % prime == 0:
        result.add(prime)
  return result

A,B = map(int,input().split())

isPrime = [True for i in range(1000001)]
isPrime[0] = isPrime[1] = False;
primeList.append(2)
for i in range(4,1000001,2):
  isPrime[i] = False

for i in range(3,1000001,2):
    if not isPrime[i]:
      continue
    primeList.append(i)
    for j in range(i, 1000001//i + 1):
      isPrime[i*j] = False

pA = primeFactorize(A)
pB = primeFactorize(B)
print(len(pA.intersection(pB)) + 1)
Problem p03050 (python)

Fixed submission:
N = int(input())
total = 0
for q in range(1,N // int(N**0.5) + 1):
	try:
		if N % (N // q - 1) == N // (N // q - 1):
			total += (N // q) - 1
	except:
		pass
print(total)

Buggy submission (verdict: Runtime Error):
N = int(input())
total = 0
for q in range(1,N // int(N**0.5) + 1):
	if N % (N // q - 1) == N // (N // q - 1):
		total += (N // q) - 1
print(total)
Problem p03354 (python)

Fixed submission:
from sys import setrecursionlimit
setrecursionlimit(100000)

global visited,num,graph

def dfs(subtree):
    global visited,num,graph
    if visited[subtree] != 0:
        return

    visited[subtree] = num
    for node in graph[subtree]:
        if visited[node] != 0:
            continue
        dfs(node)

N,M = map(int,input().split())

starting = list(map(int,input().split()))
graph = [[] for x in range(N+1)]
for i in range(M):
    a,b = map(int,input().split())
    graph[a].append(b)
    graph[b].append(a)

visited = [0 for x in range(N+1)]
num = 1
for i in range(1,N+1):
    if visited[i] == 0:
        dfs(i)
        num += 1

ans = 0
for i in range(1,N+1):
    if visited[i] == visited[starting[i-1]]:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
global visited,num,graph

def dfs(subtree):
    global visited,num,graph
    if visited[subtree] != 0:
        return

    visited[subtree] = num
    for node in graph[subtree]:
        if visited[node] != 0:
            continue
        dfs(node)

N,M = map(int,input().split())

starting = list(map(int,input().split()))
graph = [[] for x in range(N+1)]
for i in range(M):
    a,b = map(int,input().split())
    graph[a].append(b)
    graph[b].append(a)

visited = [0 for x in range(N+1)]
num = 1
for i in range(1,N+1):
    if visited[i] == 0:
        dfs(i)
        num += 1

ans = 0
for i in range(1,N+1):
    if visited[i] == visited[starting[i-1]]:
        ans += 1

print(ans)
Problem p03424 (python)

Fixed submission:
N = int(input())
A = set(input().split())
if len(A) == 3:
   print("Three")
else:
   print("Four")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = set(input().split())
if len(A) == 3:
   print(“Three”)
else:
   print(“Four”)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = set()
for i in range(N):
   A.add(input())
if len(A) == 3:
   print(“Three”)
else:
   print(“Four”)
Problem p03438 (python)

Fixed submission:
from math import ceil

N = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]

suma = sumb = num = 0
for i in range(N):
    suma += A[i]
    sumb += B[i]
    if A[i] < B[i]:
        num += ceil((B[i] - A[i]) / 2)

if A == B:
    print("Yes")
else:
    if suma >= sumb:
        print("No")
    else:
        if num > sumb - suma:
            print("No")
        else:
            print("Yes")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]

suma = sumb = num = 0
for i in range(N):
    suma += A[i]
    sumb += B[i]
    if A[i] < B[i]:
        num += ceil((B[i] - A[i]) / 2)

if A == B:
    print("Yes")
else:
    if suma >= sumb:
        print("No")
    else:
        if num > sumb - suma:
            print("No")
        else:
            print("Yes")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]

suma = sumb = num
for i in range(N):
    suma += A[i]
    sumb += B[i]
    if A[i] < B[i]:
        num += (B[i] - A[i]) // 2

if A == B:
    print("Yes")
else:
    if suma >= sumb:
        print("No")
    else:
        if num > sumb - suma:
            print("No")
        else:
            print("Yes")
Problem p03476 (python)

Fixed submission:
Q = int(input())
isPrime = [True] * 100001
for p in range(2, 100001):
    if isPrime[p]:
       for i in range(p * p, 100001, p):
           isPrime[i] = False
isPrime[1],isPrime[2] = False,True

like_2017 = [0] * 100002
for i in range(1,100001):
    if isPrime[i] and isPrime[(i+1)//2]:
        like_2017[i] = like_2017[i-1] + 1
    else:
        like_2017[i] = like_2017[i-1]
        
for i in range(Q):
    l,r = map(int,input().split())
    print(like_2017[r] - like_2017[l-1])

Buggy submission (verdict: Runtime Error):
Q = int(input())
isPrime = [-1 for x in range(10001)]
isPrime[1],isPrime[2] = False,True
for i in range(Q):
    ans = 0
    l,r = map(int,input().split())
    for c in range(l,r+1,2):
        other = (c+1)//2
        if isPrime[c] == -1:
            for j in range(2,int(c**0.5)+1):
                if c % j == 0:
                    isPrime[c] = False
                    break
            else:
                isPrime[c] = True
        if isPrime[other] == -1:
            for j in range(2,int(other**0.5)+1):
                if other % j == 0:
                    isPrime[other] = False
                    break
            else:
                isPrime[other] = True
                
        if isPrime[c] and isPrime[other]:
            ans += 1
    print(ans)

Buggy submission (verdict: Runtime Error):
Q = int(input())
isPrime = [-1 for x in range(10001)]
isPrime[1],isPrime[2] = False,True
for i in range(Q):
    ans = 0
    l,r = map(int,input().split())
    for c in range(l,r+1,2):
        other = (c+1)//2
        if isPrime[c] == -1:
            for j in range(2,int(c**0.5)+1):
                if c % j == 0:
                    isPrime[c] = False
                    break
            else:
                isPrime[c] = True
        if isPrime[other] == -1:
            for j in range(2,int(other**0.5)+1):
                if other % j == 0:
                    isPrime[other] = False
                    break
            else:
                isPrime[other] = True
                
        if isPrime[c] and isPrime[other]:
            ans += 1
    print(ans)
Problem p03480 (python)

Fixed submission:
S = input()

ans = len(S)
for i in range(len(S) - 1):
    if S[i] != S[i+1]:
        ans = min(max(len(S) - i - 1, i + 1),ans)
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
L = len(s)

ans = L
for i in range(L - 1):
    if S[i] != S[i+1]:
        ans = min(max(L - i - 1, i + 1),ans)
print(ans)
Problem p03533 (python)

Fixed submission:
S = input()

if len(S) > 9:
    print("NO")
elif "KIH" not in S or "B" not in S or "R" not in S:
    print("NO")
elif ("A" in S and len(set(S)) > 6) or ("A" not in S and len(set(S)) > 5):
    print("NO")
elif S.index("B") > S.index("R") or S.index("B") < S.index("K") or S.index("R") < S.index("K"):
    print("NO")
elif S[:S.index("K")].count("A") > 1 or S[S.index("H"):S.index("B")].count("A") > 1 or S[S.index("B"):S.index("R")].count("A") > 1 or S[S.index("R"):].count("A") > 1:
    print("NO")
else:
    print("YES")

Buggy submission (verdict: Runtime Error):
S = input()

if len(S) >= 9:
    print("NO")
else:
    if S.count("A") > 4:
        print("NO")
    elif "KIH" not in S:
        print("NO")
    elif S.index("B") > S.index("R") or S.index("B") < S.index("K") or S.index("R") < S.index("K"):
        print("NO")
    elif S[:S.index("K")].count("A") > 1 or S[S.index("H"):S.index("B")].count("A") > 1 or S[S.index("B"):S.index("R")].count("A") > 1 or S[S.index("R"):].count("A") > 1:
        print("NO")
    else:
        print("YES")
Problem p03625 (python)

Fixed submission:
N = int(input())
freq = {}
arr = map(int,input().split())
for i in arr:
    try:
        freq[i] += 1
    except KeyError:
        freq[i] = 1

to_multiply = []      
for i in sorted(freq.keys(),reverse=True):
    if freq[i] >= 4:
        to_multiply.append(i)
        to_multiply.append(i)
    elif freq[i] >= 2:
        to_multiply.append(i)
if len(to_multiply) >= 2:
    print(to_multiply[0] * to_multiply[1])
else:
    print("0")

Buggy submission (verdict: Runtime Error):
N = int(input())

def quicksort_reverse(lst):
    if len(lst) < 2:
        return lst
    else:
        less = []
        more = []
        pivot = lst[0]
        for i in range(1,len(lst)):
            if lst[i] < pivot:
                less.append(lst[i])
            else:
                more.append(lst[i])
        return quicksort_reverse(more) + [pivot] + quicksort_reverse(less)

arr = list(map(int,input().split()))
arr = quicksort_reverse(arr)

to_multiply = []
while len(to_multiply) < 2 and len(arr) > 1:
    if arr[0] == arr[1]:
        to_multiply.append(arr[0])
    arr = arr[2:]
if len(to_multiply) == 2:
    print(to_multiply[0] * to_multiply[1])
else:
    print("0")
Problem p03738 (python)

Fixed submission:
A = int(input())
B = int(input())
 
if A > B:
    print("GREATER")
elif A < B:
    print("LESS")
else:
    print("EQUAL")

Buggy submission (verdict: Runtime Error):
A = input()
B = input()

if len(A) > len(B):
    print("GREATER")
elif len(A) < len(B):
    print("LESS")
else:
    i = 0
    while A[i] == B[i]:
        i += 1
    if int(A[i]) > int(B[i]):
        print("GREATER")
    else:
        print("LESS")