n = int(input())
r = []
for i in range(n):
    r.append(int(input()))

min_v = r[0]
max_p = -1000000000
for i in range(1,n):
    max_p = max(max_p,r[i]-min_v)
    min_v = min(min_v,r[i])
print(max_p) n = int(input()) n int(input()) int input() input r = [] r [] for i in range(n):
    r.append(int(input())) i range(n) range n r.append(int(input())) r.append r append int(input()) int input() input min_v = r[0] min_v r[0] r 0 max_p = -1000000000 max_p -1000000000 for i in range(1,n):
    max_p = max(max_p,r[i]-min_v)
    min_v = min(min_v,r[i]) i range(1,n) range 1 n max_p = max(max_p,r[i]-min_v) max_p max(max_p,r[i]-min_v) max max_p r[i]-min_v r[i] r i min_v min_v = min(min_v,r[i]) min_v min(min_v,r[i]) min min_v r[i] r i print(max_p) print max_p min_v = r[0] r[0] min_v min_v = min(min_v,r[i]) min(min_v,r[i]) min_v n = int(input()) int(input()) n r = [] [] r max_p = -1000000000 -1000000000 max_p max_p = max(max_p,r[i]-min_v) max(max_p,r[i]-min_v) max_p
n = int(input())
r = []
for i in range(n):
    r.append(int(input()))

min_v = r[0]
max_p = -1000000000
for i in range(1,n):
    max_p = max(max_p,r[i]-min_v)
    min_v = min(min_v,r[i])
print(max_p)