Buggy python submission (verdict: Runtime Error):
n = input()
m = [0] * n
max = [0] * n
kijun = [0] * n
rieki = [0] * n
max_rieki = 0
for i in xrange(n):
 m[i] = input()


for i in xrange(n-1):
 max[i] = m[i+1] #0???i
 kijun[i] = m[i]
 for j in xrange(i+1,n): #1 wo i+1 n-1 wo n-1+i
  if max[i] < m[j]:
      max[i] = m[j]
 rieki[i] = max[i] - kijun[i]
max_rieki = rieki[0]
for i in xrange(1,n):
  if rieki[i] > max_rieki:
   max_rieki = rieki[i]
print max_rieki

Fixed submission:
n = input()
m = [0] * n
max_rieki = -1000000000



for i in xrange(n):
 m[i] = input()

min_rieki = m[0]
for i in xrange(1,n): 
  if max_rieki < m[i] - min_rieki:
     max_rieki = m[i] - min_rieki
  if min_rieki > m[i]:
     min_rieki = m[i]

print max_rieki

Buggy python submission (verdict: Runtime Error):
n = input()
m = [0] * n
max = [0] * n
kijun = [0] * n
rieki = [0] * n
max_rieki = 0
for i in xrange(n):
 m[i] = input()


for i in xrange(n-1):
 max[i] = m[i+1] #0???i
 kijun[i] = m[i]
 for j in xrange(i+1,n): #1 wo i+1 n-1 wo n-1+i
  if max[i] < m[j]:
      max[i] = m[j]
 rieki[i] = max[i] - kijun[i]
max_rieki = rieki[0]
for i in xrange(1,n):
  if rieki[i] > max_rieki:
   max_rieki = rieki[i]
print max_rieki

Fixed submission:
n = input()
m = [0] * n
max_rieki = -1000000000



for i in xrange(n):
 m[i] = input()

min_rieki = m[0]
for i in xrange(1,n): 
  if max_rieki < m[i] - min_rieki:
     max_rieki = m[i] - min_rieki
  if min_rieki > m[i]:
     min_rieki = m[i]

print max_rieki

Buggy python submission (verdict: Runtime Error):
n = input()
m = [0] * n
max = [0] * n
kijun = [0] * n
rieki = [0] * n
max_rieki = 0
for i in xrange(n):
 m[i] = raw_input()


for i in xrange(n-1):
 max[i] = m[i+1] #0???i
 kijun[i] = m[i]
 for j in xrange(i+1,n): #1 wo i+1 n-1 wo n-1+i
  if max[i] < m[j]:
      max[i] = m[j]
 rieki[i] = max[i] - kijun[i]
max_rieki = rieki[0]
for i in xrange(1,n):
  if rieki[i] > max_rieki:
   max_rieki = rieki[i]
print max_rieki

Fixed submission:
n = input()
m = [0] * n
max_rieki = -1000000000



for i in xrange(n):
 m[i] = input()

min_rieki = m[0]
for i in xrange(1,n): 
  if max_rieki < m[i] - min_rieki:
     max_rieki = m[i] - min_rieki
  if min_rieki > m[i]:
     min_rieki = m[i]

print max_rieki

Buggy python submission (verdict: Runtime Error):
n = input()
m = [0] * n
max = [0] * n
kijun = [0] * n
rieki = [0] * n
max_rieki = 0
for i in xrange(n):
 m[i] = raw_input()


for i in xrange(n-1):
 max[i] = m[i+1]
 kijun[i] = m[i]
 for j in xrange(i+1,n):
  if max[i] < m[j]:
      max[i] = m[j]
 rieki[i] = max[i] - kijun[i]
max_rieki = rieki[0]
for i in xrange(1,n):
  if rieki[i] > max_rieki:
   max_rieki = rieki[i]
print max_rieki

Fixed submission:
n = input()
m = [0] * n
max_rieki = -1000000000



for i in xrange(n):
 m[i] = input()

min_rieki = m[0]
for i in xrange(1,n): 
  if max_rieki < m[i] - min_rieki:
     max_rieki = m[i] - min_rieki
  if min_rieki > m[i]:
     min_rieki = m[i]

print max_rieki

Buggy python submission (verdict: Runtime Error):
n = input()
m = [0] * n
max = [0] * n
kijun = [0] * n
rieki = [0] * n
max_rieki = 0
for i in xrange(n):
 m[i] = input()


for i in xrange(n-1):
 max[i] = m[i+1] 
 kijun[i] = m[i]
 for j in xrange(i+1,n): 
  if max[i] < m[j]:
      max[i] = m[j]
 rieki[i] = max[i] - kijun[i]
 print rieki[i]
max_rieki = rieki[0]
for i in xrange(1,n):
  if rieki[i] > max_rieki:
   max_rieki = rieki[i]

print max_rieki

Fixed submission:
n = input()
m = [0] * n
max_rieki = -1000000000



for i in xrange(n):
 m[i] = input()

min_rieki = m[0]
for i in xrange(1,n): 
  if max_rieki < m[i] - min_rieki:
     max_rieki = m[i] - min_rieki
  if min_rieki > m[i]:
     min_rieki = m[i]

print max_rieki

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
m = [0] * n
max = [0] * n
kijun = [0] * n
rieki = [0] * n
max_rieki = 0
for i in xrange(n):
 m[i] = input()
 
 
for i in xrange(n-1):
 max[i] = m[i+1] 
 kijun[i] = m[i]
 for j in xrange(i+1,n): 
  if max[i] < m[j]:
      max[i] = m[j]
 rieki[i] = max[i] - kijun[i]
max_rieki = rieki[0]
for i in xrange(1,n-1):
  if rieki[i] > max_rieki:
   max_rieki = rieki[i]
 
print max_rieki

Fixed submission:
n = input()
m = [0] * n
max_rieki = -1000000000



for i in xrange(n):
 m[i] = input()

min_rieki = m[0]
for i in xrange(1,n): 
  if max_rieki < m[i] - min_rieki:
     max_rieki = m[i] - min_rieki
  if min_rieki > m[i]:
     min_rieki = m[i]

print max_rieki

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
m = [0] * n
max = [0] * n
kijun = [0] * n
rieki = [0] * n
max_rieki = 0
for i in xrange(n):
 m[i] = input()
 
 
for i in xrange(n-1):
 max[i] = m[i+1] 
 kijun[i] = m[i]
 for j in xrange(i+1,n): 
  if max[i] < m[j]:
      max[i] = m[j]
 rieki[i] = max[i] - kijun[i]
max_rieki = rieki[0]
for i in xrange(1,n-1):
  if rieki[i] > max_rieki:
   max_rieki = rieki[i]
 
print max_rieki

Fixed submission:
n = input()
m = [0] * n
max_rieki = -1000000000



for i in xrange(n):
 m[i] = input()

min_rieki = m[0]
for i in xrange(1,n): 
  if max_rieki < m[i] - min_rieki:
     max_rieki = m[i] - min_rieki
  if min_rieki > m[i]:
     min_rieki = m[i]

print max_rieki

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
m = [0] * n
max = [0] * n
kijun = [0] * n
rieki = [0] * n
max_rieki = 0
for i in xrange(n):
 m[i] = input()
 
 
for i in xrange(n-1):
 max[i] = m[i+1] 
 kijun[i] = m[i]
 for j in xrange(i+1,n): 
  if max[i] < m[j]:
      max[i] = m[j]
 rieki[i] = max[i] - kijun[i]
 if i == 0:
  max_rieki = rieki[0]
 if rieki[i] > max_rieki:
  max_rieki = rieki[i]

print max_rieki

Fixed submission:
n = input()
m = [0] * n
max_rieki = -1000000000



for i in xrange(n):
 m[i] = input()

min_rieki = m[0]
for i in xrange(1,n): 
  if max_rieki < m[i] - min_rieki:
     max_rieki = m[i] - min_rieki
  if min_rieki > m[i]:
     min_rieki = m[i]

print max_rieki

Buggy python submission (verdict: Runtime Error):
n = input()
m = [0] * n
max = [0] * n
kijun = [0] * n
rieki = [0] * n
max_rieki = 0
for i in xrange(n):
 m[i] = input()
 
 
for i in xrange(n-1):
 max[i] = m[i+1] 
 kijun[i] = m[i]
 for j in xrange(i+1,n): 
  if max[i] < m[j]:
      max[i] = m[j]
 rieki[i] = max[i] - kijun[i]
 if i == 0:
  max_rieki = rieki[0]
 if rieki[i] > max_rieki:
  max_rieki = rieki[i]

print max_rieki

Fixed submission:
n = input()
m = [0] * n
max_rieki = -1000000000



for i in xrange(n):
 m[i] = input()

min_rieki = m[0]
for i in xrange(1,n): 
  if max_rieki < m[i] - min_rieki:
     max_rieki = m[i] - min_rieki
  if min_rieki > m[i]:
     min_rieki = m[i]

print max_rieki

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
m = [0] * n
max = [0] * n
kijun = [0] * n
rieki = [0] * n
max_rieki = 0
for i in xrange(n):
 m[i] = input()
 
 
for i in xrange(n-1):
 max[i] = m[i+1] 
 kijun[i] = m[i]
 for j in xrange(i+1,n): 
  if max[i] < m[j]:
      max[i] = m[j]
 rieki[i] = max[i] - kijun[i]
 if i == 0:
  max_rieki = rieki[0]
 if rieki[i] > max_rieki:
  max_rieki = rieki[i]

print max_rieki

Fixed submission:
n = input()
m = [0] * n
max_rieki = -1000000000



for i in xrange(n):
 m[i] = input()

min_rieki = m[0]
for i in xrange(1,n): 
  if max_rieki < m[i] - min_rieki:
     max_rieki = m[i] - min_rieki
  if min_rieki > m[i]:
     min_rieki = m[i]

print max_rieki

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
m = [0] * n
max = [0] * n
kijun = [0] * n
rieki = [0] * n
max_rieki = 0
for i in xrange(n):
 m[i] = input()
 
 
for i in xrange(n-1):
 max[i] = m[i+1] 
 kijun[i] = m[i]
 for j in xrange(i+1,n): 
  if max[i] < m[j]:
      max[i] = m[j]
 rieki[i] = max[i] - kijun[i]
 if i == 0:
  max_rieki = rieki[0]
 if rieki[i] > max_rieki:
  max_rieki = rieki[i]

print max_rieki

Fixed submission:
n = input()
m = [0] * n
max_rieki = -1000000000



for i in xrange(n):
 m[i] = input()

min_rieki = m[0]
for i in xrange(1,n): 
  if max_rieki < m[i] - min_rieki:
     max_rieki = m[i] - min_rieki
  if min_rieki > m[i]:
     min_rieki = m[i]

print max_rieki

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Here your code !
n = input()
m = [0] * n
max = [0] * n
kijun = [0] * n
rieki = [0] * n
max_rieki = 0


for i in xrange(n):
 m[i] = input()
 
 
for i in xrange(n):
 if i != n-1:    
  max[i] = m[i+1] 
  kijun[i] = m[i]
  for j in xrange(i+1,n): 
   if max[i] < m[j]:
      max[i] = m[j]
  rieki[i] = max[i] - kijun[i]
  if i == 0:
   max_rieki = rieki[0]
  if rieki[i] > max_rieki:
   max_rieki = rieki[i]

print max_rieki

Fixed submission:
n = input()
m = [0] * n
max_rieki = -1000000000



for i in xrange(n):
 m[i] = input()

min_rieki = m[0]
for i in xrange(1,n): 
  if max_rieki < m[i] - min_rieki:
     max_rieki = m[i] - min_rieki
  if min_rieki > m[i]:
     min_rieki = m[i]

print max_rieki

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
m = [0] * n
max = [0] * n
kijun = [0] * n
rieki = [0] * n
max_rieki = 0


for i in xrange(n):
 m[i] = input()
 
 
for i in xrange(n):
 if i != n-1:    
  max[i] = m[i+1] 
  kijun[i] = m[i]
  for j in xrange(i+1,n): 
   if max[i] < m[j]:
      max[i] = m[j]
  rieki[i] = max[i] - kijun[i]
  if i == 0:
   max_rieki = rieki[0]
  if rieki[i] > max_rieki:
   max_rieki = rieki[i]

print max_rieki

Fixed submission:
n = input()
m = [0] * n
max_rieki = -1000000000



for i in xrange(n):
 m[i] = input()

min_rieki = m[0]
for i in xrange(1,n): 
  if max_rieki < m[i] - min_rieki:
     max_rieki = m[i] - min_rieki
  if min_rieki > m[i]:
     min_rieki = m[i]

print max_rieki

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
m = [0] * n
max = [0] * n
kijun = [0] * n
rieki = [0] * n
max_rieki = -1*10**9


for i in xrange(n):
 m[i] = input()
 
 
for i in xrange(n):
 if i != n-1:    
  for j in xrange(i+1,n): 
   if max_rieki < m[j] - m[i]:
      max_rieki = m[j] - m[i]


print max_rieki

Fixed submission:
n = input()
m = [0] * n
max_rieki = -1000000000



for i in xrange(n):
 m[i] = input()

min_rieki = m[0]
for i in xrange(1,n): 
  if max_rieki < m[i] - min_rieki:
     max_rieki = m[i] - min_rieki
  if min_rieki > m[i]:
     min_rieki = m[i]

print max_rieki