let N = stdin.ReadLine() |> int let s = stdin.ReadLine().Split(' ') |> Seq.map int |> Set.ofSeq if s.Count <= 1 then 0 else s |> Seq.pairwise |> Seq.map (fun (a,b) -> abs(a-b)) |> Seq.min |> printfn "%d"