Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = str(input())

if N % 2 == 0:
  NN = N/2
  for i in range(0, NN):
    if S[i] != S[i+NN]:
      print('No')
  else:
    print('Yes')
    
else:
  print('No')

Fixed submission:
N = int(input())
S = str(input())
 
if N % 2 == 0:
  NN = int(N/2)
  for i in range(0, NN):
    if S[i] != S[i+NN]:
      print('No')
      break
  else:
    print('Yes')
    
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
S = str(input())

Ans = True
for i in range(0, len(S)):
  if i % 2 == 0:
    if S[i] == 'L' or S[i] == 'U' or S[i] == 'D':
    else:
      Ans = False
      break
  if i % 2 != 0:
    if S[i] == 'R' or S[i] == 'U' or S[i] == 'D':
    else:
      Ans = False
      break
else:
  print('Yes')
  
if Ans == False:
  print('No')

Fixed submission:
S = str(input())
 
Ans = True
for i in range(0, len(S)):
  if (i + 1) % 2 == 0:
    if S[i] != 'L' and S[i] != 'U' and S[i] != 'D':
      Ans = False
      break
  if (i + 1) % 2 == 1:
    if S[i] != 'R' and S[i] != 'U' and S[i] != 'D':
      Ans = False
      break
  
if Ans == False:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
N = int(input())

res=0
for i in range(1, N+1):
    if(les(N)//2==1):
        rea+=1

print(res)

Fixed submission:
N = int(input())

res=0
for i in range(1, N+1):
    if(len(str(i)) % 2==1):
        res+=1

print(res)

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

res=0
for i in range(1, int(N)+1):
    if(les(N)//2==1):
        rea+=1

print(res)

Fixed submission:
N = int(input())

res=0
for i in range(1, N+1):
    if(len(str(i)) % 2==1):
        res+=1

print(res)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = str(input())
A=[0] * N

for i in range(0, N):
    for j in range(0, N):
        if i != j:
            if j<i:
                if S[j] == "W":
                    A[i]+=1
                
            if j>i:
                if S[j] == "E":
                    A[i]+=1

tmp=A[0]
for i in range(1, N):
    if tmp > A[i]:
        tmp = A[i]

print(tmp)

Fixed submission:
N = int(input())
S = str(input())
W=[0] * N
E=[0] * N

for i in range(1, N):
    if S[i-1] == "W":
        W[i]=W[i-1]+1
    else:
        W[i]=W[i-1]
for i in range(N-2, -1, -1):
    if S[i+1] == "E":
        E[i]=E[i+1]+1
    else:
        E[i]=E[i+1]

tmp=W[0]+E[0]
for i in range(1, N):
    if tmp > W[i]+E[i]:
        tmp = W[i]+E[i]

print(tmp)
Buggy python submission (verdict: Runtime Error):
s=input()
c=0
for i in range(s):
    if i=="1":
        c+=1

print(c)

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

if (a*b)%2==1:
    print("Odd");
else:
    print("Even");
Buggy python submission (verdict: Runtime Error):
N, A, B = [int(input()) for i in range(3)]
 
ans = 0
for i in range(0, N+1):
    tmp=i
    sum=0
    while(tmp>0):
        sum += tmp%10
        tmp = int(tmp/10)

    if A<=sum and sum<=B:
        ans+=i
 
print(ans)

Fixed submission:
N, A, B = map(int,input().split())
 
ans = 0
for i in range(0, N+1):
    tmp=i
    sum=0
    while(tmp>0):
        sum += tmp%10
        tmp = int(tmp/10)

    if A<=sum and sum<=B:
        ans+=i
 
print(ans)

Buggy python submission (verdict: Runtime Error):
N, A, B = [int(input()) for i in range(3)]
 
ans = 0
for i in range(0, N+1):
    tmp=i
    sum=0
    while(tmp>0):
        sum += tmp%10
        tmp = int(tmp/10)

    if A<=sum and sum<=B:
        ans+=i
        print(i)
 
print(ans)

Fixed submission:
N, A, B = map(int,input().split())
 
ans = 0
for i in range(0, N+1):
    tmp=i
    sum=0
    while(tmp>0):
        sum += tmp%10
        tmp = int(tmp/10)

    if A<=sum and sum<=B:
        ans+=i
 
print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()
c=0
range(i, s):
    if i=="1":
        c++

print(c)

Fixed submission:
s=str(input())
c=0
for i in range(0,3):
    if s[i]=="1":
        c+=1

print(c)
Buggy python submission (verdict: Runtime Error):
from math import floor
from decimal import Decimal

S = list(input())
T = list(input())

isSuccess = False

for i in reversed(range(len(S) - len(T) + 1)):
    T_str = S[i: i + len(T)]
    for j in range(len(T)):
        if T_str[j] != T[j] and T_str[j] != "?":
        break
    else:
        isSuccess = True
        S[i:i + len(T)] = T
        break
if isSuccess == False:
    print("UNRESTORABLE")
else:
    string = ",".join(S)
    string = string.replace('?', 'a')
    S = string.split(',')
    print("".join(map(str,S)))

Fixed submission:
from math import floor
from decimal import Decimal

S = list(input())
T = list(input())

isSuccess = False

for i in reversed(range(len(S) - len(T) + 1)):
    T_str = S[i: i + len(T)]
    for j in range(len(T)):
        if T_str[j] != T[j] and T_str[j] != "?":
        	break
    else:
        isSuccess = True
        S[i:i + len(T)] = T
        break
if isSuccess == False:
    print("UNRESTORABLE")
else:
    string = ",".join(S)
    string = string.replace('?', 'a')
    S = string.split(',')
    print("".join(map(str,S)))
Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())

if A<C:
    A=C
if D<B
    B=D

print(A-B)

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

ans=0

if A<C:
    A=C
if D<B:
    B=D

if B<C or D<A:
    ans=0
else:
    ans=abs(A-B)

print(ans)
Buggy python submission (verdict: Runtime Error):
import math

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

if C%math.gcd(A, B)==0:
    print("YES")
else:
    print("NO")

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

sum=A
while sum % B != 0:
    sum = sum + A

    if sum%B==C:
        print("YES")
        break
else:
    print("NO")

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

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

if C%math.gcd(A, B)==0:
    print("Yes")
else:
    print("No")

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

sum=A
while sum % B != 0:
    sum = sum + A

    if sum%B==C:
        print("YES")
        break
else:
    print("NO")

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

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

if C%math.gcd(A, B)==0:
    print("Yes")
    break
else:
    print("No")

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

sum=A
while sum % B != 0:
    sum = sum + A

    if sum%B==C:
        print("YES")
        break
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
a,b = input().split()

if a=='H':
    if b=='H':
        print('H')
    else:
        print('D')
else:
    if b==H:
        print('D')
    else:
        print('H')

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

if a=='H':
    if b=='H':
        print('H')
    else:
        print('D')
else:
    if b=='H':
        print('D')
    else:
        print('H')
Buggy python submission (verdict: Runtime Error):
N = input()
sum=1

for i in range(1, N+1):
    sum=(sum*i)%1000000007

print(sum)


Fixed submission:
N = int(input())
sum=1

for i in range(1, N+1):
    sum=(sum*i)%1000000007

print(sum)

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

for i in range(1, N):
    sum=(sum*i)%1000000007

print(sum)

Fixed submission:
N = int(input())
sum=1

for i in range(1, N+1):
    sum=(sum*i)%1000000007

print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
sum=1

for i in range(1, N+1):
    sum = (sum*i)

print(sum%1000000007)

Fixed submission:
N = int(input())
sum=1

for i in range(1, N+1):
    sum=(sum*i)%1000000007

print(sum)

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

for i in range(1, N):
    sum=(sum*i)%1000000007

print(sum)

Fixed submission:
N = int(input())
sum=1

for i in range(1, N+1):
    sum=(sum*i)%1000000007

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

d = a // b
if a % d != 0:
    d += 1

print(d * c)

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

d = a // b
if a % b != 0:
    d += 1

print(d * c)
Buggy python submission (verdict: Runtime Error):
a = list(input())
b = list(input())
n = 0
for c, d in zip(a, b):
  if c != d:
    count += 1

Fixed submission:
a = list(input())
b = list(input())
n = 0
for c, d in zip(a, b):
  if c != d:
    n += 1
print(n)
Buggy python submission (verdict: Runtime Error):
for i in range(5):
  n = input()
  if n == 0:
    print(i + 1)

Fixed submission:
number = input()
for i, n in enumerate(number.split()):
  if n == "0":
    print(i + 1)
    break
Buggy python submission (verdict: Runtime Error):
number = input()
list = number.split()
if int(list[1]) % 3 == 0 or int(list[0]) * 4 < int(list[1]):
    print("No")
else:
    a = 0
    for i in range(int(list[0])):
        a = i
        n = i + 1
        n2 = int(list[0] - n)
        if n * 2 + n2 * 4 == int(list[1]):
            print("Yes")
            break
    if a == int(list[0]) - 1:
      print("No")

Fixed submission:
number = input()
list = number.split()


def hoge(a, b):
    if a * 4 < b:
        print("No")
        return
    else:
        for i in range(a):
            n = i + 1
            n2 = a - n
            if n * 2 + n2 * 4 == b:
                print("Yes")
                return
        else:
            if a * 4 == b:
                print("Yes")
                return
            print("No")


hoge(int(list[0]), int(list[1]))
Buggy python submission (verdict: Runtime Error):
a = input().split()
if a[1] == "0":
  print(a[0])
else:
  number_list = input().split()
  n = 1
  number = int(a[0])
  while True:
    num = number + n
    num2 = number - n
    if str(num) not in number_list or str(num2) not in number_list:
      if str(num) in number_list:
        print(num2)
      else:
        print(num1)
      break
    n += 1
    

Fixed submission:
a = input().split()
if a[1] == "0":
  print(a[0])
else:
  number_list = input().split()
  n = 0
  number = int(a[0])
  while True:
    num = number + n
    num2 = number - n
    if str(num) not in number_list or str(num2) not in number_list:
      if str(num) not in number_list and str(num2) not in number_list:
        print(num2)
        break
      if str(num) in number_list:
        print(num2)
      else:
        print(num)
      break
    n += 1
Buggy python submission (verdict: Time Limit Exceeded):
text_list = input().split()
n = 0
a = int(text_list[0])
b = int(text_list[0]) + int(text_list[1])
c = int(text_list[0]) + int(text_list[1]) + int(text_list[2])
for i in range(int(text_list[3])):
    if i < a:
        n += 1
    elif i < b:
        continue
    elif i < c:
        n -= 1

print(n)

Fixed submission:
a, b, c, d = map(int, input().split())
if d <= a:
  print(d)
elif d <= a + b:
  print(a)
else:
  print(a-(d-(a+b)))

Buggy python submission (verdict: Runtime Error):
text_list = input().split()
n = 0
a = int(text_list[0])
b = int(text_list[0]) + int(text_list[1])
c = int(text_list[0]) + int(text_list[1]) + int(text_list[2])
for i in range(int(text_list[3])):
    if i a:
        n += 1
    elif i b:
        continue
    elif i c:
        n -= 1

print(n)

Fixed submission:
a, b, c, d = map(int, input().split())
if d <= a:
  print(d)
elif d <= a + b:
  print(a)
else:
  print(a-(d-(a+b)))

Buggy python submission (verdict: Time Limit Exceeded):
text_list = input().split()
n = 0
a = int(text_list[0])
b = int(text_list[0]) + int(text_list[1])
c = int(text_list[0]) + int(text_list[1]) + int(text_list[2])
for i in range(int(text_list[3])):
    if i < int(text_list[0]):
        n += 1
    elif i < int(text_list[0]) + int(text_list[1]):
        continue
    elif i < int(text_list[0]) + int(text_list[1]) + int(text_list[2]):
        n -= 1

print(n)

Fixed submission:
a, b, c, d = map(int, input().split())
if d <= a:
  print(d)
elif d <= a + b:
  print(a)
else:
  print(a-(d-(a+b)))

Buggy python submission (verdict: Time Limit Exceeded):
text_list = input().split()
n = 0
for i in range(int(text_list[3])):
  if i < int(text_list[0]):
    n += 1
  elif i < int(text_list[0]) + int(text_list[1]):
    pass
  elif i < int(text_list[0]) + int(text_list[1]) + int(text_list[2]):
    n -= 1
    
print(n)

Fixed submission:
a, b, c, d = map(int, input().split())
if d <= a:
  print(d)
elif d <= a + b:
  print(a)
else:
  print(a-(d-(a+b)))

Buggy python submission (verdict: Runtime Error):
text_list = input().split()
n = 0
for i in range(str(text_list[3])):
  if i >= int(text_list[0]):
    n += 1
  elif i >= int(text_list[0]) + int(text_list[1]):
    pass
  elif i >= int(test_list[0]) + int(text_list[1]) + int(text_list[2]):
    n -= 1
    
print(n)


Fixed submission:
a, b, c, d = map(int, input().split())
if d <= a:
  print(d)
elif d <= a + b:
  print(a)
else:
  print(a-(d-(a+b)))
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())

if a < b:
    x = b
if a < b:
    x = a

if c < d:
    y = d
if c > d:
    y = c
print(x*y)

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

ri1 = [a,b]
ri2 = [c,d]
ma = -10**20

for i in range(2):
    for j in range(2):
        a = ri1[i]*ri2[j]
        if a > ma:
            ma = a
print(ma)
Buggy python submission (verdict: Runtime Error):
X,N = map(int,input().split())
p = list(map(int,input().split()))

if (1 <= X <= 100) and (0 <= N <= 100) and ((1 <= len(p) <= 100 ) or N == 0) :
    ans = X-1
    bns = X+1
    
    while True:
        if N == 0:
            print(X)
            break
        
        if ans in p:
            ans-=1         
        if ans not in p:
            print(ans)
            break
        
        if bns in p:
            bns+=1
        if bns not in p:
            print(bns)
            break
        

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

if a == 0:
    print(1)
    
elif b == 0:
    print(2)
    
elif c == 0:
    print(3)
    
elif d == 0:
    print(4)
    
elif e == 0:
    print(5)

Buggy python submission (verdict: Runtime Error):
X,Y = map(float,input().split())

if (1 <= X <= 100) and (1 <= Y <= 100 ) and float.is_integer(X) and float.is_integer(Y) :
    if Y % 2 == 0:
        if Y / X <= 4:
            print("Yes")
            print()

        else:
            print("No")
    else: 
        print("No")

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

if a == 0:
    print(1)
    
elif b == 0:
    print(2)
    
elif c == 0:
    print(3)
    
elif d == 0:
    print(4)
    
elif e == 0:
    print(5)
Buggy python submission (verdict: Runtime Error):
A,V = map(int,input().split()) 
B,W = map(int,input().split())
T = int(input())
P = 0
if (-10**9 <= A <= 10**9) and (-10**9 <= B <= 10**9) and (1 <= V <= 10**9) \
and  (1 <= W <= 10**9) and (1 <= T <= 10**9) and (A != B) and type(A) == int and\
type(B) == int and type(V) == int and type(W) == int and type(T) == int:
    
    while P != T: 
        if A > B:
            A -= V
            B -= W
            P+=1
        
        elif A < B:
            A += V
            B += W
            P+=1

        else:
            print("YES")
            break
    
    if A != B:
        print("NO")


Fixed submission:
import random

name = str(input())
a = len(name)

if  3<= a <= 20:
    b = random.randint(0,a-3) 
    
    ada_1 = name[b]
    ada_2 = name[b+1]
    ada_3 = name[b+2]
    
    print(ada_1+ada_2+ada_3)
else:
    None
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())

cnt=0

for i in range(1,n):
    for j in range(i,n-i+1):
        if i*j<n and i==j:
            cnt+=1
        elif i*j<n:
            cnt+=2
        else:
            pass

print(cnt)

Fixed submission:
n=int(input())

m=int((n-1)**(1/2))

cnt=0
for i in range(1,m+1):
    cnt+=((n-1)//i-i)*2+1

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

l=[]
for i in range(n-k+1):
    total=1
    for j in range(0+i,k+i):
        total*=a[j]
    l.append(total)

for i in range(n-k):
    if l[i]<l[i+1]:
        print('Yes')
    else:
        print('No')   

Fixed submission:
x=int(input())

if 400<=x<=599:
    print(8)
elif 600<=x<=799:
    print(7)
elif 800<=x<=999:
    print(6)
elif 1000<=x<=1199:
    print(5)
elif 1200<=x<=1399:
    print(4)
elif 1400<=x<=1599:
    print(3)
elif 1600<=x<=1799:
    print(2)
else:
    print(1)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
a=list(map(int,input().split()))

l=[]
for i in range(n-k+1):
    total=1
    for j in range(0+i,k+i):
        total*=a[j]
    l.append(total)

for i in range(n-k):
    if l[i]<l[i+1]:
        print('Yes')
    else:
        print('No')   

Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))

for i in range(n-k):
    if a[i]<a[i+k]:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
a=list(map(int,input().split()))

l=[]
for i in range(n-k+1):
    total=1
    for j in range(0+i,k+i):
        total*=a[j]
    l.append(total)

for i in range(n-k):
    if l[i]<l[i+1]:
        print('Yes')
    else:
        print('No')  

Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))

for i in range(n-k):
    if a[i]<a[i+k]:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
N=int(input())
lst=list(map(int,input().split()))
lst.sort(reverse=True)

A=0
B=0
for i in range(N):
    if i==0 or i%2==0:
        A+=lst[i]
    else:
        B+=lst[i]

print(int(A)-int(B))

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

a=int(N%500)
if A>=a:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
print(math.floor((a*b) / math.gcd(a, b)))

Fixed submission:
import math
import fractions
a, b = map(int, input().split())
print(math.floor((a*b) / fractions.gcd(a, b)))

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

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))

Fixed submission:
import math
import fractions
a, b = map(int, input().split())
print(math.floor((a*b) / fractions.gcd(a, b)))
Buggy python submission (verdict: Runtime Error):
x,y,z = sorted(map(int, input().split()))
print((b-a)+(c-b))

Fixed submission:
x,y,z = sorted(map(int, input().split()))
print((y-x)+(z-y))
Buggy python submission (verdict: Runtime Error):
for noguchi in range(n + 1):
    for higuchi in range(n + 1 - noguchi):
        yukichi = n - noguchi - higuchi
        if noguchi + higuchi * 5 + yukichi * 10 == yen:
            print(yukichi, higuchi, noguchi)
            exit(0)
print("-1 -1 -1")

Fixed submission:
n, yen = map(int, input().split())
yen //= 1000

for noguchi in range(n + 1):
    for higuchi in range(n + 1 - noguchi):
        yukichi = n - noguchi - higuchi
        if noguchi + higuchi * 5 + yukichi * 10 == yen:
            print(yukichi, higuchi, noguchi)
            exit(0)
print("-1 -1 -1")
Buggy python submission (verdict: Runtime Error):
a, b= map(str, input().split())
if a=="H":
    print(b)
else:
    if b = "H":
        print("D")
    if b = "D":
        print("H")

Fixed submission:
a, b= map(str, input().split())
if a=="H":
    print(b)
else:
    if b == "H":
        print("D")
    if b == "D":
        print("H")
Buggy python submission (verdict: Runtime Error):
def main():
N = int(input())
A = list(map(int, input().split()))
SUM = 1

if 0 in A:
    print(0)
    return

for a in A:
    SUM = SUM * a
    if SUM > 1000000000000000000:
        print(-1)
        return

    print(SUM)

main()

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

    if 0 in A:
        print(0)
        return

    for a in A:
        SUM = SUM * a
        if SUM > 1000000000000000000:
            print(-1)
            return

    print(SUM)
main()

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
i = 0
SUM = 1
for a in A:
    SUM = SUM * a

if SUM > 10**18:
    print(-1)
    
else:
    print(SUM)

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

    if 0 in A:
        print(0)
        return

    for a in A:
        SUM = SUM * a
        if SUM > 1000000000000000000:
            print(-1)
            return

    print(SUM)
main()

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
i = 0
SUM = 1
for i in range(N):
    SUM = SUM * A[i]
    i += 1

if SUM > 10**18:
    print(-1)
    
else:
    print(SUM)

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

    if 0 in A:
        print(0)
        return

    for a in A:
        SUM = SUM * a
        if SUM > 1000000000000000000:
            print(-1)
            return

    print(SUM)
main()

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
i = 0
SUM = 1
while i < N:
    SUM = SUM * A[i]
    i += 1

if SUM > 10**18:
    print(-1)
    
else:
    print(SUM)

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

    if 0 in A:
        print(0)
        return

    for a in A:
        SUM = SUM * a
        if SUM > 1000000000000000000:
            print(-1)
            return

    print(SUM)
main()
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
count=0
for num in range(N):
    if A[num]>A[num+1]:
        count=count+A[num]-A[num+1]
        A[num+1]=A[num]
    else:
        continue        
print(count)   

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
count=0
for num in range(N-1):
    if A[num]>A[num+1]:
        count=count+A[num]-A[num+1]
        A[num+1]=A[num]
    else:
        continue        
print(count)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
count=0
for num in range(N)
    if A[num]>A[num+1]:
        count=count+A[num]-A[num+1]
        A[num+1]=A[num]
    else:
        continue        
print(count)  

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
count=0
for num in range(N-1):
    if A[num]>A[num+1]:
        count=count+A[num]-A[num+1]
        A[num+1]=A[num]
    else:
        continue        
print(count)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
count=0
for num in range(N)
    if A[num]>A[num+1]:
        count=count+A[num]-A[num+1]
    else:
        count=count
print (count)    

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
count=0
for num in range(N-1):
    if A[num]>A[num+1]:
        count=count+A[num]-A[num+1]
        A[num+1]=A[num]
    else:
        continue        
print(count)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
sum(A)
count=0
for num in range(N)
    if A[num]>A[num+1]:
        count=count+A[num]-A[num+1]
    else:
        count=count
print (count)    

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
count=0
for num in range(N-1):
    if A[num]>A[num+1]:
        count=count+A[num]-A[num+1]
        A[num+1]=A[num]
    else:
        continue        
print(count)
Buggy python submission (verdict: Runtime Error):
x=list(map(int,input().split()))
for k in range(5)
    if x[k]==0:
        print(k+1)
    else:
        continue

Fixed submission:
x=list(map(int,input().split()))
for k in range(5):
    if x[k]==0:
        print(k+1)
    else:
        continue

Buggy python submission (verdict: Runtime Error):
x=list(map(int,input().split()))
for k in range(5)
    if x[k]=0:
        print(k)
    else:
        continue

Fixed submission:
x=list(map(int,input().split()))
for k in range(5):
    if x[k]==0:
        print(k+1)
    else:
        continue

Buggy python submission (verdict: Runtime Error):
x=list(map(int,input().split()))
for k in range(5)
    if x[k]==0:
        print(k)
        exit()
    else:
        continue

Fixed submission:
x=list(map(int,input().split()))
for k in range(5):
    if x[k]==0:
        print(k+1)
    else:
        continue