let n = Scanf.scanf " %d" (+) 0
let a_s = Array.init n @@ fun _ -> Scanf.scanf " %d" (+) 0
let ans = ref min_int
let _ = Array.iteri (fun i a -> for j = i + 1 to n - 1 do ans := max !ans @@ abs @@ a - a_s.(j) done) a_s; Printf.printf "%d\n" !ans