N = input()
a = [input() for i in range(N)]

def smax(N,a):
  smin = a[0]
  smax = -10**9
  for j in range(1,N):
   smax = max(smax,a[j]-smin)
   smin = min(smin,a[j])
  return smax

print smax(N,a) N = input() N input() input input() for i in range(N) for i in range(N) i range(N) range N for i in range(N) input() input a = [input() for i in range(N)] a [input() for i in range(N)] def smax(N,a):
  smin = a[0]
  smax = -10**9
  for j in range(1,N):
   smax = max(smax,a[j]-smin)
   smin = min(smin,a[j])
  return smax smax smin = a[0] smin a[0] a 0 smax = -10**9 smax -10**9 -10 9 for j in range(1,N):
   smax = max(smax,a[j]-smin)
   smin = min(smin,a[j])
   j range(1,N) range 1 N smax = max(smax,a[j]-smin) smax max(smax,a[j]-smin) max smax a[j]-smin a[j] a j smin smin = min(smin,a[j]) smin min(smin,a[j]) min smin a[j] a j return smax smax N N a a print smax(N,a) smax N a def smax(N,a):
  smin = a[0]
  smax = -10**9
  for j in range(1,N):
   smax = max(smax,a[j]-smin)
   smin = min(smin,a[j])
  return smax def smax(N,a):
  smin = a[0]
  smax = -10**9
  for j in range(1,N):
   smax = max(smax,a[j]-smin)
   smin = min(smin,a[j])
  return smax smax a = [input() for i in range(N)] [input() for i in range(N)] a N = input() input() N
N = input()
a = [input() for i in range(N)]

def smax(N,a):
  smin = a[0]
  smax = -10**9
  for j in range(1,N):
   smax = max(smax,a[j]-smin)
   smin = min(smin,a[j])
  return smax

print smax(N,a)