N = int(input())

price_list = [int(input()) for _ in range(N)]

purchase_price = price_list[0]
profit = price_list[1] - purchase_price
for price in price_list[1:]:
    if profit < price - purchase_price:
        profit = price - purchase_price
    if price < purchase_price:
        purchase_price = price

print(profit) N = int(input()) N int(input()) int input() input int(input()) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) int(input()) int input() input price_list = [int(input()) for _ in range(N)] price_list [int(input()) for _ in range(N)] purchase_price = price_list[0] purchase_price price_list[0] price_list 0 profit = price_list[1] - purchase_price profit price_list[1] - purchase_price price_list[1] price_list 1 purchase_price for price in price_list[1:]:
    if profit < price - purchase_price:
        profit = price - purchase_price
    if price < purchase_price:
        purchase_price = price price price_list[1:] price_list 1: 1 if profit < price - purchase_price:
        profit = price - purchase_price
     profit < price - purchase_price profit price - purchase_price price purchase_price profit = price - purchase_price profit price - purchase_price price purchase_price if price < purchase_price:
        purchase_price = price price < purchase_price price purchase_price purchase_price = price purchase_price price print(profit) print profit N = int(input()) int(input()) N price_list = [int(input()) for _ in range(N)] [int(input()) for _ in range(N)] price_list profit = price - purchase_price price - purchase_price profit profit = price_list[1] - purchase_price price_list[1] - purchase_price profit purchase_price = price price purchase_price purchase_price = price_list[0] price_list[0] purchase_price
N = int(input())

price_list = [int(input()) for _ in range(N)]

purchase_price = price_list[0]
profit = price_list[1] - purchase_price
for price in price_list[1:]:
    if profit < price - purchase_price:
        profit = price - purchase_price
    if price < purchase_price:
        purchase_price = price

print(profit)
