n = input()
minv = input()
maxv = -2000000000 #10**9-10**9
for i in xrange(1, n):
    r = input()
    maxv = max(maxv, r - minv)
    minv = min(minv, r)

print maxv n = input() n input() input minv = input() minv input() input maxv = -2000000000 maxv -2000000000 for i in xrange(1, n):
    r = input()
    maxv = max(maxv, r - minv)
    minv = min(minv, r) i xrange(1, n) xrange 1 n r = input() r input() input maxv = max(maxv, r - minv) maxv max(maxv, r - minv) max maxv r - minv r minv minv = min(minv, r) minv min(minv, r) min minv r print r = input() input() r n = input() input() n maxv = -2000000000 -2000000000 maxv maxv = max(maxv, r - minv) max(maxv, r - minv) maxv minv = min(minv, r) min(minv, r) minv minv = input() input() minv
n = input()
minv = input()
maxv = -2000000000 #10**9-10**9
for i in xrange(1, n):
    r = input()
    maxv = max(maxv, r - minv)
    minv = min(minv, r)

print maxv