a=input()
r=[]
for i in range(a):
    k=input()
    r.append(k)
minv=r[0]
maxv=-10**9
for j in range(1,len(r)):
    maxv=max(maxv,r[j]-minv)
    minv=min(minv,r[j])
print maxv a=input() a input() input r=[] r [] for i in range(a):
    k=input()
    r.append(k) i range(a) range a k=input() k input() input r.append(k) r.append r append k minv=r[0] minv r[0] r 0 maxv=-10**9 maxv -10**9 -10 9 for j in range(1,len(r)):
    maxv=max(maxv,r[j]-minv)
    minv=min(minv,r[j]) j range(1,len(r)) range 1 len(r) len r maxv=max(maxv,r[j]-minv) maxv max(maxv,r[j]-minv) max maxv r[j]-minv r[j] r j minv minv=min(minv,r[j]) minv min(minv,r[j]) min minv r[j] r j print k=input() input() k maxv=max(maxv,r[j]-minv) max(maxv,r[j]-minv) maxv r=[] [] r maxv=-10**9 -10**9 maxv minv=min(minv,r[j]) min(minv,r[j]) minv a=input() input() a minv=r[0] r[0] minv
a=input()
r=[]
for i in range(a):
    k=input()
    r.append(k)
minv=r[0]
maxv=-10**9
for j in range(1,len(r)):
    maxv=max(maxv,r[j]-minv)
    minv=min(minv,r[j])
print maxv