import java.util.Arrays; import java.util.Scanner; public class CutSticks { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] arr=new int[n]; for (int i = 0; i < n; i++) arr[i] = sc.nextInt(); Arrays.sort(arr); int min = 2000000000; for (int i = 0; i < n - 1; i++) { if(Math.abs(arr[i]-arr[i+1])<=min) min=Math.abs(arr[i]-arr[i+1]); } System.out.println(min); } }