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(); } int min = 0; int tmp; for (int i = 0; i < num; i++) { for (int k = 0; k < num; k++) { if (vc[i] == vc[k]) { continue; } if ( min == 0 ) { min = Math.abs(vc[i] - vc[k]); } tmp = Math.abs(vc[i] - vc[k]); if ( tmp < min ) { min = tmp; } } } System.out.println(min); } }