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 n = input() n input() input m = [0] * n m [0] * n [0] 0 n max_rieki = -1000000000 max_rieki -1000000000 for i in xrange(n):
 m[i] = input() i xrange(n) xrange n m[i] = input() m[i] m i input() input min_rieki = m[0] min_rieki m[0] 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] i xrange(1,n) xrange 1 n if max_rieki < m[i] - min_rieki:
     max_rieki = m[i] - min_rieki
   max_rieki < m[i] - min_rieki max_rieki m[i] - min_rieki m[i] m i min_rieki max_rieki = m[i] - min_rieki max_rieki m[i] - min_rieki m[i] m i min_rieki if min_rieki > m[i]:
     min_rieki = m[i] min_rieki > m[i] min_rieki m[i] m i min_rieki = m[i] min_rieki m[i] m i print min_rieki = m[i] m[i] min_rieki m = [0] * n [0] * n m max_rieki = -1000000000 -1000000000 max_rieki max_rieki = m[i] - min_rieki m[i] - min_rieki max_rieki n = input() input() n min_rieki = m[0] m[0] min_rieki
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