n = input()
maxv = - 1 * pow(10, 9)
minv = input()
for _ in xrange(1, n):
    Rj = input()
    maxv = max(maxv, Rj - minv)
    minv = min(minv, Rj)

print maxv n = input() n input() input maxv = - 1 * pow(10, 9) maxv - 1 * pow(10, 9) - 1 pow(10, 9) pow 10 9 minv = input() minv input() input for _ in xrange(1, n):
    Rj = input()
    maxv = max(maxv, Rj - minv)
    minv = min(minv, Rj) _ xrange(1, n) xrange 1 n Rj = input() Rj input() input maxv = max(maxv, Rj - minv) maxv max(maxv, Rj - minv) max maxv Rj - minv Rj minv minv = min(minv, Rj) minv min(minv, Rj) min minv Rj print maxv = max(maxv, Rj - minv) max(maxv, Rj - minv) maxv minv = input() input() minv Rj = input() input() Rj n = input() input() n maxv = - 1 * pow(10, 9) - 1 * pow(10, 9) maxv minv = min(minv, Rj) min(minv, Rj) minv
n = input()
maxv = - 1 * pow(10, 9)
minv = input()
for _ in xrange(1, n):
    Rj = input()
    maxv = max(maxv, Rj - minv)
    minv = min(minv, Rj)

print maxv