let n = Scanf.scanf " %d" (+) 0
let a_s = Array.init n @@ fun _ -> Scanf.scanf " %d" (+) 0
let _ = Array.(fold_left (fun m a -> fold_left (fun m b -> max m @@ abs @@ a - b) m a_s) 0 a_s) |> Printf.printf "%d\n"