N = input()
a = [input() for i in range(N)]

maxv = a[-1] - a[0]
minv = a[0]

for i in range(1,N):
    maxv = max(maxv,a[i]-minv)
    minv = min(minv,a[i])

print maxv N = input() N input() input input() for i in range(N) for i in range(N) i range(N) range N for i in range(N) input() input a = [input() for i in range(N)] a [input() for i in range(N)] maxv = a[-1] - a[0] maxv a[-1] - a[0] a[-1] a -1 a[0] a 0 minv = a[0] minv a[0] a 0 for i in range(1,N):
    maxv = max(maxv,a[i]-minv)
    minv = min(minv,a[i]) i range(1,N) range 1 N maxv = max(maxv,a[i]-minv) maxv max(maxv,a[i]-minv) max maxv a[i]-minv a[i] a i minv minv = min(minv,a[i]) minv min(minv,a[i]) min minv a[i] a i print a = [input() for i in range(N)] [input() for i in range(N)] a minv = a[0] a[0] minv maxv = max(maxv,a[i]-minv) max(maxv,a[i]-minv) maxv N = input() input() N maxv = a[-1] - a[0] a[-1] - a[0] maxv minv = min(minv,a[i]) min(minv,a[i]) minv
N = input()
a = [input() for i in range(N)]

maxv = a[-1] - a[0]
minv = a[0]

for i in range(1,N):
    maxv = max(maxv,a[i]-minv)
    minv = min(minv,a[i])

print maxv