Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
 int(input())
 
A = []
B = []
for i in range(n):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
 
C = zip(B, A)
C = sorted(C)
B, A = zip(*C)
 
ans = 1
t = 0
for i, j in zip(A, B):
    t += i
    if t <= j:
        continue
    else:
        print("No")
        ans = 0
        break
if ans:
    print("Yes")

Fixed submission:
n = int(input())

A = []
B = []
for i in range(n):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

C = zip(B, A)
C = sorted(C)
B, A = zip(*C)

ans = 1
t = 0
for i, j in zip(A, B):
    t += i
    if t <= j:
        continue
    else:
        print("No")
        ans = 0
        break
if ans:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
print(X[1])
print(X[2])
print(X[3])
print(X[4])
print(X[5])
print(X[6])
print(X[7])
print(X[8])
print(X[9])
print(X[10])

Fixed submission:
r,D,x = map(int,input().split())
X = [x]*11

for i in range(0,10):
  X[i+1] = r*X[i] - D
  
  
print(X[1])
print(X[2])
print(X[3])
print(X[4])
print(X[5])
print(X[6])
print(X[7])
print(X[8])
print(X[9])
print(X[10])
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
ll = []
rl = []

for i in range(m):
  l,r = list(map(int,input().split()))
  ll.append(l)
  rl.append(r)
  
if min(rr)<max(ll):
  print("0")

else:
  print(abs(max(rr)-min(ll)+1))

Fixed submission:
n,m = map(int,input().split())
ll = []
rl = []
 
for i in range(m):
  l,r = list(map(int,input().split()))
  ll.append(l)
  rl.append(r)
  
if min(rl)<max(ll):
  print("0")
 
else:
  print(abs(min(rl)-max(ll)+1))
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
A = sorted(list(map(int,input().split())))
C = []
for i in range(m):
  b,c = map(int,input().split())
  for i in range(b):
    C.append(c)
    
Cs = sorted(C)
CS = Cs[::-1]
ans = 0

if len(CS)<n:
  CS = CS +[0]*(n-m+1)
for i in range(n):
  ans += max(A[i],CS[i])

print(ans)
  


Fixed submission:
n,m=map(int,input().split())
a=sorted(list(map(int,input().split())))
l=sorted([list(map(int,input().split())) for i in range(m)],reverse=True,key=lambda x: x[1])
 
c_l=[]
for b,c in l:
  c_l+=[c]*b
  if len(c_l)>=n:
    break
 
for i in range(min(n,len(c_l))):
  a[i]=max(a[i],c_l[i])
 
print(sum(a))
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
s = input()

S = ord(s[k+1])
C =  chr(int(S)+26)

print(C)

Fixed submission:
N, K = map(int, input().split())
S = input()
 
print(S[0:K-1] + S[K-1].lower() + S[K:N])
Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N = map(int,input().split())
r = N//R
g = N//G
ans = 0

for i in range(r+1):
  for j in range(g+1):
    tmp = N - R*i - G*j
    if tmp >= 0 and tmp%B == 0:
      ans += 1
      
print(ans)

Fixed submission:
R,G,B,N=map(int,input().split())
ans=0
 
for i in range(N//R+1):
    for j in range((N-R*i)//G+1):
        b=N-(R*i+G*j)
        if b==0 or  b%B==0: 
            ans+=1
 
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N = map(int,input().split())
r = N//R
g = N//G
b = N//B
ans = 0

for i in range(r+1):
  for j in range(g+1):
    tmp = N - R*i - G*j
    if tmp >= 0 and tmp%B == 0:
      ans += 1
      
print(ans)

Fixed submission:
R,G,B,N=map(int,input().split())
ans=0
 
for i in range(N//R+1):
    for j in range((N-R*i)//G+1):
        b=N-(R*i+G*j)
        if b==0 or  b%B==0: 
            ans+=1
 
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
ans = 0
for i in range(N):
  if a>=b:
    ans += a
    a -= 1
  else:
    ans += b
    b -= 1
print(ans)

Fixed submission:
a,b = map(int,input().split())
ans = 0
for i in range(2):
  if a>=b:
    ans += a
    a -= 1
  else:
    ans += b
    b -= 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n = input()

if n == "A":
  print("T")
if n == "T":
  print("A")
if n == "G":
  print("C")
if n =="C":
  print(G)

Fixed submission:
n = input()

if n == "A":
  print("T")
if n == "T":
  print("A")
if n == "G":
  print("C")
if n =="C":
  print("G")
Buggy python submission (verdict: Time Limit Exceeded):
n,q = map(int,input().split())
S = input()
l = 0
r = 0

for i in range(q):
  l,r = map(int,input().split())
  ans = S[l-1:r].count("AC")
  print(ans)
  

Fixed submission:
n,q=(map(int,input().split()))
s=input()
count=0
c=[0]*n
for i in range(1,n):
        if s[i-1]=='A':
            if s[i]=='C':
               count+=1
        c[i]=count
for _ in range(q):
    l,r=(map(int,input().split())) 
    print(c[r-1]-c[l-1])
Buggy python submission (verdict: Runtime Error):
n,m,c = map(int,input().split())
B = map(int,input().split())
A = []
ans = 0
for i in range(m):
  a = map(int,input().split())
  A.append(a)

sum = c
for i in range(n):
    for j in range(m):
        sum += A[i][j]*B[j]
    if sum > 0:
        ans += 1
        sum = c
print(ans)

Fixed submission:
n, m, c  = map(int, input().split())
b = list(map(int, input().split()))
s = 0
for i in range(n):
    a = list(map(int, input().split()))
    t = 0
    for j in range(m):
        t += a[j]*b[j]
    if t+c > 0:
        s += 1
print(s)
Buggy python submission (verdict: Runtime Error):
s = int(input())

ans = [s]
 
while True:
  if s%2 ==0:
    s = s//2
  else:
    s = 3s + 1
 
  if s in ans:
        break
  else:
        ans.append(s)

Fixed submission:
s = int(input())
ans = [s]
 
while True:
  if s%2 ==0:
    s = s//2
  else:
    s = 3*s + 1
 
  if s in ans:
        break
  else:
        ans.append(s)
      
print(len(ans)+1)

Buggy python submission (verdict: Runtime Error):
s = int(input())
a = list(map(int,input().split()))
ans = [s]

while True:
  if s%2 ==0:
    s = s//2
  else:
    s = 3s + 1

  if s in ans:
        break
  else:
        ans.append(s)
      
print(len(ans)+1)

Fixed submission:
s = int(input())
ans = [s]
 
while True:
  if s%2 ==0:
    s = s//2
  else:
    s = 3*s + 1
 
  if s in ans:
        break
  else:
        ans.append(s)
      
print(len(ans)+1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(int,input().split())
inf = float("inf")
dp =[inf for i in range(n)]
dp[0] = 0
dp[1] = h[1]
for i in range(2,n):
  dp[i] = min(dp[i-1],dp[i-2])+h[i]
  
print(dp[-1])

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
 
a = [0 for _ in range(n)]
a[1] = abs(h[1] - h[0])
 
for i in range(2,n):
    a[i] = min(a[i-1]+abs(h[i]-h[i-1]), a[i-2]+abs(h[i]-h[i-2]))
    
print(a[-1])
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
*h, = map(int, input().split())
dp = [float("inf") for _ in range(N)]
dp[0] = 0
for i in range(N - 1):
	for j in range(1, min(K + 1, N - i)):
		dp[i + j] = min(dp[i + j], dp[i] + abs(h[i + j] - h[i]))
print(dp[N - 1])

Fixed submission:
N, K = map(int, input().split())
*h, = map(int, input().split())
dp = [float("inf") for _ in range(N)]
dp[0] = 0
for i in range(N - 1):
	for j in range(1, min(K + 1, N - i)):
		dp[i + j] = min(dp[i + j], dp[i] + abs(h[i + j] - h[i]))
print(dp[N - 1])
Buggy python submission (verdict: Time Limit Exceeded):
N,W = map(int,input().split())
Value = []
weight = []
inf=float("inf")
dp=[[-inf for i in range(W+1)] for j in range(N+1)]
for i in range(W+1): dp[0][i]=0

for i in range(N):
    w,v = map(int,input().split())
    Value.append(v)
    weight.append(w)


for i in range(N):
  for w in range(W+1):
    if w>=weight[i]:
      dp[i+1][w] = max(dp[i][w-weight[i]]+Value[i],dp[i][w])
    else:
      dp[i+1][w] = dp[i][w]

print(dp[N][W])

Fixed submission:
N,W = map(int,input().split())
Value = []
weight = []
inf=float("inf")
dp=[[-inf for i in range(W+1)] for j in range(N+1)]
for i in range(W+1): dp[0][i]=0

for i in range(N):
    w,v = map(int,input().split())
    Value.append(v)
    weight.append(w)


for i in range(N):
  for w in range(W+1):
    if w>=weight[i]:
      dp[i+1][w] = max(dp[i][w-weight[i]]+Value[i],dp[i][w])
    else:
      dp[i+1][w] = dp[i][w]

print(dp[N][W])
Buggy python submission (verdict: Runtime Error):
print('second' if all(a[i] % 2 == 0 for i in range(N)) else 'first')

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]
print("second" if all(i % 2 == 0 for i in a) else "first")
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
N = len(S)
ans = 0


for i in range(N):
  if S[i] == "W":
    for j in range(i):
      if S[j] =="B":
        ans += 1
print(ans)

Fixed submission:
S = input()
b = 0
ans = 0
 
for s in S:
    if s == 'B':
        b += 1
    else:
        ans += b
 
print(ans)
Buggy python submission (verdict: Runtime Error):
1 S = input()
2 print(min(abs(int(S[i:i+3]) - 753) for i in range(len(S) - 2)))


Fixed submission:
S = input()
print(min(abs(int(S[i:i+3]) - 753) for i in range(len(S) - 2)))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
ans = 10**9

for i in range(n):
  west = s[:i].count("W")
  east = s[i+1:].count("E")
  ans = min(ans,west+east)

print(ans)

Fixed submission:
N = input()
s = input()

#累積和 前処理 Eの数を集計
count = s.count('E')

ans = count
#左端1番目からリーダーをずらしながらチェック。
for ch in s:
    if ch == 'E':
        count -= 1
        ans = min(count,ans)
    else:
        count += 1
    
print(ans)
Buggy python submission (verdict: Runtime Error):
x = int(input())
if x == 1:
  print("1")
  exit()
  
ans = 0
for b in range(2,int(x**(1/2)+1)):
  for p in range(2,1000):
    tmp = pow(b,p)
    if tmp<=x:
      ans = max(ans,pow(b,p))
    else:
      break
      
print(ans)


Fixed submission:
a,b,c,d = map(int,input().split())
flag = False
if abs(c-a)<=d:
  flag = True
elif abs(b-a)<=d and abs(c-b)<=d:
  flag = True

if flag:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input.split())
if a==i and b==1:
  print(1)
else:
  print(min(a,b)-1)

Fixed submission:
a,b = map(int,input().split())
if a<=b:
  print(a)
else:
  print(a-1)
Buggy python submission (verdict: Runtime Error):
S = input()
print(700 + count("1")*100)

Fixed submission:
S = input()
print(700 + S.count("o")*100)
Buggy python submission (verdict: Time Limit Exceeded):
from math import factorial
import bisect
import sys
n = int(input())
A = sorted(list(map(int,input().split())))
           
max1 = A[-1]
half = A[-1]//2

point = bisect.bisect_left(A, half)

if A[point] == A[-1]:
  print(A[-1],A[-2])
  sys.exit()

a1 = factorial(max1) / factorial(A[point]) / factorial(max1 - A[point])
a2 = factorial(max1) / factorial(A[point+1]) / factorial(max1 - A[point+1])
if a1>=a2:
  print(max1,A[point])
else:
  print(max1,A[point+1])

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
 
m = max(a)
a = sorted(a)
 
ans = 0
 
for i in a:
    if abs(m/2-i) < abs(m/2-ans):
        ans = i
 
print(m, ans)

Buggy python submission (verdict: Runtime Error):
import bisect
n = int(input())
A = sorted(list(map(int,input().splitfrom math import factorial
import bisect
import sys
n = int(input())
A = sorted(list(map(int,input().split())))
           
max1 = A[-1]
half = A[-1]//2

point = bisect.bisect_left(A, half)

if A[point] == A[-1]:
  print(A[-1],A[-2])
  sys.exit()

a1 = factorial(max1) / factorial(A[point]) / factorial(max1 - A[point])
a2 = factorial(max1) / factorial(A[point+1]) / factorial(max1 - A[point+1])
if a1>=a2:
  print(max1,A[point])
else:
  print(max1,A[point+1])

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
 
m = max(a)
a = sorted(a)
 
ans = 0
 
for i in a:
    if abs(m/2-i) < abs(m/2-ans):
        ans = i
 
print(m, ans)
Buggy python submission (verdict: Runtime Error):
N , A = map(int,input().split())

if N < (N//500)*500-A :
    print("Yes")
else:
    print("No")

Fixed submission:
N = int(input())
A = int(input())

if N-(N//500)*500 <=A:
    print("Yes")
else:
    print("No")

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

B = N % 500
 if B > A:
    print("Yes")
else:
    print("No") 


Fixed submission:
N = int(input())
A = int(input())

if N-(N//500)*500 <=A:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
print((x-a)%b)

Fixed submission:
x=int(input())
a= int(input())
b = int(input())
print((x-a)%b)
Buggy python submission (verdict: Runtime Error):
A, B, C, X = map(int,input().split())
count = 0

for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            if 500*i+100*j+50*k == X:
                count += 1
print(count)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0

for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            if 500*i+100*j+50*k == X:
                count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
import math
a, b = input().split())
c = int(a+ b)
 
if math.sqrt(c).is_integer() == True:
    print('Yes')
else:
    print('No')

Fixed submission:
import math
a, b = map(str,input().split())
c = int(a+ b)
 
if   math.sqrt(c).is_integer() == True:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
S = input()
S[0]= 2018
print("/".join(S))

Fixed submission:
S = input().split("/")
S[0]= "2018"
print("/".join(S))
Buggy python submission (verdict: Runtime Error):
N = int(input())
mochi = []
for i in range(N):
  a = int(input())
  if not a in mochi:
    mochi.append(a)
    
mochi.sorted()
print(len(mochi))

Fixed submission:
N = int(input())
mochi = []
for i in range(N):
  a = int(input())
  if not a in mochi:
    mochi.append(a)
    
mochi.sort()
print(len(mochi))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
s = input()
s1,s2 = s.split("-")
 
if s.count("-") ==1:
  if a == len(s1) and b == len(s2):
    print("Yes")
  else:
    print("No")

else:
  print("No")

Fixed submission:
a,b = map(int,input().split())
s = input()

 
if s.count("-") ==1:
  s1,s2 = s.split("-")
  if a == len(s1) and b == len(s2):
    print("Yes")
  else:
    print("No")
 
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
s = input()
s1,s2 = s.split("-")

if s.count("-") ==1:
  if a == len(s1) and b == len(s2):
    print("Yes")
  else:
    print("No")
  

Fixed submission:
a,b = map(int,input().split())
s = input()

 
if s.count("-") ==1:
  s1,s2 = s.split("-")
  if a == len(s1) and b == len(s2):
    print("Yes")
  else:
    print("No")
 
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())

average = (a+b)/2

print(math.ceil(average)

Fixed submission:
a,b = map(int,input().split())

print((a+b+1)//2)
Buggy python submission (verdict: Runtime Error):
import collections
N = int(input())
a = sorted(list(map(int,input().split())))
A =  collections.Counter(a)
cnt = 0
for i in A:
   # print(i)
    if i[0]<i[1]:
      cnt=cnt+i[1]-i[0]
    if i[0]>i[1]:
      cnt=cnt+i[1]
print(cnt)   
    



Fixed submission:
import collections
N = int(input())
a = sorted(list(map(int,input().split())))
c = collections.Counter(a)
cnt = 0
for i in c.most_common():
   # print(i)
    if i[0]<i[1]:
      cnt=cnt+i[1]-i[0]
    if i[0]>i[1]:
      cnt=cnt+i[1]
print(cnt)
Buggy python submission (verdict: Runtime Error):
N = input()

print(N.count(1))

Fixed submission:
N = input()
 
print(N.count("1"))

Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().spilt())
n = 0

if a == 1:
    n += 1
else:
    pass
if b == 1:
    n += 1
else:
    pass
if c == 1:
    n += 1
else:
    pass

print(n)





Fixed submission:
N = input()
 
print(N.count("1"))
Buggy python submission (verdict: Runtime Error):
n = int(input())
op_cnt = len(n)-1　#隙間の数
for i in range(2 ** op_cnt):
  op = ["-"]*op_cnt ##あらかじめ[---]を入れておく
  for j in range(op_cnt):
    if ((i>>j)&1):
      op[op_cnt-1-j] = "+" #フラブが立っている箇所を"+"へ
      
  formula = "" 
  for p_n,p_o in zip(n,op+[""]):
    formula += (p_n+p_o)
  if eval(formula) == 7:
    print(formula+ "=7")
    break

Fixed submission:
a = list(input())
 
sign = "+-"
 
for i in range(2):  #1つめの正負
 for j in range(2):  #2つ目の正負
  for k in range(2):  #3つ目の正負
    if eval(a[0]+sign[i]+a[1]+sign[j]+a[2]+sign[k]+a[3] ) == 7:
     print(str(a[0]+sign[i]+a[1]+sign[j]+a[2]+sign[k]+a[3])+'=7')
     exit()

Buggy python submission (verdict: Runtime Error):
n = int(input())
op_cnu = len(n)-1　#隙間の数
for i in range(2 ** op_cnt):
  op = ["-"]*op_cnt ##あらかじめ[---]を入れておく
  for j in range(op_cnt):
    if ((i>>j)&1):
      op[op_cnt-1-j] = "+" #フラブが立っている箇所を"+"へ
      
  formula = "" 
  for p_n,p_o in zip(n,op+[""]):
    formula += (p_n+p_o)
  if eval(formula) == 7:
    print(formula+ "=7")
    break

Fixed submission:
a = list(input())
 
sign = "+-"
 
for i in range(2):  #1つめの正負
 for j in range(2):  #2つ目の正負
  for k in range(2):  #3つ目の正負
    if eval(a[0]+sign[i]+a[1]+sign[j]+a[2]+sign[k]+a[3] ) == 7:
     print(str(a[0]+sign[i]+a[1]+sign[j]+a[2]+sign[k]+a[3])+'=7')
     exit()
Buggy python submission (verdict: Runtime Error):
c1 = list(map(int,input().split()))
c2 = list(map(int,input().split()))

if c1[0] == c2[2] and c1[1]==c2[1] and c1[2] == c2[0]:
  print("YES")
else:
  print("NO")

Fixed submission:
c1 = list(input())
c2 = list(input())

if c1[0] == c2[2] and c1[1]==c2[1] and c1[2] == c2[0]:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

for h in range(1,3501):
  for n in range(1,3501):
    if (4*h*n-N*n-N*h)!= 0:
        w = N*h*n/(4*h*n-N*n-N*h)
        if w >0 and w.is_integer():
          print(h,n,int(w))
          exit()

Fixed submission:
N = int(input())
for h in range(1, 3501):
    for n in range(h, 3501):
        if (4*h*n-N*n-N*h)>0 and (N*h*n)%(4*h*n-N*n-N*h)==0:
            print(h, n, (N*h*n)//(4*h*n-N*n-N*h))
            exit()

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

for h in range(1,3501):
  for n in range(1,3501):
    if (4*h*n-N*n-N*h)!= 0:
        w = N*h*n/(4*h*n-N*n-N*h)
    if w >0 and w.is_integer():
      print(h,n,int(w))
      exit()

Fixed submission:
N = int(input())
for h in range(1, 3501):
    for n in range(h, 3501):
        if (4*h*n-N*n-N*h)>0 and (N*h*n)%(4*h*n-N*n-N*h)==0:
            print(h, n, (N*h*n)//(4*h*n-N*n-N*h))
            exit()
Buggy python submission (verdict: Runtime Error):
import sys
n = int(input())
a = []
ans = 0
lamp = 1
for _ in range(n):
  A = int(input())
  a.append(a)
  
for i in range(n):
  if lamp -1 == 1:
    print(i)
    sys.exit()
  lamp = a[lamp - 1]
print(-1)

Fixed submission:
import sys
n = int(input())
a = [int(input()) for _ in range(n)]
lamp = 1
ans=0
for i in range(n):
    if lamp - 1 == 1:
        print(i)
        sys.exit()
    lamp = a[lamp - 1]
print(-1)
Buggy python submission (verdict: Runtime Error):
r = int(input())
g = int(input())
b = int(input())

total = 100*r + 10*g + b

if total % 4 == 0:
    print("YES")
else:
    print("NO")

Fixed submission:
r,g,b=map(int, input().split())

A = 10*g + b

if A % 4 == 0:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
n,T = map(int,input().split())
t = list(map(int,input().split())
A = [0]*n

for i in range(n):
    if t[i]>T:
        A[i+1] = A[i] + T
    else:
        A[i+1] = A[i]+ t[i]
print(A[n])

Fixed submission:
N, T =map(int, input().split())
t = list(map(int, input().split()))
ans = T
for i in range(1, N):
    if t[i] - t[i-1] >= T:
        ans += T
    else:
        ans += t[i] - t[i-1]
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())

if a>b:
  print("GREATER")

elif a == b:
  print("EQUAL")

else:
  print("LESS")

Fixed submission:
a = int(input())
b = int(input())
if a>b:
  print("GREATER")
  
elif a == b:
  print("EQUAL")
  
else:
  print("LESS")

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
 
if a>b:
  print("GREATER")
  
elif a == b:
  print("EQUAL")
  
else:
  print("LESS")

Fixed submission:
a = int(input())
b = int(input())
if a>b:
  print("GREATER")
  
elif a == b:
  print("EQUAL")
  
else:
  print("LESS")

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

if a>b:
  print("GREATER")
  
elif a = b:
  print("EQUAL")
  
else:
  print("LESS")

Fixed submission:
a = int(input())
b = int(input())
if a>b:
  print("GREATER")
  
elif a == b:
  print("EQUAL")
  
else:
  print("LESS")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 1
for i in range(1,n+1):
  ans = ans * i
  
if ans >= (10**9+7):
  ans  =  ans%(10**9+7)
  
print(ans)


Fixed submission:
n = int(input())
ans = 1
for i in range(1,n+1):
  ans =  i* ans%(10**9+7) 

  
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())

while True:
  if 2*n<m:
    n += 1
    m -= 2
  else:
    if n*2 == m:
      print(n)
      break
    elif n*2>m:
      print(m//2)
      break


Fixed submission:
n, m = map(int, input().split())
Scc = min(n, m//2)
cccc = (m-Scc*2)//4
print(Scc+cccc)
Buggy python submission (verdict: Runtime Error):
A=[input() for _ in range(N)]
B=[input() for _ in range(M)]
ans='No'
 
for i in range(N-M+1):
    for j in range(N-M+1):
        cnt=0
        if A[i][j:j+M] ==B[0]:
            for k in range(1,M):
                if A[i+k][j:j+M] == B[k]:
                    cnt+=1
            if cnt==M-1:
                ans='Yes'
                
print(ans)

Fixed submission:
N,M=map(int,input().split())
A=[input() for _ in range(N)]
B=[input() for _ in range(M)]
ans='No'
 
for i in range(N-M+1):
    for j in range(N-M+1):
        cnt=0
        if A[i][j:j+M] ==B[0]:
            for k in range(1,M):
                if A[i+k][j:j+M] == B[k]:
                    cnt+=1
            if cnt==M-1:
                ans='Yes'
                
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
l = len(s)
for i in range(l):
  for j in range(l-1,i,-1):
    if s[i]=="A" and s[j]=="Z":
      print(j-i+1)
      exit()
      
      

Fixed submission:
s = input()
 
for i in range(len(s)):
    if s[i] == 'A':
        a = i
        break
for i in range(-1,-len(s),-1):
    if s[i] == 'Z':
        b = len(s) + i
        break
 
print(b-a+1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
ans = 0
x =0

for i in range(n):
  if s(i) == "I":
    x += 1
  else:
    x -= 1
    ans = max(ans,x)
    

print(ans)

Fixed submission:
n = int(input())
s = input()
x = ans = 0

 
for i in range(n):
  if s[i] == "I":
    x += 1
  else:
    x -= 1
  ans = max(ans,x)
    
print(ans)
Buggy python submission (verdict: Runtime Error):
a = input()
vowel = set("a","b","c","d","e")
if a in vowel:
  print("vowel")
else:
  print("consonant")

Fixed submission:
a = input()
vowel = set("aiueo")
if a in vowel:
  print("vowel")
else:
  print("consonant")