N = int(input())
input_line = []
for i in range(N):
    input_line.append(int(input()))

maxv = input_line[1] - input_line[0]
minv = input_line[0]
for j in range(1, N):
    maxv = max(maxv, input_line[j] - minv)
    minv = min(minv, input_line[j])
print(maxv) N = int(input()) N int(input()) int input() input input_line = [] input_line [] for i in range(N):
    input_line.append(int(input())) i range(N) range N input_line.append(int(input())) input_line.append input_line append int(input()) int input() input maxv = input_line[1] - input_line[0] maxv input_line[1] - input_line[0] input_line[1] input_line 1 input_line[0] input_line 0 minv = input_line[0] minv input_line[0] input_line 0 for j in range(1, N):
    maxv = max(maxv, input_line[j] - minv)
    minv = min(minv, input_line[j]) j range(1, N) range 1 N maxv = max(maxv, input_line[j] - minv) maxv max(maxv, input_line[j] - minv) max maxv input_line[j] - minv input_line[j] input_line j minv minv = min(minv, input_line[j]) minv min(minv, input_line[j]) min minv input_line[j] input_line j print(maxv) print maxv input_line = [] [] input_line maxv = max(maxv, input_line[j] - minv) max(maxv, input_line[j] - minv) maxv minv = input_line[0] input_line[0] minv maxv = input_line[1] - input_line[0] input_line[1] - input_line[0] maxv N = int(input()) int(input()) N minv = min(minv, input_line[j]) min(minv, input_line[j]) minv
N = int(input())
input_line = []
for i in range(N):
    input_line.append(int(input()))

maxv = input_line[1] - input_line[0]
minv = input_line[0]
for j in range(1, N):
    maxv = max(maxv, input_line[j] - minv)
    minv = min(minv, input_line[j])
print(maxv)