s_max = -float('inf')
s = 0
for i in range(int(input())):
	r = int(input())
	if i:
		s = max(s, 0) + r - prev
		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:
		s = max(s, 0) + r - prev
		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:
		s = max(s, 0) + r - prev
		s_max = max(s, s_max)
	 i s = max(s, 0) + r - prev s max(s, 0) + r - prev max(s, 0) + r max(s, 0) max s 0 r prev 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 prev = r r prev s = max(s, 0) + r - prev max(s, 0) + r - prev s s_max = -float('inf') -float('inf') s_max s_max = max(s, s_max) max(s, s_max) s_max s = 0 0 s r = int(input()) int(input()) r
s_max = -float('inf')
s = 0
for i in range(int(input())):
	r = int(input())
	if i:
		s = max(s, 0) + r - prev
		s_max = max(s, s_max)
	prev = r
print(s_max)
