N = int(input())
R = [int(input()) for i in range(N)]

min_v = R[0]
max_v = R[1] - R[0]
for i in range(1, len(R)):
    if min_v > R[i - 1]:
        min_v = R[i - 1]
    if max_v < R[i] - min_v:
        max_v = R[i] - min_v
print(max_v) 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 R = [int(input()) for i in range(N)] R [int(input()) for i in range(N)] min_v = R[0] min_v R[0] R 0 max_v = R[1] - R[0] max_v R[1] - R[0] R[1] R 1 R[0] R 0 for i in range(1, len(R)):
    if min_v > R[i - 1]:
        min_v = R[i - 1]
    if max_v < R[i] - min_v:
        max_v = R[i] - min_v i range(1, len(R)) range 1 len(R) len R if min_v > R[i - 1]:
        min_v = R[i - 1]
     min_v > R[i - 1] min_v R[i - 1] R i - 1 i 1 min_v = R[i - 1] min_v R[i - 1] R i - 1 i 1 if max_v < R[i] - min_v:
        max_v = R[i] - min_v max_v < R[i] - min_v max_v R[i] - min_v R[i] R i min_v max_v = R[i] - min_v max_v R[i] - min_v R[i] R i min_v print(max_v) print max_v N = int(input()) int(input()) N R = [int(input()) for i in range(N)] [int(input()) for i in range(N)] R min_v = R[0] R[0] min_v max_v = R[1] - R[0] R[1] - R[0] max_v min_v = R[i - 1] R[i - 1] min_v max_v = R[i] - min_v R[i] - min_v max_v
N = int(input())
R = [int(input()) for i in range(N)]

min_v = R[0]
max_v = R[1] - R[0]
for i in range(1, len(R)):
    if min_v > R[i - 1]:
        min_v = R[i - 1]
    if max_v < R[i] - min_v:
        max_v = R[i] - min_v
print(max_v)
