n = int(raw_input())
R_list = [int(raw_input()) for _ in range(n)]

min_R = int(1e10)
ans = -int(1e10)
for R in R_list:
    ans = max(ans, R - min_R)
    min_R = min(min_R, R)

print ans n = int(raw_input()) n int(raw_input()) int raw_input() raw_input int(raw_input()) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) int(raw_input()) int raw_input() raw_input R_list = [int(raw_input()) for _ in range(n)] R_list [int(raw_input()) for _ in range(n)] min_R = int(1e10) min_R int(1e10) int 1e10 ans = -int(1e10) ans -int(1e10) int(1e10) int 1e10 for R in R_list:
    ans = max(ans, R - min_R)
    min_R = min(min_R, R) R R_list ans = max(ans, R - min_R) ans max(ans, R - min_R) max ans R - min_R R min_R min_R = min(min_R, R) min_R min(min_R, R) min min_R R print R_list = [int(raw_input()) for _ in range(n)] [int(raw_input()) for _ in range(n)] R_list ans = -int(1e10) -int(1e10) ans ans = max(ans, R - min_R) max(ans, R - min_R) ans min_R = min(min_R, R) min(min_R, R) min_R n = int(raw_input()) int(raw_input()) n min_R = int(1e10) int(1e10) min_R
n = int(raw_input())
R_list = [int(raw_input()) for _ in range(n)]

min_R = int(1e10)
ans = -int(1e10)
for R in R_list:
    ans = max(ans, R - min_R)
    min_R = min(min_R, R)

print ans