N = input()
nums = []
for i in range(N):
     nums.append(input())
profit = nums[1] - nums[0]
min = nums[0]
for a in range(1, N):
     if nums[a] - min > profit:
          profit = nums[a] - min

     if nums[a] < min:
               min = nums[a]
print profit N = input() N input() input nums = [] nums [] for i in range(N):
     nums.append(input()) i range(N) range N nums.append(input()) nums.append nums append input() input profit = nums[1] - nums[0] profit nums[1] - nums[0] nums[1] nums 1 nums[0] nums 0 min = nums[0] min nums[0] nums 0 for a in range(1, N):
     if nums[a] - min > profit:
          profit = nums[a] - min

     if nums[a] < min:
               min = nums[a] a range(1, N) range 1 N if nums[a] - min > profit:
          profit = nums[a] - min

      nums[a] - min > profit nums[a] - min nums[a] nums a min profit profit = nums[a] - min profit nums[a] - min nums[a] nums a min if nums[a] < min:
               min = nums[a] nums[a] < min nums[a] nums a min min = nums[a] min nums[a] nums a print min = nums[a] nums[a] min profit = nums[1] - nums[0] nums[1] - nums[0] profit nums = [] [] nums profit = nums[a] - min nums[a] - min profit min = nums[0] nums[0] min N = input() input() N
N = input()
nums = []
for i in range(N):
     nums.append(input())
profit = nums[1] - nums[0]
min = nums[0]
for a in range(1, N):
     if nums[a] - min > profit:
          profit = nums[a] - min

     if nums[a] < min:
               min = nums[a]
print profit