Buggy python submission (verdict: Runtime Error):
n = raw_input()
max = 0
min = 0
for x in range(n):
  x = raw_input()
  if x > max:
    max = x
  if x < min:
    min = x

print max-min
  

Fixed submission:
N = int(raw_input())
min = int(raw_input())
max = int(raw_input())
dif = max - min
if max < min:
    min = max

for i in range(N - 2):
    R = int(raw_input())
    if R - min > dif:
        dif = R - min
    if R < min:
        min = R

print dif

Buggy python submission (verdict: Runtime Error):
word = raw_input()
for i in range(len(word)):
    if word[i] == '\n':
        n = word[:i - 1]
        word = word[i:]
        break
n = int(n)

max = 0
min = 0
num = range(n)
for i in range(n):
    for j in range(7):
        if word[j] == '\n':
            num[i] = word[:j - 1]
            num[i] = int(num[i])
            word = word[j:]
            break

dif = range(n - 1)
min = 0
for i in range(n):
    for j in range(i):
        if num[j] < min:
            min = num[j]
    dif[i] = num[i] - min
    if dif[i] > max:
        max = dif[i]

print max

Fixed submission:
N = int(raw_input())
min = int(raw_input())
max = int(raw_input())
dif = max - min
if max < min:
    min = max

for i in range(N - 2):
    R = int(raw_input())
    if R - min > dif:
        dif = R - min
    if R < min:
        min = R

print dif

Buggy python submission (verdict: Runtime Error):
n = input()
list = []
for i in range(n):
    list.append(input())

min = list[0]
max = list[0]
dif = []
for i in range(n):
    for j in range(i - 1):
        if list[j] < min:
            min = list[j]
    dif[i] = list[i] - min
    if dif[i] > max:
        max = dif[i]

print max

Fixed submission:
N = int(raw_input())
min = int(raw_input())
max = int(raw_input())
dif = max - min
if max < min:
    min = max

for i in range(N - 2):
    R = int(raw_input())
    if R - min > dif:
        dif = R - min
    if R < min:
        min = R

print dif

Buggy python submission (verdict: Runtime Error):
n = input()
list = []
for i in range(n):
    list.append(input())

min = list[0]
max = list[0]
dif = []
for i in range(n):
    for j in range(i - 1):
        if list[j] < min:
            min = list[j]
    dif[i] = list[i] - min
    if dif[i] > max:
        max = dif[i]

print max

Fixed submission:
N = int(raw_input())
min = int(raw_input())
max = int(raw_input())
dif = max - min
if max < min:
    min = max

for i in range(N - 2):
    R = int(raw_input())
    if R - min > dif:
        dif = R - min
    if R < min:
        min = R

print dif

Buggy python submission (verdict: Runtime Error):
n = input()
list = []
for i in range(n):
    list.append(input())

min = list[0]
max = list[0]
dif = []
for i in range(n):
    for j in range(i - 1):
        if list[j] < min:
            min = list[j]
            dif.append(list[i] - min)
    if dif[i] > max:
        max = dif[i]

print max

Fixed submission:
N = int(raw_input())
min = int(raw_input())
max = int(raw_input())
dif = max - min
if max < min:
    min = max

for i in range(N - 2):
    R = int(raw_input())
    if R - min > dif:
        dif = R - min
    if R < min:
        min = R

print dif

Buggy python submission (verdict: Runtime Error):
n = input()
list = []
for i in range(n):
    list.append(input())

min = list[0]
max = list[0]
dif = []
for i in range(n):
    for j in range(i - 1):
        if list[j] < min:
            min = list[j]
    dif[i] = list[i] - min
    if dif[i] > max:
        max = dif[i]

print max

Fixed submission:
N = int(raw_input())
min = int(raw_input())
max = int(raw_input())
dif = max - min
if max < min:
    min = max

for i in range(N - 2):
    R = int(raw_input())
    if R - min > dif:
        dif = R - min
    if R < min:
        min = R

print dif

Buggy python submission (verdict: Runtime Error):
N = int(raw_input())
R = []
for i in range(N)
    R.append(int(raw_input()))

max = R[1] - R[0]
for i in range(N - 1)
    for j in range(i)
        dif = R[i+1] - R[j]
        if dif > max:
            max = dif

print max

Fixed submission:
N = int(raw_input())
min = int(raw_input())
max = int(raw_input())
dif = max - min
if max < min:
    min = max

for i in range(N - 2):
    R = int(raw_input())
    if R - min > dif:
        dif = R - min
    if R < min:
        min = R

print dif

Buggy python submission (verdict: Runtime Error):
N = int(raw_input())
R = []
for i in range(N):
    R[i] = (int(raw_input()))

max = R[1] - R[0]
for i in range(N - 1):
    for j in range(i):
        dif = R[i+1] - R[j]
        if dif > max:
            max = dif

print max

Fixed submission:
N = int(raw_input())
min = int(raw_input())
max = int(raw_input())
dif = max - min
if max < min:
    min = max

for i in range(N - 2):
    R = int(raw_input())
    if R - min > dif:
        dif = R - min
    if R < min:
        min = R

print dif

Buggy python submission (verdict: Time Limit Exceeded):
N = int(raw_input())
R = []
for i in range(N):
    R.append(int(raw_input()))

max = R[1] - R[0]
for i in range(N - 1):
    for j in range(i + 1):
        dif = R[i+1] - R[j]
        if dif > max:
            max = dif

print max

Fixed submission:
N = int(raw_input())
min = int(raw_input())
max = int(raw_input())
dif = max - min
if max < min:
    min = max

for i in range(N - 2):
    R = int(raw_input())
    if R - min > dif:
        dif = R - min
    if R < min:
        min = R

print dif

Buggy python submission (verdict: Runtime Error):
N = int(raw_input())
max = 0
min = 0
for i in range(N):
    R.append(int(raw_input()))

min = R[0]
max = R[1]
dif = R[1] - R[0]
for i in range(N - 1):
    if R[i+1] > max:
        max = R[i+1]
        dif = max - min
    if R[i] < min:
        min = R[i]
        dif = max - min

print dif

Fixed submission:
N = int(raw_input())
min = int(raw_input())
max = int(raw_input())
dif = max - min
if max < min:
    min = max

for i in range(N - 2):
    R = int(raw_input())
    if R - min > dif:
        dif = R - min
    if R < min:
        min = R

print dif

Buggy python submission (verdict: Runtime Error):
N = int(raw_input())
min = int(raw_input())
max = int(raw_input())
dif = max - min
for i in range(N):
    R = int(raw_input())
    if R - min > dif:
        dif = R - min
    if R < min:
        min = R

print dif

Fixed submission:
N = int(raw_input())
min = int(raw_input())
max = int(raw_input())
dif = max - min
if max < min:
    min = max

for i in range(N - 2):
    R = int(raw_input())
    if R - min > dif:
        dif = R - min
    if R < min:
        min = R

print dif