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 = -1; int tmp = 0; boolean flag = false; for (int j = 0; j <= num - 2; j++) { if ( x_axis[j] == x_axis[j+1]) { continue; } if ( ! flag ) { min = Math.abs(x_axis[j] - x_axis[j+1]); flag = true; } else { tmp = Math.abs(x_axis[j] - x_axis[j+1]); } if (tmp <= min && min != -1) { min = tmp; } else { min = tmp; } } if ( ! flag ) { System.out.println(0); } else { System.out.println(min); } } }