import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { /*public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] a = new int[n]; for(int a_i=0; a_i < n; a_i++){ a[a_i] = in.nextInt(); } // your code goes here int ansArray[] = new int[(n*(n-1)/2)]; //int ans = Math.abs(a[0]-a[1]); int k = 0; for(int i = 0; i < a.length; i++){ for(int j = i+1; j <= a.length-1; j++){ ansArray[k++] = Math.abs(a[i] - a[j]); } } /*if(Math.abs(a[i]-a[j]) < ans){ ans = Math.abs(a[i]-a[j]); } /*int ans = Math.abs(a[0]-a[1]); while(a.length >= 2){ for(int i = 1; i < a.length; i++){ if(Math.abs(a[0]-a[i]) < ans){ ans = Math.abs(a[0]-a[i]); } } int[] newA = new int[a.length-1]; for(int i = 0; i < newA.length; i++){ newA[i] = a[i+1]; } a = newA; }*/ // Arrays.sort(ansArray); //System.out.println(ansArray[0]); // } /*public static int sum(int n){ int ans = 0; for(int i = n; i>=0; --i){ ans += i; } return ans; }*/ public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] a = new int[n]; for(int a_i=0; a_i < n; a_i++){ a[a_i] = in.nextInt(); } // your code goes here int value = Integer.MAX_VALUE; Arrays.sort(a); for(int i=1;i