using System; using System.Collections.Generic; using System.Linq; class Program { static void Main(string[] args) { var n = int.Parse(Console.ReadLine()); var list = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray(); var dist = new List(); var abs = 0; for (int i=0; i < n; i++) { for (int j=i+1; j < n; j++) { abs = Math.Abs(list[j] - list[i]); if (abs != 0) dist.Add(abs); } } dist = dist.Distinct().ToList(); Console.WriteLine(dist.Count(x => x == dist.Min()) >= 2 ? 0 : dist.Min()); } }