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]; int [] diff = new int[n]; int m=0,k=0,ind=0; for(int a_i=0; a_i < n; a_i++){ a[a_i] = in.nextInt(); } // your code goes here for(int a_i=0; a_i < n-1; a_i++){ for(int a_j=a_i+1; a_j < n; a_j++){ k=a[a_i]-a[a_j]; m = Math.abs(k); diff[ind++]=m; } } int temp; for(int a_i=0; a_i < ind-1; a_i++){ for(int a_j=a_i+1; a_j < ind; a_j++){ if(diff[a_i]>diff[a_j]){ temp = diff[a_i]; diff[a_i]=diff[a_j]; diff[a_j]=diff[a_i]; } } } System.out.println(diff[0]); } }