line = int(input())
nums = []
for n in range(line):
    nums.append(int(input()))

# res = nums[1] - nums[0]
# for i in range(line):
#     for j in range(i+1, line):
#         dif = nums[j] - nums[i]
#         res = dif if dif > res else res
maxd = nums[1] - nums[0]
minv = nums[0]

for j in range(1, line):
    maxd = max(maxd, nums[j] - minv)
    minv = min(minv, nums[j])


print(maxd) line = int(input()) line int(input()) int input() input nums = [] nums [] for n in range(line):
    nums.append(int(input()))

# res = nums[1] - nums[0]
# for i in range(line):
#     for j in range(i+1, line):
#         dif = nums[j] - nums[i]
#         res = dif if dif > res else res n range(line) range line nums.append(int(input())) nums.append nums append int(input()) int input() input maxd = nums[1] - nums[0] maxd nums[1] - nums[0] nums[1] nums 1 nums[0] nums 0 minv = nums[0] minv nums[0] nums 0 for j in range(1, line):
    maxd = max(maxd, nums[j] - minv)
    minv = min(minv, nums[j]) j range(1, line) range 1 line maxd = max(maxd, nums[j] - minv) maxd max(maxd, nums[j] - minv) max maxd nums[j] - minv nums[j] nums j minv minv = min(minv, nums[j]) minv min(minv, nums[j]) min minv nums[j] nums j print(maxd) print maxd minv = min(minv, nums[j]) min(minv, nums[j]) minv minv = nums[0] nums[0] minv maxd = max(maxd, nums[j] - minv) max(maxd, nums[j] - minv) maxd maxd = nums[1] - nums[0] nums[1] - nums[0] maxd nums = [] [] nums line = int(input()) int(input()) line
line = int(input())
nums = []
for n in range(line):
    nums.append(int(input()))

# res = nums[1] - nums[0]
# for i in range(line):
#     for j in range(i+1, line):
#         dif = nums[j] - nums[i]
#         res = dif if dif > res else res
maxd = nums[1] - nums[0]
minv = nums[0]

for j in range(1, line):
    maxd = max(maxd, nums[j] - minv)
    minv = min(minv, nums[j])


print(maxd)