n = int(raw_input())
max = -(10**9)
x1 = input() 
min = x1

for i in range(n-1):
 x = int(raw_input())

 if max < x-min:
  max = x- min
 if x< min:
  min = x
  
print max n = int(raw_input()) n int(raw_input()) int raw_input() raw_input max = -(10**9) max -(10**9) 10**9 10 9 x1 = input() x1 input() input min = x1 min x1 for i in range(n-1):
 x = int(raw_input())

 if max < x-min:
  max = x- min
 if x< min:
  min = x
   i range(n-1) range n-1 n 1 x = int(raw_input()) x int(raw_input()) int raw_input() raw_input if max < x-min:
  max = x- min
  max < x-min max x-min x min max = x- min max x- min x min if x< min:
  min = x
   x< min x min min = x min x print min = x x min x = int(raw_input()) int(raw_input()) x n = int(raw_input()) int(raw_input()) n max = -(10**9) -(10**9) max min = x1 x1 min max = x- min x- min max x1 = input() input() x1
n = int(raw_input())
max = -(10**9)
x1 = input() 
min = x1

for i in range(n-1):
 x = int(raw_input())

 if max < x-min:
  max = x- min
 if x< min:
  min = x
  
print max