n = int(input())
R = [0]*n
for i in range(n):
    R[i] = int(input())
    
minv = R[0]
maxv = R[1] - R[0]
for i in range(1,n):
    maxv = max(maxv, R[i] - minv)
    minv = min(minv, R[i])
print(maxv) n = int(input()) n int(input()) int input() input R = [0]*n R [0]*n [0] 0 n for i in range(n):
    R[i] = int(input())
     i range(n) range n R[i] = int(input()) R[i] R i int(input()) int input() input minv = R[0] minv R[0] R 0 maxv = R[1] - R[0] maxv R[1] - R[0] R[1] R 1 R[0] R 0 for i in range(1,n):
    maxv = max(maxv, R[i] - minv)
    minv = min(minv, R[i]) i range(1,n) range 1 n maxv = max(maxv, R[i] - minv) maxv max(maxv, R[i] - minv) max maxv R[i] - minv R[i] R i minv minv = min(minv, R[i]) minv min(minv, R[i]) min minv R[i] R i print(maxv) print maxv maxv = max(maxv, R[i] - minv) max(maxv, R[i] - minv) maxv minv = R[0] R[0] minv minv = min(minv, R[i]) min(minv, R[i]) minv n = int(input()) int(input()) n maxv = R[1] - R[0] R[1] - R[0] maxv R = [0]*n [0]*n R
n = int(input())
R = [0]*n
for i in range(n):
    R[i] = int(input())
    
minv = R[0]
maxv = R[1] - R[0]
for i in range(1,n):
    maxv = max(maxv, R[i] - minv)
    minv = min(minv, R[i])
print(maxv)
