N = int(input())
r = [int(input()) for i in range(N)]
 
min = r[0]
max = -9999999999999999
 
for i in range(1, N):
    if r[i] - min > max:
        max = r[i] - min
    if r[i] < min:
        min = r[i]
 
print(max) N = int(input()) N int(input()) int input() input int(input()) for i in range(N) for i in range(N) i range(N) range N for i in range(N) int(input()) int input() input r = [int(input()) for i in range(N)] r [int(input()) for i in range(N)] min = r[0] min r[0] r 0 max = -9999999999999999 max -9999999999999999 for i in range(1, N):
    if r[i] - min > max:
        max = r[i] - min
    if r[i] < min:
        min = r[i]
  i range(1, N) range 1 N if r[i] - min > max:
        max = r[i] - min
     r[i] - min > max r[i] - min r[i] r i min max max = r[i] - min max r[i] - min r[i] r i min if r[i] < min:
        min = r[i]
  r[i] < min r[i] r i min min = r[i] min r[i] r i print(max) print max r = [int(input()) for i in range(N)] [int(input()) for i in range(N)] r min = r[i] r[i] min max = r[i] - min r[i] - min max N = int(input()) int(input()) N max = -9999999999999999 -9999999999999999 max min = r[0] r[0] min
N = int(input())
r = [int(input()) for i in range(N)]
 
min = r[0]
max = -9999999999999999
 
for i in range(1, N):
    if r[i] - min > max:
        max = r[i] - min
    if r[i] < min:
        min = r[i]
 
print(max)