N = input()
d = -999999999
R = input()
for i in range(N-1):
	r = input()
	d = max(d,(r-R))
	R = min(R,r)
print d N = input() N input() input d = -999999999 d -999999999 R = input() R input() input for i in range(N-1):
	r = input()
	d = max(d,(r-R))
	R = min(R,r) i range(N-1) range N-1 N 1 r = input() r input() input d = max(d,(r-R)) d max(d,(r-R)) max d r-R r R R = min(R,r) R min(R,r) min R r print r = input() input() r R = input() input() R d = max(d,(r-R)) max(d,(r-R)) d R = min(R,r) min(R,r) R N = input() input() N d = -999999999 -999999999 d
N = input()
d = -999999999
R = input()
for i in range(N-1):
	r = input()
	d = max(d,(r-R))
	R = min(R,r)
print d