Buggy python submission (verdict: Runtime Error):
max = 0
n_max = 19999

price = [0]*n_max
for i in range(n_max):
  price[i] = int(raw_input())

for i in range(n_max):
  for j in range(j, n_max+1):
    if max <= price[j] - price[i]:
      max = price[j] - price[i]
print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 19999

price = []
for k in range(n_max):
    price.attend(int(raw_input())
    
for i in range(n_max):
    for j in range(k, n_max):
        if max <= price[j] - price[i]:
            max = price[j] - price[i]
print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 19999

price = []
for k in range(n_max):
    price.attend(int(raw_input())
    
for i in range(n_max):
    for j in range(k, n_max):
        if max <= price[j] - price[i]:
            max = price[j] - price[i]
print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 19

price = []
for k in range(n_max):
    price.attend(int(raw_input())
    
for i in range(n_max):
    for j in range(k, n_max):
        if max <= price[j] - price[i]:
            max = price[j] - price[i]
print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 10

price = []
for k in range(n_max):
    price.attend(int(raw_input())
    
for i in range(n_max)
    for j in range(k, n_max)
        if max <= price[j] - price[i]:
            max = price[j] - price[i]
print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 7

price = []
for k in range(n_max):
    price.attend(int(raw_input())
    
for i in range(n_max)
    for j in range(k, n_max)
        if max <= price[j] - price[i]:
            max = price[j] - price[i]
print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 6

price = []
for k in range(n_max):
    price.attend(int(raw_input())
    
for i in range(n_max)
    for j in range(k, n_max)
        if max <= price[j] - price[i]:
            max = price[j] - price[i]
print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0

n_max = int(raw_input())
price = []
for k in range(n_max):
    price.attend(int(raw_input())
    
for i in range(n_max)
    for j in range(k, n_max)
        if max <= price[j] - price[i]:
            max = price[j] - price[i]
print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0

n_max = int(raw_input())
price = [0]*n_max
    
for i in range(n_max)
    for j in range(k, n_max)
        if max <= price[j] - price[i]:
            max = price[j] - price[i]
print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = []
for k in range(n_max):
    price.attend(int(raw_input())
    
for i in range(n_max)
    for j in range(k, n_max)
        if max <= price[j] - price[i]:
            max = price[j] - price[i]
print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5,6]
for i in range(n_max)
    for j in range(i, n_max)
        if max <= price[j] - price[i]:
            max = price[j] - price[i]
print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5,6]
for i in range(n_max)
    if max <= price[j] - price[i]:
    print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5,6]
for i in range(6)
    if max <= price[j] - price[i]:
    print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5,6]
for i in range(6):
    if max <= price[j] - price[i]:
    print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5,6]

for i in range(n_max)
    for j in range(k, n_max)
        if max <= price[j] - price[i]:
            print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5,6]

for i in range(6)
    for j in range(k, 6)
        if max <= price[j] - price[i]:
            print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5,6]

for i in range(6)
    for j in range(j, 6)
        if max <= price[j] - price[i]:
            print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5,6]

for i in range(6)
    for j in range(j, 6)
        if max <= price[5] - price[i]:
            print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5]

for i in range(6)
    for j in range(j, 6)
        if max <= price[5] - price[i]:
            print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5]

for i in range(5)
    for j in range(j, 5)
        if max <= price[5] - price[i]:
            print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5]

for i in range(5)
    for j in range(5)
        if max <= price[5] - price[i]:
            print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5]

for i in range(5)
    if max <= price[5] - price[i]:
        print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5]

for i in range(5)
  if max <= price[5] - price[i]:
    print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5]

for i in range(5)
  for i in range(5)
    if max <= price[5] - price[i]:
      print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5]

for i in range(5):
  for i in range(5):
    if max <= price[5] - price[i]:
      print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5]

for i in range(5):
  for j in range(5):
    if max <= price[5] - price[i]:
      print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5]

for i in range(5)
  for j in range(5)
    if max <= price[5] - price[i]:
      print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5]

for i in range(5)
  if max <= price[5] - price[i]:
    print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5]

for i in range(5):
  if max <= price[5] - price[i]:
    print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5]

for i in range(5):
  if max <= price[5] - price[i]:
    print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0
??
n_max = int(raw_input())
price = [1,2,3,4,5,6]
for i in range(6):
????????for j in range(6):
????????????????if max <= price[j] - price[i]:
????????????????????????print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0
??
n_max = int(raw_input())
price = [1,2,3,4,5,6]
for i in range(6):
????for j in range(6):
????????????if max <= price[j] - price[i]:
????????????????????print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5,6]
for i in range(6):
????for j in range(6):
????????????if max <= price[j] - price[i]:
????????????????????print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5,6]
for i in range(6):
????  for j in range(6):
????????????  if max <= price[j] - price[i]:
????????????????????  print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Time Limit Exceeded):
max = 1-10**9
i = 0
j = 0
n_max = 0

n_max = int(raw_input())
price = [0]*n_max
for i in range(n_max):
    price[i] = int(raw_input())
for i in range(n_max):
    for j in range(i+1, n_max):
        if max <= (price[j] - price[i]):
            max = price[j] - price[i]
print max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Time Limit Exceeded):
dif_max = 1-10**9
max = 1
min = 10**9
n_max = 0
n_max = int(raw_input())

price = [0]*n_max
for i in range(0, n_max):
    price[i] = int(raw_input())
for i in range(0, n_max-1):
    for j in range(0, n_max):
        if j <= i:
            if min >= price[j]:
                min = price[j]
        else:
            if max <= price[j]:
                max = price[j]
    if dif_max <= max - min:
        dif_max = max - min
    max = 1
    min = 10**9
print dif_max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Time Limit Exceeded):
dif_max = 1-10**9
max = 1
min = 10**9
n_max = 0
n_max = int(raw_input())
 
price = [0]*n_max
for i in range(0, n_max):
  price[i] = int(raw_input())
for i in range(0, n_max-1):
  if min >= price[i]:
      min = price[i]
  for j in range(i+1, n_max):
      if max <= price[j]:
          max = price[j]
  if dif_max <= max - min:
      dif_max = max - min
  max = 1
  min = 10**9
print dif_max

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans

Buggy python submission (verdict: Runtime Error):
n = int(raw_input())

R = [0 for i in range(n)]

ans = 1 - 10**9
for i in range(n):
    R[i] = int(raw_input())
    if i == 0:
        min_R = R[0]
        continue
    if min_R < R[i]:
        if ans < R[i]-min_R:
            ans = R[i] - min_R
    elif min_R > R[i]:
        if ans < R[i]-min_R:
            ans = R[i] - min_R
        min_R = R[i]
    else:
        if ans < 0
        ans = 0
        
print ans
    
    
    

Fixed submission:
import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans