n = int(input())
minv = int(input())
maxv = -1000000000

for i in range(1,n):
  r = int(input())
  m = r-minv
  if maxv < m < 0:
    maxv = m
    minv = r
  elif maxv < m:
    maxv = m
  elif m < 0:
    minv = r

print(maxv) n = int(input()) n int(input()) int input() input minv = int(input()) minv int(input()) int input() input maxv = -1000000000 maxv -1000000000 for i in range(1,n):
  r = int(input())
  m = r-minv
  if maxv < m < 0:
    maxv = m
    minv = r
  elif maxv < m:
    maxv = m
  elif m < 0:
    minv = r i range(1,n) range 1 n r = int(input()) r int(input()) int input() input m = r-minv m r-minv r minv if maxv < m < 0:
    maxv = m
    minv = r
  elif maxv < m:
    maxv = m
  elif m < 0:
    minv = r maxv < m < 0 maxv < m maxv m 0 maxv = m maxv m minv = r minv r elif maxv < m:
    maxv = m
   maxv < m maxv m maxv = m maxv m elif m < 0:
    minv = r m < 0 m 0 minv = r minv r print(maxv) print maxv r = int(input()) int(input()) r minv = r r minv m = r-minv r-minv m maxv = m m maxv n = int(input()) int(input()) n maxv = m m maxv minv = r r minv maxv = -1000000000 -1000000000 maxv minv = int(input()) int(input()) minv
n = int(input())
minv = int(input())
maxv = -1000000000

for i in range(1,n):
  r = int(input())
  m = r-minv
  if maxv < m < 0:
    maxv = m
    minv = r
  elif maxv < m:
    maxv = m
  elif m < 0:
    minv = r

print(maxv)