n = int(input())

R = []

for i in range(0,n):
    R.insert(i, int(input()))

maxV = -2000000000  # ????°??????????????????????????¨????????????????
minV = R[0]

for r in range(1, n):
    maxV = max(maxV, R[r] - minV)
    minV = min(minV, R[r])

print(maxV) n = int(input()) n int(input()) int input() input R = [] R [] for i in range(0,n):
    R.insert(i, int(input())) i range(0,n) range 0 n R.insert(i, int(input())) R.insert R insert i int(input()) int input() input maxV = -2000000000 maxV -2000000000 minV = R[0] minV R[0] R 0 for r in range(1, n):
    maxV = max(maxV, R[r] - minV)
    minV = min(minV, R[r]) r range(1, n) range 1 n maxV = max(maxV, R[r] - minV) maxV max(maxV, R[r] - minV) max maxV R[r] - minV R[r] R r minV minV = min(minV, R[r]) minV min(minV, R[r]) min minV R[r] R r print(maxV) print maxV maxV = -2000000000 -2000000000 maxV maxV = max(maxV, R[r] - minV) max(maxV, R[r] - minV) maxV R = [] [] R n = int(input()) int(input()) n minV = R[0] R[0] minV minV = min(minV, R[r]) min(minV, R[r]) minV
n = int(input())

R = []

for i in range(0,n):
    R.insert(i, int(input()))

maxV = -2000000000  # ????°??????????????????????????¨????????????????
minV = R[0]

for r in range(1, n):
    maxV = max(maxV, R[r] - minV)
    minV = min(minV, R[r])

print(maxV)