Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
if x < a:
  print(0)
elif x > a:
  print(10)

Fixed submission:
x, a = [int(x) for x in input().split()]
if x < a:
  print(0)
elif x >= a:
  print(10)

Buggy python submission (verdict: Runtime Error):
x = int(input()) % 10
a = int(input()) % 10
if x < a:
  print(0)
elif x > a:
  print(10)

Fixed submission:
x, a = [int(x) for x in input().split()]
if x < a:
  print(0)
elif x >= a:
  print(10)
Buggy python submission (verdict: Runtime Error):

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

grid = []
for i in range(N):
    X = list(map(int, input().strip().split()))
    grid.append(X)

# print(grid)
cnt = 0
grid2 = list(itertools.combinations(grid, 2))
for i in grid2:
    x = numpy.array(i[0])
    y = numpy.array(i[1])
  #  print(x, y)
    dis = numpy.linalg.norm(y - x)
    # print(dis)
    if (dis.is_integer()):
        #print(dis)
        cnt += 1
print(cnt)

Fixed submission:
import itertools
import numpy

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

grid = []
for i in range(N):
    X = list(map(int, input().strip().split()))
    grid.append(X)

# print(grid)
cnt = 0
grid2 = list(itertools.combinations(grid, 2))
for i in grid2:
    x = numpy.array(i[0])
    y = numpy.array(i[1])
  #  print(x, y)
    dis = numpy.linalg.norm(y - x)
    # print(dis)
    if (dis.is_integer()):
        # print(dis)
        cnt += 1

  # print("-------------")
print(cnt)
# distance = [math.sqrt(() ^ 2+() ^ 2) for i in rang(N)]
# for i in range(N):

Buggy python submission (verdict: Runtime Error):

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

grid = []
for i in range(N):
    X = list(map(int, input().strip().split()))
    grid.append(X)

# print(grid)
cnt = 0
grid2 = list(itertools.combinations(grid, 2))
for i in grid2:
    x = numpy.array(i[0])
    y = numpy.array(i[1])
  #  print(x, y)
    dis = numpy.linalg.norm(y - x)
    # print(dis)
    if (dis.is_integer()):
        #print(dis)
        cnt += 1


Fixed submission:
import itertools
import numpy

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

grid = []
for i in range(N):
    X = list(map(int, input().strip().split()))
    grid.append(X)

# print(grid)
cnt = 0
grid2 = list(itertools.combinations(grid, 2))
for i in grid2:
    x = numpy.array(i[0])
    y = numpy.array(i[1])
  #  print(x, y)
    dis = numpy.linalg.norm(y - x)
    # print(dis)
    if (dis.is_integer()):
        # print(dis)
        cnt += 1

  # print("-------------")
print(cnt)
# distance = [math.sqrt(() ^ 2+() ^ 2) for i in rang(N)]
# for i in range(N):
Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())

module = []
for i in range(L, R):
    for j in range(i+1, R+1):
       # print("({} * {}) % 2019:{}".format(i, j, (i * j) % 2019))
        module.append((i * j) % 2019)

if not module:
    print("0")
else:
    print(min(module))


Fixed submission:
L, R = map(int, input().split())

module = []
for i in range(L, R):
    for j in range(i+1, R+1):
        #print("({} * {}) mod 2019 = {}".format(i, j, (i * j) % 2019))
        if (i * j) % 2019 == 0:
            print("0")
            exit()
        else:
            module.append((i * j) % 2019)

if not module:
    print("0")
else:
    print(min(module))

Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())

module = []
for i in range(L, R):
    for j in range(i+1, R+1):
       # print("({} * {}) % 2019:{}".format(i, j, (i * j) % 2019))
        module.append((i * j) % 2019)

print(min(module))


Fixed submission:
L, R = map(int, input().split())

module = []
for i in range(L, R):
    for j in range(i+1, R+1):
        #print("({} * {}) mod 2019 = {}".format(i, j, (i * j) % 2019))
        if (i * j) % 2019 == 0:
            print("0")
            exit()
        else:
            module.append((i * j) % 2019)

if not module:
    print("0")
else:
    print(min(module))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
avg = [0] * N

avg[0] = sum(A) - 2 * (sum([A[i] for i in range(N) if i % 2 == 1]))

for i in range(N - 1):
    X[i + 1] = 2 * A[i] - avg[i]

print(" ".join(map(str, avg)))


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
X = [0] * N

X[0] = sum(A) - 2 * (sum([A[i] for i in range(N) if i % 2 == 1]))

for i in range(N - 1):
    X[i + 1] = 2 * A[i] - X[i]

print(" ".join(map(str, X)))

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

module = []
for i in range(L, R):
    for j in range(i+1, R+1):
        print("({} * {}) mod 2019 = {}".format(i, j, (i * j) % 2019))
        if (i * j) % 2019 == 0:
            print("0")
            exit()
        else:
            module.append((i * j) % 2019)

if not module:
    print("0")
else:
    print(min(module))


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
X = [0] * N

X[0] = sum(A) - 2 * (sum([A[i] for i in range(N) if i % 2 == 1]))

for i in range(N - 1):
    X[i + 1] = 2 * A[i] - X[i]

print(" ".join(map(str, X)))
Buggy python submission (verdict: Runtime Error):
import sys


s = sys.argv[1]

if len(s) == 4:
    if s.count(s[0]) == 2:
        if s.count(s[1]) == 2:
            if s.count(s[2]) == 2:
                if s.count(s[3]) == 2:
                    print("Yes")
                    exit()
print("No")
exit()


Fixed submission:
import sys


#s = sys.argv[1]
s = input()
if len(s) == 4:
    if s.count(s[0]) == 2:
        if s.count(s[1]) == 2:
            if s.count(s[2]) == 2:
                if s.count(s[3]) == 2:
                    print("Yes")
                    exit()
print("No")
exit()

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

""" print('sys.argv         : ', sys.argv)
print('type(sys.argv)   : ', type(sys.argv))
print('len(sys.argv)    : ', len(sys.argv))

print('sys.argv[0]      : ', sys.argv[0])
print('sys.argv[1]      : ', sys.argv[1])
print('type(sys.argv)   : ', type(sys.argv[1]))
 """
s = sys.argv[1]
# print(len(s))

if len(s) == 4:
    if s.count(s[0]) == 2:
        if s.count(s[1]) == 2:
            if s.count(s[2]) == 2:
                if s.count(s[3]) == 2:
                    print("Yes")
                    exit()
print("No")
exit()


Fixed submission:
import sys


#s = sys.argv[1]
s = input()
if len(s) == 4:
    if s.count(s[0]) == 2:
        if s.count(s[1]) == 2:
            if s.count(s[2]) == 2:
                if s.count(s[3]) == 2:
                    print("Yes")
                    exit()
print("No")
exit()
Buggy python submission (verdict: Runtime Error):
N, L = map(int, input().split())


lis = []
for n in range(1, N+1):
    azi = L + n - 1
    lis.append(azi)

lis2 = [abs(l) for l in lis]

min = min(lis2)
del lis[min]

print(sum(lis))

Fixed submission:
N, L = map(int, input().split())


lis = []
for n in range(1, N+1):
    azi = L + n - 1
    lis.append(azi)

lis2 = [abs(l) for l in lis]

min = lis2.index(min(lis2))
del lis[min]

print(sum(lis))
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = input()

s = list(S)
print(s[K+1].lower())


Fixed submission:
N, K = map(int, input().split())
S = input()

s = list(S)
s[K-1] = s[K-1].lower()
print(''.join(s))
Buggy python submission (verdict: Runtime Error):
import itertools
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

M = [[V[i], C[i]]for i in range(N)]
# print(M)

com_M = list(itertools.combinations(M, 2))
m_M = []
for i in range(N):
    X = com_M[i][0][0] + com_M[i][1][0]
    Y = com_M[i][0][1] + com_M[i][1][1]
    # print(X)
    # print(Y)
    m_M.append(X - Y)

print(max(m_M))


Fixed submission:
import itertools
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

M = [[V[i], C[i]]for i in range(N)]
#print(M)


tx = 0
R = 0
for i in range(N):
    tx = V[i] - C[i]
    if (tx > 0):
        R += tx

print(R)

Buggy python submission (verdict: Runtime Error):
import itertools
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

M = [[V[i], C[i]]for i in range(N)]
print(M)

com_M = list(itertools.combinations(M, 2))
m_M = []
for i in range(N):
    X = com_M[i][0][0] + com_M[i][1][0]
    Y = com_M[i][0][1] + com_M[i][1][1]
    #print(X)
    #print(Y)
    m_M.append(X - Y)

print(max(m_M))


Fixed submission:
import itertools
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

M = [[V[i], C[i]]for i in range(N)]
#print(M)


tx = 0
R = 0
for i in range(N):
    tx = V[i] - C[i]
    if (tx > 0):
        R += tx

print(R)
Buggy python submission (verdict: Runtime Error):

if b <= c:
    print("0")
elif c <= a:
    print("0")



if a<c and (c<b and b<d):
    print(b-c)
elif (a<c and a<d) and (c<b and d<b):
    print(d-c)
elif (c<a and a<d) and (c<b and b<d):
    print(b-a)
elif (c<a and a<d) and (c<b and d<b):
    print(d-a)
else:
    print("0")


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



mi = min(b,d )
ma = max(a,c)

print(max(0,mi - ma))

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



if b<c:
    print("0")
elif a<c and (c<b and b<d):
    print(b-c)
elif (a<c and c<n) and (a<d and d<b):
    print(d-c)
elif (c<a and a<d) and (c<b and b<d):
    print(b-a)
elif (c<a and a<d) and (c<b and d<b):
    print(d-a)
elif d<a:
    print("0")



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



mi = min(b,d )
ma = max(a,c)

print(max(0,mi - ma))

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


if b < c:
    print("0")
    exit()

if c<b and b<d:
    print((d-c)-(d-b))
elif a<c adn d<b:
    print(d-c)
else:
    print("0")



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



mi = min(b,d )
ma = max(a,c)

print(max(0,mi - ma))
Buggy python submission (verdict: Runtime Error):
list_ = input().split()
remain_quant = int(list_[0] - list_[1])
if remain_quant >= int(list_[2]):
  print(0)
else:
  print(int(list_[2] - remain_quant)

Fixed submission:
list_ = input().split()
remain_quant = int(list_[0]) - int(list_[1])
if remain_quant >= int(list_[2]):
  print(0)
else:
  print(int(list_[2]) - remain_quant)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = [int(input()) for _ in range(n)]
l = []

for i in range(n):
    for j in range(n):
        if i != j:
            l.append(A[j])
    print(max(l))
    l.clear()
        

Fixed submission:
n = int(input())
A = [int(input()) for _ in range(n)]
B = sorted(A)
B_M = max(B)
B_M_1 = max(B[:n-1])
for i in range(n):
    if A[i] == B_M:
       print(B_M_1)
    else:
        print(B_M)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = [int(input()) for _ in range(n)]
l = []

for i in range(n):
    for j in range(n):
        if i != j:
            l.append(A[j])
    print(max(l))
    l.clear()
        

Fixed submission:
n = int(input())
A = [int(input()) for _ in range(n)]
B = sorted(A)
B_M = max(B)
B_M_1 = max(B[:n-1])
for i in range(n):
    if A[i] == B_M:
       print(B_M_1)
    else:
        print(B_M)
Buggy python submission (verdict: Runtime Error):
x = raw_input().split()
if(x[0] * x[1] < x[2]):
  print(x[0] * x[1])
  elif:
    print(x[2])

Fixed submission:
x =  [int(s) for s in input().split()]
if(x[0]*x[1]<x[2]):
  print(x[0]*x[1])
else:
  print(x[2])
Buggy python submission (verdict: Runtime Error):
5
4 5 3 5 4

Fixed submission:
n = int(input())
m = list(map(int, input().split()))
maxH = m[0]
numH = 0
for i in range(n):
    if m[i] >= maxH:
        maxH = m[i]
        numH += 1
print(numH)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

food = [int(input()) for i in range(5)]

minr = 10
minf = 0
for f in food:
    if f % 10 != 0 :
        if f % 10 < minr :
            minr = f % 10
            minf = f

food.remove(minf)
food.append(minf)

sumf = 0
i = 0
for f in food:
    if i == 4:
        sumf += f
    elif f % 10 != 0:
        sumf += int(f/10) * 10 + 10
    else:
        sumf += f
    i+=1
print(sumf)

Fixed submission:
# coding: utf-8
# Your code here!

food = [int(input()) for i in range(5)]

minr = 10
minf = 0
for f in food:
    if f % 10 != 0 :
        if f % 10 < minr :
            minr = f % 10
            minf = f
if minf == 0:
    minf = food[0]
        

food.remove(minf)
food.append(minf)

sumf = 0
i = 0
for f in food:
    if i == 4:
        sumf += f
    elif f % 10 != 0:
        sumf += int(f/10) * 10 + 10
    else:
        sumf += f
    i+=1
print(sumf)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

food = [int(input()) for i in range(5)]

minr = 9
minf = 0
for f in food:
    if f % 10 != 0 :
        if f % 10 < minr :
            minr = f % 10
            minf = f

food.remove(minf)
food.append(minf)

sumf = 0
i = 0
for f in food:
    if i == 4:
        sumf += f
    elif f % 10 != 0:
        sumf += int(f/10) * 10 + 10
    else:
        sumf += f
    i+=1
print(sumf)

Fixed submission:
# coding: utf-8
# Your code here!

food = [int(input()) for i in range(5)]

minr = 10
minf = 0
for f in food:
    if f % 10 != 0 :
        if f % 10 < minr :
            minr = f % 10
            minf = f
if minf == 0:
    minf = food[0]
        

food.remove(minf)
food.append(minf)

sumf = 0
i = 0
for f in food:
    if i == 4:
        sumf += f
    elif f % 10 != 0:
        sumf += int(f/10) * 10 + 10
    else:
        sumf += f
    i+=1
print(sumf)

Buggy python submission (verdict: Runtime Error):
t = 0
l = [int(input()) for i in range(5)]
min1 = 9
minN = 0
for i in l:
    if i%10 != 0:
        if i%10 < min1:
            min1 = i%10
            minN = i
l.remove(minN)
l.append(minN)

for i in range(5):
    if(l[i]%10 != 0 and i != 4):
        t += int(l[i]/10) * 10 + 10

    elif l[i]%10 == 0 or i == 4:
        t += l[i]
    
print(t) 
        


Fixed submission:
# coding: utf-8
# Your code here!

food = [int(input()) for i in range(5)]

minr = 10
minf = 0
for f in food:
    if f % 10 != 0 :
        if f % 10 < minr :
            minr = f % 10
            minf = f
if minf == 0:
    minf = food[0]
        

food.remove(minf)
food.append(minf)

sumf = 0
i = 0
for f in food:
    if i == 4:
        sumf += f
    elif f % 10 != 0:
        sumf += int(f/10) * 10 + 10
    else:
        sumf += f
    i+=1
print(sumf)
Buggy python submission (verdict: Runtime Error):
https://atcoder.jp/contests/abc128/tasks/abc128_a

Fixed submission:
Str = list(input())
tmp = 0
maxLen = 0

for s in Str:
    if s in "ACGT":
        tmp += 1
        maxLen = max(maxLen, tmp)
    else:
        tmp = 0


print(maxLen)
Buggy python submission (verdict: Runtime Error):
100 50 4


Fixed submission:
# coding: utf-8
# Your code here!

a,b,k = map(int, input().split())

def d(n):
    div = []
    for i in range(1,n+1):
        if(n % i == 0):
            div.append(i)
    return div
        
a_d = d(a)
b_d = d(b)
s = []
l = []
ab = []

if len(a_d) < len(b_d):
    s = a_d
    l = b_d
else:
    s = b_d
    l = a_d

for i in s:
    if i in l:
        ab.append(i)
print(ab[len(ab)-k])
Buggy python submission (verdict: Runtime Error):
N=input()
count=0
for i in range(1,N+1):
  ks=len(str(i))
  if ks!=2 and ks!=4:
    count=count+1
print(count)
    
    
    


Fixed submission:
N=int(input())
count=0
for i in range(1,N+1):
  ks=len(str(i))
  if ks!=2 and ks!=4 and ks!=6:
    count=count+1
print(count)

Buggy python submission (verdict: Runtime Error):
N=input()
count=0
for i in range(1,N+1):
  ks=len(str(i))
  if ks!=2 and ks!=4:
    count=count+1
print count
    
    
    

Fixed submission:
N=int(input())
count=0
for i in range(1,N+1):
  ks=len(str(i))
  if ks!=2 and ks!=4 and ks!=6:
    count=count+1
print(count)
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
if (A+B) % 2 = 0:
  K = (A+B)/2
else:
  K ="IMPOSSIBLE"
print(K)

Fixed submission:
A,B=map(int,input().split())
if (A+B) % 2 == 0:
  K = (A+B)//2
else:
  K ="IMPOSSIBLE"
print(K)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int.input().split()))
print(max(a)-min(a))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
print(max(a)-min(a))

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split())
print(max(a)-min(a))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
print(max(a)-min(a))

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int.input().split())
print(max(a)-min(a))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
print(max(a)-min(a))
Buggy python submission (verdict: Runtime Error):
a,b=map(input().split())
if a=="H" and b=="H":
  print("H")
elif a=="H" and b=="D":
  print("D")
elif a=="D" and b=="H":
  print("D")
elif a=="D" and b=="D":
  print("H")


Fixed submission:
a,b=input().split()
if a=="H" and b=="H":
  print("H")
elif a=="H" and b=="D":
  print("D")
elif a=="D" and b=="H":
  print("D")
elif a=="D" and b=="D":
  print("H")

Buggy python submission (verdict: Runtime Error):
a,b=map(input().split())
if a="H" and b="H":
  print("H")
elif a="H" and b="D":
  print("D")
elif a="D" and b="H":
  print("D")
elif a="D" and b="D":
  print("H")

Fixed submission:
a,b=input().split()
if a=="H" and b=="H":
  print("H")
elif a=="H" and b=="D":
  print("D")
elif a=="D" and b=="H":
  print("D")
elif a=="D" and b=="D":
  print("H")
Buggy python submission (verdict: Time Limit Exceeded):
import sys

hs = list(map(int, sys.stdin.read().strip().splitlines()[1].split(" ")))
if len(hs) == 1:
  print("Yes")
  sys.exit(0)

stack = [(hs[0], 1), (hs[0]-1, 1)]
while stack:
  pre, i = stack.pop()
  for v in (hs[i]-1, hs[i]):
    if v >= pre:
      if i == len(hs)-1:
        print("Yes")
        sys.exit(0)

      stack.append((v, i+1))
print("No")


Fixed submission:
import sys

hs = list(map(int, sys.stdin.read().strip().splitlines()[1].split(" ")))
if len(hs) == 1:
  print("Yes")
  sys.exit(0)
if hs[0] > hs[1]:
  hs[0] -= 1

for i in range(1, len(hs)):
  pre = hs[i-1]
  diff = hs[i] - pre
  if diff >= 1:
    hs[i] -= 1
  elif diff < 0:
    print("No")
    sys.exit(0)
print("Yes")

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

hs = list(map(int, sys.stdin.read().strip().splitlines()[1].split(" ")))
if len(hs) == 1:
  print("Yes")
  sys.exit(0)

def solver(pre, i):
  for v in (hs[i]-1, hs[i]):
    if v >= pre:
      if i == len(hs)-1:
        return True

      if solver(v, i+1):
        return True
  return False

if solver(hs[0], 1) or solver(hs[0]-1, 1):
  print("Yes")
else:
  print("No")


Fixed submission:
import sys

hs = list(map(int, sys.stdin.read().strip().splitlines()[1].split(" ")))
if len(hs) == 1:
  print("Yes")
  sys.exit(0)
if hs[0] > hs[1]:
  hs[0] -= 1

for i in range(1, len(hs)):
  pre = hs[i-1]
  diff = hs[i] - pre
  if diff >= 1:
    hs[i] -= 1
  elif diff < 0:
    print("No")
    sys.exit(0)
print("Yes")
Buggy python submission (verdict: Runtime Error):
import sys

a = sys.argv[1]
b = sys.argv[2]

if (a + b) % 2 == 0:
  print("Even")
else:
  print("Odd")

Fixed submission:
import sys

a, b = [int(v) for v in sys.stdin.read().split(" ")]
if (a * b) % 2 == 0:
  print("Even")
else:
  print("Odd")
Buggy python submission (verdict: Time Limit Exceeded):
import sys

num, total = list(map(int, sys.stdin.read().split(" ")))
for i in range(total // 10000, -1, -1):
  amount = total - 10000 * i
  if amount == 0 and i == num:
    print("%d 0 0"%i)
    sys.exit(0)
  for j in range(amount // 5000, -1, -1):
    amountj = amount - 5000 * j
    if amountj == 0 and i+j == num:
      print("%d %d 0"%(i, j))
      sys.exit(0)
    for k in range(amountj // 1000, -1, -1):
      amountk = amountj - 1000 * k
      if amountk == 0 and i+j+k == num:
        print("%d %d %d"%(i, j, k))
        sys.exit(0)
print("-1 -1 -1")


Fixed submission:
import sys

num, total = list(map(int, sys.stdin.read().split(" ")))
for i in range(total // 10000, -1, -1):
  amount = total - 10000 * i
  if amount == 0 and i == num:
    print("%d 0 0"%i)
    sys.exit(0)
  for j in range(amount // 5000, -1, -1):
    amountj = amount - 5000 * j
    if amountj == 0 and i+j == num:
      print("%d %d 0"%(i, j))
      sys.exit(0)
    k = amountj // 1000
    if i+j+k == num:
      print("%d %d %d"%(i, j, k))
      sys.exit(0)
print("-1 -1 -1")
Buggy python submission (verdict: Runtime Error):
import sys

s = sys.stdin.read().strip()
words = ["dream", "dreamer", "erase", "eraser"]

def dfs(i):
  for w in words:
    if s.startswith(w, i):
      n = i + len(w)
      if n == len(s):
        return True
      if dfs(n):
        return True
  return False

print("YES" if dfs(0) else "NO")


Fixed submission:
import sys

s = sys.stdin.read().strip()
words = ["dream", "dreamer", "erase", "eraser"]

stack = [0]
match = False
while not match and stack:
  i = stack.pop()
  for w in words:
    if s.startswith(w, i):
      n = i + len(w)
      if n == len(s):
        match = True
        break
      stack.append(n)
print("YES" if match else "NO")

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

s = sys.stdin.read().strip()
words = ["dream", "dreamer", "erase", "eraser"]

def dfs(i):
  for w in words:
    if s.startswith(w, i):
      n = i + len(w)
      if n == len(s):
        print("YES")
        sys.exit(0)
      dfs(n)

dfs(0)
print("NO")


Fixed submission:
import sys

s = sys.stdin.read().strip()
words = ["dream", "dreamer", "erase", "eraser"]

stack = [0]
match = False
while not match and stack:
  i = stack.pop()
  for w in words:
    if s.startswith(w, i):
      n = i + len(w)
      if n == len(s):
        match = True
        break
      stack.append(n)
print("YES" if match else "NO")
Buggy python submission (verdict: Runtime Error):
import time

A = int(input())
B = int(input())
C = int(input())

if (B + C) >= A:
    print(C - (A - B))

else:
    print(0)

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

if (B + C) >= A:
    print(C - (A - B))

else:
    print(0)
Buggy python submission (verdict: Runtime Error):
N = input()
ans = 0
i = 1

for i in range(N):
    s = str(i+1)
    if len(s) == 1 or len(s) == 3 or len(s) == 5:
        ans += 1
        
print(ans)

Fixed submission:
N = int(input())
ans = 0
i = 1

for i in range(N):
    s = str(i+1)
    if len(s) == 1 or len(s) == 3 or len(s) == 5:
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
N = input()
ans = 0
i = 1

for i in range(N):
    s = str(i+1)
    if len(s) == 1 or len(s) == 3 or len(s) == 5:
        ans += 1

Fixed submission:
N = int(input())
ans = 0
i = 1

for i in range(N):
    s = str(i+1)
    if len(s) == 1 or len(s) == 3 or len(s) == 5:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())

ans = c - (a - b)
if ans < 0:
	ans = 0
print(ans)

Fixed submission:

a,b,c = map(int, input().split())

ans = c - (a - b)
if ans < 0:
	ans = 0
print(ans)

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


ans = C - (A - B)
if ans == 0:
	ans = 0

print(ans)

Fixed submission:

a,b,c = map(int, input().split())

ans = c - (a - b)
if ans < 0:
	ans = 0
print(ans)

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

if B != C:
	surplus = A - B
	ans = C - surplus 
	print(ans)
else:
	print(0)

Fixed submission:

a,b,c = map(int, input().split())

ans = c - (a - b)
if ans < 0:
	ans = 0
print(ans)

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

if B != C:
	surplus = A - B
	result = C - surplus 
	print(result)
else:
	print(0)

Fixed submission:

a,b,c = map(int, input().split())

ans = c - (a - b)
if ans < 0:
	ans = 0
print(ans)

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


if B != C {
	surplus = A - B
	result = C - surplus 
	print(result)
} else { 
	 print(0)
}

Fixed submission:

a,b,c = map(int, input().split())

ans = c - (a - b)
if ans < 0:
	ans = 0
print(ans)