m = int(input())
n = [int(input())for i in range(m)]

minv = n[0]
maxv = -99999999999

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

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

minv = n[0]
maxv = -99999999999

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

print(maxv)