-- | Main entry point to the application.
module Main where
 
import Control.Applicative
import Control.Monad
import Data.List
import Debug.Trace
import Text.Printf
import Data.Array

zipWith' f l1 l2 = [ f e1 e2 | (e1, e2) <- zipWith k l1 l2 ]
            where
                k x y = x `seq` y `seq` (x,y)

solve :: [Int] -> Int
solve ns = maximum $ zipWith' (-) (tail ns) $ scanl1 min ns

-- | The main entry point.
main :: IO ()
main = do
    -- _ <- getLine
    -- ns <- concatMap (fmap (read :: String -> Int) . words) . lines <$> getContents
    -- let ns = [5,3,1,3,4,3]
    let ns = [1..200000]
    putStrLn $ show $ solve ns