import java.util.Scanner; class No_135 { public static void main(String args[]) { Scanner stdIn = new Scanner(System.in); int num = stdIn.nextInt(); int vc[] = new int[num]; for (int i = 0; i < num; i++) { vc[i] = stdIn.nextInt(); } System.out.println(vc_Length(vc, num)); } public static int vc_Length(int vc[], int num) { int min = 100000; for (int i = 0; i < num; i++) { for (int k = 0; k < num; k++) { if (i == k) { continue; } if (vc[i] == vc[k]) { continue; } int tmp = Math.abs(vc[i] - vc[k]); if ( tmp > min ) { continue; } else { min = tmp; } } } if (min == 100000) { return 0; } else { return min; } } }