n = int(input())
r = []
for i in range(n): r.append(int(input()))
start = r[0]
score = r[1] - r[0]
for i in range(1,n):
  if r[i] - start > score: score = r[i] - start
  if r[i] < start: start = r[i]
print(score) n = int(input()) n int(input()) int input() input r = [] r [] for i in range(n): r.append(int(input())) i range(n) range n start = r[0] start r[0] r 0 score = r[1] - r[0] score r[1] - r[0] r[1] r 1 r[0] r 0 for i in range(1,n):
  if r[i] - start > score: score = r[i] - start
  if r[i] < start: start = r[i] i range(1,n) range 1 n if r[i] - start > score: score = r[i] - start
   r[i] - start > score r[i] - start r[i] r i start score if r[i] < start: start = r[ r[i] < start r[i] r i start print(score) print score r = [] [] r score = r[1] - r[0] r[1] - r[0] score start = r[0] r[0] start n = int(input()) int(input()) n
n = int(input())
r = []
for i in range(n): r.append(int(input()))
start = r[0]
score = r[1] - r[0]
for i in range(1,n):
  if r[i] - start > score: score = r[i] - start
  if r[i] < start: start = r[i]
print(score)