n = int(input())
nums = [int(input()) for i in range(n)]
temp = nums[1] - nums[0]
p = nums[0]

for i in nums[1:]:
    if i - p > temp:
        temp = i- p
    if i < p:
        p = i
print(temp) n = int(input()) n int(input()) int input() input int(input()) for i in range(n) for i in range(n) i range(n) range n for i in range(n) int(input()) int input() input nums = [int(input()) for i in range(n)] nums [int(input()) for i in range(n)] temp = nums[1] - nums[0] temp nums[1] - nums[0] nums[1] nums 1 nums[0] nums 0 p = nums[0] p nums[0] nums 0 for i in nums[1:]:
    if i - p > temp:
        temp = i- p
    if i < p:
        p = i i nums[1:] nums 1: 1 if i - p > temp:
        temp = i- p
     i - p > temp i - p i p temp temp = i- p temp i- p i p if i < p:
        p = i i < p i p p = i p i print(temp) print temp temp = nums[1] - nums[0] nums[1] - nums[0] temp n = int(input()) int(input()) n p = i i p nums = [int(input()) for i in range(n)] [int(input()) for i in range(n)] nums p = nums[0] nums[0] p temp = i- p i- p temp
n = int(input())
nums = [int(input()) for i in range(n)]
temp = nums[1] - nums[0]
p = nums[0]

for i in nums[1:]:
    if i - p > temp:
        temp = i- p
    if i < p:
        p = i
print(temp)