import java.util.Arrays; import java.util.Scanner; public class No135 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] x = new int[n]; // 全ての地点を配列に格納 for(int i = 0; i < n; i++){ x[i] = sc.nextInt(); } sc.close(); // 地点を昇順にソート Arrays.sort(x); int min = 9999999; for(int i = 0; i < (n - 1); i++){ if((x[i] != x[i + 1]) && (x[i + 1] - x[i]) < min){ min = x[i + 1] - x[i]; } } if(min == 9999999){ min = 0; } System.out.println(min); } }