import Data.List


main = do
    n <- getLine
    as <- map read . words <$> getLine
    putStrLn $ show $ ans as

ans as = foldl1 max diffs
    where
        combs = [(x, y) | (x:rest) <- tails as, y <- rest]
        diffs = map (\p -> abs $ (fst p) - (snd p)) combs
