n = int(input())

R = []

for i in range(0,n):
    R.insert(i, int(input()))

m = min(R[0:2])
MAX = R[1] - R[0]
for r in range(2, n):
    if(R[r-1] < m):
        m = R[r-1]
    MAX2 = R[r] - m
    if(MAX2 > MAX):
        MAX = MAX2

print(MAX) n = int(input()) n int(input()) int input() input R = [] R [] for i in range(0,n):
    R.insert(i, int(input())) i range(0,n) range 0 n R.insert(i, int(input())) R.insert R insert i int(input()) int input() input m = min(R[0:2]) m min(R[0:2]) min R[0:2] R 0:2 0 2 MAX = R[1] - R[0] MAX R[1] - R[0] R[1] R 1 R[0] R 0 for r in range(2, n):
    if(R[r-1] < m):
        m = R[r-1]
    MAX2 = R[r] - m
    if(MAX2 > MAX):
        MAX = MAX2 r range(2, n) range 2 n if(R[r-1] < m):
        m = R[r-1]
     R[r-1] < m R[r-1] R r-1 r 1 m m = R[r-1] m R[r-1] R r-1 r 1 MAX2 = R[r] - m MAX2 R[r] - m R[r] R r m if(MAX2 > MAX):
        MAX = MAX2 MAX2 > MAX MAX2 MAX MAX = MAX2 MAX MAX2 print(MAX) print MAX m = min(R[0:2]) min(R[0:2]) m MAX = MAX2 MAX2 MAX m = R[r-1] R[r-1] m MAX2 = R[r] - m R[r] - m MAX2 R = [] [] R n = int(input()) int(input()) n MAX = R[1] - R[0] R[1] - R[0] MAX
n = int(input())

R = []

for i in range(0,n):
    R.insert(i, int(input()))

m = min(R[0:2])
MAX = R[1] - R[0]
for r in range(2, n):
    if(R[r-1] < m):
        m = R[r-1]
    MAX2 = R[r] - m
    if(MAX2 > MAX):
        MAX = MAX2

print(MAX)