class Program { static void Main(string[] args) { string inputCount = Console.ReadLine()!; string[] inputNum = Console.ReadLine()!.Split(' '); List numList = new List(); int ans = 0; if (inputCount == "1") { Console.WriteLine(0); return; } for (int i = 0; i < inputNum.Length; i++) { numList.Add(int.Parse(inputNum[i])); } numList.Sort(); for (int i = 1; i < numList.Count; i++) { int firstPoint = int.Parse(inputNum[i - 1]); int secondPoint = int.Parse(inputNum[i]); if (i == 1 && secondPoint - firstPoint != 0) { ans = secondPoint - firstPoint; } else if (ans > secondPoint - firstPoint) { ans = secondPoint - firstPoint; } } if (ans <= -1) { ans *= -1; } Console.WriteLine(ans); } }