import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] x = new int[n]; int ans = 1001001001; for(int i = 0 ; i < n ; i++) x[i] = sc.nextInt(); for(int i = 0 ; i < n ; i++) { for(int j = i + 1 ; j < n ; j++) { if(Math.abs(x[i] - x[j]) != 0) { ans = Math.min(ans, Math.abs(x[i] - x[j])); } } } System.out.println(ans); } }