n = input()
R = []
for i in range(n):
   R.append(int(raw_input()))

maxv = R[1] - R[0]
minv = R[0]

for v in range(1, n):
   if minv > R[v]:
      minv = R[v]
   elif maxv < R[v] - minv:
      maxv = R[v] - minv
print maxv    n = input() n input() input R = [] R [] for i in range(n):
   R.append(int(raw_input())) i range(n) range n R.append(int(raw_input())) R.append R append int(raw_input()) int raw_input() raw_input maxv = R[1] - R[0] maxv R[1] - R[0] R[1] R 1 R[0] R 0 minv = R[0] minv R[0] R 0 for v in range(1, n):
   if minv > R[v]:
      minv = R[v]
   elif maxv < R[v] - minv:
      maxv = R[v] - minv v range(1, n) range 1 n if minv > R[v]:
      minv = R[v]
   elif maxv < R[v] - minv:
      maxv = R[v] - minv minv > R[v] minv R[v] R v minv = R[v] minv R[v] R v elif maxv < R[v] - minv:
      maxv = R[v] - minv maxv < R[v] - minv maxv R[v] - minv R[v] R v minv maxv = R[v] - minv maxv R[v] - minv R[v] R v minv print n = input() input() n minv = R[v] R[v] minv R = [] [] R minv = R[0] R[0] minv maxv = R[1] - R[0] R[1] - R[0] maxv maxv = R[v] - minv R[v] - minv maxv
n = input()
R = []
for i in range(n):
   R.append(int(raw_input()))

maxv = R[1] - R[0]
minv = R[0]

for v in range(1, n):
   if minv > R[v]:
      minv = R[v]
   elif maxv < R[v] - minv:
      maxv = R[v] - minv
print maxv   