n = input()

min_val = float("inf")
max_val = -float("inf")
for i in range(n):
  tmp = input()
  max_val = max(max_val, tmp - min_val)
  min_val = min(min_val, tmp)

print max_val n = input() n input() input min_val = float("inf") min_val float("inf") float "inf" max_val = -float("inf") max_val -float("inf") float("inf") float "inf" for i in range(n):
  tmp = input()
  max_val = max(max_val, tmp - min_val)
  min_val = min(min_val, tmp) i range(n) range n tmp = input() tmp input() input max_val = max(max_val, tmp - min_val) max_val max(max_val, tmp - min_val) max max_val tmp - min_val tmp min_val min_val = min(min_val, tmp) min_val min(min_val, tmp) min min_val tmp print n = input() input() n min_val = min(min_val, tmp) min(min_val, tmp) min_val tmp = input() input() tmp max_val = max(max_val, tmp - min_val) max(max_val, tmp - min_val) max_val max_val = -float("inf") -float("inf") max_val min_val = float("inf") float("inf") min_val
n = input()

min_val = float("inf")
max_val = -float("inf")
for i in range(n):
  tmp = input()
  max_val = max(max_val, tmp - min_val)
  min_val = min(min_val, tmp)

print max_val