import java.util.Scanner; import java.util.Arrays; class No_135 { public static void main(String args[]) { Scanner stdIn = new Scanner(System.in); int num = stdIn.nextInt(); int x_axis[] = new int[num]; for (int i = 0; i < num; i++) { x_axis[i] = stdIn.nextInt(); } Arrays.sort(x_axis); int min = 10000000; int tmp; for (int j = 0; j <= num - 2; j++) { if ( x_axis[j] == x_axis[j+1]) { continue; } tmp = Math.abs(x_axis[j] - x_axis[j+1]); if ( tmp <= min ) { min = tmp; } } if ( min == 1000000 ) { System.out.println(0); } else { System.out.println(min); } } }