N = int(input())
R = [int(input()) for i in range(N)]

maxv = R[1] - R[0]
minv = R[0]
for i in range(1,len(R)):
    maxv = max(maxv,R[i]-minv)
    minv = min(minv,R[i])

print (maxv) 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)] maxv = R[1] - R[0] maxv R[1] - R[0] R[1] R 1 R[0] R 0 minv = R[0] minv R[0] R 0 for i in range(1,len(R)):
    maxv = max(maxv,R[i]-minv)
    minv = min(minv,R[i]) i range(1,len(R)) range 1 len(R) len R 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 minv = R[0] R[0] minv maxv = max(maxv,R[i]-minv) max(maxv,R[i]-minv) maxv N = int(input()) int(input()) N maxv = R[1] - R[0] R[1] - R[0] maxv minv = min(minv,R[i]) min(minv,R[i]) minv R = [int(input()) for i in range(N)] [int(input()) for i in range(N)] R
N = int(input())
R = [int(input()) for i in range(N)]

maxv = R[1] - R[0]
minv = R[0]
for i in range(1,len(R)):
    maxv = max(maxv,R[i]-minv)
    minv = min(minv,R[i])

print (maxv)