main :: IO ()
main = do
    n <- read <$> getLine
    as <- map read . words <$> getLine
    print $ go as n
    return ()

go as n = maximum [abs (as !! x - as !! y) | x <- [0..(n-2)], y <- [(x+1)..(n-1)]]