s_max = -float('inf')
s = 0
for i in range(int(input())):
	r = int(input())
	if i:
		d = r - prev
		s = max(s, 0) + d
		s_max = max(s, s_max)
	prev = r
print(s_max) s_max = -float('inf') s_max -float('inf') float('inf') float 'inf' s = 0 s 0 for i in range(int(input())):
	r = int(input())
	if i:
		d = r - prev
		s = max(s, 0) + d
		s_max = max(s, s_max)
	prev = r i range(int(input())) range int(input()) int input() input r = int(input()) r int(input()) int input() input if i:
		d = r - prev
		s = max(s, 0) + d
		s_max = max(s, s_max)
	 i d = r - prev d r - prev r prev s = max(s, 0) + d s max(s, 0) + d max(s, 0) max s 0 d s_max = max(s, s_max) s_max max(s, s_max) max s s_max prev = r prev r print(s_max) print s_max s = max(s, 0) + d max(s, 0) + d s d = r - prev r - prev d s = 0 0 s s_max = max(s, s_max) max(s, s_max) s_max r = int(input()) int(input()) r prev = r r prev s_max = -float('inf') -float('inf') s_max
s_max = -float('inf')
s = 0
for i in range(int(input())):
	r = int(input())
	if i:
		d = r - prev
		s = max(s, 0) + d
		s_max = max(s, s_max)
	prev = r
print(s_max)
