n = int(input())
s = []
for i in range(n):
    s.append(int(input()))
max_s = -10**9
min_s = s[0]
for i in range(1, n):
    max_s = max(max_s, s[i] - min_s)
    min_s = min(min_s, s[i])

print(max_s) n = int(input()) n int(input()) int input() input s = [] s [] for i in range(n):
    s.append(int(input())) i range(n) range n s.append(int(input())) s.append s append int(input()) int input() input max_s = -10**9 max_s -10**9 -10 9 min_s = s[0] min_s s[0] s 0 for i in range(1, n):
    max_s = max(max_s, s[i] - min_s)
    min_s = min(min_s, s[i]) i range(1, n) range 1 n max_s = max(max_s, s[i] - min_s) max_s max(max_s, s[i] - min_s) max max_s s[i] - min_s s[i] s i min_s min_s = min(min_s, s[i]) min_s min(min_s, s[i]) min min_s s[i] s i print(max_s) print max_s n = int(input()) int(input()) n max_s = max(max_s, s[i] - min_s) max(max_s, s[i] - min_s) max_s min_s = min(min_s, s[i]) min(min_s, s[i]) min_s s = [] [] s min_s = s[0] s[0] min_s max_s = -10**9 -10**9 max_s
n = int(input())
s = []
for i in range(n):
    s.append(int(input()))
max_s = -10**9
min_s = s[0]
for i in range(1, n):
    max_s = max(max_s, s[i] - min_s)
    min_s = min(min_s, s[i])

print(max_s)
