n = int(raw_input())
a = []
a.append(int(raw_input()))
Min = a[0]
Max = -1*10**9
for j in range(1,n):
    a.append(int(raw_input()))
    Max = max(Max,a[j]-Min)
    Min = min(Min,a[j])
print Max n = int(raw_input()) n int(raw_input()) int raw_input() raw_input a = [] a [] a.append(int(raw_input())) a.append a append int(raw_input()) int raw_input() raw_input Min = a[0] Min a[0] a 0 Max = -1*10**9 Max -1*10**9 -1 10**9 10 9 for j in range(1,n):
    a.append(int(raw_input()))
    Max = max(Max,a[j]-Min)
    Min = min(Min,a[j]) j range(1,n) range 1 n a.append(int(raw_input())) a.append a append int(raw_input()) int raw_input() raw_input Max = max(Max,a[j]-Min) Max max(Max,a[j]-Min) max Max a[j]-Min a[j] a j Min Min = min(Min,a[j]) Min min(Min,a[j]) min Min a[j] a j print Max = max(Max,a[j]-Min) max(Max,a[j]-Min) Max Max = -1*10**9 -1*10**9 Max Min = min(Min,a[j]) min(Min,a[j]) Min n = int(raw_input()) int(raw_input()) n Min = a[0] a[0] Min a = [] [] a
n = int(raw_input())
a = []
a.append(int(raw_input()))
Min = a[0]
Max = -1*10**9
for j in range(1,n):
    a.append(int(raw_input()))
    Max = max(Max,a[j]-Min)
    Min = min(Min,a[j])
print Max